Browse Source

Merge remote-tracking branch 'origin/master'

yumeng 2 years ago
parent
commit
4879828234

+ 23 - 2
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/controller/KuaiShouMaterialStareController.java

@@ -2,6 +2,7 @@ package org.jeecg.ctop.material.controller;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.poi.hssf.usermodel.HSSFCell;
 import org.apache.poi.hssf.usermodel.HSSFCellStyle;
@@ -27,6 +28,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.BufferedOutputStream;
 import java.io.OutputStream;
 import java.net.URLEncoder;
+import java.text.ParseException;
 import java.util.List;
 import java.util.Map;
 
@@ -131,7 +133,7 @@ public class KuaiShouMaterialStareController {
      * @time: 2022/2/17
      */
     @GetMapping("/getKuaiShouOperateProjectInfo")
-    public Result<JSONObject> getKuaiShouOperateProjectInfo(@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
+    public Result<Object> getKuaiShouOperateProjectInfo(@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
                                                             @RequestParam(name = "pageSize", defaultValue = "10") int pageSize,
                                                             @RequestParam(name = "mediaType", defaultValue = "2") String mediaType,
                                                             @RequestParam(name = "startTime") String startTime,
@@ -142,6 +144,25 @@ public class KuaiShouMaterialStareController {
     }
 
 
+
+
+    @GetMapping("/getKuaiShouOperateProjectInfo2")
+    public Result<Object> getKuaiShouOperateProjectInfo2(@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
+                                                            @RequestParam(name = "pageSize", defaultValue = "10") int pageSize,
+                                                            @RequestParam(name = "mediaType", defaultValue = "2") String mediaType,
+                                                            @RequestParam(name = "startTime") String startTime,
+                                                            @RequestParam(name = "endTime") String endTime,
+                                                            @RequestParam(name = "userId") String userId) {
+
+        try {
+            List<KuaiShouOperateProjectVo> list = materialStareService.getOperateProjectInfo(pageNum, pageSize, mediaType, startTime, endTime, userId);
+            return Result.successMsg("运营项目列表数据查询成功。", new PageInfo<>(list));
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+    }
+
     /**
      * @param pageNum
      * @param pageSize
@@ -359,7 +380,7 @@ public class KuaiShouMaterialStareController {
                 cell.setCellStyle(style);          //内容居中
             }
 
-            List<KuaiShouOperateProjectVo> resultList = materialStareService.exportKuaiShouOperateProjectInfo(mediaType, startTime, endTime, userId);
+            List<KuaiShouOperateProjectVo> resultList = materialStareService.getOperateProjectInfo(1, 99999, mediaType, startTime, endTime, userId);
 
             for (int j = 0; j < resultList.size(); j++) {
                 KuaiShouOperateProjectVo projectVo = resultList.get(j);

+ 1 - 0
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/entity/vo/KuaiShouOperateProjectVo.java

@@ -134,6 +134,7 @@ public class KuaiShouOperateProjectVo {
 
     @ApiModelProperty(value = "版位数据")
     private List<JSONObject> adSceneDate;
+    private String adSceneDateStr;
     private String jiLishiPin;
     private String kaiPing;
     private String souSuo;

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

@@ -159,4 +159,11 @@ public interface MaterialStareMapper {
 
     List<String> getAllOperationByMediaId(@Param("mediaId") String mediaId);
 
+    List<KuaiShouOperateProjectVo> getBytedanceOperateProjectInfoNew(Map<String, Object> parameterMap);
+
+    List<Long> getBytedanceProjectList(Map<String, Object> parameterMap);
+
+    List<Long> getKuaishouProjectList(Map<String, Object> parameterMap);
+
+    List<KuaiShouOperateProjectVo> getKuaiShouOperateProjectInfoNew(Map<String, Object> parameterMap);
 }

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

@@ -1866,4 +1866,365 @@
     </select>
 
 
+    <select id="getBytedanceOperateProjectInfoNew"
+            resultType="org.jeecg.ctop.material.entity.vo.KuaiShouOperateProjectVo">
+        SELECT
+        COUNT( DISTINCT t1.account_id ) AS 'accountNum',
+        COUNT( DISTINCT t1.user_id ) AS 'userNum',
+        t1.project_id AS 'projectId',
+        t1.project_name AS 'projectName',
+        SUM( t1.cost ) AS 'totalCost',
+        t2.inventory,
+        t0.realname AS 'userName',
+        CONCAT(IFNULL(ROUND(((SUM( t1.cost )-t3.totalCost) / t3.totalCost) * 100,2),0),'%') AS 'yearOnYear',
+        CONCAT(IFNULL(ROUND(((SUM( t1.cost )-t5.totalCost) / t5.totalCost) * 100,2),0),'%') AS 'equallyRate',
+        t4.*
+        FROM
+        ${tableName} t1
+        LEFT JOIN `jeecg-boot`.sys_user t0 on t1.user_id = t0.id
+        LEFT JOIN (
+        SELECT project_id,
+        group_concat(concat(inventory_name,':',cost)) as 'inventory'
+        from (
+        select project_id,inventory_name,sum(cost) as cost from
+        application.bytedance_advertiser_inventory_report_daily_dw
+        where cost > 0
+        <if test="startDate != null and startDate != '' ">
+            and stat_datetime &gt;= #{startDate}
+        </if>
+        <if test="endDate != null and endDate != '' ">
+            and stat_datetime &lt;= #{endDate}
+        </if>
+        <if test='projectIds!=null and projectIds.size()>0'>
+            AND project_id IN
+            <foreach collection="projectIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        group by project_id, inventory_name
+        ORDER BY cost desc
+        )t
+        group by project_id
+        ) t2 on t1.project_id = t2.project_id
+        LEFT JOIN (
+        SELECT
+        project_id,
+        SUM(cost) AS totalCost
+        FROM
+        ${tableName}
+        WHERE cost > 0
+        AND stat_datetime >= #{lastTimeStart}
+        AND stat_datetime &lt;= #{lastTimeEnd}
+        <if test="hour != null and hour != '' ">
+            AND `hour` &lt;= #{hour}
+        </if>
+        <if test='projectIds!=null and projectIds.size()>0'>
+            AND project_id IN
+            <foreach collection="projectIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        GROUP BY project_id
+        ) t3 ON t1.project_id = t3.project_id
+        LEFT JOIN (
+        SELECT tt1.project_id as 'pid' ,
+        IFNULL(SUM(tt1.new_effect_num),0) as 'newEffectNum',
+        IFNULL(SUM(tt1.new_campaign_num),0) as 'newCampaignNum',
+        IFNULL(SUM(tt1.new_ad_num),0)-IFNULL(SUM(tt1.trust_campaign_num),0) as 'trustUnitNum',
+        IFNULL(SUM(tt1.new_video_num),0) AS 'newVideoNum',
+        IFNULL(SUM(tt1.new_hot_num),0) AS 'newHotNum',
+        IFNULL(SUM(tt1.new_cpd_project_num),0) AS 'newProjectNum',
+        IFNULL(SUM(tt1.new_ad_num),0)+IFNULL(SUM(tt1.promotion_num),0) AS 'newUnitNum'
+        from application.app_bytedance_account_base_info_d tt1
+        LEFT JOIN `jeecg-boot`.ctop_user_allocation tt2 ON tt1.account_id = tt2.account_id
+        WHERE tt2.account_status = 0
+        <if test="startDate != null and startDate != '' ">
+            and tt1.stat_date &gt;= #{startDate}
+        </if>
+        <if test="endDate != null and endDate != '' ">
+            and tt1.stat_date &lt;= #{endDate}
+        </if>
+        <if test='projectIds!=null and projectIds.size()>0'>
+            AND tt1.project_id IN
+            <foreach collection="projectIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        GROUP BY tt1.project_id
+        ) t4 ON t1.project_id = t4.pid
+        LEFT JOIN (
+        SELECT
+        project_id,
+        SUM(cost) AS totalCost
+        FROM
+        ${tableName}
+        WHERE cost > 0
+        AND stat_datetime >= #{startEqually}
+        AND stat_datetime &lt;= #{endEqually}
+        <if test='projectIds!=null and projectIds.size()>0'>
+            AND project_id IN
+            <foreach collection="projectIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        GROUP BY project_id
+        ) t5 ON t1.project_id = t5.project_id
+        WHERE t1.cost > 0
+        <if test="startDate != null and startDate != '' ">
+            and t1.stat_datetime &gt;= #{startDate}
+        </if>
+        <if test="endDate != null and endDate != '' ">
+            and t1.stat_datetime &lt;= #{endDate}
+        </if>
+        <if test="hour != null and hour != '' ">
+            AND `hour` &lt;= #{hour}
+        </if>
+        <if test='projectIds!=null and projectIds.size()>0'>
+            AND t1.project_id IN
+            <foreach collection="projectIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        GROUP BY t1.project_id
+        ORDER BY SUM(t1.cost) DESC
+    </select>
+
+    <select id="getBytedanceProjectList" resultType="Long">
+        SELECT
+               project_id
+        FROM
+        application.bytedance_advertiser_report_daily_dw
+        WHERE cost > 0
+        <if test="startDate != null and startDate != '' ">
+            and stat_datetime &gt;= #{startDate}
+        </if>
+        <if test="endDate != null and endDate != '' ">
+            and stat_datetime &lt;= #{endDate}
+        </if>
+        <if test='userIds!=null and userIds.size()>0'>
+            AND user_id IN
+            <foreach collection="userIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        GROUP BY project_id
+    </select>
+
+    <select id="getKuaishouProjectList" resultType="Long">
+        SELECT
+               project_id
+        FROM
+        application.kuaishou_account_report_daily_dw d
+        WHERE charge > 0
+        <if test="startDate != null and startDate != '' ">
+            and stat_date &gt;= #{startDate}
+        </if>
+        <if test="endDate != null and endDate != '' ">
+            and stat_date &lt;= #{endDate}
+        </if>
+        <if test='userIds!=null and userIds.size()>0'>
+            AND user_id IN
+            <foreach collection="userIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        GROUP BY project_id
+    </select>
+
+
+
+
+    <select id="getKuaiShouOperateProjectInfoNew" resultType="org.jeecg.ctop.material.entity.vo.KuaiShouOperateProjectVo">
+        SELECT
+        t1.project_name AS projectName,
+        t1.project_id AS  projectId,
+        SUM(t1.charge) AS totalCost,
+        COUNT(DISTINCT t1.account_id) AS accountNum,
+        COUNT(DISTINCT t1.user_id) AS userNum,
+        CONCAT(IFNULL(ROUND(((SUM(t1.charge )-t2.totalCost) / t2.totalCost) * 100,2),0),'%') AS 'yearOnYear',
+        CONCAT(IFNULL(ROUND(((SUM(t1.charge )-t3.totalCost) / t3.totalCost) * 100,2),0),'%') AS 'equallyRate',
+        IFNULL(newEffectNum,0) as 'newEffectNum',
+        IFNULL(newCampaignNum,0) as 'newCampaignNum',
+        IFNULL(newUnitNum,0) as 'newUnitNum',
+        IFNULL(newVideoNum,0) as 'newVideoNum',
+        IFNULL(newHotNum,0) as 'newHotNum',
+        IFNULL(trustUnitNum,0) as 'trustUnitNum',
+        IFNULL(t5.adspNum,0) as 'adspNum',
+        IFNULL(t6.mediaNum,0) as 'mediaNum',
+        t7.adSceneDate as 'adSceneDateStr'
+        FROM
+        ${tableName} t1
+        LEFT JOIN (
+        SELECT
+        project_id,
+        SUM(charge) AS totalCost
+        FROM
+        ${tableName}
+        WHERE charge > 0
+        <if test="lastTimeStart != null and lastTimeStart != '' ">
+            and stat_date &gt;= #{lastTimeStart}
+        </if>
+        <if test="lastTimeEnd != null and lastTimeEnd != '' ">
+            and stat_date &lt;= #{lastTimeEnd}
+        </if>
+        <if test='projectIds!=null and projectIds.size()>0'>
+            AND project_id IN
+            <foreach collection="projectIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="hour != null and hour != '' ">
+            AND `hour` &lt;= #{hour}
+        </if>
+        GROUP BY project_id
+        ) t2 ON t1.project_id = t2.project_id
+        LEFT JOIN (
+        SELECT
+        project_id,
+        SUM(charge) AS totalCost
+        FROM
+        application.kuaishou_account_report_daily_dw
+        WHERE charge > 0
+        <if test="startEqually != null and startEqually != '' ">
+            and stat_date &gt;= #{startEqually}
+        </if>
+        <if test="endEqually != null and endEqually != '' ">
+            and stat_date &lt;= #{endEqually}
+        </if>
+        <if test='projectIds!=null and projectIds.size()>0'>
+            AND project_id IN
+            <foreach collection="projectIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        GROUP BY project_id
+        ) t3 ON t1.project_id = t3.project_id
+        LEFT JOIN (
+        SELECT project_id as 'pid',
+        IFNULL(SUM(new_effect_num),0) as newEffectNum,
+        IFNULL(SUM(new_campaign_num),0) as newCampaignNum,
+        IFNULL(SUM(new_unit_num),0) as newUnitNum,
+        IFNULL(SUM(new_video_num),0) AS newVideoNum,
+        IFNULL(SUM(new_hot_num),0) AS newHotNum,
+        IFNULL(SUM(trust_unit_num),0) AS trustUnitNum
+        from application.app_kuaishou_account_base_info_d
+        <where>
+            <if test="startDate != null and startDate != '' ">
+                and stat_date &gt;= #{startDate}
+            </if>
+            <if test="endDate != null and endDate != '' ">
+                and stat_date &lt;= #{endDate}
+            </if>
+            <if test='projectIds!=null and projectIds.size()>0'>
+                AND project_id IN
+                <foreach collection="projectIds" item="item" separator=","
+                         open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+        GROUP BY project_id
+        )t4 ON t1.project_id = t4.pid
+        LEFT JOIN (
+        SELECT
+        project_id,
+        IFNULL( SUM( material_num ), 0 ) 'adspNum'
+        FROM
+        application.new_material_num_in_project
+        <where>
+            <if test="startDate != null and startDate != '' ">
+                and stat_date &gt;= #{startDate}
+            </if>
+            <if test="endDate != null and endDate != '' ">
+                and stat_date &lt;= #{endDate}
+            </if>
+            <if test='projectIds!=null and projectIds.size()>0'>
+                AND project_id IN
+                <foreach collection="projectIds" item="item" separator=","
+                         open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+        GROUP BY project_id
+        )t5 ON t1.project_id = t5.project_id
+        LEFT JOIN (
+        SELECT
+        dimension,
+        IFNULL( SUM( material_upload_media_num ), 0 ) 'mediaNum'
+        FROM
+        application.today_material_upload_num
+        <where>
+        <if test="startDate != null and startDate != '' ">
+            and stat_date &gt;= #{startDate}
+        </if>
+        <if test="endDate != null and endDate != '' ">
+            and stat_date &lt;= #{endDate}
+        </if>
+        <if test='projectIds!=null and projectIds.size()>0'>
+            AND dimension IN
+            <foreach collection="projectIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        </where>
+        GROUP BY dimension
+        )t6 ON t1.project_id = t6.dimension
+        LEFT JOIN (
+        select project_id,CONCAT('[',group_concat(adSceneDate) ,']') as 'adSceneDate' from
+        (
+        SELECT
+        project_id,
+        json_object('adSceneCost',IFNULL(SUM(charge),0),'adSceneName',ad_scene) as 'adSceneDate'
+        FROM
+        application.app_kuaishou_account_ad_scene_report_d
+        WHERE  ad_scene!='全部'
+        <if test="startDate != null and startDate != '' ">
+            and stat_date &gt;= #{startDate}
+        </if>
+        <if test="endDate != null and endDate != '' ">
+            and stat_date &lt;= #{endDate}
+        </if>
+        <if test='projectIds!=null and projectIds.size()>0'>
+            AND project_id IN
+            <foreach collection="projectIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        GROUP BY project_id,ad_scene
+        order by project_id
+        )t
+        group by project_id
+        ) t7 ON t1.project_id = t7.project_id
+        WHERE t1.charge > 0
+        <if test="startDate != null and startDate != '' ">
+            and t1.stat_date &gt;= #{startDate}
+        </if>
+        <if test="endDate != null and endDate != '' ">
+            and t1.stat_date &lt;= #{endDate}
+        </if>
+        <if test='projectIds!=null and projectIds.size()>0'>
+            AND t1.project_id IN
+            <foreach collection="projectIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="hour != null and hour != '' ">
+            AND `hour` &lt;= #{hour}
+        </if>
+        GROUP BY t1.project_id
+        ORDER BY SUM(t1.charge) DESC
+    </select>
 </mapper>

+ 3 - 0
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/MaterialStareService.java

@@ -8,6 +8,7 @@ import org.jeecg.ctop.material.entity.vo.KuaiShouOperateProjectVo;
 import org.springframework.web.bind.annotation.RequestParam;
 
 import javax.servlet.http.HttpServletResponse;
+import java.text.ParseException;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -58,4 +59,6 @@ public interface MaterialStareService {
     Result getOperationGroupData(String userId,String mediaType,String startTime, String endTime, Integer pageNum, Integer pageSize);
     Result exportOperationGroupData(String userId,String mediaType,String startTime, String endTime,HttpServletResponse response);
 
+    List<KuaiShouOperateProjectVo> getOperateProjectInfo(Integer pageNum, int pageSize, String mediaType, String startTime, String endTime, String userId) throws ParseException;
+
 }

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

@@ -3,6 +3,7 @@ package org.jeecg.ctop.material.service.impl;
 
 import cn.afterturn.easypoi.excel.ExcelExportUtil;
 import cn.afterturn.easypoi.excel.entity.ExportParams;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
@@ -25,9 +26,11 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
+import java.lang.reflect.Type;
 import java.math.BigDecimal;
 import java.net.URLEncoder;
 import java.text.DecimalFormat;
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
@@ -731,7 +734,7 @@ public class MaterialStareServiceImpl implements MaterialStareService {
                         List<KuaiShouOperateProjectVo> projectYearOnYearInfoNow = materialStareMapper.getBytedanceOperateProjectInfoHour(startDate, entDate, hour, projectId, operatorUserIds);
                         List<KuaiShouOperateProjectVo> projectYearOnYearInfoLast = materialStareMapper.getBytedanceOperateProjectInfoHour(lastTimeStart, lastTimeEnd, hour, projectId, operatorUserIds);
                         if (!Check.isNull(projectYearOnYearInfoNow) && !Check.isNull(projectYearOnYearInfoLast)) {
-                            Double yearOnYearD = (projectYearOnYearInfoNow.get(0).getTotalCost() - projectYearOnYearInfoLast.get(0).getTotalCost()) / projectYearOnYearInfoNow.get(0).getTotalCost();
+                            Double yearOnYearD = (projectYearOnYearInfoNow.get(0).getTotalCost() - projectYearOnYearInfoLast.get(0).getTotalCost()) / projectYearOnYearInfoLast.get(0).getTotalCost();
                             yearOnYear = decimalFormat.format(yearOnYearD);
                         }
                         projectInfo.setYearOnYear(yearOnYear);
@@ -1779,6 +1782,82 @@ public class MaterialStareServiceImpl implements MaterialStareService {
         return Result.errorMsg("哎呀,查询失败了。");
     }
 
+    @Override
+    public List<KuaiShouOperateProjectVo> getOperateProjectInfo(Integer pageNum, int pageSize, String mediaType, String startTime, String endTime, String userId) throws ParseException {
+        DecimalFormat decimalFormat = new DecimalFormat("0.00%");
+        long now = Long.valueOf(DateUtils.getDateInteger(DateUtils.getDate("yyyy-MM-dd")));
+        List<KuaiShouOperateProjectVo> listOperate = new ArrayList<>();
+            //查询当前人员所有下级
+            Set<String> operatorUserIds = getAffiliateId(userId);
+            //2022-02-15 ==>> 20220215
+            long startDate = Long.valueOf(DateUtils.getDateInteger(startTime));
+            long entDate = Long.valueOf(DateUtils.getDateInteger(endTime));
+
+            //计算环比 时间值 上阶段时间 以及 两个日期之间的 间隔天数
+            Map<String, String> lastTime = DateUtils.getStartEndTime(startTime, endTime);
+            long lastTimeStart = Long.valueOf(DateUtils.getDateInteger(lastTime.get("lastTimeStart")));
+            long lastTimeEnd = Long.valueOf(DateUtils.getDateInteger(lastTime.get("lastTimeEnd")));
+            Integer daysBetween = Integer.valueOf(lastTime.get("daysBetween")) + 1;
+
+            Map<String, Object> parameterMap = new HashMap<>();
+            parameterMap.put("startDate", startDate);
+            parameterMap.put("endDate", entDate);
+            parameterMap.put("lastTimeStart", lastTimeStart);
+            parameterMap.put("lastTimeEnd", lastTimeEnd);
+            parameterMap.put("userIds", operatorUserIds);
+            parameterMap.put("startEqually", DateUtils.getDateInteger(DateUtils.addDayParse(String.valueOf(DateUtils.getDateInteger(startTime)), -7)));
+            parameterMap.put("endEqually", DateUtils.getDateInteger(DateUtils.addDayParse(String.valueOf(DateUtils.getDateInteger(endTime)), -7)));
+
+            //头条
+            if (mediaType.equals("1")) {
+                List<Long> projectIds = materialStareMapper.getBytedanceProjectList(parameterMap);
+                if(Check.isNull(projectIds)){
+                    return listOperate;
+                }
+                parameterMap.put("projectIds", projectIds);
+                PageHelper.startPage(pageNum, pageSize);
+                if (startDate == now || entDate == now) {
+                    parameterMap.put("tableName", "application.bytedance_advertiser_report_hourly_dw");
+                    parameterMap.put("hour", DateUtils.getNowHour());
+                } else {
+                    parameterMap.put("tableName", "application.bytedance_advertiser_report_daily_dw");
+                }
+                listOperate = materialStareMapper.getBytedanceOperateProjectInfoNew(parameterMap);
+            }
+            //快手
+            if (mediaType.equals("2")) {
+                List<Long> projectIds = materialStareMapper.getKuaishouProjectList(parameterMap);
+               if(Check.isNull(projectIds)){
+                   return listOperate;
+               }
+                parameterMap.put("projectIds", projectIds);
+                if (startDate == now || entDate == now) {
+                    parameterMap.put("tableName", "application.kuaishou_account_report_hourly_dw");
+                    parameterMap.put("hour", DateUtils.getNowHour());
+                   /* //查询 当天有效 上新计划 上新组
+                    JSONObject newEffect = materialStareMapper.getKuaiShouAccountNowBaseByUserId(null, projectIds.get(0)+"", null, now, now);
+                    int newUnitNumNow = 0;
+                    int trustUnitNum = 0;
+                    newUnitNumNow = Check.isNull(newEffect) ? 0 : newEffect.getInteger("newUnitNum");//组
+                    trustUnitNum = Check.isNull(newEffect) ? 0 : newEffect.getInteger("trustUnitNum");//智能托管*/
+                } else {
+                    parameterMap.put("tableName", "application.kuaishou_account_report_daily_dw");
+                }
+                PageHelper.startPage(pageNum, pageSize);
+                listOperate = materialStareMapper.getKuaiShouOperateProjectInfoNew(parameterMap);
+                for (KuaiShouOperateProjectVo vo : listOperate) {
+                    List<JSONObject> adSceneDate = JSONObject.parseArray( vo.getAdSceneDateStr(), JSONObject.class);
+                    vo.setAdSceneDate(adSceneDate);
+                }
+            }
+            //计算同比 时间值 只支持7天
+            if (daysBetween > 7) {
+                for (KuaiShouOperateProjectVo projectVo : listOperate) {
+                    projectVo.setEquallyRate("-");
+                }
+            }
+         return listOperate;
+    }
 
 //===========================================查询下级员工========================