Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

syh 5 gadi atpakaļ
vecāks
revīzija
b061867cd0

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

@@ -7,6 +7,7 @@ import cn.com.ctop.common.module.service.IMaterialInfoService;
 import cn.com.ctop.common.module.service.IMaterialParameterService;
 import cn.com.ctop.common.module.service.IMaterialTagService;
 import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.JsonUtil;
 import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
@@ -24,6 +25,10 @@ import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.ctop.entity.ByteDanceCleanMaterialReport;
+import org.jeecg.modules.ctop.entity.KuaiShouCleanMaterialReport;
+import org.jeecg.modules.ctop.service.IByteDanceCleanMaterialReportService;
+import org.jeecg.modules.ctop.service.IKuaiShouCleanMaterialReportService;
 import org.jeecg.modules.ctop.service.IProjectMemberService;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -67,6 +72,10 @@ public class MaterialInfoController {
     private IMaterialParameterService materialParameterService;
     @Autowired
     private IMaterialTagService materialTagService;
+    @Autowired
+    private IByteDanceCleanMaterialReportService byteDanceCleanMaterialReportService;
+    @Autowired
+    private IKuaiShouCleanMaterialReportService kuaiShouCleanMaterialReportService;
 
     @GetMapping(value = "/report")
     public JSONObject report(String userId) {
@@ -193,22 +202,41 @@ public class MaterialInfoController {
 
         List<MaterialInfo> materialInfoList = pageList.getRecords();
 
-        if (materialInfoList.size() != 0){
-            for (MaterialInfo material:materialInfoList){
+        if (materialInfoList.size() != 0) {
+            for (MaterialInfo material : materialInfoList) {
                 //判断是否已经同步到快手平台
                 Integer kuaishouMaterialUpCount = materialInfoService.getKuaishouUpVideoCount(material.getCode());
-                if (kuaishouMaterialUpCount>0){
+                if (kuaishouMaterialUpCount > 0) {
                     material.setKuaishouVideoIsUp(1);
-                }else{
+                } else {
                     material.setKuaishouVideoIsUp(0);
                 }
                 //判断是否已经同步到抖音平台
                 Integer toutiaoMaterialUpCount = materialInfoService.getToutiaoUpVideoCount(material.getCode());
-                if(toutiaoMaterialUpCount >0){
+                if (toutiaoMaterialUpCount > 0) {
                     material.setToutiaoVideoIsUp(1);
-                }else{
+                } else {
                     material.setToutiaoVideoIsUp(0);
                 }
+
+
+                ByteDanceCleanMaterialReport byteDance = byteDanceCleanMaterialReportService.getById(material.getCode());
+                if (!Check.isNull(byteDance)) {
+                    String byteDanceString = JsonUtil.objectToJson(byteDance);
+                    material.setByteDance(JSONObject.parseObject(byteDanceString));
+                }
+
+                KuaiShouCleanMaterialReport kuaiShou = kuaiShouCleanMaterialReportService.getById(material.getCode());
+                if (!Check.isNull(kuaiShou)) {
+                    String kuaiShouString = JsonUtil.objectToJson(kuaiShou);
+                    material.setKuaiShou(JSONObject.parseObject(kuaiShouString));
+                }
+
+                /*JSONObject generalizationJson = materialInfoService.getGeneralizationInfo(material.getCode());
+                if (!Check.isNull(generalizationJson)) {
+                    material.setGeneralization(generalizationJson);
+                }*/
+
             }
         }
 
@@ -217,6 +245,7 @@ public class MaterialInfoController {
         return result;
     }
 
+
     /**
      * 添加
      *

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

@@ -1706,8 +1706,8 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
         String startTime = timeMap.get("startDate");
         String endTime = timeMap.get("endDate");
 
-        //1 获取快手下所有人
-        List<UserDto2> userDto2List = userEfficientVideoMapMapper.getKuaishouYunyingDepartUserInfo();
+        //1 获取头条下所有优化师
+        List<UserDto2> userDto2List = userEfficientVideoMapMapper.getToutiaoYunyingDepartUserInfo();
         //2 循环所有人,并查询出每个人的有效视频数、总视频数、总消耗
         for (UserDto2 userDto : userDto2List) {
             BigDecimal cost = null;

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

@@ -1,5 +1,6 @@
 package cn.com.ctop.common.module.entity;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -129,4 +130,10 @@ public class MaterialInfo {
     @TableField(exist = false)
     private Integer toutiaoVideoIsUp;  //判断是否已经同步到头条平台0否_1是
 
+    @TableField(exist = false)
+    private JSONObject byteDance;
+
+    @TableField(exist = false)
+    private JSONObject kuaiShou;
+
 }

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

@@ -1,6 +1,7 @@
 package cn.com.ctop.common.module.mapper;
 
 import cn.com.ctop.common.module.entity.MaterialInfo;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -21,7 +22,9 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> {
 
     String getRoleCodeByUserId(@Param("userId") String userId);
 
-    Integer getKuaishouUpVideoCount(@Param("code")String code);
+    Integer getKuaishouUpVideoCount(@Param("code") String code);
 
-    Integer getToutiaoUpVideoCount(@Param("code")String code);
+    Integer getToutiaoUpVideoCount(@Param("code") String code);
+
+    JSONObject getGeneralizationInfo(@Param("code") String code);
 }

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

@@ -58,4 +58,33 @@
         v.signature = #{code}
     </select>
 
+
+    <select id="getGeneralizationInfo" resultType="com.alibaba.fastjson.JSONObject">
+     SELECT
+	 SUM(t.cost) cost,
+	 SUM(t.photoShow) photoShow,
+	 SUM(t.photoClick) photoClick
+      FROM
+	 (
+		SELECT
+		cost cost,
+        show_num photoShow,
+        click photoClick
+		FROM
+		ctop_bytedance_clean_material_report
+		WHERE
+		id = #{code}
+		UNION ALL
+		SELECT
+		charge cost,
+        photo_show photoShow,
+        photo_click photoClick
+		FROM
+		ctop_kuaishou_clean_material_report
+		WHERE
+		id = #{code}
+	  )t
+    </select>
+
+
 </mapper>

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

@@ -38,4 +38,6 @@ public interface IMaterialInfoService extends IService<MaterialInfo> {
     Integer getKuaishouUpVideoCount(@Param("code")String code);
 
     Integer getToutiaoUpVideoCount(@Param("code")String code);
+
+    JSONObject getGeneralizationInfo(String code);
 }

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

@@ -422,4 +422,15 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
     public Integer getToutiaoUpVideoCount(String code) {
         return materialInfoMapper.getToutiaoUpVideoCount(code);
     }
+
+
+    /**
+     * 获取素材概括信息
+     * @param code
+     * @return
+     */
+    @Override
+    public JSONObject getGeneralizationInfo(String code) {
+        return materialInfoMapper.getGeneralizationInfo(code);
+    }
 }