浏览代码

Merge remote-tracking branch 'origin/master'

zhaoxian 4 年之前
父节点
当前提交
0929435a5f

+ 5 - 0
jeecg-boot-module-system/pom.xml

@@ -161,6 +161,8 @@
             <groupId>cn.com.ctop</groupId>
             <artifactId>opencv</artifactId>
             <version>4.2.0</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/src/main/resources/lib/opencv-4.2.0.jar</systemPath>
         </dependency>
         <dependency>
             <groupId>com.github.pagehelper</groupId>
@@ -208,6 +210,9 @@
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <includeSystemScope>true</includeSystemScope>
+                </configuration>
             </plugin>
         </plugins>
         <resources>

+ 0 - 1
jeecg-boot-module-system/src/main/resources/application.yml

@@ -1,6 +1,5 @@
 spring:
   profiles:
-    # active: wps
     active: @activatedProperties@
 swagger:
   production: false

二进制
jeecg-boot-module-system/src/main/resources/lib/opencv-4.2.0.jar


+ 0 - 1
jeecg-boot-module-system/src/main/resources/static/demo1.html

@@ -1 +0,0 @@
-demo1

+ 24 - 22
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -6,8 +6,8 @@ import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
-import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouAccountMaterialReportDaily;
 import cn.com.ctop.kuaishou.modules.report.mapper.EtlKuaishouAccountMaterialReportDailyMapper;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaishouAccountMaterialReportDailyService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyImageService;
 import cn.com.ctop.oa.modules.service.IWechatNoListService;
 import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
@@ -76,19 +76,23 @@ public class SampleTest {
     private IBytedanceReportService bytedanceReportService;
     @Autowired
     private IETLReportBytedanceVideoService etlReportBytedanceVideoService;
+    @Autowired
+    private IEtlKuaishouAccountMaterialReportDailyService materialReportDailyService;
 
     @Test
     public void loadKuaishouCookie() throws ParseException {
-        CtopOauthToken tokenByAccountId = tokenService.getTokenByAccountId(1700996735138951L);
-        advertiserDataService.getMaterialList(tokenByAccountId);
 
-        CtopOauthToken tokenByAccountId1 = tokenService.getTokenByAccountId(1700996735589383L);
-        advertiserDataService.getMaterialList(tokenByAccountId1);
+        Date startDate = new Date();
+        for (int i = 1; i <= 2; i++) {
+            if (i == 1) {
+                continue;
+            }
+            System.err.println(DateUtils.addDay(new Date(), -i));
+            materialReportDailyService.etlKuaishouAccountMaterialReportInfo(DateUtils.formatDate(DateUtils.addDay(new Date(), -i)));
+        }
     }
 
 
-
-
     @Test
     public void deleteKuaishouComment() {
         Long start = System.currentTimeMillis();
@@ -123,7 +127,6 @@ public class SampleTest {
     }
 
 
-
     @Test
     public void etlBytedanceVideoInfo() {
         String startDate = "2021-02-01";
@@ -147,7 +150,6 @@ public class SampleTest {
     }
 
 
-
     @Test
     public void formatVideoReportData() {
         for (int i = 1; i < 45; i++) {
@@ -192,35 +194,35 @@ public class SampleTest {
     }
 
     @Test
-    public void checkCostData(){
+    public void checkCostData() {
         String date = "2021-06-11";
-        for (int i=0;i<7;i++){
-            String getDate = DateUtils.addDay(date,i);
+        for (int i = 0; i < 7; i++) {
+            String getDate = DateUtils.addDay(date, i);
             //1:初始化
             checkReportTaskInfoService.initTask(getDate);
             //2: checkCost
-            List<BytedanceCheckReportTaskInfo>taskInfos = checkReportTaskInfoService.getListByParams(null,getDate,0);
-            if(null!=taskInfos&&!taskInfos.isEmpty()){
-                for (BytedanceCheckReportTaskInfo task:taskInfos) {
+            List<BytedanceCheckReportTaskInfo> taskInfos = checkReportTaskInfoService.getListByParams(null, getDate, 0);
+            if (null != taskInfos && !taskInfos.isEmpty()) {
+                for (BytedanceCheckReportTaskInfo task : taskInfos) {
                     checkReportTaskInfoService.checkCost(task);
                 }
-                log.info("{}:数据获取完成",getDate);
+                log.info("{}:数据获取完成", getDate);
             }
         }
     }
 
     @Test
-    public void refreshReportData()throws Exception{
+    public void refreshReportData() throws Exception {
         //1:查询异常任务数据
-        List<BytedanceCheckReportTaskInfo>taskInfos = checkReportTaskInfoService.getListByParams(null,null,50001);
-        if(null!=taskInfos&&!taskInfos.isEmpty()){
+        List<BytedanceCheckReportTaskInfo> taskInfos = checkReportTaskInfoService.getListByParams(null, null, 50001);
+        if (null != taskInfos && !taskInfos.isEmpty()) {
             countDownLatch = new CountDownLatch(taskInfos.size());
             taskInfos.forEach(taskInfo -> {
                 try {
                     checkReportTaskInfoService.reloadData(taskInfo);
                     checkReportTaskInfoService.checkCost(taskInfo);
-                }catch (Exception e){
-                }finally {
+                } catch (Exception e) {
+                } finally {
                     countDownLatch.countDown();
                 }
             });
@@ -230,7 +232,7 @@ public class SampleTest {
     }
 
     @Test
-    public void testfreshBytedanceUrl(){
+    public void testfreshBytedanceUrl() {
         etlReportBytedanceVideoService.etlBytedanceVideoClipIdJob();
         etlReportBytedanceVideoService.etlBytedanceVideoPlanInfoJob();
         etlReportBytedanceVideoService.etlBytedanceVideoShotInfoJob();

+ 2 - 13
module-common/pom.xml

@@ -29,6 +29,8 @@
             <groupId>thirtpart</groupId>
             <artifactId>jave</artifactId>
             <version>1.0</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/src/main/resources/lib/jave-1.0.jar</systemPath>
         </dependency>
         <dependency>
             <groupId>junit</groupId>
@@ -106,19 +108,6 @@
 
     <build>
         <resources>
-            <resource>
-                <directory>lib</directory>
-                <targetPath>BOOT-INF/lib/</targetPath>
-                <includes>
-                    <include>**/*.jar</include>
-                </includes>
-            </resource>
-            <resource>
-                <directory>src/main/resources</directory>
-                <targetPath>BOOT-INF/classes/</targetPath>
-            </resource>
-
-
             <!-- 解决MyBatis配置文件引入问题 -->
             <resource>
                 <directory>src/main/java</directory>

+ 2 - 2
module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialInfoService.java

@@ -31,7 +31,7 @@ public interface IMaterialInfoService extends IService<MaterialInfo> {
 
     MaterialInfo getMaterialInfoByCode(String code);
 
-    Map<String, Object> checkMaterialInfo(String code, Long productId);
+    Map<String, Object> checkMaterialInfo(String code, Long projectId);
 
     Map<String, Object> insert(JSONObject jsonObject);
 
@@ -78,7 +78,7 @@ public interface IMaterialInfoService extends IService<MaterialInfo> {
 
     List<MaterialInfo> getListByDate(String startDate, String endDate);
 
-    Map<String, Object> getListByParams(String tagCode, String type, Integer status, List<Long> projectIds, String materialName, String code, String startDate, String endDate, String userId, Long projectId, String clipId, String shotId, String planId,Integer offlineFlag, Integer pageNo, Integer pageSize);
+    Map<String, Object> getListByParams(String tagCode, String type, Integer status, List<Long> projectIds, String materialName, String code, String startDate, String endDate, String userId, Long projectId, String clipId, String shotId, String planId, Integer offlineFlag, Integer pageNo, Integer pageSize);
 
     JSONArray getIdListByProject(Long projectId);
 }

+ 4 - 4
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java

@@ -170,10 +170,10 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
 
 
     @Override
-    public MaterialInfo getMaterialInfoByCodeAndProductId(String code, Long productId) {
+    public MaterialInfo getMaterialInfoByCodeAndProductId(String code, Long projectId) {
         QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("code", code);
-        queryWrapper.eq("product_id", productId);
+        queryWrapper.eq("project_id", projectId);
         queryWrapper.orderByDesc("id").last("limit 1");
         return this.getOne(queryWrapper);
     }
@@ -188,9 +188,9 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
     }
 
     @Override
-    public Map<String, Object> checkMaterialInfo(String code, Long productId) {
+    public Map<String, Object> checkMaterialInfo(String code, Long projectId) {
         Map<String, Object> result = new HashMap<>();
-        MaterialInfo info = this.getMaterialInfoByCodeAndProductId(code, productId);
+        MaterialInfo info = this.getMaterialInfoByCodeAndProductId(code, projectId);
         if (null != info) {
             //文件已存在
             ResultMapUtils.setResultMap(result, StatusCode.FILE_HAS_UPLOAD.getCode());

二进制
module-common/src/main/resources/lib/jave-1.0.jar


+ 9 - 3
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyCampaignReportLoadJob.java

@@ -29,14 +29,20 @@ public class KuaishouDailyCampaignReportLoadJob {
 
     @XxlJob("kuaishouDailyCampaignReport")
     public void execute() throws Exception {
-        Date getDate = DateUtils.addDay(new Date(), -1);
+        Date getDate = DateUtils.addDay(new Date(), -2);
+        Date endDate = DateUtils.addDay(new Date(), -1);
         //1:查询当日数据
         List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        if (null == tokens || tokens.size() <= 0) {
+        if (null == tokens || tokens.isEmpty()) {
             XxlJobHelper.log("定时获取快手数据异常:未获取到可用的token");
             XxlJobHelper.handleFail();
             return;
         }
-        tokens.forEach(token -> executorService.submit(() -> kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getDate, getDate)));
+
+        tokens.forEach(token -> executorService.submit(() -> kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getDate, endDate)));
     }
+
+
+
+
 }

+ 4 - 3
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyGroupReportLoadJob.java

@@ -25,11 +25,12 @@ public class KuaishouDailyGroupReportLoadJob {
     private ICtopOauthTokenService tokenService;
     @Autowired
     private IKuaishouReportDailyGroupService reportDailyGroupService;
-    static ExecutorService executorService = Executors.newFixedThreadPool(3);
+    static ExecutorService executorService = Executors.newFixedThreadPool(5);
 
     @XxlJob("kuaishouDailyGroupReport")
     public void execute() throws Exception {
-        Date getDate = DateUtils.addDay(new Date(), -1);
+        Date startDate = DateUtils.addDay(new Date(), -2);
+        Date endDate = DateUtils.addDay(new Date(), -1);
         //1:查询当日数据
         List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
         if (null == tokens || tokens.size() <= 0) {
@@ -37,6 +38,6 @@ public class KuaishouDailyGroupReportLoadJob {
             XxlJobHelper.handleFail();
             return;
         }
-        tokens.forEach(token -> executorService.submit(() -> reportDailyGroupService.getAdvertiserGroupReportDaily(token, getDate, getDate)));
+        tokens.forEach(token -> executorService.submit(() -> reportDailyGroupService.getAdvertiserGroupReportDaily(token, startDate, endDate)));
     }
 }

+ 0 - 46
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouGroupDailyReportJob.java

@@ -1,46 +0,0 @@
-package cn.com.ctop.job.kuaishou.handler;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
-import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyGroupService;
-import com.xxl.job.core.context.XxlJobHelper;
-import com.xxl.job.core.handler.annotation.XxlJob;
-import org.jeecg.common.util.DateUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-@Component
-public class KuaishouGroupDailyReportJob {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-    @Autowired
-    private IKuaishouReportDailyGroupService reportDailyGroupService;
-
-    static ExecutorService executorService = Executors.newFixedThreadPool(5);
-
-    @XxlJob("kuaishouGroupDailyReportJob")
-    public void execute() throws ParseException {
-        String date = DateUtils.getDate("yyyy-MM-dd");
-        String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", date, -1);
-        String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", date, -2);
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        Date parse = simpleDateFormat.parse(startDate);
-        Date parse2 = simpleDateFormat.parse(endDate);
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        tokens.forEach(token -> executorService.submit(() ->
-                reportDailyGroupService.getAdvertiserGroupReportDaily(token, parse, parse2))
-        );
-        XxlJobHelper.log("快手物料数据同步完成");
-    }
-
-}

+ 2 - 2
pom.xml

@@ -73,7 +73,7 @@
         <repository>
             <id>ctop</id>
             <name>ctop</name>
-            <url>http://118.24.244.213:8081/repository/3rd_part</url>
+            <url>http://118.24.244.213:8081/3rd_part/</url>
         </repository>
     </repositories>
 
@@ -83,7 +83,7 @@
                 <enabled>true</enabled>
             </snapshots>
             <id>ctop</id>
-            <url>http://118.24.244.213:8081/repository/3rd_part</url>
+            <url>http://118.24.244.213:8081/3rd_part/</url>
         </pluginRepository>
     </pluginRepositories>