瀏覽代碼

快手-盯盘-有效、上新修改

yangzian 3 年之前
父節點
當前提交
6bf1b1c18d

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

@@ -44,7 +44,7 @@ public interface MaterialStareMapper {
     List<KuaiShouOperateVo> getKuaiShouOperateInfo(@Param("startDate")Long startDate, @Param("endDate")Long endDate, @Param("list")Set<String> operatorUserIds);
 
     //查看 快手 有效 计划 组
-    JSONObject getKuaiShouAccountBaseByUserId(@Param("userId")String userId,@Param("startDate")Long startDate, @Param("endDate")Long endDate);
+    JSONObject getKuaiShouAccountBaseByUserId(@Param("userId")String userId,@Param("projectId")String projectId,@Param("accountId")String accountId,@Param("startDate")Long startDate, @Param("endDate")Long endDate);
 
     //快手 -查询 项目 数据信息
     List<KuaiShouOperateProjectVo> getKuaiShouOperateProjectInfo(@Param("startDate")Long startDate, @Param("endDate")Long endDate, @Param("projectId")String projectId,@Param("list")Set<String> operatorUserIds);

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

@@ -155,13 +155,22 @@
         `jeecg-boot`.ctop_user_allocation u
         WHERE abi.account_id = u.account_id
         and u.account_status = 0
-        and abi.user_id = #{userId}
         <if test="startDate != null and startDate != '' ">
             and abi.stat_date &gt;= #{startDate}
         </if>
         <if test="endDate != null and endDate != '' ">
             and abi.stat_date &lt;= #{endDate}
         </if>
+        <if test="userId != null and userId != '' ">
+            and abi.user_id = #{userId}
+        </if>
+        <if test="projectId != null and projectId != '' ">
+            and abi.project_id = #{projectId}
+        </if>
+        <if test="accountId != null and accountId != '' ">
+            and abi.account_id = #{accountId}
+        </if>
+
     </select>
 
 

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

@@ -369,12 +369,10 @@ public class MaterialStareServiceImpl implements MaterialStareService {
         for (KuaiShouOperateVo operate : listOperate) {
 
             //查询 有效 上新计划 上新组
-            JSONObject newEffect = materialStareMapper.getKuaiShouAccountBaseByUserId(operate.getUserId(),startDate,entDate);
-            if (!Check.isNull(newEffect)){
-                operate.setNewEffectNum(newEffect.getInteger("newEffectNum"));//有效
-                operate.setNewCampaignNum(newEffect.getInteger("newCampaignNum"));//计划
-                operate.setNewUnitNum(newEffect.getInteger("newUnitNum"));//组
-            }
+            JSONObject newEffect = materialStareMapper.getKuaiShouAccountBaseByUserId(operate.getUserId(),null,null,startDate,entDate);
+            operate.setNewEffectNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newEffectNum"));//有效
+            operate.setNewCampaignNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newCampaignNum"));//计划
+            operate.setNewUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newUnitNum"));//组
 
             Set<String> userSet = new HashSet<String>(){{
                 add(operate.getUserId());
@@ -415,12 +413,10 @@ public class MaterialStareServiceImpl implements MaterialStareService {
         for (KuaiShouOperateVo operate : listOperate) {
 
             //查询 有效 上新计划 上新组
-            JSONObject newEffect = materialStareMapper.getKuaiShouAccountBaseByUserId(operate.getUserId(),startDate,entDate);
-            if (!Check.isNull(newEffect)){
-                operate.setNewEffectNum(newEffect.getInteger("newEffectNum"));//有效
-                operate.setNewCampaignNum(newEffect.getInteger("newCampaignNum"));//计划
-                operate.setNewUnitNum(newEffect.getInteger("newUnitNum"));//组
-            }
+            JSONObject newEffect = materialStareMapper.getKuaiShouAccountBaseByUserId(operate.getUserId(),null,null,startDate,entDate);
+            operate.setNewEffectNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newEffectNum"));//有效
+            operate.setNewCampaignNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newCampaignNum"));//计划
+            operate.setNewUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newUnitNum"));//组
 
             Set<String> userSet = new HashSet<String>(){{
                 add(operate.getUserId());
@@ -490,12 +486,10 @@ public class MaterialStareServiceImpl implements MaterialStareService {
             for (KuaiShouOperateProjectVo projectInfo : listOperate) {
 
                 //查询 有效 上新视频 爆款视频
-                JSONObject newEffect = materialStareMapper.getKuaiShouAccountBaseByUserId(projectInfo.getUserId(),startDate,entDate);
-                if (!Check.isNull(newEffect)){
-                    projectInfo.setNewEffectNum(newEffect.getInteger("newEffectNum"));//有效
-                    projectInfo.setNewVideoNum(newEffect.getInteger("newVideoNum"));//上新
-                    projectInfo.setNewHotNum(newEffect.getInteger("newHotNum"));//爆款
-                }
+                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"));//爆款
 
 
                 String projectId = projectInfo.getProjectId();
@@ -574,13 +568,10 @@ public class MaterialStareServiceImpl implements MaterialStareService {
             for (KuaiShouOperateAccountVo accountInfo : listOperate) {
 
                 //查询 有效 上新视频 爆款视频
-                JSONObject newEffect = materialStareMapper.getKuaiShouAccountBaseByUserId(accountInfo.getUserId(),startDate,entDate);
-                if (!Check.isNull(newEffect)){
-                    accountInfo.setNewEffectNum(newEffect.getInteger("newEffectNum"));//有效
-                    accountInfo.setNewVideoNum(newEffect.getInteger("newVideoNum"));//上新
-                    accountInfo.setNewHotNum(newEffect.getInteger("newHotNum"));//爆款
-                }
-
+                JSONObject newEffect = materialStareMapper.getKuaiShouAccountBaseByUserId(null,null,String.valueOf(accountInfo.getAccountId()),startDate,entDate);
+                accountInfo.setNewEffectNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newEffectNum"));//有效
+                accountInfo.setNewVideoNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newVideoNum"));//上新
+                accountInfo.setNewHotNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newHotNum"));//爆款
 
                 long accountId = accountInfo.getAccountId();
                 List<KuaiShouOperateAccountVo> accountYearOnYearInfo = materialStareMapper.getKuaiShouOperateAccountInfo(lastTimeStart,lastTimeEnd,projectId,accountId,operatorUserIds);