فهرست منبع

release of '素材大盘' on 2021.3.22

jiequan.bi 4 سال پیش
والد
کامیت
8e48d3a3c6

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -191,6 +191,7 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/explore/*", "anon");
         filterChainDefinitionMap.put("/ai/batchUpdate/*", "anon");
         filterChainDefinitionMap.put("/ctop/kuaishou/videoReport/*", "anon");
+        filterChainDefinitionMap.put("/overView/*", "anon");
 
         // 添加自己的过滤器并且取名为jwt
         Map<String, Filter> filterMap = new HashMap<>(1);

+ 13 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/MaterialReportOverViewServiceImpl.java

@@ -4,7 +4,6 @@ import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.common.module.utils.ExportExcelUtils;
 import cn.com.ctop.common.module.utils.HttpUtils;
-import cn.com.ctop.kuaishou.modules.utils.LinkUtils;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
@@ -27,6 +26,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.text.ParseException;
 import java.util.*;
 
@@ -91,7 +91,7 @@ public class MaterialReportOverViewServiceImpl implements IMaterialReportOverVie
             BigDecimal cost = materialReportOverViewMapper.queryBytedanceCost(startDate, endDate, projects);
             BigDecimal lastCost = materialReportOverViewMapper.queryBytedanceCost(DateUtils.addDay(startDate, -DateUtils.dateDiff(startDate, endDate)-1), DateUtils.addDay(startDate, -1), projects);
             result.put("cost", cost);
-            result.put("costLink", LinkUtils.countLink(cost == null ? BigDecimal.ZERO : cost, lastCost == null ? BigDecimal.ZERO : lastCost));
+            result.put("costLink", countLink(cost == null ? BigDecimal.ZERO : cost, lastCost == null ? BigDecimal.ZERO : lastCost));
             result.put("video", materialReportOverViewMapper.queryMaterialCount(startDate, endDate, projects));
             result.put("newVideo", materialReportOverViewMapper.queryNewMaterialCount(DateUtils.date2Str(), projects));
             result.put("hot", 0);
@@ -100,7 +100,7 @@ public class MaterialReportOverViewServiceImpl implements IMaterialReportOverVie
             BigDecimal cost = materialReportOverViewMapper.queryKuaishouCost(startDate, endDate, projects);
             BigDecimal lastCost = materialReportOverViewMapper.queryKuaishouCost(DateUtils.addDay(startDate, -DateUtils.dateDiff(startDate, endDate)-1), DateUtils.addDay(startDate, -1), projects);
             result.put("cost", cost);
-            result.put("costLink", LinkUtils.countLink(cost == null ? BigDecimal.ZERO : cost, lastCost == null ? BigDecimal.ZERO : lastCost));
+            result.put("costLink", countLink(cost == null ? BigDecimal.ZERO : cost, lastCost == null ? BigDecimal.ZERO : lastCost));
             result.put("video", materialReportOverViewMapper.queryMaterialCount(startDate, endDate, projects));
             result.put("newVideo", materialReportOverViewMapper.queryNewMaterialCount(DateUtils.date2Str(), projects));
             result.put("hot", 0);
@@ -383,4 +383,14 @@ public class MaterialReportOverViewServiceImpl implements IMaterialReportOverVie
         }
         return titles;
     }
+
+    //环比计算
+    public  BigDecimal countLink(BigDecimal numA, BigDecimal numB) {
+        BigDecimal link = new BigDecimal(0);
+        if (numB.compareTo(BigDecimal.ZERO)!=0) {
+            link = (numA.subtract(numB)).divide(numB, 4, RoundingMode.HALF_UP);
+        }
+        return link;
+    }
+
 }

+ 9 - 3
jeecg-boot-module-system/src/main/resources/application-test.yml

@@ -101,6 +101,12 @@ spring:
           username: hcst
           password: hcst@2020
           driver-class-name: com.mysql.jdbc.Driver
+#      datasource:
+#        master:
+#          url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true
+#          username: data
+#          password: hcst@2021
+#          driver-class-name: com.mysql.jdbc.Driver
   #redis 配置
   redis:
     database: 0
@@ -125,9 +131,9 @@ mybatis-plus:
       id-type: 4
       # 默认数据库表下划线命名
       table-underline: true
-  #  configuration:
-  #    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
-  #  map-underscore-to-camel-case: false
+    configuration:
+      log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+    map-underscore-to-camel-case: false
   #分页pageHelper
 pagehelper:
   helper-dialect: mysql