ccj 2 年 前
コミット
a773cc8f71

+ 10 - 4
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/BiInfoController.java

@@ -138,10 +138,14 @@ public class BiInfoController {
      */
     @GetMapping("/selectBiInfoNew")
     public List<BiViewInfo> selectBiInfoNew(String compId, String seachMoth) {
-            List<BiViewInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_BI_INFO, BiViewInfo.class);
+        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+            List<BiViewInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_BI_INFO+userId, BiViewInfo.class);
             if (listRedis != null && listRedis.size() > 0) {
                 return listRedis;
-            }
+            } 
+        }
+
         companyId = compId;
         List<BiViewInfo> biViewInfos = new ArrayList<>();
         // 车辆
@@ -187,8 +191,10 @@ public class BiInfoController {
         getBuyInfo(contractManagementInfos, biViewInfos);
         // 收入支出毛利润
         getMoney(biViewInfos, seachMoth);
-
-        cacheComponent.putRaw(Const.ADMIN_BI_INFO, JSONObject.toJSONString(biViewInfos), 60 * 20);
+        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+            cacheComponent.putRaw(Const.ADMIN_BI_INFO+userId, JSONObject.toJSONString(biViewInfos), 60 * 20);
+        }
         return biViewInfos;
     }