Procházet zdrojové kódy

Merge branch 'test' into test_v2

# Conflicts:
#	jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCampaignGroupJob.java
yumeng před 5 roky
rodič
revize
9115ed5f6d
17 změnil soubory, kde provedl 379 přidání a 68 odebrání
  1. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  2. 152 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ImageDownloadController.java
  3. 42 11
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java
  4. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCampaignGroupJob.java
  5. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyCreativeReportLoadJob.java
  6. 6 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/WatermarkVideoJob.java
  7. 4 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/ProjectMemberMapper.java
  8. 7 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ProjectMemberMapper.xml
  9. 3 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IProjectMemberService.java
  10. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java
  11. 2 2
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java
  12. 26 6
      module-report/src/main/java/cn/com/ctop/bytedance/controller/AccountReportController.java
  13. 52 12
      module-report/src/main/java/cn/com/ctop/bytedance/controller/BytedanceReportController.java
  14. 50 14
      module-report/src/main/java/cn/com/ctop/bytedance/controller/MaterialReportController.java
  15. 4 4
      module-report/src/main/java/cn/com/ctop/bytedance/service/impl/AccountReportServiceImpl.java
  16. 6 6
      module-report/src/main/java/cn/com/ctop/bytedance/service/impl/BytedanceReportServiceImpl.java
  17. 8 8
      module-report/src/main/java/cn/com/ctop/bytedance/service/impl/MaterialReportServiceImpl.java

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -137,6 +137,7 @@ public class ShiroConfig {
 		filterChainDefinitionMap.put("/report/kuaishouReportDailyAgent/get","anon");
 
 		filterChainDefinitionMap.put("/appium/appiumTask/run/login", "anon");
+		filterChainDefinitionMap.put("/zip/download", "anon");
 		//爬虫接口
 		filterChainDefinitionMap.put("/graphql/video", "anon");
 		filterChainDefinitionMap.put("/ks/web/test", "anon");

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 152 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ImageDownloadController.java


+ 42 - 11
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java

@@ -4,6 +4,7 @@ package org.jeecg.modules.ctop.controller;
 import cn.com.ctop.common.module.entity.MaterialInfo;
 import cn.com.ctop.common.module.service.IMaterialInfoService;
 import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -20,6 +21,7 @@ import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.ctop.service.IProjectMemberService;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -65,7 +67,6 @@ public class MaterialInfoController {
 
     @GetMapping(value = "/getDetail")
     public JSONObject getDetail(String materialId) {
-
         return materialInfoService.getDetail(materialId);
 
     }
@@ -90,6 +91,9 @@ public class MaterialInfoController {
      * @param req
      * @return
      */
+    @Autowired
+    private IProjectMemberService memberService;
+
     @AutoLog(value = "素材信息-分页列表查询")
     @ApiOperation(value = "素材信息-分页列表查询", notes = "素材信息-分页列表查询")
     @GetMapping(value = "/list")
@@ -99,24 +103,43 @@ public class MaterialInfoController {
                                                      HttpServletRequest req) {
 
         Result<IPage<MaterialInfo>> result = new Result<>();
+        QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
         Object createTime = materialInfo.getCreateTime();
         materialInfo.setCreateTime(null);
         if (!Check.isNull(materialInfo.getUserId())) {
             String roleCode = materialInfoService.getRoleCodeByUserId(materialInfo.getUserId());
-            if ("admin".equals(roleCode) || "operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode)) {
+            if ("admin".equals(roleCode) || "operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "operationAssistant".equals(roleCode) || "touTiaoOperationManager".equals(roleCode)) {
+                materialInfo.setUserId(null);
+                queryWrapper = QueryGenerator.initQueryWrapper(materialInfo, req.getParameterMap());
+            } else if ("designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode) || "plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode)) {
+                String userId = materialInfo.getUserId();
                 materialInfo.setUserId(null);
+                queryWrapper = QueryGenerator.initQueryWrapper(materialInfo, req.getParameterMap());
+                if (Check.isNull(materialInfo.getProjectId())) {
+                    List<Long> projects = memberService.selectProjectsByUserId(userId);
+                    if (!Check.isNull(projects)) {
+                        queryWrapper.in("project_id", projects);
+                    } else {
+                        result.setSuccess(true);
+                        result.setResult(null);
+                        return result;
+                    }
+                }
+
+            } else {
+                queryWrapper = QueryGenerator.initQueryWrapper(materialInfo, req.getParameterMap());
             }
-        }
-        QueryWrapper<MaterialInfo> queryWrapper = QueryGenerator.initQueryWrapper(materialInfo, req.getParameterMap());
-        if (!Check.isNull(createTime)) {
-            try {
-                Map<String, Object> map = DateUtils.getStartEndTime(createTime.toString());
-                queryWrapper.ge("create_time", map.get("start"));
-                queryWrapper.lt("create_time", map.get("end"));
-            } catch (ParseException e) {
-                e.printStackTrace();
+            if (!Check.isNull(createTime)) {
+                try {
+                    Map<String, Object> map = DateUtils.getStartEndTime(createTime.toString());
+                    queryWrapper.ge("create_time", map.get("start"));
+                    queryWrapper.lt("create_time", map.get("end"));
+                } catch (ParseException e) {
+                    e.printStackTrace();
+                }
             }
         }
+
         Page<MaterialInfo> page = new Page<>(pageNo, pageSize);
         IPage<MaterialInfo> pageList = materialInfoService.page(page, queryWrapper);
         result.setSuccess(true);
@@ -193,6 +216,14 @@ public class MaterialInfoController {
         if (materialInfoEntity == null) {
             result.error500("未找到对应实体");
         } else {
+            String url = materialInfo.getUrl();
+            if (!Check.isNull(url)) {
+                if (!url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                    url = KuaishouInterfaceConstant.HTTPS_PREFIX + url;
+                }
+                materialInfo.setUrl(url);
+            }
+
             boolean ok = materialInfoService.updateById(materialInfo);
             if (ok) {
                 result.success("修改成功!");

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCampaignGroupJob.java

@@ -32,7 +32,7 @@ public class KuaishouCampaignGroupJob implements Job {
             public void run() {
                 //1:查询当日数据
                 List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
-                executorService = Executors.newFixedThreadPool(5);
+                executorService = Executors.newFixedThreadPool(4);
                 tokens.forEach(token -> {
                     executorService.submit(new Runnable() {
                         @Override

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyCreativeReportLoadJob.java

@@ -51,7 +51,7 @@ public class KuaishouHourlyCreativeReportLoadJob implements Job {
                     log.info("定时获取头条数据异常:为获取到可用的token");
                     return;
                 }
-                executorService = Executors.newFixedThreadPool(5);
+                executorService = Executors.newFixedThreadPool(3);
                 countDownLatch = new CountDownLatch(tokens.size());
                 Date finalGetDate = getDate;
                 tokens.forEach(token -> {

+ 6 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/WatermarkVideoJob.java

@@ -1,17 +1,15 @@
 package org.jeecg.modules.ctop.job;
 
 import cn.com.ctop.common.module.entity.MaterialInfo;
-import cn.com.ctop.common.module.entity.VideoMergeTask;
 import cn.com.ctop.common.module.entity.VideoWatermarkTask;
 import cn.com.ctop.common.module.service.IMaterialInfoService;
-import cn.com.ctop.common.module.service.IVideoMergeTaskService;
 import cn.com.ctop.common.module.service.IVideoWatermarkTaskService;
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.LoadFileUtil;
 import cn.com.ctop.common.module.utils.MpsUtils;
 import cn.com.ctop.common.module.utils.PropertiesUtils;
 import com.aliyuncs.mts.model.v20140618.QueryJobListResponse;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
@@ -25,6 +23,7 @@ public class WatermarkVideoJob implements Job {
     private IVideoWatermarkTaskService videoWaterMarkService;
     @Autowired
     private IMaterialInfoService materialInfoService;
+
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
         Thread thread = new Thread() {
@@ -48,6 +47,10 @@ public class WatermarkVideoJob implements Job {
                                 QueryWrapper<MaterialInfo> materialInfoQueryWrapper = new QueryWrapper<>();
                                 materialInfoQueryWrapper.eq("watermark_code", job.getJobId());
                                 MaterialInfo materialInfo = materialInfoService.getOne(materialInfoQueryWrapper);
+                                if (Check.isNull(materialInfo)) {
+                                    continue;
+
+                                }
                                 materialInfo.setWatermarkUrl(url);
                                 materialInfoService.saveOrUpdate(materialInfo);
                                 videoWatermarkTask.setVideoUrl(url);

+ 4 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/ProjectMemberMapper.java

@@ -1,8 +1,11 @@
 package org.jeecg.modules.ctop.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.ctop.entity.ProjectMember;
 
+import java.util.List;
+
 /**
  * 项目成员
  *
@@ -12,4 +15,5 @@ import org.jeecg.modules.ctop.entity.ProjectMember;
  */
 public interface ProjectMemberMapper extends BaseMapper<ProjectMember> {
 
+    List<Long> selectProjectsByUserId(@Param("userId") String userId);
 }

+ 7 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ProjectMemberMapper.xml

@@ -2,4 +2,11 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.ctop.mapper.ProjectMemberMapper">
 
+    <select id="selectProjectsByUserId" resultType="java.lang.Long">
+        select
+        DISTINCT(project_id)
+         from ctop_project_member
+        where user_id = #{userId}
+    </select>
+
 </mapper>

+ 3 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IProjectMemberService.java

@@ -5,6 +5,8 @@ import org.jeecg.modules.ctop.entity.Project;
 import org.jeecg.modules.ctop.entity.ProjectMember;
 import org.jeecg.modules.system.entity.SysUser;
 
+import java.util.List;
+
 /**
  * 项目成员
  *
@@ -15,4 +17,5 @@ import org.jeecg.modules.system.entity.SysUser;
 public interface IProjectMemberService extends IService<ProjectMember> {
     void addMember(SysUser sysUser, Project project);
 
+    List<Long> selectProjectsByUserId(String userId);
 }

+ 14 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java

@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -26,6 +27,8 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
 
     @Autowired
     private MaterialReportMapper materialReportMapper;
+    @Autowired
+    private ProjectMemberMapper memberMapper;
 
     @Override
     public void addMember(SysUser sysUser, Project project) {
@@ -44,4 +47,15 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
         }
         this.save(member);
     }
+
+    /**
+     * 查询所有项目
+     *
+     * @param userId
+     * @return
+     */
+    @Override
+    public List<Long> selectProjectsByUserId(String userId) {
+        return memberMapper.selectProjectsByUserId(userId);
+    }
 }

+ 2 - 2
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java

@@ -362,7 +362,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
                                 log.info("素材基本信息入库完成,用时:{} s", (System.currentTimeMillis() - l) / 1000);
 
                             }
-                            Thread thread = new Thread() {
+                            /*Thread thread = new Thread() {
                                 @Override
                                 public void run() {
                                     try {
@@ -373,7 +373,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
                                     }
                                 }
                             };
-                            thread.start();
+                            thread.start();*/
 
                         } catch (Exception e) {
                             e.printStackTrace();

+ 26 - 6
module-report/src/main/java/cn/com/ctop/bytedance/controller/AccountReportController.java

@@ -56,17 +56,37 @@ public class AccountReportController {
     }
 
     @PostMapping("/getReportList")
-    public JSONObject getReportList(@RequestBody JSONObject json) {
-        JSONObject summaryJson = accountReportService.getSummaryReport(json);
-        return summaryJson;
+    public Result<JSONObject> getReportList(@RequestBody JSONObject json) {
+        Result<JSONObject> result = new Result<>();
+        try {
+            JSONObject summaryJson = accountReportService.getSummaryReport(json);
+            result.setResult(summaryJson);
+            result.setSuccess(true);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
+
+        return result;
 
     }
 
 
     @PostMapping("/getStatistics")
-    public JSONObject getStatistics(@RequestBody JSONObject json) {
-        JSONObject statisticsJson = accountReportService.getStatistics(json);
-        return statisticsJson;
+    public Result<JSONObject> getStatistics(@RequestBody JSONObject json) {
+        Result<JSONObject> result = new Result<>();
+        try {
+            JSONObject statisticsJson = accountReportService.getStatistics(json);
+            result.setResult(statisticsJson);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+
+        }
+
+        return result;
 
     }
 

+ 52 - 12
module-report/src/main/java/cn/com/ctop/bytedance/controller/BytedanceReportController.java

@@ -3,6 +3,7 @@ package cn.com.ctop.bytedance.controller;
 import cn.com.ctop.bytedance.service.IBytedanceReportService;
 import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -24,32 +25,71 @@ public class BytedanceReportController {
      * @return
      */
     @RequestMapping(value = "/accountReport")
-    public JSONObject getAccountReport() {
-        JSONObject json = bytedanceReportService.getAccountReport("e9ca23d68d884d4ebb19d07889727dae");
-        return json;
+    public Result<JSONObject> getAccountReport() {
+        Result<JSONObject> result = new Result<>();
+
+        try {
+            JSONObject json = bytedanceReportService.getAccountReport("e9ca23d68d884d4ebb19d07889727dae");
+            result.setResult(json);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
+
+        return result;
     }
 
 
     @PostMapping("/kuaiShou/accountReport")
-    public JSONObject getKuaiShouAccountReport(@RequestBody JSONObject requestJson) {
-        JSONObject json = bytedanceReportService.getKuaiShouAccountReport(requestJson);
-        return json;
+    public Result<JSONObject> getKuaiShouAccountReport(@RequestBody JSONObject requestJson) {
+        Result<JSONObject> result = new Result<>();
+        try {
+            JSONObject json = bytedanceReportService.getKuaiShouAccountReport(requestJson);
+            result.setResult(json);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
+
+        return result;
 
     }
 
 
     @PostMapping("/kuaiShou/accountDetailReport")
-    public List<JSONObject> getKuaiShouAccountDetailReport(@RequestBody JSONObject requestJson) {
-        List<JSONObject> kuaiShouAccounDetailtReport = bytedanceReportService.getKuaiShouAccounDetailtReport(requestJson);
-        return kuaiShouAccounDetailtReport;
+    public Result<List<JSONObject>> getKuaiShouAccountDetailReport(@RequestBody JSONObject requestJson) {
+
+        Result<List<JSONObject>> result = new Result<>();
+        try {
+            List<JSONObject> kuaiShouAccounDetailtReport = bytedanceReportService.getKuaiShouAccounDetailtReport(requestJson);
+            result.setResult(kuaiShouAccounDetailtReport);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
+
+        return result;
 
     }
 
 
     @PostMapping("/kuaiShou/getReportList")
-    public List<JSONObject> getReportList(@RequestBody JSONObject requestJson) {
-        List<JSONObject> kuaiShouAccounDetailtReport = bytedanceReportService.getReportList(requestJson);
-        return kuaiShouAccounDetailtReport;
+    public Result<List<JSONObject>> getReportList(@RequestBody JSONObject requestJson) {
+
+        Result<List<JSONObject>> result = new Result<>();
+        try {
+            List<JSONObject> kuaiShouAccounDetailtReport = bytedanceReportService.getReportList(requestJson);
+            result.setResult(kuaiShouAccounDetailtReport);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+
+        }
+        return result;
 
     }
 

+ 50 - 14
module-report/src/main/java/cn/com/ctop/bytedance/controller/MaterialReportController.java

@@ -6,6 +6,7 @@ import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.utils.Check;
 import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -23,36 +24,71 @@ public class MaterialReportController {
 
 
     @PostMapping(value = "/getKuaiShouMaterialMarket")
-    public List<JSONObject> getKuaiShouMaterialMarket(@RequestBody JSONObject json) {
-        List<JSONObject> marketJson = materialReportService.getKuaiShouMaterialMarket(json);
-        return marketJson;
+    public Result<List<JSONObject>> getKuaiShouMaterialMarket(@RequestBody JSONObject json) {
+        Result<List<JSONObject>> result = new Result<>();
+        try {
+            List<JSONObject> marketJson = materialReportService.getKuaiShouMaterialMarket(json);
+            result.setResult(marketJson);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
+
+        return result;
     }
 
 
     @PostMapping(value = "/getKuaiShouChainRatio")
-    public JSONObject getKuaiShouChainRatio(@RequestBody JSONObject json) {
-        JSONObject marketJson = materialReportService.getKuaiShouChainRatio(json);
-        return marketJson;
+    public Result<JSONObject> getKuaiShouChainRatio(@RequestBody JSONObject json) {
+
+        Result<JSONObject> result = new Result<>();
+        try {
+            JSONObject marketJson = materialReportService.getKuaiShouChainRatio(json);
+            result.setResult(marketJson);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
+
+        return result;
 
     }
 
 
     @PostMapping(value = "/getMaterialAccount")
-    public List<UserAllocation> getKuaiShouChainRatio(@RequestBody String userId) {
-        if (Check.isNull(userId)) {
-            return null;
+    public Result<List<UserAllocation>> getKuaiShouChainRatio(@RequestBody String userId) {
+        Result<List<UserAllocation>> result = new Result<>();
+        try {
+            if (Check.isNull(userId)) {
+                throw new Exception("用户id为空");
+            }
+            List<UserAllocation> accountIdList = materialReportService.selectAccountIds(userId);
+            result.setResult(accountIdList);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+
         }
-        List<UserAllocation> accountIdList = materialReportService.selectAccountIds(userId);
-        return accountIdList;
+        return result;
 
     }
 
 
     @PostMapping(value = "/getMaterialReportByAccount")
-    public List<JSONObject> getMaterialReportByAccount(@RequestBody JSONObject json) {
+    public Result<List<JSONObject>> getMaterialReportByAccount(@RequestBody JSONObject json) {
+        Result<List<JSONObject>> result = new Result<>();
+        try {
+            List<JSONObject> reportList = materialReportService.selectReportByAccountIds(json);
+            result.setResult(reportList);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            result.setSuccess(false);
+        }
 
-        List<JSONObject> reportList = materialReportService.selectReportByAccountIds(json);
-        return reportList;
+        return result;
 
     }
 

+ 4 - 4
module-report/src/main/java/cn/com/ctop/bytedance/service/impl/AccountReportServiceImpl.java

@@ -200,11 +200,11 @@ public class AccountReportServiceImpl implements IAccountReportService {
                 accountJson = accountReportMapper.selectDayReport(anotherDay, accountIds);
                 detail = accountReportMapper.selectReportDetail(anotherDay, accountIds);
             } else if (type == 3) {
-                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -7);
+                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -6);
                 accountJson = accountReportMapper.selectByDate(anotherDay, endDate, accountIds);
                 detail = accountReportMapper.selectDayDetailByDate(anotherDay, endDate, accountIds);
             } else if (type == 4) {
-                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -15);
+                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -14);
                 accountJson = accountReportMapper.selectByDate(anotherDay, endDate, accountIds);
                 detail = accountReportMapper.selectDayDetailByDate(anotherDay, endDate, accountIds);
             } else if (type == 5) {
@@ -516,7 +516,7 @@ public class AccountReportServiceImpl implements IAccountReportService {
 
                 returnJson.put("ratioJson", ratioJson);
             } else if (type == 3) {
-                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -7);
+                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -6);
                 accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds, discount);
                 statDate = endDate + " ~ " + anotherDay;
 
@@ -527,7 +527,7 @@ public class AccountReportServiceImpl implements IAccountReportService {
 
 
             } else if (type == 4) {
-                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -15);
+                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -14);
                 accountDetail = accountReportMapper.selectAccountReportByDate(anotherDay, endDate, accountIds, discount);
                 statDate = endDate + " ~ " + anotherDay;
                 queryMap.put("startDate", endDate);

+ 6 - 6
module-report/src/main/java/cn/com/ctop/bytedance/service/impl/BytedanceReportServiceImpl.java

@@ -283,10 +283,10 @@ public class BytedanceReportServiceImpl implements IBytedanceReportService {
             } else if (type == 2) {
                 accountJson = reportMapper.selectDayReport(anotherDay);
             } else if (type == 3) {
-                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -7);
+                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -6);
                 accountJson = reportMapper.selectByDate(anotherDay, endDate);
             } else if (type == 4) {
-                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -15);
+                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -14);
                 accountJson = reportMapper.selectByDate(anotherDay, endDate);
             } else if (type == 5) {
                 String endDate = DateUtils.getMonthBefore("yyyy-MM-dd", anotherDay, -1);
@@ -440,10 +440,10 @@ public class BytedanceReportServiceImpl implements IBytedanceReportService {
             } else if (type == 2) {
                 detail = reportMapper.selectReportDetail(anotherDay);
             } else if (type == 3) {
-                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -7);
+                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -6);
                 detail = reportMapper.selectDayDetailByDate(anotherDay, endDate);
             } else if (type == 4) {
-                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -15);
+                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -14);
                 detail = reportMapper.selectDayDetailByDate(anotherDay, endDate);
             } else if (type == 5) {
                 String endDate = DateUtils.getMonthBefore("yyyy-MM-dd", anotherDay, -1);
@@ -580,10 +580,10 @@ public class BytedanceReportServiceImpl implements IBytedanceReportService {
             } else if (type == 2) {
                 reportList = reportMapper.selectReportDetail(anotherDay);
             } else if (type == 3) {
-                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -7);
+                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -6);
                 reportList = reportMapper.selectDayDetailByDate(anotherDay, endDate);
             } else if (type == 4) {
-                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -15);
+                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -14);
                 reportList = reportMapper.selectDayDetailByDate(anotherDay, endDate);
             } else if (type == 5) {
                 String endDate = DateUtils.getMonthBefore("yyyy-MM-dd", anotherDay, -1);

+ 8 - 8
module-report/src/main/java/cn/com/ctop/bytedance/service/impl/MaterialReportServiceImpl.java

@@ -86,13 +86,13 @@ public class MaterialReportServiceImpl implements IMaterialReportService {
                 marketJsonList = materialReportMapper.selectByMap(paramsMap);
 
             } else if (type == 3) {
-                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -7);
+                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -6);
                 paramsMap.put("startDate", anotherDay);
                 paramsMap.put("endDate", endDate);
                 marketJsonList = materialReportMapper.selectDailyByMap(paramsMap);
 
             } else if (type == 4) {
-                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -15);
+                String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -14);
                 paramsMap.put("startDate", anotherDay);
                 paramsMap.put("endDate", endDate);
                 marketJsonList = materialReportMapper.selectDailyByMap(paramsMap);
@@ -190,25 +190,25 @@ public class MaterialReportServiceImpl implements IMaterialReportService {
 
             } else if (type == 3) {
                 // 近一周数据
-                contrastStartDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -7);
+                contrastStartDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -6);
                 paramsMap.put("startDate", contrastStartDate);
                 paramsMap.put("endDate", anotherDay);
                 contrastJson = materialReportMapper.selectDailyChainRatioByMap(paramsMap);
                 if (!Check.isNull(contrastJson)) {
                     beContrastEndDate = DateUtils.getAnotherDay("yyyy-MM-dd", contrastStartDate, -1);
-                    beContrastStartDate = DateUtils.getAnotherDay("yyyy-MM-dd", beContrastEndDate, -7);
+                    beContrastStartDate = DateUtils.getAnotherDay("yyyy-MM-dd", beContrastEndDate, -6);
                     paramsMap.put("endDate", beContrastEndDate);
                     paramsMap.put("startDate", beContrastStartDate);
                     beContrastJson = materialReportMapper.selectDailyChainRatioByMap(paramsMap);
                 }
             } else if (type == 4) {
-                contrastStartDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -15);
+                contrastStartDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -14);
                 paramsMap.put("startDate", contrastStartDate);
                 paramsMap.put("endDate", anotherDay);
                 contrastJson = materialReportMapper.selectDailyChainRatioByMap(paramsMap);
                 if (!Check.isNull(contrastJson)) {
                     beContrastEndDate = DateUtils.getAnotherDay("yyyy-MM-dd", contrastStartDate, -1);
-                    beContrastStartDate = DateUtils.getAnotherDay("yyyy-MM-dd", beContrastEndDate, -15);
+                    beContrastStartDate = DateUtils.getAnotherDay("yyyy-MM-dd", beContrastEndDate, -14);
                     paramsMap.put("endDate", beContrastEndDate);
                     paramsMap.put("startDate", beContrastStartDate);
                     beContrastJson = materialReportMapper.selectDailyChainRatioByMap(paramsMap);
@@ -480,12 +480,12 @@ public class MaterialReportServiceImpl implements IMaterialReportService {
                 paramsMap.put("endDate", anotherDay);
                 marketJsonList = materialReportMapper.selectDayMaterialList(paramsMap);
             } else if (type == 3) {
-                String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -7);
+                String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -6);
                 paramsMap.put("startDate", startDate);
                 paramsMap.put("endDate", anotherDay);
                 marketJsonList = materialReportMapper.selectDayMaterialList(paramsMap);
             } else if (type == 4) {
-                String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -15);
+                String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -14);
                 paramsMap.put("startDate", startDate);
                 paramsMap.put("endDate", anotherDay);
                 marketJsonList = materialReportMapper.selectDayMaterialList(paramsMap);