Browse Source

add data cache on 2020.6.10

jiequan.bi 5 years ago
parent
commit
083ff68fb9

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceAccountReportServiceImpl.java

@@ -56,11 +56,11 @@ public class BytedanceAccountReportServiceImpl implements IBytedanceAccountRepor
         String filedAll = JsonResourceUtil.joinAllFiled();
         if (startDate.equals(endDate)) {
             List<JSONObject> after = bytedanceAccountReportMapper.queryTodayDetailReportBy(filedAll, startDate, accounts);
-            if(after==null){
+            List<JSONObject> before = bytedanceAccountReportMapper.queryTodayDetailReportBy(filedAll, DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, startDate, -1), accounts);
+            if(after==null||before==null){
                 return result;
             }
             List<JSONObject> afterDis = this.countDiscountCost(mediaId, discount, after);
-            List<JSONObject> before = bytedanceAccountReportMapper.queryTodayDetailReportBy(filedAll, DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd, startDate, -1), accounts);
             List<JSONObject> beforeDis = this.countDiscountCost(mediaId, discount, before);
             result = LinkUtils.getCompareDate(beforeDis, afterDis, "statHour");
         } else {