瀏覽代碼

Merge remote-tracking branch 'origin/ScrmStores' into ScrmStores

yjwang 1 天之前
父節點
當前提交
e324423892

+ 20 - 11
fs-admin/src/main/java/com/fs/api/controller/IndexStatisticsController.java

@@ -156,6 +156,8 @@ public class IndexStatisticsController {
             Long[] companyIds = companyService.selectCompanyList(company).stream().map(Company::getCompanyId).toArray(Long[]::new);
             for(Long companyId : companyIds){
                 ConsumptionBalanceDataDTO clildDTO = redisCache.getCacheObject(String.format("%s:%d",DATA_OVERVIEW_DEALER_BALANCE,companyId));
+                //判断缓存是否为空
+                if (clildDTO != null) {
                 consumptionBalanceDataDTO.setBalance(
                     (consumptionBalanceDataDTO.getBalance() == null ? BigDecimal.ZERO : consumptionBalanceDataDTO.getBalance())
                     .add(clildDTO.getBalance() == null ? BigDecimal.ZERO : clildDTO.getBalance())
@@ -169,6 +171,7 @@ public class IndexStatisticsController {
                     .add(clildDTO.getYesterdayComsumption() == null ? BigDecimal.ZERO : clildDTO.getYesterdayComsumption())
                 );
             }
+                }
         }
 
         return R.ok().put("data", consumptionBalanceDataDTO);
@@ -763,11 +766,14 @@ public class IndexStatisticsController {
             List<Integer> payPriceList = new ArrayList<>();
             for(Long companyId : companyIds) {
                 R result = redisCache.getCacheObject(String.format("%s:%d", THIS_MONTH_ORDER_COUNT, companyId));
-                Object datas = result.get("datas");
-                Object orderCount = result.get("orderCount");
-                Object payPrice = result.get("payPrice");
-                if(datas != null){
-                    mergeDataListsForInteger(datesList, orderCountList, payPriceList, (List<String>)datas, (List<Integer>)orderCount, (List<Integer>)payPrice);
+                //缓存判断
+                if (result != null) {
+                    Object datas = result.get("datas");
+                    Object orderCount = result.get("orderCount");
+                    Object payPrice = result.get("payPrice");
+                    if(datas != null){
+                        mergeDataListsForInteger(datesList, orderCountList, payPriceList, (List<String>)datas, (List<Integer>)orderCount, (List<Integer>)payPrice);
+                    }
                 }
             }
             return R.ok().put("dates", datesList).put("orderCount", orderCountList).put("payPrice", payPriceList);
@@ -796,12 +802,15 @@ public class IndexStatisticsController {
             List<Float> payMoneyList = new ArrayList<>();
             for(Long companyId : companyIds) {
                R result = redisCache.getCacheObject(String.format("%s:%d", THIS_MONTH_RECV_COUNT, companyId));
-               Object datas = result.get("datas");
-               Object orderCount = result.get("orderCount");
-               Object payMoney = result.get("payMoney");
-               if(datas != null){
-                   mergeDataLists(datesList, orderCountList, payMoneyList, (List<String>)datas, (List<Integer>)orderCount, (List<Float>)payMoney);
-               }
+               //判断缓存为空
+              if (result!=null){
+                  Object datas = result.get("datas");
+                  Object orderCount = result.get("orderCount");
+                  Object payMoney = result.get("payMoney");
+                  if(datas != null){
+                      mergeDataLists(datesList, orderCountList, payMoneyList, (List<String>)datas, (List<Integer>)orderCount, (List<Float>)payMoney);
+                  }
+              }
             }
             return R.ok().put("dates", datesList).put("orderCount", orderCountList).put("payMoney", payMoneyList);
         }

+ 2 - 0
fs-service/src/main/resources/mapper/company/CompanyUserMapper.xml

@@ -63,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="qrCodeWecom" column="qr_code_wecom"/>
         <result property="jpushId" column="jpush_id"/>
         <result property="callerNo" column="caller_no"/>
+        <result property="isAllowedAllRegister" column="is_allowed_all_register"/>
         <collection property="roleNames" ofType="java.lang.String" javaType="java.util.ArrayList">
             <result column="role_name"/>
         </collection>
@@ -91,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         u.qw_status, u.phonenumber, u.create_time, u.dept_id,
         u.qr_code_weixin, u.user_type, u.qr_code_wecom, u.jpush_id,
         u.avatar,
+        u.is_allowed_all_register,
         d.dept_name,
         d.leader,
         cr.role_name as role_name