Selaa lähdekoodia

Merge remote-tracking branch 'origin/test' into test2

xuzuoyun 5 vuotta sitten
vanhempi
commit
b83b19b5b5
91 muutettua tiedostoa jossa 755 lisäystä ja 860 poistoa
  1. 23 2
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java
  2. 6 0
      jeecg-boot-module-system/pom.xml
  3. 0 250
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AuthTaskController.java
  4. 11 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BindAccountLoginController.java
  5. 0 44
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/AuthTask.java
  6. 0 14
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/AuthTaskMapper.java
  7. 0 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/CustomerPlanStatisticInfoMapper.xml
  8. 0 14
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IAuthTaskService.java
  9. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/ICreateInternalService.java
  10. 0 23
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IReportService.java
  11. 0 31
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/AuthTaskServiceImpl.java
  12. 2 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CreateInternalServiceImpl.java
  13. 1 25
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  14. 7 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/BindAccountLogin.java
  15. 2 2
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/FileInfoServiceImpl.java
  16. 33 99
      module-common/src/main/java/cn/com/ctop/common/module/utils/HttpUtils.java
  17. 17 0
      module-report/pom.xml
  18. 4 0
      module-report/src/main/java/cn/com/ctop/bytedance/aa.java
  19. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceAdvertiserDailyReportController.java
  20. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceAdvertiserHourlyReportController.java
  21. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceCampaignDailyReportController.java
  22. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceCampaignHourlyReportController.java
  23. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceCreativeDailyReportController.java
  24. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceCreativeHourlyReportController.java
  25. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedancePlanDailyReportController.java
  26. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedancePlanHourlyReportController.java
  27. 36 0
      module-report/src/main/java/cn/com/ctop/bytedance/controller/BytedanceReportController.java
  28. 3 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CustomerPlanStatisticInfoController.java
  29. 19 24
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/PlatformCampaignStatisticInfoController.java
  30. 13 12
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ReportController.java
  31. 3 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceAdvertiserDailyReport.java
  32. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceAdvertiserHourlyReport.java
  33. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceCampaignDailyReport.java
  34. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceCampaignHourlyReport.java
  35. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceCreativeDailyReport.java
  36. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceCreativeHourlyReport.java
  37. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedancePlanDailyReport.java
  38. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedancePlanHourlyReport.java
  39. 3 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/CustomerPlanStatisticInfo.java
  40. 10 14
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/PlatformCampaignStatisticInfo.java
  41. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceAdvertiserDailyReportMapper.java
  42. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceAdvertiserHourlyReportMapper.java
  43. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceCampaignDailyReportMapper.java
  44. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceCampaignHourlyReportMapper.java
  45. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceCreativeDailyReportMapper.java
  46. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceCreativeHourlyReportMapper.java
  47. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedancePlanDailyReportMapper.java
  48. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedancePlanHourlyReportMapper.java
  49. 2 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/CustomerPlanStatisticInfoMapper.java
  50. 6 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/PlatformCampaignStatisticInfoMapper.java
  51. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceAdvertiserDailyReportMapper.xml
  52. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceAdvertiserHourlyReportMapper.xml
  53. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceCampaignDailyReportMapper.xml
  54. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceCampaignHourlyReportMapper.xml
  55. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceCreativeDailyReportMapper.xml
  56. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceCreativeHourlyReportMapper.xml
  57. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedancePlanDailyReportMapper.xml
  58. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedancePlanHourlyReportMapper.xml
  59. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/AuthTaskMapper.xml
  60. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/PlatformCampaignStatisticInfoMapper.xml
  61. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedanceAdvertiserDailyReportService.java
  62. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedanceAdvertiserHourlyReportService.java
  63. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedanceCampaignDailyReportService.java
  64. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedanceCampaignHourlyReportService.java
  65. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedanceCreativeDailyReportService.java
  66. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedanceCreativeHourlyReportService.java
  67. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedancePlanDailyReportService.java
  68. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedancePlanHourlyReportService.java
  69. 7 0
      module-report/src/main/java/cn/com/ctop/bytedance/service/IBytedanceReportService.java
  70. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/ICustomerPlanStatisticInfoService.java
  71. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IPlatformCampaignStatisticInfoService.java
  72. 24 0
      module-report/src/main/java/cn/com/ctop/bytedance/service/IReportService.java
  73. 5 4
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceAdvertiserDailyReportServiceImpl.java
  74. 4 4
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceAdvertiserHourlyReportServiceImpl.java
  75. 4 4
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceCampaignDailyReportServiceImpl.java
  76. 5 4
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceCampaignHourlyReportServiceImpl.java
  77. 5 4
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceCreativeDailyReportServiceImpl.java
  78. 4 4
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceCreativeHourlyReportServiceImpl.java
  79. 4 4
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedancePlanDailyReportServiceImpl.java
  80. 4 4
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedancePlanHourlyReportServiceImpl.java
  81. 92 0
      module-report/src/main/java/cn/com/ctop/bytedance/service/impl/BytedanceReportServiceImpl.java
  82. 5 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CustomerPlanStatisticInfoServiceImpl.java
  83. 5 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/PlatformCampaignStatisticInfoServiceImpl.java
  84. 73 141
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ReportServiceImpl.java
  85. 15 0
      module-report/src/main/java/cn/com/ctop/bytedance/vo/ByteDanceAdvertiserReportDTO.java
  86. 208 0
      module-report/src/main/java/cn/com/ctop/bytedance/vo/StatisticCampaignVo.java
  87. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/ByteDanceAdvertisePlanServiceImpl.java
  88. 1 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/ByteDanceAdvertiserDataServiceImpl.java
  89. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/ByteDanceCampaignTemplateServiceImpl.java
  90. 3 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/ByteDanceCreativeServiceImpl.java
  91. 4 4
      module-toutiao/src/main/java/cn/com/ctop/toutiao/test/Test.java

+ 23 - 2
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -1,5 +1,7 @@
 package org.jeecg.common.util;
 
+import org.springframework.util.StringUtils;
+
 import java.beans.PropertyEditorSupport;
 import java.sql.Timestamp;
 import java.text.DateFormat;
@@ -7,8 +9,6 @@ import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
-import org.springframework.util.StringUtils;
-
 /**
  * 类描述:时间操作定义类
  *
@@ -94,6 +94,7 @@ public class DateUtils extends PropertyEditorSupport {
 
     /**
      * 日期转换为字符串
+     *
      * @return 字符串
      */
     public static String date2Str() {
@@ -125,6 +126,7 @@ public class DateUtils extends PropertyEditorSupport {
 
     /**
      * 日期转换为字符串
+     *
      * @param format 日期格式
      * @return 字符串
      */
@@ -730,4 +732,23 @@ public class DateUtils extends PropertyEditorSupport {
         }
     }
 
+
+    public static Map<String, Object> getBeforeDate() {
+        Date dNow = new Date(); //当前时间
+        Date dBefore = new Date();
+        Calendar calendar = Calendar.getInstance(); //得到日历
+        calendar.setTime(dNow);//把当前时间赋给日历
+        calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天
+        dBefore = calendar.getTime(); //得到前一天的时间
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); //设置时间格式
+        String defaultStartDate = sdf.format(dBefore); //格式化前一天
+        defaultStartDate = defaultStartDate + " 00:00:00";
+        String defaultEndDate = defaultStartDate.substring(0, 10) + " 23:59:59";
+        Map<String, Object> map = new HashMap<>();
+        map.put("startDate", defaultStartDate);
+        map.put("endDate", defaultEndDate);
+        return map;
+    }
+
+
 }

+ 6 - 0
jeecg-boot-module-system/pom.xml

@@ -101,6 +101,12 @@
             <version>2.0.2</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>cn.com.ctop</groupId>
+            <artifactId>module-report</artifactId>
+            <version>2.0.2</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 
     <build>

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

@@ -1,250 +0,0 @@
-package org.jeecg.modules.ctop.controller;
-
-import com.alibaba.fastjson.JSON;
-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.jeecg.common.api.vo.Result;
-import org.jeecg.common.aspect.annotation.AutoLog;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
-import org.jeecg.modules.ctop.entity.AuthTask;
-import org.jeecg.modules.ctop.service.IAuthTaskService;
-import org.jeecgframework.poi.excel.ExcelImportUtil;
-import org.jeecgframework.poi.excel.def.NormalExcelConstants;
-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.multipart.MultipartFile;
-import org.springframework.web.multipart.MultipartHttpServletRequest;
-import org.springframework.web.servlet.ModelAndView;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-/**
- * TODO 相关AuthTask 需要删除
- *
- * @Description: 关联用户分配
- * @Author: jeecg-boot
- * @Date: 2019-07-31
- * @Version: V1.0
- */
-@Slf4j
-@Api(tags = "关联用户分配")
-@RestController
-@RequestMapping("/ctop/authTask")
-public class AuthTaskController {
-    @Autowired
-    private IAuthTaskService authTaskService;
-
-    /**
-     * 分页列表查询
-     *
-     * @param authTask
-     * @param pageNo
-     * @param pageSize
-     * @param req
-     * @return
-     */
-    @AutoLog(value = "关联用户分配-分页列表查询")
-    @ApiOperation(value = "关联用户分配-分页列表查询", notes = "关联用户分配-分页列表查询")
-    @GetMapping(value = "/list")
-    public Result<IPage<AuthTask>> queryPageList(AuthTask authTask,
-                                                 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                 HttpServletRequest req) {
-        Result<IPage<AuthTask>> result = new Result<IPage<AuthTask>>();
-        QueryWrapper<AuthTask> queryWrapper = QueryGenerator.initQueryWrapper(authTask, req.getParameterMap());
-        Page<AuthTask> page = new Page<AuthTask>(pageNo, pageSize);
-        IPage<AuthTask> pageList = authTaskService.page(page, queryWrapper);
-        result.setSuccess(true);
-        result.setResult(pageList);
-        return result;
-    }
-
-    /**
-     * 添加
-     *
-     * @param authTask
-     * @return
-     */
-    @AutoLog(value = "关联用户分配-添加")
-    @ApiOperation(value = "关联用户分配-添加", notes = "关联用户分配-添加")
-    @PostMapping(value = "/add")
-    public Result<AuthTask> add(@RequestBody AuthTask authTask) {
-        Result<AuthTask> result = new Result<AuthTask>();
-        try {
-            authTaskService.save(authTask);
-            result.success("添加成功!");
-        } catch (Exception e) {
-            log.error(e.getMessage(), e);
-            result.error500("操作失败");
-        }
-        return result;
-    }
-
-    /**
-     * 编辑
-     *
-     * @param authTask
-     * @return
-     */
-    @AutoLog(value = "关联用户分配-编辑")
-    @ApiOperation(value = "关联用户分配-编辑", notes = "关联用户分配-编辑")
-    @PutMapping(value = "/edit")
-    public Result<AuthTask> edit(@RequestBody AuthTask authTask) {
-        Result<AuthTask> result = new Result<AuthTask>();
-        AuthTask authTaskEntity = authTaskService.getById(authTask.getId());
-        if (authTaskEntity == null) {
-            result.error500("未找到对应实体");
-        } else {
-            boolean ok = authTaskService.updateById(authTask);
-            //TODO 返回false说明什么?
-            if (ok) {
-                result.success("修改成功!");
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * 通过id删除
-     *
-     * @param id
-     * @return
-     */
-    @AutoLog(value = "关联用户分配-通过id删除")
-    @ApiOperation(value = "关联用户分配-通过id删除", notes = "关联用户分配-通过id删除")
-    @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
-        try {
-            authTaskService.removeById(id);
-        } catch (Exception e) {
-            log.error("删除失败", e.getMessage());
-            return Result.error("删除失败!");
-        }
-        return Result.ok("删除成功!");
-    }
-
-    /**
-     * 批量删除
-     *
-     * @param ids
-     * @return
-     */
-    @AutoLog(value = "关联用户分配-批量删除")
-    @ApiOperation(value = "关联用户分配-批量删除", notes = "关联用户分配-批量删除")
-    @DeleteMapping(value = "/deleteBatch")
-    public Result<AuthTask> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<AuthTask> result = new Result<AuthTask>();
-        if (ids == null || "".equals(ids.trim())) {
-            result.error500("参数不识别!");
-        } else {
-            this.authTaskService.removeByIds(Arrays.asList(ids.split(",")));
-            result.success("删除成功!");
-        }
-        return result;
-    }
-
-    /**
-     * 通过id查询
-     *
-     * @param id
-     * @return
-     */
-    @AutoLog(value = "关联用户分配-通过id查询")
-    @ApiOperation(value = "关联用户分配-通过id查询", notes = "关联用户分配-通过id查询")
-    @GetMapping(value = "/queryById")
-    public Result<AuthTask> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<AuthTask> result = new Result<AuthTask>();
-        AuthTask authTask = authTaskService.getById(id);
-        if (authTask == null) {
-            result.error500("未找到对应实体");
-        } else {
-            result.setResult(authTask);
-            result.setSuccess(true);
-        }
-        return result;
-    }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<AuthTask> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                AuthTask authTask = JSON.parseObject(deString, AuthTask.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(authTask, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<AuthTask> pageList = authTaskService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "关联用户分配列表");
-        mv.addObject(NormalExcelConstants.CLASS, AuthTask.class);
-        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("关联用户分配列表数据", "导出人:Jeecg", "导出信息"));
-        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
-        return mv;
-    }
-
-    /**
-     * 通过excel导入数据
-     *
-     * @param request
-     * @param response
-     * @return
-     */
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
-        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
-        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
-            // 获取上传文件对象
-            MultipartFile file = entity.getValue();
-            ImportParams params = new ImportParams();
-            params.setTitleRows(2);
-            params.setHeadRows(1);
-            params.setNeedSave(true);
-            try {
-                List<AuthTask> listAuthTasks = ExcelImportUtil.importExcel(file.getInputStream(), AuthTask.class, params);
-                authTaskService.saveBatch(listAuthTasks);
-                return Result.ok("文件导入成功!数据行数:" + listAuthTasks.size());
-            } catch (Exception e) {
-                log.error(e.getMessage(), e);
-                return Result.error("文件导入失败:" + e.getMessage());
-            } finally {
-                try {
-                    file.getInputStream().close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-        return Result.ok("文件导入失败!");
-    }
-}

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

@@ -1,10 +1,10 @@
 package org.jeecg.modules.ctop.controller;
 
-import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.UserAllocationMapper;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
+import cn.com.ctop.common.module.utils.Check;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -13,9 +13,11 @@ 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;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.ctop.service.ICreateInternalService;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
@@ -79,17 +81,17 @@ public class BindAccountLoginController {
         String userId = json.getString("userId");
         String password = json.getString("password");
         String loginType = json.getString("loginType");
+        // 广告主名称
+        String advertiserName = json.getString("advertiser_name");
         //账号
         String accountName = json.getString("accountName");
-        boolean trueOrFalse = createInternalService.bindLogin(advertiserId, accountName, password, loginType, userId);
+        boolean trueOrFalse = createInternalService.bindLogin(advertiserId, accountName, password, loginType, userId, advertiserName);
         if (trueOrFalse) {
             String realName = json.getString("realName");
             //部门id
             String departmentId = json.getString("departmentId");
             //指定分配人姓名
             String distributionName = json.getString("distributionName");
-            // 广告主名称
-            String advertiserName = json.getString("advertiser_name");
             // 媒体类型: 1 头条 2 快手
             String mediaId = json.getString("mediaId");
             UserAllocation userAllocation = new UserAllocation();
@@ -130,6 +132,11 @@ public class BindAccountLoginController {
                                                          HttpServletRequest req) {
         Result<IPage<BindAccountLogin>> result = new Result<>();
         QueryWrapper<BindAccountLogin> queryWrapper = QueryGenerator.initQueryWrapper(bindAccountLogin, req.getParameterMap());
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        if (!Check.isNull(user)) {
+            queryWrapper.eq("user_id", user.getId());
+        }
+        queryWrapper.orderByDesc("id");
         Page<BindAccountLogin> page = new Page<>(pageNo, pageSize);
         IPage<BindAccountLogin> pageList = bindAccountLoginService.page(page, queryWrapper);
         result.setSuccess(true);

+ 0 - 44
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/AuthTask.java

@@ -1,44 +0,0 @@
-package org.jeecg.modules.ctop.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecgframework.poi.excel.annotation.Excel;
-
-/**
- * 关联用户分配
- * @author jeecg-boot
- * @date 2019-07-31
- * @version V1.0
- */
-@Data
-@TableName("ctop_auth_task")
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-@ApiModel(value = "ctop_auth_task对象", description = "关联用户分配")
-public class AuthTask {
-
-    /**
-     * 主键ID
-     */
-    @TableId(type = IdType.AUTO)
-    @ApiModelProperty(value = "主键ID")
-    private Long id;
-    /**
-     * 广告主ID
-     */
-    @Excel(name = "广告主ID", width = 15)
-    @ApiModelProperty(value = "广告主ID")
-    private String advertiserId;
-    /**
-     * task_id
-     */
-    @Excel(name = "task_id", width = 15)
-    @ApiModelProperty(value = "task_id")
-    private String taskId;
-}

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

@@ -1,14 +0,0 @@
-package org.jeecg.modules.ctop.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.jeecg.modules.ctop.entity.AuthTask;
-
-/**
- * @Description: 关联用户分配
- * @Author: jeecg-boot
- * @Date: 2019-07-31
- * @Version: V1.0
- */
-public interface AuthTaskMapper extends BaseMapper<AuthTask> {
-
-}

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

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!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.CustomerPlanStatisticInfoMapper">
-
-</mapper>

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

@@ -1,14 +0,0 @@
-package org.jeecg.modules.ctop.service;
-
-import org.jeecg.modules.ctop.entity.AuthTask;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * @Description: 关联用户分配
- * @Author: jeecg-boot
- * @Date: 2019-07-31
- * @Version: V1.0
- */
-public interface IAuthTaskService extends IService<AuthTask> {
-    AuthTask getAuthTask(String taskId);
-}

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/ICreateInternalService.java

@@ -9,5 +9,5 @@ public interface ICreateInternalService {
 
     Map<String, Object> checkAccountPassword(String account, String password);
 
-    public boolean bindLogin(String advertiserId, String accountName, String password, String loginType, String userId);
+     boolean bindLogin(String advertiserId, String accountName, String password, String loginType, String userId,String advertiserName);
 }

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

@@ -1,23 +0,0 @@
-package org.jeecg.modules.ctop.service;
-
-import com.alibaba.fastjson.JSONObject;
-
-import java.util.Map;
-
-public interface IReportService {
-    Map<String, Object> getAdvertiserReport(JSONObject conditions);
-
-    Map<String, Object> getCampaignReport(JSONObject conditions);
-
-    Map<String, Object> getAdReport(JSONObject conditions);
-
-    Map<String, Object> getCreativeReport(JSONObject conditions);
-
-    Map<String, Object> getAgentReport(JSONObject conditions);
-
-    void insertCustomerInfo(String csvPath, String charset);
-
-    void insertPlatformInfo(String excelPath, String charset, Long accountId);
-
-    Map<String, Object> debitAuto(JSONObject data);
-}

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

@@ -1,31 +0,0 @@
-package org.jeecg.modules.ctop.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import org.jeecg.modules.ctop.entity.AuthTask;
-import org.jeecg.modules.ctop.mapper.AuthTaskMapper;
-import org.jeecg.modules.ctop.service.IAuthTaskService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
-/**
- * @Description: 关联用户分配
- * @Author: jeecg-boot
- * @Date: 2019-07-31
- * @Version: V1.0
- */
-@Service
-public class AuthTaskServiceImpl extends ServiceImpl<AuthTaskMapper, AuthTask> implements IAuthTaskService {
-
-    @Autowired
-    private AuthTaskMapper authTaskMapper;
-
-    @Override
-    public AuthTask getAuthTask(String taskId) {
-        QueryWrapper<AuthTask> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("task_id", taskId).orderByDesc("create_time");
-        AuthTask authTask = authTaskMapper.selectOne(queryWrapper);
-        return authTask;
-    }
-}

+ 2 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CreateInternalServiceImpl.java

@@ -46,7 +46,7 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
     private BytedanceUrlInfoMapper urlInfoMapper;
 
     @Override
-    public boolean bindLogin(String advertiserId, String accountName, String password, String loginType, String userId) {
+    public boolean bindLogin(String advertiserId, String accountName, String password, String loginType, String userId, String advertiserName) {
         Map<String, Object> requestMap = new HashMap<>();
         requestMap.put("advertiser_id", advertiserId);
         requestMap.put("account_name", accountName);
@@ -71,6 +71,7 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
         bindAccountLogin.setPassword(password);
         bindAccountLogin.setAccountId(accountId);
         bindAccountLogin.setLoginType(loginType);
+        bindAccountLogin.setAccountName(advertiserName);
         bindAccountLogin.setUserId(userId);
         int i = bindAccountLoginMapper.insert(bindAccountLogin);
         if (i > 0) {

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

@@ -1,10 +1,8 @@
 package org.jeecg;
 
-import cn.com.ctop.common.module.utils.OSSUtils;
-import cn.com.ctop.common.module.utils.ResultMapUtils;
-import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.utils.OSSUtils;
 import cn.com.ctop.toutiao.entity.ByteDanceUserOrientationTemplate;
 import cn.com.ctop.toutiao.entity.BytedanceAreaInfo;
 import cn.com.ctop.toutiao.entity.BytedanceInterestCategory;
@@ -16,7 +14,6 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import org.jeecg.common.util.jsonschema.JsonschemaUtil;
 import org.jeecg.modules.ctop.service.ICreateInternalService;
-import org.jeecg.modules.ctop.service.IReportService;
 import org.jeecg.modules.demo.mock.MockController;
 import org.jeecg.modules.demo.test.mapper.JeecgDemoMapper;
 import org.jeecg.modules.demo.test.service.IJeecgDemoService;
@@ -30,7 +27,6 @@ import org.springframework.test.context.junit4.SpringRunner;
 import javax.annotation.Resource;
 import java.io.File;
 import java.util.Date;
-import java.util.HashMap;
 import java.util.Map;
 
 @RunWith(SpringRunner.class)
@@ -47,26 +43,6 @@ public class SampleTest {
     private MockController mock;
 
     @Autowired
-    private IReportService reportService;
-
-    @Test
-    public void loadCustomerData() {
-        Map<String, Object> result = new HashMap<>();
-        String csvPath = "D:\\工作文件\\360借条\\借条后台数据实时.csv";
-        reportService.insertCustomerInfo(csvPath, "utf8");
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS.getCode());
-    }
-
-    @Test
-    public void loadPlatformData() {
-        Map<String, Object> result = new HashMap<>();
-        String csvPath4 = "D:\\工作文件\\360借条\\快手后台数据-户4.csv";
-        reportService.insertPlatformInfo(csvPath4, "GBK", 4L);
-        String csvPath1 = "D:\\工作文件\\360借条\\快手后台数据-户1.csv";
-        reportService.insertPlatformInfo(csvPath1, "GBK", 1L);
-    }
-
-    @Autowired
     private ICreateInternalService createInternalService;
 
     @Test

+ 7 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/BindAccountLogin.java

@@ -39,6 +39,13 @@ public class BindAccountLogin {
     @Excel(name = "广告id", width = 15)
     @ApiModelProperty(value = "广告id")
     private String advertiserId;
+
+    /**
+     * 广告名称
+     */
+    @Excel(name = "广告名称", width = 15)
+    @ApiModelProperty(value = "广告名称")
+    private String advertiserName;
     /**
      * 广告id
      */

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

@@ -165,7 +165,7 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
         // 请求地址
         String url = "https://ad.toutiao.com/open_api/2/tools/creative_word/select/";
         // 请求参数
-        Map<String, Object> data = new HashMap();
+        JSONObject data = new JSONObject();
         data.put("advertiser_id", advertiserId);
         JSONObject resultObject = HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, data);
         JSONArray creativeWords = resultObject.getJSONObject("data").getJSONArray("creative_word");
@@ -192,7 +192,7 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
         if (null != level) {
             url += "?level=" + level;
         }
-        return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, new HashMap<>());
+        return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, new JSONObject());
     }
 
     public JSONObject uploadAdImage(CtopOauthToken token, String imageUrl, String advertiserId) {

+ 33 - 99
module-common/src/main/java/cn/com/ctop/common/module/utils/HttpUtils.java

@@ -11,7 +11,6 @@ import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpStatus;
 import org.apache.http.NameValuePair;
-import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.CookieStore;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.config.CookieSpecs;
@@ -54,7 +53,7 @@ import java.util.*;
 @Slf4j
 public class HttpUtils {
 
-    public static JSONObject bytedanceGetRequest(String accessToken, String url, Map<String, Object> params) {
+    public static JSONObject bytedanceGetRequest(String accessToken, String url, JSONObject params) {
         // 构造请求
         HttpEntityEnclosingRequestBase httpEntity = new HttpEntityEnclosingRequestBase() {
             @Override
@@ -68,11 +67,11 @@ public class HttpUtils {
         try {
             client = HttpClientBuilder.create().build();
             httpEntity.setURI(URI.create(url));
-            httpEntity.setEntity(new StringEntity(JSONObject.toJSONString(params), ContentType.APPLICATION_JSON));
+            httpEntity.setEntity(new StringEntity(params.toJSONString(), ContentType.APPLICATION_JSON));
             response = client.execute(httpEntity);
             if (response != null && response.getStatusLine().getStatusCode() == 200) {
                 BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-                StringBuffer result = new StringBuffer();
+                StringBuilder result = new StringBuilder();
                 String line = "";
                 while ((line = bufferedReader.readLine()) != null) {
                     result.append(line);
@@ -80,16 +79,16 @@ public class HttpUtils {
                 bufferedReader.close();
                 return JSONObject.parseObject(result.toString());
             }
-        } catch (ClientProtocolException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
+        } catch (Exception e) {
+            log.error(e.getMessage());
         } finally {
             try {
                 if (response != null) {
                     response.close();
                 }
-                client.close();
+                if (client != null) {
+                    client.close();
+                }
             } catch (IOException e) {
                 e.printStackTrace();
             }
@@ -109,25 +108,24 @@ public class HttpUtils {
             response = client.execute(httpEntity);
             if (response != null && response.getStatusLine().getStatusCode() == 200) {
                 BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-                StringBuffer result = new StringBuffer();
+                StringBuilder result = new StringBuilder();
                 String line = "";
                 while ((line = bufferedReader.readLine()) != null) {
                     result.append(line);
                 }
                 bufferedReader.close();
-                System.out.println(JSONObject.parseObject(result.toString()));
                 return JSONObject.parseObject(result.toString());
             }
-        } catch (ClientProtocolException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
+        } catch (Exception e) {
             e.printStackTrace();
         } finally {
             try {
                 if (response != null) {
                     response.close();
                 }
-                client.close();
+                if (client != null) {
+                    client.close();
+                }
             } catch (IOException e) {
                 e.printStackTrace();
             }
@@ -135,7 +133,7 @@ public class HttpUtils {
         return null;
     }
 
-    public static CookieStore cookieStore = new BasicCookieStore();
+    public static CookieStore COOKIESTORE = new BasicCookieStore();
     /**
      * setProxy(new HttpHost("106.125.239.179", 4245))
      */
@@ -153,7 +151,7 @@ public class HttpUtils {
             }).build();
             RequestConfig globalConfig = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).setCookieSpec(CookieSpecs.STANDARD).build();
             SSLConnectionSocketFactory sslFactory = new SSLConnectionSocketFactory(sslContext);
-            return HttpClients.custom().setDefaultCookieStore(cookieStore).setDefaultRequestConfig(globalConfig).setConnectionReuseStrategy((response, context) -> false).setSSLSocketFactory(sslFactory).build();
+            return HttpClients.custom().setDefaultCookieStore(COOKIESTORE).setDefaultRequestConfig(globalConfig).setConnectionReuseStrategy((response, context) -> false).setSSLSocketFactory(sslFactory).build();
         } catch (Exception e) {
             log.error("处理Https证书异常", e);
         }
@@ -166,19 +164,11 @@ public class HttpUtils {
         try {
             HttpPost httppost = new HttpPost(url);
             httppost.setHeader("User-Agent", USER_AGENT);
-
-            List<Cookie> list = cookieStore.getCookies();
-            for (Cookie ck : list) {
-                System.out.println(ck.getName() + "=" + ck.getValue() + "," + ck.getDomain());
-            }
-            System.out.println("-------------------------------------");
             for (String key : headers.keySet()) {
                 httppost.setHeader(key, headers.get(key));
             }
             List<NameValuePair> paramList = new ArrayList<NameValuePair>();
             for (String key : param.keySet()) {
-                System.out.println(key + "=" + String.valueOf(param.get(key)));
-                System.out.println("-------------------------------------");
                 BasicNameValuePair basicNameValuePair = new BasicNameValuePair(key, String.valueOf(param.get(key)));
                 paramList.add(basicNameValuePair);
             }
@@ -187,8 +177,6 @@ public class HttpUtils {
             UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(paramList);
             // 第一步:通过setEntity 将我们的entity对象传递过去
             httppost.setEntity(formEntity);
-
-//            httppost.setHeader("Content-Type", "application/json");
             httppost.setEntity(new StringEntity(new Gson().toJson(param), Charset.forName("UTF-8")));
             HttpEntity respentity;
 
@@ -210,21 +198,15 @@ public class HttpUtils {
     }
 
     public static String httpPostRequest(String url, Map<String, Object> param, Map<String, String> headers) {
-//        HttpClient httpclient = HttpClientBuilder.create().setRedirectStrategy(new LaxRedirectStrategy()).build();
         HttpClient httpClient = createSslClientDefault();
         String strReturn = "";
         try {
             HttpPost httppost = new HttpPost(url);
             httppost.setHeader("User-Agent", USER_AGENT);
             httppost.addHeader("Content-Type", "application/json");
-            List<Cookie> list = cookieStore.getCookies();
-//            for (Cookie ck : list) {
-//                System.out.println(ck.getName() + "=" + ck.getValue() + "," + ck.getDomain());
-//            }
             for (String key : headers.keySet()) {
                 httppost.setHeader(key, headers.get(key));
             }
-            //httppost.setHeader("Content-Type", "application/json");
             httppost.setEntity(new StringEntity(new Gson().toJson(param), Charset.forName("UTF-8")));
             HttpEntity respentity;
 
@@ -247,21 +229,19 @@ public class HttpUtils {
 
 
     public static String httpPostRequestTest(String url, String body, Map<String, String> headers) {
-//        HttpClient httpclient = HttpClientBuilder.create().setRedirectStrategy(new LaxRedirectStrategy()).build();
         HttpClient httpClient = createSslClientDefault();
         String strReturn = "";
         try {
             HttpPost httppost = new HttpPost(url);
             httppost.setHeader("User-Agent", USER_AGENT);
             httppost.addHeader("Content-Type", "application/json");
-            List<Cookie> list = cookieStore.getCookies();
+            List<Cookie> list = COOKIESTORE.getCookies();
             for (Cookie ck : list) {
                 System.out.println(ck.getName() + "=" + ck.getValue() + "," + ck.getDomain());
             }
             for (String key : headers.keySet()) {
                 httppost.setHeader(key, headers.get(key));
             }
-            //httppost.setHeader("Content-Type", "application/json");
             httppost.setEntity(new StringEntity(body, Charset.forName("UTF-8")));
             HttpEntity respentity;
 
@@ -314,21 +294,15 @@ public class HttpUtils {
 
 
     public static String httpPostRequest(String url, JSONObject params, Map<String, String> headers) {
-//        HttpClient httpclient = HttpClientBuilder.create().setRedirectStrategy(new LaxRedirectStrategy()).build();
         HttpClient httpClient = createSslClientDefault();
         String strReturn = "";
         try {
             HttpPost httppost = new HttpPost(url);
             httppost.setHeader("User-Agent", USER_AGENT);
             httppost.addHeader("Content-Type", "application/json");
-            List<Cookie> list = cookieStore.getCookies();
-//            for (Cookie ck : list) {
-//                System.out.println(ck.getName() + "=" + ck.getValue() + "," + ck.getDomain());
-//            }
             for (String key : headers.keySet()) {
                 httppost.setHeader(key, headers.get(key));
             }
-            //httppost.setHeader("Content-Type", "application/json");
             httppost.setEntity(new StringEntity(params.toJSONString(), Charset.forName("UTF-8")));
             HttpEntity respentity;
 
@@ -353,19 +327,10 @@ public class HttpUtils {
         HttpClient httpClient = createSslClientDefault();
         HttpResponse response = null;
         HttpGet httpGet = new HttpGet(url);
-//        httpPost.setHeader("Content-Type", "application/json");
         String result = null;
         try {
             httpGet.setHeader("User-Agent", USER_AGENT);
-            List<Cookie> list2 = cookieStore.getCookies();
-//            for (Cookie ck : list2) {
-//                System.out.println(ck.getName() + "=" + ck.getValue() + "," + ck.getDomain());
-//            }
             response = httpClient.execute(httpGet);
-            List<Cookie> list = cookieStore.getCookies();
-//            for (Cookie ck : list) {
-//                System.out.println(ck.getName() + "=" + ck.getValue() + "," + ck.getDomain());
-//            }
             int statusCode = response.getStatusLine().getStatusCode();
             if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
                 String newUrl = response.getFirstHeader("Location").getValue();
@@ -387,7 +352,6 @@ public class HttpUtils {
     }
 
     public static String httpRequest(String url, String strParams) throws Exception {
-//        HttpClient httpclient = HttpClientBuilder.create().build();
         HttpClient httpClient = createSslClientDefault();
         String strReturn = "";
         try {
@@ -397,8 +361,6 @@ public class HttpUtils {
             httppost.setEntity(new StringEntity(strParams, Charset.forName("UTF-8")));
             HttpEntity respentity;
             HttpResponse response = httpClient.execute(httppost);
-            int code = response.getStatusLine().getStatusCode();
-
             respentity = response.getEntity();
             strReturn = EntityUtils.toString(respentity);
         } catch (Exception e) {
@@ -409,7 +371,6 @@ public class HttpUtils {
     }
 
     public static String httpRequest(String url, CookieStore cookies, Map<String, String> parameterMap) throws Exception {
-//        HttpClient httpclient = getHttpclient();
         HttpClient httpClient = createSslClientDefault();
         String strReturn = "";
         try {
@@ -430,7 +391,7 @@ public class HttpUtils {
     }
 
     public static List<NameValuePair> getParam(Map parameterMap) {
-        List<NameValuePair> param = new ArrayList<NameValuePair>();
+        List<NameValuePair> param = new ArrayList<>();
         Iterator it = parameterMap.entrySet().iterator();
         while (it.hasNext()) {
             Map.Entry parmEntry = (Map.Entry) it.next();
@@ -451,13 +412,7 @@ public class HttpUtils {
         HttpClient httpClient = createSslClientDefault();
         HttpResponse response = null;
         HttpPost httpPost = new HttpPost(url);
-        List<Cookie> list = cookieStore.getCookies();
-//        cookieStore.clear();
-//        for (Cookie ck : list) {
-//
-//            System.out.println(ck.getName() + "=" + ck.getValue() + "," + ck.getDomain());
-//        }
-//        System.out.println("-------------------------------------");
+        List<Cookie> list = COOKIESTORE.getCookies();
         httpPost.setHeader("Content-Type", "application/json");
         String result = null;
 
@@ -472,10 +427,6 @@ public class HttpUtils {
             while ((line = reader.readLine()) != null) {
                 builder.append(line);
             }
-//            for (Cookie ck : list) {
-//
-//                System.out.println(ck.getName() + "=" + ck.getValue() + "," + ck.getDomain());
-//            }
             result = builder.toString();
         } catch (Exception e) {
             e.printStackTrace();
@@ -483,11 +434,11 @@ public class HttpUtils {
         return result;
     }
 
-    public static Map<String, Integer> kuaishouNumberMap;
+    public static Map<String, Integer> KUAISHOUNUMBERMAP;
 
     public static Integer getKuaishouNumber(String key) {
-        if (kuaishouNumberMap == null) {
-            kuaishouNumberMap = new HashMap<>();
+        if (KUAISHOUNUMBERMAP == null) {
+            KUAISHOUNUMBERMAP = new HashMap<>();
 //            kuaishouNumberMap.put("32.0#-6.0#526.0#729.0",0);//735
 //            kuaishouNumberMap.put("98.0#13.0#363.0#726.0",1);//713
 //            kuaishouNumberMap.put("32.0#13.0#527.0#732.0",2);//719
@@ -498,18 +449,18 @@ public class HttpUtils {
 //            kuaishouNumberMap.put("38.0#13.0#536.0#717.0",7);//704
 //            kuaishouNumberMap.put("33.0#-7.0#525.0#731.0",8);//738
 //            kuaishouNumberMap.put("37.0#-7.0#521.0#730.0",9);//737
-            kuaishouNumberMap.put("494.0#735.0", 0);
-            kuaishouNumberMap.put("265.0#713.0", 1);
-            kuaishouNumberMap.put("495.0#719.0", 2);
-            kuaishouNumberMap.put("500.0#736.0", 3);
-            kuaishouNumberMap.put("510.0#718.0", 4);
-            kuaishouNumberMap.put("493.0#722.0", 5);
-            kuaishouNumberMap.put("491.0#737.0", 6);
-            kuaishouNumberMap.put("498.0#704.0", 7);
-            kuaishouNumberMap.put("492.0#738.0", 8);
-            kuaishouNumberMap.put("484.0#737.0", 9);
+            KUAISHOUNUMBERMAP.put("494.0#735.0", 0);
+            KUAISHOUNUMBERMAP.put("265.0#713.0", 1);
+            KUAISHOUNUMBERMAP.put("495.0#719.0", 2);
+            KUAISHOUNUMBERMAP.put("500.0#736.0", 3);
+            KUAISHOUNUMBERMAP.put("510.0#718.0", 4);
+            KUAISHOUNUMBERMAP.put("493.0#722.0", 5);
+            KUAISHOUNUMBERMAP.put("491.0#737.0", 6);
+            KUAISHOUNUMBERMAP.put("498.0#704.0", 7);
+            KUAISHOUNUMBERMAP.put("492.0#738.0", 8);
+            KUAISHOUNUMBERMAP.put("484.0#737.0", 9);
         }
-        return kuaishouNumberMap.get(key);
+        return KUAISHOUNUMBERMAP.get(key);
     }
 
     public static void kuaishouTtf(String ttfName) {
@@ -521,44 +472,30 @@ public class HttpUtils {
 
             TTFParser ttfParser = new TTFParser();
             TrueTypeFont ttf = ttfParser.parse(urlconn.getInputStream());
-//            System.out.println(new Gson().toJson(ttf.getGlyph().getGlyphs()));
             GlyphData[] datas = ttf.getGlyph().getGlyphs();
             CmapSubtable[] tables = ttf.getCmap().getCmaps();
-            Gson gson = new Gson();
-//            System.out.println(gson.toJson(tables));
             CmapSubtable table = tables[0];
-            Map<String, Integer> numberMap = new HashMap<String, Integer>();
-            Map<String, String> fontMap = new HashMap<String, String>();
+            Map<String, String> fontMap = new HashMap<>();
             for (int i = 0; i <= 13; i++) {
                 GlyphData data = datas[i];
                 if (data != null) {
-//                    System.out.println("getBoundingBox" + data.getBoundingBox());
                     float fx = data.getBoundingBox().getLowerLeftX();
                     float fy = data.getBoundingBox().getLowerLeftY();
                     float rx = data.getBoundingBox().getUpperRightX();
                     float ry = data.getBoundingBox().getUpperRightY();
                     Integer num = getKuaishouNumber(String.valueOf(rx - fx) + "#" + String.valueOf(ry - fy));
-//                    if (num != null) {
-//                        System.out.println(num);
-//                    }
                     fontMap.put(String.valueOf((char) table.getCharCodes(i).get(0).intValue()), String.valueOf(num));
-
                 }
             }
-//            System.out.println(new Gson().toJson(fontMap));
             fontsMap.put(ttfName, fontMap);
             for (GlyphData data : datas) {
                 if (data != null) {
-//                    System.out.println("getBoundingBox" + data.getBoundingBox());
                     float fx = data.getBoundingBox().getLowerLeftX();
                     float fy = data.getBoundingBox().getLowerLeftY();
                     float rx = data.getBoundingBox().getUpperRightX();
                     float ry = data.getBoundingBox().getUpperRightY();
-                    Integer num = getKuaishouNumber(String.valueOf(fx) + "#" + String.valueOf(fy) + "#" + String.valueOf(rx) + "#" + String.valueOf(ry));
-//                    System.out.println(num);
                 }
             }
-//            System.out.println(new Gson().toJson(numberMap));
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -646,7 +583,6 @@ public class HttpUtils {
     public static String httpGet(String url, Map<String, Object> paramsMap, Map<String, String> headers) {
         String result = null;
         try {
-            // CloseableHttpClient httpClient = HttpClients.createDefault();
             //创建参数列表
             HttpClient httpclient = getHttpclient();
             StringBuilder postBody = null;
@@ -687,6 +623,4 @@ public class HttpUtils {
         }
         return result;
     }
-
-
 }

+ 17 - 0
module-report/pom.xml

@@ -29,5 +29,22 @@
             <version>4.11</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>cn.com.ctop</groupId>
+            <artifactId>module-common</artifactId>
+            <version>2.0.2</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.jeecgframework.boot</groupId>
+            <artifactId>jeecg-boot-base-common</artifactId>
+            <version>2.0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.com.ctop</groupId>
+            <artifactId>module-kuaishou</artifactId>
+            <version>2.0.2</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 </project>

+ 4 - 0
module-report/src/main/java/cn/com/ctop/bytedance/aa.java

@@ -0,0 +1,4 @@
+package cn.com.ctop.bytedance;
+
+public class aa {
+}

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceAdvertiserDailyReportController.java

@@ -1,7 +1,7 @@
-package cn.com.ctop.toutiao.controller;
+package cn.com.ctop.bytedance.controller;
 
-import cn.com.ctop.toutiao.entity.BytedanceAdvertiserDailyReport;
-import cn.com.ctop.toutiao.service.IBytedanceAdvertiserDailyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceAdvertiserDailyReport;
+import cn.com.ctop.bytedance.service.IBytedanceAdvertiserDailyReportService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceAdvertiserHourlyReportController.java

@@ -1,7 +1,7 @@
-package cn.com.ctop.toutiao.controller;
+package cn.com.ctop.bytedance.controller;
 
-import cn.com.ctop.toutiao.entity.BytedanceAdvertiserHourlyReport;
-import cn.com.ctop.toutiao.service.IBytedanceAdvertiserHourlyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceAdvertiserHourlyReport;
+import cn.com.ctop.bytedance.service.IBytedanceAdvertiserHourlyReportService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceCampaignDailyReportController.java

@@ -1,7 +1,7 @@
-package cn.com.ctop.toutiao.controller;
+package cn.com.ctop.bytedance.controller;
 
-import cn.com.ctop.toutiao.entity.BytedanceCampaignDailyReport;
-import cn.com.ctop.toutiao.service.IBytedanceCampaignDailyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceCampaignDailyReport;
+import cn.com.ctop.bytedance.service.IBytedanceCampaignDailyReportService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceCampaignHourlyReportController.java

@@ -1,7 +1,7 @@
-package cn.com.ctop.toutiao.controller;
+package cn.com.ctop.bytedance.controller;
 
-import cn.com.ctop.toutiao.entity.BytedanceCampaignHourlyReport;
-import cn.com.ctop.toutiao.service.IBytedanceCampaignHourlyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceCampaignHourlyReport;
+import cn.com.ctop.bytedance.service.IBytedanceCampaignHourlyReportService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceCreativeDailyReportController.java

@@ -1,7 +1,7 @@
-package cn.com.ctop.toutiao.controller;
+package cn.com.ctop.bytedance.controller;
 
-import cn.com.ctop.toutiao.entity.BytedanceCreativeDailyReport;
-import cn.com.ctop.toutiao.service.IBytedanceCreativeDailyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceCreativeDailyReport;
+import cn.com.ctop.bytedance.service.IBytedanceCreativeDailyReportService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedanceCreativeHourlyReportController.java

@@ -1,7 +1,7 @@
-package cn.com.ctop.toutiao.controller;
+package cn.com.ctop.bytedance.controller;
 
-import cn.com.ctop.toutiao.entity.BytedanceCreativeHourlyReport;
-import cn.com.ctop.toutiao.service.IBytedanceCreativeHourlyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceCreativeHourlyReport;
+import cn.com.ctop.bytedance.service.IBytedanceCreativeHourlyReportService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedancePlanDailyReportController.java

@@ -1,7 +1,7 @@
-package cn.com.ctop.toutiao.controller;
+package cn.com.ctop.bytedance.controller;
 
-import cn.com.ctop.toutiao.entity.BytedancePlanDailyReport;
-import cn.com.ctop.toutiao.service.IBytedancePlanDailyReportService;
+import cn.com.ctop.bytedance.entity.BytedancePlanDailyReport;
+import cn.com.ctop.bytedance.service.IBytedancePlanDailyReportService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/controller/BytedancePlanHourlyReportController.java

@@ -1,7 +1,7 @@
-package cn.com.ctop.toutiao.controller;
+package cn.com.ctop.bytedance.controller;
 
-import cn.com.ctop.toutiao.entity.BytedancePlanHourlyReport;
-import cn.com.ctop.toutiao.service.IBytedancePlanHourlyReportService;
+import cn.com.ctop.bytedance.entity.BytedancePlanHourlyReport;
+import cn.com.ctop.bytedance.service.IBytedancePlanHourlyReportService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;

+ 36 - 0
module-report/src/main/java/cn/com/ctop/bytedance/controller/BytedanceReportController.java

@@ -0,0 +1,36 @@
+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.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@Slf4j
+@RestController
+@RequestMapping("/ctop/report")
+public class BytedanceReportController {
+    @Autowired
+    private IBytedanceReportService bytedanceReportService;
+
+    /**
+     * 昨日总花费
+     *
+     * @return
+     */
+    @RequestMapping(value = "/cost")
+    public JSONObject getCost() {
+        /*LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        if (Check.isNull(user)) {
+            JSONObject json = bytedanceReportService.getCost(user.getId());
+        }*/
+
+
+        JSONObject json = bytedanceReportService.getCost("e9ca23d68d884d4ebb19d07889727dae");
+        return null;
+
+    }
+
+
+}

+ 3 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CustomerPlanStatisticInfoController.java

@@ -1,5 +1,7 @@
-package org.jeecg.modules.ctop.controller;
+package cn.com.ctop.bytedance.controller;
 
+import cn.com.ctop.bytedance.entity.CustomerPlanStatisticInfo;
+import cn.com.ctop.bytedance.service.ICustomerPlanStatisticInfoService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -11,8 +13,6 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
-import org.jeecg.modules.ctop.entity.CustomerPlanStatisticInfo;
-import org.jeecg.modules.ctop.service.ICustomerPlanStatisticInfoService;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;

+ 19 - 24
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/PlatformCampaignStatisticInfoController.java

@@ -1,42 +1,37 @@
-package org.jeecg.modules.ctop.controller;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.aspect.annotation.AutoLog;
-import org.jeecg.common.util.oConvertUtils;
-import org.jeecg.modules.ctop.entity.PlatformCampaignStatisticInfo;
-import org.jeecg.modules.ctop.service.IPlatformCampaignStatisticInfoService;
-
-import java.util.Date;
+package cn.com.ctop.bytedance.controller;
 
+import cn.com.ctop.bytedance.entity.PlatformCampaignStatisticInfo;
+import cn.com.ctop.bytedance.service.IPlatformCampaignStatisticInfoService;
+import com.alibaba.fastjson.JSON;
 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.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 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.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.servlet.ModelAndView;
-import com.alibaba.fastjson.JSON;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 快手平台广告组信息

+ 13 - 12
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ReportController.java

@@ -1,13 +1,14 @@
-package org.jeecg.modules.ctop.controller;
+package cn.com.ctop.bytedance.controller;
 
+import cn.com.ctop.bytedance.service.IReportService;
+import cn.com.ctop.bytedance.vo.ByteDanceAdvertiserReportDTO;
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.ResultMapUtils;
 import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import com.alibaba.fastjson.JSONObject;
 import org.jeecg.common.util.DateUtils;
-import org.jeecg.modules.ctop.service.IReportService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -28,7 +29,7 @@ public class ReportController {
      * @return
      */
     @GetMapping("bytedance/advertiser")
-    public Map<String, Object> advertiserReport(@RequestBody JSONObject conditions) {
+    public Map<String, Object> advertiserReport(@RequestBody ByteDanceAdvertiserReportDTO conditions) {
         return reportService.getAdvertiserReport(conditions);
     }
 
@@ -38,8 +39,8 @@ public class ReportController {
      * 单次获取最大条数1000
      * @return 广告组报表数据
      */
-    @GetMapping("campaign")
-    public Map<String, Object> campaignReport(@RequestBody JSONObject conditions) {
+    @GetMapping("bytedance/campaign")
+    public Map<String, Object> campaignReport(@RequestBody ByteDanceAdvertiserReportDTO conditions) {
         return reportService.getCampaignReport(conditions);
     }
 
@@ -48,8 +49,8 @@ public class ReportController {
      * @param conditions 查询条件
      * @return 广告计划报表数据
      */
-    @GetMapping("ad")
-    public Map<String, Object> adReport(@RequestBody JSONObject conditions) {
+    @GetMapping("bytedance/ad")
+    public Map<String, Object> adReport(@RequestBody ByteDanceAdvertiserReportDTO conditions) {
         return reportService.getAdReport(conditions);
     }
 
@@ -58,8 +59,8 @@ public class ReportController {
      * @param conditions
      * @return
      */
-    @GetMapping("creative")
-    public Map<String, Object> creativeReport(@RequestBody JSONObject conditions) {
+    @GetMapping("bytedance/creative")
+    public Map<String, Object> creativeReport(@RequestBody ByteDanceAdvertiserReportDTO conditions) {
         return reportService.getCreativeReport(conditions);
     }
 
@@ -69,7 +70,7 @@ public class ReportController {
      * @return
      * TODO 尚未完善
      */
-    @GetMapping("agent")
+    @GetMapping("bytedance/agent")
     public Map<String, Object> agentReport(@RequestBody JSONObject conditions) {
         return reportService.getAgentReport(conditions);
     }

+ 3 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceAdvertiserDailyReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.entity;
+package cn.com.ctop.bytedance.entity;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;
@@ -16,9 +16,10 @@ import java.util.Date;
 
 /**
  * 广告主日报表
+ *
  * @author jeecg-boot
- * @date 2019-09-10
  * @version V1.0
+ * @date 2019-09-10
  */
 @Data
 @TableName("ctop_bytedance_report_advertiser_daily")

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceAdvertiserHourlyReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.entity;
+package cn.com.ctop.bytedance.entity;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceCampaignDailyReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.entity;
+package cn.com.ctop.bytedance.entity;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceCampaignHourlyReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.entity;
+package cn.com.ctop.bytedance.entity;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceCreativeDailyReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.entity;
+package cn.com.ctop.bytedance.entity;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedanceCreativeHourlyReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.entity;
+package cn.com.ctop.bytedance.entity;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedancePlanDailyReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.entity;
+package cn.com.ctop.bytedance.entity;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/BytedancePlanHourlyReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.entity;
+package cn.com.ctop.bytedance.entity;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;

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

@@ -1,20 +1,17 @@
-package org.jeecg.modules.ctop.entity;
+package cn.com.ctop.bytedance.entity;
 
-import java.io.Serializable;
-import java.util.Date;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
+import java.util.Date;
+
 /**
  * @Description: 用户平台广告计划信息
  * @Author: jeecg-boot

+ 10 - 14
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/PlatformCampaignStatisticInfo.java

@@ -1,22 +1,18 @@
-package org.jeecg.modules.ctop.entity;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.Date;
+package cn.com.ctop.bytedance.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
+import java.math.BigDecimal;
+import java.util.Date;
+
 /**
  * @Description: 快手平台广告组信息
  * @Author: jeecg-boot
@@ -71,7 +67,7 @@ public class PlatformCampaignStatisticInfo {
      */
     @Excel(name = "花费", width = 15)
     @ApiModelProperty(value = "花费")
-    private java.math.BigDecimal cost;
+    private BigDecimal cost;
     /**
      * 封面曝光数
      */
@@ -113,19 +109,19 @@ public class PlatformCampaignStatisticInfo {
      */
     @Excel(name = "平均千次封面曝光花费", width = 15)
     @ApiModelProperty(value = "平均千次封面曝光花费")
-    private java.math.BigDecimal thousandsCoverExposureCost;
+    private BigDecimal thousandsCoverExposureCost;
     /**
      * 平均封面点击单价
      */
     @Excel(name = "平均封面点击单价", width = 15)
     @ApiModelProperty(value = "平均封面点击单价")
-    private java.math.BigDecimal averageCoverClickCost;
+    private BigDecimal averageCoverClickCost;
     /**
      * 平均行为单价
      */
     @Excel(name = "平均行为单价", width = 15)
     @ApiModelProperty(value = "平均行为单价")
-    private java.math.BigDecimal averageActionCost;
+    private BigDecimal averageActionCost;
     /**
      * 提交按钮点击
      */
@@ -143,7 +139,7 @@ public class PlatformCampaignStatisticInfo {
      */
     @Excel(name = "表单提交单价", width = 15)
     @ApiModelProperty(value = "表单提交单价")
-    private java.math.BigDecimal formSubmissionPrice;
+    private BigDecimal formSubmissionPrice;
     /**
      * 落地页完成件数
      */
@@ -155,7 +151,7 @@ public class PlatformCampaignStatisticInfo {
      */
     @Excel(name = "落地页完件成本", width = 15)
     @ApiModelProperty(value = "落地页完件成本")
-    private java.math.BigDecimal pageCompleteCost;
+    private BigDecimal pageCompleteCost;
     /**
      * 落地页授信数
      */

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceAdvertiserDailyReportMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import cn.com.ctop.toutiao.entity.BytedanceAdvertiserDailyReport;
+import cn.com.ctop.bytedance.entity.BytedanceAdvertiserDailyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceAdvertiserHourlyReportMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import cn.com.ctop.toutiao.entity.BytedanceAdvertiserHourlyReport;
+import cn.com.ctop.bytedance.entity.BytedanceAdvertiserHourlyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceCampaignDailyReportMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import cn.com.ctop.toutiao.entity.BytedanceCampaignDailyReport;
+import cn.com.ctop.bytedance.entity.BytedanceCampaignDailyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceCampaignHourlyReportMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import cn.com.ctop.toutiao.entity.BytedanceCampaignHourlyReport;
+import cn.com.ctop.bytedance.entity.BytedanceCampaignHourlyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceCreativeDailyReportMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import cn.com.ctop.toutiao.entity.BytedanceCreativeDailyReport;
+import cn.com.ctop.bytedance.entity.BytedanceCreativeDailyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedanceCreativeHourlyReportMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import cn.com.ctop.toutiao.entity.BytedanceCreativeHourlyReport;
+import cn.com.ctop.bytedance.entity.BytedanceCreativeHourlyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedancePlanDailyReportMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import cn.com.ctop.toutiao.entity.BytedancePlanDailyReport;
+import cn.com.ctop.bytedance.entity.BytedancePlanDailyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/BytedancePlanHourlyReportMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import cn.com.ctop.toutiao.entity.BytedancePlanHourlyReport;
+import cn.com.ctop.bytedance.entity.BytedancePlanHourlyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 2 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/CustomerPlanStatisticInfoMapper.java

@@ -1,9 +1,6 @@
-package org.jeecg.modules.ctop.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import java.util.List;
-
-import org.apache.ibatis.annotations.Param;
-import org.jeecg.modules.ctop.entity.CustomerPlanStatisticInfo;
+import cn.com.ctop.bytedance.entity.CustomerPlanStatisticInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 6 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/PlatformCampaignStatisticInfoMapper.java

@@ -1,11 +1,11 @@
-package org.jeecg.modules.ctop.mapper;
+package cn.com.ctop.bytedance.mapper;
 
-import java.util.List;
-
-import org.apache.ibatis.annotations.Param;
-import org.jeecg.modules.ctop.entity.PlatformCampaignStatisticInfo;
+import cn.com.ctop.bytedance.entity.PlatformCampaignStatisticInfo;
+import cn.com.ctop.bytedance.vo.StatisticCampaignVo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.jeecg.modules.ctop.vo.StatisticCampaignVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * @Description: 快手平台广告组信息

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceAdvertiserDailyReportMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ctop.toutiao.mapper.BytedanceAdvertiserDailyReportMapper">
+<mapper namespace="cn.com.ctop.bytedance.mapper.BytedanceAdvertiserDailyReportMapper">
 
 </mapper>

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceAdvertiserHourlyReportMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ctop.toutiao.mapper.BytedanceAdvertiserHourlyReportMapper">
+<mapper namespace="cn.com.ctop.bytedance.mapper.BytedanceAdvertiserHourlyReportMapper">
 
 </mapper>

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceCampaignDailyReportMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ctop.toutiao.mapper.BytedanceCampaignDailyReportMapper">
+<mapper namespace="cn.com.ctop.bytedance.mapper.BytedanceCampaignDailyReportMapper">
 
 </mapper>

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceCampaignHourlyReportMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ctop.toutiao.mapper.BytedanceCampaignHourlyReportMapper">
+<mapper namespace="cn.com.ctop.bytedance.mapper.BytedanceCampaignHourlyReportMapper">
 
 </mapper>

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceCreativeDailyReportMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ctop.toutiao.mapper.BytedanceCreativeDailyReportMapper">
+<mapper namespace="cn.com.ctop.bytedance.mapper.BytedanceCreativeDailyReportMapper">
 
 </mapper>

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedanceCreativeHourlyReportMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ctop.toutiao.mapper.BytedanceCreativeHourlyReportMapper">
+<mapper namespace="cn.com.ctop.bytedance.mapper.BytedanceCreativeHourlyReportMapper">
 
 </mapper>

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedancePlanDailyReportMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ctop.toutiao.mapper.BytedancePlanDailyReportMapper">
+<mapper namespace="cn.com.ctop.bytedance.mapper.BytedancePlanDailyReportMapper">
 
 </mapper>

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/mapper/xml/BytedancePlanHourlyReportMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ctop.toutiao.mapper.BytedancePlanHourlyReportMapper">
+<mapper namespace="cn.com.ctop.bytedance.mapper.BytedancePlanHourlyReportMapper">
 
 </mapper>

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/AuthTaskMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!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.AuthTaskMapper">
+<mapper namespace="cn.com.ctop.bytedance.mapper.CustomerPlanStatisticInfoMapper">
 
 </mapper>

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/PlatformCampaignStatisticInfoMapper.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!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.PlatformCampaignStatisticInfoMapper">
+<mapper namespace="cn.com.ctop.bytedance.mapper.PlatformCampaignStatisticInfoMapper">
     <resultMap id="voMap" type="org.jeecg.modules.ctop.vo.StatisticCampaignVo">
         <result column="statisticDate" property="statisticDate"/>
         <result column="proxy" property="proxy"/>

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedanceAdvertiserDailyReportService.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.service;
+package cn.com.ctop.bytedance.service;
 
-import cn.com.ctop.toutiao.entity.BytedanceAdvertiserDailyReport;
+import cn.com.ctop.bytedance.entity.BytedanceAdvertiserDailyReport;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedanceAdvertiserHourlyReportService.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.service;
+package cn.com.ctop.bytedance.service;
 
-import cn.com.ctop.toutiao.entity.BytedanceAdvertiserHourlyReport;
+import cn.com.ctop.bytedance.entity.BytedanceAdvertiserHourlyReport;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedanceCampaignDailyReportService.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.service;
+package cn.com.ctop.bytedance.service;
 
-import cn.com.ctop.toutiao.entity.BytedanceCampaignDailyReport;
+import cn.com.ctop.bytedance.entity.BytedanceCampaignDailyReport;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedanceCampaignHourlyReportService.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.service;
+package cn.com.ctop.bytedance.service;
 
-import cn.com.ctop.toutiao.entity.BytedanceCampaignHourlyReport;
+import cn.com.ctop.bytedance.entity.BytedanceCampaignHourlyReport;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedanceCreativeDailyReportService.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.service;
+package cn.com.ctop.bytedance.service;
 
-import cn.com.ctop.toutiao.entity.BytedanceCreativeDailyReport;
+import cn.com.ctop.bytedance.entity.BytedanceCreativeDailyReport;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedanceCreativeHourlyReportService.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.service;
+package cn.com.ctop.bytedance.service;
 
-import cn.com.ctop.toutiao.entity.BytedanceCreativeHourlyReport;
+import cn.com.ctop.bytedance.entity.BytedanceCreativeHourlyReport;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedancePlanDailyReportService.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.service;
+package cn.com.ctop.bytedance.service;
 
-import cn.com.ctop.toutiao.entity.BytedancePlanDailyReport;
+import cn.com.ctop.bytedance.entity.BytedancePlanDailyReport;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/IBytedancePlanHourlyReportService.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.service;
+package cn.com.ctop.bytedance.service;
 
-import cn.com.ctop.toutiao.entity.BytedancePlanHourlyReport;
+import cn.com.ctop.bytedance.entity.BytedancePlanHourlyReport;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

+ 7 - 0
module-report/src/main/java/cn/com/ctop/bytedance/service/IBytedanceReportService.java

@@ -0,0 +1,7 @@
+package cn.com.ctop.bytedance.service;
+
+import com.alibaba.fastjson.JSONObject;
+
+public interface IBytedanceReportService {
+    JSONObject getCost(String loginId);
+}

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/ICustomerPlanStatisticInfoService.java

@@ -1,6 +1,6 @@
-package org.jeecg.modules.ctop.service;
+package cn.com.ctop.bytedance.service;
 
-import org.jeecg.modules.ctop.entity.CustomerPlanStatisticInfo;
+import cn.com.ctop.bytedance.entity.CustomerPlanStatisticInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IPlatformCampaignStatisticInfoService.java

@@ -1,6 +1,6 @@
-package org.jeecg.modules.ctop.service;
+package cn.com.ctop.bytedance.service;
 
-import org.jeecg.modules.ctop.entity.PlatformCampaignStatisticInfo;
+import cn.com.ctop.bytedance.entity.PlatformCampaignStatisticInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

+ 24 - 0
module-report/src/main/java/cn/com/ctop/bytedance/service/IReportService.java

@@ -0,0 +1,24 @@
+package cn.com.ctop.bytedance.service;
+
+import cn.com.ctop.bytedance.vo.ByteDanceAdvertiserReportDTO;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.Map;
+
+public interface IReportService {
+    Map<String, Object> getAdvertiserReport(ByteDanceAdvertiserReportDTO conditions);
+
+    Map<String, Object> getCampaignReport(ByteDanceAdvertiserReportDTO conditions);
+
+    Map<String, Object> getAdReport(ByteDanceAdvertiserReportDTO conditions);
+
+    Map<String, Object> getCreativeReport(ByteDanceAdvertiserReportDTO conditions);
+
+    Map<String, Object> getAgentReport(JSONObject conditions);
+
+    void insertCustomerInfo(String csvPath, String charset);
+
+    void insertPlatformInfo(String excelPath, String charset, Long accountId);
+
+    Map<String, Object> debitAuto(JSONObject data);
+}

+ 5 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceAdvertiserDailyReportServiceImpl.java

@@ -1,8 +1,9 @@
-package cn.com.ctop.toutiao.service.impl;
+package cn.com.ctop.bytedance.service.impl;
 
-import cn.com.ctop.toutiao.entity.BytedanceAdvertiserDailyReport;
-import cn.com.ctop.toutiao.mapper.BytedanceAdvertiserDailyReportMapper;
-import cn.com.ctop.toutiao.service.IBytedanceAdvertiserDailyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceAdvertiserDailyReport;
+import cn.com.ctop.bytedance.mapper.BytedanceAdvertiserDailyReportMapper;
+import cn.com.ctop.bytedance.service.IBytedanceAdvertiserDailyReportService;
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 

+ 4 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceAdvertiserHourlyReportServiceImpl.java

@@ -1,8 +1,8 @@
-package cn.com.ctop.toutiao.service.impl;
+package cn.com.ctop.bytedance.service.impl;
 
-import cn.com.ctop.toutiao.entity.BytedanceAdvertiserHourlyReport;
-import cn.com.ctop.toutiao.mapper.BytedanceAdvertiserHourlyReportMapper;
-import cn.com.ctop.toutiao.service.IBytedanceAdvertiserHourlyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceAdvertiserHourlyReport;
+import cn.com.ctop.bytedance.mapper.BytedanceAdvertiserHourlyReportMapper;
+import cn.com.ctop.bytedance.service.IBytedanceAdvertiserHourlyReportService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 

+ 4 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceCampaignDailyReportServiceImpl.java

@@ -1,8 +1,8 @@
-package cn.com.ctop.toutiao.service.impl;
+package cn.com.ctop.bytedance.service.impl;
 
-import cn.com.ctop.toutiao.entity.BytedanceCampaignDailyReport;
-import cn.com.ctop.toutiao.mapper.BytedanceCampaignDailyReportMapper;
-import cn.com.ctop.toutiao.service.IBytedanceCampaignDailyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceCampaignDailyReport;
+import cn.com.ctop.bytedance.mapper.BytedanceCampaignDailyReportMapper;
+import cn.com.ctop.bytedance.service.IBytedanceCampaignDailyReportService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 

+ 5 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceCampaignHourlyReportServiceImpl.java

@@ -1,8 +1,9 @@
-package cn.com.ctop.toutiao.service.impl;
+package cn.com.ctop.bytedance.service.impl;
 
-import cn.com.ctop.toutiao.entity.BytedanceCampaignHourlyReport;
-import cn.com.ctop.toutiao.mapper.BytedanceCampaignHourlyReportMapper;
-import cn.com.ctop.toutiao.service.IBytedanceCampaignHourlyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceCampaignHourlyReport;
+import cn.com.ctop.bytedance.mapper.BytedanceCampaignHourlyReportMapper;
+import cn.com.ctop.bytedance.service.IBytedanceCampaignHourlyReportService;
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 

+ 5 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceCreativeDailyReportServiceImpl.java

@@ -1,8 +1,9 @@
-package cn.com.ctop.toutiao.service.impl;
+package cn.com.ctop.bytedance.service.impl;
 
-import cn.com.ctop.toutiao.entity.BytedanceCreativeDailyReport;
-import cn.com.ctop.toutiao.mapper.BytedanceCreativeDailyReportMapper;
-import cn.com.ctop.toutiao.service.IBytedanceCreativeDailyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceCreativeDailyReport;
+import cn.com.ctop.bytedance.mapper.BytedanceCreativeDailyReportMapper;
+import cn.com.ctop.bytedance.service.IBytedanceCreativeDailyReportService;
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 

+ 4 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedanceCreativeHourlyReportServiceImpl.java

@@ -1,8 +1,8 @@
-package cn.com.ctop.toutiao.service.impl;
+package cn.com.ctop.bytedance.service.impl;
 
-import cn.com.ctop.toutiao.entity.BytedanceCreativeHourlyReport;
-import cn.com.ctop.toutiao.mapper.BytedanceCreativeHourlyReportMapper;
-import cn.com.ctop.toutiao.service.IBytedanceCreativeHourlyReportService;
+import cn.com.ctop.bytedance.entity.BytedanceCreativeHourlyReport;
+import cn.com.ctop.bytedance.mapper.BytedanceCreativeHourlyReportMapper;
+import cn.com.ctop.bytedance.service.IBytedanceCreativeHourlyReportService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 

+ 4 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedancePlanDailyReportServiceImpl.java

@@ -1,8 +1,8 @@
-package cn.com.ctop.toutiao.service.impl;
+package cn.com.ctop.bytedance.service.impl;
 
-import cn.com.ctop.toutiao.entity.BytedancePlanDailyReport;
-import cn.com.ctop.toutiao.mapper.BytedancePlanDailyReportMapper;
-import cn.com.ctop.toutiao.service.IBytedancePlanDailyReportService;
+import cn.com.ctop.bytedance.entity.BytedancePlanDailyReport;
+import cn.com.ctop.bytedance.mapper.BytedancePlanDailyReportMapper;
+import cn.com.ctop.bytedance.service.IBytedancePlanDailyReportService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 

+ 4 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/BytedancePlanHourlyReportServiceImpl.java

@@ -1,8 +1,8 @@
-package cn.com.ctop.toutiao.service.impl;
+package cn.com.ctop.bytedance.service.impl;
 
-import cn.com.ctop.toutiao.entity.BytedancePlanHourlyReport;
-import cn.com.ctop.toutiao.mapper.BytedancePlanHourlyReportMapper;
-import cn.com.ctop.toutiao.service.IBytedancePlanHourlyReportService;
+import cn.com.ctop.bytedance.entity.BytedancePlanHourlyReport;
+import cn.com.ctop.bytedance.mapper.BytedancePlanHourlyReportMapper;
+import cn.com.ctop.bytedance.service.IBytedancePlanHourlyReportService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 

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

@@ -0,0 +1,92 @@
+package cn.com.ctop.bytedance.service.impl;
+
+import cn.com.ctop.bytedance.entity.BytedanceAdvertiserDailyReport;
+import cn.com.ctop.bytedance.mapper.BytedanceAdvertiserDailyReportMapper;
+import cn.com.ctop.bytedance.service.IBytedanceReportService;
+import cn.com.ctop.common.module.entity.UserAllocation;
+import cn.com.ctop.common.module.mapper.UserAllocationMapper;
+import cn.com.ctop.common.module.utils.Check;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+@Service
+public class BytedanceReportServiceImpl implements IBytedanceReportService {
+    @Autowired
+    private UserAllocationMapper userAllocationMapper;
+
+    @Autowired
+    private BytedanceAdvertiserDailyReportMapper bytedanceAdvertiserDailyReportMapper;
+
+    /**
+     * 获取 媒体昨日总消耗
+     *
+     * @param loginId
+     * @return
+     */
+    @Override
+    public JSONObject getCost(String loginId) {
+
+        JSONObject returnJson = new JSONObject();
+
+
+        QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id", loginId);
+        queryWrapper.eq("media_id", 1);
+        queryWrapper.isNotNull("account_id");
+        queryWrapper.groupBy("account_id");
+        List<UserAllocation> userAllocations = userAllocationMapper.selectList(queryWrapper);
+        if (!Check.isNull(userAllocations)) {
+            JSONObject bytedanceJson = new JSONObject();
+            BigDecimal byteDanceCost = new BigDecimal(0);
+            Long byteDanceClick = 0L;
+            Long byteDanceShow = 0L;
+            Long byteDanceConvert = 0L;
+            Long byteDanceForm = 0L;
+            Long byteDanceNextDayOpen = 0L;
+            Long byteDanceActive = 0L;
+            for (UserAllocation userAllocation : userAllocations) {
+                QueryWrapper<BytedanceAdvertiserDailyReport> bytedanceAdvertiserDailyReportQueryWrapper = new QueryWrapper<>();
+                bytedanceAdvertiserDailyReportQueryWrapper.eq("advertiser_id", userAllocation.getAccountId());
+                //   Map<String, Object> beforeDate = DateUtils.getBeforeDate();
+                //  bytedanceAdvertiserDailyReportQueryWrapper.between("stat_datetime", beforeDate.get("startDate"), beforeDate.get("endDate"));
+                bytedanceAdvertiserDailyReportQueryWrapper.between("stat_datetime", "2019-07-01 00:00:00", "2019-07-01 23:59:59");
+                bytedanceAdvertiserDailyReportQueryWrapper.orderByDesc("create_time");
+                bytedanceAdvertiserDailyReportQueryWrapper.last("limit 1");
+                BytedanceAdvertiserDailyReport bytedanceAdvertiserDailyReport = bytedanceAdvertiserDailyReportMapper.selectOne(bytedanceAdvertiserDailyReportQueryWrapper);
+
+                if (!Check.isNull(bytedanceAdvertiserDailyReport)) {
+                    byteDanceCost = byteDanceCost.add(bytedanceAdvertiserDailyReport.getCost());
+                    byteDanceClick += bytedanceAdvertiserDailyReport.getClick();
+                    byteDanceShow += bytedanceAdvertiserDailyReport.getShowNum();
+                    byteDanceConvert += bytedanceAdvertiserDailyReport.getConvertNum();
+                    byteDanceForm += bytedanceAdvertiserDailyReport.getForm();
+                    byteDanceNextDayOpen += bytedanceAdvertiserDailyReport.getNextDayOpen();
+                    byteDanceActive += bytedanceAdvertiserDailyReport.getActive();
+                }
+
+            }
+            bytedanceJson.put("cost", byteDanceCost); // 总消耗
+            bytedanceJson.put("click", byteDanceClick); // 总点击
+            bytedanceJson.put("show", byteDanceShow); // 总展示
+            bytedanceJson.put("convert", byteDanceConvert); // 总转化
+            bytedanceJson.put("form", byteDanceForm); // 总表单提交
+            bytedanceJson.put("nextDayOpen", byteDanceNextDayOpen); // 总次留数
+            bytedanceJson.put("active", byteDanceActive); // 总激活
+
+
+            returnJson.put("bytedance", bytedanceJson);
+            System.err.println(returnJson);
+
+        }
+
+
+        return null;
+    }
+
+
+}

+ 5 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CustomerPlanStatisticInfoServiceImpl.java

@@ -1,11 +1,10 @@
-package org.jeecg.modules.ctop.service.impl;
-
-import org.jeecg.modules.ctop.entity.CustomerPlanStatisticInfo;
-import org.jeecg.modules.ctop.mapper.CustomerPlanStatisticInfoMapper;
-import org.jeecg.modules.ctop.service.ICustomerPlanStatisticInfoService;
-import org.springframework.stereotype.Service;
+package cn.com.ctop.bytedance.service.impl;
 
+import cn.com.ctop.bytedance.entity.CustomerPlanStatisticInfo;
+import cn.com.ctop.bytedance.mapper.CustomerPlanStatisticInfoMapper;
+import cn.com.ctop.bytedance.service.ICustomerPlanStatisticInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
 
 /**
  * @Description: 用户平台广告计划信息

+ 5 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/PlatformCampaignStatisticInfoServiceImpl.java

@@ -1,11 +1,10 @@
-package org.jeecg.modules.ctop.service.impl;
-
-import org.jeecg.modules.ctop.entity.PlatformCampaignStatisticInfo;
-import org.jeecg.modules.ctop.mapper.PlatformCampaignStatisticInfoMapper;
-import org.jeecg.modules.ctop.service.IPlatformCampaignStatisticInfoService;
-import org.springframework.stereotype.Service;
+package cn.com.ctop.bytedance.service.impl;
 
+import cn.com.ctop.bytedance.entity.PlatformCampaignStatisticInfo;
+import cn.com.ctop.bytedance.mapper.PlatformCampaignStatisticInfoMapper;
+import cn.com.ctop.bytedance.service.IPlatformCampaignStatisticInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
 
 /**
  * @Description: 快手平台广告组信息

+ 73 - 141
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ReportServiceImpl.java

@@ -1,13 +1,19 @@
-package org.jeecg.modules.ctop.service.impl;
-
-import cn.com.ctop.common.module.utils.*;
+package cn.com.ctop.bytedance.service.impl;
 
+import cn.com.ctop.bytedance.entity.*;
+import cn.com.ctop.bytedance.mapper.CustomerPlanStatisticInfoMapper;
+import cn.com.ctop.bytedance.mapper.PlatformCampaignStatisticInfoMapper;
+import cn.com.ctop.bytedance.service.*;
+import cn.com.ctop.bytedance.vo.ByteDanceAdvertiserReportDTO;
+import cn.com.ctop.bytedance.vo.StatisticCampaignVo;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.toutiao.entity.*;
-import cn.com.ctop.toutiao.service.*;
+import cn.com.ctop.common.module.utils.*;
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.PropertyNamingStrategy;
+import com.alibaba.fastjson.serializer.SerializeConfig;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.poi.hssf.usermodel.HSSFDataFormat;
@@ -16,14 +22,6 @@ import org.apache.poi.ss.usermodel.CellStyle;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.jeecg.modules.ctop.entity.CustomerPlanStatisticInfo;
-import org.jeecg.modules.ctop.entity.PlatformCampaignStatisticInfo;
-import org.jeecg.modules.ctop.mapper.CustomerPlanStatisticInfoMapper;
-import org.jeecg.modules.ctop.mapper.PlatformCampaignStatisticInfoMapper;
-import org.jeecg.modules.ctop.service.ICustomerPlanStatisticInfoService;
-import org.jeecg.modules.ctop.service.IPlatformCampaignStatisticInfoService;
-import org.jeecg.modules.ctop.service.IReportService;
-import org.jeecg.modules.ctop.vo.StatisticCampaignVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -76,18 +74,19 @@ public class ReportServiceImpl implements IReportService {
     private IBytedanceCreativeHourlyReportService creativeHourlyReportService;
 
     @Override
-    public Map<String, Object> getAdvertiserReport(JSONObject conditions) {
-        String time_granularity = "STAT_TIME_GRANULARITY_HOURLY";
-        conditions = new JSONObject();
-        conditions.put("advertiser_id", 111463131228L);
-        conditions.put("start_date", "2019-06-01");
-        conditions.put("end_date", "2019-06-10");
-        conditions.put("page_size", 1000);
-        conditions.put("page", 1);
-        conditions.put("time_granularity", time_granularity);
-        Long accountId = conditions.getLong("advertiser_id");
+    public Map<String, Object> getAdvertiserReport(ByteDanceAdvertiserReportDTO conditions) {
+        conditions.setAdvertiserId(111463131228L);
+        conditions.setStartDate("2019-06-01");
+        conditions.setEndDate("2019-06-10");
+        conditions.setPageSize(1000);
+        conditions.setPage(1);
+        conditions.setTimeGranularity(CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        SerializeConfig config = new SerializeConfig();
+        config.propertyNamingStrategy = PropertyNamingStrategy.SnakeCase;
+        JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(conditions, config));
+        Long accountId = conditions.getAdvertiserId();
         CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId + "");
-        JSONObject getObject = getAdvertiserStat(token, conditions);
+        JSONObject getObject = getAdvertiserStat(token, jsonObject);
         Integer code = getObject.getInteger("code");
         String message = getObject.getString("message");
         if (null == code || code != 0) {
@@ -97,7 +96,7 @@ public class ReportServiceImpl implements IReportService {
             if (null != dataArray && dataArray.size() > 0) {
                 for (int i = 0; i < dataArray.size(); i++) {
                     JSONObject data = dataArray.getJSONObject(i);
-                    if (null != time_granularity && time_granularity.equals(CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY)) {
+                    if (null != conditions.getTimeGranularity() && conditions.getTimeGranularity().equals(CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY)) {
                         BytedanceAdvertiserHourlyReport hourlyReport = new BytedanceAdvertiserHourlyReport(data);
                         advertiserHourlyReportService.saveOrUpdate(hourlyReport);
                     } else {
@@ -111,18 +110,19 @@ public class ReportServiceImpl implements IReportService {
     }
 
     @Override
-    public Map<String, Object> getCampaignReport(JSONObject conditions) {
-        String time_granularity = CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY;
-        conditions = new JSONObject();
-        conditions.put("advertiser_id", 111463131228L);
-        conditions.put("start_date", "2019-06-01");
-        conditions.put("end_date", "2019-06-10");
-        conditions.put("page_size", 1000);
-        conditions.put("page", 1);
-        conditions.put("time_granularity", time_granularity);
-        Long accountId = conditions.getLong("advertiser_id");
+    public Map<String, Object> getCampaignReport(ByteDanceAdvertiserReportDTO conditions) {
+        conditions.setAdvertiserId(111463131228L);
+        conditions.setStartDate("2019-06-01");
+        conditions.setEndDate("2019-06-10");
+        conditions.setPageSize(1000);
+        conditions.setPage(1);
+        conditions.setTimeGranularity(CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        SerializeConfig config = new SerializeConfig();
+        config.propertyNamingStrategy = PropertyNamingStrategy.SnakeCase;
+        JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(conditions, config));
+        Long accountId = conditions.getAdvertiserId();
         CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId + "");
-        JSONObject getObject = getAdStat(token, conditions);
+        JSONObject getObject = getAdStat(token, jsonObject);
         Integer code = getObject.getInteger("code");
         String message = getObject.getString("message");
         if (null == code || code != 0) {
@@ -132,7 +132,7 @@ public class ReportServiceImpl implements IReportService {
             if (null != dataArray && dataArray.size() > 0) {
                 for (int i = 0; i < dataArray.size(); i++) {
                     JSONObject data = dataArray.getJSONObject(i);
-                    if (null != time_granularity && "STAT_TIME_GRANULARITY_HOURLY".equals(time_granularity)) {
+                    if (null != conditions.getTimeGranularity() && CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY.equals(conditions.getTimeGranularity())) {
                         BytedanceCampaignHourlyReport hourlyReport = new BytedanceCampaignHourlyReport(data);
                         campaignHourlyReportService.saveOrUpdate(hourlyReport);
                     } else {
@@ -145,36 +145,20 @@ public class ReportServiceImpl implements IReportService {
         return getObject;
     }
 
-    private JSONObject getAdStat(CtopOauthToken token, JSONObject conditions) {
-        Long advertiserId = token.getAccountId();
-        // 请求地址
-        String url = "https://ad.toutiao.com/open_api/2/report/ad/get/";
-        Map<String, Object> filtering = new HashMap<>();
-        filtering.put("campaign_id", 1L);
-        // 请求参数
-        Map<String, Object> params = new HashMap<>();
-        params.put("advertiser_id", advertiserId);
-        params.put("start_date", "2018-04-01");
-        params.put("end_date", "2018-05-01");
-        params.put("time_granularity", "STAT_TIME_GRANULARITY_DAILY");
-        params.put("group_by", new String[]{"STAT_GROUP_BY_FIELD_ID"});
-        params.put("filtering", filtering);
-        return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, params);
-    }
-
     @Override
-    public Map<String, Object> getAdReport(JSONObject conditions) {
-        String time_granularity = CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY;
-        conditions = new JSONObject();
-        conditions.put("advertiser_id", 111463131228L);
-        conditions.put("start_date", "2019-06-01");
-        conditions.put("end_date", "2019-06-10");
-        conditions.put("page_size", 1000);
-        conditions.put("page", 1);
-        conditions.put("time_granularity", time_granularity);
-        Long accountId = conditions.getLong("advertiser_id");
+    public Map<String, Object> getAdReport(ByteDanceAdvertiserReportDTO conditions) {
+        conditions.setAdvertiserId(111463131228L);
+        conditions.setStartDate("2019-06-01");
+        conditions.setEndDate("2019-06-10");
+        conditions.setPageSize(1000);
+        conditions.setPage(1);
+        conditions.setTimeGranularity(CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        SerializeConfig config = new SerializeConfig();
+        config.propertyNamingStrategy = PropertyNamingStrategy.SnakeCase;
+        JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(conditions, config));
+        Long accountId = conditions.getAdvertiserId();
         CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId + "");
-        JSONObject getObject = getAdStat(token, conditions);
+        JSONObject getObject = getAdStat(token, jsonObject);
         Integer code = getObject.getInteger("code");
         String message = getObject.getString("message");
         if (null == code || code != 0) {
@@ -184,7 +168,7 @@ public class ReportServiceImpl implements IReportService {
             if (null != dataArray && dataArray.size() > 0) {
                 for (int i = 0; i < dataArray.size(); i++) {
                     JSONObject data = dataArray.getJSONObject(i);
-                    if (null != time_granularity && "STAT_TIME_GRANULARITY_HOURLY".equals(time_granularity)) {
+                    if (null != conditions.getTimeGranularity() && CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY.equals(conditions.getTimeGranularity())) {
                         BytedancePlanHourlyReport hourlyReport = new BytedancePlanHourlyReport(data);
                         planHourlyReportService.saveOrUpdate(hourlyReport);
                     } else {
@@ -198,18 +182,19 @@ public class ReportServiceImpl implements IReportService {
     }
 
     @Override
-    public Map<String, Object> getCreativeReport(JSONObject conditions) {
-        String time_granularity = CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY;
-        conditions = new JSONObject();
-        conditions.put("advertiser_id", 111463131228L);
-        conditions.put("start_date", "2019-06-01");
-        conditions.put("end_date", "2019-06-10");
-        conditions.put("page_size", 1000);
-        conditions.put("page", 1);
-        conditions.put("time_granularity", time_granularity);
-        Long accountId = conditions.getLong("advertiser_id");
+    public Map<String, Object> getCreativeReport(ByteDanceAdvertiserReportDTO conditions) {
+        conditions.setAdvertiserId(111463131228L);
+        conditions.setStartDate("2019-06-01");
+        conditions.setEndDate("2019-06-10");
+        conditions.setPageSize(1000);
+        conditions.setPage(1);
+        conditions.setTimeGranularity(CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        SerializeConfig config = new SerializeConfig();
+        config.propertyNamingStrategy = PropertyNamingStrategy.SnakeCase;
+        JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(conditions, config));
+        Long accountId = conditions.getAdvertiserId();
         CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId + "");
-        JSONObject getObject = getCreativeStat(token, conditions);
+        JSONObject getObject = getCreativeStat(token, jsonObject);
         Integer code = getObject.getInteger("code");
         String message = getObject.getString("message");
         if (null == code || code != 0) {
@@ -219,7 +204,7 @@ public class ReportServiceImpl implements IReportService {
             if (null != dataArray && dataArray.size() > 0) {
                 for (int i = 0; i < dataArray.size(); i++) {
                     JSONObject data = dataArray.getJSONObject(i);
-                    if (null != time_granularity && "STAT_TIME_GRANULARITY_HOURLY".equals(time_granularity)) {
+                    if (null != conditions.getTimeGranularity() && CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY.equals(conditions.getTimeGranularity())) {
                         BytedanceCreativeHourlyReport hourlyReport = new BytedanceCreativeHourlyReport(data);
                         creativeHourlyReportService.saveOrUpdate(hourlyReport);
                     } else {
@@ -240,6 +225,12 @@ public class ReportServiceImpl implements IReportService {
         return getObject;
     }
 
+    private JSONObject getAdStat(CtopOauthToken token, JSONObject conditions) {
+        // 请求地址
+        String url = "https://ad.toutiao.com/open_api/2/report/ad/get/";
+        return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, conditions);
+    }
+
     @Override
     public void insertCustomerInfo(String csvPath, String charset) {
         try {
@@ -674,83 +665,24 @@ public class ReportServiceImpl implements IReportService {
     public JSONObject getAgentStat(CtopOauthToken token, JSONObject conditions) {
         // 请求地址
         String url = "https://ad.toutiao.com/open_api/2/report/agent/get/";
-        // 请求参数
-        Map params = new HashMap() {
-            {
-                put("advertiser_id", token.getAccountId());
-                put("start_date", "2018-04-01");
-                put("end_date", "2018-05-01");
-                put("time_granularity", "STAT_TIME_GRANULARITY_DAILY");
-            }
-        };
-        JSONObject data = HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, params);
-        return data;
+        return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, conditions);
     }
 
     public JSONObject getCreativeStat(CtopOauthToken token, JSONObject conditions) {
         // 请求地址
         String url = "https://ad.toutiao.com/open_api/2/report/creative/get/";
-        final Map filtering = new HashMap() {
-            {
-                put("campaign_id", 1L);
-            }
-        };
-        // 请求参数
-        final Map params = new HashMap() {
-            {
-                put("advertiser_id", token.getAccountId());
-                put("start_date", "2018-04-01");
-                put("end_date", "2018-05-01");
-                put("time_granularity", "STAT_TIME_GRANULARITY_DAILY");
-                put("group_by", new String[]{"STAT_GROUP_BY_FIELD_ID"});
-                put("filtering", filtering);
-            }
-        };
-        JSONObject data = HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, params);
-        return data;
+        return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, conditions);
     }
 
     public static JSONObject getCampaignStat(CtopOauthToken token, JSONObject conditions) {
         // 请求地址
         String url = "https://ad.toutiao.com/open_api/2/report/campaign/get/";
-        final Map filtering = new HashMap() {
-            {
-                put("campaign_ids", new Long[]{1L, 2L});
-            }
-        };
-        // 请求参数
-        final Map params = new HashMap() {
-            {
-                put("page", 1000);
-                put("pageSize", conditions.getInteger("page_size"));
-                put("advertiser_id", token.getAccountId());
-                put("start_date", conditions.getString("startDate"));
-                put("end_date", conditions.getString("endDate"));
-                put("time_granularity", conditions.getString("timeGranularity"));
-                put("group_by", conditions.getJSONArray("groupBy"));
-                put("filtering", filtering);
-            }
-        };
-        JSONObject data = HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, params);
-        return data;
+        return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, conditions);
     }
 
     public JSONObject getAdvertiserStat(CtopOauthToken token, JSONObject conditions) {
-        final Long advertiserId = token.getAccountId();
         // 请求地址
         String url = "https://ad.toutiao.com/open_api/2/report/advertiser/get/";
-        // 请求参数
-        Map params = new HashMap() {
-            {
-                put("advertiser_id", advertiserId);
-                put("start_date", conditions.getString("start_date"));
-                put("end_date", conditions.getString("end_date"));
-                put("time_granularity", conditions.getString("time_granularity"));
-                put("page", conditions.getString("page"));
-                put("page_size", conditions.getString("page_size"));
-            }
-        };
-        JSONObject data = HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, params);
-        return data;
+        return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, conditions);
     }
 }

+ 15 - 0
module-report/src/main/java/cn/com/ctop/bytedance/vo/ByteDanceAdvertiserReportDTO.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.bytedance.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class ByteDanceAdvertiserReportDTO implements Serializable {
+    private Long advertiserId;
+    private String startDate;
+    private String endDate;
+    private Integer pageSize;
+    private Integer page;
+    private String timeGranularity;
+}

+ 208 - 0
module-report/src/main/java/cn/com/ctop/bytedance/vo/StatisticCampaignVo.java

@@ -0,0 +1,208 @@
+package cn.com.ctop.bytedance.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author 宋英豪
+ */
+@Data
+public class StatisticCampaignVo implements Serializable {
+    /**
+     * 日期
+     */
+    private String statisticDate;
+    /**
+     * 代理
+     */
+    private String proxy;
+    /**
+     * 投放系统
+     */
+    private String deliverySystem;
+    /**
+     * 渠道名称
+     */
+    private String channelName;
+    /**
+     * 广告组名称
+     */
+    private String content;
+    /**
+     * 投放素材
+     */
+    private String meterial;
+    /**
+     * 出价方式
+     */
+    private String priceType;
+    /**
+     * 定向条件
+     */
+    private String directCondition;
+    /**
+     * 基础定向
+     */
+    private String basicDirect;
+    /**
+     * 花费
+     */
+    private String cost;
+    /**
+     * 封面曝光数
+     */
+    private String coverViews;
+    /**
+     * 封面点击数
+     */
+    private String coverClick;
+    /**
+     * 素材曝光数
+     */
+    private String materialViews;
+    /**
+     * 行为数
+     */
+    private String actions;
+    /**
+     * 点击率
+     */
+    private String clickRate;
+    /**
+     * 行为点击率
+     */
+    private String actionClickRate;
+    /**
+     * ACTR*BCTR
+     */
+    private String abctr;
+    /**
+     * 点击成本
+     */
+    private String clickPrice;
+    /**
+     * 行为成本
+     */
+    private String actionPrice;
+    /**
+     * 注册用户
+     */
+    private String registUserNum;
+    /**
+     * 完件用户
+     */
+    private String complateUserNum;
+    /**
+     * 授信用户
+     */
+    private String creditUserNum;
+    /**
+     * 当日注册且完件数
+     */
+    private String registCompleteNum;
+    /**
+     * 当日注册且授信数
+     */
+    private String registCreditNum;
+    /**
+     * 注册成本
+     */
+    private String registPrice;
+    /**
+     * 完件成本
+     */
+    private String completePrice;
+    /**
+     * 授信成本
+     */
+    private String creditPrice;
+    /**
+     * 当日注册且完件成本
+     */
+    private String registCompletePrice;
+    /**
+     * 当日注册且授信成本
+     */
+    private String registCreditPrice;
+    /**
+     * 点击注册率
+     */
+    private String clickRegistRate;
+    /**
+     * 行为注册率
+     */
+    private String actionRegistRate;
+    /**
+     * 完件率
+     */
+    private String completeRate;
+    /**
+     * 授信率
+     */
+    private String creditRate;
+    /**
+     * 当日完件率
+     */
+    private String registCompleteRate;
+    /**
+     * 当日授信率
+     */
+    private String registCreditRate;
+    /**
+     * 当日完件百分比
+     */
+    private String completeRateDay;
+    /**
+     * 当日授信百分比
+     */
+    private String creditRateDay;
+    /**
+     * 当日授信注册百分比
+     */
+    private String creditRegistRateDay;
+
+    @Override
+    public String toString() {
+        return "StatisticCampaignVo{" +
+                "statisticDate='" + statisticDate + '\'' +
+                ", proxy='" + proxy + '\'' +
+                ", deliverySystem='" + deliverySystem + '\'' +
+                ", channelName='" + channelName + '\'' +
+                ", content='" + content + '\'' +
+                ", meterial='" + meterial + '\'' +
+                ", priceType='" + priceType + '\'' +
+                ", directCondition='" + directCondition + '\'' +
+                ", basicDirect='" + basicDirect + '\'' +
+                ", cost='" + cost + '\'' +
+                ", coverViews='" + coverViews + '\'' +
+                ", coverClick='" + coverClick + '\'' +
+                ", materialViews='" + materialViews + '\'' +
+                ", actions='" + actions + '\'' +
+                ", clickRate='" + clickRate + '\'' +
+                ", actionClickRate='" + actionClickRate + '\'' +
+                ", abctr='" + abctr + '\'' +
+                ", clickPrice='" + clickPrice + '\'' +
+                ", actionPrice='" + actionPrice + '\'' +
+                ", registUserNum='" + registUserNum + '\'' +
+                ", complateUserNum='" + complateUserNum + '\'' +
+                ", creditUserNum='" + creditUserNum + '\'' +
+                ", registCompleteNum='" + registCompleteNum + '\'' +
+                ", registCreditNum='" + registCreditNum + '\'' +
+                ", registPrice='" + registPrice + '\'' +
+                ", completePrice='" + completePrice + '\'' +
+                ", creditPrice='" + creditPrice + '\'' +
+                ", registCompletePrice='" + registCompletePrice + '\'' +
+                ", registCreditPrice='" + registCreditPrice + '\'' +
+                ", clickRegistRate='" + clickRegistRate + '\'' +
+                ", actionRegistRate='" + actionRegistRate + '\'' +
+                ", completeRate='" + completeRate + '\'' +
+                ", creditRate='" + creditRate + '\'' +
+                ", registCompleteRate='" + registCompleteRate + '\'' +
+                ", registCreditRate='" + registCreditRate + '\'' +
+                ", completeRateDay='" + completeRateDay + '\'' +
+                ", creditRateDay='" + creditRateDay + '\'' +
+                ", creditRegistRateDay='" + creditRegistRateDay + '\'' +
+                '}';
+    }
+}

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/ByteDanceAdvertisePlanServiceImpl.java

@@ -97,10 +97,10 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         // 请求地址
         String url = "https://ad.toutiao.com/open_api/2/tools/ad_convert/select/";
         // 请求参数
-        Map<String, Object> params = new HashMap();
+        JSONObject params = new JSONObject();
         params.put("advertiser_id", advertiserId);
         //落地页或IOS下载链接
-        if ("page".equals(urlInfo.getType()) || "page".equals(urlInfo.getType())) {
+        if ("page".equals(urlInfo.getType())) {
             params.put("external_url", urlInfo.getUrl());
         }
         //安卓下载链接
@@ -118,7 +118,7 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         // 请求地址
         String url = "https://ad.toutiao.com/open_api/2/tools/ad_convert/select/";
         // 请求参数
-        Map<String, Object> params = new HashMap();
+        JSONObject params = new JSONObject();
         params.put("advertiser_id", advertiserId);
         //落地页
         if ("EXTERNAL_URL".equals(targetTemplate.getDownloadType())) {

+ 1 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/ByteDanceAdvertiserDataServiceImpl.java

@@ -105,7 +105,7 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         Map<String, Object> filtering = new HashMap<>();
         filtering.put("ids", getIds);
 
-        Map<String, Object> param = new HashMap<>();
+        JSONObject param = new JSONObject();
         param.put("advertiser_id", token.getAccountId());
         param.put("page", pageNum);
         param.put("page_size", 100);
@@ -312,7 +312,6 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         params.put("advertiser_id", cTopOauthToken.getAccountId());
         params.put("campaign_id", campaignId);
         params.put("modify_time", campaign.getModifyTime());
-        params.put("campaign_id", campaignId);
         if (null != campaignName && !"".equals(campaignName.trim())) {
             params.put("campaign_name", campaignName);
         }

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/ByteDanceCampaignTemplateServiceImpl.java

@@ -134,7 +134,7 @@ public class ByteDanceCampaignTemplateServiceImpl extends ServiceImpl<ByteDanceC
         // 请求地址
         String url = "https://ad.toutiao.com/open_api/2/tools/video_cover/suggest/";
         // 请求参数
-        Map<String, Object> data = new HashMap();
+        JSONObject data = new JSONObject();
         data.put("advertiser_id", token.getAccountId());
         data.put("video_id", videoId);
         return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, data);

+ 3 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/ByteDanceCreativeServiceImpl.java

@@ -297,7 +297,9 @@ public class ByteDanceCreativeServiceImpl extends ServiceImpl<ByteDanceCreativeM
                 if (response != null) {
                     response.close();
                 }
-                client.close();
+                if (null != client) {
+                    client.close();
+                }
             } catch (IOException e) {
                 e.printStackTrace();
             }

+ 4 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/test/Test.java

@@ -48,7 +48,7 @@ public class Test {
 
                 ck.setExpiryDate(cookie.getExpiry());
                 ck.setPath(cookie.getPath());
-                HttpUtils.cookieStore.addCookie(ck);
+                HttpUtils.COOKIESTORE.addCookie(ck);
                 System.out.println(cookie.getName() + "," + cookie.getValue() + "," + cookie.getDomain());
 //                ck.setDomain(".sso.toutiao.com");
 //                HttpUtils.cookieStore.addCookie(ck);
@@ -104,7 +104,7 @@ public class Test {
 //                String redirectUrl = jsonNode.get("redirect_url").asText();
 //                webDriver.get(redirectUrl);
                 String csrftoken = "";
-                List<org.apache.http.cookie.Cookie> cookies = HttpUtils.cookieStore.getCookies();
+                List<org.apache.http.cookie.Cookie> cookies = HttpUtils.COOKIESTORE.getCookies();
                 for (org.apache.http.cookie.Cookie ck : cookies) {
                     Cookie cookie = new Cookie(ck.getName(), ck.getValue(), "." + ck.getDomain(), ck.getPath(), ck.getExpiryDate());
                     webDriver.manage().addCookie(cookie);
@@ -140,7 +140,7 @@ public class Test {
                     ck.setDomain("ad.oceanengine.com");
                     ck.setExpiryDate(cookie.getExpiry());
                     ck.setPath(cookie.getPath());
-                    HttpUtils.cookieStore.addCookie(ck);
+                    HttpUtils.COOKIESTORE.addCookie(ck);
                     System.out.println(cookie.getName() + "," + cookie.getValue() + "," + cookie.getDomain());
                 }
                 header.put("Accept", "application/json, text/javascript, */*; q=0.01");
@@ -167,7 +167,7 @@ public class Test {
                     ck.setDomain("ad.oceanengine.com");
                     ck.setExpiryDate(cookie.getExpiry());
                     ck.setPath(cookie.getPath());
-                    HttpUtils.cookieStore.addCookie(ck);
+                    HttpUtils.COOKIESTORE.addCookie(ck);
                     System.out.println(cookie.getName() + "," + cookie.getValue() + "," + cookie.getDomain());
                 }
                 String siteStr = HttpUtils.httpGetRequest("https://ad.oceanengine.com/overture/api/adv_site/get_site_list/?_=" + String.valueOf(System.currentTimeMillis()));