Bladeren bron

有效素材接口增加是否上传相对应平台字段

hcst_sunzhen 5 jaren geleden
bovenliggende
commit
0121224f6e

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

@@ -18,6 +18,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.shiro.SecurityUtils;
+import org.apache.velocity.runtime.directive.Break;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
@@ -192,6 +193,27 @@ public class MaterialInfoController {
 
         Page<MaterialInfo> page = new Page<>(pageNo, pageSize);
         IPage<MaterialInfo> pageList = materialInfoService.page(page, queryWrapper);
+
+        List<MaterialInfo> materialInfoList = pageList.getRecords();
+        if (materialInfoList.size() != 0){
+            for (MaterialInfo material:materialInfoList){
+                //判断是否已经同步到快手平台
+                Integer kuaishouMaterialUpCount = materialInfoService.getKuaishouUpVideoCount(material.getCode());
+                if (kuaishouMaterialUpCount>0){
+                    material.setKuaishouVideoIsUp(1);
+                }else{
+                    material.setKuaishouVideoIsUp(0);
+                }
+                //判断是否已经同步到抖音平台
+                Integer toutiaoMaterialUpCount = materialInfoService.getToutiaoUpVideoCount(material.getCode());
+                if(toutiaoMaterialUpCount >0){
+                    material.setToutiaoVideoIsUp(1);
+                }else{
+                    material.setToutiaoVideoIsUp(0);
+                }
+            }
+        }
+
         result.setSuccess(true);
         result.setResult(pageList);
         return result;

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

@@ -123,4 +123,8 @@ public class MaterialInfo {
 
     private Integer kuaishouEffiType; //判断是否为快手有效素材0否_1是
 
+    private Integer kuaishouVideoIsUp;  //判断是否已经同步到快手平台0否_1是
+
+    private Integer toutiaoVideoIsUp;  //判断是否已经同步到头条平台0否_1是
+
 }

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

@@ -20,4 +20,8 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> {
     Integer selectCountByMap(Map<String, Object> requestMap);
 
     String getRoleCodeByUserId(@Param("userId") String userId);
+
+    Integer getKuaishouUpVideoCount(@Param("code")String code);
+
+    Integer getToutiaoUpVideoCount(@Param("code")String code);
 }

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

@@ -40,5 +40,22 @@
     )
     </select>
 
+    <select id="getKuaishouUpVideoCount" resultType="java.lang.Integer">
+        select
+        count(1)
+        from
+        ctop_kuaishou_video_get v
+        where
+        v.signature = #{code}
+    </select>
+
+    <select id="getToutiaoUpVideoCount" resultType="java.lang.Integer">
+        select
+        count(1)
+        from
+        ctop_bytedance_video_info v
+        where
+        v.signature = #{code}
+    </select>
 
 </mapper>

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

@@ -3,6 +3,7 @@ package cn.com.ctop.common.module.service;
 import cn.com.ctop.common.module.entity.MaterialInfo;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.Map;
 
@@ -33,4 +34,8 @@ public interface IMaterialInfoService extends IService<MaterialInfo> {
     void getFile(MaterialInfo materialInfo);
 
     void setExcellent(String id, Integer excellent);
+
+    Integer getKuaishouUpVideoCount(@Param("code")String code);
+
+    Integer getToutiaoUpVideoCount(@Param("code")String code);
 }

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

@@ -412,4 +412,14 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
         info.setExcellent(excellent);
         this.updateById(info);
     }
+
+    @Override
+    public Integer getKuaishouUpVideoCount(String code) {
+        return materialInfoMapper.getKuaishouUpVideoCount(code);
+    }
+
+    @Override
+    public Integer getToutiaoUpVideoCount(String code) {
+        return materialInfoMapper.getToutiaoUpVideoCount(code);
+    }
 }