浏览代码

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
syh 4 年之前
父节点
当前提交
bfd571224d
共有 100 个文件被更改,包括 4070 次插入1492 次删除
  1. 27 2
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java
  2. 7 0
      jeecg-boot-module-system/pom.xml
  3. 3 1
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  4. 52 78
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AdvertiserController.java
  5. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BindAccountLoginController.java
  6. 6 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java
  7. 0 337
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProductController.java
  8. 20 38
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectController.java
  9. 43 12
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java
  10. 136 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  11. 5 8
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UserAllocationController.java
  12. 0 126
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/Advertiser.java
  13. 10 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/ProjectMember.java
  14. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/AdvertiserMapper.java
  15. 18 10
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ProjectMemberMapper.xml
  16. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IAdvertiserService.java
  17. 7 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/AdvertiserServiceImpl.java
  18. 3 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/PerformanceSaleServiceImpl.java
  19. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectTransferRecordServiceImpl.java
  20. 3 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/performance/service/impl/SalePerformanceDetailServiceImpl.java
  21. 20 20
      jeecg-boot-module-system/src/main/resources/application-dev.yml
  22. 2 2
      jeecg-boot-module-system/src/main/resources/application-test.yml
  23. 3 3
      jeecg-boot-module-system/src/main/resources/jeecg/jeecg_database.properties
  24. 96 100
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  25. 295 0
      module-common/src/main/java/cn/com/ctop/common/module/controller/ProductController.java
  26. 1 31
      module-common/src/main/java/cn/com/ctop/common/module/entity/Advertiser.java
  27. 22 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/MusicInfo.java
  28. 20 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/MusicType.java
  29. 44 13
      module-common/src/main/java/cn/com/ctop/common/module/entity/Product.java
  30. 15 15
      module-common/src/main/java/cn/com/ctop/common/module/entity/Project.java
  31. 9 12
      module-common/src/main/java/cn/com/ctop/common/module/entity/UserAllocation.java
  32. 7 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/MusicInfoMapper.java
  33. 8 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/MusicTypeMapper.java
  34. 8 40
      module-common/src/main/java/cn/com/ctop/common/module/mapper/ProductMapper.java
  35. 4 224
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/ProductMapper.xml
  36. 5 38
      module-common/src/main/java/cn/com/ctop/common/module/service/IProductService.java
  37. 7 0
      module-common/src/main/java/cn/com/ctop/common/module/service/MusicInfoService.java
  38. 8 0
      module-common/src/main/java/cn/com/ctop/common/module/service/MusicTypeService.java
  39. 1 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/BindAccountAuthServiceImpl.java
  40. 11 6
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/FileInfoServiceImpl.java
  41. 11 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MusicInfoServiceImpl.java
  42. 14 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MusicTypeServiceImpl.java
  43. 9 137
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/ProductServiceImpl.java
  44. 6 2
      module-common/src/main/java/cn/com/ctop/common/module/utils/HttpUtils.java
  45. 0 25
      module-common/src/main/java/cn/com/ctop/common/module/vo/ProductDto.java
  46. 0 28
      module-common/src/main/java/cn/com/ctop/common/module/vo/ProductInfoDto.java
  47. 0 52
      module-common/src/main/java/cn/com/ctop/common/module/vo/ProductVO.java
  48. 15 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/entity/CrawlerDouyinMusicTask.java
  49. 8 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/mapper/CrawlerDouyinMusicTaskMapper.java
  50. 9 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/mapper/xml/CrawlerDouyinMusicTaskMapper.xml
  51. 8 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/service/CrawlerDouyinMusicTaskService.java
  52. 18 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/service/impl/CrawlerDouyinMusicServiceImpl.java
  53. 9 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/douyin/service/DouyinMusicService.java
  54. 175 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/douyin/service/impl/DouyinMusicServiceImpl.java
  55. 23 2
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/taobao/service/impl/TaobaoJhsbybtServiceImpl.java
  56. 5 5
      module-ctop/src/main/java/cn/com/ctop/manage/modules/material/service/impl/MaterialUploadServiceImpl.java
  57. 1 1
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceAdvertiserHourlyReportLoadJob.java
  58. 52 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceYesterdayAdvertiserHourlyLoadJob.java
  59. 3 3
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/SendDailyUReportJob.java
  60. 45 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouGroupDailyReportJob.java
  61. 29 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouMaterialSyncMd5Job.java
  62. 33 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java
  63. 26 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouReportDailyMaterialMapper.java
  64. 147 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouReportDailyMaterialMapper.xml
  65. 10 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IBatchService.java
  66. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouHistoryReportTaskService.java
  67. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouReportDailyMaterialService.java
  68. 7 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/AccountWarningServiceImpl.java
  69. 33 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/BatchServiceImpl.java
  70. 26 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouDailyReportTaskServiceImpl.java
  71. 113 3
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouHistoryReportTaskServiceImpl.java
  72. 19 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouReportDailyMaterialServiceImpl.java
  73. 17 8
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  74. 57 4
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/MaterialReportController.java
  75. 419 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaiShouReportDailyMaterial.java
  76. 34 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaiShouReportDailyMaterialVo.java
  77. 84 74
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyGroup.java
  78. 13 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/VideoGetvo.java
  79. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyGroupMapper.java
  80. 391 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyGroupMapper.xml
  81. 48 0
      module-oa/pom.xml
  82. 20 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/constant/QYWxConstant.java
  83. 248 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/controller/WechatCheckinDataController.java
  84. 248 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/controller/WechatDepartmentController.java
  85. 248 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/controller/WechatUserListController.java
  86. 134 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/entity/WechatCheckinData.java
  87. 69 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/entity/WechatDepartment.java
  88. 63 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/entity/WechatUserList.java
  89. 59 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/enums/DepartEnum.java
  90. 15 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/WechatCheckinDataMapper.java
  91. 15 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/WechatDepartmentMapper.java
  92. 15 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/WechatUserListMapper.java
  93. 5 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/xml/WechatCheckinDataMapper.xml
  94. 5 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/xml/WechatDepartmentMapper.xml
  95. 5 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/xml/WechatUserListMapper.xml
  96. 15 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatCheckinDataService.java
  97. 14 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatDepartmentService.java
  98. 8 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatTokenService.java
  99. 15 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatUserListService.java
  100. 0 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatCheckinDataServiceImpl.java

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

@@ -181,6 +181,7 @@ public class DateUtils extends PropertyEditorSupport {
     public static Calendar getCalendar() {
         return Calendar.getInstance();
     }
+
     /**
      * 指定毫秒数表示的日历
      *
@@ -213,15 +214,17 @@ public class DateUtils extends PropertyEditorSupport {
         }
         return null;
     }
+
     /**
      * 当前日期
      *
-     * @return 系统当前时间
      * @param l
+     * @return 系统当前时间
      */
     public static Date getDate(long l) {
         return new Date();
     }
+
     /**
      * 日期转换为字符串
      *
@@ -235,9 +238,11 @@ public class DateUtils extends PropertyEditorSupport {
         }
         return date_sdf.format(date);
     }
+
     public static Date getDate() {
         return new Date();
     }
+
     /**
      * 格式化时间
      *
@@ -592,7 +597,7 @@ public class DateUtils extends PropertyEditorSupport {
      * @return 如果转换成功则返回转换后的日期
      * @throws
      */
-    public static Calendar parseCalendar(String src, String pattern){
+    public static Calendar parseCalendar(String src, String pattern) {
 
         Date date = parseDate(src, pattern);
         Calendar cal = Calendar.getInstance();
@@ -711,6 +716,26 @@ public class DateUtils extends PropertyEditorSupport {
         return dateFormat.format(getDate);
     }
 
+    public static Date stampToTime(Long ms) throws ParseException {
+        long msl = ms * 1000;
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date temp = null;
+        if (ms != null) {
+            try {
+                String str = sdf.format(msl);
+                temp = sdf.parse(str);
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+        }
+        return temp;
+    }
+
+    public static void main(String[] args) throws ParseException {
+        Date date = stampToTime(1599524171L);
+        System.err.println(date);
+    }
+
     /**
      * String类型 转换为Date, 如果参数长度为10 转换格式”yyyy-MM-dd“ 如果参数长度为19 转换格式”yyyy-MM-dd
      * HH:mm:ss“ * @param text String类型的时间值

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

@@ -99,6 +99,13 @@
             <scope>compile</scope>
         </dependency>
         <dependency>
+            <groupId>cn.com.ctop</groupId>
+            <artifactId>module-oa</artifactId>
+            <version>2.0.2</version>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
             <groupId>com.aliyun.oss</groupId>
             <artifactId>aliyun-sdk-oss</artifactId>
             <version>3.5.0</version>

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

@@ -155,7 +155,9 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/test/getGroupData/**", "anon");
         filterChainDefinitionMap.put("/test/getVideoAndImage/**", "anon");
         filterChainDefinitionMap.put("/test/gerCreative/**", "anon");
-
+        filterChainDefinitionMap.put("/test/testdouyinmusic","anon");
+        filterChainDefinitionMap.put("/test/syncDouyinMusic","anon");
+        filterChainDefinitionMap.put("/test/parseDouyinMusic","anon");
         filterChainDefinitionMap.put("/report/kuaishouReportDailyAgent/get", "anon");
 
         filterChainDefinitionMap.put("/appium/appiumTask/run/login", "anon");

+ 52 - 78
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AdvertiserController.java

@@ -2,10 +2,11 @@ package org.jeecg.modules.ctop.controller;
 
 import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.constant.CtopRoleCodeConstant;
+import cn.com.ctop.common.module.entity.Advertiser;
 import cn.com.ctop.common.module.entity.Project;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.ProjectMapper;
-import cn.com.ctop.common.module.service.IProjectService;
+import cn.com.ctop.common.module.service.IProductService;
 import cn.com.ctop.common.module.service.ISysRoleExtService;
 import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.*;
@@ -28,14 +29,11 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.DateUtils;
-import org.jeecg.modules.ctop.entity.Advertiser;
 import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
 import org.jeecg.modules.ctop.service.IAdvertiserService;
 import org.jeecg.modules.excelutil.entity.*;
-import org.jeecg.modules.system.entity.SysCategory;
 import org.jeecg.modules.system.entity.UserCompany;
 import org.jeecg.modules.system.mapper.UserCompanyMapper;
-import org.jeecg.modules.system.service.ISysCategoryService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -61,8 +59,6 @@ public class AdvertiserController {
     @Autowired
     private IAdvertiserService advertiserService;
     @Autowired
-    private ISysCategoryService sysCategoryService;
-    @Autowired
     private UserCompanyMapper userCompanyMapper;
     @Autowired
     private ISysRoleExtService sysRoleService;
@@ -120,15 +116,16 @@ public class AdvertiserController {
                                                    @RequestParam(name = "pageSize", defaultValue = "1000") Integer pageSize,
                                                    HttpServletRequest req) {
         Result<IPage<Advertiser>> result = new Result<>();
-        String roleCode = sysRoleService.getRoleCodeByUserId(advertiser.getUserId());
-        String userId = advertiser.getUserId();
+        // String roleCode = sysRoleService.getRoleCodeByUserId(advertiser.getUserId());
+      /*  String userId = advertiser.getUserId();
         if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "touTiaoOperationManager".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
             advertiser.setUserId(null);
-        }
-        String industryId = advertiser.getIndustryId();
-        advertiser.setIndustryId(null);
+        }*/
+
+        String name = advertiser.getName();
+        advertiser.setName(null);
         QueryWrapper<Advertiser> queryWrapper = QueryGenerator.initQueryWrapper(advertiser, req.getParameterMap());
-        if ("kuaishouOperationManager".equals(roleCode) || "touTiaoOperationManager".equals(roleCode)) {
+       /* if ("kuaishouOperationManager".equals(roleCode) || "touTiaoOperationManager".equals(roleCode)) {
             QueryWrapper<UserCompany> userCompanyQueryWrapper = new QueryWrapper<>();
             userCompanyQueryWrapper.eq("user_id", userId);
             userCompanyQueryWrapper.orderByDesc("create_time");
@@ -137,12 +134,9 @@ public class AdvertiserController {
             if (!Check.isNull(userCompany)) {
                 queryWrapper.eq("company_id", userCompany.getCompanyId());
             }
-        }
-        if (null != industryId && !"".equals(industryId.trim())) {
-            SysCategory category = sysCategoryService.getById(industryId);
-            if (null != category) {
-                queryWrapper.likeRight("industry_code", category.getCode());
-            }
+        }*/
+        if (!Check.isNull(name)) {
+            queryWrapper.like("name", name);
         }
         Page<Advertiser> page = new Page<>(pageNo, pageSize);
         IPage<Advertiser> pageList = advertiserService.page(page, queryWrapper);
@@ -184,14 +178,6 @@ public class AdvertiserController {
             if (!Check.isNull(userCompany)) {
                 advertiser.setCompanyId(userCompany.getCompanyId());
             }
-            String industryId = advertiser.getIndustryId();
-            if (null != industryId && !"".equals(industryId.trim())) {
-                SysCategory category = sysCategoryService.getById(industryId);
-                if (null != category) {
-                    advertiser.setIndustryId(category.getId());
-                    advertiser.setIndustryCode(category.getCode());
-                }
-            }
             advertiserService.save(advertiser);
             result.success("添加成功!");
         } catch (Exception e) {
@@ -207,8 +193,6 @@ public class AdvertiserController {
      * @param advertiser
      * @return
      */
-    @Autowired
-    private IProjectService projectService;
 
     @AutoLog(value = "广告主信息表-编辑")
     @ApiOperation(value = "广告主信息表-编辑", notes = "广告主信息表-编辑")
@@ -219,25 +203,7 @@ public class AdvertiserController {
         if (advertiserEntity == null) {
             result.error500("未找到对应实体");
         } else {
-            String industryId = advertiser.getIndustryId();
-            if (null != industryId && !"".equals(industryId.trim())) {
-                SysCategory category = sysCategoryService.getById(industryId);
-                if (null != category) {
-                    advertiser.setIndustryId(category.getId());
-                    advertiser.setIndustryCode(category.getCode());
-                }
-            }
             boolean ok = advertiserService.updateById(advertiser);
-            QueryWrapper<Project> projectQueryWrapper = new QueryWrapper<>();
-            projectQueryWrapper.eq("advertiser_id", advertiser.getId());
-            Project updateProject = new Project();
-            updateProject.setAdvertiserName(advertiser.getName());
-            projectService.update(updateProject, projectQueryWrapper);
-            QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
-            userAllocationQueryWrapper.eq("advertiser_id", advertiser.getId());
-            UserAllocation updateUserAllocation = new UserAllocation();
-            updateUserAllocation.setAdvertiserName(advertiser.getName());
-            userAllocationService.update(updateUserAllocation, userAllocationQueryWrapper);
             if (ok) {
                 result.success("修改成功!");
             }
@@ -252,6 +218,9 @@ public class AdvertiserController {
      * @param id
      * @return
      */
+    @Autowired
+    private IProductService productService;
+
     @AutoLog(value = "广告主信息表-通过id删除")
     @ApiOperation(value = "广告主信息表-通过id删除", notes = "广告主信息表-通过id删除")
     @DeleteMapping(value = "/delete")
@@ -269,9 +238,14 @@ public class AdvertiserController {
                     Map<String, Object> map = new HashMap<>();
                     map.put("project_id", project.getId());
                     projectMemberMapper.deleteByMap(map);
+                    userAllocationService.removeByMap(map);
                 }
 
             }
+            Map<String, Object> productDeleteMap = new HashMap<>();
+            productDeleteMap.put("advertiser_id", id);
+            productService.removeByMap(productDeleteMap);
+
             projectMapper.delete(queryWrapper);
             boolean ok = advertiserService.removeById(id);
             if (ok) {
@@ -456,11 +430,11 @@ public class AdvertiserController {
     @RequestMapping("/exportKuaishouProjectInfo")
     public void getKuaishouProjectInfo(@RequestBody KuaishouInfoDTO dto,
                                        HttpServletRequest request,
-                                       HttpServletResponse response)throws IOException  {
+                                       HttpServletResponse response) throws IOException {
         Result<PageInfo<ProjectAccountDTO>> result = new Result<>();
         result.setSuccess(true);
 
-        if(dto.getPageSize() == 0){
+        if (dto.getPageSize() == 0) {
             dto.setPageSize(100000);
         }
         OutputStream outputStream = response.getOutputStream();
@@ -468,36 +442,36 @@ public class AdvertiserController {
         HttpUtils.setResponseHeader(response, "快手效果报表" + date + ".xlsx");
         ExcelWriter excelWriter = EasyExcelFactory.getWriter(outputStream);
         String type = dto.getType();
-        if(null!=type&&type.trim().equals("project")){
+        if (null != type && type.trim().equals("project")) {
             SheetInfoVo projectSheetVo = this.getProjectSheetVo(dto, "项目报表");
-            Sheet sheet = new Sheet( 1, 0, EffecfReportProjectEntity.class);
+            Sheet sheet = new Sheet(1, 0, EffecfReportProjectEntity.class);
             sheet.setSheetName(projectSheetVo.getSheetName());
             excelWriter.write(projectSheetVo.getDetails(), sheet);
         }
-        if(null!=type&&type.trim().equals("account")){
+        if (null != type && type.trim().equals("account")) {
             SheetInfoVo accountSheetVo = this.getAccountSheetVo(dto, "账户报表");
-            Sheet sheet = new Sheet( 1, 0, EffecfReportAccountEntity.class);
+            Sheet sheet = new Sheet(1, 0, EffecfReportAccountEntity.class);
             sheet.setSheetName(accountSheetVo.getSheetName());
             excelWriter.write(accountSheetVo.getDetails(), sheet);
         }
 
-        if(null!=type&&type.trim().equals("campaign")){
+        if (null != type && type.trim().equals("campaign")) {
             SheetInfoVo planSheetVo = this.getPlanSheetVo(dto, "广告计划报表");
-            Sheet sheet = new Sheet( 1, 0, EffecfReportPlanEntity.class);
+            Sheet sheet = new Sheet(1, 0, EffecfReportPlanEntity.class);
             sheet.setSheetName(planSheetVo.getSheetName());
             excelWriter.write(planSheetVo.getDetails(), sheet);
         }
 
-        if(null!=type&&type.trim().equals("group")){
+        if (null != type && type.trim().equals("group")) {
             SheetInfoVo campaignSheetVo = this.getGroupSheetVo(dto, "广告组报表");
-            Sheet sheet = new Sheet( 1, 0, EffecfReportGroupEntity.class);
+            Sheet sheet = new Sheet(1, 0, EffecfReportGroupEntity.class);
             sheet.setSheetName(campaignSheetVo.getSheetName());
             excelWriter.write(campaignSheetVo.getDetails(), sheet);
         }
 
-        if(null!=type&&type.trim().equals("creative")){
+        if (null != type && type.trim().equals("creative")) {
             SheetInfoVo creativeSheetVo = this.getCreativeSheetVo(dto, "广告创意");
-            Sheet sheet = new Sheet( 1, 0, EffecfReportCreativeEntity.class);
+            Sheet sheet = new Sheet(1, 0, EffecfReportCreativeEntity.class);
             sheet.setSheetName(creativeSheetVo.getSheetName());
             excelWriter.write(creativeSheetVo.getDetails(), sheet);
         }
@@ -510,13 +484,13 @@ public class AdvertiserController {
     private SheetInfoVo getCreativeSheetVo(KuaishouInfoDTO dto, String sheetName) {
         SheetInfoVo vo = new SheetInfoVo<EffecfReportProjectEntity>();
         vo.setSheetName(sheetName);
-        PageInfo<KuaishouReportDailyAccountDTO> kuaishouCampaignInfoList = accountService.getKuaishouCreativeInfoByUnitId(dto.getProjectList(), dto.getUnitId(), dto.getStartDate(), dto.getEndDate(),dto.getPageSize(),dto.getPageNum(),dto.getYn());
+        PageInfo<KuaishouReportDailyAccountDTO> kuaishouCampaignInfoList = accountService.getKuaishouCreativeInfoByUnitId(dto.getProjectList(), dto.getUnitId(), dto.getStartDate(), dto.getEndDate(), dto.getPageSize(), dto.getPageNum(), dto.getYn());
         List<KuaishouReportDailyAccountDTO> dtos = kuaishouCampaignInfoList.getList();
-        if(null!=dtos&&!dtos.isEmpty()){
+        if (null != dtos && !dtos.isEmpty()) {
             List<EffecfReportCreativeEntity> details = new ArrayList<>();
-            for(KuaishouReportDailyAccountDTO dto1:dtos){
+            for (KuaishouReportDailyAccountDTO dto1 : dtos) {
                 EffecfReportCreativeEntity entity = new EffecfReportCreativeEntity();
-                BeanUtils.copyProperties(dto1,entity);
+                BeanUtils.copyProperties(dto1, entity);
                 details.add(entity);
             }
             vo.setDetails(details);
@@ -527,13 +501,13 @@ public class AdvertiserController {
     private SheetInfoVo getGroupSheetVo(KuaishouInfoDTO dto, String sheetName) {
         SheetInfoVo vo = new SheetInfoVo<EffecfReportProjectEntity>();
         vo.setSheetName(sheetName);
-        PageInfo<KuaishouReportDailyAccountDTO> kuaishouCampaignInfoList = accountService.getKuaishouUnitInfoByCampaignId(dto.getProjectList(), dto.getCampaignId(), dto.getStartDate(), dto.getEndDate(),dto.getPageSize(),dto.getPageNum(),dto.getYn());
+        PageInfo<KuaishouReportDailyAccountDTO> kuaishouCampaignInfoList = accountService.getKuaishouUnitInfoByCampaignId(dto.getProjectList(), dto.getCampaignId(), dto.getStartDate(), dto.getEndDate(), dto.getPageSize(), dto.getPageNum(), dto.getYn());
         List<KuaishouReportDailyAccountDTO> dtos = kuaishouCampaignInfoList.getList();
-        if(null!=dtos&&!dtos.isEmpty()){
+        if (null != dtos && !dtos.isEmpty()) {
             List<EffecfReportGroupEntity> details = new ArrayList<>();
-            for(KuaishouReportDailyAccountDTO dto1:dtos){
+            for (KuaishouReportDailyAccountDTO dto1 : dtos) {
                 EffecfReportGroupEntity entity = new EffecfReportGroupEntity();
-                BeanUtils.copyProperties(dto1,entity);
+                BeanUtils.copyProperties(dto1, entity);
                 details.add(entity);
             }
             vo.setDetails(details);
@@ -544,13 +518,13 @@ public class AdvertiserController {
     private SheetInfoVo getPlanSheetVo(KuaishouInfoDTO dto, String sheetName) {
         SheetInfoVo vo = new SheetInfoVo<EffecfReportProjectEntity>();
         vo.setSheetName(sheetName);
-        PageInfo<KuaishouReportDailyAccountDTO> kuaishouCampaignInfoList = accountService.getKuaishouCampaignInfoByAccountId(dto.getProjectList(), dto.getAccountId(), dto.getStartDate(), dto.getEndDate(),dto.getPageSize(),dto.getPageNum(),dto.getYn());
+        PageInfo<KuaishouReportDailyAccountDTO> kuaishouCampaignInfoList = accountService.getKuaishouCampaignInfoByAccountId(dto.getProjectList(), dto.getAccountId(), dto.getStartDate(), dto.getEndDate(), dto.getPageSize(), dto.getPageNum(), dto.getYn());
         List<KuaishouReportDailyAccountDTO> dtos = kuaishouCampaignInfoList.getList();
-        if(null!=dtos&&!dtos.isEmpty()){
+        if (null != dtos && !dtos.isEmpty()) {
             List<EffecfReportPlanEntity> details = new ArrayList<>();
-            for(KuaishouReportDailyAccountDTO dto1:dtos){
+            for (KuaishouReportDailyAccountDTO dto1 : dtos) {
                 EffecfReportPlanEntity entity = new EffecfReportPlanEntity();
-                BeanUtils.copyProperties(dto1,entity);
+                BeanUtils.copyProperties(dto1, entity);
                 details.add(entity);
             }
             vo.setDetails(details);
@@ -561,13 +535,13 @@ public class AdvertiserController {
     private SheetInfoVo getAccountSheetVo(KuaishouInfoDTO dto, String sheetName) {
         SheetInfoVo vo = new SheetInfoVo<EffecfReportProjectEntity>();
         vo.setSheetName(sheetName);
-        PageInfo<KuaishouReportDailyAccountDTO> kuaishouReportDailyAccountDTOList = accountService.getKuaishouAccountInfoByProjectId(dto.getProjectId(),dto.getProjectList(), dto.getStartDate(), dto.getEndDate(),dto.getPageSize(),dto.getPageNum(),dto.getYn());
+        PageInfo<KuaishouReportDailyAccountDTO> kuaishouReportDailyAccountDTOList = accountService.getKuaishouAccountInfoByProjectId(dto.getProjectId(), dto.getProjectList(), dto.getStartDate(), dto.getEndDate(), dto.getPageSize(), dto.getPageNum(), dto.getYn());
         List<KuaishouReportDailyAccountDTO> dtos = kuaishouReportDailyAccountDTOList.getList();
-        if(null!=dtos&&!dtos.isEmpty()){
+        if (null != dtos && !dtos.isEmpty()) {
             List<EffecfReportAccountEntity> details = new ArrayList<>();
-            for(KuaishouReportDailyAccountDTO dto1:dtos){
+            for (KuaishouReportDailyAccountDTO dto1 : dtos) {
                 EffecfReportAccountEntity entity = new EffecfReportAccountEntity();
-                BeanUtils.copyProperties(dto1,entity);
+                BeanUtils.copyProperties(dto1, entity);
                 details.add(entity);
             }
             vo.setDetails(details);
@@ -578,13 +552,13 @@ public class AdvertiserController {
     private SheetInfoVo getProjectSheetVo(KuaishouInfoDTO dto, String sheetName) {
         SheetInfoVo vo = new SheetInfoVo<EffecfReportProjectEntity>();
         vo.setSheetName(sheetName);
-        PageInfo<ProjectAccountDTO> projectAccountDTOList = accountService.getKuaishouProjectInfo(dto.getStartDate(), dto.getEndDate(), dto.getProjectList(),dto.getPageSize(),dto.getPageNum(), "", dto.getYn());
+        PageInfo<ProjectAccountDTO> projectAccountDTOList = accountService.getKuaishouProjectInfo(dto.getStartDate(), dto.getEndDate(), dto.getProjectList(), dto.getPageSize(), dto.getPageNum(), "", dto.getYn());
         List<ProjectAccountDTO> dtos = projectAccountDTOList.getList();
-        if(null!=dtos&&!dtos.isEmpty()){
+        if (null != dtos && !dtos.isEmpty()) {
             List<EffecfReportProjectEntity> details = new ArrayList<>();
-            for(ProjectAccountDTO dto1:dtos){
+            for (ProjectAccountDTO dto1 : dtos) {
                 EffecfReportProjectEntity entity = new EffecfReportProjectEntity();
-                BeanUtils.copyProperties(dto1,entity);
+                BeanUtils.copyProperties(dto1, entity);
                 details.add(entity);
             }
             vo.setDetails(details);

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

@@ -91,10 +91,10 @@ public class BindAccountLoginController {
             userAllocation.setUserId(userId);
             userAllocation.setAdvertiserId(advertiserId);
             userAllocation.setAccountId(accountId);
-            userAllocation.setAdvertiserName(advertiserName);
+          //  userAllocation.setAdvertiserName(advertiserName);
             userAllocation.setAccountName(accountName);
             userAllocation.setProjectId(projectId);
-            userAllocation.setProjectName(projectName);
+            // userAllocation.setProjectName(projectName);
             userAllocation.setMediaId(mediaId);
             userAllocation.setSystemType(systemType);
             int i = userAllocationMapper.insert(userAllocation);

+ 6 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java

@@ -184,11 +184,11 @@ public class CallbackController {
                     if ((Integer) advertiseBaseInfoMap.get("code") == 0) {
                         userAllocation.setAuthName((String) advertiseBaseInfoMap.get("userName"));
                     }
-                    userAllocation.setAdvertiserName(advertiserName);
+               //     userAllocation.setAdvertiserName(advertiserName);
                     userAllocation.setMediaId(mediaId);
                     userAllocation.setAccountId(accountId);
                     userAllocation.setProjectId(projectId);
-                    userAllocation.setProjectName(projectName);
+                 //   userAllocation.setProjectName(projectName);
                     userAllocation.setWarningProportion(warningProportion);
                     userAllocation.setWarningAmount(warningAmount);
 
@@ -344,10 +344,10 @@ public class CallbackController {
                             userAllocation.setUserId(userId);
                             userAllocation.setUserName(userName);
                             userAllocation.setAccountId(token.getAccountId());
-                            userAllocation.setAdvertiserName(advertiserName);
+                       //     userAllocation.setAdvertiserName(advertiserName);
                             userAllocation.setMediaId(mediaId);
                             userAllocation.setProjectId(projectId);
-                            userAllocation.setProjectName(projectName);
+                         //   userAllocation.setProjectName(projectName);
                             userAllocation.setSystemType(systemType);
                             userAllocation.setAuthName((String) advertiserDataMap.get("name"));
                             userAllocation.setAdvertiserId(advertiserId);
@@ -398,10 +398,10 @@ public class CallbackController {
                     userAllocation.setUserId(userId);
                     userAllocation.setUserName(userName);
                     userAllocation.setAccountId(token.getAccountId());
-                    userAllocation.setAdvertiserName(advertiserName);
+               //     userAllocation.setAdvertiserName(advertiserName);
                     userAllocation.setMediaId(mediaId);
                     userAllocation.setProjectId(projectId);
-                    userAllocation.setProjectName(projectName);
+                //    userAllocation.setProjectName(projectName);
                     userAllocation.setSystemType(systemType);
                     userAllocation.setAuthName((String) advertiserDataMap.get("name"));
                     userAllocation.setAdvertiserId(advertiserId);

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

@@ -1,337 +0,0 @@
-package org.jeecg.modules.ctop.controller;
-
-import cn.com.ctop.common.module.entity.Advertiser;
-import cn.com.ctop.common.module.entity.Project;
-import cn.com.ctop.common.module.service.IProductService;
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
-
-import cn.com.ctop.common.module.vo.ProductInfoDto;
-import cn.com.ctop.common.module.vo.ProductVO;
-import cn.com.ctop.common.module.vo.ProjectVO;
-import cn.com.ctop.manage.modules.actor.entity.Actor;
-import cn.com.ctop.manage.modules.actor.entity.ActorComment;
-import cn.com.ctop.manage.modules.actor.entity.ActorPhoto;
-import cn.com.ctop.manage.modules.actor.entity.ActorVideo;
-import cn.com.ctop.manage.modules.actor.service.IActorCommentService;
-import cn.com.ctop.manage.modules.actor.service.IActorPhotoService;
-import cn.com.ctop.manage.modules.actor.service.IActorService;
-import cn.com.ctop.manage.modules.actor.service.IActorVideoService;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.github.pagehelper.PageInfo;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-@RestController
-@Slf4j
-@RequestMapping("/ctop/product")
-public class ProductController {
-    @Autowired
-    private IProductService productService;
-
-    //获取广告主列表
-    @ResponseBody
-    @RequestMapping(value = "/advertiserList")
-    public Result<List<Advertiser>> advertiserList(HttpServletRequest request,HttpServletResponse response){
-        log.info("/ctop/product/advertiserList 方法开始");
-        Result<List<Advertiser>> result = new Result();
-
-        try {
-            List<Advertiser> advertiserList = productService.advertiserList();
-            result.setResult(advertiserList);
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/advertiserList 方法结束");
-        }
-
-        return result;
-    }
-
-    //根据广告主id获取项目列表
-    @ResponseBody
-    @RequestMapping(value = "/getProjectListByAdvertiserId")
-    public Result<List<Project>> getProjectListByAdvertiserId(@RequestBody ProductInfoDto dto,
-            HttpServletRequest request, HttpServletResponse response){
-        log.info("/ctop/product/getProjectListByAdvertiserId 方法开始");
-        Result<List<Project>> result = new Result();
-        if(dto == null || dto.getAdvertiserId() ==null ){
-            result.setSuccess(false);
-            result.setMessage("advertiserId不能为空");
-            return result;
-        }
-
-        try {
-            List<Project> projectList = productService.getProjectListByAdvertiserId(dto.getAdvertiserId());
-            result.setResult(projectList);
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/getProjectListByAdvertiserId 方法结束");
-        }
-
-        return result;
-    }
-
-    //根据项目列表获取运营和销售的信息
-    @ResponseBody
-    @RequestMapping(value = "/getSaleAndYunyingListByProjectIds")
-    public Result<Map<String, Object>> getSaleAndYunyingListByProjectIds(@RequestBody ProductInfoDto dto,
-                                                              HttpServletRequest request, HttpServletResponse response){
-        log.info("/ctop/product/getSaleAndYunyingListByProjectIds 方法开始");
-        Result<Map<String, Object>> result = new Result();
-        if(dto == null || dto.getProjectIds() ==null || dto.getProjectIds().size() ==0 ){
-            result.setSuccess(false);
-            result.setMessage("projectIds不能为空");
-            return result;
-        }
-
-        try {
-            Map<String, Object> map = productService.getSaleAndYunyingListByProjectIds(dto.getProjectIds());
-            result.setResult(map);
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/getSaleAndYunyingListByProjectIds 方法结束");
-        }
-
-        return result;
-    }
-
-    //逻辑删除产品
-    @ResponseBody
-    @RequestMapping(value = "/deleteProduct")
-    public Result deleteProduct(@RequestBody ProductInfoDto dto,HttpServletRequest request, HttpServletResponse response){
-        log.info("/ctop/product/deleteProduct 方法开始");
-        Result result = new Result();
-        if(dto == null || dto.getProductId() ==null ){
-            result.setSuccess(false);
-            result.setMessage("productId不能为空");
-            return result;
-        }
-
-        try {
-            productService.deleteProduct(dto.getProductId());
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/deleteProduct 方法结束");
-        }
-
-        return result;
-    }
-
-    //产品信息入库
-    @ResponseBody
-    @RequestMapping(value = "/insertOrUpdateProduct")
-    public Result insertOrUpdateProduct(@RequestBody ProductVO vo, HttpServletRequest request, HttpServletResponse response){
-        log.info("/ctop/product/insertOrUpdateProduct 方法开始");
-        Result result = new Result();
-
-        //if(vo==null || vo.getId() == null){
-        //    if(StringUtils.isBlank(vo.getProductName())){
-        //        result.setSuccess(false);
-        //        result.setMessage("产品不能为空");
-        //        return result;
-        //    }
-        //    Integer count = productService.getProductNameCount(vo.getProductName());
-        //    if(count != 0){
-        //        result.setSuccess(false);
-        //        result.setMessage("产品名字已存在");
-        //        return result;
-        //    }
-        //}
-
-        try {
-            productService.insertOrUpdateProduct(vo);
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/insertOrUpdateProduct 方法结束");
-        }
-
-        return result;
-    }
-
-    //编辑产品反显
-    @ResponseBody
-    @RequestMapping(value = "/getProductInfo")
-    public Result<Map<String, Object>> getProductInfo(@RequestBody ProductInfoDto dto, HttpServletRequest request, HttpServletResponse response){
-        log.info("/ctop/product/getProductInfo 方法开始");
-        Result<Map<String, Object>> result = new Result();
-        if(dto==null || dto.getProductId() == null){
-            result.setSuccess(false);
-            result.setMessage("productId不能为空");
-            return result;
-        }
-
-        try {
-            Map<String, Object> productInfo = productService.getProductInfo(dto.getProductId());
-            result.setResult(productInfo);
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/getProductInfo 方法结束");
-        }
-
-        return result;
-    }
-
-    //单独删除产品关联项目
-    @ResponseBody
-    @RequestMapping(value = "/deleteByProjectIdAndProductId")
-    public Result deleteByProjectIdAndProductId(@RequestBody ProductInfoDto dto, HttpServletRequest request, HttpServletResponse response){
-        log.info("/ctop/product/deleteByProjectIdAndProductId 方法开始");
-        Result result = new Result();
-        if(dto==null || dto.getProductId() == null || dto.getProjectId() ==null){
-            result.setSuccess(false);
-            result.setMessage("productId,projectId不能为空");
-            return result;
-        }
-
-        try {
-            productService.deleteByProjectIdAndProductId(dto.getProjectId(), dto.getProductId());
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/deleteByProjectIdAndProductId 方法结束");
-        }
-
-        return result;
-    }
-
-    //编辑产品按钮反显
-    @ResponseBody
-    @RequestMapping(value = "/getProjectListByProductId")
-    public Result<List<ProjectVO>> getProjectListByProductId(@RequestBody ProductInfoDto dto, HttpServletRequest request, HttpServletResponse response){
-        log.info("/ctop/product/getProjectListByProductId 方法开始");
-        Result<List<ProjectVO>> result = new Result();
-        if(dto==null || dto.getProductId() == null){
-            result.setSuccess(false);
-            result.setMessage("productId,projectId不能为空");
-            return result;
-        }
-
-        try {
-            List<ProjectVO> projectListByProductId = productService.getProjectListByProductId(dto.getProductId());
-            result.setResult(projectListByProductId);
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/getProjectListByProductId 方法结束");
-        }
-
-        return result;
-    }
-
-    //产品列表
-    @ResponseBody
-    @RequestMapping(value = "/getProductList")
-    public Result<PageInfo<ProductVO>> getProductList(@RequestBody ProductInfoDto dto, HttpServletRequest request, HttpServletResponse response){
-        log.info("/ctop/product/getProductList 方法开始");
-        Result<PageInfo<ProductVO>> result = new Result();
-        if(dto==null || dto.getPageNum() == 0 || dto.getPageSize() ==0){
-            dto.setPageNum(1);
-            dto.setPageSize(10);
-        }
-
-        try {
-            PageInfo<ProductVO> productList = productService.getProductList(dto.getAdvertiserName(), dto.getProductName(), dto.getPageNum(), dto.getPageSize());
-            result.setResult(productList);
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/getProductList 方法结束");
-        }
-
-        return result;
-    }
-
-    //产品列表
-    @ResponseBody
-    @RequestMapping(value = "/insertProductProjectMap")
-    public Result insertProductProjectMap(@RequestBody ProductInfoDto dto, HttpServletRequest request, HttpServletResponse response){
-        log.info("/ctop/product/insertProductProjectMap 方法开始");
-        Result result = new Result();
-        if(dto==null || dto.getProductId() == null || dto.getProjectIds() == null){
-            result.setSuccess(false);
-            result.setMessage("productId,projectIds不能为空");
-            return result;
-        }
-
-        List<Long> dtoProjectIds = dto.getProjectIds();
-        List<Long> projectIdsHas = productService.getProjectIdsByProductId(dto.getProductId());
-        List<Long> addProjectIds = new ArrayList<>();
-
-        for(Long dtoProjectId:dtoProjectIds){
-            int filter = 0;
-            for(Long projectIdHas:projectIdsHas){
-                if(projectIdHas.equals(dtoProjectId)){
-                    filter = -1;
-                    break;
-                }
-            }
-            if(filter == 0){
-                addProjectIds.add(dtoProjectId);
-            }
-        }
-
-        if(addProjectIds==null || addProjectIds.size()==0){
-            return result;
-        }
-
-        try {
-            productService.insertProductProjectMap(dto.getProductId(), addProjectIds);
-        }catch (Exception e){
-            log.error(e.getMessage());
-            result.setSuccess(false);
-            result.setMessage("error");
-        }finally{
-            log.info("/ctop/product/insertProductProjectMap 方法结束");
-        }
-
-        return result;
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-}

+ 20 - 38
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectController.java

@@ -16,14 +16,12 @@ import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
-import org.jeecg.modules.ctop.entity.Advertiser;
 import org.jeecg.modules.ctop.entity.ProjectMember;
 import org.jeecg.modules.ctop.entity.TransferAccount;
 import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
 import org.jeecg.modules.ctop.service.IAdvertiserService;
 import org.jeecg.modules.ctop.service.IProjectMemberService;
 import org.jeecg.modules.ctop.service.ITransferAccountService;
-import org.jeecg.modules.system.entity.SysCategory;
 import org.jeecg.modules.system.service.ISysCategoryService;
 import org.jeecg.modules.system.service.ISysUserService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -195,9 +193,9 @@ public class ProjectController {
         } else if ("operator".equals(roleCode) || "operationAssistant".equals(roleCode)) {
             queryWrapper.eq("responsible_id", userId);
             pageList = projectService.page(page, queryWrapper);
-        }else{
+        } else {
             queryWrapper.eq("responsible_id", userId);
-            pageList = projectService.page(page,queryWrapper);
+            pageList = projectService.page(page, queryWrapper);
         }
         List<Project> records = pageList.getRecords();
         if (!Check.isNull(records)) {
@@ -239,33 +237,27 @@ public class ProjectController {
                                                 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                 HttpServletRequest req) {
         Result<IPage<Project>> result = new Result<>();
-        String advertiserName = project.getAdvertiserName();
-        project.setAdvertiserName(null);
+
         String projectName = project.getProjectName();
         project.setProjectName(null);
-        String industryId = project.getIndustryId();
-        project.setIndustryId(null);
+
+
         QueryWrapper<Project> queryWrapper = QueryGenerator.initQueryWrapper(project, req.getParameterMap());
         Page<Project> page = new Page<>(pageNo, pageSize);
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String roleCode = sysRoleService.getRoleCodeByUserId(sysUser.getId());
-        if (!(CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode))) {
-            queryWrapper.eq("user_id", sysUser.getId());
-            queryWrapper.orderByDesc("create_time");
-        }
-        if (null != industryId && !"".equals(industryId.trim())) {
-            SysCategory category = sysCategoryService.getById(industryId);
-            if (null != category) {
-                queryWrapper.likeRight("industry_code", category.getCode());
-            }
-        }
-        if (!Check.isNull(advertiserName)) {
-            queryWrapper.like("advertiser_name", advertiserName);
+        if ("operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "touTiaoOperationManager".equals(roleCode)) {
+            queryWrapper.eq("responsible_id", sysUser.getId());
 
+        } else if ("plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode) || "clip".equals(roleCode) || "designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode)) {
+            queryWrapper.eq("design_responsible_id", sysUser.getId());
         }
+
         if (!Check.isNull(projectName)) {
             queryWrapper.like("project_name", projectName);
         }
+        queryWrapper.orderByDesc("create_time");
+
         IPage<Project> pageList = projectService.page(page, queryWrapper);
         List<Project> records = pageList.getRecords();
         if (!Check.isNull(records)) {
@@ -310,23 +302,22 @@ public class ProjectController {
             if (!Check.isNull(advertiser)) {
                 project.setCompanyId(advertiser.getCompanyId());
             }
-            SysCategory category = sysCategoryService.getById(project.getIndustryId());
+          /*  SysCategory category = sysCategoryService.getById(project.getIndustryId());
             if (null != category) {
                 project.setIndustryCode(category.getCode());
                 project.setIndustryId(category.getId());
-            }
+            }*/
             SysUser sysUser = sysUserService.getById(project.getResponsibleId());
             if (!Check.isNull(sysUser)) {
-                project.setResponsibleName(sysUser.getRealname());
+                //  project.setResponsibleName(sysUser.getRealname());
                 memberMap.put(sysUser.getId(), sysUser.getRealname());
             }
 
             SysUser designSysUser = sysUserService.getById(project.getDesignResponsibleId());
             if (!Check.isNull(designSysUser)) {
-                project.setDesignResponsibleName(designSysUser.getRealname());
+                // project.setDesignResponsibleName(designSysUser.getRealname());
                 memberMap.put(designSysUser.getId(), designSysUser.getRealname());
             }
-
             projectService.save(project);
 
             Long id = project.getId();
@@ -339,7 +330,6 @@ public class ProjectController {
                 projectMemberService.removeByMap(map);
                 ProjectMember member = new ProjectMember();
                 member.setProjectId(id);
-                member.setProjectName(project.getProjectName());
                 member.setUserId(userId);
                 member.setUserName(userName);
                 String roleCode = sysRoleService.getRoleCodeByUserId(userId);
@@ -374,18 +364,18 @@ public class ProjectController {
         Result<Project> result = new Result<>();
         SysUser sysUser = sysUserService.getById(project.getResponsibleId());
         if (!Check.isNull(sysUser)) {
-            project.setResponsibleName(sysUser.getRealname());
+            //     project.setResponsibleName(sysUser.getRealname());
             projectMemberService.addMember(sysUser, project);
         }
 
-        SysCategory category = sysCategoryService.getById(project.getIndustryId());
+       /* SysCategory category = sysCategoryService.getById(project.getIndustryId());
         if (null != category) {
             project.setIndustryCode(category.getCode());
             project.setIndustryId(category.getId());
-        }
+        }*/
         SysUser designSysUser = sysUserService.getById(project.getDesignResponsibleId());
         if (!Check.isNull(designSysUser)) {
-            project.setDesignResponsibleName(designSysUser.getRealname());
+            //      project.setDesignResponsibleName(designSysUser.getRealname());
             projectMemberService.addMember(designSysUser, project);
         }
         Project projectEntity = projectService.getById(project.getId());
@@ -393,20 +383,12 @@ public class ProjectController {
             result.error500("未找到对应实体");
         } else {
             boolean ok = projectService.updateById(project);
-
             QueryWrapper<ProjectMember> memberQueryWrapper = new QueryWrapper<>();
             memberQueryWrapper.eq("project_id", project.getId());
             ProjectMember updateMember = new ProjectMember();
             updateMember.setProjectName(project.getProjectName());
             projectMemberService.update(updateMember, memberQueryWrapper);
 
-            QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
-            userAllocationQueryWrapper.eq("project_id", project.getId());
-            UserAllocation updateUserAllocation = new UserAllocation();
-            updateUserAllocation.setProjectName(project.getProjectName());
-            // updateUserAllocation.setMediaId(project.getMediaId());
-            userAllocationService.update(updateUserAllocation, userAllocationQueryWrapper);
-
             if (!projectEntity.getSupplierCode().equals(project.getSupplierCode())) {
                 QueryWrapper<MaterialInfo> materialInfoQueryWrapper = new QueryWrapper<>();
                 materialInfoQueryWrapper.eq("project_id", project.getId());

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

@@ -1,7 +1,10 @@
 package org.jeecg.modules.ctop.controller;
 
+import cn.com.ctop.common.module.entity.Advertiser;
+import cn.com.ctop.common.module.entity.Product;
 import cn.com.ctop.common.module.entity.Project;
 import cn.com.ctop.common.module.entity.SysUser;
+import cn.com.ctop.common.module.service.IProductService;
 import cn.com.ctop.common.module.service.IProjectService;
 import cn.com.ctop.common.module.service.ISysRoleExtService;
 import cn.com.ctop.common.module.utils.Check;
@@ -20,6 +23,7 @@ import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.modules.ctop.entity.ProjectMember;
 import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
+import org.jeecg.modules.ctop.service.IAdvertiserService;
 import org.jeecg.modules.ctop.service.IProjectMemberService;
 import org.jeecg.modules.system.service.ISysUserService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -50,6 +54,8 @@ public class ProjectMemberController {
     private ISysRoleExtService sysRoleService;
     @Autowired
     private ISysUserService sysUserService;
+    @Autowired
+    private IAdvertiserService advertiserService;
 
 
     /**
@@ -84,6 +90,8 @@ public class ProjectMemberController {
      * @param userId
      * @return
      */
+
+
     @GetMapping(value = "/participateList")
     public Map<String, Object> participateList(String userId) {
         Map<String, Object> map = new HashMap<>();
@@ -104,9 +112,20 @@ public class ProjectMemberController {
                     }
                     Project project = projectService.getById(projectMember.getProjectId());
                     if (!Check.isNull(project)) {
-                        projectMember.setResponsibleName(project.getResponsibleName());
-                        projectMember.setDesignResponsibleName(project.getDesignResponsibleName());
-                        projectMember.setAdvertiserName(project.getAdvertiserName());
+                        SysUser responsible = sysUserService.getById(project.getResponsibleId());
+
+                        projectMember.setResponsibleName(responsible.getRealname());
+                        SysUser designResponsible = sysUserService.getById(project.getDesignResponsibleId());
+                        projectMember.setDesignResponsibleName(designResponsible.getRealname());
+
+                        projectMember.setProjectName(project.getProjectName());
+                        Product product = productService.getById(project.getProductId());
+                        if (!Check.isNull(product)) {
+                            projectMember.setProductId(product.getId());
+                            projectMember.setProductName(product.getProductName());
+                        }
+                        Advertiser advertiser = advertiserService.getById(project.getAdvertiserId());
+                        projectMember.setAdvertiserName(advertiser.getName());
                         projectMember.setAdvertiserId(project.getAdvertiserId());
                         projectMember.setMediaId(project.getMediaId());
                         projectMember.setMaxBid(project.getMaxBid());
@@ -126,28 +145,30 @@ public class ProjectMemberController {
     }
 
     @GetMapping("/projectList")
-    public Map<String,Object>projectList(){
+    public Map<String, Object> projectList() {
         Map<String, Object> result = new HashMap<>();
         try {
             String userId = ((LoginUser) SecurityUtils.getSubject().getPrincipal()).getId();
             String roleCode = sysRoleService.getRoleCodeByUserId(userId);
             if ("admin".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
-                List<Project>projects = projectService.list();
-                result.put("data",projects);
+                List<Project> projects = projectService.list();
+                result.put("data", projects);
                 ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
                 return result;
             }
             List<Project> projects = projectMemberService.selectListByUserId(userId);
-            result.put("data",projects);
-            ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+            result.put("data", projects);
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
             return result;
         } catch (Exception e) {
             e.printStackTrace();
-            ResultMapUtils.setResultMap(result,StatusCode.COMMON_PARAM_ERROR);
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
             return result;
         }
     }
 
+    @Autowired
+    private IProductService productService;
 
     @GetMapping(value = "/participateListV2")
     public Result<IPage<ProjectMember>> participateListV2(ProjectMember projectMember,
@@ -189,9 +210,19 @@ public class ProjectMemberController {
                 }
                 Project project = projectService.getById(member.getProjectId());
                 if (!Check.isNull(project)) {
-                    member.setResponsibleName(project.getResponsibleName());
-                    member.setDesignResponsibleName(project.getDesignResponsibleName());
-                    member.setAdvertiserName(project.getAdvertiserName());
+                    SysUser responsible = sysUserService.getById(project.getResponsibleId());
+                    member.setResponsibleName(responsible.getRealname());
+                    SysUser designResponsible = sysUserService.getById(project.getDesignResponsibleId());
+                    member.setDesignResponsibleName(designResponsible.getRealname());
+                    Advertiser advertiser = advertiserService.getById(project.getAdvertiserId());
+                    member.setProjectName(project.getProjectName());
+                    Product product = productService.getById(project.getProductId());
+                    if (!Check.isNull(product)) {
+                        member.setProductId(product.getId());
+                        member.setProductName(product.getProductName());
+                    }
+                    member.setAdvertiserName(advertiser.getName());
+                    member.setAdvertiserId(project.getAdvertiserId());
                     member.setAdvertiserId(project.getAdvertiserId());
                     member.setMediaId(project.getMediaId());
                     member.setMaxBid(project.getMaxBid());

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

@@ -5,6 +5,9 @@ import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
 import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.utils.*;
 import cn.com.ctop.common.module.vo.ResFileDTO;
+import cn.com.ctop.crawler.modules.core.entity.CrawlerDouyinMusicTask;
+import cn.com.ctop.crawler.modules.core.service.CrawlerDouyinMusicTaskService;
+import cn.com.ctop.crawler.modules.douyin.service.DouyinMusicService;
 import cn.com.ctop.kuaishou.modules.batch.service.*;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
@@ -71,11 +74,141 @@ public class TestController {
     private IKuaishouInterfaceService2 kuaishouInterfaceService2;
     @Autowired
     private IUserAllocationService userAllocationService;
+    @Autowired
+    private DouyinMusicService douyinMusicService;
+    @Autowired
+    private CrawlerDouyinMusicTaskService crawlerDouyinMusicTaskService;
+    @Autowired
+    private MusicInfoService musicInfoService;
+    @Autowired
+    private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
 
     static ExecutorService executorService = Executors.newFixedThreadPool(15);
     static ExecutorService videoService = Executors.newFixedThreadPool(5);
-    static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
+    static ExecutorService suzhaoService = Executors.newFixedThreadPool(10);
+
 
+    @GetMapping(value = "/dailyReport")
+    public void dailyReport() {
+        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
+        if (null == tokens || tokens.size() <= 0) {
+            log.info("定时获取快手数据异常:未获取到可用的token");
+        }
+        for (CtopOauthToken token : tokens) {
+            dailyReportTaskService.getTaskList(token.getAccountId(), token.getAccessToken(), "2020-09-20");
+        }
+    }
+
+    @GetMapping(value = "/getMd5")
+    public void getMd5() {
+        kuaiShouHistoryReportTaskService.getMd5(null, null);
+
+    }
+
+    @GetMapping(value = "/getGroupReport")
+    public void getGroupReport() throws ParseException {
+        List<CtopOauthToken> tokens = oauthTokenService.selectKuaiShouToken();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date parse1 = simpleDateFormat.parse("2020-09-12");
+        Date parse2 = simpleDateFormat.parse("2020-09-17");
+        for (CtopOauthToken token : tokens) {
+
+            suzhaoService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    //1: 获取广告主信息数据
+                    kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, parse1, parse2);
+                }
+            });
+
+
+        }
+    }
+
+
+    @GetMapping(value = "/syncDouyinMusicAsc")
+    public String syncDouyinMusicAsc() {
+        QueryWrapper<CrawlerDouyinMusicTask> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("status", "init").orderByAsc("id").last(" limit 20");
+
+        List<CrawlerDouyinMusicTask> list = crawlerDouyinMusicTaskService.list(queryWrapper);
+
+        while (list != null) {
+            for (CrawlerDouyinMusicTask crawlerDouyinMusicTask : list) {
+                MusicInfo musicInfo = new MusicInfo();
+                musicInfo.setExtId(crawlerDouyinMusicTask.getId());
+                musicInfo = douyinMusicService.getMusicInfo(musicInfo);
+                musicInfoService.save(musicInfo);
+                crawlerDouyinMusicTask.setStatus("done");
+                crawlerDouyinMusicTaskService.updateById(crawlerDouyinMusicTask);
+            }
+            list = crawlerDouyinMusicTaskService.list(queryWrapper);
+        }
+        return "success";
+    }
+
+    @GetMapping(value = "/syncDouyinMusic")
+    public String syncDouyinMusic() {
+        for (int i = 0; i < 10; i++) {
+            final int j = i;
+            Thread thread = new Thread() {
+                @Override
+                public void run() {
+                    QueryWrapper<CrawlerDouyinMusicTask> queryWrapper = new QueryWrapper<>();
+                    queryWrapper.eq("status", "init").likeLeft("id", j).orderByDesc("id").last(" limit 20");
+                    List<CrawlerDouyinMusicTask> list = crawlerDouyinMusicTaskService.list(queryWrapper);
+                    while (list != null) {
+                        log.info("【同步歌曲】第" + j + "线程正在处理:" + list.size() + "条数据");
+                        for (CrawlerDouyinMusicTask crawlerDouyinMusicTask : list) {
+                            MusicInfo musicInfo = new MusicInfo();
+                            musicInfo.setExtId(crawlerDouyinMusicTask.getId());
+                            douyinMusicService.getMusicInfo(musicInfo);
+                        }
+                        list = crawlerDouyinMusicTaskService.list(queryWrapper);
+                    }
+                }
+            };
+            thread.start();
+        }
+
+        return "success";
+    }
+
+    @GetMapping(value = "/parseDouyinMusic")
+    public String parseDouyinMusic() {
+        for (int i = 0; i < 10; i++) {
+            final int j = i;
+            Thread thread = new Thread() {
+                @Override
+                public void run() {
+                    QueryWrapper<CrawlerDouyinMusicTask> queryWrapper = new QueryWrapper<>();
+                    queryWrapper.eq("status", "done").likeLeft("id", j).orderByDesc("id").last(" limit 20");
+                    List<CrawlerDouyinMusicTask> list = crawlerDouyinMusicTaskService.list(queryWrapper);
+                    while (list != null) {
+                        log.info("【解析分类】第" + j + "线程正在处理:" + list.size() + "条数据");
+                        for (CrawlerDouyinMusicTask crawlerDouyinMusicTask : list) {
+                            QueryWrapper<MusicInfo> queryWrapper1 = new QueryWrapper<>();
+                            queryWrapper1.eq("ext_id", crawlerDouyinMusicTask.getId()).last(" limit 1");
+                            MusicInfo musicInfo = musicInfoService.getOne(queryWrapper1);
+                            if (musicInfo != null) {
+                                douyinMusicService.parseTag(musicInfo);
+                            }
+                        }
+                        list = crawlerDouyinMusicTaskService.list(queryWrapper);
+                    }
+                }
+            };
+            thread.start();
+        }
+
+        return "success";
+    }
+
+    @GetMapping(value = "/testdouyinmusic")
+    public String testDouyinMusic() {
+        douyinMusicService.getHotMusicList();
+        return "success";
+    }
 
     @GetMapping(value = "/getDailyDataByProjectId")
     public String getDailyDataByProjectId(Long projectId, String startDate, String endDate) {
@@ -84,7 +217,7 @@ public class TestController {
 
             QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
             userAllocationQueryWrapper.eq("project_id", projectId);
-           // userAllocationQueryWrapper.eq("account_status", 0);
+            // userAllocationQueryWrapper.eq("account_status", 0);
             List<UserAllocation> list = userAllocationService.list(userAllocationQueryWrapper);
             if (!Check.isNull(list)) {
                 for (UserAllocation allocation : list) {
@@ -117,7 +250,7 @@ public class TestController {
 
             QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
             userAllocationQueryWrapper.eq("project_id", projectId);
-           // userAllocationQueryWrapper.eq("account_status", 0);
+            // userAllocationQueryWrapper.eq("account_status", 0);
             List<UserAllocation> list = userAllocationService.list(userAllocationQueryWrapper);
             if (!Check.isNull(list)) {
                 for (UserAllocation allocation : list) {

+ 5 - 8
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UserAllocationController.java

@@ -82,10 +82,8 @@ public class UserAllocationController {
             }
             userAllocations.setAccountStatus(1);
             userAllocations.setProjectId(projectId);
-            userAllocations.setProjectName(project.getProjectName());
             userAllocations.setMediaId(project.getMediaId());
             userAllocations.setAdvertiserId(project.getAdvertiserId());
-            userAllocations.setAdvertiserName(project.getAdvertiserName());
             userAllocationService.save(userAllocations);
             QueryWrapper<ProjectMember> memberQueryWrapper = new QueryWrapper<>();
             memberQueryWrapper.eq("user_id", userAllocations.getUserId());
@@ -274,11 +272,10 @@ public class UserAllocationController {
             ProjectMember member = memberMapper.selectOne(memberQueryWrapper);
             if (Check.isNull(member)) {
                 ProjectMember addMember = new ProjectMember();
-                addMember.setProjectId(update.getProjectId());
-                addMember.setProjectName(update.getProjectName());
-                addMember.setUserId(update.getUserId());
-                addMember.setUserName(update.getUserName());
-                String roleCode = sysRoleService.getRoleCodeByUserId(update.getUserId());
+                addMember.setProjectId(userAllocation.getProjectId());
+                addMember.setUserId(userAllocation.getUserId());
+                addMember.setUserName(userAllocation.getUserName());
+                String roleCode = sysRoleService.getRoleCodeByUserId(userAllocation.getUserId());
                 if (!Check.isNull(roleCode)) {
                     addMember.setRoleCode(roleCode);
                 }
@@ -362,7 +359,7 @@ public class UserAllocationController {
     public Result<List<UserAllocation>> selectAccountListByProjectId(Long projectId) {
         Result<List<UserAllocation>> result = new Result<>();
         try {
-            List<UserAllocation> userAllocations = userAllocationService.getByParams(projectId,null,null);
+            List<UserAllocation> userAllocations = userAllocationService.getByParams(projectId, null, null);
             result.setSuccess(true);
             result.setResult(userAllocations);
         } catch (Exception e) {

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

@@ -1,126 +0,0 @@
-package org.jeecg.modules.ctop.entity;
-
-import cn.com.ctop.common.module.annotation.Dict;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
-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;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.util.Date;
-
-/**
- * 广告主信息表
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2019-06-11
- */
-@Data
-@TableName("ctop_advertiser")
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-@ApiModel(value = "ctop_advertiser对象", description = "广告主信息表")
-public class Advertiser {
-
-    /**
-     * 主键ID
-     */
-    @TableId(type = IdType.UUID)
-    @ApiModelProperty(value = "主键ID")
-    private String id;
-    /**
-     * 广告主名称
-     */
-    @Excel(name = "广告主名称", width = 15)
-    @ApiModelProperty(value = "广告主名称")
-    private String name;
-    /**
-     * 行业ID
-     */
-    @Excel(name = "行业ID", width = 15)
-    @ApiModelProperty(value = "行业ID")
-    @Dict(dicCode = "id",dictTable="sys_category",dicText="name")
-    private String industryId;
-    private String industryCode;
-    /**
-     * 销售ID
-     */
-    @Excel(name = "销售ID", width = 15)
-    @ApiModelProperty(value = "销售ID")
-    @Dict(dicCode = "id",dictTable="sys_user",dicText="realname")
-    private String saleId;
-    /**
-     * 销售ID
-     */
-    @Excel(name = "广告主类别", width = 15)
-    @ApiModelProperty(value = "广告主类别")
-    private Integer advertiserType;
-
-    /**
-     * 代理商Id
-     */
-    private Long agentId;
-
-    /**
-     * 联系人姓名
-     */
-    @Excel(name = "联系人姓名", width = 15)
-    @ApiModelProperty(value = "联系人姓名")
-    private String contact;
-    /**
-     * 联系人手机
-     */
-    @Excel(name = "联系人手机", width = 15)
-    @ApiModelProperty(value = "联系人手机")
-    private String mobile;
-    /**
-     * 联系人邮箱
-     */
-    @Excel(name = "联系人邮箱", width = 15)
-    @ApiModelProperty(value = "联系人邮箱")
-    private String email;
-    /**
-     * 创建人
-     */
-    @Excel(name = "创建人", width = 15)
-    @ApiModelProperty(value = "创建人")
-    private String createBy;
-    /**
-     * 创建时间
-     */
-    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @ApiModelProperty(value = "创建时间")
-    private Date createTime;
-    /**
-     * 修改人
-     */
-    @Excel(name = "修改人", width = 15)
-    @ApiModelProperty(value = "修改人")
-    private String updateBy;
-    /**
-     * 修改时间
-     */
-    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @ApiModelProperty(value = "修改时间")
-    private Date updateTime;
-    private String userId;
-
-    private String companyId;
-
-    @TableField(exist = false)
-    private String saleName;
-
-
-}

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

@@ -28,7 +28,7 @@ import java.util.Date;
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
 @ApiModel(value = "ctop_project_member对象", description = "项目成员")
-public class ProjectMember implements  Serializable{
+public class ProjectMember implements Serializable {
 
     /**
      * id
@@ -47,6 +47,8 @@ public class ProjectMember implements  Serializable{
     @Excel(name = "项目名称", width = 15)
     @ApiModelProperty(value = "项目名称")
     private String projectName;
+
+
     /**
      * 成员id
      */
@@ -73,6 +75,7 @@ public class ProjectMember implements  Serializable{
 
     @TableField(exist = false)
     private String advertiserName;
+
     @TableField(exist = false)
     private String advertiserId;
 
@@ -86,6 +89,12 @@ public class ProjectMember implements  Serializable{
     @TableField(exist = false)
     private String saleName;
 
+    @TableField(exist = false)
+    private Long productId;
+
+    @TableField(exist = false)
+    private String productName;
+
 
     /**
      * 创建时间

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

@@ -1,9 +1,9 @@
 package org.jeecg.modules.ctop.mapper;
 
+import cn.com.ctop.common.module.entity.Advertiser;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
-import org.jeecg.modules.ctop.entity.Advertiser;
 import org.jeecg.modules.excelutil.entity.KuaishouXxlEntity;
 import org.jeecg.modules.excelutil.entity.YdPlanAggregateEntity;
 import org.jeecg.modules.excelutil.entity.YdWeekAggregateEntity;
@@ -13,7 +13,7 @@ import java.util.List;
 /**
  * @Description: 广告主信息表
  * @Author: jeecg-boot
- * @Date:   2019-06-11
+ * @Date: 2019-06-11
  * @Version: V1.0
  */
 public interface AdvertiserMapper extends BaseMapper<Advertiser> {

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

@@ -12,22 +12,26 @@
     <!-- 设计师展示所有自己的角色下制作的视频 -->
     <select id="adminProjects" resultType="org.jeecg.modules.ctop.entity.ProjectMember">
         select
-        id as projectId,
-        project_name as projectName,
-        advertiser_id as advertiserId,
-        advertiser_name as advertiserName,
-        media_id as mediaId,
-        max_bid as maxBid,
-        advertiser_name as advertiserName ,
-        responsible_name as responsibleName
+        t1.id as projectId,
+        t1.project_name as projectName,
+        t1.advertiser_id as advertiserId,
+        (
+        select name from ctop_advertiser where  id = t1.advertiser_id
+        )
+         as advertiserName,
+        t1.media_id as mediaId,
+        t1.max_bid as maxBid,
+
+        t1.responsible_name as responsibleName
         from
-        ctop_project
+        ctop_project t1
         where
         media_id in
         <foreach collection="mediaIds" item="item" separator=","
                  open="(" close=")">
             #{item}
         </foreach>
+        order by create_time desc
     </select>
 
     <!-- 视频报表设计师leader展示自己所在公司的所有项目 -->
@@ -110,7 +114,10 @@
         distinct b.project_id as projectId,
         b.project_name as projectName,
         a.advertiser_id as advertiserId,
-        a.advertiser_name as advertiserName,
+        (
+        select name from ctop_advertiser where  id = a.advertiser_id
+        )
+        as advertiserName,
         (SELECT media_id from ctop_project c where c.id=a.project_id limit 1) as mediaId
         from
         ctop_user_allocation a
@@ -121,6 +128,7 @@
                  open="(" close=")">
             #{item}
         </foreach>
+        order by b.create_time desc
     </select>
 
     <select id="getSaleProjects" resultType="org.jeecg.modules.ctop.entity.ProjectMember">

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

@@ -1,9 +1,9 @@
 package org.jeecg.modules.ctop.service;
 
+import cn.com.ctop.common.module.entity.Advertiser;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.vo.SheetInfoVo;
 import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.modules.ctop.entity.Advertiser;
 
 import java.text.ParseException;
 import java.util.List;
@@ -11,7 +11,7 @@ import java.util.List;
 /**
  * @Description: 广告主信息表
  * @Author: jeecg-boot
- * @Date:   2019-06-11
+ * @Date: 2019-06-11
  * @Version: V1.0
  */
 public interface IAdvertiserService extends IService<Advertiser> {

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

@@ -1,12 +1,12 @@
 package org.jeecg.modules.ctop.service.impl;
 
+import cn.com.ctop.common.module.entity.Advertiser;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.vo.SheetInfoVo;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.jeecg.common.util.DateUtils;
-import org.jeecg.modules.ctop.entity.Advertiser;
 import org.jeecg.modules.ctop.mapper.AdvertiserMapper;
 import org.jeecg.modules.ctop.service.IAdvertiserService;
 import org.jeecg.modules.excelutil.entity.KuaishouXxlEntity;
@@ -26,7 +26,7 @@ import java.util.stream.Collectors;
 /**
  * @Description: 广告主信息表
  * @Author: jeecg-boot
- * @Date:   2019-06-11
+ * @Date: 2019-06-11
  * @Version: V1.0
  */
 @Service
@@ -34,6 +34,7 @@ public class AdvertiserServiceImpl extends ServiceImpl<AdvertiserMapper, Adverti
 
     @Autowired
     private AdvertiserMapper advertiserMapper;
+
     @Override
     public List<Advertiser> getBySaleId(String saleId) {
         QueryWrapper<Advertiser> queryWrapper = new QueryWrapper<>();
@@ -62,10 +63,10 @@ public class AdvertiserServiceImpl extends ServiceImpl<AdvertiserMapper, Adverti
 
     @Override
     public List<SheetInfoVo> getSystemTypeXxlStatisticInfo(Long projectId) {
-        List<SheetInfoVo>vos = new ArrayList<>();
-        SheetInfoVo android = getXxlStatisticInfo(projectId,"android",null,"android汇总表");
+        List<SheetInfoVo> vos = new ArrayList<>();
+        SheetInfoVo android = getXxlStatisticInfo(projectId, "android", null, "android汇总表");
         vos.add(android);
-        SheetInfoVo ios = getXxlStatisticInfo(projectId,"ios",null,"ios汇总表");
+        SheetInfoVo ios = getXxlStatisticInfo(projectId, "ios", null, "ios汇总表");
         vos.add(ios);
         return vos;
     }
@@ -115,7 +116,7 @@ public class AdvertiserServiceImpl extends ServiceImpl<AdvertiserMapper, Adverti
 
     private List<YdPlanAggregateEntity> getYdPlanStatisticInfo(Long projectId, String startDate, String endDate) {
         List<YdPlanAggregateEntity> result = new ArrayList<>();
-        List<UserAllocation> allocations = userAllocationService.getByParams(projectId, null,null);
+        List<UserAllocation> allocations = userAllocationService.getByParams(projectId, null, null);
         if (null != allocations && !allocations.isEmpty()) {
             allocations.forEach(allocation -> {
                 List<YdPlanAggregateEntity> plans = statisticWeekInfoByAccount(allocation, startDate, endDate);

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

@@ -1,12 +1,13 @@
 package org.jeecg.modules.ctop.service.impl;
 
+import cn.com.ctop.common.module.entity.Advertiser;
 import cn.com.ctop.common.module.entity.SysUser;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.performanceappraisal.service.IPerformanceService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
-import org.jeecg.modules.ctop.entity.Advertiser;
+
 import org.jeecg.modules.ctop.service.IAdvertiserService;
 import org.jeecg.modules.ctop.service.IPerformanceSaleService;
 import org.jeecg.modules.performance.entity.SalePerformanceDetail;
@@ -127,7 +128,7 @@ public class PerformanceSaleServiceImpl implements IPerformanceSaleService {
         detail.setQuarter(quarter);
         detail.setStartDate(startDate);
         detail.setEndDate(endDate);
-        detail.setExtensionSelf(advertiser.getAdvertiserType());
+     //   detail.setExtensionSelf(advertiser.getAdvertiserType());
         detail.setBrandNew(brandNew);
         if (user.getOrgCode().startsWith(CtopAdConstant.HB_BYTEDANCE_SALE_ORG_CODE)) {
             detail.setMediaType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);

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

@@ -56,7 +56,7 @@ public class ProjectTransferRecordServiceImpl extends ServiceImpl<ProjectTransfe
             SysUser user = sysUserService.getById(record.getUserId());
             Project project = projectService.getById(record.getTargetProject());
             userAllocation.setProjectId(project.getId());
-            userAllocation.setProjectName(project.getProjectName());
+       //     userAllocation.setProjectName(project.getProjectName());
             userAllocationService.updateById(userAllocation);
             ProjectMember member = projectMemberService.getProjectByParams(record.getTargetProject(),record.getUserId());
             if(null == member){

+ 3 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/performance/service/impl/SalePerformanceDetailServiceImpl.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.performance.service.impl;
 
+import cn.com.ctop.common.module.entity.Advertiser;
 import cn.com.ctop.common.module.entity.SysUser;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
@@ -8,7 +9,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
-import org.jeecg.modules.ctop.entity.Advertiser;
+
 import org.jeecg.modules.ctop.service.IAdvertiserService;
 import org.jeecg.modules.performance.constants.RateConstant;
 import org.jeecg.modules.performance.entity.SalePerformanceDetail;
@@ -137,7 +138,7 @@ public class SalePerformanceDetailServiceImpl extends ServiceImpl<SalePerformanc
         detail.setQuarter(quarter);
         detail.setStartDate(startDate);
         detail.setEndDate(endDate);
-        detail.setExtensionSelf(advertiser.getAdvertiserType());
+     //   detail.setExtensionSelf(advertiser.getAdvertiserType());
         detail.setBrandNew(brandNew);
         if (null != user.getOrgCode()) {
             if (user.getOrgCode().startsWith(CtopAdConstant.HB_BYTEDANCE_SALE_ORG_CODE)) {

+ 20 - 20
jeecg-boot-module-system/src/main/resources/application-dev.yml

@@ -10,28 +10,28 @@ server:
     mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
 
 management:
- endpoints:
-  web:
-   exposure:
-    include: metrics,httptrace
+  endpoints:
+    web:
+      exposure:
+        include: metrics,httptrace
 
 spring:
   servlet:
-     multipart:
-        max-file-size: 10MB
-        max-request-size: 10MB
+    multipart:
+      max-file-size: 10MB
+      max-request-size: 10MB
   mail:
-      host: smtp.exmail.qq.com
-      username: notice@c-top.com.cn
-      password: Hcst@2019
-      properties:
-        mail:
-          smtp:
-            ssl.enable: enable
-            auth: true
-            starttls:
-              enable: true
-              required: true
+    host: smtp.exmail.qq.com
+    username: notice@c-top.com.cn
+    password: Hcst@2019
+    properties:
+      mail:
+        smtp:
+          ssl.enable: enable
+          auth: true
+          starttls:
+            enable: true
+            required: true
   ## quartz定时任务,采用数据库方式
   quartz:
     job-store-type: jdbc
@@ -132,9 +132,9 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url: jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          url: jdbc:mysql://139.186.31.213:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true
           username: hcst
-          password: test@20190531
+          password: hcst2020
           driver-class-name: com.mysql.jdbc.Driver
           # 多数据源配置
           #multi-datasource1:

+ 2 - 2
jeecg-boot-module-system/src/main/resources/application-test.yml

@@ -94,9 +94,9 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url: jdbc:mysql://139.186.27.96/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          url: jdbc:mysql://139.186.31.213:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true
           username: hcst
-          password: test@20190531
+          password: hcst2020
           driver-class-name: com.mysql.jdbc.Driver
   #redis 配置
   redis:

+ 3 - 3
jeecg-boot-module-system/src/main/resources/jeecg/jeecg_database.properties

@@ -1,8 +1,8 @@
 #mysql
 diver_name=com.mysql.jdbc.Driver
-url=jdbc:mysql://139.186.27.96:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-username=hcst
-password=test@20190531
+url=jdbc:mysql://127.0.0.1:3306/jeecg-boot?useUnicode=true&characterEncoding=UTF-8
+username=root
+password=123456
 database_name=jeecg-boot
 #oracle
 #diver_name=oracle.jdbc.driver.OracleDriver

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

@@ -5,25 +5,29 @@ import cn.com.ctop.check.entity.CtopCheckTaskList;
 import cn.com.ctop.check.service.ICtopCheckTaskListService;
 import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.entity.UReportSubscriber;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.message.handle.impl.EmailSendMsgHandle;
 import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.crawler.modules.core.service.IKuaishouCrawlerService;
-import cn.com.ctop.crawler.modules.music.entity.MusicInfoKuaishou;
-import cn.com.ctop.crawler.modules.music.entity.MusicKuaishouType;
-import cn.com.ctop.crawler.modules.music.service.IMusicInfoKuaishouService;
-import cn.com.ctop.crawler.modules.music.service.IMusicKuaishouTypeService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
 import cn.com.ctop.toutiao.modules.material.entity.ByteDanceAdvertisePlan;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertisePlanService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceCreativeService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
+import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
+import cn.com.ctop.oa.modules.service.IWechatDepartmentService;
+import cn.com.ctop.oa.modules.service.IWechatUserListService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import cn.com.ctop.toutiao.modules.report.service.IReportService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.junit.Test;
@@ -33,10 +37,12 @@ import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
+import java.io.File;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -55,6 +61,11 @@ public class SampleTest {
     @Autowired
     private IUserAllocationService userAllocationService;
     @Autowired
+    private IByteDanceAdvertiserDataService advertiserDataService;
+    @Autowired
+    private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
+    @Autowired
+    private IKuaiShouDailyReportTaskService dailyReportTaskService;
     private IBytedanceReportService bytedanceReportService;
     @Test
     public void loadBytedanceMatData(){
@@ -97,68 +108,55 @@ public class SampleTest {
         String tokenInfo = "surl_token="+token;
         String appType = plan.getAppType();
 
-        if(null!=downloadUrl){
-            if(null!=appType&&appType.equals("APP_IOS")){
-                if(!downloadUrl.equals("https://apps.apple.com/cn/app/id1468454200")){
-                    errorMsg+= "应用下载链接填写异常;";
-                    errorflag = true;
-                }
-            }
-            if(null!=appType&&appType.equals("APP_ANDROID")){
-                if(!downloadUrl.contains(token)){
-                    errorMsg+= "应用下载链接填写异常;";
-                    errorflag = true;
-                }
-            }
-        }
-        //展示监测链接
-        String trackUrl = data.getString("trackUrl");
-        if(null!=trackUrl&&!trackUrl.trim().equals("")){
-            if(!trackUrl.contains(tokenInfo)){
-                errorMsg+= "展示监测链接填写异常;";
-                errorflag = true;
-            }
-        }
-        //点击监测链接
-        String actionTrackUrl = data.getString("actionTrackUrl");
-        if(null!=actionTrackUrl&&!actionTrackUrl.trim().equals("")){
-            if(null!=appType&&appType.equals("APP_IOS")){
-                if(!actionTrackUrl.contains(tokenInfo)||!actionTrackUrl.contains("app_platform=ios")){
-                    errorMsg+= "点击监测链接填写异常;";
-                    errorflag = true;
-                }
-            }
-            if(null!=appType&&appType.equals("APP_ANDROID")){
-                if(!actionTrackUrl.contains(tokenInfo)||!actionTrackUrl.contains("tt/1967")){
-                    errorMsg+= "点击监测链接填写异常;";
-                    errorflag = true;
-                }
-            }
-        }
-        //视频有效播放监测链接
-        String videoPlayEffectiveTrackUrl = data.getString("videoPlayEffectiveTrackUrl");
-        if(null!=videoPlayEffectiveTrackUrl&&!videoPlayEffectiveTrackUrl.trim().equals("")){
-            if(!videoPlayEffectiveTrackUrl.contains(tokenInfo)){
-                errorMsg+= "视频有效播放监测链接填写异常;";
-                errorflag = true;
-            }
-        }
-        if(errorflag){
-            sendMessage(allocation,"警告:账户:"+allocation.getAuthName()+"(id:"+allocation.getAccountId()+")下的广告计划:"+plan.getName()+"(id:"+plan.getId()+")"+"监测链接异常>>"+errorMsg);
-        }
-    }
-    private void sendMessage(UserAllocation allocation, String errorMsg) {
-        sendMessageService.sendMessage(allocation.getUserId(),errorMsg);
-    }
-
     @Autowired
-    private IUserAllocationService allocationService;
+    private IWechatDepartmentService wechatDepartment;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
     @Autowired
-    private IByteDanceAdvertisePlanService advertisePlanService;
+    private IWechatUserListService wechatUserInfoService;
     @Autowired
-    private IByteDanceCreativeService creativeService;
+    private IWechatCheckinDataService wechatCheckinDataService;
     @Autowired
-    private ISendMessageService sendMessageService;
+    private ICtopOauthTokenService tokenService;
+
+
+    @Test
+    public void getDepartment() throws ParseException {
+        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date parse1 = simpleDateFormat.parse("2020-09-12");
+        Date parse2 = simpleDateFormat.parse("2020-09-17");
+        for (CtopOauthToken token : tokens) {
+
+            kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, parse1, parse2);
+
+        }
+
+    //    wechatCheckinDataService.getCheckinData();
+        //  wechatUserInfoService.getUserList();
+        // wechatDepartment.getDepartment();
+        // kuaishouInterfaceService.getSuZaoList("a34853c230e1b949eddbe569023dbc40", 7022550L, 1, "2020-09-15", "2020-09-16");
+
+    }
+
+
+    @Test
+    public void loadBytedanceCreativeData() {
+        QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("media_id", 2);
+        List<CtopOauthToken> list = oauthTokenService.list(queryWrapper);
+         for (CtopOauthToken token : list) {
+        kuaiShouHistoryReportTaskService.createTask(token.getAccountId(), token.getAccessToken(), "2020-09-20", "2020-09-20", "daily");
+
+         }
+
+    }
+
+    @Test
+    public void getTaskList() {
+        kuaiShouHistoryReportTaskService.getTaskList();
+    }
+
 
     @Autowired
     private IBindAccountLoginService bindAccountLoginService;
@@ -183,7 +181,7 @@ public class SampleTest {
     }
 
     static ExecutorService executorService = null;
-    //线程计数器
+    //线程计数器/bytedance/bytedanceMaterialReport
     static CountDownLatch countDownLatch = null;
 
     @Test
@@ -212,6 +210,9 @@ public class SampleTest {
         }
     }
 
+    @Autowired
+    private IUserAllocationService allocationService;
+
     @Test
     public void testLoadBytedanceData() {
         List<UserAllocation> allocations = allocationService.getByParams(430L, null, 0);
@@ -227,13 +228,18 @@ public class SampleTest {
     @Test
     public void loadKuaishouAgentData() {
         kuaishouReportDailyAgentService.loginAgent();
-        try {
-            for (int i = 1; i < 30; i++) {
-                kuaishouReportDailyAgentService.getAccount(i);
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
+        for (int i = 0; i < 20; i++) {
+            String currentDate = DateUtils.formatDate(DateUtils.addDay(new Date(), -i));
+            kuaishouReportDailyAgentService.getReport(currentDate, DateUtils.getNowDate("yyyy-MM-dd"));
         }
+//
+//        try {
+//            for (int i = 1; i < 30; i++) {
+//                kuaishouReportDailyAgentService.getAccount(i);
+//            }
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
     }
 
     @Autowired
@@ -275,38 +281,28 @@ public class SampleTest {
     @Autowired
     IUReportService uReportService;
 
-    @Autowired
-    private IKuaishouCrawlerService crawlerService;
-    @Autowired
-    private IMusicKuaishouTypeService musicKuaishouTypeService;
     @Test
-    public void loadKuaishouMusicInfo(){
-        String musicType = crawlerService.getMusicTypeList("");
-        String llsid = JSONObject.parseObject(musicType).getString("llsid");
-        QueryWrapper<MusicKuaishouType>queryWrapper = new QueryWrapper<>();
-        queryWrapper.orderByDesc("id");
-        List<MusicKuaishouType>musicKuaishouTypes = musicKuaishouTypeService.list(queryWrapper);
-        if(null!=musicKuaishouTypes){
-            for (MusicKuaishouType type:musicKuaishouTypes) {
-                loadMusicList(type,llsid);
+    public void sendUReport() {
+        uReportService.uReportList().forEach(uReport -> {
+            List<UReportSubscriber> uReportSubscriber = uReportService.getUReportSubscriberByFileId(uReport.getString("id"));
+            if (!uReportSubscriber.isEmpty()) {
+                String title = uReport.getString("name").replace(".ureport.xml", "");
+                String content = "您订阅的日报在附件中请注意查收》》》";
+                //下载文件到本地
+                uReportExportService.exportExcel(uReport.getString("name"));
+                uReportSubscriber.forEach(sender -> {
+                    emailSendMsgHandle.SendAttachment("bijiequan@c-top.com.cn", title, content,
+                            new File(System.getProperty("user.dir") + File.separator + "uReport" + File.separator + uReport.getString("name").replace("ureport.xml", "") + "xlsx"));
+                });
             }
-        }
-    }
-
-    public void loadMusicList(MusicKuaishouType musicKuaishouType,String llsid){
-        String musicTypeString = crawlerService.getMusicList(musicKuaishouType.getId()+"",llsid);
-        System.out.println(musicTypeString);
-        JSONArray musicList = JSONObject.parseObject(musicTypeString).getJSONArray("music");
-        String getLlsid = JSONObject.parseObject(musicTypeString).getString("llsid");
-        if(null!=musicList&&!musicList.isEmpty()){
-            for(int i=0;i<musicList.size();i++){
-                JSONObject music = musicList.getJSONObject(i);
-                MusicInfoKuaishou musicInfoKuaishou = new MusicInfoKuaishou(music,musicKuaishouType.getId());
-                musicInfoKuaishouService.saveOrUpdate(musicInfoKuaishou);
+        });
+        //发完全部订阅,删除文件
+        File file = new File(System.getProperty("user.dir") + File.separator + "uReport");
+        File[] files = file.listFiles();
+        if (files != null && files.length > 0) {
+            for (File f : files) {
+                f.delete();
             }
-//            loadMusicList(musicKuaishouType,getLlsid);
         }
     }
-    @Autowired
-    private IMusicInfoKuaishouService musicInfoKuaishouService;
 }

+ 295 - 0
module-common/src/main/java/cn/com/ctop/common/module/controller/ProductController.java

@@ -0,0 +1,295 @@
+package cn.com.ctop.common.module.controller;
+
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.entity.Product;
+import cn.com.ctop.common.module.entity.Project;
+import cn.com.ctop.common.module.mapper.ProjectMapper;
+import cn.com.ctop.common.module.service.IProductService;
+import cn.com.ctop.common.module.service.IUserAllocationService;
+import cn.com.ctop.common.module.utils.Check;
+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.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 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.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 产品表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-08
+ */
+@Slf4j
+@Api(tags = "产品表")
+@RestController
+@RequestMapping("/ctop/product")
+public class ProductController {
+    @Autowired
+    private IProductService productService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param product
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "产品表-分页列表查询")
+    @ApiOperation(value = "产品表-分页列表查询", notes = "产品表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<Product>> queryPageList(Product product,
+                                                @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                HttpServletRequest req) {
+        Result<IPage<Product>> result = new Result<>();
+        String productName = product.getProductName();
+        product.setProductName(null);
+        QueryWrapper<Product> queryWrapper = QueryGenerator.initQueryWrapper(product, req.getParameterMap());
+        if (!Check.isNull(productName)) {
+            queryWrapper.like("product_name", productName);
+        }
+        Page<Product> page = new Page<>(pageNo, pageSize);
+        IPage<Product> pageList = productService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+
+    @AutoLog(value = "产品表-分页列表查询")
+    @ApiOperation(value = "产品表-分页列表查询", notes = "产品表-分页列表查询")
+    @GetMapping(value = "/productList")
+    public Result<List<Product>> productList(Product product,
+                                             HttpServletRequest req) {
+        Result<List<Product>> result = new Result<>();
+        QueryWrapper<Product> queryWrapper = QueryGenerator.initQueryWrapper(product, req.getParameterMap());
+        List<Product> list = productService.list(queryWrapper);
+        result.setSuccess(true);
+        result.setResult(list);
+        return result;
+    }
+
+
+    /**
+     * 添加
+     *
+     * @param product
+     * @return
+     */
+    @AutoLog(value = "产品表-添加")
+    @ApiOperation(value = "产品表-添加", notes = "产品表-添加")
+    @PostMapping(value = "/add")
+    public Result<Product> add(@RequestBody Product product) {
+        Result<Product> result = new Result<>();
+        try {
+            productService.save(product);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param product
+     * @return
+     */
+    @AutoLog(value = "产品表-编辑")
+    @ApiOperation(value = "产品表-编辑", notes = "产品表-编辑")
+    @PostMapping(value = "/edit")
+    public Result<Product> edit(@RequestBody Product product) {
+        Result<Product> result = new Result<Product>();
+        Product productEntity = productService.getById(product.getId());
+        if (productEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = productService.updateById(product);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @Autowired
+    private ProjectMapper projectMapper;
+    @Autowired
+    private ProjectMapper projectMemberMapper;
+    @Autowired
+    private IUserAllocationService userAllocationService;
+
+    @AutoLog(value = "产品表-通过id删除")
+    @ApiOperation(value = "产品表-通过id删除", notes = "产品表-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            productService.removeById(id);
+            QueryWrapper<Project> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("product_id", id);
+            List<Project> projects = projectMapper.selectList(queryWrapper);
+            if (!Check.isNull(projects)) {
+                for (Project project : projects) {
+                    Map<String, Object> map = new HashMap<>();
+                    map.put("project_id", project.getId());
+                    projectMemberMapper.deleteByMap(map);
+                    userAllocationService.removeByMap(map);
+                }
+            }
+            Map<String, Object> deleteProjectMap = new HashMap<>();
+            deleteProjectMap.put("product_id", id);
+            projectMapper.deleteByMap(deleteProjectMap);
+
+        } 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<Product> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<Product> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.productService.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<Product> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<Product> result = new Result<>();
+        Product product = productService.getById(id);
+        if (product == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(product);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<Product> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                Product product = JSON.parseObject(deString, Product.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(product, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<Product> pageList = productService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "产品表列表");
+        mv.addObject(NormalExcelConstants.CLASS, Product.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<Product> listProducts = ExcelImportUtil.importExcel(file.getInputStream(), Product.class, params);
+                productService.saveBatch(listProducts);
+                return Result.ok("文件导入成功!数据行数:" + listProducts.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("文件导入失败!");
+    }
+
+}

+ 1 - 31
module-common/src/main/java/cn/com/ctop/common/module/entity/Advertiser.java

@@ -1,8 +1,6 @@
 package cn.com.ctop.common.module.entity;
 
-import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -42,32 +40,6 @@ public class Advertiser {
     @Excel(name = "广告主名称", width = 15)
     @ApiModelProperty(value = "广告主名称")
     private String name;
-    /**
-     * 行业ID
-     */
-    @Excel(name = "行业ID", width = 15)
-    @ApiModelProperty(value = "行业ID")
-    @Dict(dicCode = "id",dictTable="sys_category",dicText="name")
-    private String industryId;
-    private String industryCode;
-    /**
-     * 销售ID
-     */
-    @Excel(name = "销售ID", width = 15)
-    @ApiModelProperty(value = "销售ID")
-    @Dict(dicCode = "id",dictTable="sys_user",dicText="realname")
-    private String saleId;
-    /**
-     * 销售ID
-     */
-    @Excel(name = "广告主类别", width = 15)
-    @ApiModelProperty(value = "广告主类别")
-    private Integer advertiserType;
-
-    /**
-     * 代理商Id
-     */
-    private Long agentId;
 
     /**
      * 联系人姓名
@@ -115,12 +87,10 @@ public class Advertiser {
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "修改时间")
     private Date updateTime;
+
     private String userId;
 
     private String companyId;
 
-    @TableField(exist = false)
-    private String saleName;
-
 
 }

+ 22 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/MusicInfo.java

@@ -0,0 +1,22 @@
+package cn.com.ctop.common.module.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+@Data
+@TableName("ctop_music_info")
+public class MusicInfo {
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+    private String name;
+    private String author;
+    private Integer usedCount;
+    private String musicUrl;
+    private String coverUrl;
+    private Integer duration;
+    private String source;
+    private Long extId;
+    private String extInfo;
+}

+ 20 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/MusicType.java

@@ -0,0 +1,20 @@
+package cn.com.ctop.common.module.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+@Data
+@TableName("ctop_music_type")
+public class MusicType {
+    @TableId(value = "id", type = IdType.INPUT)
+    private Long id;
+    private String type;
+    private String typeValue;
+    private String extType;
+    private String extTypeValue;
+    private Long musicId;
+    private String musicName;
+    private String author;
+}

+ 44 - 13
module-common/src/main/java/cn/com/ctop/common/module/entity/Product.java

@@ -1,44 +1,75 @@
 package cn.com.ctop.common.module.entity;
 
+import cn.com.ctop.common.module.annotation.Dict;
+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;
 
 import java.util.Date;
 
 /**
- * 产品
+ * 产品表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-08
  */
 @Data
+@TableName("ctop_product")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_product对象", description = "产品表")
 public class Product {
+
     /**
      * id
      */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
     private Long id;
     /**
-     * 产品名
+     * 产品名
      */
+    @Excel(name = "产品名", width = 15)
+    @ApiModelProperty(value = "产品名")
     private String productName;
     /**
-     * 广告主id
+     * advertiserId
      */
+    @Excel(name = "advertiserId", width = 15)
+    @ApiModelProperty(value = "advertiserId")
+    @Dict(dicCode = "id", dictTable = "ctop_advertiser", dicText = "name")
     private String advertiserId;
-
-    private String advertiserName;
-
     /**
      * 创建人
      */
-    private String createUserId;
+    @Excel(name = "创建人", width = 15)
+    @ApiModelProperty(value = "创建人")
+    @Dict(dicCode = "id", dictTable = "sys_user", dicText = "realname")
+    private String userId;
 
+    @Dict(dicCode = "id", dictTable = "sys_category", dicText = "name")
+    private String industryId;
     /**
-     * 媒体类型
+     * 1正常0删除
      */
-    private String mediaId;
-
+    @Excel(name = "1正常0删除", width = 15)
+    @ApiModelProperty(value = "1正常0删除")
+    private Integer productStatus;
     /**
-     * 创建时间
+     * createTime
      */
+    @ApiModelProperty(value = "createTime")
     private Date createTime;
-
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
     private Date updateTime;
-
 }

+ 15 - 15
module-common/src/main/java/cn/com/ctop/common/module/entity/Project.java

@@ -47,16 +47,15 @@ public class Project {
      */
     @Excel(name = "广告主id", width = 15)
     @ApiModelProperty(value = "广告主id")
+    @Dict(dicCode = "id", dictTable = "ctop_advertiser", dicText = "name")
     private String advertiserId;
 
-    @Excel(name = "广告主名称", width = 15)
-    @ApiModelProperty(value = "广告主名称")
-    private String advertiserName;
 
-    @Dict(dicCode = "id", dictTable = "sys_category", dicText = "name")
-    private String industryId;
-    @Dict(dicCode = "code", dictTable = "sys_category", dicText = "name")
-    private String industryCode;
+    @Excel(name = "产品id", width = 15)
+    @ApiModelProperty(value = "广告主id")
+    @Dict(dicCode = "id", dictTable = "ctop_product", dicText = "product_name")
+    private Long productId;
+
     /**
      * 创建人
      */
@@ -68,21 +67,15 @@ public class Project {
      */
     @Excel(name = "负责人id", width = 15)
     @ApiModelProperty(value = "负责人id")
+    @Dict(dicCode = "id", dictTable = "sys_user", dicText = "realname")
     private String responsibleId;
 
 
-    @Excel(name = "负责人名称", width = 15)
-    @ApiModelProperty(value = "负责人名称")
-    private String responsibleName;
-
     @Excel(name = "设计负责人", width = 15)
     @ApiModelProperty(value = "设计负责人")
+    @Dict(dicCode = "id", dictTable = "sys_user", dicText = "realname")
     private String designResponsibleId;
 
-    @Excel(name = "设计负责人名称", width = 15)
-    @ApiModelProperty(value = "设计负责人名称")
-    private String designResponsibleName;
-
 
     @Excel(name = "公司id", width = 15)
     @ApiModelProperty(value = "公司id")
@@ -135,4 +128,11 @@ public class Project {
     @TableField(exist = false)
     private Integer needExamine;
 
+
+   /* @TableField(exist = false)
+    private String responsibleName; // 运营负责人
+
+
+    private String designResponsibleName; // 产品负责人
+*/
 }

+ 9 - 12
module-common/src/main/java/cn/com/ctop/common/module/entity/UserAllocation.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.common.module.entity;
 
+import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -59,6 +60,7 @@ public class UserAllocation implements Serializable {
      */
     @Excel(name = "广告主ID", width = 15)
     @ApiModelProperty(value = "广告主ID")
+    @Dict(dicCode = "id", dictTable = "ctop_advertiser", dicText = "name")
     private String advertiserId;
 
     private String systemType;
@@ -66,27 +68,16 @@ public class UserAllocation implements Serializable {
     /**
      * 项目id
      */
+    @Dict(dicCode = "id", dictTable = "ctop_project", dicText = "project_name")
     private Long projectId;
 
     /**
-     * 项目名称
-     */
-    private String projectName;
-
-    /**
-     * 广告主名称
-     */
-    @Excel(name = "广告主名称", width = 15)
-    @ApiModelProperty(value = "广告主名称")
-    private String advertiserName;
-    /**
      * 输入账号  --登陆
      */
     @Excel(name = "输入账号  --登陆", width = 15)
     @ApiModelProperty(value = "输入账号  --登陆")
     private String accountName;
 
-
     /**
      * 预警 金额
      */
@@ -135,4 +126,10 @@ public class UserAllocation implements Serializable {
     @ApiModelProperty(value = "平台类型 1 头条 2快手")
     private String mediaId;
 
+   /* @TableField(exist = false)
+    private String advertiserName;
+
+    @TableField(exist = false)
+    private String projectName;*/
+
 }

+ 7 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/MusicInfoMapper.java

@@ -0,0 +1,7 @@
+package cn.com.ctop.common.module.mapper;
+
+import cn.com.ctop.common.module.entity.MusicInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+public interface MusicInfoMapper extends BaseMapper<MusicInfo> {
+}

+ 8 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/MusicTypeMapper.java

@@ -0,0 +1,8 @@
+package cn.com.ctop.common.module.mapper;
+
+import cn.com.ctop.common.module.entity.MusicInfo;
+import cn.com.ctop.common.module.entity.MusicType;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+public interface MusicTypeMapper extends BaseMapper<MusicType> {
+}

+ 8 - 40
module-common/src/main/java/cn/com/ctop/common/module/mapper/ProductMapper.java

@@ -1,49 +1,17 @@
 package cn.com.ctop.common.module.mapper;
 
-import cn.com.ctop.common.module.entity.Advertiser;
 import cn.com.ctop.common.module.entity.Product;
-import cn.com.ctop.common.module.entity.Project;
-import cn.com.ctop.common.module.vo.*;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.List;
-
-
+/**
+ * 产品表
+ *
+ * @author: jeecg-boot
+ * @date: 2020-09-08
+ * @cersion: V1.0
+ */
 public interface ProductMapper extends BaseMapper<Product> {
 
-    Long insertProduct(@Param("product") ProductVO product);
-
-    List<Advertiser> getAdvertiserList();
-
-    List<Project> getProjectListByAdvertiserId(@Param("advertiserId")String advertiserId);
-
-    List<ProductDto> getYunyingListByProjectIds(@Param("projectIds")List<Long> projectIds);
-
-    List<ProductDto> getSaleListByProjectIds(@Param("projectIds")List<Long> projectIds);
-
-    void logicDeleteProductById(@Param("id")Long id);
-
-    void deleteProductProjectMapByProductId(@Param("id")Long ProductId);
-
-    void insertProductProjectMap(@Param("projectIds")List<Long> projectIds, @Param("productId")Long productId);
-
-    Integer getProductNameCount(@Param("productName")String productName);
-
-    void updateProduct(@Param("product")ProductVO product);
-
-    Product getProductInfo(@Param("id")Long id);
-
-    List<ProjectVO> getProjectListByProductId(@Param("productId")Long productId);
-
-    List<Long> getProjectIdsByProductId(@Param("productId")Long productId);
-
-    void deleteByProjectIdAndProductId(@Param("productId")Long productId, @Param("projectId")Long projectId);
-
-    List<ProductVO> getProductList(@Param("advertiserName")String advertiserName, @Param("productName")String productName);
-
-    List<SaleVO> getSalesListByProductId(@Param("productId")Long productId);
-
-    List<UserDto> getYunyingListByProductId(@Param("productId")Long productId);
-
+    String getUserNameByUserId(@Param("userId") String userId);
 }

+ 4 - 224
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/ProductMapper.xml

@@ -2,229 +2,9 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.common.module.mapper.ProductMapper">
 
-    <insert id="insertProduct" useGeneratedKeys="true" keyProperty="id">
-        insert into
-        ctop_product
-        (
-            product_name,
-            media_id,
-            advertiser_id,
-            advertiser_name,
-            create_user_id,
-            product_status
-        )values(
-            #{product.productName},
-            #{product.mediaId},
-            #{product.advertiserId},
-            #{product.advertiserName},
-            #{product.createUserId},
-            1
-        )
-    </insert>
-
-    <select id="getAdvertiserList" resultType="cn.com.ctop.common.module.entity.Advertiser">
-        select
-        id as id,
-        name as name
-        from
-        ctop_advertiser
-    </select>
-
-    <select id="getProjectListByAdvertiserId" resultType="cn.com.ctop.common.module.entity.Project">
-        select
-        id,
-        project_name as projectName,
-        media_id as mediaId
-        from
-        ctop_project
-        where
-        advertiser_id = #{advertiserId}
-        and media_id in (1,2)
-    </select>
-
-    <select id="getYunyingListByProjectIds" resultType="cn.com.ctop.common.module.vo.ProductDto">
-        select
-        distinct user_id as userId,
-        user_name as userName
-        from
-        ctop_user_allocation
-        where
-        project_id in
-        <foreach collection="projectIds" item="item" separator=","
-                 open="(" close=")">
-            #{item}
-        </foreach>
-
-    </select>
-
-    <select id="getSaleListByProjectIds" resultType="cn.com.ctop.common.module.vo.ProductDto">
-        select
-        distinct a.sale_id as saleId,
-        b.realname as saleName
-        from
-        ctop_project a
-        left join sys_user b on a.sale_id = b.id
-        where
-        a.id in
-        <foreach collection="projectIds" item="item" separator=","
-                       open="(" close=")">
-        #{item}
-        </foreach>
-    </select>
-
-    <update id="logicDeleteProductById">
-        update
-        ctop_product
-        set product_status = 0
-        where
-        id = #{id}
-    </update>
-
-    <delete id="deleteProductProjectMapByProductId">
-        delete
-        from
-        ctop_product_project_map
-        where
-        product_id  = #{id}
-    </delete>
-
-    <insert id="insertProductProjectMap">
-        insert into
-        ctop_product_project_map
-        (
-            product_id,
-            project_id
-        )
-        values
-        <foreach collection="projectIds" item="projectId" separator=",">
-            (
-             #{productId},
-             #{projectId}
-            )
-        </foreach>
-    </insert>
-
-    <select id="getProductNameCount" resultType="integer">
-        select
-        count(1)
-        from
-        ctop_product
-        where
-        product_name = #{productName}
-    </select>
-
-    <update id="updateProduct">
-        update
-        ctop_product
-        set
-        product_name = #{product.productName},
-        media_id = #{product.mediaId}
-      <!--  advertiser_id = #{product.advertiserId},
-        advertiser_name = #{product.advertiserName}  -->
-        where
-        id = #{product.id}
-    </update>
-
-    <select id="getProductInfo" resultType="cn.com.ctop.common.module.entity.Product">
-        select
-        id as id,
-        product_name as productName,
-        media_id as mediaId,
-        advertiser_id as advertiserId,
-        advertiser_name as advertiserName,
-        create_user_id as createUserId,
-        product_status as productStatus
-        from
-        ctop_product
-        where
-        id = #{id}
-    </select>
-
-    <select id="getProjectListByProductId" resultType="cn.com.ctop.common.module.vo.ProjectVO">
-        select
-        a.project_id as projectId,
-        b.project_name as projectName
-        from
-        ctop_product_project_map a
-        left join ctop_project b on a.project_id = b.id
-        where
-        a.product_id = #{productId}
+    <select id="getUserNameByUserId" resultType="java.lang.String">
+     select  realname  from sys_user
+     where  id = #{userId}
     </select>
 
-    <select id="getProjectIdsByProductId" resultType="Long">
-        select
-        a.project_id as projectId
-        from
-        ctop_product_project_map a
-        left join ctop_project b on a.project_id = b.id
-        where
-        a.product_id = #{productId}
-    </select>
-
-
-
-
-    <select id="deleteByProjectIdAndProductId">
-        delete
-        from
-        ctop_product_project_map
-        where
-        project_id = #{projectId}
-        and
-        product_id = #{productId}
-    </select>
-
-    <select id="getProductList" resultType="cn.com.ctop.common.module.vo.ProductVO">
-            select
-            id as id,
-            product_name as productName,
-            media_id as mediaId,
-            advertiser_id as advertiserId,
-            advertiser_name as advertiserName,
-            create_user_id as createUserId,
-            product_status as productStatus
-        from
-        ctop_product
-        where
-        product_status = 1 and
-        <if test="advertiserName != null and advertiserName != '' ">
-            advertiser_name like concat('%', #{advertiserName},'%') and
-        </if>
-        <if test="productName != null and productName != '' ">
-            product_name like concat('%', #{productName}, '%') and
-        </if>
-        1=1
-    </select>
-
-    <select id="getSalesListByProductId" resultType="cn.com.ctop.common.module.vo.SaleVO">
-        select
-        distinct b.sale_id as saleId,
-        c.realname as saleName
-        from
-        ctop_product_project_map a
-        left join (select id,project_name,sale_id from ctop_project) b on a.project_id = b.id
-        left join sys_user c on b.sale_id = c.id
-        where
-        product_id = #{productId}
-    </select>
-
-    <select id="getYunyingListByProductId" resultType="cn.com.ctop.common.module.vo.UserDto">
-        select
-        distinct user_id as userId,
-        user_name as realname
-        from
-        ctop_user_allocation a
-        where
-        project_id in (
-        select project_id
-        from
-        ctop_product_project_map
-        where product_id = #{productId}
-        )
-
-    </select>
-
-
-
-
-</mapper>
+</mapper>

+ 5 - 38
module-common/src/main/java/cn/com/ctop/common/module/service/IProductService.java

@@ -1,48 +1,15 @@
 package cn.com.ctop.common.module.service;
 
-import cn.com.ctop.common.module.entity.Advertiser;
 import cn.com.ctop.common.module.entity.Product;
-import cn.com.ctop.common.module.entity.Project;
-import cn.com.ctop.common.module.vo.ProductVO;
-import cn.com.ctop.common.module.vo.ProjectVO;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.github.pagehelper.PageInfo;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-import java.util.Map;
 
 /**
- * 项目
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2019-11-19
+ * @Description: 产品表
+ * @Author: jeecg-boot
+ * @Date: 2020-09-08
+ * @Version: V1.0
  */
 public interface IProductService extends IService<Product> {
 
-    List<Advertiser> advertiserList();
-
-    List<Project> getProjectListByAdvertiserId(String advertiserId);
-
-    Map<String,Object> getSaleAndYunyingListByProjectIds(List<Long> projectIds);
-
-    void deleteProduct(Long id);
-
-    void insertOrUpdateProduct(ProductVO product);
-
-    Integer getProductNameCount(String productName);
-
-    void insertProductProjectMap(Long productId, List<Long> projectIds);
-
-    Map<String, Object> getProductInfo(Long productId);
-
-    void deleteByProjectIdAndProductId(Long projectId, Long productId);
-
-    List<ProjectVO> getProjectListByProductId(Long productId);
-
-    PageInfo<ProductVO> getProductList(String advertiserName, String productName, Integer pageNum, Integer pageSize);
-
-    List<Long> getProjectIdsByProductId(Long productId);
-
+    String getUserNameByUserId(String userId);
 }

+ 7 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/MusicInfoService.java

@@ -0,0 +1,7 @@
+package cn.com.ctop.common.module.service;
+
+import cn.com.ctop.common.module.entity.MusicInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+public interface MusicInfoService extends IService<MusicInfo> {
+}

+ 8 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/MusicTypeService.java

@@ -0,0 +1,8 @@
+package cn.com.ctop.common.module.service;
+
+import cn.com.ctop.common.module.entity.MusicInfo;
+import cn.com.ctop.common.module.entity.MusicType;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+public interface MusicTypeService extends IService<MusicType> {
+}

+ 1 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/BindAccountAuthServiceImpl.java

@@ -92,6 +92,7 @@ public class BindAccountAuthServiceImpl extends ServiceImpl<BindAccountAuthMappe
                 .append(BytedanceInterfaceConstant.AUTH_PATH)
                 .append("?app_id=" + PropertiesUtils.getValue("bytedance_config", "bytedance_appid"))
                 .append("&state=" + URLEncoder.encode(state))
+                .append("&material_auth=1")
                 .append("&redirect_uri=" + URLEncoder.encode(PropertiesUtils.getValue("bytedance_config", "bytedance_callback_url"), "UTF-8"));
         return sb.toString();
     }

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

@@ -2,6 +2,7 @@ package cn.com.ctop.common.module.service.impl;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.entity.FileInfo;
+import cn.com.ctop.common.module.entity.Project;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.FileInfoMapper;
 import cn.com.ctop.common.module.service.*;
@@ -60,6 +61,8 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
     private IMessageTemplate messageTemplate;
     @Autowired
     private ISendMessageService sendMessageService;
+    @Autowired
+    private IProjectService projectService;
 
     @Override
     public void uploadVideoToBytedance(String accountId, String videoUrl, String userId, String materialName) {
@@ -73,11 +76,12 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
                 } else {
                     log.error("头条上传素材失败,返回信息:{},accountId:{}", jsonObject, accountId);
                     UserAllocation allocation = userAllocationService.getByAccountId(Long.valueOf(accountId));
-                    String message = messageTemplate.getMaterialSyncTemplate(allocation.getProjectName(), Long.valueOf(accountId), allocation.getAuthName(), materialName, jsonObject.getString("message"));
+                    Project project = projectService.getById(allocation.getProjectId());
+                    String message = messageTemplate.getMaterialSyncTemplate(project.getProjectName(), Long.valueOf(accountId), allocation.getAuthName(), materialName, jsonObject.getString("message"));
                     sendMessageService.sendMessage(userId, message);
                 }
 
-            }else{
+            } else {
                 log.info("头条上传素材返回结果为空,返回信息:{},accountId:{}", jsonObject, accountId);
             }
 
@@ -137,11 +141,11 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
                 JSONObject getWord = (JSONObject) word;
                 String name = getWord.getString("name");
                 getWord.remove("words");
-                getWord.put("name",name);
+                getWord.put("name", name);
                 getWord.remove("words");
                 getWord.remove("max_word_len");
                 String status = getWord.getString("status");
-                if(null!=status&&status.trim().equals("CREATIVE_WORD_STATUS_APPROVE")){
+                if (null != status && status.trim().equals("CREATIVE_WORD_STATUS_APPROVE")) {
                     array.add(getWord);
                 }
             });
@@ -152,17 +156,18 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
 
     /**
      * 行动号召数据获取
+     *
      * @return
      */
     @Override
-    public JSONObject getActionText(Long accountId,String landingType) {
+    public JSONObject getActionText(Long accountId, String landingType) {
         CtopOauthToken token = ctopOauthTokenService.getTokenByAccountId(accountId);
         // 请求地址
         String url = "https://ad.oceanengine.com/open_api/2/tools/action_text/get/";
         // 请求参数
         JSONObject data = new JSONObject();
         data.put("advertiser_id", accountId);
-        data.put("landing_type",landingType);
+        data.put("landing_type", landingType);
         return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, data);
     }
 

+ 11 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MusicInfoServiceImpl.java

@@ -0,0 +1,11 @@
+package cn.com.ctop.common.module.service.impl;
+
+import cn.com.ctop.common.module.entity.MusicInfo;
+import cn.com.ctop.common.module.mapper.MusicInfoMapper;
+import cn.com.ctop.common.module.service.MusicInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+@Service
+public class MusicInfoServiceImpl extends ServiceImpl<MusicInfoMapper, MusicInfo> implements MusicInfoService {
+}

+ 14 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MusicTypeServiceImpl.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.common.module.service.impl;
+
+import cn.com.ctop.common.module.entity.MusicInfo;
+import cn.com.ctop.common.module.entity.MusicType;
+import cn.com.ctop.common.module.mapper.MusicInfoMapper;
+import cn.com.ctop.common.module.mapper.MusicTypeMapper;
+import cn.com.ctop.common.module.service.MusicInfoService;
+import cn.com.ctop.common.module.service.MusicTypeService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+@Service
+public class MusicTypeServiceImpl extends ServiceImpl<MusicTypeMapper, MusicType> implements MusicTypeService {
+}

+ 9 - 137
module-common/src/main/java/cn/com/ctop/common/module/service/impl/ProductServiceImpl.java

@@ -1,154 +1,26 @@
 package cn.com.ctop.common.module.service.impl;
 
-import cn.com.ctop.common.module.entity.Advertiser;
 import cn.com.ctop.common.module.entity.Product;
-import cn.com.ctop.common.module.entity.Project;
 import cn.com.ctop.common.module.mapper.ProductMapper;
 import cn.com.ctop.common.module.service.IProductService;
-import cn.com.ctop.common.module.vo.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
-import org.apache.ibatis.annotations.Param;
-import org.apache.shiro.SecurityUtils;
-import org.jeecg.common.system.vo.LoginUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-
+/**
+ * 产品表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-08
+ */
 @Service
 public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements IProductService {
-
     @Autowired
     private ProductMapper productMapper;
 
     @Override
-    public List<Advertiser> advertiserList(){
-        return productMapper.getAdvertiserList();
-    }
-
-    @Override
-    public List<Project> getProjectListByAdvertiserId(String advertiserId){
-        return productMapper.getProjectListByAdvertiserId(advertiserId);
-    }
-
-    @Override
-    public Map<String,Object> getSaleAndYunyingListByProjectIds(List<Long> projectIds){
-        Map<String,Object> map = new HashMap<>();
-
-        List<ProductDto> saleList = productMapper.getSaleListByProjectIds(projectIds);
-        List<ProductDto> yunyingeList = productMapper.getYunyingListByProjectIds(projectIds);
-
-        map.put("saleList",saleList);
-        map.put("yunyingList",yunyingeList);
-
-        return map;
-    }
-
-    @Override
-    public void deleteProduct(Long id){
-        productMapper.logicDeleteProductById(id);
-    }
-
-    @Override
-    public void insertOrUpdateProduct(ProductVO product){
-        //更新
-        if(product.getId() != null){
-            //productMapper.deleteProductProjectMapByProductId(product.getId());
-            //if(product.getProjectIds() != null && product.getProjectIds().size() != 0 ){
-            //    productMapper.insertProductProjectMap(product.getProjectIds(), product.getId());
-            //}
-            productMapper.updateProduct(product);
-        }else { //入库
-            LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-            product.setCreateUserId(sysUser.getId());
-            productMapper.insertProduct(product);
-
-            if(product.getProjectIds() != null && product.getProjectIds().size() != 0 ){
-                productMapper.insertProductProjectMap(product.getProjectIds(), product.getId());
-            }
-        }
-    }
-
-    @Override
-    public Integer getProductNameCount(String productName){
-        return productMapper.getProductNameCount(productName);
-    }
-
-    @Override
-    public void insertProductProjectMap(Long productId, List<Long> projectIds){
-        productMapper.insertProductProjectMap(projectIds, productId);
-    }
-
-  @Override
-    public Map<String, Object> getProductInfo(Long productId){
-        Map<String,Object> map = new HashMap<>();
-
-        Product product = productMapper.getProductInfo(productId);
-        List<ProjectVO> projectList = productMapper.getProjectListByProductId(productId);
-
-        List<Long> projectIds = new ArrayList<>();
-        for(ProjectVO vo:projectList){
-            projectIds.add(vo.getProjectId());
-        }
-
-        List<ProductDto> saleList = productMapper.getSaleListByProjectIds(projectIds);
-        List<ProductDto> yunyingeList = productMapper.getYunyingListByProjectIds(projectIds);
-
-        map.put("saleList",saleList);
-        map.put("yunyingList",yunyingeList);
-        map.put("product",product);
-        map.put("projectList",projectList);
-
-        return map;
-    }
-
-    @Override
-    public void deleteByProjectIdAndProductId(Long projectId, Long productId){
-        productMapper.deleteByProjectIdAndProductId(productId, projectId);
-    }
-
-    @Override
-    public List<ProjectVO> getProjectListByProductId(Long productId){
-        return productMapper.getProjectListByProductId(productId);
-    }
-
-    @Override
-    public PageInfo<ProductVO> getProductList(String advertiserName, String productName, Integer pageNum, Integer pageSize){
-        PageHelper.startPage(pageNum, pageSize);
-        List<ProductVO> productList = productMapper.getProductList(advertiserName, productName);
-
-        for(ProductVO product:productList){
-            List<ProjectVO> projectListByProductId = productMapper.getProjectListByProductId(product.getId());
-            List<SaleVO> salesListByProductId = productMapper.getSalesListByProductId(product.getId());
-            List<UserDto> yunyingListByProductId = productMapper.getYunyingListByProductId(product.getId());
-            List<Long> projectIds = productMapper.getProjectIdsByProductId(product.getId());
-
-            product.setProjectIds(projectIds);
-            product.setProjectList(projectListByProductId);
-            product.setSaleList(salesListByProductId);
-            product.setYunyingList(yunyingListByProductId);
-        }
-
-        return new PageInfo<>(productList);
-
-    }
-
-    @Override
-    public List<Long> getProjectIdsByProductId(Long productId){
-
-        return productMapper.getProjectIdsByProductId(productId);
-
+    public String getUserNameByUserId(String userId) {
+        return productMapper.getUserNameByUserId(userId);
     }
-
-
-
-
-
-
 }

+ 6 - 2
module-common/src/main/java/cn/com/ctop/common/module/utils/HttpUtils.java

@@ -328,9 +328,12 @@ public class HttpUtils {
             HttpPost httppost = new HttpPost(url);
             httppost.setHeader("User-Agent", USER_AGENT);
             httppost.addHeader("Content-Type", "application/json");
-            for (String key : headers.keySet()) {
-                httppost.setHeader(key, headers.get(key));
+            if (!Check.isNull(headers)) {
+                for (String key : headers.keySet()) {
+                    httppost.setHeader(key, headers.get(key));
+                }
             }
+
             httppost.setEntity(new StringEntity(body, Charset.forName("UTF-8")));
             HttpEntity respentity;
 
@@ -679,6 +682,7 @@ public class HttpUtils {
         String strReturn = "";
         try {
             String uri = url + "?" + mapParamsSortToStringBySeperator(params, "&");
+            System.err.println(uri);
             HttpGet httpGet = new HttpGet(uri);
             if (headers != null) {
                 Iterator<String> keyIter = headers.keySet().iterator();

+ 0 - 25
module-common/src/main/java/cn/com/ctop/common/module/vo/ProductDto.java

@@ -1,25 +0,0 @@
-package cn.com.ctop.common.module.vo;
-
-import lombok.Data;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-
-@Data
-public class ProductDto implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    private String userId;
-
-    private String userName;
-
-    private String saleId;
-
-    private String saleName;
-
-    private Long projectId;
-
-    private String projectName;
-
-}

+ 0 - 28
module-common/src/main/java/cn/com/ctop/common/module/vo/ProductInfoDto.java

@@ -1,28 +0,0 @@
-package cn.com.ctop.common.module.vo;
-
-import com.github.pagehelper.PageInfo;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.List;
-
-@Data
-public class ProductInfoDto extends PageInfo implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    private String advertiserId;
-
-    private List<Long> projectIds;
-
-    private Long productId;
-
-    private Long projectId;
-
-    private String advertiserName;
-
-    private String productName;
-
-    private Integer mediaId;
-
-}

+ 0 - 52
module-common/src/main/java/cn/com/ctop/common/module/vo/ProductVO.java

@@ -1,52 +0,0 @@
-package cn.com.ctop.common.module.vo;
-
-import lombok.Data;
-
-import java.util.Date;
-import java.util.List;
-
-/**
- * 产品
- */
-@Data
-public class ProductVO {
-    /**
-     * id
-     */
-    private Long id;
-    /**
-     * 产品名称
-     */
-    private String productName;
-    /**
-     * 广告主id
-     */
-    private String advertiserId;
-    private String advertiserName;
-
-    /**
-     * 创建人
-     */
-    private String createUserId;
-
-    /**
-     * 媒体类型
-     */
-    private String mediaId;
-
-    /**
-     * 创建时间
-     */
-    private Date createTime;
-
-    private Date updateTime;
-
-    private List<Long> projectIds;
-
-    private List<ProjectVO> projectList;
-
-    private List<SaleVO> saleList;
-
-    private List<UserDto> yunyingList;
-
-}

+ 15 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/entity/CrawlerDouyinMusicTask.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.crawler.modules.core.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+@Data
+@TableName("ctop_crawler_douyin_music_task")
+public class CrawlerDouyinMusicTask {
+    @TableId(value = "id", type = IdType.INPUT)
+    private Long id;
+    private String status;
+
+}

+ 8 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/mapper/CrawlerDouyinMusicTaskMapper.java

@@ -0,0 +1,8 @@
+package cn.com.ctop.crawler.modules.core.mapper;
+
+import cn.com.ctop.crawler.modules.core.entity.CrawlerDouyinMusicTask;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+public interface CrawlerDouyinMusicTaskMapper extends BaseMapper<CrawlerDouyinMusicTask> {
+    public void replaceInto(CrawlerDouyinMusicTask crawlerDouyinMusicTask);
+}

+ 9 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/mapper/xml/CrawlerDouyinMusicTaskMapper.xml

@@ -0,0 +1,9 @@
+<?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.crawler.modules.core.mapper.CrawlerDouyinMusicTaskMapper">
+
+
+    <insert id="replaceInto" parameterType="cn.com.ctop.crawler.modules.core.entity.CrawlerDouyinMusicTask">
+		replace into ctop_crawler_douyin_music_task (id,status) values(#{id},#{status})
+	</insert>
+</mapper>

+ 8 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/service/CrawlerDouyinMusicTaskService.java

@@ -0,0 +1,8 @@
+package cn.com.ctop.crawler.modules.core.service;
+
+import cn.com.ctop.crawler.modules.core.entity.CrawlerDouyinMusicTask;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+public interface CrawlerDouyinMusicTaskService extends IService<CrawlerDouyinMusicTask> {
+    public void replaceInto(CrawlerDouyinMusicTask crawlerDouyinMusicTask);
+}

+ 18 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/service/impl/CrawlerDouyinMusicServiceImpl.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.crawler.modules.core.service.impl;
+
+import cn.com.ctop.crawler.modules.core.entity.CrawlerDouyinMusicTask;
+import cn.com.ctop.crawler.modules.core.mapper.CrawlerDouyinMusicTaskMapper;
+import cn.com.ctop.crawler.modules.core.service.CrawlerDouyinMusicTaskService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class CrawlerDouyinMusicServiceImpl extends ServiceImpl<CrawlerDouyinMusicTaskMapper, CrawlerDouyinMusicTask> implements CrawlerDouyinMusicTaskService {
+    @Autowired
+    private CrawlerDouyinMusicTaskMapper crawlerDouyinMusicTaskMapper;
+    @Override
+    public void replaceInto(CrawlerDouyinMusicTask crawlerDouyinMusicTask) {
+        crawlerDouyinMusicTaskMapper.replaceInto(crawlerDouyinMusicTask);
+    }
+}

+ 9 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/douyin/service/DouyinMusicService.java

@@ -0,0 +1,9 @@
+package cn.com.ctop.crawler.modules.douyin.service;
+
+import cn.com.ctop.common.module.entity.MusicInfo;
+
+public interface DouyinMusicService {
+    public void getHotMusicList();
+    public MusicInfo getMusicInfo(MusicInfo musicInfo);
+    public void parseTag(MusicInfo musicInfo);
+}

文件差异内容过多而无法显示
+ 175 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/douyin/service/impl/DouyinMusicServiceImpl.java


+ 23 - 2
module-crawler/src/main/java/cn/com/ctop/crawler/modules/taobao/service/impl/TaobaoJhsbybtServiceImpl.java

@@ -51,17 +51,20 @@ public class TaobaoJhsbybtServiceImpl implements TaobaoJhsbybtService {
         String sign = DigestUtils.md5Hex(token + "&" + paramMap.get("t") + "&" + paramMap.get("appKey") + "&" + paramMap.get("data"));
         paramMap.put("sign", sign);
         headerMap.put("Cookie", cookie);
+//        System.out.println(cookie);
         result = HttpUtils.httpGet(url, paramMap, headerMap);
         return result;
     }
 
     public static void main(String[] args) {
         try {
-            PrintStream out = new PrintStream("D:/bybt0901.csv");
+            PrintStream out = new PrintStream("D:/bybt0916.csv");
             System.setOut(out);
         } catch (FileNotFoundException e) {
             e.printStackTrace();
         }
+        System.out.println("商品id,商品名,销量,商品logo,设计图,商品图,商品链接,正常价,,,补贴价,补贴券");
+
         TaobaoJhsbybtServiceImpl tb = new TaobaoJhsbybtServiceImpl();
         int i = 1;
         Boolean hasMore = true;
@@ -72,6 +75,8 @@ public class TaobaoJhsbybtServiceImpl implements TaobaoJhsbybtService {
                 result = result.substring(0, result.length() - 1);
                 ObjectMapper mapper = new ObjectMapper();
                 JsonNode rootNode = mapper.readTree(result);
+//                System.out.println(HttpUtils.COOKIESTORE.toString());
+//                System.out.println(result);
                 Boolean success = rootNode.get("data").get("resultValue").get("8613423").get("success").asBoolean();
                 while (!success) {
                     Thread.sleep(3000L);
@@ -98,12 +103,28 @@ public class TaobaoJhsbybtServiceImpl implements TaobaoJhsbybtService {
                     String cutPrice = itemNode.get("cutPrice").asText();
                     String itemUrl = itemNode.get("itemUrl").asText();
                     String itemId = itemNode.get("itemId").asText();
+                    System.out.println(itemId+","+cjmsItemName+","+
+                            itemSoldInfo+","+
+                            brandLogo+","+
+                            picUrl+","+
+                            cjmsTaobaoEntrance+","+
+                            itemUrl+","+
+                            actPrice+","+
+                            cutPrice+","+
+                            orgPrice+","+
+                            couponPrice+","+
+                            couponAmount);
                 }
                 i++;
-                Thread.sleep(3000L);
+
             } catch (Exception e) {
                 e.printStackTrace();
             }
+            try {
+                Thread.sleep(3000L);
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
         }
 
     }

+ 5 - 5
module-ctop/src/main/java/cn/com/ctop/manage/modules/material/service/impl/MaterialUploadServiceImpl.java

@@ -1,9 +1,6 @@
 package cn.com.ctop.manage.modules.material.service.impl;
 
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.entity.MaterialInfo;
-import cn.com.ctop.common.module.entity.MaterialParameter;
-import cn.com.ctop.common.module.entity.UserAllocation;
+import cn.com.ctop.common.module.entity.*;
 import cn.com.ctop.common.module.enums.MaterialEnum;
 import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
 import cn.com.ctop.common.module.mapper.MaterialInfoMapper;
@@ -65,6 +62,8 @@ public class MaterialUploadServiceImpl implements IMaterialUploadService {
     private IUserAllocationService userAllocationService;
     @Autowired
     private IKuaishouInterfaceService kuaishouInterfaceService;
+    @Autowired
+    private IProjectService projectService;
 
 
     /**
@@ -236,7 +235,8 @@ public class MaterialUploadServiceImpl implements IMaterialUploadService {
                                         log.error("快手同步素材失败,返回信息:{},请求参数:{}", resultJson, requestJson);
                                         //  发送消息到上传人
                                         UserAllocation allocation = userAllocationService.getByAccountId(accountId);
-                                        String message = messageTemplate.getMaterialSyncTemplate(allocation.getProjectName(), accountId, allocation.getAuthName(), materialInfo.getMaterialName(), resultJson.getString("message"));
+                                        Project project = projectService.getById(allocation.getProjectId());
+                                        String message = messageTemplate.getMaterialSyncTemplate(project.getProjectName(), accountId, allocation.getAuthName(), materialInfo.getMaterialName(), resultJson.getString("message"));
                                         sendMessageService.sendMessage(userId, message);
                                     }
                                 }

+ 1 - 1
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceAdvertiserHourlyReportLoadJob.java

@@ -26,7 +26,7 @@ public class BytedanceAdvertiserHourlyReportLoadJob {
     private ICtopOauthTokenService tokenService;
     @Autowired
     private IReportService reportService;
-    static ExecutorService executorService = Executors.newFixedThreadPool(4);;
+    static ExecutorService executorService = Executors.newFixedThreadPool(4);
 
     @XxlJob("bytedanceAdvertiserHourlyReport")
     public ReturnT<String> execute(String param) throws Exception {

+ 52 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceYesterdayAdvertiserHourlyLoadJob.java

@@ -0,0 +1,52 @@
+package cn.com.ctop.job.bytedance.handler;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.toutiao.modules.report.service.IReportService;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.core.log.XxlJobLogger;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ *  Created by JQ.bi on 2020.09.03
+ */
+public class BytedanceYesterdayAdvertiserHourlyLoadJob {
+
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+
+    @Autowired
+    private IReportService reportService;
+
+    private ExecutorService executorService = Executors.newFixedThreadPool(5);
+    @XxlJob("byteDanceAdvertiserHourlyReport")
+    public ReturnT<String> execute(String param) throws Exception {
+        //查询需要拉取数据的账户token
+        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
+        if (null == tokens || tokens.isEmpty()) {
+            XxlJobLogger.log("获取昨日头条小时数据异常:未获取到可用的token");
+            return ReturnT.FAIL;
+        }
+        Date yesterday = DateUtils.parseDate(DateUtils.getAnotherDay("yy-MM-dd", DateUtils.getNowDate("yy-MM-dd"), -1), "yy-MM-dd");
+        tokens.forEach(it ->executorService.submit(() -> {
+            try {
+                reportService.getAdvertiserReport(it, yesterday, yesterday, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
+            } catch (Exception e) {
+                XxlJobLogger.log("获取昨日头条小时数据异常:拉取数据异常");
+                XxlJobLogger.log(e.getMessage());
+            }
+        }));
+        if(!executorService.isShutdown()){
+            executorService.shutdown();
+        }
+        return ReturnT.SUCCESS;
+    }
+}

+ 3 - 3
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/SendDailyUReportJob.java

@@ -23,7 +23,7 @@ public class SendDailyUReportJob {
     @Autowired
     IUReportService uReportService;
     @Autowired
-    ICtopCorpWexinUserService CorpUserService;
+    ICtopCorpWexinUserService corpUserService;
 
     /**
      * 检查任务执行结果
@@ -38,7 +38,7 @@ public class SendDailyUReportJob {
                  //下载文件到本地
                  uReportExportService.exportExcel(uReport.getString("name"));
                  uReportSubscriber.forEach(sender->{
-                     String receiver=CorpUserService.getEmailByUserId(sender.getSender());
+                     String receiver=corpUserService.getEmailByUserId(sender.getSender());
                      emailSendMsgHandle.SendAttachment(receiver,title,content,
                              new File("/data/file/report"+ File.separator + "uReport"+File.separator+uReport.getString("name")
                                      .replace("ureport.xml","")+"xlsx"));
@@ -46,7 +46,7 @@ public class SendDailyUReportJob {
              }
         });
         //发完全部订阅,删除文件
-        File file =new File(System.getProperty("/data/file/report")+ File.separator + "uReport");
+        File file =new File("/data/file/report"+ File.separator + "uReport");
             File[] files=file.listFiles();
             if(files!=null&&files.length>0){
                 for (File f: files){

+ 45 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouGroupDailyReportJob.java

@@ -0,0 +1,45 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import com.xxl.job.core.log.XxlJobLogger;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class KuaishouGroupDailyReportJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+
+    static ExecutorService executorService = Executors.newFixedThreadPool(5);
+
+    @XxlJob("kuaishouGroupDailyReportJob")
+    public ReturnT<String> execute(String param) throws ParseException {
+        String date = DateUtils.getDate("yyyy-MM-dd");
+        String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", date, -1);
+        String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", date, -2);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date parse = simpleDateFormat.parse(startDate);
+        Date parse2 = simpleDateFormat.parse(endDate);
+        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
+        tokens.forEach(token -> executorService.submit(() ->
+                kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, parse, parse2))
+        );
+        XxlJobLogger.log("快手物料数据同步完成");
+        return ReturnT.SUCCESS;
+    }
+
+}

+ 29 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouMaterialSyncMd5Job.java

@@ -0,0 +1,29 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import static org.jeecg.common.util.DateUtils.getAnotherDay;
+
+/**
+ * 检查前一天md5为空的数据
+ *
+ * @author yumeng
+ */
+@Component
+public class KuaishouMaterialSyncMd5Job {
+    @Autowired
+    private IKuaiShouHistoryReportTaskService historyReportTaskService;
+
+    @XxlJob("kuaishouMaterialSyncMd5Job")
+    public ReturnT<String> execute(String param) throws Exception {
+        String nowDate = DateUtils.getDate("yyyy-MM-dd");
+        String statDate = getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        historyReportTaskService.getMd5V2(statDate);
+        return ReturnT.SUCCESS;
+    }
+}

+ 33 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java

@@ -1131,7 +1131,6 @@ public class BatchController {
                 queryWrapper.between("stat_date", startDate, endDate);
             }
             queryWrapper.orderByDesc("stat_date");
-            queryWrapper.orderByDesc("photo_id");
             queryWrapper.groupBy("signature");
             Page<KuaiShouVideoGet> page = new Page<>(pageNo, pageSize);
             IPage<KuaiShouVideoGet> pageList = kuaiShouVideoGetService.page(page, queryWrapper);
@@ -2292,4 +2291,37 @@ public class BatchController {
         return result;
     }
 
+
+    /**
+     * 同步应用
+     *
+     * @param accountId
+     * @return
+     */
+    @GetMapping(value = "/getWhiteList")
+    public Result<JSONObject> getWhiteList(Long accountId) {
+        Result<JSONObject> result = new Result<>();
+        try {
+            if (Check.isNull(accountId)) {
+                throw new Exception("入参为空");
+            }
+            CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
+            if (Check.isNull(oauthToken)) {
+                throw new Exception("未获取到账户信息");
+            }
+
+            JSONObject data = batchService.getWhiteList(accountId, oauthToken.getAccessToken());
+            result.setSuccess(true);
+            result.setResult(data);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+            result.setResult(null);
+            result.setMessage(e.getMessage());
+        }
+
+        return result;
+    }
+
+
 }

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

@@ -0,0 +1,26 @@
+package cn.com.ctop.kuaishou.modules.batch.mapper;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo;
+import cn.com.ctop.kuaishou.modules.report.entity.VideoGetvo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 素材
+ *
+ * @author: jeecg-boot
+ * @date: 2020-09-09
+ * @cersion: V1.0
+ */
+public interface KuaiShouReportDailyMaterialMapper extends BaseMapper<KuaiShouReportDailyMaterial> {
+    void loadMaterialDailyReport(@Param("accountId") Long accountId, @Param("localPath") String localPath);
+
+    List<KuaiShouReportDailyMaterialVo> getPhotoList(@Param("accountId") Long accountId, @Param("statDate") String statDate);
+
+    VideoGetvo getVideoGetByPhotoId(@Param("photoId") Long photoId);
+
+    List<KuaiShouReportDailyMaterialVo> getPhotoListByDate(@Param("statDate") String statDate);
+}

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

@@ -0,0 +1,147 @@
+<?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.kuaishou.modules.batch.mapper.KuaiShouReportDailyMaterialMapper">
+
+    <insert id="loadMaterialDailyReport">
+		LOAD DATA local INFILE  #{localPath}
+	    REPLACE INTO TABLE ctop_kuaishou_report_daily_material CHARACTER SET utf8mb4
+		FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
+		IGNORE 1 LINES
+		(photo_id,
+		image_token,
+		cover_url,
+		photo_url,
+		@photo_caption,
+		@creative_material_type_string,
+        @ad_scene,
+        charge,
+        photo_show,
+        aclick,
+        bclick,
+        photo_share,
+        photo_comment,
+        photo_like,
+        follow,
+        cancel_follow,
+        report,
+        block,
+        negative,
+        download_started,
+        download_completed,
+        activation,
+        submit,
+        stat_date,
+        @stat_hour,
+        photo_click,
+        photo_click_ratio,
+        action_ratio,
+        impression_1k_cost,
+        photo_click_cost,
+        @click_1k_cost,
+        action_cost,
+        event_pay_first_day,
+        event_pay_purchase_amount_first_day,
+        event_pay_first_day_roi,
+        event_pay,
+        event_pay_purchase_amount,
+        event_pay_roi,
+        event_register,
+        event_register_cost,
+        event_register_ratio,
+        event_jin_jian_app,
+        event_jin_jian_app_cost,
+        event_credit_grant_app,
+        event_credit_grant_app_cost,
+        event_credit_grant_app_ratio,
+        event_order_paid,
+        event_order_paid_purchase_amount,
+        event_order_paid_cost,
+        form_count,
+        form_cost,
+        form_action_ratio,
+        event_jin_jian_landing_page,
+        event_jin_jian_landing_page_cost,
+        event_credit_grant_landing_page,
+        event_credit_grant_landing_page_cost,
+        event_credit_grant_landing_ratio,
+        event_next_day_stay_cost,
+        event_next_day_stay_ratio,
+        event_next_day_stay,
+        play_3s_ratio,
+        @event_valid_clues,
+        @event_valid_clues_cost,
+        @ad_product_cnt,
+        @event_goods_view,
+        @merchant_reco_fans,
+        @event_order_amount_roi,
+        @event_goods_view_cost,
+        @merchant_reco_fans_cost,
+        @event_new_user_pay,
+        @event_new_user_pay_cost,
+        @event_new_user_pay_ratio,
+        @event_button_click,
+        @event_button_click_cost,
+        @event_button_click_ratio,
+        @play_5s_ratio,
+        @play_end_ratio,
+        @event_order_paid_roi,
+        @event_new_user_jinjian_app,
+        @event_new_user_jinjian_app_cost,
+        @event_new_user_jinjian_app_roi,
+        @event_new_user_credit_grant_app,
+        @event_new_user_credit_grant_app_cost,
+        @event_new_user_credit_grant_app_roi,
+        @event_new_user_jinjian_page,
+        @event_new_user_jinjian_page_cost,
+        @event_new_user_jinjian_page_roi,
+        @event_new_user_credit_grant_page,
+        @event_new_user_credit_grant_page_cost,
+        @event_new_user_credit_grant_page_roi,
+        @event_appoint_form,
+        @event_appoint_form_cost,
+        @event_appoint_form_ratio,
+        @event_appoint_jump_click,
+        @event_appoint_jump_click_cost,
+        @event_appoint_jump_click_ratio
+        )
+          set account_id = #{accountId}
+    </insert>
+
+    <select id="getPhotoList" resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo">
+           select
+           id as id,
+           photo_id as photoId
+           from
+           ctop_kuaishou_report_daily_material
+           where account_id = #{accountId}
+           <if test="statDate != null and statDate != '' ">
+               and stat_date = #{statDate}
+           </if>
+           group by photo_id
+
+    </select>
+
+    <select id="getPhotoListByDate"
+            resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo">
+        select
+        id as id,
+        photo_id as photoId
+        from
+        ctop_kuaishou_report_daily_material
+        WHERE stat_date = #{statDate}
+        and signature is null
+        group by photo_id
+    </select>
+
+    <select id="getVideoGetByPhotoId" resultType="cn.com.ctop.kuaishou.modules.report.entity.VideoGetvo">
+      select
+      signature as 'signature',
+      channel_type as 'channelType'
+      from ctop_kuaishou_video_get
+      where photo_id = #{photoId}
+      and signature is not null
+      limit 1
+    </select>
+
+
+</mapper>

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

@@ -138,4 +138,14 @@ public interface IBatchService {
      * @param copyUnitId
      */
     void copyCreative(Long accountId, Long unitId, Long copyUnitId, JSONObject appJson) throws Exception;
+
+
+    /**
+     * 获取联盟白名单
+     *
+     * @param accountId
+     * @param accessToken
+     * @return
+     */
+    JSONObject getWhiteList(Long accountId, String accessToken);
 }

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

@@ -15,4 +15,7 @@ public interface IKuaiShouHistoryReportTaskService extends IService<KuaiShouHist
 
     void getTaskList();
 
+    void getMd5(String statDate, Long accountId);
+
+    void getMd5V2(String statDate);
 }

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

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.batch.service;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 素材
+ * @Author: jeecg-boot
+ * @Date: 2020-09-09
+ * @Version: V1.0
+ */
+public interface IKuaiShouReportDailyMaterialService extends IService<KuaiShouReportDailyMaterial> {
+
+}

+ 7 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/AccountWarningServiceImpl.java

@@ -1,9 +1,11 @@
 package cn.com.ctop.kuaishou.modules.batch.service.impl;
 
 import cn.com.ctop.common.module.entity.MailLog;
+import cn.com.ctop.common.module.entity.Project;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.MailLogMapper;
 import cn.com.ctop.common.module.mapper.UserAllocationMapper;
+import cn.com.ctop.common.module.service.IProjectService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.CorpWexinUtils;
 import cn.com.ctop.common.module.utils.SendMailUtil;
@@ -28,6 +30,8 @@ public class AccountWarningServiceImpl implements IAccountWarningService {
     private UserAllocationMapper userAllocationMapper;
     @Autowired
     private MailLogMapper mailLogMapper;
+    @Autowired
+    private IProjectService projectService;
 
 
     /**
@@ -55,6 +59,7 @@ public class AccountWarningServiceImpl implements IAccountWarningService {
             if (userAllocation.getAccountStatus() == 1) {
                 return;
             }
+            Project project = projectService.getById(userAllocation.getProjectId());
             BigDecimal warningAmount = userAllocation.getWarningAmount();
             BigDecimal warningProportion = userAllocation.getWarningProportion();
             BigDecimal nowCost = hourlyAccountMapper.getCost(accountId, maxHour, statDate);
@@ -65,7 +70,7 @@ public class AccountWarningServiceImpl implements IAccountWarningService {
                         BigDecimal subtract = nowCost.subtract(lastHourCost);
                         BigDecimal divide = nowCost.divide(lastHourCost, 2, RoundingMode.HALF_UP);
                         if (subtract.compareTo(warningAmount) > -1 && divide.compareTo(warningProportion) > -1) {
-                            sendMessage(accountId, userAllocation.getAuthName(), maxHour, nowCost, userAllocation.getProjectId(), userAllocation.getProjectName());
+                            sendMessage(accountId, userAllocation.getAuthName(), maxHour, nowCost, userAllocation.getProjectId(), project.getProjectName());
                         }
                     }
                 }
@@ -77,7 +82,7 @@ public class AccountWarningServiceImpl implements IAccountWarningService {
                     BigDecimal subtract = nowCost.subtract(yesterdayHourCost);
                     BigDecimal divide = nowCost.divide(yesterdayHourCost, 2, RoundingMode.HALF_UP);
                     if (subtract.compareTo(warningAmount) > -1 && divide.compareTo(warningProportion) > -1) {
-                        sendYesterdayMessage(accountId, userAllocation.getAuthName(), maxHour, nowCost, userAllocation.getProjectId(), userAllocation.getProjectName());
+                        sendYesterdayMessage(accountId, userAllocation.getAuthName(), maxHour, nowCost, userAllocation.getProjectId(), project.getProjectName());
                     }
                 }
             }

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

@@ -5,6 +5,7 @@ import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.UserAllocationMapper;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.HttpUtils;
 import cn.com.ctop.kuaishou.modules.batch.entity.*;
 import cn.com.ctop.kuaishou.modules.batch.mapper.*;
 import cn.com.ctop.kuaishou.modules.batch.service.*;
@@ -19,6 +20,7 @@ import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -1673,6 +1675,37 @@ public class BatchServiceImpl implements IBatchService {
         return returnJson;
     }
 
+
+    /**
+     * 获取联盟白名单
+     *
+     * @param accountId
+     * @param accessToken
+     * @return
+     */
+    @Override
+    public JSONObject getWhiteList(Long accountId, String accessToken) {
+
+        String url = "https://ad.e.kuaishou.com/rest/openapi/v1/advertiser/white_list";
+        Map<String, String> headers = new HashMap<String, String>();
+        headers.put("Content-Type", "application/json");
+        headers.put("Access-Token", accessToken);
+        Map<String, Object> param = new HashMap<String, Object>();
+        param.put("advertiser_id", accountId);
+
+        String result = HttpUtils.httpPostRequest(url, param, headers);
+        JSONObject resultJson = JSONObject.parseObject(result);
+        if (!Check.isNull(resultJson)) {
+            Integer code = resultJson.getInteger("code");
+            if (code == 0) {
+                return resultJson.getJSONObject("data");
+            }
+
+        }
+        return null;
+    }
+
+
 }
 
 

+ 26 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouDailyReportTaskServiceImpl.java

@@ -3,7 +3,9 @@ package cn.com.ctop.kuaishou.modules.batch.service.impl;
 import cn.com.ctop.common.module.utils.*;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouDailyReportTask;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouDailyReportTaskMapper;
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouReportDailyMaterialMapper;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCampaignMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyGroupMapper;
@@ -44,6 +46,10 @@ public class KuaiShouDailyReportTaskServiceImpl extends ServiceImpl<KuaiShouDail
 
     @Autowired
     private KuaishouReportDailyCreativeMapper reportDailyCreativeMapper;
+    @Autowired
+    private KuaiShouReportDailyMaterialMapper kuaishouReportDailyMaterialMapper;
+    @Autowired
+    private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
 
     @Override
     public void formatCreativeDailyReportData(Long accountId, String statDate) {
@@ -126,12 +132,30 @@ public class KuaiShouDailyReportTaskServiceImpl extends ServiceImpl<KuaiShouDail
 
                 } else if (task.getViewType() == 4) {
                     reportDailyCreativeMapper.loadCreativeDailyReport(task.getAccountId(), localPath);
-                    Thread.sleep(1 * 1000);
-                    reportDailyCreativeMapper.formatCreativeDailyReportData(task.getAccountId(), task.getStatDate());
+                  /*  Thread.sleep(1 * 1000);
+                    reportDailyCreativeMapper.formatCreativeDailyReportData(task.getAccountId(), task.getStatDate());*/
                 } else if (task.getViewType() == 10) {
                     XxlJobLogger.log("下载文件,accountId:{}", task.getAccountId());
                     reportDailyCreativeMapper.loadProgramCreativeDailyReport(task.getAccountId(), localPath);
                     XxlJobLogger.log("下载结束,accountId:{}", task.getAccountId());
+                } else if (task.getViewType() == 5) {
+                    kuaishouReportDailyMaterialMapper.loadMaterialDailyReport(task.getAccountId(), localPath);
+                    Thread thread = new Thread() {
+                        @Override
+                        public void run() {
+                            try {
+                                Thread.sleep(1 * 1000L);
+                                kuaiShouHistoryReportTaskService.getMd5(task.getStatDate(), task.getAccountId());
+                            } catch (InterruptedException e) {
+                                e.printStackTrace();
+                            }
+
+                        }
+
+                    };
+                    thread.start();
+
+
                 }
             }
 

+ 113 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouHistoryReportTaskServiceImpl.java

@@ -6,8 +6,12 @@ import cn.com.ctop.common.module.utils.*;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouDailyReportTask;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouHistoryReportTask;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouHistoryReportTaskMapper;
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouReportDailyMaterialMapper;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo;
+import cn.com.ctop.kuaishou.modules.report.entity.VideoGetvo;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCampaignMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
@@ -26,6 +30,8 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 /**
  * 快手历史数据任务记录
@@ -58,6 +64,9 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
     @Autowired
     private IKuaiShouDailyReportTaskService dailyReportTaskService;
 
+    @Autowired
+    private KuaiShouReportDailyMaterialMapper kuaishouReportDailyMaterialMapper;
+
     @Override
     public void createTask(Long accountId, String token, String startDate, String endDate, String taskType) {
         if (Check.isNull(accountId) || Check.isNull(token)) {
@@ -74,6 +83,7 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
             JSONObject taskParams = new JSONObject();
             taskParams.put("start_date", startDate);
             taskParams.put("end_date", endDate);
+
             if (null != taskType && taskType.equals(CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_DAILY)) {
                 if (Check.isNull(dailyTypeList)) {
                     getDailyTypeList();
@@ -84,6 +94,7 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
                     param.put("task_name", taskName);
                     taskParams.put("view_type", type);
                     param.put("task_params", taskParams);
+
                     String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
                     JSONObject resultJson = JSONObject.parseObject(result);
                     if (!Check.isNull(resultJson)) {
@@ -99,7 +110,7 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
                             dailyReportTask.setTaskName(taskName);
                             dailyReportTaskService.save(dailyReportTask);
                         } else {
-                            log.error("快手历史报表请求失败,accountId:{},返回数据:{}", accountId, resultJson);
+                            log.error("快手分天报表请求失败,accountId:{},返回数据:{}", accountId, resultJson);
                         }
                     }
                 }
@@ -217,13 +228,32 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
 
                 } else if (task.getViewType() == 4) {
                     reportDailyCreativeMapper.loadCreativeDailyReport(task.getAccountId(), localPath);
-                    reportDailyCreativeMapper.formatCreativeDailyReportData(task.getAccountId(), null);
+                    // reportDailyCreativeMapper.formatCreativeDailyReportData(task.getAccountId(), null);
                 } else if (task.getViewType() == 10) {
                     XxlJobLogger.log("下载文件,accountId:{}", task.getAccountId());
                     reportDailyCreativeMapper.loadProgramCreativeDailyReport(task.getAccountId(), localPath);
                     XxlJobLogger.log("下载结束,accountId:{}", task.getAccountId());
                     // 程序化报表
+                } else if (task.getViewType() == 5) {
+                    kuaishouReportDailyMaterialMapper.loadMaterialDailyReport(task.getAccountId(), localPath);
+
+                    Thread thread = new Thread() {
+                        @Override
+                        public void run() {
+                            try {
+                                Thread.sleep(1 * 1000L);
+                                getMd5(null, task.getAccountId());
+                            } catch (InterruptedException e) {
+                                e.printStackTrace();
+                            }
+
+                        }
+
+                    };
+                    thread.start();
                 }
+
+
             }
             task.setTaskStatus(4);
 
@@ -237,12 +267,16 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
 
 
     private void getHistoryTypeList() {
+
         historyTypeList = new ArrayList<>();
+        historyTypeList.add(5);
         historyTypeList.add(1);
         historyTypeList.add(2);
         historyTypeList.add(3);
-        historyTypeList.add(4);
         historyTypeList.add(10);
+        historyTypeList.add(4);
+
+
     }
 
     private void getDailyTypeList() {
@@ -250,7 +284,83 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
         dailyTypeList.add(2);
         dailyTypeList.add(3);
         dailyTypeList.add(4);
+        dailyTypeList.add(5);
         dailyTypeList.add(10);
     }
 
+
+    static ExecutorService executorService = Executors.newFixedThreadPool(30);
+
+    @Autowired
+    private ICtopOauthTokenService oauthTokenService;
+
+    @Override
+    public void getMd5(String statDate, Long accountId) {
+        executorService.submit(new Runnable() {
+            @Override
+            public void run() {
+                List<KuaiShouReportDailyMaterialVo> photoList = kuaishouReportDailyMaterialMapper.getPhotoList(accountId, statDate);
+                if (!Check.isNull(photoList)) {
+                    for (KuaiShouReportDailyMaterialVo materialVo : photoList) {
+                        Long photoId = materialVo.getPhotoId();
+                        VideoGetvo videoGetvo = kuaishouReportDailyMaterialMapper.getVideoGetByPhotoId(photoId);
+                        if (!Check.isNull(videoGetvo)) {
+                            QueryWrapper<KuaiShouReportDailyMaterial> updateQueryWrapper = new QueryWrapper<>();
+                            updateQueryWrapper.eq("photo_id", photoId);
+                            if (!Check.isNull(statDate)) {
+                                updateQueryWrapper.eq("stat_date", statDate);
+                            }
+
+                            updateQueryWrapper.isNull("signature");
+                            KuaiShouReportDailyMaterial material = new KuaiShouReportDailyMaterial();
+                            material.setSignature(videoGetvo.getSignature());
+                            material.setChannelType(videoGetvo.getChannelType());
+                            kuaishouReportDailyMaterialMapper.update(material, updateQueryWrapper);
+                            log.info("修改成功:photoId:{},accountId:{}", photoId, accountId);
+                        }
+
+                    }
+                }
+            }
+        });
+
+    }
+
+    @Override
+    public void getMd5V2(String statDate) {
+        List<KuaiShouReportDailyMaterialVo> photoList = kuaishouReportDailyMaterialMapper.getPhotoListByDate(statDate);
+        XxlJobLogger.log("素材未匹配md5:数据长度:{}", photoList.size());
+        if (!Check.isNull(photoList)) {
+            for (KuaiShouReportDailyMaterialVo materialVo : photoList) {
+                executorService.submit(new Runnable() {
+                    @Override
+                    public void run() {
+                        Long photoId = materialVo.getPhotoId();
+                        VideoGetvo videoGetvo = kuaishouReportDailyMaterialMapper.getVideoGetByPhotoId(photoId);
+                        if (!Check.isNull(videoGetvo)) {
+                            QueryWrapper<KuaiShouReportDailyMaterial> updateQueryWrapper = new QueryWrapper<>();
+                            updateQueryWrapper.eq("photo_id", photoId);
+                            if (!Check.isNull(statDate)) {
+                                updateQueryWrapper.eq("stat_date", statDate);
+                            }
+
+                            KuaiShouReportDailyMaterial material = new KuaiShouReportDailyMaterial();
+                            material.setSignature(videoGetvo.getSignature());
+                            material.setChannelType(videoGetvo.getChannelType());
+                            kuaishouReportDailyMaterialMapper.update(material, updateQueryWrapper);
+                            XxlJobLogger.log("修改成功:photoId:{}", photoId);
+
+                        }
+
+
+                    }
+                });
+
+            }
+        }
+
+
+    }
+
+
 }

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

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.batch.service.impl;
+
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouReportDailyMaterialMapper;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouReportDailyMaterialService;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 素材
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-09
+ */
+@Service
+public class KuaiShouReportDailyMaterialServiceImpl extends ServiceImpl<KuaiShouReportDailyMaterialMapper, KuaiShouReportDailyMaterial> implements IKuaiShouReportDailyMaterialService {
+
+}

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

@@ -16,6 +16,7 @@ import cn.com.ctop.kuaishou.modules.material.entity.KuaishouResultToken;
 import cn.com.ctop.kuaishou.modules.report.entity.*;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCampaignMapper;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyGroupMapper;
 import cn.com.ctop.kuaishou.modules.report.service.*;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
@@ -103,6 +104,10 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     private IKuaishouReportDailyCampaignService dailyCampaignService;
     @Autowired
     private IKuaishouReportDailyGroupService dailyGroupService;
+
+    @Autowired
+    private KuaishouReportDailyGroupMapper dailyGroupMapper;
+
     @Autowired
     private IKuaishouReportHourlyGroupService hourlyGroupService;
     @Autowired
@@ -489,6 +494,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     }
 
     private void getAdvertiserGroupReportDailyByPage(CtopOauthToken token, Date startDate, Date endDate, int page) {
+        log.info("获取广告组日报,accountId:{},开始时间:{},结束时间:{}", token.getAccountId(), DateUtils.formatDate(startDate), DateUtils.formatDate(endDate));
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.GTOUP_REPORT;
         Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", "application/json");
@@ -522,14 +528,15 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         }
         for (int i = 0; i < details.size(); i++) {
             var detailJson = details.getJSONObject(i);
-            var show = detailJson.getLong("show");
-            detailJson.put("photo_show", show);
-            var like = detailJson.getLong("like");
-            detailJson.put("photo_like", like);
+
+            detailJson.put("photo_share", detailJson.getString("share"));
+            detailJson.put("photo_comment", detailJson.getString("comment"));
+            detailJson.put("photo_like", detailJson.getString("like"));
+            detailJson.put("photo_show", detailJson.getString("show"));
+
             var dailyGroup = JSONObject.toJavaObject(detailJson, KuaishouReportDailyGroup.class);
             dailyGroup.setAccountId(token.getAccountId());
-            dailyGroup.setId("" + dailyGroup.getAccountId() + dailyGroup.getUnitId() + dailyGroup.getStatDate());
-            dailyGroupService.saveOrUpdate(dailyGroup);
+            dailyGroupMapper.insertSelective(dailyGroup);
         }
         getAdvertiserGroupReportDailyByPage(token, startDate, endDate, page + 1);
     }
@@ -557,8 +564,8 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             List<KuaishouReportDailyGroup> dailyGroups = kuaishouResult.getData().getDetails();
             dailyGroups.forEach((dailyGroup) -> {
                 dailyGroup.setAccountId(advertiserId);
-                dailyGroup.setId("" + dailyGroup.getAccountId() + dailyGroup.getUnitId() + dailyGroup.getStatDate());
-                dailyGroupService.saveOrUpdate(dailyGroup);
+                //  dailyGroup.setId("" + dailyGroup.getAccountId() + dailyGroup.getUnitId() + dailyGroup.getStatDate());
+                dailyGroupMapper.insertSelective(dailyGroup);
             });
         } catch (Exception e) {
             e.printStackTrace();
@@ -2747,6 +2754,8 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             JSONObject requestJson = new JSONObject();
             requestJson.put("advertiser_id", accountId);
             requestJson.put("status", 4);
+            requestJson.put("page", 1);
+            requestJson.put("page_size", 500);
             String result = HttpUtils.kuaiShouhttpPostRequest(url, requestJson.toJSONString(), headers);
             JSONObject resultJson = JSONObject.parseObject(result);
             if (!Check.isNull(resultJson)) {

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

@@ -3,16 +3,27 @@ package cn.com.ctop.kuaishou.modules.report.controller;
 
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.ExportExcelUtils;
+import cn.com.ctop.common.module.utils.HttpUtils;
 import cn.com.ctop.kuaishou.modules.report.service.IMaterialReportService;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.constant.AccountReportConstants;
+import org.jeecg.common.util.JsonResourceUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
 import java.util.List;
 
 @Slf4j
@@ -76,7 +87,6 @@ public class MaterialReportController {
 
     }
 
-
     @PostMapping(value = "/getMaterialReportByAccount")
     public Result<List<JSONObject>> getMaterialReportByAccount(@RequestBody JSONObject json) {
         Result<List<JSONObject>> result = new Result<>();
@@ -87,9 +97,52 @@ public class MaterialReportController {
         } catch (Exception e) {
             result.setSuccess(false);
         }
-
         return result;
-
     }
-
+    /**
+     *  导出数据
+     */
+    @PostMapping("/materialReport/excel")
+    public void getExcelReport(@RequestBody JSONObject requestBody,
+                               HttpServletRequest request,
+                               HttpServletResponse response) {
+
+        List<JSONObject> excelData = materialReportService.selectReportByAccountIds(requestBody);
+        if(excelData.isEmpty()){
+            return;
+        }
+        List<List<Object>> excelList= new ArrayList<>();
+        excelData.forEach(data->{
+            List<Object> temp= new ArrayList<>();
+            temp.add(data.getString("url"));
+            temp.add(data.getString("signature"));
+            temp.add(data.getString("cost"));
+            temp.add(data.getBigDecimal("downloadCompleted"));
+            temp.add(data.getLong("photoShow"));
+            temp.add(data.getLong("photoClick"));
+            temp.add(data.getString("aclick"));
+            temp.add(data.getString("bclick"));
+            temp.add(data.getBigDecimal("photoClickRatio"));
+            temp.add(data.getBigDecimal("actionRatio"));
+            temp.add(data.getBigDecimal("impression1kCost"));
+            temp.add(data.getBigDecimal("photoClickCost"));
+            temp.add(data.getBigDecimal("actionCost"));
+            temp.add(data.getLong("conversions"));
+            temp.add(data.getBigDecimal("conversionPrice"));
+            excelList.add(temp);
+        });
+        try{
+            String[] headers = {"视频","视频md5","花费","安卓下载完成数","封面曝光数","封面点击数","素材曝光数","行为数","封面点击率","行为率","均千次封面曝光花费(元)","平均封面点击单价(元)","平均行为单价(元)","转化数","转化单价(元)"};
+            OutputStream os = response.getOutputStream();
+            ExportExcelUtils eeu = new ExportExcelUtils();
+            XSSFWorkbook workbook = new XSSFWorkbook();
+            eeu.exportExcel(workbook, 0, "素材账户报表", headers, excelList);
+            HttpUtils.setResponseHeader(response, "素材账户报表.xlsx");
+            workbook.write(os);
+            os.flush();
+            os.close();
+        }catch (IOException e){
+            log.error(e.getMessage());
+        }
+    }
 }

+ 419 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaiShouReportDailyMaterial.java

@@ -0,0 +1,419 @@
+package cn.com.ctop.kuaishou.modules.report.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+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;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 素材
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-09
+ */
+@Data
+@TableName("ctop_kuaishou_report_daily_material")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_report_daily_material对象", description = "素材")
+public class KuaiShouReportDailyMaterial {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+    private Long accountId;
+    /**
+     * 计划ID
+     */
+    @Excel(name = "计划ID", width = 15)
+    @ApiModelProperty(value = "计划ID")
+    private Long photoId;
+    /**
+     * channelType
+     */
+    @Excel(name = "channelType", width = 15)
+    @ApiModelProperty(value = "channelType")
+    private Integer channelType;
+    /**
+     * signature
+     */
+    @Excel(name = "signature", width = 15)
+    @ApiModelProperty(value = "signature")
+    private String signature;
+    /**
+     * 封面token
+     */
+    @Excel(name = "封面token", width = 15)
+    @ApiModelProperty(value = "封面token")
+    private String imageToken;
+    /**
+     * 封面url
+     */
+    @Excel(name = "封面url", width = 15)
+    @ApiModelProperty(value = "封面url")
+    private String coverUrl;
+    /**
+     * 视频uel
+     */
+    @Excel(name = "视频uel", width = 15)
+    @ApiModelProperty(value = "视频uel")
+    private String photoUrl;
+    /**
+     * 素材类型
+     */
+    @Excel(name = "素材类型", width = 15)
+    @ApiModelProperty(value = "素材类型")
+    private String creativeMaterialTypeString;
+    /**
+     * 场景
+     */
+    @Excel(name = "场景", width = 15)
+    @ApiModelProperty(value = "场景")
+    private String adScene;
+    /**
+     * 花费(元)
+     */
+    @Excel(name = "花费(元)", width = 15)
+    @ApiModelProperty(value = "花费(元)")
+    private java.math.BigDecimal charge;
+    /**
+     * 曝光数
+     */
+    @Excel(name = "曝光数", width = 15)
+    @ApiModelProperty(value = "曝光数")
+    private Integer photoShow;
+    /**
+     * 素材曝光数
+     */
+    @Excel(name = "素材曝光数", width = 15)
+    @ApiModelProperty(value = "素材曝光数")
+    private Integer aclick;
+    /**
+     * 行为数
+     */
+    @Excel(name = "行为数", width = 15)
+    @ApiModelProperty(value = "行为数")
+    private Integer bclick;
+    /**
+     * 分享数
+     */
+    @Excel(name = "分享数", width = 15)
+    @ApiModelProperty(value = "分享数")
+    private Integer photoShare;
+    /**
+     * 评论数
+     */
+    @Excel(name = "评论数", width = 15)
+    @ApiModelProperty(value = "评论数")
+    private Integer photoComment;
+    /**
+     * 点赞数
+     */
+    @Excel(name = "点赞数", width = 15)
+    @ApiModelProperty(value = "点赞数")
+    private Integer photoLike;
+    /**
+     * 新增关注数
+     */
+    @Excel(name = "新增关注数", width = 15)
+    @ApiModelProperty(value = "新增关注数")
+    private Integer follow;
+    /**
+     * 取消关注数
+     */
+    @Excel(name = "取消关注数", width = 15)
+    @ApiModelProperty(value = "取消关注数")
+    private Integer cancelFollow;
+    /**
+     * 举报数
+     */
+    @Excel(name = "举报数", width = 15)
+    @ApiModelProperty(value = "举报数")
+    private Integer report;
+    /**
+     * 拉黑数
+     */
+    @Excel(name = "拉黑数", width = 15)
+    @ApiModelProperty(value = "拉黑数")
+    private Integer block;
+    /**
+     * 减少此类作品数
+     */
+    @Excel(name = "减少此类作品数", width = 15)
+    @ApiModelProperty(value = "减少此类作品数")
+    private Integer negative;
+    /**
+     * 应用下载数据-安卓下载开始数
+     */
+    @Excel(name = "应用下载数据-安卓下载开始数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-安卓下载开始数")
+    private Integer downloadStarted;
+    /**
+     * 应用下载数据-安卓下载完成数
+     */
+    @Excel(name = "应用下载数据-安卓下载完成数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-安卓下载完成数")
+    private Integer downloadCompleted;
+    /**
+     * 应用下载数据-激活数
+     */
+    @Excel(name = "应用下载数据-激活数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-激活数")
+    private Integer activation;
+    /**
+     * 提交按钮点击数
+     */
+    @Excel(name = "提交按钮点击数", width = 15)
+    @ApiModelProperty(value = "提交按钮点击数")
+    private Integer submit;
+    /**
+     * 日期
+     */
+    @Excel(name = "日期", width = 15)
+    @ApiModelProperty(value = "日期")
+    private String statDate;
+    /**
+     * 封面点击数
+     */
+    @Excel(name = "封面点击数", width = 15)
+    @ApiModelProperty(value = "封面点击数")
+    private Integer photoClick;
+    /**
+     * 封面点击率
+     */
+    @Excel(name = "封面点击率", width = 15)
+    @ApiModelProperty(value = "封面点击率")
+    private Double photoClickRatio;
+    /**
+     * 行为率
+     */
+    @Excel(name = "行为率", width = 15)
+    @ApiModelProperty(value = "行为率")
+    private Double actionRatio;
+    /**
+     * 平均千次曝光花费(元)
+     */
+    @Excel(name = "平均千次曝光花费(元)", width = 15)
+    @ApiModelProperty(value = "平均千次曝光花费(元)")
+    private java.math.BigDecimal impression1kCost;
+    /**
+     * 平均点击单价(元)
+     */
+    @Excel(name = "平均点击单价(元)", width = 15)
+    @ApiModelProperty(value = "平均点击单价(元)")
+    private java.math.BigDecimal photoClickCost;
+    /**
+     * 平均行为单价(元)
+     */
+    @Excel(name = "平均行为单价(元)", width = 15)
+    @ApiModelProperty(value = "平均行为单价(元)")
+    private java.math.BigDecimal actionCost;
+    /**
+     * 应用下载数据-首日付费次数
+     */
+    @Excel(name = "应用下载数据-首日付费次数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-首日付费次数")
+    private Integer eventPayFirstDay;
+    /**
+     * 应用下载数据-首日付费金额
+     */
+    @Excel(name = "应用下载数据-首日付费金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-首日付费金额")
+    private java.math.BigDecimal eventPayPurchaseAmountFirstDay;
+    /**
+     * 应用下载数据-首日ROI
+     */
+    @Excel(name = "应用下载数据-首日ROI", width = 15)
+    @ApiModelProperty(value = "应用下载数据-首日ROI")
+    private Double eventPayFirstDayRoi;
+    /**
+     * 应用下载数据-付费次数
+     */
+    @Excel(name = "应用下载数据-付费次数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付费次数")
+    private Integer eventPay;
+    /**
+     * 应用下载数据-付费金额
+     */
+    @Excel(name = "应用下载数据-付费金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付费金额")
+    private java.math.BigDecimal eventPayPurchaseAmount;
+    /**
+     * 应用下载数据-ROI
+     */
+    @Excel(name = "应用下载数据-ROI", width = 15)
+    @ApiModelProperty(value = "应用下载数据-ROI")
+    private Double eventPayRoi;
+    /**
+     * 应用下载数据-注册数
+     */
+    @Excel(name = "应用下载数据-注册数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-注册数")
+    private Integer eventRegister;
+    /**
+     * 应用下载数据-注册成本
+     */
+    @Excel(name = "应用下载数据-注册成本", width = 15)
+    @ApiModelProperty(value = "应用下载数据-注册成本")
+    private java.math.BigDecimal eventRegisterCost;
+    /**
+     * 应用下载数据-注册率
+     */
+    @Excel(name = "应用下载数据-注册率", width = 15)
+    @ApiModelProperty(value = "应用下载数据-注册率")
+    private Double eventRegisterRatio;
+    /**
+     * 应用下载数据-完件数
+     */
+    @Excel(name = "应用下载数据-完件数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-完件数")
+    private Integer eventJinJianApp;
+    /**
+     * 应用下载数据-完件成本
+     */
+    @Excel(name = "应用下载数据-完件成本", width = 15)
+    @ApiModelProperty(value = "应用下载数据-完件成本")
+    private java.math.BigDecimal eventJinJianAppCost;
+    /**
+     * 应用下载数据-授信数
+     */
+    @Excel(name = "应用下载数据-授信数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-授信数")
+    private Integer eventCreditGrantApp;
+    /**
+     * 应用下载数据-授信成本
+     */
+    @Excel(name = "应用下载数据-授信成本", width = 15)
+    @ApiModelProperty(value = "应用下载数据-授信成本")
+    private java.math.BigDecimal eventCreditGrantAppCost;
+    /**
+     * 应用下载数据-授信率
+     */
+    @Excel(name = "应用下载数据-授信率", width = 15)
+    @ApiModelProperty(value = "应用下载数据-授信率")
+    private Double eventCreditGrantAppRatio;
+    /**
+     * 应用下载数据-付款成功数
+     */
+    @Excel(name = "应用下载数据-付款成功数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付款成功数")
+    private Integer eventOrderPaid;
+    /**
+     * 应用下载数据-付款成功金额
+     */
+    @Excel(name = "应用下载数据-付款成功金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付款成功金额")
+    private java.math.BigDecimal eventOrderPaidPurchaseAmount;
+    /**
+     * 落地页数据-落地页完件数
+     */
+    @Excel(name = "落地页数据-落地页完件数", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页完件数")
+    private Integer eventJinJianLandingPage;
+    /**
+     * 落地页数据-落地页完件成本
+     */
+    @Excel(name = "落地页数据-落地页完件成本", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页完件成本")
+    private java.math.BigDecimal eventJinJianLandingPageCost;
+    /**
+     * 落地页数据-落地页授信数
+     */
+    @Excel(name = "落地页数据-落地页授信数", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页授信数")
+    private Integer eventCreditGrantLandingPage;
+    /**
+     * 落地页数据-落地页授信成本
+     */
+    @Excel(name = "落地页数据-落地页授信成本", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页授信成本")
+    private java.math.BigDecimal eventCreditGrantLandingPageCost;
+    /**
+     * 落地页数据-落地页授信率
+     */
+    @Excel(name = "落地页数据-落地页授信率", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页授信率")
+    private Double eventCreditGrantLandingRatio;
+    /**
+     * 应用下载数据-次留成本(仅支持分日查询)
+     */
+    @Excel(name = "应用下载数据-次留成本(仅支持分日查询)", width = 15)
+    @ApiModelProperty(value = "应用下载数据-次留成本(仅支持分日查询)")
+    private java.math.BigDecimal eventNextDayStayCost;
+    /**
+     * 应用下载数据-次留率(仅支持分日查询)
+     */
+    @Excel(name = "应用下载数据-次留率(仅支持分日查询)", width = 15)
+    @ApiModelProperty(value = "应用下载数据-次留率(仅支持分日查询)")
+    private Integer eventNextDayStayRatio;
+    /**
+     * 落地页数据-表单提交点击率
+     */
+    @Excel(name = "落地页数据-表单提交点击率", width = 15)
+    @ApiModelProperty(value = "落地页数据-表单提交点击率")
+    private Double formActionRatio;
+    /**
+     * 应用下载数据-单次付款成本
+     */
+    @Excel(name = "应用下载数据-单次付款成本", width = 15)
+    @ApiModelProperty(value = "应用下载数据-单次付款成本")
+    private java.math.BigDecimal eventOrderPaidCost;
+    /**
+     * 应用下载数据-次留数(仅支持分日查询)
+     */
+    @Excel(name = "应用下载数据-次留数(仅支持分日查询)", width = 15)
+    @ApiModelProperty(value = "应用下载数据-次留数(仅支持分日查询)")
+    private Integer eventNextDayStay;
+    /**
+     * 落地页数据-表单提交单价
+     */
+    @Excel(name = "落地页数据-表单提交单价", width = 15)
+    @ApiModelProperty(value = "落地页数据-表单提交单价")
+    private java.math.BigDecimal formCost;
+    /**
+     * 落地页数据-表单提交数
+     */
+    @Excel(name = "落地页数据-表单提交数", width = 15)
+    @ApiModelProperty(value = "落地页数据-表单提交数")
+    private Integer formCount;
+    /**
+     * 3s播放率
+     */
+    @Excel(name = "3s播放率", width = 15)
+    @ApiModelProperty(value = "3s播放率")
+    private Double play3sRatio;
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+}

+ 34 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaiShouReportDailyMaterialVo.java

@@ -0,0 +1,34 @@
+package cn.com.ctop.kuaishou.modules.report.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+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
+ * @version V1.0
+ * @date 2020-09-09
+ */
+@Data
+
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class KuaiShouReportDailyMaterialVo {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+
+    @Excel(name = "计划ID", width = 15)
+    @ApiModelProperty(value = "计划ID")
+    private Long photoId;
+}

+ 84 - 74
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyGroup.java

@@ -1,9 +1,9 @@
 package cn.com.ctop.kuaishou.modules.report.entity;
 
-import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -14,118 +14,128 @@ import java.util.Date;
 @TableName("ctop_kuaishou_report_daily_group")
 public class KuaishouReportDailyGroup implements Serializable {
     private static final long serialVersionUID = 1L;
-    @TableId
-    private String id;
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
 
     private Long accountId;
 
+    private Long unitId;
+
     private Long campaignId;
-    private String campaignName;
 
-    @JsonProperty("unit_id")
-    private Long unitId;
     private String unitName;
-    private Integer status;
 
-    @JsonProperty("stat_date")
-    private String statDate;
+    private String campaignName;
+
+    private Integer status;
 
-    @JsonProperty
     private BigDecimal charge;
-    @JsonProperty
+
     private Long photoShow;
-    @JsonProperty("photo_click")
-    @TableField("photo_click")
-    private Long photoClick;
-    @JsonProperty
+
     private Long aclick;
-    @JsonProperty
+
     private Long bclick;
-    @JsonProperty
-    private Long share;
-    @JsonProperty
-    private Long comment;
-    @JsonProperty
+
+    private Long photoShare;
+
+    private Long photoComment;
+
     private Long photoLike;
-    @JsonProperty
+
     private Long follow;
-    @JsonProperty("cancel_follow")
+
     private Long cancelFollow;
-    @JsonProperty
+
     private Long report;
-    @JsonProperty
+
     private Long block;
-    @JsonProperty
+
     private Long negative;
-    @JsonProperty("download_started")
+
     private Long downloadStarted;
-    @JsonProperty("download_completed")
+
     private Long downloadCompleted;
-    @JsonProperty
+
     private Long activation;
-    @JsonProperty
+
     private Long submit;
 
-    @JsonProperty
-    private BigDecimal photoClickRatio;
-    @JsonProperty
-    private BigDecimal actionRatio;
-    @JsonProperty("impression_1k_cost")
-    @TableField("impression_1k_cost")
+    private String statDate;
+
+    private Long photoClick;
+
+    private Double photoClickRatio;
+
+    private Double actionRatio;
+
     private BigDecimal impression1kCost;
-    @JsonProperty
+
     private BigDecimal photoClickCost;
-    @JsonProperty
+
     private BigDecimal actionCost;
-    @JsonProperty
+
     private Long eventPayFirstDay;
-    @JsonProperty
-    private BigDecimal eventPayFirstDayRoi;
-    @JsonProperty
-    private BigDecimal eventPay;
-    @JsonProperty
+
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+
+    private Double eventPayFirstDayRoi;
+
+    private Long eventPay;
+
     private BigDecimal eventPayPurchaseAmount;
-    @JsonProperty
-    private BigDecimal eventPayRoi;
-    @JsonProperty
+
+    private Double eventPayRoi;
+
     private Long eventRegister;
-    @JsonProperty
+
     private BigDecimal eventRegisterCost;
-    @JsonProperty
+
+    private Double eventRegisterRatio;
+
     private Long eventJinJianApp;
-    @JsonProperty
+
     private BigDecimal eventJinJianAppCost;
-    @JsonProperty
-    private BigDecimal eventPayPurchaseAmountFirstDay;
-    @JsonProperty
+
     private Long eventCreditGrantApp;
-    @JsonProperty
+
     private BigDecimal eventCreditGrantAppCost;
-    @JsonProperty
-    private BigDecimal eventCreditGrantAppRatio;
-    @JsonProperty
-    private BigDecimal eventOrderPaid;
-    @JsonProperty
+
+    private Double eventCreditGrantAppRatio;
+
+    private Long eventOrderPaid;
+
     private BigDecimal eventOrderPaidPurchaseAmount;
-    @JsonProperty
-    private BigDecimal eventOrderPaidCost;
-    @JsonProperty
-    private Long formCount;
-    @JsonProperty
-    private BigDecimal formCost;
-    @JsonProperty
-    private BigDecimal formActionRatio;
-    @JsonProperty
+
     private Long eventJinJianLandingPage;
-    @JsonProperty
+
     private BigDecimal eventJinJianLandingPageCost;
-    @JsonProperty
+
     private Long eventCreditGrantLandingPage;
-    @JsonProperty
+
     private BigDecimal eventCreditGrantLandingPageCost;
-    @JsonProperty
+
+    private Double eventCreditGrantLandingRatio;
+
+    private BigDecimal eventNextDayStayCost;
+
+    private Long eventNextDayStayRatio;
+
+    private Double formActionRatio;
+
+    private BigDecimal eventOrderPaidCost;
+
+    private Long eventNextDayStay;
+
+    private BigDecimal formCost;
+
+    private Long formCount;
+
+    private Double play3sRatio;
+
     private Date createTime;
-    @JsonProperty
+
     private Date updateTime;
 
     private String channelCode;

+ 13 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/VideoGetvo.java

@@ -0,0 +1,13 @@
+package cn.com.ctop.kuaishou.modules.report.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+@Data
+public class VideoGetvo implements Serializable {
+    private String signature;
+    private Integer channelType;
+
+}

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyGroupMapper.java

@@ -12,4 +12,6 @@ public interface KuaishouReportDailyGroupMapper extends BaseMapper<KuaishouRepor
             "set channel_code = substring_index(unit_name, '-', 1) " +
             "where stat_date =#{date}")
     void formatChannelCode(@Param("date") String date);
+
+    int insertSelective(KuaishouReportDailyGroup record);
 }

+ 391 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyGroupMapper.xml

@@ -108,4 +108,395 @@
     </insert>
 
 
+
+
+
+
+
+
+
+
+
+    <insert id="insertSelective" parameterType="cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyGroup" >
+        replace into ctop_kuaishou_report_daily_group
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="id != null" >
+                id,
+            </if>
+            <if test="accountId != null" >
+                account_id,
+            </if>
+            <if test="unitId != null" >
+                unit_id,
+            </if>
+            <if test="campaignId != null" >
+                campaign_id,
+            </if>
+            <if test="status != null" >
+                status,
+            </if>
+            <if test="charge != null" >
+                charge,
+            </if>
+            <if test="photoShow != null" >
+                photo_show,
+            </if>
+            <if test="aclick != null" >
+                aclick,
+            </if>
+            <if test="bclick != null" >
+                bclick,
+            </if>
+            <if test="photoShare != null" >
+                photo_share,
+            </if>
+            <if test="photoComment != null" >
+                photo_comment,
+            </if>
+            <if test="photoLike != null" >
+                photo_like,
+            </if>
+            <if test="follow != null" >
+                follow,
+            </if>
+            <if test="cancelFollow != null" >
+                cancel_follow,
+            </if>
+            <if test="report != null" >
+                report,
+            </if>
+            <if test="block != null" >
+                block,
+            </if>
+            <if test="negative != null" >
+                negative,
+            </if>
+            <if test="downloadStarted != null" >
+                download_started,
+            </if>
+            <if test="downloadCompleted != null" >
+                download_completed,
+            </if>
+            <if test="activation != null" >
+                activation,
+            </if>
+            <if test="submit != null" >
+                submit,
+            </if>
+            <if test="statDate != null" >
+                stat_date,
+            </if>
+            <if test="photoClick != null" >
+                photo_click,
+            </if>
+            <if test="photoClickRatio != null" >
+                photo_click_ratio,
+            </if>
+            <if test="actionRatio != null" >
+                action_ratio,
+            </if>
+            <if test="impression1kCost != null" >
+                impression_1k_cost,
+            </if>
+            <if test="photoClickCost != null" >
+                photo_click_cost,
+            </if>
+            <if test="actionCost != null" >
+                action_cost,
+            </if>
+            <if test="eventPayFirstDay != null" >
+                event_pay_first_day,
+            </if>
+            <if test="eventPayPurchaseAmountFirstDay != null" >
+                event_pay_purchase_amount_first_day,
+            </if>
+            <if test="eventPayFirstDayRoi != null" >
+                event_pay_first_day_roi,
+            </if>
+            <if test="eventPay != null" >
+                event_pay,
+            </if>
+            <if test="eventPayPurchaseAmount != null" >
+                event_pay_purchase_amount,
+            </if>
+            <if test="eventPayRoi != null" >
+                event_pay_roi,
+            </if>
+            <if test="eventRegister != null" >
+                event_register,
+            </if>
+            <if test="eventRegisterCost != null" >
+                event_register_cost,
+            </if>
+            <if test="eventRegisterRatio != null" >
+                event_register_ratio,
+            </if>
+            <if test="eventJinJianApp != null" >
+                event_jin_jian_app,
+            </if>
+            <if test="eventJinJianAppCost != null" >
+                event_jin_jian_app_cost,
+            </if>
+            <if test="eventCreditGrantApp != null" >
+                event_credit_grant_app,
+            </if>
+            <if test="eventCreditGrantAppCost != null" >
+                event_credit_grant_app_cost,
+            </if>
+            <if test="eventCreditGrantAppRatio != null" >
+                event_credit_grant_app_ratio,
+            </if>
+            <if test="eventOrderPaid != null" >
+                event_order_paid,
+            </if>
+            <if test="eventOrderPaidPurchaseAmount != null" >
+                event_order_paid_purchase_amount,
+            </if>
+            <if test="eventJinJianLandingPage != null" >
+                event_jin_jian_landing_page,
+            </if>
+            <if test="eventJinJianLandingPageCost != null" >
+                event_jin_jian_landing_page_cost,
+            </if>
+            <if test="eventCreditGrantLandingPage != null" >
+                event_credit_grant_landing_page,
+            </if>
+            <if test="eventCreditGrantLandingPageCost != null" >
+                event_credit_grant_landing_page_cost,
+            </if>
+            <if test="eventCreditGrantLandingRatio != null" >
+                event_credit_grant_landing_ratio,
+            </if>
+            <if test="eventNextDayStayCost != null" >
+                event_next_day_stay_cost,
+            </if>
+            <if test="eventNextDayStayRatio != null" >
+                event_next_day_stay_ratio,
+            </if>
+            <if test="formActionRatio != null" >
+                form_action_ratio,
+            </if>
+            <if test="eventOrderPaidCost != null" >
+                event_order_paid_cost,
+            </if>
+            <if test="eventNextDayStay != null" >
+                event_next_day_stay,
+            </if>
+            <if test="formCost != null" >
+                form_cost,
+            </if>
+            <if test="formCount != null" >
+                form_count,
+            </if>
+            <if test="play3sRatio != null" >
+                play_3s_ratio,
+            </if>
+            <if test="createTime != null" >
+                create_time,
+            </if>
+            <if test="updateTime != null" >
+                update_time,
+            </if>
+            <if test="channelCode != null" >
+                channel_code,
+            </if>
+            <if test="unitName != null" >
+                unit_name,
+            </if>
+            <if test="campaignName != null" >
+                campaign_name,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="id != null" >
+                #{id,jdbcType=BIGINT},
+            </if>
+            <if test="accountId != null" >
+                #{accountId,jdbcType=BIGINT},
+            </if>
+            <if test="unitId != null" >
+                #{unitId,jdbcType=BIGINT},
+            </if>
+            <if test="campaignId != null" >
+                #{campaignId,jdbcType=BIGINT},
+            </if>
+            <if test="status != null" >
+                #{status,jdbcType=INTEGER},
+            </if>
+            <if test="charge != null" >
+                #{charge,jdbcType=DECIMAL},
+            </if>
+            <if test="photoShow != null" >
+                #{photoShow,jdbcType=BIGINT},
+            </if>
+            <if test="aclick != null" >
+                #{aclick,jdbcType=BIGINT},
+            </if>
+            <if test="bclick != null" >
+                #{bclick,jdbcType=BIGINT},
+            </if>
+            <if test="photoShare != null" >
+                #{photoShare,jdbcType=BIGINT},
+            </if>
+            <if test="photoComment != null" >
+                #{photoComment,jdbcType=BIGINT},
+            </if>
+            <if test="photoLike != null" >
+                #{photoLike,jdbcType=BIGINT},
+            </if>
+            <if test="follow != null" >
+                #{follow,jdbcType=BIGINT},
+            </if>
+            <if test="cancelFollow != null" >
+                #{cancelFollow,jdbcType=BIGINT},
+            </if>
+            <if test="report != null" >
+                #{report,jdbcType=BIGINT},
+            </if>
+            <if test="block != null" >
+                #{block,jdbcType=BIGINT},
+            </if>
+            <if test="negative != null" >
+                #{negative,jdbcType=BIGINT},
+            </if>
+            <if test="downloadStarted != null" >
+                #{downloadStarted,jdbcType=BIGINT},
+            </if>
+            <if test="downloadCompleted != null" >
+                #{downloadCompleted,jdbcType=BIGINT},
+            </if>
+            <if test="activation != null" >
+                #{activation,jdbcType=BIGINT},
+            </if>
+            <if test="submit != null" >
+                #{submit,jdbcType=BIGINT},
+            </if>
+            <if test="statDate != null" >
+                #{statDate,jdbcType=VARCHAR},
+            </if>
+            <if test="photoClick != null" >
+                #{photoClick,jdbcType=BIGINT},
+            </if>
+            <if test="photoClickRatio != null" >
+                #{photoClickRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="actionRatio != null" >
+                #{actionRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="impression1kCost != null" >
+                #{impression1kCost,jdbcType=DECIMAL},
+            </if>
+            <if test="photoClickCost != null" >
+                #{photoClickCost,jdbcType=DECIMAL},
+            </if>
+            <if test="actionCost != null" >
+                #{actionCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventPayFirstDay != null" >
+                #{eventPayFirstDay,jdbcType=BIGINT},
+            </if>
+            <if test="eventPayPurchaseAmountFirstDay != null" >
+                #{eventPayPurchaseAmountFirstDay,jdbcType=DECIMAL},
+            </if>
+            <if test="eventPayFirstDayRoi != null" >
+                #{eventPayFirstDayRoi,jdbcType=DOUBLE},
+            </if>
+            <if test="eventPay != null" >
+                #{eventPay,jdbcType=BIGINT},
+            </if>
+            <if test="eventPayPurchaseAmount != null" >
+                #{eventPayPurchaseAmount,jdbcType=DECIMAL},
+            </if>
+            <if test="eventPayRoi != null" >
+                #{eventPayRoi,jdbcType=DOUBLE},
+            </if>
+            <if test="eventRegister != null" >
+                #{eventRegister,jdbcType=BIGINT},
+            </if>
+            <if test="eventRegisterCost != null" >
+                #{eventRegisterCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventRegisterRatio != null" >
+                #{eventRegisterRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="eventJinJianApp != null" >
+                #{eventJinJianApp,jdbcType=BIGINT},
+            </if>
+            <if test="eventJinJianAppCost != null" >
+                #{eventJinJianAppCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventCreditGrantApp != null" >
+                #{eventCreditGrantApp,jdbcType=BIGINT},
+            </if>
+            <if test="eventCreditGrantAppCost != null" >
+                #{eventCreditGrantAppCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventCreditGrantAppRatio != null" >
+                #{eventCreditGrantAppRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="eventOrderPaid != null" >
+                #{eventOrderPaid,jdbcType=BIGINT},
+            </if>
+            <if test="eventOrderPaidPurchaseAmount != null" >
+                #{eventOrderPaidPurchaseAmount,jdbcType=DECIMAL},
+            </if>
+            <if test="eventJinJianLandingPage != null" >
+                #{eventJinJianLandingPage,jdbcType=BIGINT},
+            </if>
+            <if test="eventJinJianLandingPageCost != null" >
+                #{eventJinJianLandingPageCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventCreditGrantLandingPage != null" >
+                #{eventCreditGrantLandingPage,jdbcType=BIGINT},
+            </if>
+            <if test="eventCreditGrantLandingPageCost != null" >
+                #{eventCreditGrantLandingPageCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventCreditGrantLandingRatio != null" >
+                #{eventCreditGrantLandingRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="eventNextDayStayCost != null" >
+                #{eventNextDayStayCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventNextDayStayRatio != null" >
+                #{eventNextDayStayRatio,jdbcType=BIGINT},
+            </if>
+            <if test="formActionRatio != null" >
+                #{formActionRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="eventOrderPaidCost != null" >
+                #{eventOrderPaidCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventNextDayStay != null" >
+                #{eventNextDayStay,jdbcType=BIGINT},
+            </if>
+            <if test="formCost != null" >
+                #{formCost,jdbcType=DECIMAL},
+            </if>
+            <if test="formCount != null" >
+                #{formCount,jdbcType=BIGINT},
+            </if>
+            <if test="play3sRatio != null" >
+                #{play3sRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="createTime != null" >
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateTime != null" >
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="channelCode != null" >
+                #{channelCode,jdbcType=VARCHAR},
+            </if>
+            <if test="unitName != null" >
+                #{unitName,jdbcType=LONGVARCHAR},
+            </if>
+            <if test="campaignName != null" >
+                #{campaignName,jdbcType=LONGVARCHAR},
+            </if>
+        </trim>
+    </insert>
+
+
+
 </mapper>

+ 48 - 0
module-oa/pom.xml

@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>jeecg-boot-parent</artifactId>
+        <groupId>org.jeecgframework.boot</groupId>
+        <version>2.0.2</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>cn.com.ctop</groupId>
+    <artifactId>module-oa</artifactId>
+    <version>2.0.2</version>
+    <name>module-oa</name>
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <maven.compiler.source>1.7</maven.compiler.source>
+        <maven.compiler.target>1.7</maven.compiler.target>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>cn.com.ctop</groupId>
+            <artifactId>module-common</artifactId>
+            <version>2.0.2</version>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <resources>
+            <!-- 解决MyBatis配置文件引入问题 -->
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.properties</include>
+                    <include>**/*.xml</include>
+                </includes>
+                <!-- 是否替换资源中的属性-->
+                <filtering>false</filtering>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+        </resources>
+    </build>
+
+</project>

+ 20 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/constant/QYWxConstant.java

@@ -0,0 +1,20 @@
+package cn.com.ctop.oa.modules.constant;
+
+public class QYWxConstant {
+    public static final String QYWX_CORP_ID = "ww24b8a47826f5875f";
+    public static final Integer QYWX_AGENT_ID = 1000004;
+    public static final String QYWX_CORP_SECRET = "1YWGDtuZWrQDl6US3OPHG8_pvuNgP1TeUsOmfRk6GmQ";
+
+
+    public static final Integer QYWX_OA_AGENT_ID = 3010011;
+    public static final String QYWX_OA_CORP_SECRET = "MDeiFSCwIlcmcR1zrYvmjNlsoYFGl8I770uuUezWgGE";
+
+
+    public static final String QYWX_API_URL = "https://qyapi.weixin.qq.com";  //企业微信api域名
+    public static final String QYWX_DEPART_LIST = "https://qyapi.weixin.qq.com/cgi-bin/department/list";  //获取部门列表
+    public static final String QYWX_GET_TOKEN = "/cgi-bin/gettoken";  //获取token
+    public static final String QYWX_USER_SIMPLELIST = "https://qyapi.weixin.qq.com/cgi-bin/user/simplelist";  //获取部门下员工简单信息
+    public static final String QYWX_CHECKIN_DATA = "https://qyapi.weixin.qq.com/cgi-bin/checkin/getcheckindata";  //获取部门下员工简单信息
+
+
+}

+ 248 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/controller/WechatCheckinDataController.java

@@ -0,0 +1,248 @@
+package cn.com.ctop.oa.modules.controller;
+
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.oa.modules.entity.WechatCheckinData;
+import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
+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.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 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;
+
+/**
+ * 企业微信用户
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-15
+ */
+@Slf4j
+@Api(tags = "企业微信用户")
+@RestController
+@RequestMapping("/oa/wechatCheckinData")
+public class WechatCheckinDataController {
+    @Autowired
+    private IWechatCheckinDataService wechatCheckinDataService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param wechatCheckinData
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "企业微信用户-分页列表查询")
+    @ApiOperation(value = "企业微信用户-分页列表查询", notes = "企业微信用户-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<WechatCheckinData>> queryPageList(WechatCheckinData wechatCheckinData,
+                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                          HttpServletRequest req) {
+        Result<IPage<WechatCheckinData>> result = new Result<>();
+        QueryWrapper<WechatCheckinData> queryWrapper = QueryGenerator.initQueryWrapper(wechatCheckinData, req.getParameterMap());
+        Page<WechatCheckinData> page = new Page<WechatCheckinData>(pageNo, pageSize);
+        IPage<WechatCheckinData> pageList = wechatCheckinDataService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param wechatCheckinData
+     * @return
+     */
+    @AutoLog(value = "企业微信用户-添加")
+    @ApiOperation(value = "企业微信用户-添加", notes = "企业微信用户-添加")
+    @PostMapping(value = "/add")
+    public Result<WechatCheckinData> add(@RequestBody WechatCheckinData wechatCheckinData) {
+        Result<WechatCheckinData> result = new Result<>();
+        try {
+            wechatCheckinDataService.save(wechatCheckinData);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param wechatCheckinData
+     * @return
+     */
+    @AutoLog(value = "企业微信用户-编辑")
+    @ApiOperation(value = "企业微信用户-编辑", notes = "企业微信用户-编辑")
+    @PutMapping(value = "/edit")
+    public Result<WechatCheckinData> edit(@RequestBody WechatCheckinData wechatCheckinData) {
+        Result<WechatCheckinData> result = new Result<WechatCheckinData>();
+        WechatCheckinData wechatCheckinDataEntity = wechatCheckinDataService.getById(wechatCheckinData.getId());
+        if (wechatCheckinDataEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = wechatCheckinDataService.updateById(wechatCheckinData);
+            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 {
+            wechatCheckinDataService.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<WechatCheckinData> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<WechatCheckinData> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.wechatCheckinDataService.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<WechatCheckinData> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<WechatCheckinData> result = new Result<>();
+        WechatCheckinData wechatCheckinData = wechatCheckinDataService.getById(id);
+        if (wechatCheckinData == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(wechatCheckinData);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<WechatCheckinData> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                WechatCheckinData wechatCheckinData = JSON.parseObject(deString, WechatCheckinData.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(wechatCheckinData, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<WechatCheckinData> pageList = wechatCheckinDataService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "企业微信用户列表");
+        mv.addObject(NormalExcelConstants.CLASS, WechatCheckinData.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<WechatCheckinData> listWechatCheckinDatas = ExcelImportUtil.importExcel(file.getInputStream(), WechatCheckinData.class, params);
+                wechatCheckinDataService.saveBatch(listWechatCheckinDatas);
+                return Result.ok("文件导入成功!数据行数:" + listWechatCheckinDatas.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("文件导入失败!");
+    }
+
+}

+ 248 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/controller/WechatDepartmentController.java

@@ -0,0 +1,248 @@
+package cn.com.ctop.oa.modules.controller;
+
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.oa.modules.entity.WechatDepartment;
+import cn.com.ctop.oa.modules.service.IWechatDepartmentService;
+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.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 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;
+
+/**
+ * 部门列表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-10
+ */
+@Slf4j
+@Api(tags = "部门列表")
+@RestController
+@RequestMapping("/oa/wechatDepartment")
+public class WechatDepartmentController {
+    @Autowired
+    private IWechatDepartmentService wechatDepartmentService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param wechatDepartment
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "部门列表-分页列表查询")
+    @ApiOperation(value = "部门列表-分页列表查询", notes = "部门列表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<WechatDepartment>> queryPageList(WechatDepartment wechatDepartment,
+                                                         @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                         HttpServletRequest req) {
+        Result<IPage<WechatDepartment>> result = new Result<>();
+        QueryWrapper<WechatDepartment> queryWrapper = QueryGenerator.initQueryWrapper(wechatDepartment, req.getParameterMap());
+        Page<WechatDepartment> page = new Page<WechatDepartment>(pageNo, pageSize);
+        IPage<WechatDepartment> pageList = wechatDepartmentService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param wechatDepartment
+     * @return
+     */
+    @AutoLog(value = "部门列表-添加")
+    @ApiOperation(value = "部门列表-添加", notes = "部门列表-添加")
+    @PostMapping(value = "/add")
+    public Result<WechatDepartment> add(@RequestBody WechatDepartment wechatDepartment) {
+        Result<WechatDepartment> result = new Result<>();
+        try {
+            wechatDepartmentService.save(wechatDepartment);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param wechatDepartment
+     * @return
+     */
+    @AutoLog(value = "部门列表-编辑")
+    @ApiOperation(value = "部门列表-编辑", notes = "部门列表-编辑")
+    @PutMapping(value = "/edit")
+    public Result<WechatDepartment> edit(@RequestBody WechatDepartment wechatDepartment) {
+        Result<WechatDepartment> result = new Result<WechatDepartment>();
+        WechatDepartment wechatDepartmentEntity = wechatDepartmentService.getById(wechatDepartment.getId());
+        if (wechatDepartmentEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = wechatDepartmentService.updateById(wechatDepartment);
+            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 {
+            wechatDepartmentService.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<WechatDepartment> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<WechatDepartment> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.wechatDepartmentService.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<WechatDepartment> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<WechatDepartment> result = new Result<>();
+        WechatDepartment wechatDepartment = wechatDepartmentService.getById(id);
+        if (wechatDepartment == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(wechatDepartment);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<WechatDepartment> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                WechatDepartment wechatDepartment = JSON.parseObject(deString, WechatDepartment.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(wechatDepartment, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<WechatDepartment> pageList = wechatDepartmentService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "部门列表列表");
+        mv.addObject(NormalExcelConstants.CLASS, WechatDepartment.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<WechatDepartment> listWechatDepartments = ExcelImportUtil.importExcel(file.getInputStream(), WechatDepartment.class, params);
+                wechatDepartmentService.saveBatch(listWechatDepartments);
+                return Result.ok("文件导入成功!数据行数:" + listWechatDepartments.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("文件导入失败!");
+    }
+
+}

+ 248 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/controller/WechatUserListController.java

@@ -0,0 +1,248 @@
+package cn.com.ctop.oa.modules.controller;
+
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.oa.modules.entity.WechatUserList;
+import cn.com.ctop.oa.modules.service.IWechatUserListService;
+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.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 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;
+
+/**
+ * 企业微信用户
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-15
+ */
+@Slf4j
+@Api(tags = "企业微信用户")
+@RestController
+@RequestMapping("/wechat/wechatUserList")
+public class WechatUserListController {
+    @Autowired
+    private IWechatUserListService wechatUserListService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param wechatUserList
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "企业微信用户-分页列表查询")
+    @ApiOperation(value = "企业微信用户-分页列表查询", notes = "企业微信用户-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<WechatUserList>> queryPageList(WechatUserList wechatUserList,
+                                                       @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                       @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                       HttpServletRequest req) {
+        Result<IPage<WechatUserList>> result = new Result<>();
+        QueryWrapper<WechatUserList> queryWrapper = QueryGenerator.initQueryWrapper(wechatUserList, req.getParameterMap());
+        Page<WechatUserList> page = new Page<WechatUserList>(pageNo, pageSize);
+        IPage<WechatUserList> pageList = wechatUserListService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param wechatUserList
+     * @return
+     */
+    @AutoLog(value = "企业微信用户-添加")
+    @ApiOperation(value = "企业微信用户-添加", notes = "企业微信用户-添加")
+    @PostMapping(value = "/add")
+    public Result<WechatUserList> add(@RequestBody WechatUserList wechatUserList) {
+        Result<WechatUserList> result = new Result<>();
+        try {
+            wechatUserListService.save(wechatUserList);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param wechatUserList
+     * @return
+     */
+    @AutoLog(value = "企业微信用户-编辑")
+    @ApiOperation(value = "企业微信用户-编辑", notes = "企业微信用户-编辑")
+    @PutMapping(value = "/edit")
+    public Result<WechatUserList> edit(@RequestBody WechatUserList wechatUserList) {
+        Result<WechatUserList> result = new Result<WechatUserList>();
+        WechatUserList wechatUserListEntity = wechatUserListService.getById(wechatUserList.getId());
+        if (wechatUserListEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = wechatUserListService.updateById(wechatUserList);
+            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 {
+            wechatUserListService.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<WechatUserList> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<WechatUserList> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.wechatUserListService.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<WechatUserList> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<WechatUserList> result = new Result<>();
+        WechatUserList wechatUserList = wechatUserListService.getById(id);
+        if (wechatUserList == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(wechatUserList);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<WechatUserList> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                WechatUserList wechatUserList = JSON.parseObject(deString, WechatUserList.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(wechatUserList, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<WechatUserList> pageList = wechatUserListService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "企业微信用户列表");
+        mv.addObject(NormalExcelConstants.CLASS, WechatUserList.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<WechatUserList> listWechatUserLists = ExcelImportUtil.importExcel(file.getInputStream(), WechatUserList.class, params);
+                wechatUserListService.saveBatch(listWechatUserLists);
+                return Result.ok("文件导入成功!数据行数:" + listWechatUserLists.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("文件导入失败!");
+    }
+
+}

+ 134 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/entity/WechatCheckinData.java

@@ -0,0 +1,134 @@
+package cn.com.ctop.oa.modules.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;
+
+import java.util.Date;
+
+/**
+ * 企业微信用户
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-15
+ */
+@Data
+@TableName("ctop_wechat_checkin_data")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_wechat_checkin_data对象", description = "企业微信用户")
+public class WechatCheckinData {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private String id;
+    /**
+     * 部门id
+     */
+    @Excel(name = "部门id", width = 15)
+    @ApiModelProperty(value = "部门id")
+    private String departId;
+    /**
+     * 用户
+     */
+    @Excel(name = "用户", width = 15)
+    @ApiModelProperty(value = "用户")
+    private String userId;
+    /**
+     * 打开规则名称
+     */
+    @Excel(name = "打开规则名称", width = 15)
+    @ApiModelProperty(value = "打开规则名称")
+    private String groupName;
+    /**
+     * 打卡类型
+     */
+    @Excel(name = "打卡类型", width = 15)
+    @ApiModelProperty(value = "打卡类型")
+    private String checkinType;
+    /**
+     * 异常类型
+     */
+    @Excel(name = "异常类型", width = 15)
+    @ApiModelProperty(value = "异常类型")
+    private String exceptionType;
+    /**
+     * 打卡时间
+     */
+    @ApiModelProperty(value = "打卡时间")
+    private Date checkinTime;
+    /**
+     * 打开地点
+     */
+    @Excel(name = "打开地点", width = 15)
+    @ApiModelProperty(value = "打开地点")
+    private String locationTitle;
+    /**
+     * 打开地点详情
+     */
+    @Excel(name = "打开地点详情", width = 15)
+    @ApiModelProperty(value = "打开地点详情")
+    private String locationDetail;
+    /**
+     * 打卡wifi名称
+     */
+    @Excel(name = "打卡wifi名称", width = 15)
+    @ApiModelProperty(value = "打卡wifi名称")
+    private String wifiname;
+    /**
+     * 打卡备注
+     */
+    @Excel(name = "打卡备注", width = 15)
+    @ApiModelProperty(value = "打卡备注")
+    private String notes;
+    /**
+     * 打卡的MAC地址/bssid
+     */
+    @Excel(name = "打卡的MAC地址/bssid", width = 15)
+    @ApiModelProperty(value = "打卡的MAC地址/bssid")
+    private String wifimac;
+    /**
+     * 打卡的附件media_id
+     */
+    @Excel(name = "打卡的附件media_id", width = 15)
+    @ApiModelProperty(value = "打卡的附件media_id")
+    private String mediaids;
+    /**
+     * 位置打卡地点纬度
+     */
+    @Excel(name = "位置打卡地点纬度", width = 15)
+    @ApiModelProperty(value = "位置打卡地点纬度")
+    private String lat;
+    /**
+     * 位置打卡地点经度
+     */
+    @Excel(name = "位置打卡地点经度", width = 15)
+    @ApiModelProperty(value = "位置打卡地点经度")
+    private String lng;
+    /**
+     * 打卡设备id
+     */
+    @Excel(name = "打卡设备id", width = 15)
+    @ApiModelProperty(value = "打卡设备id")
+    private String deviceid;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 69 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/entity/WechatDepartment.java

@@ -0,0 +1,69 @@
+package cn.com.ctop.oa.modules.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;
+
+import java.util.Date;
+
+/**
+ * 部门列表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-10
+ */
+@Data
+@TableName("ctop_wechat_department")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_wechat_department对象", description = "部门列表")
+public class WechatDepartment {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 部门名称
+     */
+    @Excel(name = "部门名称", width = 15)
+    @ApiModelProperty(value = "部门名称")
+    private String departName;
+    /**
+     * 部门id
+     */
+    @Excel(name = "部门id", width = 15)
+    @ApiModelProperty(value = "部门id")
+    private String departId;
+    /**
+     * 父部门id
+     */
+    @Excel(name = "父部门id", width = 15)
+    @ApiModelProperty(value = "父部门id")
+    private String parentId;
+    /**
+     * 排序
+     */
+    @Excel(name = "排序", width = 15)
+    @ApiModelProperty(value = "排序")
+    private String departOrder;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 63 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/entity/WechatUserList.java

@@ -0,0 +1,63 @@
+package cn.com.ctop.oa.modules.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;
+
+import java.util.Date;
+
+/**
+ * 企业微信用户
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-15
+ */
+@Data
+@TableName("ctop_wechat_user_list")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_wechat_user_list对象", description = "企业微信用户")
+public class WechatUserList {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+    private String id;
+    /**
+     * 成员名称
+     */
+    @Excel(name = "成员名称", width = 15)
+    @ApiModelProperty(value = "成员名称")
+    private String userName;
+    /**
+     * 成员id
+     */
+    @Excel(name = "成员id", width = 15)
+    @ApiModelProperty(value = "成员id")
+    private String userId;
+    /**
+     * 部门id
+     */
+    @Excel(name = "部门id", width = 15)
+    @ApiModelProperty(value = "部门id")
+    private String departId;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

+ 59 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/enums/DepartEnum.java

@@ -0,0 +1,59 @@
+package cn.com.ctop.oa.modules.enums;
+
+
+import cn.com.ctop.common.module.utils.Check;
+
+public enum DepartEnum {
+
+
+    depart1("快手事业部"),
+    depart2("头条事业部"),
+    depart3("销售部"),
+    depart4("研发中心部"),
+    depart5("内容中心部"),
+    depart6("媒介部"),
+    depart7("渠道部"),
+    depart8("制片部"),
+    depart9("法务部"),
+    depart10("财务部"),
+    depart11("人事行政部");
+
+
+    private String departName;
+
+
+    private DepartEnum(String departName) {
+        this.departName = departName;
+
+    }
+
+    public static Boolean getDepart(String departNameStr) {
+        if (Check.isNull(departNameStr)) {
+            return false;
+        }
+        for (DepartEnum departEnum : DepartEnum.values()) {
+            String departName = departEnum.getDepartName();
+
+            if (departNameStr.equals(departName)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+
+    public String getDepartName() {
+        return departName;
+    }
+
+    public void setDepartName(String departName) {
+        this.departName = departName;
+    }
+
+    @Override
+    public String toString() {
+        return "DepartEnum{" +
+                "departName='" + departName + '\'' +
+                '}';
+    }
+}

+ 15 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/WechatCheckinDataMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.oa.modules.mapper;
+
+import cn.com.ctop.oa.modules.entity.WechatCheckinData;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 企业微信用户
+ *
+ * @author: jeecg-boot
+ * @date: 2020-09-15
+ * @cersion: V1.0
+ */
+public interface WechatCheckinDataMapper extends BaseMapper<WechatCheckinData> {
+
+}

+ 15 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/WechatDepartmentMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.oa.modules.mapper;
+
+import cn.com.ctop.oa.modules.entity.WechatDepartment;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 部门列表
+ *
+ * @author: jeecg-boot
+ * @date: 2020-09-10
+ * @cersion: V1.0
+ */
+public interface WechatDepartmentMapper extends BaseMapper<WechatDepartment> {
+
+}

+ 15 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/WechatUserListMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.oa.modules.mapper;
+
+import cn.com.ctop.oa.modules.entity.WechatUserList;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 企业微信用户
+ *
+ * @author: jeecg-boot
+ * @date: 2020-09-15
+ * @cersion: V1.0
+ */
+public interface WechatUserListMapper extends BaseMapper<WechatUserList> {
+
+}

+ 5 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/xml/WechatCheckinDataMapper.xml

@@ -0,0 +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.oa.modules.mapper.WechatCheckinDataMapper">
+
+</mapper>

+ 5 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/xml/WechatDepartmentMapper.xml

@@ -0,0 +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.oa.modules.mapper.WechatDepartmentMapper">
+
+</mapper>

+ 5 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/mapper/xml/WechatUserListMapper.xml

@@ -0,0 +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.oa.modules.mapper.WechatUserListMapper">
+
+</mapper>

+ 15 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatCheckinDataService.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.oa.modules.service;
+
+import cn.com.ctop.oa.modules.entity.WechatCheckinData;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 企业微信用户
+ * @Author: jeecg-boot
+ * @Date: 2020-09-15
+ * @Version: V1.0
+ */
+public interface IWechatCheckinDataService extends IService<WechatCheckinData> {
+    void getCheckinData();
+
+}

+ 14 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatDepartmentService.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.oa.modules.service;
+
+import cn.com.ctop.oa.modules.entity.WechatDepartment;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 部门列表
+ * @Author: jeecg-boot
+ * @Date: 2020-09-10
+ * @Version: V1.0
+ */
+public interface IWechatDepartmentService extends IService<WechatDepartment> {
+    void getDepartment();
+}

+ 8 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatTokenService.java

@@ -0,0 +1,8 @@
+package cn.com.ctop.oa.modules.service;
+
+import java.util.Map;
+
+public interface IWechatTokenService {
+    Map<String, Object> getQYWXAccessToken();
+    Map<String, Object> getOAAccessToken();
+}

+ 15 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/service/IWechatUserListService.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.oa.modules.service;
+
+import cn.com.ctop.oa.modules.entity.WechatUserList;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 企业微信用户
+ * @Author: jeecg-boot
+ * @Date: 2020-09-15
+ * @Version: V1.0
+ */
+public interface IWechatUserListService extends IService<WechatUserList> {
+    void getUserList();
+
+}

+ 0 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatCheckinDataServiceImpl.java


部分文件因为文件数量过多而无法显示