Przeglądaj źródła

素材池功能

zhaoxian 4 lat temu
rodzic
commit
249d9720cb
13 zmienionych plików z 61 dodań i 25 usunięć
  1. 20 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UserAllocationController.java
  2. 2 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/KuaishouVideoDirectionalPackageController.java
  3. 7 4
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaishouProjectVideoGetController.java
  4. 0 6
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaishouProjectVideoGet.java
  5. 6 4
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouVideoGetMapper.java
  6. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaishouProjectVideoGetMapper.java
  7. 10 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouVideoGetMapper.xml
  8. 1 3
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouProjectVideoGetMapper.xml
  9. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouVideoGetService.java
  10. 3 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouProjectVideoGetService.java
  11. 5 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouVideoGetServiceImpl.java
  12. 2 3
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouProjectVideoGetServiceImpl.java
  13. 2 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouReportAccountDailyMapper.xml

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

@@ -356,6 +356,26 @@ public class UserAllocationController {
         return result;
     }
 
+    /**
+     * 查询项目下账户集合
+     *
+     * @param
+     * @return
+     */
+    @GetMapping(value = "/queryAccountIdsByProjectId")
+    public Result<Object> queryAccountIdsByProjectId(Long projectId) {
+        if(Check.isNull(projectId)){
+            return Result.error("请选择项目");
+        }
+        try {
+            List<JSONObject> accountListByProject = userAllocationService.getAccountListByProject(projectId);
+            return Result.ok(accountListByProject);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return  Result.error("查询失败");
+    }
+
 
     @GetMapping(value = "/getAccountIdListByUserId")
     public Result<List<JSONObject>> getAccountIdListByUserId(String userId) {

+ 2 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/KuaishouVideoDirectionalPackageController.java

@@ -53,7 +53,8 @@ import io.swagger.annotations.ApiOperation;
 public class KuaishouVideoDirectionalPackageController {
     @Autowired
     private IKuaishouVideoDirectionalPackageService kuaishouVideoDirectionalPackageService;
-
+    @Autowired
+    private IUserAllocationService userAllocationService;
     /**
      * 分页列表查询
      *

+ 7 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaishouProjectVideoGetController.java

@@ -4,6 +4,7 @@ import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.QueryGenerator;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouProjectVideoGet;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouVideoGetService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouProjectVideoGetService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -53,6 +54,8 @@ import java.util.Map;
 public class KuaishouProjectVideoGetController {
     @Autowired
     private IKuaishouProjectVideoGetService kuaishouProjectVideoGetService;
+    @Autowired
+    private IKuaiShouVideoGetService videoGetService;
 
     /**
      * 分页列表查询
@@ -99,12 +102,12 @@ public class KuaishouProjectVideoGetController {
      * @return
      */
     @GetMapping(value = "/getVideoDetails")
-    public Result<Object> getVideoDetails(String signature) {
+    public Result<Object> getVideoDetails(String signature, String id) {
         try {
-            if (Check.isNull(signature)) {
-                return Result.error("请选择素材");
+            if (Check.isNull(signature) || Check.isNull(id)) {
+                return Result.error("缺失参数");
             }
-            return kuaishouProjectVideoGetService.getVideoDetails(signature);
+            return kuaishouProjectVideoGetService.getVideoDetails(signature, id);
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 0 - 6
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaishouProjectVideoGet.java

@@ -47,12 +47,6 @@ public class KuaishouProjectVideoGet {
     @ApiModelProperty(value = "0 可用 1 删除")
     private Integer status;
     /**
-     * 视频id
-     */
-    @Excel(name = "视频id", width = 15)
-    @ApiModelProperty(value = "视频id")
-    private String photoId;
-    /**
      * 宽
      */
     @Excel(name = "宽", width = 15)

+ 6 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouVideoGetMapper.java

@@ -42,13 +42,15 @@ public interface KuaiShouVideoGetMapper extends BaseMapper<KuaiShouVideoGet> {
 
     Integer getHotMoneyCountByAccountId(Long accountId);
 
-    List<KuaiShouVideoGet> getZeroVideoByParams(@Param("accountId")Long accountId, @Param("startTime")String startTime, @Param("endTime")String endTime, @Param("videoCnt")Long videoCnt,@Param("appVersion")String appVersion,@Param("channelType")Integer channelType,@Param("relativeCnt")Integer relativeCnt);
+    List<KuaiShouVideoGet> getZeroVideoByParams(@Param("accountId") Long accountId, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("videoCnt") Long videoCnt, @Param("appVersion") String appVersion, @Param("channelType") Integer channelType, @Param("relativeCnt") Integer relativeCnt);
 
-    List<KuaiShouVideoGet> getHistoryTopVideoByParams(@Param("accountId")Long accountId, @Param("startTime")String startTime, @Param("endTime")String endTime, @Param("videoCnt")Long videoCnt,@Param("appVersion")String appVersion,@Param("channelType")Integer channelType);
+    List<KuaiShouVideoGet> getHistoryTopVideoByParams(@Param("accountId") Long accountId, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("videoCnt") Long videoCnt, @Param("appVersion") String appVersion, @Param("channelType") Integer channelType);
 
-    List<KuaishouProjectVideoGet> selectProjectVideo(@Param("projectId") Long projectId,@Param("updateTime") String updateTime);
+    List<KuaishouProjectVideoGet> selectProjectVideo(@Param("projectId") Long projectId, @Param("updateTime") String updateTime);
 
-    void updateBatch(@Param(value = "videoGetList")  List<KuaiShouVideoGet> videoGetList);
+    void updateBatch(@Param(value = "videoGetList") List<KuaiShouVideoGet> videoGetList);
 
     List<JSONObject> getAccountIds();
+
+    List<String> queryPhotoIdsByProjectAndMd5(@Param("projectId") Long projectId, @Param("signature") String signature);
 }

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaishouProjectVideoGetMapper.java

@@ -27,7 +27,7 @@ public interface KuaishouProjectVideoGetMapper extends BaseMapper<KuaishouProjec
 
     JSONObject getVideoTotalNumber(Map<String, Object> paramsMap);
 
-    JSONObject getVideoDetails(@Param("signature") String signature);
+    JSONObject getVideoDetails(@Param("signature") String signature,@Param("id") String id);
 
     Long getAccountVideosTotal(@Param("signature") String signature, @Param("projectId") Long projectId);
 

+ 10 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouVideoGetMapper.xml

@@ -334,6 +334,16 @@
         GROUP BY account_id
     </select>
 
+    <select id="queryPhotoIdsByProjectAndMd5" resultType="java.lang.String">
+        SELECT t1.photo_id
+        FROM ctop_kuaishou_video_get t1
+                 LEFT JOIN  ctop_user_allocation t2 ON t1.account_id = t2.account_id
+        where t1.status = 0
+          AND t2.project_id = #{projectId}
+          AND t1.signature =#{signature}
+        GROUP BY photo_id
+    </select>
+
     <update id="updateBatch">
         UPDATE ctop_kuaishou_video_get SET
         material_tag = CASE id

+ 1 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouProjectVideoGetMapper.xml

@@ -7,7 +7,6 @@
         id,
         project_id,
         status,
-        photo_id,
         width,
         height,
         url,
@@ -28,7 +27,6 @@
             #{video.id},
             #{video.projectId},
             #{video.status},
-            #{video.photoId},
             #{video.width},
             #{video.height},
             #{video.url},
@@ -75,7 +73,6 @@
         SELECT
         project_id,
         status,
-        photo_id,
         width,
         height,
         url,
@@ -165,6 +162,7 @@
         FROM ctop_kuaishou_project_video_get t1
                  LEFT JOIN ctop_material_ascription t2 ON t1.signature = t2.material_id
         WHERE t1.signature = #{signature}
+        and t1.id = #{id}
     </select>
 
     <select id="getAccountVideosTotal" resultType="java.lang.Long">

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouVideoGetService.java

@@ -56,4 +56,6 @@ public interface IKuaiShouVideoGetService extends IService<KuaiShouVideoGet> {
     void getSuZaoList(String token, Long accountId, int page,String startDate);
 
     List<JSONObject> getAccountIds();
+
+    List<String> queryPhotoIdsByProjectAndMd5(Long projectId, String signature);
 }

+ 3 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouProjectVideoGetService.java

@@ -4,6 +4,8 @@ import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouProjectVideoGet;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.common.api.vo.Result;
 
+import java.util.List;
+
 /**
  * @Description: 快手-项目下视频信息
  * @Author: jeecg-boot
@@ -21,7 +23,7 @@ public interface IKuaishouProjectVideoGetService extends IService<KuaishouProjec
 
     Result<Object> getVideoTotalNumber(Long projectId);
 
-    Result<Object> getVideoDetails(String signature);
+    Result<Object> getVideoDetails(String signature,String id);
 
     Result<Object> getAccountVideos(String signature,Long projectId,Integer pageNo,Integer pageSize);
 

+ 5 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouVideoGetServiceImpl.java

@@ -348,4 +348,9 @@ public class KuaiShouVideoGetServiceImpl extends ServiceImpl<KuaiShouVideoGetMap
     public List<JSONObject> getAccountIds() {
         return videoGetMapper.getAccountIds();
     }
+
+    @Override
+    public List<String> queryPhotoIdsByProjectAndMd5(Long projectId, String signature) {
+        return videoGetMapper.queryPhotoIdsByProjectAndMd5(projectId, signature);
+    }
 }

+ 2 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouProjectVideoGetServiceImpl.java

@@ -43,7 +43,6 @@ public class KuaishouProjectVideoGetServiceImpl extends ServiceImpl<KuaishouProj
     @Override
     public void clearProjectVideo(Long projectId) {
         String updateTime = projectVideoGetMapper.queryLatestUpdateTime(projectId);
-        System.out.println(updateTime);
         List<KuaishouProjectVideoGet> list = videoGetMapper.selectProjectVideo(projectId, updateTime);
         if (!Check.isNull(list)) {
             projectVideoGetMapper.replaceBatch(list);
@@ -79,8 +78,8 @@ public class KuaishouProjectVideoGetServiceImpl extends ServiceImpl<KuaishouProj
     }
 
     @Override
-    public Result<Object> getVideoDetails(String signature) {
-        return Result.ok(projectVideoGetMapper.getVideoDetails(signature));
+    public Result<Object> getVideoDetails(String signature, String id) {
+        return Result.ok(projectVideoGetMapper.getVideoDetails(signature, id));
     }
 
     @Override

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouReportAccountDailyMapper.xml

@@ -285,13 +285,13 @@
                      AND media_id =2
                      GROUP BY user_id) t) as 'totle'
                  FROM (
-                     SELECT sum (charge) as 'charge', t2.user_id 'userId' FROM ctop_etl_kuaishou_report_account_daily t1
+                     SELECT sum(charge) as 'charge', t2.user_id 'userId' FROM ctop_etl_kuaishou_report_account_daily t1
                      LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
                      WHERE t1.stat_date &gt;= #{mStartDate}
                      AND t1.stat_date &lt;= #{today}
                      AND media_id =2
                      GROUP BY user_id
-                     ORDER BY SUM (charge) DESC
+                     ORDER BY SUM(charge) DESC
                      ) t, (select @rownum := 0) a
              ) tt
         WHERE tt.userId = #{userId}