Przeglądaj źródła

盯盘运营经理-项目数据修改智能托管

yangzian 3 lat temu
rodzic
commit
02e99268ca

+ 2 - 1
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/MaterialStareMapper.xml

@@ -183,7 +183,8 @@
  <!-- 查看 快手 当天 有效 计划 组-->
     <select id="getKuaiShouAccountNowBaseByUserId" resultType="com.alibaba.fastjson.JSONObject">
         SELECT abi.account_id ,
-        IFNULL(SUM(abi.new_all_unit_num),0) as newUnitNum
+        IFNULL(SUM(abi.new_all_unit_num),0) as newUnitNum,
+        IFNULL(SUM(abi.new_trush_unit_num),0) as trustUnitNum
         from application.app_kuaishou_account_today_base_info_d abi,
         `jeecg-boot`.ctop_user_allocation u
         WHERE abi.account_id = u.account_id

+ 17 - 4
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/impl/MaterialStareServiceImpl.java

@@ -523,10 +523,12 @@ public class MaterialStareServiceImpl implements MaterialStareService {
 
                 //当天
                 int newUnitNumNow = 0;
+                int trustUnitNum = 0;
                 if (startDate == now || entDate == now){
                     //查询 当天有效 上新计划 上新组
-                    JSONObject newEffect = materialStareMapper.getKuaiShouAccountNowBaseByUserId(operatorUserIds,null,null,now,now);
+                    JSONObject newEffect = materialStareMapper.getKuaiShouAccountNowBaseByUserId(null,projectInfo.getProjectId(),null,now,now);
                     newUnitNumNow = Check.isNull(newEffect) ? 0 : newEffect.getInteger("newUnitNum");//组
+                    trustUnitNum = Check.isNull(newEffect) ? 0 : newEffect.getInteger("trustUnitNum");//智能托管
                 }
 
                 //查询 有效 上新视频 爆款视频
@@ -536,7 +538,7 @@ public class MaterialStareServiceImpl implements MaterialStareService {
                 projectInfo.setNewHotNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newHotNum"));//爆款
 
                 projectInfo.setNewUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newUnitNum")+newUnitNumNow);//基建数
-                projectInfo.setTrustUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("trustUnitNum"));//智能托管
+                projectInfo.setTrustUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("trustUnitNum")+trustUnitNum);//智能托管
 
                 //查看 上传到助手、媒体的素材数量 分版位花费
                 List<JSONObject> materailUpload = materialStareMapper.getKuaiShouMaterailUploadType(projectInfo.getProjectId(),startDate,entDate);
@@ -584,6 +586,7 @@ public class MaterialStareServiceImpl implements MaterialStareService {
 
     public List<KuaiShouOperateProjectVo> exportKuaiShouOperateProjectInfo(String startTime, String endTime, String userId) {
         DecimalFormat decimalFormat = new DecimalFormat("0.00%");
+        long now = Long.valueOf(DateUtils.getDateInteger(DateUtils.getDate("yyyy-MM-dd")));
         try {
             //查询当前人员所有下级
             Set<String> operatorUserIds = getAffiliateId(userId);
@@ -609,14 +612,24 @@ public class MaterialStareServiceImpl implements MaterialStareService {
             List<KuaiShouOperateProjectVo> listOperate = materialStareMapper.getKuaiShouOperateProjectInfo(startDate,entDate,null,operatorUserIds);
             for (KuaiShouOperateProjectVo projectInfo : listOperate) {
 
+                //当天
+                int newUnitNumNow = 0;
+                int trustUnitNum = 0;
+                if (startDate == now || entDate == now){
+                    //查询 当天有效 上新计划 上新组
+                    JSONObject newEffect = materialStareMapper.getKuaiShouAccountNowBaseByUserId(null,projectInfo.getProjectId(),null,now,now);
+                    newUnitNumNow = Check.isNull(newEffect) ? 0 : newEffect.getInteger("newUnitNum");//组
+                    trustUnitNum = Check.isNull(newEffect) ? 0 : newEffect.getInteger("trustUnitNum");//智能托管
+                }
+
                 //查询 有效 上新视频 爆款视频
                 JSONObject newEffect = materialStareMapper.getKuaiShouAccountBaseByUserId(null,projectInfo.getProjectId(),null,startDate,entDate);
                 projectInfo.setNewEffectNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newEffectNum"));//有效
                 projectInfo.setNewVideoNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newVideoNum"));//上新
                 projectInfo.setNewHotNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newHotNum"));//爆款
 
-                projectInfo.setNewUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newUnitNum"));//基建数
-                projectInfo.setTrustUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("trustUnitNum"));//智能托管
+                projectInfo.setNewUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newUnitNum")+newUnitNumNow);//基建数
+                projectInfo.setTrustUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("trustUnitNum")+trustUnitNum);//智能托管
 
                 //查看 上传到助手、媒体的素材数量 分版位花费
                 List<JSONObject> materailUpload = materialStareMapper.getKuaiShouMaterailUploadType(projectInfo.getProjectId(),startDate,entDate);