syh 4 rokov pred
rodič
commit
72a3bdee58

+ 3 - 3
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -409,12 +409,12 @@ public class SampleTest {
     private IBytedanceVideoEtlInfoService bytedanceVideoEtlInfoService;
     @Test
     public void etlBytedanceData(){
-        String dateString = "2020-08-30";
+        String dateString = "2020-07-01";
         Date startDate = DateUtils.parseDate(dateString,"yyyy-MM-dd");
         for(int i=0;i<=310;i++){
             Date getDate = DateUtils.addDay(startDate,i);
-//            bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
-            kuaishouVideoEtlInfoService.etlKuaishouVideoInfo(getDate);
+            bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
+//            kuaishouVideoEtlInfoService.etlKuaishouVideoInfo(getDate);
         }
     }
 

+ 4 - 7
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaishouAudienceReportDailyController.java

@@ -6,9 +6,11 @@ import cn.com.ctop.kuaishou.modules.report.entity.KuaishouAudienceReportDailyAcc
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouAudienceReportDailyAccountService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouAudienceReportDailyService;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
@@ -97,13 +99,8 @@ public class KuaishouAudienceReportDailyController {
     @AutoLog(value = "人群分析报表-分页列表查询")
     @ApiOperation(value = "人群分析报表-分页列表查询", notes = "人群分析报表-分页列表查询")
     @GetMapping(value = "/queryPageList")
-    public Result<Object> queryPageLists(KuaishouAudienceReportDailyAccount audienceReport, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
-        try {
-            return kuaishouAudienceReportDailyAccountService.queryPageLists(audienceReport, pageNo, pageSize);
-        } catch (Exception e) {
-            log.error("人群分析报表-分页列表查询异常", e);
-        }
-        return Result.error("查询人群分析报表失败");
+    public PageInfo<JSONObject> queryPageLists(KuaishouAudienceReportDailyAccount audienceReport, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
+        return kuaishouAudienceReportDailyAccountService.queryPageLists(audienceReport, pageNo, pageSize);
     }
 
     /**

+ 4 - 42
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouAudienceReportDailyAccountMapper.xml

@@ -114,55 +114,18 @@
 
     <select id="querybusinessTypeReportForm" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
-        statDate as statDate,
-        accountId as accountId,
-        businessInterestTags as businessInterestTags,
-        SUM(photoShow) as photoShow,
-        SUM(photoClick) as photoClick,
-        SUM(aclick) as aclick,
-        SUM(bclick) as bclick,
-        ROUND(SUM(photoClick)/SUM(photoShow)*100,2) as photoClickRatio,
-        ROUND(SUM(bclick)/SUM(aclick)*100,2) as actionRatio
-        FROM(
-        SELECT
-        stat_date as statDate,
-        account_id as accountId,
-        '其他' as businessInterestTags,
-        SUM(photo_show) as photoShow,
-        SUM(photo_click) as photoClick,
-        SUM(aclick) as aclick,
-        SUM(bclick) as bclick
-        FROM ctop_kuaishou_audience_report_daily_account t
-        where 1=1
-        <if test="accountId != null">
-            and account_id = #{accountId}
-        </if>
-        <if test="startTime != null">
-            AND stat_date &gt;= #{startTime}
-        </if>
-        <if test="endTime != null">
-            AND stat_date &lt;= #{endTime}
-        </if>
-        AND audience_type = 'businessInterestTags'
-        GROUP BY business_interest_tags
-        ORDER BY photoShow
-        limit 0,#{count}
-        ) t1
-        union
-        (
-        SELECT
         stat_date as statDate,
         account_id as accountId,
         business_interest_tags as businessInterestTags ,
         SUM(photo_show) as photoShow,
         SUM(photo_click) as photoClick,
+        sum(charge) as totalCost,
         SUM(aclick) as aclick,
         SUM(bclick) as bclick,
         ROUND(SUM(photo_click)/SUM(photo_show)*100,2) as photoClickRatio,
         ROUND(SUM(bclick)/SUM(aclick)*100,2) as actionRatio
         FROM ctop_kuaishou_audience_report_daily_account
         where 1=1
-        AND business_interest_tags != '其他'
         <if test="accountId != null">
             and account_id = #{accountId}
         </if>
@@ -174,9 +137,8 @@
         </if>
         AND audience_type = 'businessInterestTags'
         GROUP BY business_interest_tags
-        ORDER BY photoShow  desc
-        limit 9
-        )
+        ORDER BY totalCost  desc
+        limit 10
     </select>
 
 
@@ -201,4 +163,4 @@
         </if>
         ) as tt
     </select>
-</mapper>
+</mapper>

+ 3 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouAudienceReportDailyAccountService.java

@@ -2,7 +2,9 @@ package cn.com.ctop.kuaishou.modules.report.service;
 
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouAudienceReportDaily;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouAudienceReportDailyAccount;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.github.pagehelper.PageInfo;
 import org.jeecg.common.api.vo.Result;
 
 /**
@@ -22,7 +24,7 @@ public interface IKuaishouAudienceReportDailyAccountService extends IService<Kua
      * @throws
      * @author ZHAOXA
      */
-    Result<Object> queryPageLists(KuaishouAudienceReportDailyAccount audienceReport, Integer pageNo, Integer pageSize);
+    PageInfo<JSONObject> queryPageLists(KuaishouAudienceReportDailyAccount audienceReport, Integer pageNo, Integer pageSize);
 
     /**
      * 首页报表数据

+ 4 - 11
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouAudienceReportDailyAccountServiceImpl.java

@@ -7,6 +7,7 @@ import cn.com.ctop.kuaishou.modules.report.service.IKuaishouAudienceReportDailyA
 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;
@@ -30,22 +31,16 @@ public class KuaishouAudienceReportDailyAccountServiceImpl extends ServiceImpl<K
 
 
     @Override
-    public Result<Object> queryPageLists(KuaishouAudienceReportDailyAccount audienceReport, Integer pageNo, Integer pageSize) {
+    public PageInfo<JSONObject> queryPageLists(KuaishouAudienceReportDailyAccount audienceReport, Integer pageNo, Integer pageSize) {
         if (null == pageNo || pageNo == 0) {
             pageNo = 1;
         }
         if (null == pageSize || pageSize == 0) {
             pageSize = 10;
         }
-        List<JSONObject> list = null;
         PageHelper.startPage(pageNo, pageSize);
-        List<JSONObject> jsonObjects = null;
-        try {
-            jsonObjects = accountMapper.queryPageLists(audienceReport);
-        } catch (Exception e) {
-            return Result.error("查询失败");
-        }
-        return Result.ok(jsonObjects);
+        List<JSONObject>jsonObjects = accountMapper.queryPageLists(audienceReport);
+        return new PageInfo<>(jsonObjects);
     }
 
     /**
@@ -80,8 +75,6 @@ public class KuaishouAudienceReportDailyAccountServiceImpl extends ServiceImpl<K
             data.put("client", clients);
         }
         audienceReport.setAudienceType("businessInterestTags");
-        int count = accountMapper.querybusinessTypeCount(audienceReport);
-        audienceReport.setCount(count - 9);
         List<JSONObject> bussiness = accountMapper.querybusinessTypeReportForm(audienceReport);
         if (!Check.isNull(bussiness)) {
             data.put("businessInterestTags", bussiness);