Procházet zdrojové kódy

Merge branch 'test'

zhaoxian před 2 roky
rodič
revize
6489383c39

+ 3 - 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java

@@ -252,6 +252,9 @@ public class ShiroConfig {
         //filterChainDefinitionMap.put("/ctop/materialInfo/**", "anon");
         filterChainDefinitionMap.put("/summary/report/**", "anon");
         filterChainDefinitionMap.put("/duxiaoman/materialInfo/**", "anon");
+        filterChainDefinitionMap.put("/ctop/byteDance/videoReport/**", "anon");
+
+        filterChainDefinitionMap.put("/designer/**", "anon");
 
         // 添加自己的过滤器并且取名为jwt
         Map<String, Filter> filterMap = new HashMap<>(1);

+ 27 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaiShouAccountReportServiceImpl.java

@@ -73,6 +73,7 @@ public class KuaiShouAccountReportServiceImpl implements IKuaiShouAccountReportS
             }
             List<JSONObject> afterDis = this.countDiscountCost(mediaId, discount, after);
             List<JSONObject> beforeDis = this.countDiscountCost(mediaId, discount, before);
+            completionTime(beforeDis);
             result = LinkUtils.getCompareDate(beforeDis, afterDis, "statHour");
         } else {
             List<JSONObject> after;
@@ -181,6 +182,32 @@ public class KuaiShouAccountReportServiceImpl implements IKuaiShouAccountReportS
         return result;
     }
 
+    /**
+     * 补全时辰
+     */
+    private void completionTime(List<JSONObject> dataList) {
+        List<Integer> newDayList = new ArrayList<>();
+        for (JSONObject data : dataList) {
+            newDayList.add(data.getInteger("statHour"));
+        }
+        List<Integer> dayList = new ArrayList<>();
+        for (int i = 0; i < 23; i++) {
+            dayList.add(i);
+        }
+        for (Integer hour : dayList) {
+            if (!newDayList.contains(hour)) {
+                JSONObject obj = new JSONObject();
+                obj.put("statHour", hour);
+                obj.put("cost", 0);
+                obj.put("photoShow", 0);
+                obj.put("photoClick", 0);
+                obj.put("aClick", 0);
+                obj.put("discountCost", 0);
+                dataList.add(obj);
+            }
+        }
+    }
+
     //计算折后消耗
     private List<JSONObject> countDiscountCost(String mediaId, BigDecimal discount, List<JSONObject> data) {
         if (data.isEmpty()) {