Browse Source

修改素材关联产品维度

xuzuoyun 4 years ago
parent
commit
bc1a9be0ce
25 changed files with 439 additions and 131 deletions
  1. 0 1
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  2. 32 66
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java
  3. 25 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProductController.java
  4. 69 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UserAllocationController.java
  5. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/ProjectMember.java
  6. 4 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/ProjectMemberMapper.java
  7. 26 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ProjectMemberMapper.xml
  8. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IProjectMemberService.java
  9. 16 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java
  10. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java
  11. 3 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/Product.java
  12. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/mapper/MaterialInfoMapper.java
  13. 4 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/ProductMapper.java
  14. 4 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/UserAllocationMapper.java
  15. 3 3
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml
  16. 34 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/ProductMapper.xml
  17. 27 1
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/UserAllocationMapper.xml
  18. 3 3
      module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialInfoService.java
  19. 5 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IProductService.java
  20. 5 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IUserAllocationService.java
  21. 53 50
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java
  22. 7 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/ProductServiceImpl.java
  23. 10 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java
  24. 95 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/ChaojiyingUtils.java
  25. 1 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/impl/KuaishouWebInterfaceServiceImpl.java

+ 0 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -198,7 +198,6 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/ai/create/*", "anon");
         //filterChainDefinitionMap.put("/overView/*", "anon");
         filterChainDefinitionMap.put("/kuaishouCrowdPack/**", "anon");
-
         // 添加自己的过滤器并且取名为jwt
         Map<String, Filter> filterMap = new HashMap<>(1);
         filterMap.put("jwt", new JwtFilter());

+ 32 - 66
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java

@@ -64,8 +64,6 @@ public class MaterialInfoController {
     @Autowired
     private IMaterialImageInfoService iMaterialImageInfoService;
     @Autowired
-    private IProjectService projectService;
-    @Autowired
     private IMessageTemplate messageTemplate;
     @Autowired
     private ISysRoleService roleService;
@@ -73,6 +71,8 @@ public class MaterialInfoController {
     private ISendMessageService sendMessageService;
     @Autowired
     private IBytedanceVideoSlogenInfoService slogenInfoService;
+    @Autowired
+    private IProductService productService;
 
 
     @GetMapping("/supplierWatermark")
@@ -219,10 +219,10 @@ public class MaterialInfoController {
                 String userId = materialInfo.getUserId();
                 materialInfo.setUserId(null);
                 queryWrapper = QueryGenerator.initQueryWrapper(materialInfo, req.getParameterMap());
-                if (Check.isNull(materialInfo.getProjectId())) {
-                    List<Long> projects = memberService.selectProjectsByUserId(userId);
-                    if (!Check.isNull(projects)) {
-                        queryWrapper.in("project_id", projects);
+                if (Check.isNull(materialInfo.getProductId())) {
+                    List<Long> products = memberService.selectProductsByUserId(userId);
+                    if (!Check.isNull(products)) {
+                        queryWrapper.in("product_id", products);
                     } else {
                         result.setSuccess(true);
                         result.setResult(null);
@@ -272,13 +272,6 @@ public class MaterialInfoController {
                     String byteDanceString = JsonUtil.objectToJson(byteDance);
                     material.setByteDance(JSONObject.parseObject(byteDanceString));
                 }
-
-                Project project = projectService.getById(material.getProjectId());
-                if (!Check.isNull(project)) {
-                    material.setMediaId(project.getMediaId());
-                    material.setProjectName(project.getProjectName());
-                }
-
                 QueryWrapper<MaterialImageInfo> imageInfoQueryWrapper = new QueryWrapper<>();
                 imageInfoQueryWrapper.eq("video_id", material.getCode());
                 imageInfoQueryWrapper.eq("status", 0);
@@ -292,12 +285,12 @@ public class MaterialInfoController {
     }
 
     @GetMapping(value = "/listV2")
-    public Map<String, Object> queryPageList(String type, Integer status, Long projectId, String materialName, String code,
+    public Map<String, Object> queryPageList(String type, Integer status, Long productId, String materialName, String code,
                                              String startDate, String endDate, String tagCode,
                                              @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                              @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        List<Long> projectIds = null;
+        List<Long> productIds = null;
         String userId = user.getId();
         String roleCode = roleService.getRoleCodeByUserId(userId);
         if (null == tagCode || "".equals(tagCode.trim())) {
@@ -305,27 +298,28 @@ public class MaterialInfoController {
         }
         if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || "operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "operationAssistant".equals(roleCode) || "touTiaoOperationManager".equals(roleCode) || roleCode.contains("sale")) {
             //查询所有
-            if (null != projectId && projectId != 0) {
-                projectIds = new ArrayList<>();
-                projectIds.add(projectId);
+            if (null != productId && productId != 0) {
+                productIds = new ArrayList<>();
+                productIds.add(productId);
             }
-            return materialInfoService.getListByParams(tagCode, type, status, projectIds, materialName, code, startDate, endDate, null, pageNo, pageSize);
+            return materialInfoService.getListByParams(tagCode, type, status, productIds, materialName, code, startDate, endDate, null, pageNo, pageSize);
         } else if ("designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode) || "plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode)) {
             //查询自己所在项目下的数据
-            if (null == projectId || projectId == 0) {
-                projectIds = memberService.selectProjectsByUserId(userId);
+            if (null == productId || productId == 0) {
+                productIds = memberService.selectProductsByUserId(userId);
+
             } else {
-                projectIds = new ArrayList<>();
-                projectIds.add(projectId);
+                productIds = new ArrayList<>();
+                productIds.add(productId);
             }
-            return materialInfoService.getListByParams(tagCode, type, status, projectIds, materialName, code, startDate, endDate, null, pageNo, pageSize);
+            return materialInfoService.getListByParams(tagCode, type, status, productIds, materialName, code, startDate, endDate, null, pageNo, pageSize);
         } else {
             //查询自己上传的视频
-            if (null != projectId && projectId != 0) {
-                projectIds = new ArrayList<>();
-                projectIds.add(projectId);
+            if (null != productId && productId != 0) {
+                productIds = new ArrayList<>();
+                productIds.add(productId);
             }
-            return materialInfoService.getListByParams(tagCode, type, status, projectIds, materialName, code, startDate, endDate, userId, pageNo, pageSize);
+            return materialInfoService.getListByParams(tagCode, type, status, productIds, materialName, code, startDate, endDate, userId, pageNo, pageSize);
         }
     }
 
@@ -378,12 +372,6 @@ public class MaterialInfoController {
         List<MaterialInfo> materialInfoList = pageList.getRecords();
         if (materialInfoList.size() != 0) {
             for (MaterialInfo material : materialInfoList) {
-                Project project = projectService.getById(material.getProjectId());
-                if (!Check.isNull(project)) {
-                    material.setMediaId(project.getMediaId());
-                    material.setProjectName(project.getProjectName());
-                }
-
                 QueryWrapper<MaterialImageInfo> imageInfoQueryWrapper = new QueryWrapper<>();
                 imageInfoQueryWrapper.eq("video_id", material.getCode());
                 imageInfoQueryWrapper.eq("status", 0);
@@ -427,7 +415,7 @@ public class MaterialInfoController {
 
 
     /**
-     * 批量修改项目
+     * 批量修改产品
      *
      * @param jsonObject
      * @return
@@ -436,13 +424,13 @@ public class MaterialInfoController {
     public Result<MaterialInfo> batchEdit(@RequestBody JSONObject jsonObject) {
         Result<MaterialInfo> result = new Result<>();
         try {
-            Long projectId = jsonObject.getLong("projectId");
+            Long productId = jsonObject.getLong("productId");
             JSONArray materialIds = jsonObject.getJSONArray("materialIds");
             for (int i = 0; i < materialIds.size(); i++) {
                 String materialId = materialIds.getString(i);
                 MaterialInfo updateMaterial = new MaterialInfo();
                 updateMaterial.setId(materialId);
-                updateMaterial.setProjectId(projectId);
+                updateMaterial.setProductId(productId);
                 materialInfoService.updateById(updateMaterial);
 
             }
@@ -533,8 +521,8 @@ public class MaterialInfoController {
         Integer status = materialInfo.getStatus();
         // 如果状态为2 审核拒绝 给上传人发送消息
         if (status == 2) {
-            Project project = projectService.getById(materialInfoEntity.getProjectId());
-            String text = messageTemplate.getMaterialRejectTemplate(project.getProjectName(), materialInfoEntity.getMaterialName(), materialInfo.getRefuseReason());
+            Product product = productService.getById(materialInfoEntity.getProductId());
+            String text = messageTemplate.getMaterialRejectTemplate(product.getProductName(), materialInfoEntity.getMaterialName(), materialInfo.getRefuseReason());
             sendMessageService.sendMessage(materialInfoEntity.getUserId(), text);
         }
         return result;
@@ -724,28 +712,6 @@ public class MaterialInfoController {
             }
         }
 
-        //  审核通过自动同步到到媒体后台
-       /* Long projectId = materialInfoEntity.getProjectId();
-        Project project = projectService.getById(projectId);
-        if (!Check.isNull(projectId)) {
-            if ("2".equals(project.getMediaId())) {
-                if (!Check.isNull(materialInfo.getStatus())) {
-                    Integer status = materialInfo.getStatus();
-                    if (status == 1) {
-                        Thread thread = new Thread() {
-                            @Override
-                            public void run() {
-                                log.info("开始自动同步素材,code:{}", materialInfoEntity.getCode());
-                                uploadService.upload(materialInfoEntity);
-                            }
-                        };
-                        thread.start();
-                    }
-                }
-            }
-
-        }*/
-
         boolean ok = materialInfoService.updateById(materialInfo);
         if (ok) {
             result.success("修改成功!");
@@ -754,8 +720,8 @@ public class MaterialInfoController {
         Integer status = materialInfo.getStatus();
         // 如果状态为2 审核拒绝 给上传人发送消息
         if (status == 2) {
-            Project project = projectService.getById(materialInfoEntity.getProjectId());
-            String text = messageTemplate.getMaterialRejectTemplate(project.getProjectName(), materialInfoEntity.getMaterialName(), materialInfo.getRefuseReason());
+            Product product = productService.getById(materialInfoEntity.getProductId());
+            String text = messageTemplate.getMaterialRejectTemplate(product.getProductName(), materialInfoEntity.getMaterialName(), materialInfo.getRefuseReason());
             sendMessageService.sendMessage(materialInfoEntity.getUserId(), text);
         }
         return result;
@@ -771,9 +737,9 @@ public class MaterialInfoController {
         QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
         if (!Check.isNull(requestBody.getString("userId"))) {
             queryWrapper.eq("user_id", requestBody.getString("userId"));
-            List<Long> projects = memberService.getProjectByAccountIds(requestBody.getJSONArray("accountIds"));
-            if (!Check.isNull(projects)) {
-                queryWrapper.in("project_id", projects);
+            List<Long> products = memberService.getProductByAccountIds(requestBody.getJSONArray("accountIds"));
+            if (!Check.isNull(products)) {
+                queryWrapper.in("product_id", products);
             }
         }
         queryWrapper.orderByDesc(true, "create_time");

+ 25 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProductController.java

@@ -5,6 +5,7 @@ import cn.com.ctop.common.module.entity.Product;
 import cn.com.ctop.common.module.entity.Project;
 import cn.com.ctop.common.module.mapper.ProjectMapper;
 import cn.com.ctop.common.module.service.IProductService;
+import cn.com.ctop.common.module.service.ISysRoleExtService;
 import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.QueryGenerator;
@@ -17,6 +18,7 @@ import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.ctop.entity.ProjectMember;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -52,7 +54,8 @@ import java.util.Map;
 public class ProductController {
     @Autowired
     private IProductService productService;
-
+    @Autowired
+    private ISysRoleExtService sysRoleService;
     /**
      * 分页列表查询
      *
@@ -97,6 +100,27 @@ public class ProductController {
         return result;
     }
 
+    @GetMapping(value = "/getUserProductList")
+    public Result<IPage<Product>> getUserProductList(String userId,String productName,
+                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                          HttpServletRequest req) {
+        Result<IPage<Product>> result = new Result<>();
+        if (Check.isNull(userId)) {
+            result.setSuccess(false);
+            result.setMessage("未获取到用户信息");
+            return result;
+        }
+        String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+        if ("admin".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
+            userId = null;
+        }
+        Page<Product> page = new Page<>(pageNo, pageSize);
+        IPage<Product> pageList = productService.getUserProductList(page,userId,productName);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
 
     /**
      * 添加

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

@@ -15,6 +15,8 @@ import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.QueryGenerator;
 import cn.com.ctop.common.module.utils.StringUtils;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouAdvertiserBaseInfo;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouAdvertiserBaseInfoService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import com.alibaba.fastjson.JSONObject;
@@ -35,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
@@ -69,8 +72,73 @@ public class UserAllocationController {
     @Autowired
     private IKuaishouInterfaceService kuaishouInterfaceService;
     @Autowired
+    private IKuaiShouAdvertiserBaseInfoService kuaiShouAdvertiserBaseInfoService;
+    @Autowired
     private IByteDanceAdvertiserDataService advertiserDataService;
-
+    @GetMapping(value = "/getUserIdListByProductId")
+    public Result<List<JSONObject>> getUserIdListByProductId(Long productId) {
+        Result<List<JSONObject>> result = new Result<>();
+        try {
+            if (Check.isNull(productId)) {
+                throw new Exception("请选择产品id");
+            }
+            List<JSONObject> userIdList = userAllocationService.getUserIdListByProductId(productId);
+            result.setSuccess(true);
+            result.setResult(userIdList);
+        } catch (Exception e) {
+            result.setSuccess(false);
+            result.success(e.getMessage());
+        }
+        return result;
+    }
+    @GetMapping(value = "/getAccountListByUserIdAndProductId")
+    public Result<List<ProjectMember>> getAccountListByUserIdAndProductId(String userId,Long productId,Integer mediaId){
+        Result<List<ProjectMember>> result = new Result<>();
+        String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+        if ("admin".equals(roleCode)) {
+            userId = null;
+        }
+        List<Integer> mediaList = new ArrayList<>();
+        mediaList.add(mediaId);
+        List<ProjectMember> projectList = projectMemberService.getOwnProjects(mediaList);
+        projectMemberService.getOwnProjects(mediaList);
+        List<ProjectMember> projectMemberList = new ArrayList<>();
+        for (ProjectMember projectMember: projectList){
+            if (projectMember.getProductId() != productId){
+                continue;
+            }
+            List<UserAllocation> userAllocationList = userAllocationService.getAccountListByUserIdAndProductId(userId,projectMember.getProjectId(),productId);
+            projectMember.setUserAllocationList(userAllocationList);
+            projectMemberList.add(projectMember);
+        }
+        result.setResult(projectMemberList);
+        result.setSuccess(true);
+        return result;
+    }
+    @GetMapping(value = "/getBytedanceAccountListByUserIdAndProductId")
+    public Result<List<ProjectMember>> getBytedanceAccountListByUserIdAndProductId(String userId,Long productId,Integer mediaId){
+        Result<List<ProjectMember>> result = new Result<>();
+        String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+        if ("admin".equals(roleCode)) {
+            userId = null;
+        }
+        List<Integer> mediaList = new ArrayList<>();
+        mediaList.add(mediaId);
+        List<ProjectMember> projectList = projectMemberService.getOwnProjects(mediaList);
+        projectMemberService.getOwnProjects(mediaList);
+        List<ProjectMember> projectMemberList = new ArrayList<>();
+        for (ProjectMember projectMember: projectList){
+            if (projectMember.getProductId() != productId){
+                continue;
+            }
+            List<UserAllocation> userAllocationList = userAllocationService.getAccountListByUserIdAndProductId(userId,projectMember.getProjectId(),productId);
+            projectMember.setUserAllocationList(userAllocationList);
+            projectMemberList.add(projectMember);
+        }
+        result.setResult(projectMemberList);
+        result.setSuccess(true);
+        return result;
+    }
 
     @GetMapping(value = "/accountTurnProject")
     public Result<Object> getAccountList(Long accountId, Long projectId) {

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/ProjectMember.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.ctop.entity;
 
+import cn.com.ctop.common.module.entity.UserAllocation;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -15,6 +16,7 @@ import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 /**
  * 项目成员
@@ -95,6 +97,9 @@ public class ProjectMember implements Serializable {
     @TableField(exist = false)
     private String productName;
 
+    @TableField(exist = false)
+    private List<UserAllocation> userAllocationList;
+
 
     /**
      * 创建时间

+ 4 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/ProjectMemberMapper.java

@@ -20,6 +20,8 @@ public interface ProjectMemberMapper extends BaseMapper<ProjectMember> {
 
     List<Long> selectProjectsByUserId(@Param("userId") String userId);
 
+    List<Long> selectProductsByUserId(@Param("userId") String userId);
+
     List<ProjectMember> adminProjects(@Param("mediaIds")List<Integer> mediaIds);
 
     List<ProjectMember> designLeaderProjects(@Param("companyId")String companyId ,@Param("mediaIds")List<Integer> mediaIds);
@@ -43,5 +45,7 @@ public interface ProjectMemberMapper extends BaseMapper<ProjectMember> {
 
     List<Long> getProjectByAccountIds(@Param("accountIds")JSONArray accountIds);
 
+    List<Long> getProductByAccountIds(@Param("accountIds")JSONArray accountIds);
+
     List<JSONObject> getProjectByUserIdAndMediaIds(@Param("userId") String userId, @Param("mediaIds") List<Integer> mediaIds);
 }

+ 26 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ProjectMemberMapper.xml

@@ -9,6 +9,13 @@
         where user_id = #{userId}
     </select>
 
+    <select id="selectProductsByUserId" resultType="java.lang.Long">
+        select  DISTINCT(product_id) from ctop_project where product_id is not NULL  and id in
+         (select
+              DISTINCT(project_id)
+          from ctop_project_member where user_id = #{userId})
+    </select>
+
     <!-- 设计师展示所有自己的角色下制作的视频 -->
     <select id="adminProjects" resultType="org.jeecg.modules.ctop.entity.ProjectMember">
         select
@@ -21,7 +28,7 @@
         as advertiserName,
         t1.media_id as mediaId,
         t1.max_bid as maxBid,
-
+        t1.product_id as productId,
         t1.responsible_name as responsibleName
         from
         ctop_project t1
@@ -41,6 +48,7 @@
         b.project_name as projectName,
         b.advertiser_id as advertiserId,
         b.advertiser_name as advertiserName,
+        b.product_id as productId,
         b.media_id as mediaId
         from
         ctop_project_member a
@@ -61,7 +69,8 @@
         b.project_name as projectName,
         b.advertiser_id as advertiserId,
         b.advertiser_name as advertiserName,
-        b.media_id as mediaId
+        b.media_id as mediaId,
+        b.product_id as productId
         from
         ctop_project_member a
         left join ctop_project b on a.project_id = b.id
@@ -80,6 +89,7 @@
         b.project_name as projectName,
         b.advertiser_id as advertiserId,
         b.advertiser_name as advertiserName,
+        b.product_id as productId,
         b.media_id as mediaId
         from
         ctop_user_allocation a
@@ -191,6 +201,20 @@
         </foreach>
     </select>
 
+    <select id="getProductByAccountIds" resultType="java.lang.Long">
+        select  DISTINCT(product_id) from ctop_project where product_id is not NULL  and id in
+        (SELECT
+        project_id
+        FROM
+        ctop_user_allocation
+        WHERE
+        account_id IN
+        <foreach collection="accountIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>)
+    </select>
+
 
     <select id="getProjectByUserIdAndMediaIds" resultType="com.alibaba.fastjson.JSONObject">
         select

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IProjectMemberService.java

@@ -5,6 +5,7 @@ import cn.com.ctop.common.module.entity.SysUser;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.ctop.entity.ProjectMember;
 
 import java.util.List;
@@ -22,6 +23,8 @@ public interface IProjectMemberService extends IService<ProjectMember> {
 
     List<Long> selectProjectsByUserId(String userId);
 
+    List<Long> selectProductsByUserId(String userId);
+
     List<ProjectMember> getProjects(List<Integer> mediaIds);
 
     List<Map<String, Object>> getProjectAccountByUserId(String userId, String mediaType);
@@ -42,5 +45,7 @@ public interface IProjectMemberService extends IService<ProjectMember> {
 
     List<Map<String, Object>> getAllProjectAccount(String mediaType);
 
+    List<Long> getProductByAccountIds(JSONArray accountIds);
+
     List<ProjectMember> getMapsByProjectList(List<ProjectMember> projectMembers);
 }

+ 16 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java

@@ -83,6 +83,18 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
         return memberMapper.selectProjectsByUserId(userId);
     }
 
+    /**
+     * 查询所有产品
+     *
+     * @param userId
+     * @return
+     */
+    @Override
+    public List<Long> selectProductsByUserId(String userId) {
+        return memberMapper.selectProductsByUserId(userId);
+    }
+
+
     //视频报表
     @Override
     public List<ProjectMember> getProjects(List<Integer> mediaIds) {
@@ -265,8 +277,10 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
     public List<Long> getProjectByAccountIds(JSONArray accountIds) {
         return memberMapper.getProjectByAccountIds(accountIds);
     }
-
-
+    @Override
+    public List<Long> getProductByAccountIds(JSONArray accountIds){
+        return memberMapper.getProductByAccountIds(accountIds);
+    }
     //视频报表
     @Override
     public List<ProjectMember> getOwnProjects(List<Integer> mediaIds) {

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java

@@ -86,6 +86,8 @@ public class MaterialInfo {
 
     private Long projectId;
 
+    private Long productId;
+
     /**
      * 素材名称
      */

+ 3 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/Product.java

@@ -2,6 +2,7 @@ package cn.com.ctop.common.module.entity;
 
 import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModel;
@@ -72,4 +73,6 @@ public class Product {
      */
     @ApiModelProperty(value = "updateTime")
     private Date updateTime;
+    @TableField(exist = false)
+    private String advertiserName;
 }

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/mapper/MaterialInfoMapper.java

@@ -36,7 +36,7 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> {
 
     List<MaterialInfo> getListByDate(@Param("startDate") String startDate,@Param("endDate") String endDate);
 
-    List<MaterialInfo> getListByParams(@Param("tagCode")String tagCode,@Param("type")String type, @Param("status")Integer status, @Param("projectIds")List<Long> projectIds, @Param("materialName")String materialName, @Param("code")String code, @Param("startDate")String startDate, @Param("endDate")String endDate, @Param("userId")String userId);
+    List<MaterialInfo> getListByParams(@Param("tagCode")String tagCode,@Param("type")String type, @Param("status")Integer status, @Param("productIds")List<Long> productIds, @Param("materialName")String materialName, @Param("code")String code, @Param("startDate")String startDate, @Param("endDate")String endDate, @Param("userId")String userId);
 
     JSONArray getIdListByProject(Long projectId);
 }

+ 4 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/ProductMapper.java

@@ -3,6 +3,8 @@ package cn.com.ctop.common.module.mapper;
 import cn.com.ctop.common.module.entity.Product;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -20,4 +22,6 @@ public interface ProductMapper extends BaseMapper<Product> {
     String getUserNameByUserId(@Param("userId") String userId);
 
     List<JSONObject> getProductByMap(@Param("ids") Map<Long, Long> productIdMap);
+
+    IPage<Product> getUserProductList(Page<Product> page, @Param("userId")String userId, @Param("productName")String productName);
 }

+ 4 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/UserAllocationMapper.java

@@ -25,6 +25,8 @@ public interface UserAllocationMapper extends BaseMapper<UserAllocation> {
 
     List<JSONObject> getUserIdListByProjectId(@Param("projectId") Long projectId);
 
+    List<JSONObject> getUserIdListByProductId(@Param("productId") Long productId);
+
     List<JSONObject> getAccountIdListByUserId(@Param("userId") Long userId);
 
     List<JSONObject> getAccountIdsByUserId(@Param("userId") String userId);
@@ -46,4 +48,6 @@ public interface UserAllocationMapper extends BaseMapper<UserAllocation> {
     List<JSONObject> getAccountListByProjectList(@Param("list") List list);
 
     List<Long> getValidProjectIds(@Param("mediaId")  Integer mediaId);
+
+    List<UserAllocation> getAccountListByUserIdAndProductId(@Param("userId")String userId,@Param("projectId")Long projectId,@Param("productId")Long productId);
 }

+ 3 - 3
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml

@@ -112,9 +112,9 @@
         <if test="materialName!=null">
             and matInfo.material_name like concat('%',#{materialName},'%')
         </if>
-        <if test="projectIds!=null">
-            and matInfo.project_id in
-            <foreach item="item" index="index" collection="projectIds" open="(" separator="," close=")">
+        <if test="productIds!=null">
+            and matInfo.product_id in
+            <foreach item="item" index="index" collection="productIds" open="(" separator="," close=")">
                 #{item}
             </foreach>
         </if>

+ 34 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/ProductMapper.xml

@@ -17,4 +17,38 @@
         </foreach>
     </select>
 
+    <select id="getUserProductList" resultType="cn.com.ctop.common.module.entity.Product">
+        select
+            cp.id,
+            cp.product_name as 'productName',
+            ca.name as 'advertiserName'
+        from
+            ctop_product cp
+                left join ctop_advertiser ca on
+                cp.advertiser_id = ca.id
+        where
+                cp.id in (
+                select
+                    DISTINCT(product_id)
+                from
+                    ctop_project
+                where
+                    product_id is not NULL
+                  and id in (
+                    select
+                        DISTINCT(project_id)
+                    from
+                        ctop_project_member
+                    <if test="userId !=null and userId!=''">
+                    where
+                            user_id =
+                            #{userId}
+                    </if>
+                      ) )
+
+                <if test="productName != null and productName != ''">
+                    and cp.product_name like concat('%',#{productName},'%')
+                </if>
+    </select>
+
 </mapper>

+ 27 - 1
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/UserAllocationMapper.xml

@@ -14,6 +14,19 @@
         where b.id = #{projectId}
         and account_status = 0
     </select>
+    <select id="getAccountListByUserIdAndProductId" resultType="cn.com.ctop.common.module.entity.UserAllocation">
+        select cua.account_id, cua.auth_name, cua.user_name
+        from ctop_user_allocation cua
+                 left join ctop_project cp on cua.project_id = cp.id
+        where
+              cua.project_id = #{projectId}
+          and
+              cp.product_id=#{productId}
+          <if test="userId != null and userId != ''">
+              and cua.user_id = #{userId}
+          </if>
+
+    </select>
 
     <select id="queryAdvertiserId" resultType="String">
         select
@@ -70,7 +83,20 @@
     AND t2.account_status = 0
     GROUP BY t1.user_id;
     </select>
-
+    <select id="getUserIdListByProductId" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT t1.user_id as 'userId',
+               t1.account_id as 'accountId',
+               t1.user_name  as 'userName'
+        from  ctop_kuaishou_advertiser_base_info t1  LEFT JOIN
+              ctop_user_allocation  t2
+              ON t1.account_id = t2.account_id
+                                                     left join
+              ctop_project t3
+                on t2.project_id=t3.id
+        WHERE t3.product_id = #{productId}
+          AND t2.account_status = 0
+        GROUP BY t1.user_id;
+    </select>
 
     <select id="getValidProjectIds" resultType="java.lang.Long">
         SELECT project_id FROM ctop_user_allocation t1

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

@@ -27,11 +27,11 @@ public interface IMaterialInfoService extends IService<MaterialInfo> {
      */
     String watermarkVideoBySupplierCode(String videoSignature, String videoUrl, Long templateId);
 
-    MaterialInfo getMaterialInfoByCodeAndProjectId(String code, Long projectId);
+    MaterialInfo getMaterialInfoByCodeAndProductId(String code, Long productId);
 
     MaterialInfo getMaterialInfoByCode(String code);
 
-    Map<String, Object> checkMaterialInfo(String code, Long projectId);
+    Map<String, Object> checkMaterialInfo(String code, Long productId);
 
     Map<String, Object> insert(JSONObject jsonObject);
 
@@ -41,7 +41,7 @@ public interface IMaterialInfoService extends IService<MaterialInfo> {
 
     void watermarkVideo(String materialId, Long videoWatermarkTemplateId, String userId);
 
-    void getFile(MaterialInfo materialInfo, String mediaId);
+    void getFile(MaterialInfo materialInfo);
 
     void setExcellent(String id, Integer excellent);
 

+ 5 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/IProductService.java

@@ -2,7 +2,10 @@ package cn.com.ctop.common.module.service;
 
 import cn.com.ctop.common.module.entity.Product;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 import java.util.Map;
@@ -18,4 +21,6 @@ public interface IProductService extends IService<Product> {
     String getUserNameByUserId(String userId);
 
     List<JSONObject> getProductByMap(Map<Long, Long> productIdMap);
+
+    IPage<Product> getUserProductList(Page<Product> page, String userId, String productName);
 }

+ 5 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/IUserAllocationService.java

@@ -3,6 +3,7 @@ package cn.com.ctop.common.module.service;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 import java.util.Map;
@@ -43,8 +44,12 @@ public interface IUserAllocationService extends IService<UserAllocation> {
 
     List<Long> getAccountsByDeleteComment();
 
+    List<UserAllocation> getAccountListByUserIdAndProductId(String userId,Long projectId,Long productId);
+
     Map<Long, List<JSONObject>> getAccountListByProjectList(List<JSONObject> projectList);
 
+    List<JSONObject> getUserIdListByProductId(Long productId);
+
     /**
      * 获取有效的项目ID集合
      *

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

@@ -67,7 +67,8 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
     private IMaterialCutFrameService materialCutFrameService;
     @Autowired
     private ISupplierWatermarkService supplierWatermarkService;
-
+    @Resource
+    private IProductService productService;
 
     @Value("${oss.replace.download}")
     private String downloadUrl;
@@ -154,10 +155,10 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
 
 
     @Override
-    public MaterialInfo getMaterialInfoByCodeAndProjectId(String code, Long projectId) {
+    public MaterialInfo getMaterialInfoByCodeAndProductId(String code, Long productId) {
         QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("code", code);
-        queryWrapper.eq("project_id", projectId);
+        queryWrapper.eq("product_id", productId);
         queryWrapper.orderByDesc("id").last("limit 1");
         return this.getOne(queryWrapper);
     }
@@ -172,9 +173,9 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
     }
 
     @Override
-    public Map<String, Object> checkMaterialInfo(String code, Long projectId) {
+    public Map<String, Object> checkMaterialInfo(String code, Long productId) {
         Map<String, Object> result = new HashMap<>();
-        MaterialInfo info = this.getMaterialInfoByCodeAndProjectId(code, projectId);
+        MaterialInfo info = this.getMaterialInfoByCodeAndProductId(code, productId);
         if (null != info) {
             //文件已存在
             ResultMapUtils.setResultMap(result, StatusCode.FILE_HAS_UPLOAD.getCode());
@@ -240,16 +241,18 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
 
     private void insertMaterialInfo(String url, String type, JSONObject jsonObject) {
         MaterialInfo info = new MaterialInfo();
-        Long projectId = jsonObject.getLong("projectId");
+//        Long projectId = jsonObject.getLong("projectId");
+        Long productId = jsonObject.getLong("productId");
         String code = jsonObject.getString("code");
-        info.setId(code + projectId);
+        info.setId(code + productId);
         info.setCode(code);
         if (!Check.isNull(jsonObject.getString("watermarkUrl"))) {
             info.setWatermarkUrl(jsonObject.getString("watermarkUrl"));
         }
         info.setUrl(url);
         info.setUserId(jsonObject.getString("userId"));
-        info.setProjectId(projectId);
+//        info.setProjectId(projectId);
+        info.setProductId(productId);
         info.setWatermarkCode(jsonObject.getString("watermarkCode"));
         info.setStatus(0);
         info.setMaterialName(jsonObject.getString("materialName"));
@@ -295,7 +298,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
             }
         }
 
-        // getFile(info,);
+         getFile(info);
 
     }
 
@@ -369,7 +372,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
     }
 
     @Override
-    public void getFile(MaterialInfo materialInfo, String mediaId) {
+    public void getFile(MaterialInfo materialInfo) {
         uploadExecutorService.submit(new Runnable() {
             @Override
             public void run() {
@@ -415,21 +418,16 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
                         if (insert > 0) {
                             log.info("素材基本信息入库完成,用时:{} s", (System.currentTimeMillis() - l) / 1000);
                         }
-
-                        if ("2".equals(mediaId) || "4".equals(mediaId)) {
-                            if (!"kuaishou_001".equals(materialInfo.getSupplierCode())) {
-                                // 默认抽帧 素造供应商
-                                Long templateId = MaterialSupplierEnum.getTemplateIdBySize(Integer.valueOf(width), Integer.valueOf(height));
-                                if (!Check.isNull(templateId)) {
-                                    Thread thread = new Thread() {
-                                        @Override
-                                        public void run() {
-                                            watermarkVideoBySupplierCode(materialInfo.getCode(), materialInfo.getUrl(), templateId);
-                                        }
-                                    };
-                                    thread.start();
+                        // 默认抽帧 素造供应商
+                        Long templateId = MaterialSupplierEnum.getTemplateIdBySize(Integer.valueOf(width), Integer.valueOf(height));
+                        if (!Check.isNull(templateId)) {
+                            Thread thread = new Thread() {
+                                @Override
+                                public void run() {
+                                    watermarkVideoBySupplierCode(materialInfo.getCode(), materialInfo.getUrl(), templateId);
                                 }
-                            }
+                            };
+                            thread.start();
                         }
                     } catch (FileNotFoundException e) {
                         e.printStackTrace();
@@ -497,6 +495,8 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
             }
             MaterialInfo info = new MaterialInfo();
             Long projectId = json.getLong("projectId");
+            Project project = projectService.getById(projectId);
+            Long productId = project.getProductId();
             String code = json.getString("code");
             info.setId(UUID.randomUUID().toString().replace("-", ""));
             info.setCode(code);
@@ -506,6 +506,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
             info.setUrl(url);
             info.setUserId(userId);
             info.setProjectId(projectId);
+            info.setProductId(productId);
             info.setWatermarkCode(json.getString("watermarkCode"));
             info.setStatus(0);
             info.setMaterialName(StringUtils.getFileNameNoEx(json.getString("materialName")));
@@ -514,12 +515,13 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
             info.setCreateTime(new Date());
             info.setUpdateTime(new Date());
             info.setType(type);
-            Project project = projectService.getById(projectId);
-            if (!Check.isNull(project)) {
-                if (!Check.isNull(project.getSupplierCode())) {
-                    info.setSupplierCode(project.getSupplierCode());
-                }
-            }
+            //TODO 此处逻辑待调整
+//            Project project = projectService.getById(projectId);
+//            if (!Check.isNull(project)) {
+//                if (!Check.isNull(project.getSupplierCode())) {
+//                    info.setSupplierCode(project.getSupplierCode());
+//                }
+//            }
             MaterialCutFrame cutFrame = materialCutFrameService.getCutFrameByCode(code);
             if (Check.isNull(cutFrame)) {
                 String videoUrl = URLDecoder.decode(info.getUrl()).replace("https://media-1301855440.cos.ap-chongqing.myqcloud.com/", "");
@@ -547,7 +549,6 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
                 JSONObject imageJson = new JSONObject();
                 imageJson.put("videoId", info.getCode());
                 imageJson.put("userId", userId);
-                imageJson.put("projectId", projectId);
                 imageJson.put("imageArr", imageArr);
                 materialImageInfoService.insertImage(imageJson);
             }
@@ -580,7 +581,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
             insertTagList(code, userId, senceTagList);
             JSONArray modTagList = json.getJSONArray("modTagList");
             insertTagList(code, userId, modTagList);
-            getFile(info, project.getMediaId());
+            getFile(info);
             ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());
         } catch (Exception e) {
             ResultMapUtils.setResultMap(resultMap, StatusCode.MATERIAL_UPLOAD_FAIL.getCode());
@@ -600,28 +601,30 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
             url = "https:" + json.getString("url");
 
         }
-        Long projectId = json.getLong("projectId");
+//        Long projectId = json.getLong("projectId");
+        Long productId = json.getLong("productId");
         String code = json.getString("code");
         info.setCode(code);
-        String id = code + "_" + projectId;
+        String id = code + "_" + productId;
         info.setId(id);
         if (!Check.isNull(json.getString("watermarkUrl"))) {
             info.setWatermarkUrl(json.getString("watermarkUrl"));
         }
         info.setUrl(url);
         info.setUserId(userId);
-        info.setProjectId(projectId);
+        info.setProductId(productId);
         info.setWatermarkCode(json.getString("watermarkCode"));
         info.setStatus(0);
         info.setMaterialName(json.getString("materialName"));
         info.setWatermarkMaterialName(json.getString("watermarkMaterialName"));
         info.setMaterialDescribe(json.getString("materialDescribe"));
-        Project project = projectService.getById(projectId);
-        if (!Check.isNull(project)) {
-            if (!Check.isNull(project.getSupplierCode())) {
-                info.setSupplierCode(project.getSupplierCode());
-            }
-        }
+        //TODO 此处逻辑待调整
+//        Project project = projectService.getById(projectId);
+//        if (!Check.isNull(project)) {
+//            if (!Check.isNull(project.getSupplierCode())) {
+//                info.setSupplierCode(project.getSupplierCode());
+//            }
+//        }
         MaterialCutFrame cutFrame = materialCutFrameService.getCutFrameByCode(code);
         if (Check.isNull(cutFrame)) {
             String videoUrl = URLDecoder.decode(info.getUrl()).replace("https://media-1301855440.cos.ap-chongqing.myqcloud.com/", "");
@@ -649,7 +652,6 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
             JSONObject imageJson = new JSONObject();
             imageJson.put("videoId", info.getCode());
             imageJson.put("userId", userId);
-            imageJson.put("projectId", projectId);
             imageJson.put("imageArr", imageArr);
             materialImageInfoService.insertImage(imageJson);
         }
@@ -678,7 +680,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
         insertTagList(code, userId, senceTagList);
         JSONArray modTagList = json.getJSONArray("modTagList");
         insertTagList(code, userId, modTagList);
-        getFile(info, project.getMediaId());
+        getFile(info);
 
         return id;
     }
@@ -756,10 +758,10 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
     }
 
     @Override
-    public Map<String, Object> getListByParams(String tagCode, String type, Integer status, List<Long> projectIds, String materialName, String code, String startDate, String endDate, String userId, Integer pageNo, Integer pageSize) {
+    public Map<String, Object> getListByParams(String tagCode, String type, Integer status, List<Long> productId, String materialName, String code, String startDate, String endDate, String userId, Integer pageNo, Integer pageSize) {
         Map<String, Object> result = new HashMap<>();
         PageHelper.startPage(pageNo, pageSize);
-        List<MaterialInfo> dailyList = materialInfoMapper.getListByParams(tagCode, type, status, projectIds, materialName, code, startDate, endDate, userId);
+        List<MaterialInfo> dailyList = materialInfoMapper.getListByParams(tagCode, type, status, productId, materialName, code, startDate, endDate, userId);
         List<MaterialInfo> setList = new ArrayList<>();
         PageInfo<MaterialInfo> pageInfo = new PageInfo<>(dailyList);
         if (null != dailyList && !dailyList.isEmpty()) {
@@ -794,11 +796,12 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
                     materialInfo.setBytedanceCost(new BigDecimal(0));
                 }
 
-                Project project = projectService.getById(info.getProjectId());
-                if (!Check.isNull(project)) {
-                    materialInfo.setMediaId(project.getMediaId());
-                    materialInfo.setProjectName(project.getProjectName());
-                }
+                //TODO 待删除
+//                Project project = projectService.getById(info.getProjectId());
+//                if (!Check.isNull(project)) {
+//                    materialInfo.setMediaId(project.getMediaId());
+//                    materialInfo.setProjectName(project.getProjectName());
+//                }
 
                 QueryWrapper<MaterialImageInfo> imageInfoQueryWrapper = new QueryWrapper<>();
                 imageInfoQueryWrapper.eq("video_id", info.getCode());

+ 7 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/ProductServiceImpl.java

@@ -4,7 +4,10 @@ import cn.com.ctop.common.module.entity.Product;
 import cn.com.ctop.common.module.mapper.ProductMapper;
 import cn.com.ctop.common.module.service.IProductService;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -32,4 +35,8 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
     public List<JSONObject> getProductByMap(Map<Long, Long> productIdMap) {
         return productMapper.getProductByMap(productIdMap);
     }
+    @Override
+    public IPage<Product> getUserProductList(Page<Product> page, String userId, String productName){
+        return productMapper.getUserProductList(page,userId,productName);
+    }
 }

+ 10 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java

@@ -158,6 +158,11 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
     }
 
     @Override
+    public List<UserAllocation> getAccountListByUserIdAndProductId(String userId, Long projectId,Long productId) {
+        return userAllocationMapper.getAccountListByUserIdAndProductId(userId,projectId,productId);
+    }
+
+    @Override
     public Map<Long, List<JSONObject>> getAccountListByProjectList(List<JSONObject> projectList) {
         Map<Long, List<JSONObject>> map = new HashMap<>();
         List list = new ArrayList();
@@ -177,6 +182,11 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
     }
 
     @Override
+    public List<JSONObject> getUserIdListByProductId(Long productId) {
+        return userAllocationMapper.getUserIdListByProductId(productId);
+    }
+
+    @Override
     public List<Long> getValidProjectIds(Integer mediaId) {
         return userAllocationMapper.getValidProjectIds(mediaId);
     }

File diff suppressed because it is too large
+ 95 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/ChaojiyingUtils.java


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

@@ -571,6 +571,7 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
     @Value("${jeecg.path.chrome-driver}")
     private String chromeDriver;
 
+
     @Override
     public void adkuaishouWebLogin(String phone, String password) throws IOException {
         ChromeDriverService service = new ChromeDriverService.Builder().usingDriverExecutable(new File(chromeDriver)).usingAnyFreePort().build();