Browse Source

Merge branch 'V2.0.1' into test

zhaoxian 3 years ago
parent
commit
2a300365c9

+ 3 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouCreativeMapper.java

@@ -35,9 +35,11 @@ public interface KuaiShouCreativeMapper extends BaseMapper<KuaiShouCreative> {
 
 
     String getClickTrackUrl(@Param("accountId") Long accountId, @Param("unitId") Long unitId);
     String getClickTrackUrl(@Param("accountId") Long accountId, @Param("unitId") Long unitId);
 
 
-    Long queryCreativeByPhotoIdTotal(@Param("photoIds")  List<String> photoIds, @Param("accountId") Long accountId);
+    Long queryCreativeByPhotoIdTotal(@Param("photoIds") List<String> photoIds, @Param("accountId") Long accountId);
 
 
     List<JSONObject> queryCreativeByPhotoId(@Param("photoId") String photoId);
     List<JSONObject> queryCreativeByPhotoId(@Param("photoId") String photoId);
 
 
     List<JSONObject> queryCreativeByPhotoIds(@Param("photoIds") List<String> photoIds, @Param("accountId") Long accountId);
     List<JSONObject> queryCreativeByPhotoIds(@Param("photoIds") List<String> photoIds, @Param("accountId") Long accountId);
+
+    String querMaxCreateTime(@Param("unitId") Long unitId);
 }
 }

+ 4 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouCreativeMapper.xml

@@ -221,4 +221,8 @@
         </if>
         </if>
         and t1.status = 42
         and t1.status = 42
     </select>
     </select>
+
+    <select id="querMaxCreateTime" resultType="java.lang.String">
+        SELECT MAX(create_time) FROM ctop_kuaishou_creative WHERE unit_id = #{unitId}
+    </select>
 </mapper>
 </mapper>

+ 2 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouCreativeService.java

@@ -74,4 +74,6 @@ public interface IKuaiShouCreativeService extends IService<KuaiShouCreative> {
 
 
 
 
     void getProgramCreative(CtopOauthToken oauthToken, int page);
     void getProgramCreative(CtopOauthToken oauthToken, int page);
+
+    String querMaxCreateTime(Long unitId);
 }
 }

+ 5 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouCreativeServiceImpl.java

@@ -379,5 +379,10 @@ public class KuaiShouCreativeServiceImpl extends ServiceImpl<KuaiShouCreativeMap
 
 
     }
     }
 
 
+    @Override
+    public String querMaxCreateTime(Long unitId) {
+        return kuaiShouCreativeMapper.querMaxCreateTime(unitId);
+    }
+
 
 
 }
 }

+ 19 - 8
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/mapper/xml/KuaishouChannelMapper.xml

@@ -116,14 +116,25 @@
     </select>
     </select>
 
 
     <select id="channelNumberUsageDetailsList" resultType="com.alibaba.fastjson.JSONObject">
     <select id="channelNumberUsageDetailsList" resultType="com.alibaba.fastjson.JSONObject">
-        SELECT IFNULL((SELECT MAX(tt.create_time)
-                       FROM ctop_kuaishou_creative tt
-                       WHERE tt.unit_id = t3.unit_id),
-                      '-') as 'createTime', CASE t1.usage_range WHEN 1 THEN '账户' WHEN 2 THEN '项目' ELSE '' END as 'usageRange', IFNULL(t3.channel_code, '') as 'channelCode', IFNULL(t1.project_name, '') as 'projectName', IFNULL(t2.auth_name, '') as 'authName', IFNULL(t3.account_id, '') as 'accountId', IFNULL(t3.campaign_id, '') as 'campaignId', IFNULL(t3.unit_id, '') as 'unitId'
-        FROM ctop_kuaishou_channel_rel t3
-                 INNER JOIN ctop_kuaishou_channel t1
-                            ON t1.account_id = t3.account_id AND t1.channel_code = t3.channel_code
-                 LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
+        SELECT
+            CASE
+                t1.usage_range
+                WHEN 1 THEN
+                    '账户'
+                WHEN 2 THEN
+                    '项目' ELSE ''
+                END AS 'usageRange',
+            IFNULL( t3.channel_code, '' ) AS 'channelCode',
+            IFNULL( t1.project_name, '' ) AS 'projectName',
+            IFNULL( t2.auth_name, '' ) AS 'authName',
+            IFNULL( t3.account_id, '' ) AS 'accountId',
+            IFNULL( t3.campaign_id, '' ) AS 'campaignId',
+            IFNULL( t3.unit_id, '' ) AS 'unitId'
+        FROM
+            ctop_kuaishou_channel_rel t3
+                INNER JOIN ctop_kuaishou_channel t1 ON t1.account_id = t3.account_id
+                AND t1.channel_code = t3.channel_code
+                LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
         WHERE t3.account_id = #{accountId}
         WHERE t3.account_id = #{accountId}
           AND t3.channel_code = #{channelCode}
           AND t3.channel_code = #{channelCode}
           AND t3.unit_id is not null
           AND t3.unit_id is not null

+ 10 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/impl/KuaishouChannelServiceImpl.java

@@ -14,6 +14,7 @@ import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaiShouAppInfoService;
 import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouAppPackageService;
 import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouAppPackageService;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouAppList;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouAppList;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouAppListService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouAppListService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCreativeService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouMaterialUploadService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouMaterialUploadService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannel;
 import cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannel;
@@ -92,6 +93,9 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
     private IKuaishouChannelAppInfoService channelAppInfoService;
     private IKuaishouChannelAppInfoService channelAppInfoService;
 
 
     @Autowired
     @Autowired
+    private IKuaiShouCreativeService kuaiShouCreativeService;
+
+    @Autowired
     private IKuaiShouAppListService kuaiShouAppListService;
     private IKuaiShouAppListService kuaiShouAppListService;
 
 
     @Autowired
     @Autowired
@@ -145,7 +149,12 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
     public Result<Object> channelNumberUsageDetailsList(KuaishouChannel kuaishouChannel, Integer pageNo, Integer pageSize) {
     public Result<Object> channelNumberUsageDetailsList(KuaishouChannel kuaishouChannel, Integer pageNo, Integer pageSize) {
         Long total = channelMapper.channelNumberUsageDetailsListTotal(kuaishouChannel);
         Long total = channelMapper.channelNumberUsageDetailsListTotal(kuaishouChannel);
         PageHelper.startPage(pageNo, pageSize, false);
         PageHelper.startPage(pageNo, pageSize, false);
-        PageInfo pageInfo = new PageInfo(channelMapper.channelNumberUsageDetailsList(kuaishouChannel));
+        List<JSONObject> list = channelMapper.channelNumberUsageDetailsList(kuaishouChannel);
+        for (JSONObject jsonObject : list) {
+            String time = kuaiShouCreativeService.querMaxCreateTime(jsonObject.getLong("unitId"));
+            jsonObject.put("createTime",time);
+        }
+        PageInfo pageInfo = new PageInfo(list);
         pageInfo.setTotal(total);
         pageInfo.setTotal(total);
         return Result.ok(pageInfo);
         return Result.ok(pageInfo);
     }
     }