Преглед на файлове

Merge branch 'master' into V2.0.1

zhaoxian преди 3 години
родител
ревизия
f4ac4b9912

+ 1 - 1
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/BossDataExhibitionMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.ctop.material.mapper.BossDataExhibitionMapper">
 
-    <!--  素材产出占比 快手 -->
+    <!--  素材产出占比 快手 master-->
     <select id="getMeterialProduceRateKuaiShou" resultType="java.util.LinkedHashMap">
         SELECT a.*,
         sum(a.meterial) meterialNum,

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/common/constant/AccountReportConstants.java

@@ -45,7 +45,7 @@ public class AccountReportConstants {
             "    \"comment\": \"转化成本\"\n" +
             "  },\n" +
             "  \"convertRate\": {\n" +
-            "    \"filed\": \"CASE WHEN sum(t1.cost) != 0 THEN concat(CAST(round(sum(t1.convert_num) / sum(t1.cost)*100,2) AS CHAR) ,'%') ELSE '0%' end AS convertRate\",\n" +
+            "    \"filed\": \"CASE WHEN sum(t1.click) != 0 THEN concat(CAST(round(sum(t1.convert_num) / sum(t1.click)*100,2) AS CHAR) ,'%') ELSE '0%' end AS convertRate\",\n" +
             "    \"comment\": \"转化率\"\n" +
             "  },\n" +
             "  \"downloadStart\": {\n" +

+ 20 - 13
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java

@@ -222,6 +222,9 @@ public class CallbackController {
                     userAllocation.setCreateTime(new Date());
                     userAllocation.setUpdateTime(new Date());
                     //自动投放,0关闭,1开启
+                    if (json.getInteger("dataSync") == 2) {
+                        userAllocation.setAccountStatus(1);
+                    }
 
                     userAllocation.setAutoDelivery(autoDelivery);
                     userAllocation.setMaterialType(materialTypeStr);
@@ -238,21 +241,25 @@ public class CallbackController {
                     Integer materialType = materialTypeArr.getInteger(0);
                     //账号绑定
                     bindAccountAuthService.addBindAccount(accountId, KuaishouInterfaceConstant.LOGIN_TYPE_KUAISHOU, advertiserId);
-                    Thread t = new Thread() {
-                        @Override
-                        public void run() {
-                            try {
-                                kuaishouInterfaceService.loadKuaishouDataSingle(topOauthToken);
-
-                                if (!Check.isNull(materialType) && materialType != 0) {
-                                    synchronMaterials(materialType, accountId, projectId);
+                    if (json.getInteger("dataSync") == 1) {
+                        Thread t = new Thread() {
+                            @Override
+                            public void run() {
+                                try {
+                                    kuaishouInterfaceService.loadKuaishouDataSingle(topOauthToken);
+
+                                    if (!Check.isNull(materialType) && materialType != 0) {
+                                        synchronMaterials(materialType, accountId, projectId);
+                                    }
+                                } catch (ParseException e) {
+                                    e.printStackTrace();
                                 }
-                            } catch (ParseException e) {
-                                e.printStackTrace();
                             }
-                        }
-                    };
-                    t.start();
+                        };
+                        t.start();
+                    } else if (json.getInteger("dataSync") == 2) {
+                        log.info("客户自运营,无需获取数据");
+                    }
                 }
                 detailService.removeById(id);
                 return "授权绑定成功";

+ 4 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectTransferRecordController.java

@@ -93,12 +93,13 @@ public class ProjectTransferRecordController {
         if (null == status || status.equals(0)) {
             projectTransferRecord.setStatus(null);
         }
+        String userId = projectTransferRecord.getUserId();
+        projectTransferRecord.setUserId(null);
         Result<IPage<ProjectTransferRecord>> result = new Result<>();
         QueryWrapper<ProjectTransferRecord> queryWrapper = QueryGenerator.initQueryWrapper(projectTransferRecord, req.getParameterMap());
-        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        String rodeCode = sysRoleService.getRoleCodeByUserId(sysUser.getId());
+        String rodeCode = sysRoleService.getRoleCodeByUserId(userId);
         if (null != rodeCode && !"admin".equals(rodeCode.trim())) {
-            queryWrapper.eq("reviewer_id", sysUser.getId());
+            queryWrapper.eq("reviewer_id", userId);
         }
         queryWrapper.ne("status", 0);
         Page<ProjectTransferRecord> page = new Page<>(pageNo, pageSize);

+ 3 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/fileupload/service/impl/ExternalMaterialCollectionServiceImpl.java

@@ -192,6 +192,7 @@ public class ExternalMaterialCollectionServiceImpl extends ServiceImpl<ExternalM
                     File file = new File(localUrl);
                     it.sauronsoftware.jave.Encoder encoder = new Encoder();
                     MultimediaInfo m = encoder.getInfo(file);
+                    Thread.sleep(5000);
                     long duration = m.getDuration();
                     long secondDuration = duration / 1000;
                     // 视频秒数
@@ -319,8 +320,8 @@ public class ExternalMaterialCollectionServiceImpl extends ServiceImpl<ExternalM
                 String platePosition = eeu.getCellValue(row.getCell(3));
                 //描述
                 String materialDescribe = eeu.getCellValue(row.getCell(4));
-                if(!Check.isNull(materialDescribe)){
-                    materialDescribe = materialDescribe.substring(0,10);
+                if (!Check.isNull(materialDescribe) && materialDescribe.length() > 10) {
+                    materialDescribe = materialDescribe.substring(0, 10);
                 }
                 ExternalMaterialCollection materialCollection = new ExternalMaterialCollection();
                 QueryWrapper<SysCategory> queryWrapper = new QueryWrapper<>();