Browse Source

视频列表listV2接口添加根据项目Id筛选,插入slogan绑定项目id

huangxuechao 4 năm trước cách đây
mục cha
commit
efc4ff1faf

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

@@ -288,6 +288,7 @@ public class MaterialInfoController {
     @GetMapping(value = "/listV2")
     @GetMapping(value = "/listV2")
     public Map<String, Object> queryPageList(String type, Integer status, Long productId, 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,
                                              String startDate, String endDate, String tagCode,
+                                             @RequestParam(name = "projectId", required = false) Long projectId,
                                              @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                              @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                              @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
                                              @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -303,7 +304,7 @@ public class MaterialInfoController {
                 productIds = new ArrayList<>();
                 productIds = new ArrayList<>();
                 productIds.add(productId);
                 productIds.add(productId);
             }
             }
-            return materialInfoService.getListByParams(tagCode, type, status, productIds, materialName, code, startDate, endDate, null, pageNo, pageSize);
+            return materialInfoService.getListByParams(projectId, 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)) {
         } else if ("designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode) || "plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode)) {
             //查询自己所在项目下的数据
             //查询自己所在项目下的数据
             if (null == productId || productId == 0) {
             if (null == productId || productId == 0) {
@@ -313,14 +314,14 @@ public class MaterialInfoController {
                 productIds = new ArrayList<>();
                 productIds = new ArrayList<>();
                 productIds.add(productId);
                 productIds.add(productId);
             }
             }
-            return materialInfoService.getListByParams(tagCode, type, status, productIds, materialName, code, startDate, endDate, null, pageNo, pageSize);
+            return materialInfoService.getListByParams(projectId, tagCode, type, status, productIds, materialName, code, startDate, endDate, null, pageNo, pageSize);
         } else {
         } else {
             //查询自己上传的视频
             //查询自己上传的视频
             if (null != productId && productId != 0) {
             if (null != productId && productId != 0) {
                 productIds = new ArrayList<>();
                 productIds = new ArrayList<>();
                 productIds.add(productId);
                 productIds.add(productId);
             }
             }
-            return materialInfoService.getListByParams(tagCode, type, status, productIds, materialName, code, startDate, endDate, userId, pageNo, pageSize);
+            return materialInfoService.getListByParams(projectId, tagCode, type, status, productIds, materialName, code, startDate, endDate, userId, pageNo, pageSize);
         }
         }
     }
     }
 
 
@@ -511,7 +512,7 @@ public class MaterialInfoController {
             JSONArray slogans = materialInfo.getSlogans();
             JSONArray slogans = materialInfo.getSlogans();
             if(null!=slogans&&!slogans.isEmpty()){
             if(null!=slogans&&!slogans.isEmpty()){
                 LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
                 LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-                slogenInfoService.insertSlogans(materialInfoEntity.getCode(),slogans,user.getId());
+                slogenInfoService.insertSlogans(materialInfoEntity.getProjectId(),materialInfoEntity.getCode(),slogans,user.getId());
             }
             }
         }
         }
         boolean ok = materialInfoService.updateById(materialInfo);
         boolean ok = materialInfoService.updateById(materialInfo);

+ 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> 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("productIds")List<Long> productIds, @Param("materialName")String materialName, @Param("code")String code, @Param("startDate")String startDate, @Param("endDate")String endDate, @Param("userId")String userId);
+    List<MaterialInfo> getListByParams(@Param("projectId")Long projectId, @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);
     JSONArray getIdListByProject(Long projectId);
 }
 }

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

@@ -124,6 +124,9 @@
         <if test="endDate!=null">
         <if test="endDate!=null">
             and matInfo.create_time &lt;= #{endDate}
             and matInfo.create_time &lt;= #{endDate}
         </if>
         </if>
+        <if test="projectId!=null">
+            and matInfo.project_id = #{projectId}
+        </if>
         order by matInfo.create_time desc
         order by matInfo.create_time desc
 
 
     </select>
     </select>

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

@@ -78,7 +78,7 @@ public interface IMaterialInfoService extends IService<MaterialInfo> {
 
 
     List<MaterialInfo> getListByDate(String startDate, String endDate);
     List<MaterialInfo> getListByDate(String startDate, String endDate);
 
 
-    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);
+    Map<String, Object> getListByParams(Long projectId, String tagCode, String type, Integer status, List<Long> projectIds, String materialName, String code, String startDate, String endDate, String userId, Integer pageNo, Integer pageSize);
 
 
     JSONArray getIdListByProject(Long projectId);
     JSONArray getIdListByProject(Long projectId);
 }
 }

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

@@ -773,10 +773,10 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
     }
     }
 
 
     @Override
     @Override
-    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) {
+    public Map<String, Object> getListByParams(Long projectId, 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<>();
         Map<String, Object> result = new HashMap<>();
         PageHelper.startPage(pageNo, pageSize);
         PageHelper.startPage(pageNo, pageSize);
-        List<MaterialInfo> dailyList = materialInfoMapper.getListByParams(tagCode, type, status, productId, materialName, code, startDate, endDate, userId);
+        List<MaterialInfo> dailyList = materialInfoMapper.getListByParams(projectId, tagCode, type, status, productId, materialName, code, startDate, endDate, userId);
         List<MaterialInfo> setList = new ArrayList<>();
         List<MaterialInfo> setList = new ArrayList<>();
         PageInfo<MaterialInfo> pageInfo = new PageInfo<>(dailyList);
         PageInfo<MaterialInfo> pageInfo = new PageInfo<>(dailyList);
         if (null != dailyList && !dailyList.isEmpty()) {
         if (null != dailyList && !dailyList.isEmpty()) {

+ 14 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/BytedanceVideoSlogenInfo.java

@@ -37,6 +37,8 @@ public class BytedanceVideoSlogenInfo {
 
 
 	private String creativeWordIds;
 	private String creativeWordIds;
 
 
+	private Long projectId;
+
 	public BytedanceVideoSlogenInfo(String videoCode, String slogan, String userId, String creativeWordIds) {
 	public BytedanceVideoSlogenInfo(String videoCode, String slogan, String userId, String creativeWordIds) {
 		this.videoCode = videoCode;
 		this.videoCode = videoCode;
 		this.slogan = slogan;
 		this.slogan = slogan;
@@ -48,6 +50,18 @@ public class BytedanceVideoSlogenInfo {
 		this.creativeWordIds = creativeWordIds;
 		this.creativeWordIds = creativeWordIds;
 	}
 	}
 
 
+	public BytedanceVideoSlogenInfo(Long projectId, String videoCode, String slogan, String userId, String creativeWordIds) {
+		this.videoCode = videoCode;
+		this.slogan = slogan;
+		this.createBy = userId;
+		this.updateBy = userId;
+		this.createTime = new Date();
+		this.updateTime = new Date();
+		this.status = 1;
+		this.creativeWordIds = creativeWordIds;
+		this.projectId = projectId;
+	}
+
 	public BytedanceVideoSlogenInfo() {
 	public BytedanceVideoSlogenInfo() {
 	}
 	}
 }
 }

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IBytedanceVideoSlogenInfoService.java

@@ -14,7 +14,7 @@ import java.util.List;
  */
  */
 public interface IBytedanceVideoSlogenInfoService extends IService<BytedanceVideoSlogenInfo> {
 public interface IBytedanceVideoSlogenInfoService extends IService<BytedanceVideoSlogenInfo> {
 
 
-    void insertSlogans(String videoCode, JSONArray slogans, String userId);
+    void insertSlogans(Long projectId, String videoCode, JSONArray slogans, String userId);
 
 
     List<BytedanceVideoSlogenInfo> listByParams(String code, Integer status);
     List<BytedanceVideoSlogenInfo> listByParams(String code, Integer status);
 }
 }

+ 2 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/BytedanceVideoSlogenInfoServiceImpl.java

@@ -22,7 +22,7 @@ import java.util.List;
 @Service
 @Service
 public class BytedanceVideoSlogenInfoServiceImpl extends ServiceImpl<BytedanceVideoSlogenInfoMapper, BytedanceVideoSlogenInfo> implements IBytedanceVideoSlogenInfoService {
 public class BytedanceVideoSlogenInfoServiceImpl extends ServiceImpl<BytedanceVideoSlogenInfoMapper, BytedanceVideoSlogenInfo> implements IBytedanceVideoSlogenInfoService {
     @Override
     @Override
-    public void insertSlogans(String videoCode, JSONArray slogans,String userId){
+    public void insertSlogans(Long projectId, String videoCode, JSONArray slogans,String userId){
         if(null==slogans||slogans.isEmpty()){
         if(null==slogans||slogans.isEmpty()){
             return;
             return;
         }
         }
@@ -32,11 +32,10 @@ public class BytedanceVideoSlogenInfoServiceImpl extends ServiceImpl<BytedanceVi
             title = title.replaceAll("\\{\\{","{");
             title = title.replaceAll("\\{\\{","{");
             title = title.replaceAll("\\}\\}","}");
             title = title.replaceAll("\\}\\}","}");
             String creativeWordIds = Check.isNull(sloganObject.getJSONArray("creative_word_ids")) ? "" : sloganObject.getJSONArray("creative_word_ids").toJSONString();
             String creativeWordIds = Check.isNull(sloganObject.getJSONArray("creative_word_ids")) ? "" : sloganObject.getJSONArray("creative_word_ids").toJSONString();
-            BytedanceVideoSlogenInfo slogenInfo = new BytedanceVideoSlogenInfo(videoCode,title,userId,creativeWordIds);
+            BytedanceVideoSlogenInfo slogenInfo = new BytedanceVideoSlogenInfo(projectId,videoCode,title,userId,creativeWordIds);
             this.save(slogenInfo);
             this.save(slogenInfo);
         }
         }
     }
     }
-
     @Override
     @Override
     public List<BytedanceVideoSlogenInfo> listByParams(String code, Integer status) {
     public List<BytedanceVideoSlogenInfo> listByParams(String code, Integer status) {
         QueryWrapper<BytedanceVideoSlogenInfo>queryWrapper =new QueryWrapper<>();
         QueryWrapper<BytedanceVideoSlogenInfo>queryWrapper =new QueryWrapper<>();