Explorar o código

设计人员报表-骄阳

zhaoxian %!s(int64=4) %!d(string=hai) anos
pai
achega
30e4d7d2cf

+ 36 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouVideoGetController.java

@@ -27,7 +27,15 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
 import org.jeecgframework.poi.excel.entity.ImportParams;
 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.servlet.ModelAndView;
@@ -37,7 +45,12 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: 快手-获取视频接口
@@ -80,6 +93,25 @@ public class KuaiShouVideoGetController {
         return result;
     }
 
+    /**
+     * 真人、制作标签素材统计报表
+     *
+     * @return
+     */
+    @GetMapping(value = "/labelMaterialList")
+    public Result<Object> labelMaterialList(String realname, String roleCode, String startTime, String endTime, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
+        try {
+            if (Check.isNull(startTime) || Check.isNull(endTime)) {
+                return Result.error("请选择查询日期");
+            }
+            return kuaiShouReportDailyMaterialService.labelMaterialList(realname, roleCode, startTime, endTime, pageNo, pageSize);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+
+    }
+
 
     @GetMapping(value = "/getVideoList")
     public Result<PageInfo<KuaiShouVideoGetVo>> getVideoList(Long accountId,
@@ -116,8 +148,8 @@ public class KuaiShouVideoGetController {
             requestMap.put("orderBy", orderBy);
             requestMap.put("materialType", materialType);
             requestMap.put("channelType", channelType);
-            if(!Check.isNull(signatures)){
-                String[] signatureArray =  signatures.split(",");
+            if (!Check.isNull(signatures)) {
+                String[] signatureArray = signatures.split(",");
                 requestMap.put("signatureList", signatureArray);
             }
             if ("time".equals(orderBy)) {

+ 9 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouReportDailyMaterialMapper.java

@@ -31,11 +31,17 @@ public interface KuaiShouReportDailyMaterialMapper extends BaseMapper<KuaiShouRe
 
     void batchReplace(@Param("addList") List<KuaiShouReportDailyMaterial> addList);
 
-    KuaiShouReportDailyMaterial getEtlDataByParams(@Param("signature")String signature, @Param("date") String date,@Param("projectId")Long projectId);
+    KuaiShouReportDailyMaterial getEtlDataByParams(@Param("signature") String signature, @Param("date") String date, @Param("projectId") Long projectId);
 
-    List<KuaiShouReportDailyMaterial> getSignatureByDate(@Param("date")String date);
+    List<KuaiShouReportDailyMaterial> getSignatureByDate(@Param("date") String date);
 
-    List<KuaiShouReportDailyMaterial> getSignatureByDateGroupByProjectId(@Param("date")String date);
+    List<KuaiShouReportDailyMaterial> getSignatureByDateGroupByProjectId(@Param("date") String date);
 
     List<JSONObject> getVideoInfoByList(@Param("photoIdList") List<Long> photoIdList);
+
+    Long labelMaterialListTotal(@Param("realname") String realname, @Param("roleCode") String roleCode, @Param("startTime") String startTime, @Param("endTime") String endTime);
+
+    List<JSONObject> labelMaterialList(@Param("realname") String realname, @Param("roleCode") String roleCode, @Param("startTime") String startTime, @Param("endTime") String endTime);
+
+    JSONObject labelMaterialAll(@Param("realname") String realname, @Param("roleCode") String roleCode, @Param("startTime") String startTime, @Param("endTime") String endTime);
 }

+ 451 - 79
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouReportDailyMaterialMapper.xml

@@ -136,17 +136,37 @@
 
 
     <insert id="loadMaterialDailyReport">
-		LOAD DATA local INFILE  #{localPath}
-	    INTO TABLE ctop_kuaishou_report_daily_material
-		FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
-		IGNORE 1 LINES
-		(photo_id,
-		image_token,
-		cover_url,
-		photo_url,
-		@photo_caption,
-		@creative_material_type_string,
-        @ad_scene,
+        LOAD
+        DATA local INFILE
+        #{localPath}
+        INTO
+        TABLE
+        ctop_kuaishou_report_daily_material
+        FIELDS
+        TERMINATED
+        BY
+        ','
+        enclosed
+        by
+        '"'
+        LINES
+        TERMINATED
+        BY
+        '\n'
+        IGNORE
+        1
+        LINES
+        (
+        photo_id,
+        image_token,
+        cover_url,
+        photo_url,
+        @
+        photo_caption,
+        @
+        creative_material_type_string,
+        @
+        ad_scene,
         charge,
         photo_show,
         aclick,
@@ -164,13 +184,15 @@
         activation,
         submit,
         stat_date,
-        @stat_hour,
+        @
+        stat_hour,
         photo_click,
         photo_click_ratio,
         action_ratio,
         impression_1k_cost,
         photo_click_cost,
-        @click_1k_cost,
+        @
+        click_1k_cost,
         action_cost,
         event_pay_first_day,
         event_pay_purchase_amount_first_day,
@@ -201,43 +223,81 @@
         event_next_day_stay_ratio,
         event_next_day_stay,
         play_3s_ratio,
-        @event_valid_clues,
-        @event_valid_clues_cost,
-        @ad_product_cnt,
-        @event_goods_view,
-        @merchant_reco_fans,
-        @event_order_amount_roi,
-        @event_goods_view_cost,
-        @merchant_reco_fans_cost,
-        @event_new_user_pay,
-        @event_new_user_pay_cost,
-        @event_new_user_pay_ratio,
-        @event_button_click,
-        @event_button_click_cost,
-        @event_button_click_ratio,
-        @play_5s_ratio,
-        @play_end_ratio,
-        @event_order_paid_roi,
-        @event_new_user_jinjian_app,
-        @event_new_user_jinjian_app_cost,
-        @event_new_user_jinjian_app_roi,
-        @event_new_user_credit_grant_app,
-        @event_new_user_credit_grant_app_cost,
-        @event_new_user_credit_grant_app_roi,
-        @event_new_user_jinjian_page,
-        @event_new_user_jinjian_page_cost,
-        @event_new_user_jinjian_page_roi,
-        @event_new_user_credit_grant_page,
-        @event_new_user_credit_grant_page_cost,
-        @event_new_user_credit_grant_page_roi,
-        @event_appoint_form,
-        @event_appoint_form_cost,
-        @event_appoint_form_ratio,
-        @event_appoint_jump_click,
-        @event_appoint_jump_click_cost,
-        @event_appoint_jump_click_ratio
+        @
+        event_valid_clues,
+        @
+        event_valid_clues_cost,
+        @
+        ad_product_cnt,
+        @
+        event_goods_view,
+        @
+        merchant_reco_fans,
+        @
+        event_order_amount_roi,
+        @
+        event_goods_view_cost,
+        @
+        merchant_reco_fans_cost,
+        @
+        event_new_user_pay,
+        @
+        event_new_user_pay_cost,
+        @
+        event_new_user_pay_ratio,
+        @
+        event_button_click,
+        @
+        event_button_click_cost,
+        @
+        event_button_click_ratio,
+        @
+        play_5s_ratio,
+        @
+        play_end_ratio,
+        @
+        event_order_paid_roi,
+        @
+        event_new_user_jinjian_app,
+        @
+        event_new_user_jinjian_app_cost,
+        @
+        event_new_user_jinjian_app_roi,
+        @
+        event_new_user_credit_grant_app,
+        @
+        event_new_user_credit_grant_app_cost,
+        @
+        event_new_user_credit_grant_app_roi,
+        @
+        event_new_user_jinjian_page,
+        @
+        event_new_user_jinjian_page_cost,
+        @
+        event_new_user_jinjian_page_roi,
+        @
+        event_new_user_credit_grant_page,
+        @
+        event_new_user_credit_grant_page_cost,
+        @
+        event_new_user_credit_grant_page_roi,
+        @
+        event_appoint_form,
+        @
+        event_appoint_form_cost,
+        @
+        event_appoint_form_ratio,
+        @
+        event_appoint_jump_click,
+        @
+        event_appoint_jump_click_cost,
+        @
+        event_appoint_jump_click_ratio
         )
-          set account_id = #{accountId}
+        set
+        account_id
+        =
+        #{accountId}
     </insert>
 
     <select id="getPhotoList" resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo">
@@ -256,24 +316,19 @@
 
     <select id="getPhotoListByDate"
             resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo">
-        select
-        id as id,
-        photo_id as photoId
-        from
-        ctop_kuaishou_report_daily_material
+        select id       as id,
+               photo_id as photoId
+        from ctop_kuaishou_report_daily_material
         WHERE stat_date = #{statDate}
-        and signature is null
+          and signature is null
         group by photo_id
     </select>
 
     <select id="getVideoGetByPhotoId" resultType="cn.com.ctop.kuaishou.modules.report.entity.VideoGetvo">
-      select
-      signature as 'signature',
-      channel_type as 'channelType'
-      from ctop_kuaishou_video_get
-      where photo_id = #{photoId}
-      and signature is not null
-      limit 1
+        select signature as 'signature', channel_type as 'channelType'
+        from ctop_kuaishou_video_get
+        where photo_id = #{photoId}
+          and signature is not null limit 1
     </select>
 
 
@@ -348,28 +403,21 @@
     </select>
     <select id="getSignatureByDate"
             resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial">
-        select
-            distinct signature
-        from
-        ctop_kuaishou_report_daily_material
-        where
-            signature is not null
-        and
-            signature != ''
+        select distinct signature
+        from ctop_kuaishou_report_daily_material
+        where signature is not null
+          and signature != ''
         and
             stat_date = #{date}
     </select>
     <select id="getSignatureByDateGroupByProjectId"
             resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial">
-        select
-    distinct signature,project_id
-from
-    ctop_kuaishou_report_daily_material report
-    left join ctop_user_allocation allocation on report.account_id = allocation.account_id
-where
-    signature is not null
-    and
-    signature != ''
+        select distinct signature,
+                        project_id
+        from ctop_kuaishou_report_daily_material report
+                 left join ctop_user_allocation allocation on report.account_id = allocation.account_id
+        where signature is not null
+          and signature != ''
     and
     stat_date = #{date}
     </select>
@@ -387,5 +435,329 @@ where
         and signature is not null
         group by photo_id
     </select>
+
+    <select id="labelMaterialListTotal" resultType="java.lang.Long">
+        SELECT IFNULL(COUNT(1),0) FROM
+        (
+        SELECT
+        t1.user_id
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.code
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        WHERE t2.parent_id in(60155,60156)
+        AND t4.stat_date &gt;= #{startTime}
+        AND t4.stat_date &lt;= concat(#{endTime},' 23:59:59')
+        GROUP BY t1.user_id
+        ) t
+    </select>
+
+    <select id="labelMaterialList" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        k.user_id,
+        k.realname,
+        k.role_name 'roleName',
+        IFNULL(k1.zhenren_charge,0)as 'zhenrenCharge',
+        IFNULL(k2.zhenren_number,0)as 'zhenrenNumber',
+        IFNULL(ROUND(k1.zhenren_charge/k2.zhenren_number,2),0) as 'zhenrenCost',
+        IFNULL(k3.zhizuo_charge,0)as 'zhizuoCharge',
+        IFNULL(k4.zhizuo_number,0)as 'zhizuoNumber',
+        IFNULL(ROUND(k3.zhizuo_charge/k4.zhizuo_number,2),0) as 'zhizuoCost'
+        FROM
+        (SELECT
+        t1.user_id,
+        t3.realname,
+        t3.role_name
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.code
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        WHERE t2.parent_id in(60155,60156)
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        GROUP BY t1.user_id
+        ) k
+        LEFT JOIN
+        (
+            SELECT
+        t1.user_id, SUM(t5.charge) 'zhenren_charge'
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        LEFT JOIN ctop_kuaishou_report_daily_material t5 ON  t1.`code` = t5.signature
+        WHERE 1=1
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        AND t2.parent_id = 60155
+        GROUP BY t1.user_id
+        ) k1 ON k1.user_id =k.user_id
+        LEFT JOIN
+        (SELECT user_id, COUNT(1) 'zhenren_number' FROM (
+        SELECT
+        t1.user_id,t4.signature
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        WHERE 1=1
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        AND t2.parent_id = 60155
+        GROUP BY t1.user_id,t1.`code`
+        ) t
+        GROUP BY user_id
+        )k2 ON k.user_id = k2.user_id
+        LEFT JOIN
+        (
+        SELECT
+        t1.user_id, SUM(t5.charge) 'zhizuo_charge'
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        LEFT JOIN ctop_kuaishou_report_daily_material t5 ON  t1.`code` = t5.signature
+        WHERE 1=1
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        AND t2.parent_id = 60156
+        GROUP BY t1.user_id
+        )k3 ON k3.user_id =k.user_id
+        LEFT JOIN
+        (SELECT user_id, COUNT(1) 'zhizuo_number' FROM (
+        SELECT
+        t1.user_id,t4.signature
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        WHERE 1=1
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        AND t2.parent_id = 60156
+        GROUP BY t1.user_id,t1.`code`
+        ) t
+        GROUP BY user_id
+        )k4 ON k4.user_id = k.user_id
+        ORDER BY k1.zhenren_charge DESC,k3.zhizuo_charge DESC
+
+    </select>
+
+    <select id="labelMaterialAll" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        '总计' as 'realname',
+        '-' as 'roleName',
+        IFNULL(SUM(t.zhenren_charge),0) as 'zhenrenCharge',
+        IFNULL(SUM(t.zhenren_number),0) as 'zhenrenNumber',
+        IFNULL(ROUND(SUM(t.zhenren_charge)/SUM(t.zhenren_number),2),0) as 'zhenrenCost',
+        IFNULL(SUM(t.zhizuo_charge),0) as 'zhizuoCharge',
+        IFNULL(SUM(t.zhizuo_number),0) as 'zhizuoNumber',
+        IFNULL(ROUND(SUM(t.zhizuo_charge)/SUM(t.zhizuo_number),2),0) as 'zhizuoCost'
+        FROM
+        (SELECT
+        IFNULL(k1.zhenren_charge,0)as 'zhenren_charge',
+        IFNULL(k2.zhenren_number,0)as 'zhenren_number',
+        IFNULL(k3.zhizuo_charge,0)as 'zhizuo_charge',
+        IFNULL(k4.zhizuo_number,0)as 'zhizuo_number'
+        FROM
+        (SELECT
+        t1.user_id,
+        t3.realname,
+        t3.role_name
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.code
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        WHERE t2.parent_id in(60155,60156)
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        GROUP BY t1.user_id
+        ) k
+        LEFT JOIN
+        (
+        SELECT
+        t1.user_id, SUM(t5.charge) 'zhenren_charge'
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        LEFT JOIN ctop_kuaishou_report_daily_material t5 ON  t1.`code` = t5.signature
+        WHERE 1=1
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        AND t2.parent_id = 60155
+        GROUP BY t1.user_id
+        )k1 ON k1.user_id =k.user_id
+        LEFT JOIN
+        (SELECT user_id, COUNT(1) 'zhenren_number' FROM (
+        SELECT
+        t1.user_id,t4.signature
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        WHERE 1=1
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        AND t2.parent_id = 60155
+        GROUP BY t1.user_id,t1.`code`
+        ) t
+        GROUP BY user_id
+        )k2 ON k.user_id = k2.user_id
+        LEFT JOIN
+        (
+        SELECT
+        t1.user_id, SUM(t5.charge) 'zhizuo_charge'
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        LEFT JOIN ctop_kuaishou_report_daily_material t5 ON  t1.`code` = t5.signature
+        WHERE 1=1
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        AND t2.parent_id = 60156
+        GROUP BY t1.user_id
+        )k3 ON k3.user_id =k.user_id
+        LEFT JOIN
+        (SELECT user_id, COUNT(1) 'zhizuo_number' FROM (
+        SELECT
+        t1.user_id,t4.signature
+        FROM ctop_material_tag_info t1
+        LEFT JOIN ctop_tag_info  t2 ON t2.id = t1.tag_id
+        LEFT JOIN ctop_kuaishou_video_get t4 ON t4.signature= t1.`code`
+        INNER JOIN(
+        SELECT tt1.id,tt3.role_name,tt1.realname FROM sys_user tt1
+        LEFT JOIN sys_user_role tt2 ON tt1.id = tt2.user_id
+        LEFT JOIN sys_role tt3 ON tt2.role_id = tt3.id
+        WHERE 1=1
+        <if test="realname!=null">
+            and tt1.realname LIKE CONCAT('%',#{realname},'%')
+        </if>
+        <if test="roleCode!=null">
+            AND tt3.role_code = #{roleCode}
+        </if>
+        ) t3 ON t3.id = t1.user_id
+        WHERE 1=1
+        AND t4.stat_date &gt;=  #{startTime}
+        AND t4.stat_date &lt;=  concat(#{endTime},' 23:59:59')
+        AND t2.parent_id = 60156
+        GROUP BY t1.user_id,t1.`code`
+        ) t
+        GROUP BY user_id
+        )k4 ON k4.user_id = k.user_id
+        ORDER BY k1.zhenren_charge DESC,k3.zhizuo_charge DESC
+        )t
+    </select>
 </mapper>
 

+ 3 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouReportDailyMaterialService.java

@@ -3,6 +3,7 @@ package cn.com.ctop.kuaishou.modules.batch.service;
 import cn.com.ctop.kuaishou.modules.batch.entity.vo.KuaiShouVideoGetVo;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
 
 import java.util.List;
 import java.util.Map;
@@ -26,4 +27,6 @@ public interface IKuaiShouReportDailyMaterialService extends IService<KuaiShouRe
     List<KuaiShouReportDailyMaterial> getSignatureByDateGroupByProjectId(String date);
 
     List<KuaiShouReportDailyMaterial> getVideoInfoByList(List<KuaiShouReportDailyMaterial> addList, List<Long> photoIdList);
+
+    Result<Object> labelMaterialList(String realname, String roleCode, String startTime, String endTime, Integer pageNo, Integer pageSize);
 }

+ 17 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouReportDailyMaterialServiceImpl.java

@@ -10,7 +10,10 @@ import cn.com.ctop.kuaishou.modules.report.mapper.KuaiShouReportHourlyMaterialMa
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -124,6 +127,20 @@ public class KuaiShouReportDailyMaterialServiceImpl extends ServiceImpl<KuaiShou
     }
 
     @Override
+    public Result<Object> labelMaterialList(String realname, String roleCode, String startTime, String endTime, Integer pageNo, Integer pageSize) {
+        Long total = dailyMaterialMapper.labelMaterialListTotal(realname, roleCode, startTime, endTime);
+        PageHelper.startPage(pageNo, pageSize, false);
+        PageInfo pageInfo = new PageInfo(dailyMaterialMapper.labelMaterialList(realname, roleCode, startTime, endTime));
+        pageInfo.setTotal(total);
+        JSONObject data = new JSONObject();
+        data.put("pageInfo", pageInfo);
+        if (total > 0) {
+            data.put("total", dailyMaterialMapper.labelMaterialAll(realname, roleCode, startTime, endTime));
+        }
+        return Result.ok(data);
+    }
+
+    @Override
     public List<KuaiShouReportDailyMaterial> getSignatureByDate(String date) {
         return dailyMaterialMapper.getSignatureByDate(date);
     }