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