Procházet zdrojové kódy

李娜、王垒需求接口调整

hcst_sunzhen před 4 roky
rodič
revize
27de0173a7

+ 2 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.ctop.controller;
 
+import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.entity.Project;
 import cn.com.ctop.common.module.service.IProjectService;
 import cn.com.ctop.common.module.service.ISysRoleService;
@@ -10,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;

+ 23 - 22
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouController.java

@@ -8,6 +8,7 @@ import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountDTO;
 import cn.com.ctop.kuaishou.modules.report.entity.ProjectAccountDTO;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAccountService;
 import com.baomidou.mybatisplus.extension.api.R;
+import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -70,8 +71,8 @@ public class KuaiShouController {
 
     @ResponseBody
     @RequestMapping("/getKuaishouProjectInfo")
-    public Result<List<ProjectAccountDTO>> getKuaishouProjectInfo(@RequestBody KuaishouInfoDTO dto) {
-        Result<List<ProjectAccountDTO>> result = new Result<>();
+    public Result<PageInfo<ProjectAccountDTO>> getKuaishouProjectInfo(@RequestBody KuaishouInfoDTO dto) {
+        Result<PageInfo<ProjectAccountDTO>> result = new Result<>();
         result.setSuccess(true);
 
         if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null){
@@ -84,7 +85,7 @@ public class KuaiShouController {
         }
 
         try{
-            List<ProjectAccountDTO> projectAccountDTOList = accountService.getKuaishouProjectInfo(dto.getStartDate(), dto.getEndDate(), dto.getProjectList(),dto.getPageSize(),dto.getPageNum(), "");
+            PageInfo<ProjectAccountDTO> projectAccountDTOList = accountService.getKuaishouProjectInfo(dto.getStartDate(), dto.getEndDate(), dto.getProjectList(),dto.getPageSize(),dto.getPageNum(), "");
             result.setResult(projectAccountDTOList);
         }catch(Exception e){
             log.error(e.getMessage());
@@ -98,8 +99,8 @@ public class KuaiShouController {
 
     @ResponseBody
     @RequestMapping("/getKuaishouSaleProjectInfo")
-    public Result<List<ProjectAccountDTO>> getKuaishouSaleProjectInfo(@RequestBody KuaishouInfoDTO dto) {
-        Result<List<ProjectAccountDTO>> result = new Result<>();
+    public Result<PageInfo<ProjectAccountDTO>> getKuaishouSaleProjectInfo(@RequestBody KuaishouInfoDTO dto) {
+        Result<PageInfo<ProjectAccountDTO>> result = new Result<>();
         result.setSuccess(true);
 
         if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null){
@@ -112,7 +113,7 @@ public class KuaiShouController {
         }
 
         try{
-            List<ProjectAccountDTO> projectAccountDTOList = accountService.getKuaishouSaleProjectInfo(dto.getStartDate(), dto.getEndDate(), dto.getProjectList(),dto.getPageSize(),dto.getPageNum(), "");
+            PageInfo<ProjectAccountDTO> projectAccountDTOList = accountService.getKuaishouSaleProjectInfo(dto.getStartDate(), dto.getEndDate(), dto.getProjectList(),dto.getPageSize(),dto.getPageNum(), "");
             result.setResult(projectAccountDTOList);
         }catch(Exception e){
             log.error(e.getMessage());
@@ -127,11 +128,11 @@ public class KuaiShouController {
 
     @ResponseBody
     @RequestMapping("/getKuaishouAccountInfoByProjectId")
-    public Result<List<KuaishouReportDailyAccountDTO>> getKuaishouAccountInfoByProjectId(@RequestBody KuaishouInfoDTO dto) {
-        Result<List<KuaishouReportDailyAccountDTO>> result = new Result<>();
+    public Result<PageInfo<KuaishouReportDailyAccountDTO>> getKuaishouAccountInfoByProjectId(@RequestBody KuaishouInfoDTO dto) {
+        Result<PageInfo<KuaishouReportDailyAccountDTO>> result = new Result<>();
         result.setSuccess(true);
 
-        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null || dto.getProjectId()==null){
+        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null){
             result.setSuccess(false);
             result.setMessage("参数有误");
             return result;
@@ -142,7 +143,7 @@ public class KuaiShouController {
         }
 
         try{
-            List<KuaishouReportDailyAccountDTO> kuaishouReportDailyAccountDTOList = accountService.getKuaishouAccountInfoByProjectId(dto.getProjectId(), dto.getStartDate(), dto.getEndDate(),dto.getPageSize(),dto.getPageNum());
+            PageInfo<KuaishouReportDailyAccountDTO> kuaishouReportDailyAccountDTOList = accountService.getKuaishouAccountInfoByProjectId(dto.getProjectId(), dto.getStartDate(), dto.getEndDate(),dto.getPageSize(),dto.getPageNum());
             result.setResult(kuaishouReportDailyAccountDTOList);
         }catch(Exception e){
             log.error(e.getMessage());
@@ -156,11 +157,11 @@ public class KuaiShouController {
 
     @ResponseBody
     @RequestMapping("/getKuaishouCampaignInfoByAccountId")
-    public Result<List<KuaishouReportDailyAccountDTO>> getKuaishouCampaignInfoByAccountId(@RequestBody KuaishouInfoDTO dto) {
-        Result<List<KuaishouReportDailyAccountDTO>> result = new Result<>();
+    public Result<PageInfo<KuaishouReportDailyAccountDTO>> getKuaishouCampaignInfoByAccountId(@RequestBody KuaishouInfoDTO dto) {
+        Result<PageInfo<KuaishouReportDailyAccountDTO>> result = new Result<>();
         result.setSuccess(true);
 
-        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null || dto.getAccountId()==null){
+        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null){
             result.setSuccess(false);
             result.setMessage("参数有误");
             return result;
@@ -171,7 +172,7 @@ public class KuaiShouController {
         }
 
         try{
-            List<KuaishouReportDailyAccountDTO> kuaishouCampaignInfoList = accountService.getKuaishouCampaignInfoByAccountId(dto.getAccountId(), dto.getStartDate(), dto.getEndDate(),dto.getPageSize(),dto.getPageNum());
+            PageInfo<KuaishouReportDailyAccountDTO> kuaishouCampaignInfoList = accountService.getKuaishouCampaignInfoByAccountId(dto.getAccountId(), dto.getStartDate(), dto.getEndDate(),dto.getPageSize(),dto.getPageNum());
             result.setResult(kuaishouCampaignInfoList);
         }catch(Exception e){
             log.error(e.getMessage());
@@ -186,11 +187,11 @@ public class KuaiShouController {
 
     @ResponseBody
     @RequestMapping("/getKuaishouUnitInfoByCampaignId")
-    public Result<List<KuaishouReportDailyAccountDTO>> getKuaishouUnitInfoByCampaignId(@RequestBody KuaishouInfoDTO dto) {
-        Result<List<KuaishouReportDailyAccountDTO>> result = new Result<>();
+    public Result<PageInfo<KuaishouReportDailyAccountDTO>> getKuaishouUnitInfoByCampaignId(@RequestBody KuaishouInfoDTO dto) {
+        Result<PageInfo<KuaishouReportDailyAccountDTO>> result = new Result<>();
         result.setSuccess(true);
 
-        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null || dto.getCampaignId()==null){
+        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null){
             result.setSuccess(false);
             result.setMessage("参数有误");
             return result;
@@ -200,7 +201,7 @@ public class KuaiShouController {
         }
 
         try{
-            List<KuaishouReportDailyAccountDTO> kuaishouCampaignInfoList = accountService.getKuaishouUnitInfoByCampaignId(dto.getCampaignId(), dto.getStartDate(), dto.getEndDate(),dto.getPageSize(),dto.getPageNum());
+            PageInfo<KuaishouReportDailyAccountDTO> kuaishouCampaignInfoList = accountService.getKuaishouUnitInfoByCampaignId(dto.getCampaignId(), dto.getStartDate(), dto.getEndDate(),dto.getPageSize(),dto.getPageNum());
             result.setResult(kuaishouCampaignInfoList);
         }catch(Exception e){
             log.error(e.getMessage());
@@ -214,11 +215,11 @@ public class KuaiShouController {
 
     @ResponseBody
     @RequestMapping("/getKuaishouCreativeInfoByUnitId")
-    public Result<List<KuaishouReportDailyAccountDTO>> getKuaishouCreativeInfoByUnitId(@RequestBody KuaishouInfoDTO dto) {
-        Result<List<KuaishouReportDailyAccountDTO>> result = new Result<>();
+    public Result<PageInfo<KuaishouReportDailyAccountDTO>> getKuaishouCreativeInfoByUnitId(@RequestBody KuaishouInfoDTO dto) {
+        Result<PageInfo<KuaishouReportDailyAccountDTO>> result = new Result<>();
         result.setSuccess(true);
 
-        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null || dto.getUnitId()==null){
+        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null){
             result.setSuccess(false);
             result.setMessage("参数有误");
             return result;
@@ -228,7 +229,7 @@ public class KuaiShouController {
         }
 
         try{
-            List<KuaishouReportDailyAccountDTO> kuaishouCampaignInfoList = accountService.getKuaishouCreativeInfoByUnitId(dto.getUnitId(), dto.getStartDate(), dto.getEndDate(),dto.getPageSize(),dto.getPageNum());
+            PageInfo<KuaishouReportDailyAccountDTO> kuaishouCampaignInfoList = accountService.getKuaishouCreativeInfoByUnitId(dto.getUnitId(), dto.getStartDate(), dto.getEndDate(),dto.getPageSize(),dto.getPageNum());
             result.setResult(kuaishouCampaignInfoList);
         }catch(Exception e){
             log.error(e.getMessage());

+ 16 - 8
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml

@@ -590,8 +590,10 @@
         a.stat_date &gt;= #{startDate}
         and
         a.stat_date &lt;= #{endDate}
-        and
-        b.project_id = #{projectId}
+        <if test="projectId!=null and projectId != '' ">
+            and
+            b.project_id = #{projectId}
+        </if>>
         group by a.account_id
         order by sum(a.charge) desc
     </select>
@@ -735,8 +737,10 @@
         a.stat_date &gt;= #{startDate}
         and
         a.stat_date &lt;= #{endDate}
-        and
-        a.account_id = #{accountId}
+        <if test="accountId !=null and accountId != '' ">
+            and
+            a.account_id = #{accountId}
+        </if>
         group by a.campaign_id
     </select>
 
@@ -806,8 +810,10 @@
         a.stat_date &gt;= #{startDate}
         and
         a.stat_date &lt;= #{endDate}
-        and
-        a.campaign_id = #{campaignId}
+        <if test="campaignId != null and campaignId != ''">
+            and
+            a.campaign_id = #{campaignId}
+        </if>
         group by unit_id
     </select>
 
@@ -976,8 +982,10 @@
             a.stat_date &gt;= #{startDate}
             and
             a.stat_date &lt;= #{endDate}
-            and
-            a.unit_id = #{unitId}
+            <if test="unitId != null and unitId !='' ">
+                and
+                a.unit_id = #{unitId}
+            </if>
             group by creative_id
         ) a
         left join  ctop_kuaishou_creative b on a.creativeId = b.creative_id

+ 7 - 6
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouReportDailyAccountService.java

@@ -5,6 +5,7 @@ import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountDTO;
 import cn.com.ctop.kuaishou.modules.report.entity.ProjectAccountDTO;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.github.pagehelper.PageInfo;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.system.vo.LoginUser;
 
@@ -15,16 +16,16 @@ public interface IKuaishouReportDailyAccountService extends IService<KuaishouRep
 
     List<JSONObject> selectCost(Long accountId, String startDate, String endDate);
 
-    List<ProjectAccountDTO> getKuaishouProjectInfo(String startDate, String endDate, List<Long> projectList , Integer pageSize, Integer pageNum, String sort );
+    PageInfo<ProjectAccountDTO> getKuaishouProjectInfo(String startDate, String endDate, List<Long> projectList , Integer pageSize, Integer pageNum, String sort );
 
-    List<ProjectAccountDTO> getKuaishouSaleProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageSize, Integer pageNum, String sort);
+    PageInfo<ProjectAccountDTO> getKuaishouSaleProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageSize, Integer pageNum, String sort);
 
-    List<KuaishouReportDailyAccountDTO> getKuaishouAccountInfoByProjectId(Long projectId, String startDate, String endDate, Integer pageSize, Integer pageNum);
+    PageInfo<KuaishouReportDailyAccountDTO> getKuaishouAccountInfoByProjectId(Long projectId, String startDate, String endDate, Integer pageSize, Integer pageNum);
 
-    List<KuaishouReportDailyAccountDTO> getKuaishouCampaignInfoByAccountId(Long accountId, String startDate, String endDate, Integer pageSize, Integer pageNum);
+    PageInfo<KuaishouReportDailyAccountDTO> getKuaishouCampaignInfoByAccountId(Long accountId, String startDate, String endDate, Integer pageSize, Integer pageNum);
 
-    List<KuaishouReportDailyAccountDTO> getKuaishouUnitInfoByCampaignId(Long campaignId, String startDate, String endDate, Integer pageSize, Integer pageNum);
+    PageInfo<KuaishouReportDailyAccountDTO> getKuaishouUnitInfoByCampaignId(Long campaignId, String startDate, String endDate, Integer pageSize, Integer pageNum);
 
-    List<KuaishouReportDailyAccountDTO> getKuaishouCreativeInfoByUnitId(Long unitId, String startDate, String endDate, Integer pageSize, Integer pageNum);
+    PageInfo<KuaishouReportDailyAccountDTO> getKuaishouCreativeInfoByUnitId(Long unitId, String startDate, String endDate, Integer pageSize, Integer pageNum);
 
 }

+ 13 - 12
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouReportDailyAccountServiceImpl.java

@@ -9,6 +9,7 @@ import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAccountSe
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.mgt.SecurityManager;
 import org.jeecg.common.system.vo.LoginUser;
@@ -31,7 +32,7 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
     }
 
     @Override
-    public List<ProjectAccountDTO> getKuaishouProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageSize, Integer pageNum, String sort ){
+    public PageInfo<ProjectAccountDTO> getKuaishouProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageSize, Integer pageNum, String sort ){
         List<ProjectAccountDTO> projectAccountDTOList = new ArrayList<>();
 
         if(projectList==null || projectList.size()==0){
@@ -86,11 +87,11 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
             project.setStatDate(startDate + "~" + endDate);
         }
 
-        return projectAccountDTOList;
+        return new PageInfo<>(projectAccountDTOList);
     }
 
     @Override
-    public List<ProjectAccountDTO> getKuaishouSaleProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageSize, Integer pageNum, String sort ){
+    public PageInfo<ProjectAccountDTO> getKuaishouSaleProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageSize, Integer pageNum, String sort ){
         List<ProjectAccountDTO> projectAccountDTOList = new ArrayList<>();
 
         if(projectList==null || projectList.size()==0){
@@ -145,30 +146,30 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
             project.setStatDate(startDate + "~" + endDate);
         }
 
-        return projectAccountDTOList;
+        return new PageInfo<>(projectAccountDTOList);
     }
 
 
     @Override
-    public List<KuaishouReportDailyAccountDTO> getKuaishouAccountInfoByProjectId(Long projectId, String startDate, String endDate, Integer pageSize, Integer pageNum){
+    public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouAccountInfoByProjectId(Long projectId, String startDate, String endDate, Integer pageSize, Integer pageNum){
         PageHelper.startPage(pageNum,pageSize);
-        return dailyAccountMapper.getKuaishouAccountInfoByProjectId(startDate, endDate, projectId);
+        return new PageInfo<>(dailyAccountMapper.getKuaishouAccountInfoByProjectId(startDate, endDate, projectId));
     }
 
     @Override
-    public List<KuaishouReportDailyAccountDTO> getKuaishouCampaignInfoByAccountId(Long accountId, String startDate, String endDate, Integer pageSize, Integer pageNum){
+    public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouCampaignInfoByAccountId(Long accountId, String startDate, String endDate, Integer pageSize, Integer pageNum){
         PageHelper.startPage(pageNum,pageSize);
-        return dailyAccountMapper.getKuaishouCampaignInfoByAccountId(startDate, endDate, accountId);
+        return new PageInfo<>(dailyAccountMapper.getKuaishouCampaignInfoByAccountId(startDate, endDate, accountId));
     }
 
     @Override
-    public List<KuaishouReportDailyAccountDTO> getKuaishouUnitInfoByCampaignId(Long campaignId, String startDate, String endDate, Integer pageSize, Integer pageNum){
+    public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouUnitInfoByCampaignId(Long campaignId, String startDate, String endDate, Integer pageSize, Integer pageNum){
         PageHelper.startPage(pageNum,pageSize);
-        return dailyAccountMapper.getKuaishouUnitInfoByCampaignId(startDate, endDate, campaignId);
+        return new PageInfo<>(dailyAccountMapper.getKuaishouUnitInfoByCampaignId(startDate, endDate, campaignId));
     }
 
     @Override
-    public List<KuaishouReportDailyAccountDTO> getKuaishouCreativeInfoByUnitId(Long unitId, String startDate, String endDate, Integer pageSize, Integer pageNum){
+    public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouCreativeInfoByUnitId(Long unitId, String startDate, String endDate, Integer pageSize, Integer pageNum){
         PageHelper.startPage(pageNum,pageSize);
         List<KuaishouReportDailyAccountDTO> kuaishouCreativeInfoList = dailyAccountMapper.getKuaishouCreativeInfoByUnitId(startDate, endDate, unitId);
         for(KuaishouReportDailyAccountDTO creativeInfo:kuaishouCreativeInfoList){
@@ -176,7 +177,7 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
             creativeInfo.setUrl(videoInfo.getUrl());
             creativeInfo.setCoverUrl(videoInfo.getCoverUrl());
         }
-        return kuaishouCreativeInfoList;
+        return new PageInfo<>(kuaishouCreativeInfoList);
     }
 
 }

+ 8 - 7
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/controller/BytedanceReportController.java

@@ -9,6 +9,7 @@ import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyServ
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceAccountReportService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import com.alibaba.fastjson.JSONObject;
+import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.api.vo.Result;
@@ -392,11 +393,11 @@ public class BytedanceReportController {
 
     @ResponseBody
     @RequestMapping("/getBytedanceAccountInfoByProjectId")
-    public Result<List<ByteDanceReportAccountDailyDTO>> getBytedanceAccountInfoByProjectId(@RequestBody BytedanceInfoDTO dto) {
-        Result<List<ByteDanceReportAccountDailyDTO>> result = new Result<>();
+    public Result<PageInfo<ByteDanceReportAccountDailyDTO>> getBytedanceAccountInfoByProjectId(@RequestBody BytedanceInfoDTO dto) {
+        Result<PageInfo<ByteDanceReportAccountDailyDTO>> result = new Result<>();
         result.setSuccess(true);
 
-        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null || dto.getProjectId()==null){
+        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null){
             result.setSuccess(false);
             result.setMessage("参数有误");
             return result;
@@ -407,7 +408,7 @@ public class BytedanceReportController {
         }
 
         try{
-            List<ByteDanceReportAccountDailyDTO> byteDanceReportAccountDailyDTOList = bytedanceAccountReportService.getBytedanceAccountInfoByProjectId(dto.getStartDate(), dto.getEndDate(), dto.getProjectId(),dto.getPageNum(),dto.getPageSize(),dto.getSort());
+            PageInfo<ByteDanceReportAccountDailyDTO> byteDanceReportAccountDailyDTOList = bytedanceAccountReportService.getBytedanceAccountInfoByProjectId(dto.getStartDate(), dto.getEndDate(), dto.getProjectId(),dto.getPageNum(),dto.getPageSize(),dto.getSort());
             result.setResult(byteDanceReportAccountDailyDTOList);
         }catch(Exception e){
             log.error(e.getMessage());
@@ -421,8 +422,8 @@ public class BytedanceReportController {
 
     @ResponseBody
     @RequestMapping("/getBytedanceSaleProjectInfo")
-    public Result<List<ByteDanceReportAccountDailyDTO>> getBytedanceSaleProjectInfo(@RequestBody BytedanceInfoDTO dto) {
-        Result<List<ByteDanceReportAccountDailyDTO>> result = new Result<>();
+    public Result<PageInfo<ByteDanceReportAccountDailyDTO>> getBytedanceSaleProjectInfo(@RequestBody BytedanceInfoDTO dto) {
+        Result<PageInfo<ByteDanceReportAccountDailyDTO>> result = new Result<>();
         result.setSuccess(true);
 
         if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null){
@@ -444,7 +445,7 @@ public class BytedanceReportController {
         }
 
         try{
-            List<ByteDanceReportAccountDailyDTO> byteDanceReportAccountDailyDTOList = bytedanceAccountReportService.getBytedanceSaleProjectInfo(dto.getStartDate(), dto.getEndDate(), dto.getProjectList(),dto.getPageNum(),dto.getPageSize(),dto.getSort());
+            PageInfo<ByteDanceReportAccountDailyDTO> byteDanceReportAccountDailyDTOList = bytedanceAccountReportService.getBytedanceSaleProjectInfo(dto.getStartDate(), dto.getEndDate(), dto.getProjectList(),dto.getPageNum(),dto.getPageSize(),dto.getSort());
             result.setResult(byteDanceReportAccountDailyDTOList);
         }catch(Exception e){
             log.error(e.getMessage());

+ 4 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceAccountReportMapper.xml

@@ -301,8 +301,10 @@
         date_format(a.stat_datetime,'%Y-%m-%d') &gt;= #{startDate}
         and
         date_format(a.stat_datetime,'%Y-%m-%d') &lt;= #{endDate}
-        and
-        b.project_id = #{projectId}
+        <if test="projectId!=null and projectId!=''">
+            and
+            b.project_id = #{projectId}
+        </if>
         group by a.advertiser_id
         -- order by sum(a.cost) desc
     </select>

+ 3 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IBytedanceAccountReportService.java

@@ -3,6 +3,7 @@ package cn.com.ctop.toutiao.modules.report.service;
 import cn.com.ctop.toutiao.modules.report.DTO.ByteDanceReportAccountDailyDTO;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.github.pagehelper.PageInfo;
 
 import java.math.BigDecimal;
 import java.util.List;
@@ -20,9 +21,9 @@ public interface IBytedanceAccountReportService {
 
     //List<ByteDanceReportAccountDailyDTO> getBytedanceSaleProjectInfo(String startDate, String endDate, List<Long> projectList);
 
-    List<ByteDanceReportAccountDailyDTO> getBytedanceAccountInfoByProjectId(String startDate, String endDate, Long projectId,Integer pageNo, Integer pageSize, String sort);
+    PageInfo<ByteDanceReportAccountDailyDTO> getBytedanceAccountInfoByProjectId(String startDate, String endDate, Long projectId, Integer pageNo, Integer pageSize, String sort);
 
-    List<ByteDanceReportAccountDailyDTO> getBytedanceSaleProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageNum, Integer pageSize, String sort);
+    PageInfo<ByteDanceReportAccountDailyDTO> getBytedanceSaleProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageNum, Integer pageSize, String sort);
 
     //List<ByteDanceReportAccountDailyDTO> getBytedanceSaleProjectInfo(String startDate, String endDate, Long projectId, int pageNum, int pageSize, String sort);
 }

+ 10 - 6
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceAccountReportServiceImpl.java

@@ -8,8 +8,11 @@ import cn.com.ctop.toutiao.modules.utils.LinkUtils;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import org.apache.commons.lang.StringUtils;
+import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.constant.SystemDateConstant;
+import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.JsonResourceUtil;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -185,12 +188,13 @@ public class BytedanceAccountReportServiceImpl implements IBytedanceAccountRepor
     }
 
     @Override
-    public List<ByteDanceReportAccountDailyDTO> getBytedanceSaleProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageNum, Integer pageSize, String sort){
+    public PageInfo<ByteDanceReportAccountDailyDTO> getBytedanceSaleProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageNum, Integer pageSize, String sort){
         List<ByteDanceReportAccountDailyDTO> list = new ArrayList<>();
 
         if(projectList==null || projectList.size()==0){
-            //LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-            String userId = "388e787edd294ecfb9243fe176a3ae56";
+            LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+            String userId = sysUser.getId();
+            //String userId = "388e787edd294ecfb9243fe176a3ae56";
             String roleCode = bytedanceAccountReportMapper.getRoleCodeByUserId(userId);
 
             List<Long> mediaIds = new ArrayList<>();
@@ -251,18 +255,18 @@ public class BytedanceAccountReportServiceImpl implements IBytedanceAccountRepor
             project.setActiveRegisterCost(p.getActiveRegisterCost());
         }
 
-        return list;
+        return new PageInfo<>(list);
     }
 
     @Override
-    public List<ByteDanceReportAccountDailyDTO> getBytedanceAccountInfoByProjectId(String startDate, String endDate, Long projectId,Integer pageNo, Integer pageSize, String sort){
+    public PageInfo<ByteDanceReportAccountDailyDTO> getBytedanceAccountInfoByProjectId(String startDate, String endDate, Long projectId, Integer pageNo, Integer pageSize, String sort){
         if(StringUtils.isBlank(sort)){
             sort = "cost-";
         }
         sort = sort.replace("-", " desc,").replace("+", " asc,");  //sort=id-name+age+
         sort = sort.substring(0, sort.length() - 1);
         PageHelper.startPage(pageNo,pageSize,sort);
-        return bytedanceAccountReportMapper.getBytedanceAccountInfoByProjectId(startDate,endDate,projectId);
+        return new PageInfo<>(bytedanceAccountReportMapper.getBytedanceAccountInfoByProjectId(startDate,endDate,projectId));
     }