Explorar el Código

修改头条快手爆款视频计算逻辑

songyh hace 4 años
padre
commit
e3ed215e54

+ 8 - 8
jeecg-boot-module-system/src/main/resources/application-wps.yml

@@ -100,16 +100,16 @@ spring:
 #          username: data
 #          password: hcst@2021
 #          driver-class-name: com.mysql.jdbc.Driver
-        master:
-          url: jdbc:mysql://139.186.165.84:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true
-          username: hcst
-          password: hcst@2020
-          driver-class-name: com.mysql.jdbc.Driver
 #        master:
-#          url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-#          username: data
-#          password: hcst@2021
+#          url: jdbc:mysql://139.186.165.84:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true
+#          username: hcst
+#          password: hcst@2020
 #          driver-class-name: com.mysql.jdbc.Driver
+        master:
+          url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          username: data
+          password: hcst@2021
+          driver-class-name: com.mysql.jdbc.Driver
   #redis 配置
   redis:
     database: 0

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

@@ -101,11 +101,11 @@ public class SampleTest {
 
     @Test
     public void loadBytedanceVideoReportData() {
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        String date = DateUtils.formatDate(getDate);
+        String startDate = "2021-04-01";
+        String endDate = "2021-04-16";
         List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
         for (CtopOauthToken token : tokens) {
-            bytedanceReportService.bytedanceVideoMaterialReport(token, date, date);
+            bytedanceReportService.bytedanceVideoMaterialReport(token, startDate, endDate);
         }
     }
 

+ 0 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreateCreativeServiceImpl.java

@@ -383,7 +383,6 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
             } else {
                 customUnitCnt = 2000L / imageCnt;
             }
-
         }
 
         Long unitNum = customUnitCnt * hour / 20;

+ 68 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouVideoEtlInfoServiceImpl.java

@@ -127,6 +127,40 @@ public class KuaishouVideoEtlInfoServiceImpl extends ServiceImpl<KuaishouVideoEt
                             etlInfo.setUpdateTime(new Date());
                             this.save(etlInfo);
                         } else {
+                            JSONObject ascription = materialAscriptionService.getDetailByCode(signature);
+                            String planId = null;
+                            if (null != ascription) {
+                                planId = ascription.getString("planId");
+                                if (null != planId && !planId.trim().equals("")) {
+                                    etlInfo.setPlanId(planId);
+                                }
+                                String planName = ascription.getString("planName");
+                                if (null != planName && !planName.trim().equals("")) {
+                                    etlInfo.setPlanName(planName);
+                                }
+                                String clipId = ascription.getString("clipId");
+                                if (null != clipId && !clipId.trim().equals("")) {
+                                    etlInfo.setClipId(clipId);
+                                }
+                                String clipName = ascription.getString("clipName");
+                                if (null != clipName && !clipName.trim().equals("")) {
+                                    etlInfo.setClipName(clipName);
+                                }
+                                String shotId = ascription.getString("shotId");
+                                if (null != shotId && !shotId.trim().equals("")) {
+                                    etlInfo.setShotId(shotId);
+                                }
+                                String shotName = ascription.getString("shotName");
+                                if (null != shotName && !shotName.trim().equals("")) {
+                                    etlInfo.setShotName(shotName);
+                                }
+                            }
+                            if (null != planId) {
+                                String companyName = kuaishouVideoEtlInfoMapper.getCompanyNameByUserId(planId);
+                                if (null != companyName && !companyName.trim().equals("")) {
+                                    etlInfo.setCompanyName(companyName);
+                                }
+                            }
                             //只需要更新汇总数据
                             etlInfo.setTotalCost(nowData.getCharge());
                             etlInfo.setAclick(nowData.getAclick());
@@ -255,6 +289,40 @@ public class KuaishouVideoEtlInfoServiceImpl extends ServiceImpl<KuaishouVideoEt
                             etlInfo.setUpdateTime(new Date());
                             kuaishouProjectVideoEtlInfoService.save(etlInfo);
                         } else {
+                            JSONObject ascription = materialAscriptionService.getDetailByCode(signature);
+                            String planId = null;
+                            if (null != ascription) {
+                                planId = ascription.getString("planId");
+                                if (null != planId && !planId.trim().equals("")) {
+                                    etlInfo.setPlanId(planId);
+                                }
+                                String planName = ascription.getString("planName");
+                                if (null != planName && !planName.trim().equals("")) {
+                                    etlInfo.setPlanName(planName);
+                                }
+                                String clipId = ascription.getString("clipId");
+                                if (null != clipId && !clipId.trim().equals("")) {
+                                    etlInfo.setClipId(clipId);
+                                }
+                                String clipName = ascription.getString("clipName");
+                                if (null != clipName && !clipName.trim().equals("")) {
+                                    etlInfo.setClipName(clipName);
+                                }
+                                String shotId = ascription.getString("shotId");
+                                if (null != shotId && !shotId.trim().equals("")) {
+                                    etlInfo.setShotId(shotId);
+                                }
+                                String shotName = ascription.getString("shotName");
+                                if (null != shotName && !shotName.trim().equals("")) {
+                                    etlInfo.setShotName(shotName);
+                                }
+                            }
+                            if (null != planId) {
+                                String companyName = kuaishouVideoEtlInfoMapper.getCompanyNameByUserId(planId);
+                                if (null != companyName && !companyName.trim().equals("")) {
+                                    etlInfo.setCompanyName(companyName);
+                                }
+                            }
                             //只需要更新汇总数据
                             etlInfo.setTotalCost(nowData.getCharge());
                             etlInfo.setAclick(nowData.getAclick());

+ 34 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceVideoEtlInfoServiceImpl.java

@@ -291,6 +291,40 @@ public class BytedanceVideoEtlInfoServiceImpl extends ServiceImpl<BytedanceVideo
                             etlInfo.setUpdateTime(new Date());
                             this.save(etlInfo);
                         }else{
+                            JSONObject ascription =  materialAscriptionService.getDetailByCode(signature);
+                            String planId = null;
+                            if(null!=ascription){
+                                planId = ascription.getString("planId");
+                                if(null!=planId&&!planId.trim().equals("")){
+                                    etlInfo.setPlanId(planId);
+                                }
+                                String planName =  ascription.getString("planName");
+                                if(null!=planName&&!planName.trim().equals("")){
+                                    etlInfo.setPlanName(planName);
+                                }
+                                String clipId = ascription.getString("clipId");
+                                if(null!=clipId&&!clipId.trim().equals("")){
+                                    etlInfo.setClipId(clipId);
+                                }
+                                String clipName = ascription.getString("clipName");
+                                if(null!=clipName&&!clipName.trim().equals("")){
+                                    etlInfo.setClipName(clipName);
+                                }
+                                String shotId = ascription.getString("shotId");
+                                if(null!=shotId&&!shotId.trim().equals("")){
+                                    etlInfo.setShotId(shotId);
+                                }
+                                String shotName = ascription.getString("shotName");
+                                if(null!=shotName&&!shotName.trim().equals("")){
+                                    etlInfo.setShotName(shotName);
+                                }
+                            }
+                            if(null!=planId){
+                                String companyName = userAllocationMapper.getCompanyNameByUserId(planId);
+                                if (null!=companyName&&!companyName.trim().equals("")){
+                                    etlInfo.setCompanyName(companyName);
+                                }
+                            }
                             //只需要更新汇总数据
                             etlInfo.setTotalCost(nowData.getTotalCost());
                             BigDecimal totalCost = etlInfo.getTotalCost();