Prechádzať zdrojové kódy

Merge branch 'master' of http://git.tjyourong.com.cn/ctop/adsp-boot

 Conflicts:
	module-crawler/src/main/java/cn/com/ctop/crawler/modules/taobao/service/impl/TaobaoJhsbybtServiceImpl.java
xuzuoyun 4 rokov pred
rodič
commit
0056192666
100 zmenil súbory, kde vykonal 4785 pridanie a 474 odobranie
  1. 6 5
      jeecg-boot-base-common/src/main/java/org/jeecg/common/constant/AccountReportConstants.java
  2. 14 3
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java
  3. 0 1
      jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/ActivitiProcessController.java
  4. 14 7
      jeecg-boot-module-system/pom.xml
  5. 4 3
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  6. 0 16
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AdvertiserController.java
  7. 150 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BytedanceMusicInfoController.java
  8. 161 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BytedanceMusicTypeController.java
  9. 156 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/DictMusicTypeController.java
  10. 50 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ImageCostController.java
  11. 54 20
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java
  12. 0 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialTagInfoController.java
  13. 30 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java
  14. 175 166
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectTransferRecordController.java
  15. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyCreativeReportLoadJob.java
  16. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IImageReportDailyService.java
  17. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IProjectMemberService.java
  18. 61 45
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ImageReportDailyServiceImpl.java
  19. 27 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java
  20. 20 17
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectTransferRecordServiceImpl.java
  21. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java
  22. 3 0
      jeecg-boot-module-system/src/main/resources/application-dev.yml
  23. 4 0
      jeecg-boot-module-system/src/main/resources/application-prod.yml
  24. 4 0
      jeecg-boot-module-system/src/main/resources/application-prod2.yml
  25. 6 1
      jeecg-boot-module-system/src/main/resources/application-test.yml
  26. 5 2
      jeecg-boot-module-system/src/main/resources/application-wps.yml
  27. 1 0
      jeecg-boot-module-system/src/main/resources/application.yml
  28. 191 88
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  29. 48 0
      module-alarm/pom.xml
  30. 256 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/controller/AlarmEventMetricController.java
  31. 253 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/controller/AlarmEventRuleController.java
  32. 256 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/controller/AlarmEventSendController.java
  33. 269 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/controller/AlarmMetricValueController.java
  34. 89 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/entity/AlarmEventMetric.java
  35. 101 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/entity/AlarmEventRule.java
  36. 77 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/entity/AlarmEventSend.java
  37. 83 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/entity/AlarmMetricValue.java
  38. 18 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/AlarmEventMetricMapper.java
  39. 15 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/AlarmEventRuleMapper.java
  40. 17 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/AlarmEventSendMapper.java
  41. 17 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/AlarmMetricValueMapper.java
  42. 10 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/xml/AlarmEventMetricMapper.xml
  43. 5 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/xml/AlarmEventRuleMapper.xml
  44. 5 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/xml/AlarmEventSendMapper.xml
  45. 5 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/xml/AlarmMetricValueMapper.xml
  46. 14 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/IAlarmEventMetricService.java
  47. 20 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/IAlarmEventRuleService.java
  48. 14 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/IAlarmEventSendService.java
  49. 16 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/IAlarmMetricValueService.java
  50. 19 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/impl/AlarmEventMetricServiceImpl.java
  51. 143 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/impl/AlarmEventRuleServiceImpl.java
  52. 19 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/impl/AlarmEventSendServiceImpl.java
  53. 59 0
      module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/impl/AlarmMetricValueServiceImpl.java
  54. 3 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java
  55. 36 1
      module-common/src/main/java/cn/com/ctop/common/module/enums/MaterialEnum.java
  56. 4 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/MaterialCutFrameMapper.java
  57. 6 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/MaterialParameterMapper.java
  58. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/UserAllocationMapper.java
  59. 12 1
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialCutFrameMapper.xml
  60. 6 1
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml
  61. 15 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialParameterMapper.xml
  62. 7 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/UserAllocationMapper.xml
  63. 1 0
      module-common/src/main/java/cn/com/ctop/common/module/message/handle/impl/EmailSendMsgHandle.java
  64. 3 1
      module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialCutFrameService.java
  65. 37 1
      module-common/src/main/java/cn/com/ctop/common/module/service/IMessageTemplate.java
  66. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/BindAccountAuthServiceImpl.java
  67. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/FileInfoServiceImpl.java
  68. 5 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialCutFrameServiceImpl.java
  69. 56 15
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java
  70. 64 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MessageTemplateImpl.java
  71. 0 3
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MusicTypeServiceImpl.java
  72. 10 3
      module-common/src/main/java/cn/com/ctop/common/module/utils/KuaishouInterfaceConstant.java
  73. 4 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/LoadFileUtil.java
  74. 467 0
      module-common/src/main/java/cn/com/ctop/common/module/vo/ByteDanceReportAccountDailyDTOEntity.java
  75. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/DTO/ImageCostVO.java
  76. 123 0
      module-common/src/main/java/cn/com/ctop/common/module/vo/BytedanceImageCostVOEntity.java
  77. 23 0
      module-common/src/main/java/cn/com/ctop/common/module/vo/KuaishouImageCostVO.java
  78. 152 0
      module-common/src/main/java/cn/com/ctop/common/module/vo/KuaishouImageCostVOEntity.java
  79. 367 0
      module-common/src/main/java/cn/com/ctop/common/module/vo/KuaishouReportAccountDailyDTOEntity.java
  80. 3 3
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/douyin/service/DouyinMusicService.java
  81. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/douyin/service/impl/DouyinMusicServiceImpl.java
  82. 74 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/entity/BytedanceMusicInfo.java
  83. 40 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/entity/BytedanceMusicType.java
  84. 41 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/entity/DictMusicType.java
  85. 14 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/BytedanceMusicInfoMapper.java
  86. 14 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/BytedanceMusicTypeMapper.java
  87. 20 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/DictMusicTypeMapper.java
  88. 5 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/xml/BytedanceMusicInfoMapper.xml
  89. 5 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/xml/BytedanceMusicTypeMapper.xml
  90. 13 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/xml/DictMusicTypeMapper.xml
  91. 14 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/IBytedanceMusicInfoService.java
  92. 14 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/IBytedanceMusicTypeService.java
  93. 16 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/IDictMusicTypeService.java
  94. 18 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/impl/BytedanceMusicInfoServiceImpl.java
  95. 18 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/impl/BytedanceMusicTypeServiceImpl.java
  96. 38 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/impl/DictMusicTypeServiceImpl.java
  97. 25 38
      module-ctop/src/main/java/cn/com/ctop/manage/modules/material/service/impl/MaterialUploadServiceImpl.java
  98. 4 3
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDanceCleanMaterialJob.java
  99. 26 18
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceDailyMaterialReportJob.java
  100. 0 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceDailyMaterialReportRetryJob.java

+ 6 - 5
jeecg-boot-base-common/src/main/java/org/jeecg/common/constant/AccountReportConstants.java

@@ -20,7 +20,6 @@ public class AccountReportConstants {
     /** 单体实例 */
     private static AccountReportConstants instance;
 
-
     /**
      * @return 返回 instance
      */
@@ -35,10 +34,11 @@ public class AccountReportConstants {
      * 字典数据
      */
     //头条字段映射
-    public static Map<String, Map<String,Object>> dicMap = new HashMap<>();
+    public static Map<String, Map<String,Object>> dicMapBy = new HashMap<>();
     //快手字段映射
     public static Map<String, Map<String,Object>> dicMapKs = new HashMap<>();
-
+    //头条视频报表字段映射
+    public static Map<String, Map<String,Object>> dicMapByVideo= new HashMap<>();
     /**
      * 初始化字典
      */
@@ -46,9 +46,10 @@ public class AccountReportConstants {
         //加载json文件
         Object jsonBy=JsonResourceUtil.getJsonObjFromResource("/json_template/bytedance_filed_mapping.json");
         Object jsonKs=JsonResourceUtil.getJsonObjFromResource("/json_template/kuaishou_filed_mapping.json");
+        Object jsonByVideo=JsonResourceUtil.getJsonObjFromResource("/json_template/bytedance_video_report_mapping.json");
         //json 转为map存为静态常量
-        dicMap=JsonResourceUtil.jsonToMap(jsonBy);
+        dicMapBy=JsonResourceUtil.jsonToMap(jsonBy);
         dicMapKs=JsonResourceUtil.jsonToMap(jsonKs);
+        dicMapByVideo=JsonResourceUtil.jsonToMap(jsonByVideo);
     }
-
 }

+ 14 - 3
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -247,6 +247,17 @@ public class DateUtils extends PropertyEditorSupport {
         return new Date();
     }
 
+
+    public static String getStartTime(Date date) {
+        Calendar dateStart = Calendar.getInstance();
+        dateStart.setTime(date);
+        dateStart.set(Calendar.HOUR_OF_DAY, 0);
+        dateStart.set(Calendar.MINUTE, 0);
+        dateStart.set(Calendar.SECOND, 0);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(dateStart.getTime());
+    }
+
     /**
      * 日期转换为字符串
      *
@@ -1502,14 +1513,14 @@ public class DateUtils extends PropertyEditorSupport {
     }
 
     /**
-     * 获取前一天的日期
+     * 以time为节点,获取前几天的日期 yyyy-MM-dd
      *
      * @param
      * @return java.lang.String
      * @throws
      * @author ZHAOXA
      */
-    public static String getLastDay(String time) {
+    public static String getLastDay(String time, int days) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         Calendar calendar = Calendar.getInstance();
         Date date = null;
@@ -1521,7 +1532,7 @@ public class DateUtils extends PropertyEditorSupport {
         calendar.setTime(date);
         int day = calendar.get(Calendar.DATE);
         //                      此处修改为+1则是获取后一天
-        calendar.set(Calendar.DATE, day - 1);
+        calendar.set(Calendar.DATE, day - days);
 
         String lastDay = sdf.format(calendar.getTime());
         return lastDay;

+ 0 - 1
jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/ActivitiProcessController.java

@@ -95,7 +95,6 @@ public class ActivitiProcessController {
                 }
                 return false;
             }).collect(Collectors.toList());
-
         }
         if(null!=list&&!list.isEmpty()){
             List<ActZprocess> getList = new ArrayList<>();

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

@@ -106,6 +106,20 @@
         </dependency>
 
         <dependency>
+            <groupId>cn.com.ctop</groupId>
+            <artifactId>module-shiwan</artifactId>
+            <version>2.0.2</version>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.com.ctop</groupId>
+            <artifactId>module-alarm</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>
@@ -161,13 +175,6 @@
             <artifactId>poi-ooxml-schemas</artifactId>
             <version>3.17</version>
         </dependency>
-
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>easyexcel</artifactId>
-            <version>1.1.2-beat1</version>
-        </dependency>
-
         <dependency>
             <groupId>com.bstek.ureport</groupId>
             <artifactId>ureport2-core</artifactId>

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

@@ -155,9 +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("/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");
@@ -174,6 +174,7 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/rest/script/*", "anon");
         filterChainDefinitionMap.put("/ctop/checkTaskList/*", "anon");
         filterChainDefinitionMap.put("/ctop/report/bytedance/*", "anon");
+        filterChainDefinitionMap.put("/shiwan/shiwanFileUpload/*", "anon");
 
         // 添加自己的过滤器并且取名为jwt
         Map<String, Filter> filterMap = new HashMap<>(1);

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

@@ -116,25 +116,9 @@ 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();
-        if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "touTiaoOperationManager".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
-            advertiser.setUserId(null);
-        }*/
-
         String name = advertiser.getName();
         advertiser.setName(null);
         QueryWrapper<Advertiser> queryWrapper = QueryGenerator.initQueryWrapper(advertiser, req.getParameterMap());
-       /* if ("kuaishouOperationManager".equals(roleCode) || "touTiaoOperationManager".equals(roleCode)) {
-            QueryWrapper<UserCompany> userCompanyQueryWrapper = new QueryWrapper<>();
-            userCompanyQueryWrapper.eq("user_id", userId);
-            userCompanyQueryWrapper.orderByDesc("create_time");
-            userCompanyQueryWrapper.last("limit 1");
-            UserCompany userCompany = userCompanyMapper.selectOne(userCompanyQueryWrapper);
-            if (!Check.isNull(userCompany)) {
-                queryWrapper.eq("company_id", userCompany.getCompanyId());
-            }
-        }*/
         if (!Check.isNull(name)) {
             queryWrapper.like("name", name);
         }

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

@@ -0,0 +1,150 @@
+package org.jeecg.modules.ctop.controller;
+
+import cn.com.ctop.crawler.modules.music.entity.BytedanceMusicInfo;
+import cn.com.ctop.crawler.modules.music.service.IBytedanceMusicInfoService;
+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.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+
+ /**
+ * 音乐信息
+ * @author jeecg-boot
+ * @date   2020-10-28
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="音乐信息")
+@RestController
+@RequestMapping("/ctop/bytedanceMusicInfo")
+public class BytedanceMusicInfoController {
+	@Autowired
+	private IBytedanceMusicInfoService bytedanceMusicInfoService;
+
+	/**
+	  * 分页列表查询
+	 * @param bytedanceMusicInfo
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@ApiOperation(value="音乐信息-分页列表查询", notes="音乐信息-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<BytedanceMusicInfo>> queryPageList(BytedanceMusicInfo bytedanceMusicInfo,
+														   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+														   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+														   HttpServletRequest req) {
+		Result<IPage<BytedanceMusicInfo>> result = new Result<>();
+		QueryWrapper<BytedanceMusicInfo> queryWrapper = QueryGenerator.initQueryWrapper(bytedanceMusicInfo, req.getParameterMap());
+		Page<BytedanceMusicInfo> page = new Page<>(pageNo, pageSize);
+		IPage<BytedanceMusicInfo> pageList = bytedanceMusicInfoService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param bytedanceMusicInfo
+	 * @return
+	 */
+	@ApiOperation(value="音乐信息-添加", notes="音乐信息-添加")
+	@PostMapping(value = "/add")
+	public Result<BytedanceMusicInfo> add(@RequestBody BytedanceMusicInfo bytedanceMusicInfo) {
+		Result<BytedanceMusicInfo> result = new Result<>();
+		try {
+			bytedanceMusicInfoService.save(bytedanceMusicInfo);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param bytedanceMusicInfo
+	 * @return
+	 */
+	@ApiOperation(value="音乐信息-编辑", notes="音乐信息-编辑")
+	@PutMapping(value = "/edit")
+	public Result<BytedanceMusicInfo> edit(@RequestBody BytedanceMusicInfo bytedanceMusicInfo) {
+		Result<BytedanceMusicInfo> result = new Result<BytedanceMusicInfo>();
+		BytedanceMusicInfo bytedanceMusicInfoEntity = bytedanceMusicInfoService.getById(bytedanceMusicInfo.getId());
+		if(bytedanceMusicInfoEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = bytedanceMusicInfoService.updateById(bytedanceMusicInfo);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@ApiOperation(value="音乐信息-通过id删除", notes="音乐信息-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			bytedanceMusicInfoService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@ApiOperation(value="音乐信息-批量删除", notes="音乐信息-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<BytedanceMusicInfo> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<BytedanceMusicInfo> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.bytedanceMusicInfoService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@ApiOperation(value="音乐信息-通过id查询", notes="音乐信息-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<BytedanceMusicInfo> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<BytedanceMusicInfo> result = new Result<>();
+		BytedanceMusicInfo bytedanceMusicInfo = bytedanceMusicInfoService.getById(id);
+		if(bytedanceMusicInfo==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(bytedanceMusicInfo);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+}

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

@@ -0,0 +1,161 @@
+package org.jeecg.modules.ctop.controller;
+
+import cn.com.ctop.crawler.modules.music.entity.BytedanceMusicInfo;
+import cn.com.ctop.crawler.modules.music.entity.BytedanceMusicType;
+import cn.com.ctop.crawler.modules.music.service.IBytedanceMusicInfoService;
+import cn.com.ctop.crawler.modules.music.service.IBytedanceMusicTypeService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+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 java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 音乐类型信息
+ * @author jeecg-boot
+ * @date   2020-10-28
+ * @version V1.0
+ */
+@Slf4j
+@RestController
+@RequestMapping("/ctop/bytedanceMusicType")
+public class BytedanceMusicTypeController {
+	@Autowired
+	private IBytedanceMusicTypeService bytedanceMusicTypeService;
+	@Autowired
+	private IBytedanceMusicInfoService bytedanceMusicInfoService;
+
+	/**
+	  * 分页列表查询
+	 * @param bytedanceMusicType
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<BytedanceMusicType>> queryPageList(BytedanceMusicType bytedanceMusicType,
+														   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+														   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+														   HttpServletRequest req) {
+		String typeValue = bytedanceMusicType.getTypeValue();
+		bytedanceMusicType.setTypeValue(null);
+		Result<IPage<BytedanceMusicType>> result = new Result<>();
+		QueryWrapper<BytedanceMusicType> queryWrapper = QueryGenerator.initQueryWrapper(bytedanceMusicType, req.getParameterMap());
+		queryWrapper.like("type_value",typeValue);
+		Page<BytedanceMusicType> page = new Page<>(pageNo, pageSize);
+		IPage<BytedanceMusicType> pageList = bytedanceMusicTypeService.page(page, queryWrapper);
+		List<BytedanceMusicType> records = pageList.getRecords();
+		if(null!=records&&!records.isEmpty()){
+			List<BytedanceMusicType> setRecords = new ArrayList<>();
+			for (BytedanceMusicType type:records) {
+				BytedanceMusicInfo musicInfo = bytedanceMusicInfoService.getById(type.getMusicId());
+				if(null!=musicInfo){
+					type.setMusicInfo(musicInfo);
+				}
+				setRecords.add(type);
+			}
+			pageList.setRecords(setRecords);
+		}
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param bytedanceMusicType
+	 * @return
+	 */
+	@PostMapping(value = "/add")
+	public Result<BytedanceMusicType> add(@RequestBody BytedanceMusicType bytedanceMusicType) {
+		Result<BytedanceMusicType> result = new Result<>();
+		try {
+			bytedanceMusicTypeService.save(bytedanceMusicType);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param bytedanceMusicType
+	 * @return
+	 */
+	@PutMapping(value = "/edit")
+	public Result<BytedanceMusicType> edit(@RequestBody BytedanceMusicType bytedanceMusicType) {
+		Result<BytedanceMusicType> result = new Result<BytedanceMusicType>();
+		BytedanceMusicType bytedanceMusicTypeEntity = bytedanceMusicTypeService.getById(bytedanceMusicType.getId());
+		if(bytedanceMusicTypeEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = bytedanceMusicTypeService.updateById(bytedanceMusicType);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			bytedanceMusicTypeService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<BytedanceMusicType> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<BytedanceMusicType> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.bytedanceMusicTypeService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@GetMapping(value = "/queryById")
+	public Result<BytedanceMusicType> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<BytedanceMusicType> result = new Result<>();
+		BytedanceMusicType bytedanceMusicType = bytedanceMusicTypeService.getById(id);
+		if(bytedanceMusicType==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(bytedanceMusicType);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+}

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

@@ -0,0 +1,156 @@
+package org.jeecg.modules.ctop.controller;
+
+import cn.com.ctop.crawler.modules.music.entity.DictMusicType;
+import cn.com.ctop.crawler.modules.music.service.IDictMusicTypeService;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import 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.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+
+ /**
+ * 抖音音乐类型
+ * @author jeecg-boot
+ * @date   2020-10-28
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="抖音音乐类型")
+@RestController
+@RequestMapping("/ctop/dictMusicType")
+public class DictMusicTypeController {
+	@Autowired
+	private IDictMusicTypeService dictMusicTypeService;
+
+	/**
+	  * 分页列表查询
+	 * @param dictMusicType
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<DictMusicType>> queryPageList(DictMusicType dictMusicType,
+													  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+													  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+													  HttpServletRequest req) {
+		Result<IPage<DictMusicType>> result = new Result<>();
+		QueryWrapper<DictMusicType> queryWrapper = QueryGenerator.initQueryWrapper(dictMusicType, req.getParameterMap());
+		Page<DictMusicType> page = new Page<>(pageNo, pageSize);
+		IPage<DictMusicType> pageList = dictMusicTypeService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+
+
+	/**
+	  *   添加
+	 * @param dict_music_type
+	 * @return
+	 */
+	@PostMapping(value = "/add")
+	public Result<DictMusicType> add(@RequestBody DictMusicType dictMusicType) {
+		Result<DictMusicType> result = new Result<>();
+		try {
+			dictMusicTypeService.save(dictMusicType);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param dictMusicType
+	 * @return
+	 */
+	@ApiOperation(value="抖音音乐类型-编辑", notes="抖音音乐类型-编辑")
+	@PutMapping(value = "/edit")
+	public Result<DictMusicType> edit(@RequestBody DictMusicType dictMusicType) {
+		Result<DictMusicType> result = new Result<>();
+		DictMusicType dictMusicTypeEntity = dictMusicTypeService.getById(dictMusicType.getId());
+		if(dictMusicTypeEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = dictMusicTypeService.updateById(dictMusicType);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	@PostMapping("listAll")
+	public JSONObject listAllType(){
+		return dictMusicTypeService.listAll();
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@ApiOperation(value="抖音音乐类型-通过id删除", notes="抖音音乐类型-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			dictMusicTypeService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@ApiOperation(value="抖音音乐类型-批量删除", notes="抖音音乐类型-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<DictMusicType> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<DictMusicType> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.dictMusicTypeService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@ApiOperation(value="抖音音乐类型-通过id查询", notes="抖音音乐类型-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<DictMusicType> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<DictMusicType> result = new Result<>();
+		DictMusicType dictMusicType = dictMusicTypeService.getById(id);
+		if(dictMusicType==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(dictMusicType);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+}

+ 50 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ImageCostController.java

@@ -1,11 +1,26 @@
 package org.jeecg.modules.ctop.controller;
 
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.ctop.common.module.vo.BytedanceImageCostVOEntity;
+import cn.com.ctop.common.module.vo.KuaishouImageCostVOEntity;
+import cn.com.ctop.common.module.vo.SheetInfoVo;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportMaterialDailyService;
+import com.alibaba.excel.EasyExcelFactory;
+import com.alibaba.excel.ExcelWriter;
+import com.alibaba.excel.metadata.Sheet;
 import com.alibaba.fastjson.JSONObject;
+import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.ctop.service.IImageReportDailyService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+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.HttpServletResponse;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Date;
 import java.util.Map;
 
 @RestController
@@ -20,8 +35,42 @@ public class ImageCostController {
         return imageReportDailyService.bytedanceImageCost(data);
     }
 
+    @PostMapping("bytedance/cost/export")
+    public void bytedanceImageCostExport(@RequestBody JSONObject data, HttpServletResponse response) throws IOException {
+
+        SheetInfoVo vo = imageReportDailyService.getbytedanceImageCostVo(data);
+        OutputStream outputStream = response.getOutputStream();
+        String date = DateUtils.formatDate(new Date());
+        HttpUtils.setResponseHeader(response, "头条图片消耗报表" + date + ".xlsx");
+        ExcelWriter excelWriter = EasyExcelFactory.getWriter(outputStream);
+        Sheet sheet = new Sheet(1, 0, BytedanceImageCostVOEntity.class);
+        sheet.setSheetName(vo.getSheetName());
+        excelWriter.write(vo.getDetails(), sheet);
+
+        excelWriter.finish();
+        outputStream.flush();
+        outputStream.close();
+    }
+
     @PostMapping("kuaishou/cost")
     public Map<String,Object> kuaishouImageCost(@RequestBody JSONObject data){
         return imageReportDailyService.kuaishouImageCost(data);
     }
+
+    @PostMapping("kuaishou/cost/export")
+    public void kuaishouImageCostExport(@RequestBody JSONObject data, HttpServletResponse response) throws IOException {
+        SheetInfoVo vo = imageReportDailyService.getkuaishouImageCostVo(data);
+        OutputStream outputStream = response.getOutputStream();
+        String date = DateUtils.formatDate(new Date());
+        HttpUtils.setResponseHeader(response, "快手图片消耗报表" + date + ".xlsx");
+        ExcelWriter excelWriter = EasyExcelFactory.getWriter(outputStream);
+        Sheet sheet = new Sheet(1, 0, KuaishouImageCostVOEntity.class);
+        sheet.setSheetName(vo.getSheetName());
+        excelWriter.write(vo.getDetails(), sheet);
+        excelWriter.finish();
+        outputStream.flush();
+        outputStream.close();
+    }
+
+
 }

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

@@ -2,13 +2,33 @@ 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.*;
+import cn.com.ctop.common.module.entity.ByteDanceCleanMaterialReport;
+import cn.com.ctop.common.module.entity.KuaiShouCleanMaterialReport;
+import cn.com.ctop.common.module.entity.MaterialAscription;
+import cn.com.ctop.common.module.entity.MaterialCutFrame;
+import cn.com.ctop.common.module.entity.MaterialImageInfo;
+import cn.com.ctop.common.module.entity.MaterialInfo;
+import cn.com.ctop.common.module.entity.MaterialParameter;
+import cn.com.ctop.common.module.entity.MaterialTag;
+import cn.com.ctop.common.module.entity.Project;
 import cn.com.ctop.common.module.enums.MaterialSupplierEnum;
-import cn.com.ctop.common.module.service.*;
+import cn.com.ctop.common.module.service.IByteDanceCleanMaterialReportService;
+import cn.com.ctop.common.module.service.IKuaiShouCleanMaterialReportService;
+import cn.com.ctop.common.module.service.IMaterialAscriptionService;
+import cn.com.ctop.common.module.service.IMaterialCutFrameService;
+import cn.com.ctop.common.module.service.IMaterialImageInfoService;
+import cn.com.ctop.common.module.service.IMaterialInfoService;
+import cn.com.ctop.common.module.service.IMaterialParameterService;
+import cn.com.ctop.common.module.service.IMaterialTagService;
+import cn.com.ctop.common.module.service.IMessageTemplate;
+import cn.com.ctop.common.module.service.IProjectService;
+import cn.com.ctop.common.module.service.ISendMessageService;
+import cn.com.ctop.common.module.service.IVideoWatermarkTaskService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.CloudVideoProcessUtil;
 import cn.com.ctop.common.module.utils.JsonUtil;
 import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouReportDailyMaterialService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -25,13 +45,24 @@ import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.ctop.service.IProjectMemberService;
 import org.jeecg.modules.system.service.ISysRoleService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.net.URLDecoder;
 import java.text.ParseException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 素材信息
@@ -65,6 +96,8 @@ public class MaterialInfoController {
     private IProjectMemberService memberService;
     @Autowired
     private IMaterialImageInfoService iMaterialImageInfoService;
+    @Autowired
+    private IKuaiShouReportDailyMaterialService kuaiShouReportDailyMaterialService;
 
 
     @GetMapping("/supplierWatermark")
@@ -309,40 +342,40 @@ public class MaterialInfoController {
     }
 
     @GetMapping(value = "/listV2")
-    public Map<String,Object> queryPageList(String type,Integer status,Long projectId,String materialName,String code,
-                                                     String startDate,String endDate,String tagCode,
-                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
+    public Map<String, Object> queryPageList(String type, Integer status, Long projectId, String materialName, String code,
+                                             String startDate, String endDate, String tagCode,
+                                             @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                             @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        List<Long>projectIds = null;
+        List<Long> projectIds = null;
         String userId = user.getId();
         String roleCode = roleService.getRoleCodeByUserId(userId);
-        if(null == tagCode||tagCode.trim().equals("")){
+        if (null == tagCode || tagCode.trim().equals("")) {
             tagCode = null;
         }
-        if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || "operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "operationAssistant".equals(roleCode) || "touTiaoOperationManager".equals(roleCode) || roleCode.contains("sale")){
+        if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || "operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "operationAssistant".equals(roleCode) || "touTiaoOperationManager".equals(roleCode) || roleCode.contains("sale")) {
             //查询所有
-            if(null!=projectId&&projectId!=0){
+            if (null != projectId && projectId != 0) {
                 projectIds = new ArrayList<>();
                 projectIds.add(projectId);
             }
-            return materialInfoService.getListByParams(tagCode,type,status,projectIds,materialName,code,startDate,endDate,null,pageNo,pageSize);
-        }else if ("designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode) || "plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode)){
+            return materialInfoService.getListByParams(tagCode, type, status, projectIds, materialName, code, startDate, endDate, null, pageNo, pageSize);
+        } else if ("designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode) || "plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode)) {
             //查询自己所在项目下的数据
-            if(null == projectId||projectId == 0){
+            if (null == projectId || projectId == 0) {
                 projectIds = memberService.selectProjectsByUserId(userId);
-            }else{
+            } else {
                 projectIds = new ArrayList<>();
                 projectIds.add(projectId);
             }
-            return materialInfoService.getListByParams(tagCode,type,status,projectIds,materialName,code,startDate,endDate,null,pageNo,pageSize);
-        }else{
+            return materialInfoService.getListByParams(tagCode, type, status, projectIds, materialName, code, startDate, endDate, null, pageNo, pageSize);
+        } else {
             //查询自己上传的视频
-            if(null!=projectId&&projectId!=0){
+            if (null != projectId && projectId != 0) {
                 projectIds = new ArrayList<>();
                 projectIds.add(projectId);
             }
-            return materialInfoService.getListByParams(tagCode,type,status,projectIds,materialName,code,startDate,endDate,userId,pageNo,pageSize);
+            return materialInfoService.getListByParams(tagCode, type, status, projectIds, materialName, code, startDate, endDate, userId, pageNo, pageSize);
         }
     }
 
@@ -726,4 +759,5 @@ public class MaterialInfoController {
         result.setResult(pageList);
         return result;
     }
+
 }

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

@@ -50,7 +50,6 @@ public class MaterialTagInfoController {
 		Result<IPage<MaterialTagInfo>> result = new Result<>();
 		QueryWrapper<MaterialTagInfo> queryWrapper = QueryGenerator.initQueryWrapper(materialTagInfo, req.getParameterMap());
 		Page<MaterialTagInfo> page = new Page<>(pageNo, pageSize);
-		queryWrapper.eq("status",1);
 		IPage<MaterialTagInfo> pageList = materialTagInfoService.page(page, queryWrapper);
 		result.setSuccess(true);
 		result.setResult(pageList);

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

@@ -117,9 +117,14 @@ public class ProjectMemberController {
                     if (!Check.isNull(project)) {
                         SysUser responsible = sysUserService.getById(project.getResponsibleId());
 
-                        projectMember.setResponsibleName(responsible.getRealname());
+                        if (!Check.isNull(responsible)) {
+                            projectMember.setResponsibleName(responsible.getRealname());
+                        }
+
                         SysUser designResponsible = sysUserService.getById(project.getDesignResponsibleId());
-                        projectMember.setDesignResponsibleName(designResponsible.getRealname());
+                        if (!Check.isNull(designResponsible)) {
+                            projectMember.setDesignResponsibleName(designResponsible.getRealname());
+                        }
 
                         projectMember.setProjectName(project.getProjectName());
                         Product product = productService.getById(project.getProductId());
@@ -506,6 +511,25 @@ public class ProjectMemberController {
         return resultBody;
     }
 
+    /**
+     * 查询当前账户下的快手头条传不同的mediaType
+     *
+     * @return
+     */
+    @GetMapping("/getAllProjectAccount")
+    public Result<List<Map<String, Object>>> getAllProjectAccount(String mediaType) {
+        Result<List<Map<String, Object>>> resultBody = new Result<>();
+        try {
+            List<Map<String, Object>> result = projectMemberService.getAllProjectAccount(mediaType);
+            resultBody.setSuccess(true);
+            resultBody.setResult(result);
+        } catch (Exception e) {
+            resultBody.setSuccess(false);
+            resultBody.success("查询失败");
+        }
+        return resultBody;
+    }
+
 
     /**
      * 销售的项目
@@ -560,5 +584,9 @@ public class ProjectMemberController {
 
     }
 
+    public static void main(String[] args) {
+
+    }
+
 
 }

+ 175 - 166
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectTransferRecordController.java

@@ -26,185 +26,194 @@ import java.util.Map;
 
 /**
  * 账户转项目记录
+ *
  * @author jeecg-boot
- * @date   2020-07-22
  * @version V1.0
+ * @date 2020-07-22
  */
 @Slf4j
-@Api(tags="账户转项目记录")
+@Api(tags = "账户转项目记录")
 @RestController
 @RequestMapping("/ctop/projectTransferRecord")
 public class ProjectTransferRecordController {
-	@Autowired
-	private IProjectTransferRecordService projectTransferRecordService;
-	@Autowired
-	private ISysRoleService sysRoleService;
-	/**
-	  * 我发起的
-	 * @param projectTransferRecord
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	@AutoLog(value = "账户转项目记录-分页列表查询")
-	@ApiOperation(value="账户转项目记录-分页列表查询", notes="账户转项目记录-分页列表查询")
-	@GetMapping(value = "/initiatedList")
-	public Result<IPage<ProjectTransferRecord>> initiatedList(ProjectTransferRecord projectTransferRecord,
-									  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-									  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-									  HttpServletRequest req) {
-		Integer status = projectTransferRecord.getStatus();
-		if(null == status||status.equals(0)){
-			projectTransferRecord.setStatus(null);
-		}
-		Result<IPage<ProjectTransferRecord>> result = new Result<>();
-		QueryWrapper<ProjectTransferRecord> queryWrapper = QueryGenerator.initQueryWrapper(projectTransferRecord, req.getParameterMap());
-		LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-		String rodeCode = sysRoleService.getRoleCodeByUserId(sysUser.getId());
-		if(null!=rodeCode&&rodeCode.trim().equals("admin")){
-			queryWrapper.eq("user_id",sysUser.getId());
-		}
-		queryWrapper.ne("status",0);
-		Page<ProjectTransferRecord> page = new Page<>(pageNo, pageSize);
-		IPage<ProjectTransferRecord> pageList = projectTransferRecordService.page(page, queryWrapper);
-		result.setSuccess(true);
-		result.setResult(pageList);
-		return result;
-	}
+    @Autowired
+    private IProjectTransferRecordService projectTransferRecordService;
+    @Autowired
+    private ISysRoleService sysRoleService;
 
-	 /**
-	  * 待审核的
-	  * @param projectTransferRecord
-	  * @param pageNo
-	  * @param pageSize
-	  * @param req
-	  * @return
-	  */
-	 @AutoLog(value = "账户转项目记录-分页列表查询")
-	 @ApiOperation(value="账户转项目记录-分页列表查询", notes="账户转项目记录-分页列表查询")
-	 @GetMapping(value = "/auditList")
-	 public Result<IPage<ProjectTransferRecord>> auditList(ProjectTransferRecord projectTransferRecord,
-															   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-															   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-															   HttpServletRequest req) {
-		 Integer status = projectTransferRecord.getStatus();
-		 if(null == status||status.equals(0)){
-			 projectTransferRecord.setStatus(null);
-		 }
-		 Result<IPage<ProjectTransferRecord>> result = new Result<>();
-		 QueryWrapper<ProjectTransferRecord> queryWrapper = QueryGenerator.initQueryWrapper(projectTransferRecord, req.getParameterMap());
-		 LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-		 String rodeCode = sysRoleService.getRoleCodeByUserId(sysUser.getId());
-		 if(null!=rodeCode&&rodeCode.trim().equals("admin")){
-			 queryWrapper.eq("reviewer_id",sysUser.getId());
-		 }
-		 queryWrapper.ne("status",0);
-		 Page<ProjectTransferRecord> page = new Page<>(pageNo, pageSize);
-		 IPage<ProjectTransferRecord> pageList = projectTransferRecordService.page(page, queryWrapper);
-		 result.setSuccess(true);
-		 result.setResult(pageList);
-		 return result;
-	 }
+    /**
+     * 我发起的
+     *
+     * @param projectTransferRecord
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "账户转项目记录-分页列表查询")
+    @ApiOperation(value = "账户转项目记录-分页列表查询", notes = "账户转项目记录-分页列表查询")
+    @GetMapping(value = "/initiatedList")
+    public Result<IPage<ProjectTransferRecord>> initiatedList(ProjectTransferRecord projectTransferRecord,
+                                                              @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                              @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                              HttpServletRequest req) {
+        Integer status = projectTransferRecord.getStatus();
+        if (null == status || status.equals(0)) {
+            projectTransferRecord.setStatus(null);
+        }
+        Result<IPage<ProjectTransferRecord>> result = new Result<>();
+        QueryWrapper<ProjectTransferRecord> queryWrapper = QueryGenerator.initQueryWrapper(projectTransferRecord, req.getParameterMap());
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        String rodeCode = sysRoleService.getRoleCodeByUserId(sysUser.getId());
+        if (null != rodeCode && rodeCode.trim().equals("admin")) {
+            queryWrapper.eq("user_id", sysUser.getId());
+        }
+        queryWrapper.ne("status", 0);
+        Page<ProjectTransferRecord> page = new Page<>(pageNo, pageSize);
+        IPage<ProjectTransferRecord> pageList = projectTransferRecordService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
 
-	 @PostMapping("editStatus")
-	 public Map<String,Object> editStatus(Long id, Integer status){
-	 	Map<String, Object>result = new HashMap<>();
-	 	if(id == null||id == 0||status == null){
-			ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
-			return result;
-		}
-		return projectTransferRecordService.updateStatus(id,status);
-	 }
+    /**
+     * 待审核的
+     *
+     * @param projectTransferRecord
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "账户转项目记录-分页列表查询")
+    @ApiOperation(value = "账户转项目记录-分页列表查询", notes = "账户转项目记录-分页列表查询")
+    @GetMapping(value = "/auditList")
+    public Result<IPage<ProjectTransferRecord>> auditList(ProjectTransferRecord projectTransferRecord,
+                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                          HttpServletRequest req) {
+        Integer status = projectTransferRecord.getStatus();
+        if (null == status || status.equals(0)) {
+            projectTransferRecord.setStatus(null);
+        }
+        Result<IPage<ProjectTransferRecord>> result = new Result<>();
+        QueryWrapper<ProjectTransferRecord> queryWrapper = QueryGenerator.initQueryWrapper(projectTransferRecord, req.getParameterMap());
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        String rodeCode = sysRoleService.getRoleCodeByUserId(sysUser.getId());
+        if (null != rodeCode && !rodeCode.trim().equals("admin")) {
+            queryWrapper.eq("reviewer_id", sysUser.getId());
+        }
+        queryWrapper.ne("status", 0);
+        Page<ProjectTransferRecord> page = new Page<>(pageNo, pageSize);
+        IPage<ProjectTransferRecord> pageList = projectTransferRecordService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
 
-	/**
-	  *  添加
-	 * @return
-	 */
-	@AutoLog(value = "账户转项目记录-添加")
-	@ApiOperation(value="账户转项目记录-添加", notes="账户转项目记录-添加")
-	@PostMapping(value = "/add")
-	public Map<String,Object> add(Long accountId, Long projectId) {
-		return projectTransferRecordService.addRecord(accountId,projectId);
-	}
+    @PostMapping("editStatus")
+    public Map<String, Object> editStatus(Long id, Integer status) {
+        Map<String, Object> result = new HashMap<>();
+        if (id == null || id == 0 || status == null) {
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+            return result;
+        }
+        return projectTransferRecordService.updateStatus(id, status);
+    }
 
-	/**
-	  *  编辑
-	 * @param projectTransferRecord
-	 * @return
-	 */
-	@AutoLog(value = "账户转项目记录-编辑")
-	@ApiOperation(value="账户转项目记录-编辑", notes="账户转项目记录-编辑")
-	@PutMapping(value = "/edit")
-	public Result<ProjectTransferRecord> edit(@RequestBody ProjectTransferRecord projectTransferRecord) {
-		Result<ProjectTransferRecord> result = new Result<>();
-		ProjectTransferRecord projectTransferRecordEntity = projectTransferRecordService.getById(projectTransferRecord.getId());
-		if(projectTransferRecordEntity==null) {
-			result.error500("未找到对应实体");
-		}else {
-			boolean ok = projectTransferRecordService.updateById(projectTransferRecord);
-			if(ok) {
-				result.success("修改成功!");
-			}
-		}
+    /**
+     * 添加
+     *
+     * @return
+     */
+    @AutoLog(value = "账户转项目记录-添加")
+    @ApiOperation(value = "账户转项目记录-添加", notes = "账户转项目记录-添加")
+    @PostMapping(value = "/add")
+    public Map<String, Object> add(Long accountId, Long projectId) {
+        return projectTransferRecordService.addRecord(accountId, projectId);
+    }
 
-		return result;
-	}
+    /**
+     * 编辑
+     *
+     * @param projectTransferRecord
+     * @return
+     */
+    @AutoLog(value = "账户转项目记录-编辑")
+    @ApiOperation(value = "账户转项目记录-编辑", notes = "账户转项目记录-编辑")
+    @PutMapping(value = "/edit")
+    public Result<ProjectTransferRecord> edit(@RequestBody ProjectTransferRecord projectTransferRecord) {
+        Result<ProjectTransferRecord> result = new Result<>();
+        ProjectTransferRecord projectTransferRecordEntity = projectTransferRecordService.getById(projectTransferRecord.getId());
+        if (projectTransferRecordEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = projectTransferRecordService.updateById(projectTransferRecord);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
 
-	/**
-	 * 通过id删除
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "账户转项目记录-通过id删除")
-	@ApiOperation(value="账户转项目记录-通过id删除", notes="账户转项目记录-通过id删除")
-	@DeleteMapping(value = "/delete")
-	public Result<Object> delete(@RequestParam(name="id",required=true) Long id,@RequestParam(name = "status",defaultValue = "0") Integer status) {
-		try {
-			projectTransferRecordService.updateStatus(id,status);
-		} catch (Exception e) {
-			log.error("删除失败",e.getMessage());
-			return Result.error("删除失败!");
-		}
-		return Result.ok("删除成功!");
-	}
+        return result;
+    }
 
-	/**
-	 *  批量删除
-	 * @param ids
-	 * @return
-	 */
-	@AutoLog(value = "账户转项目记录-批量删除")
-	@ApiOperation(value="账户转项目记录-批量删除", notes="账户转项目记录-批量删除")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<ProjectTransferRecord> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		Result<ProjectTransferRecord> result = new Result<>();
-		if(ids==null || "".equals(ids.trim())) {
-			result.error500("参数不识别!");
-		}else {
-			this.projectTransferRecordService.removeByIds(Arrays.asList(ids.split(",")));
-			result.success("删除成功!");
-		}
-		return result;
-	}
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "账户转项目记录-通过id删除")
+    @ApiOperation(value = "账户转项目记录-通过id删除", notes = "账户转项目记录-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<Object> delete(@RequestParam(name = "id", required = true) Long id, @RequestParam(name = "status", defaultValue = "0") Integer status) {
+        try {
+            projectTransferRecordService.updateStatus(id, status);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
 
-	/**
-	 * 通过id查询
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "账户转项目记录-通过id查询")
-	@ApiOperation(value="账户转项目记录-通过id查询", notes="账户转项目记录-通过id查询")
-	@GetMapping(value = "/queryById")
-	public Result<ProjectTransferRecord> queryById(@RequestParam(name="id",required=true) String id) {
-		Result<ProjectTransferRecord> result = new Result<>();
-		ProjectTransferRecord projectTransferRecord = projectTransferRecordService.getById(id);
-		if(projectTransferRecord==null) {
-			result.error500("未找到对应实体");
-		}else {
-			result.setResult(projectTransferRecord);
-			result.setSuccess(true);
-		}
-		return result;
-	}
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "账户转项目记录-批量删除")
+    @ApiOperation(value = "账户转项目记录-批量删除", notes = "账户转项目记录-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<ProjectTransferRecord> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<ProjectTransferRecord> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.projectTransferRecordService.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<ProjectTransferRecord> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<ProjectTransferRecord> result = new Result<>();
+        ProjectTransferRecord projectTransferRecord = projectTransferRecordService.getById(id);
+        if (projectTransferRecord == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(projectTransferRecord);
+            result.setSuccess(true);
+        }
+        return result;
+    }
 }

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

@@ -61,7 +61,7 @@ public class KuaishouDailyCreativeReportLoadJob implements Job {
                                     @Override
                                     public void run() {
                                         try {
-                                            kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, getDate, getDate, campaignIds);
+                                            kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, getDate, getDate, campaignIds, null);
                                         } catch (Exception e) {
                                             log.info("获取创意日报失败,accountId:{}", token.getAccountId());
                                         }

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

@@ -1,5 +1,6 @@
 package org.jeecg.modules.ctop.service;
 
+import cn.com.ctop.common.module.vo.SheetInfoVo;
 import com.alibaba.fastjson.JSONObject;
 
 import java.util.Map;
@@ -8,4 +9,8 @@ public interface IImageReportDailyService {
     Map<String,Object> bytedanceImageCost(JSONObject data);
 
     Map<String, Object> kuaishouImageCost(JSONObject data);
+
+    SheetInfoVo getkuaishouImageCostVo(JSONObject data);
+
+    SheetInfoVo getbytedanceImageCostVo(JSONObject data);
 }

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

@@ -39,4 +39,6 @@ public interface IProjectMemberService extends IService<ProjectMember> {
     List<Long> getProjectByAccountIds(JSONArray accountIds);
 
     List<JSONObject> getProjectByUserIdAndMediaIds(String userId, List<Integer> mediaIds);
+
+    List<Map<String, Object>> getAllProjectAccount(String mediaType);
 }

+ 61 - 45
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ImageReportDailyServiceImpl.java

@@ -1,11 +1,9 @@
 package org.jeecg.modules.ctop.service.impl;
 
-import cn.com.ctop.common.module.entity.MaterialImageInfo;
-import cn.com.ctop.common.module.entity.SysUser;
-import cn.com.ctop.common.module.service.IMaterialImageInfoService;
 import cn.com.ctop.common.module.utils.ResultMapUtils;
 import cn.com.ctop.common.module.utils.StatusCode;
-import cn.com.ctop.toutiao.modules.report.DTO.ImageCostVO;
+import cn.com.ctop.common.module.vo.*;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyImageMapper;
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -16,13 +14,19 @@ import org.jeecg.modules.system.service.ISysUserService;
 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;
 
 @Service
 public class ImageReportDailyServiceImpl implements IImageReportDailyService {
+    @Autowired
+    private BytedanceReportMaterialDailyMapper bytedanceReportMaterialDailyMapper;
+    @Autowired
+    private KuaishouReportDailyImageMapper kuaishouReportDailyImageMapper;
+    @Autowired
+    private ISysUserService sysUserService;
+
 
     @Override
     public Map<String,Object> bytedanceImageCost(JSONObject data) {
@@ -52,29 +56,38 @@ public class ImageReportDailyServiceImpl implements IImageReportDailyService {
             pageSize = 10;
         }
         PageHelper.startPage(pageNumber,pageSize);
-        List<ImageCostVO> vos = bytedanceReportMaterialDailyMapper.bytedanceImageCost(startDate,endDate,accountList,code,(pageNumber-1)*pageSize,pageSize);
-        PageInfo<ImageCostVO> pageInfo = new PageInfo<>(vos);
-        if(null!=vos&&!vos.isEmpty()){
-            List<ImageCostVO>setVos = new ArrayList<>();
-            for(ImageCostVO vo:vos){
-                MaterialImageInfo imageInfo = imageInfoService.getByCode(vo.getSignature());
-                if(null!=imageInfo){
-                    vo.setUserId(imageInfo.getUserId());
-                    SysUser user = sysUserService.getById(imageInfo.getUserId());
-                    vo.setUserName(user.getUsername());
-                }else{
-                    vo.setUserName("-");
-                }
-                setVos.add(vo);
-            }
-            pageInfo.setList(setVos);
-        }
+        List<BytedanceImageCostVO> vos = bytedanceReportMaterialDailyMapper.bytedanceImageCost(startDate,endDate,accountList,code);
+        PageInfo<BytedanceImageCostVO> pageInfo = new PageInfo<>(vos);
         result.put("data",pageInfo);
         ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
         return result;
     }
 
     @Override
+    public SheetInfoVo getbytedanceImageCostVo(JSONObject data) {
+        SheetInfoVo sheetInfoVo = new SheetInfoVo<BytedanceImageCostVOEntity>();
+        String startDate = data.getString("startDate");
+        if(null == startDate||startDate.trim().equals("")){
+            startDate = null;
+        }
+        String endDate = data.getString("endDate");
+        if(null == endDate||endDate.trim().equals("")){
+            endDate = null;
+        }
+        JSONArray accountList = data.getJSONArray("accountList");
+        if(null==accountList||accountList.isEmpty()){
+            accountList = null;
+        }
+        String code = data.getString("code");
+        if(null == code||code.trim().equals("")){
+            code = null;
+        }
+        List<BytedanceImageCostVOEntity>details = bytedanceReportMaterialDailyMapper.bytedanceImageCostEntity(startDate,endDate,accountList,code);
+        sheetInfoVo.setDetails(details);
+        return sheetInfoVo;
+    }
+
+    @Override
     public Map<String, Object> kuaishouImageCost(JSONObject data) {
         Map<String,Object>result = new HashMap<>();
         String startDate = data.getString("startDate");
@@ -102,32 +115,35 @@ public class ImageReportDailyServiceImpl implements IImageReportDailyService {
             pageSize = 10;
         }
         PageHelper.startPage(pageNumber,pageSize);
-        List<ImageCostVO> vos = bytedanceReportMaterialDailyMapper.bytedanceImageCost(startDate,endDate,accountList,code,(pageNumber-1)*pageSize,pageSize);
-        PageInfo<ImageCostVO> pageInfo = new PageInfo<>(vos);
-        if(null!=vos&&!vos.isEmpty()){
-            List<ImageCostVO>setVos = new ArrayList<>();
-            for(ImageCostVO vo:vos){
-                MaterialImageInfo imageInfo = imageInfoService.getByCode(vo.getSignature());
-                if(null!=imageInfo){
-                    vo.setUserId(imageInfo.getUserId());
-                    SysUser user = sysUserService.getById(imageInfo.getUserId());
-                    vo.setUserName(user.getUsername());
-                }else{
-                    vo.setUserName("-");
-                }
-                setVos.add(vo);
-            }
-            pageInfo.setList(setVos);
-        }
+        List<KuaishouImageCostVO> vos = kuaishouReportDailyImageMapper.imageCost(startDate,endDate,accountList,code);
+        PageInfo<KuaishouImageCostVO> pageInfo = new PageInfo<>(vos);
         result.put("data",pageInfo);
         ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
         return result;
     }
 
-    @Autowired
-    private IMaterialImageInfoService imageInfoService;
-    @Autowired
-    private BytedanceReportMaterialDailyMapper bytedanceReportMaterialDailyMapper;
-    @Autowired
-    private ISysUserService sysUserService;
+    @Override
+    public SheetInfoVo getkuaishouImageCostVo(JSONObject data) {
+        SheetInfoVo sheetInfoVo = new SheetInfoVo<KuaishouImageCostVOEntity>();
+        String startDate = data.getString("startDate");
+        if(null == startDate||startDate.trim().equals("")){
+            startDate = null;
+        }
+        String endDate = data.getString("endDate");
+        if(null == endDate||endDate.trim().equals("")){
+            endDate = null;
+        }
+        JSONArray accountList = data.getJSONArray("accountList");
+        if(null==accountList||accountList.isEmpty()){
+            accountList = null;
+        }
+        String code = data.getString("code");
+        if(null == code||code.trim().equals("")){
+            code = null;
+        }
+        sheetInfoVo.setSheetName("快手图片消耗统计");
+        List<KuaishouImageCostVOEntity> details = kuaishouReportDailyImageMapper.imageCostEntity(startDate,endDate,accountList,code);
+        sheetInfoVo.setDetails(details);
+        return sheetInfoVo;
+    }
 }

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

@@ -149,7 +149,6 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
         temp.put("project", projectMember);
         QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("project_id", projectMember.getProjectId());
-        queryWrapper.eq("account_status", 0);
         queryWrapper.isNotNull("account_id");
         List<UserAllocation> userAllocations = userAllocationMapper.selectList(queryWrapper);
         if (userAllocations.isEmpty()) {
@@ -202,6 +201,7 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
         return memberMapper.getProjectByUserId(userId);
     }
 
+    @Override
     public List<Long> getProjectByAccountIds(JSONArray accountIds) {
         return memberMapper.getProjectByAccountIds(accountIds);
     }
@@ -235,5 +235,31 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
         return memberMapper.getProjectByUserIdAndMediaIds(userId, mediaIds);
     }
 
+    @Override
+    public List<Map<String, Object>> getAllProjectAccount(String mediaType) {
+        List<Map<String, Object>> result = new ArrayList<>();
+        List<Integer> mediaList = new ArrayList<>();
+        if (mediaType.equals(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE)) {
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT);
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INSIDE_INT);
+        } else if (mediaType.equals(CtopAdConstant.PLATFORM_TYPE_KUAISHOU)) {
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT);
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INSIDE_INT);
+        }
+
+        //查询登录账号下的项目
+        List<ProjectMember> projectMemberList = this.memberMapper.adminProjects(mediaList);
+        if (projectMemberList.isEmpty()) {
+            return result;
+        }
+        projectMemberList.forEach(ProjectMember -> {
+            Map<String, Object> temp = this.queryAccountByProjectId(ProjectMember);
+            if (temp != null) {
+                result.add(temp);
+            }
+        });
+        return result;
+    }
+
 
 }

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

@@ -25,9 +25,10 @@ import java.util.Map;
 
 /**
  * 账户转项目记录
+ *
  * @author jeecg-boot
- * @date   2020-07-22
  * @version V1.0
+ * @date 2020-07-22
  */
 @Service
 public class ProjectTransferRecordServiceImpl extends ServiceImpl<ProjectTransferRecordMapper, ProjectTransferRecord> implements IProjectTransferRecordService {
@@ -39,46 +40,48 @@ public class ProjectTransferRecordServiceImpl extends ServiceImpl<ProjectTransfe
     private IProjectService projectService;
     @Autowired
     private IUserAllocationService userAllocationService;
+
     @Override
-    public Map<String,Object> updateStatus(Long id, Integer status) {
-        Map<String,Object>result = new HashMap<>();
+    public Map<String, Object> updateStatus(Long id, Integer status) {
+        Map<String, Object> result = new HashMap<>();
         ProjectTransferRecord record = this.getById(id);
-        if(null == record||record.getStatus()==0){
+        if (null == record || record.getStatus() == 0) {
             ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
             return result;
         }
         record.setStatus(status);
         record.setUpdateTime(new Date());
         this.updateById(record);
-        if(status == 2){
+        if (status == 2) {
             //需要转转项目
             UserAllocation userAllocation = userAllocationService.getByAccountId(record.getAccountId());
             SysUser user = sysUserService.getById(record.getUserId());
             Project project = projectService.getById(record.getTargetProject());
             userAllocation.setProjectId(project.getId());
-       //     userAllocation.setProjectName(project.getProjectName());
+            userAllocation.setAdvertiserId(project.getAdvertiserId());
+            //     userAllocation.setProjectName(project.getProjectName());
             userAllocationService.updateById(userAllocation);
-            ProjectMember member = projectMemberService.getProjectByParams(record.getTargetProject(),record.getUserId());
-            if(null == member){
-                projectMemberService.addMember(user,project);
+            ProjectMember member = projectMemberService.getProjectByParams(record.getTargetProject(), record.getUserId());
+            if (null == member) {
+                projectMemberService.addMember(user, project);
             }
         }
-        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
         return result;
     }
 
     @Override
     public Map<String, Object> addRecord(Long accountId, Long projectId) {
-        Map<String,Object>result = new HashMap<>();
+        Map<String, Object> result = new HashMap<>();
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        if(accountId == null||projectId==null){
-            ResultMapUtils.setResultMap(result,StatusCode.COMMON_PARAM_ERROR);
+        if (accountId == null || projectId == null) {
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
             return result;
         }
         UserAllocation allocation = userAllocationService.getByAccountId(accountId);
         Project project = projectService.getById(projectId);
-        if(null == allocation||null == project){
-            ResultMapUtils.setResultMap(result,StatusCode.COMMON_PARAM_ERROR);
+        if (null == allocation || null == project) {
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
             return result;
         }
         ProjectTransferRecord record = new ProjectTransferRecord();
@@ -87,11 +90,11 @@ public class ProjectTransferRecordServiceImpl extends ServiceImpl<ProjectTransfe
         record.setSoucreProject(allocation.getProjectId());
         record.setTargetProject(projectId);
         record.setUserId(user.getId());
-        record.setReviewerId(project.getUserId());
+        record.setReviewerId(project.getResponsibleId());
         record.setCreateTime(new Date());
         record.setUpdateTime(new Date());
         this.save(record);
-        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
         return result;
     }
 }

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

@@ -122,7 +122,7 @@ public class SysBaseApiImpl implements ISysBaseApi {
 	}
 
 	@Override
-	@Cacheable(cacheNames=CacheConstant.SYS_USERS_CACHE, key="#username")
+//	@Cacheable(cacheNames=CacheConstant.SYS_USERS_CACHE, key="#username")
 	public LoginUser getUserByName(String username) {
 		if(oConvertUtils.isEmpty(username)) {
 			return null;

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

@@ -226,3 +226,6 @@ oss:
     replace-old-value: oss-cn-beijing
     download: D:\mnt\file\video
 
+zip:
+  local:
+    download-path: /data/unzip/

+ 4 - 0
jeecg-boot-module-system/src/main/resources/application-prod.yml

@@ -196,3 +196,7 @@ oss:
     replace-value: oss-cn-beijing
     replace-old-value: oss-cn-beijing
     download: /data/file/video/
+
+zip:
+  local:
+    download-path: /data/unzip/

+ 4 - 0
jeecg-boot-module-system/src/main/resources/application-prod2.yml

@@ -188,3 +188,7 @@ oss:
     replace-value: oss-cn-beijing
     replace-old-value: oss-cn-beijing
     download: /data/file/video/
+
+zip:
+  local:
+    download-path: /data/unzip/

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

@@ -125,7 +125,8 @@ mybatis-plus:
       id-type: 4
       # 默认数据库表下划线命名
       table-underline: true
-  # configuration:
+  #  configuration:
+  #    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
   #  map-underscore-to-camel-case: false
   #分页pageHelper
 pagehelper:
@@ -186,3 +187,7 @@ oss:
     replace-value: oss-cn-beijing
     replace-old-value: oss-cn-beijing
     download: /mnt/file/video/
+
+zip:
+  local:
+    download-path: /data/unzip/

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

@@ -126,8 +126,8 @@ mybatis-plus:
       id-type: 4
       # 默认数据库表下划线命名
       table-underline: true
-  configuration:
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+#  configuration:
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 #jeecg专用配置
 jeecg:
   elasticsearch:
@@ -182,3 +182,6 @@ oss:
     replace-value: oss-cn-beijing-internal
     replace-old-value: oss-cn-beijing
     download: D://mnt//image//
+zip:
+  local:
+    download-path: D://mnt//data//

+ 1 - 0
jeecg-boot-module-system/src/main/resources/application.yml

@@ -1,5 +1,6 @@
 spring:
   profiles:
+#    active: wps
     active: @activatedProperties@
 swagger:
   production: false

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 191 - 88
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java


+ 48 - 0
module-alarm/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-alarm</artifactId>
+    <version>2.0.2</version>
+    <name>module-alarm</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>

+ 256 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/controller/AlarmEventMetricController.java

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

+ 253 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/controller/AlarmEventRuleController.java

@@ -0,0 +1,253 @@
+package cn.com.ctop.alarm.modules.controller;
+
+import cn.com.ctop.alarm.modules.entity.AlarmEventRule;
+import cn.com.ctop.alarm.modules.service.IAlarmEventRuleService;
+import cn.com.ctop.common.module.annotation.AutoLog;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import 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.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+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.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+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-10-29
+ */
+@Slf4j
+@Api(tags = "预警事件规则表")
+@RestController
+@RequestMapping("/alarm/alarmEventRule")
+public class AlarmEventRuleController {
+    @Autowired
+    private IAlarmEventRuleService alarmEventRuleService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param alarmEventRule
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "预警事件规则表-分页列表查询")
+    @ApiOperation(value = "预警事件规则表-分页列表查询", notes = "预警事件规则表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<AlarmEventRule>> queryPageList(AlarmEventRule alarmEventRule,
+                                                       @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                       @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                       HttpServletRequest req) {
+        Result<IPage<AlarmEventRule>> result = new Result<>();
+        QueryWrapper<AlarmEventRule> queryWrapper = QueryGenerator.initQueryWrapper(alarmEventRule, req.getParameterMap());
+        Page<AlarmEventRule> page = new Page<AlarmEventRule>(pageNo, pageSize);
+        IPage<AlarmEventRule> pageList = alarmEventRuleService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param alarmEventRule
+     * @return
+     */
+    @AutoLog(value = "预警事件规则表-添加")
+    @ApiOperation(value = "预警事件规则表-添加", notes = "预警事件规则表-添加")
+    @PostMapping(value = "/add")
+    public Result<AlarmEventRule> addAlarmEventRule(@RequestBody JSONObject obj) {
+        Result<AlarmEventRule> result = new Result<>();
+        try {
+            alarmEventRuleService.addAlarmEventRule(obj);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param alarmEventRule
+     * @return
+     */
+    @AutoLog(value = "预警事件规则表-编辑")
+    @ApiOperation(value = "预警事件规则表-编辑", notes = "预警事件规则表-编辑")
+    @PostMapping(value = "/edit")
+    public Result<AlarmEventRule> editAlarmEventRule(@RequestBody JSONObject obj) {
+        Result<AlarmEventRule> result = new Result<>();
+        try {
+            alarmEventRuleService.editAlarmEventRule(obj);
+            result.success("修改成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        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 {
+            alarmEventRuleService.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<AlarmEventRule> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<AlarmEventRule> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.alarmEventRuleService.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<AlarmEventRule> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<AlarmEventRule> result = new Result<>();
+        AlarmEventRule alarmEventRule = alarmEventRuleService.selectById(id);
+        if (alarmEventRule == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(alarmEventRule);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<AlarmEventRule> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                AlarmEventRule alarmEventRule = JSON.parseObject(deString, AlarmEventRule.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(alarmEventRule, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<AlarmEventRule> pageList = alarmEventRuleService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "预警事件规则表列表");
+        mv.addObject(NormalExcelConstants.CLASS, AlarmEventRule.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<AlarmEventRule> listAlarmEventRules = ExcelImportUtil.importExcel(file.getInputStream(), AlarmEventRule.class, params);
+                alarmEventRuleService.saveBatch(listAlarmEventRules);
+                return Result.ok("文件导入成功!数据行数:" + listAlarmEventRules.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("文件导入失败!");
+    }
+
+}

+ 256 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/controller/AlarmEventSendController.java

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

+ 269 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/controller/AlarmMetricValueController.java

@@ -0,0 +1,269 @@
+package cn.com.ctop.alarm.modules.controller;
+
+import cn.com.ctop.alarm.modules.entity.AlarmMetricValue;
+import cn.com.ctop.alarm.modules.service.IAlarmMetricValueService;
+import cn.com.ctop.common.module.annotation.AutoLog;
+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.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+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.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+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-10-29
+ */
+@Slf4j
+@Api(tags = "指标字段记录表")
+@RestController
+@RequestMapping("/alarm/alarmMetricValue")
+public class AlarmMetricValueController {
+    @Autowired
+    private IAlarmMetricValueService alarmMetricValueService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param alarmMetricValue
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "指标字段记录表-分页列表查询")
+    @ApiOperation(value = "指标字段记录表-分页列表查询", notes = "指标字段记录表-分页列表查询")
+    @GetMapping(value = "/queryPageList")
+    public Result<IPage<AlarmMetricValue>> queryPageList(AlarmMetricValue alarmMetricValue,
+                                                         @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                         HttpServletRequest req) {
+        Result<IPage<AlarmMetricValue>> result = new Result<>();
+        QueryWrapper<AlarmMetricValue> queryWrapper = QueryGenerator.initQueryWrapper(alarmMetricValue, req.getParameterMap());
+        Page<AlarmMetricValue> page = new Page<AlarmMetricValue>(pageNo, pageSize);
+        IPage<AlarmMetricValue> pageList = alarmMetricValueService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    @AutoLog(value = "指标字段记录表-分页列表查询")
+    @ApiOperation(value = "指标字段记录表-分页列表查询", notes = "指标字段记录表-分页列表查询")
+    @GetMapping(value = "/queryParentChildList")
+    public Result<Object> queryParentChildList(AlarmMetricValue alarmMetricValue, HttpServletRequest req) {
+        Result<Object> result = null;
+        try {
+            result = alarmMetricValueService.queryParentChildList(alarmMetricValue);
+        } catch (Exception e) {
+            log.error("查询指标数据异常:", e);
+            result = Result.error("查询失败");
+        }
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param alarmMetricValue
+     * @return
+     */
+    @AutoLog(value = "指标字段记录表-添加")
+    @ApiOperation(value = "指标字段记录表-添加", notes = "指标字段记录表-添加")
+    @PostMapping(value = "/add")
+    public Result<AlarmMetricValue> add(@RequestBody AlarmMetricValue alarmMetricValue) {
+        Result<AlarmMetricValue> result = new Result<>();
+        try {
+            alarmMetricValueService.save(alarmMetricValue);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param alarmMetricValue
+     * @return
+     */
+    @AutoLog(value = "指标字段记录表-编辑")
+    @ApiOperation(value = "指标字段记录表-编辑", notes = "指标字段记录表-编辑")
+    @GetMapping(value = "/edit")
+    public Result<AlarmMetricValue> edit(@RequestBody AlarmMetricValue alarmMetricValue) {
+        Result<AlarmMetricValue> result = new Result<AlarmMetricValue>();
+        AlarmMetricValue alarmMetricValueEntity = alarmMetricValueService.getById(alarmMetricValue.getMetricValueId());
+        if (alarmMetricValueEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = alarmMetricValueService.updateById(alarmMetricValue);
+            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 {
+            alarmMetricValueService.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<AlarmMetricValue> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<AlarmMetricValue> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.alarmMetricValueService.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<AlarmMetricValue> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<AlarmMetricValue> result = new Result<>();
+        AlarmMetricValue alarmMetricValue = alarmMetricValueService.getById(id);
+        if (alarmMetricValue == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(alarmMetricValue);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<AlarmMetricValue> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                AlarmMetricValue alarmMetricValue = JSON.parseObject(deString, AlarmMetricValue.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(alarmMetricValue, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<AlarmMetricValue> pageList = alarmMetricValueService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "指标字段记录表列表");
+        mv.addObject(NormalExcelConstants.CLASS, AlarmMetricValue.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<AlarmMetricValue> listAlarmMetricValues = ExcelImportUtil.importExcel(file.getInputStream(), AlarmMetricValue.class, params);
+                alarmMetricValueService.saveBatch(listAlarmMetricValues);
+                return Result.ok("文件导入成功!数据行数:" + listAlarmMetricValues.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("文件导入失败!");
+    }
+
+}

+ 89 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/entity/AlarmEventMetric.java

@@ -0,0 +1,89 @@
+package cn.com.ctop.alarm.modules.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-10-29
+ */
+@Data
+@TableName("ctop_alarm_event_metric")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_alarm_event_metric对象", description = "制定详细规则表")
+public class AlarmEventMetric {
+
+    /**
+     * 主键id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键id")
+    private Long eventMetricId;
+    /**
+     * 规则id
+     */
+    @Excel(name = "规则id", width = 15)
+    @ApiModelProperty(value = "规则id")
+    private Long eventRuleId;
+    /**
+     * 指标标识
+     */
+    @Excel(name = "指标标识", width = 15)
+    @ApiModelProperty(value = "指标标识")
+    private String metricValueCode;
+    /**
+     * 判断方式 > >= < <= =
+     */
+    @Excel(name = "判断方式 > >= < <= =", width = 15)
+    @ApiModelProperty(value = "判断方式 > >= < <= =")
+    private String judgeMethod;
+    /**
+     * 判断类型 1-金额
+     */
+    private String judgeType;
+    /**
+     * 阈值
+     */
+    @Excel(name = "阈值", width = 15)
+    @ApiModelProperty(value = "阈值")
+    private String threshold;
+    /**
+     * 下限阈值
+     */
+    private String minThreshold;
+    /**
+     * createTime
+     */
+    @Excel(name = "createTime", 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 = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @Excel(name = "updateTime", 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 = "updateTime")
+    private Date updateTime;
+    /**
+     * 数据范围:TODAY_DATA-当天数据
+     */
+    private String dataRange;
+}

+ 101 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/entity/AlarmEventRule.java

@@ -0,0 +1,101 @@
+package cn.com.ctop.alarm.modules.entity;
+
+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;
+import java.util.List;
+
+/**
+ * 预警事件规则表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-10-29
+ */
+@Data
+@TableName("ctop_alarm_event_rule")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_alarm_event_rule对象", description = "预警事件规则表")
+public class AlarmEventRule {
+
+    /**
+     * 规则id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "规则id")
+    private Long eventRuleId;
+    /**
+     * 账户编号
+     */
+    @Excel(name = "账户编号", width = 15)
+    @ApiModelProperty(value = "账户编号")
+    private Long accountId;
+    /**
+     * 组编号
+     */
+    @Excel(name = "组编号", width = 15)
+    @ApiModelProperty(value = "组编号")
+    private Long unitId;
+    /**
+     * 规则名称
+     */
+    @Excel(name = "规则名称", width = 15)
+    @ApiModelProperty(value = "规则名称")
+    private String eventRuleName;
+    /**
+     * 预警事件规则级别 1-普通预警 2-严重预警
+     */
+    @Excel(name = "预警事件规则级别 1-普通预警 2-严重预警", width = 15)
+    @ApiModelProperty(value = "预警事件规则级别 1-普通预警 2-严重预警")
+    private String eventRuleLevel;
+    /**
+     * 检查频率 1每小时,2每半小时
+     */
+    @Excel(name = "检查频率 1每小时,2每半小时", width = 15)
+    @ApiModelProperty(value = "检查频率 1每小时,2每半小时")
+    private String checkFrequency;
+    /**
+     * 预警达标处理方式1发送,2关停并发送
+     */
+    @Excel(name = "预警达标处理方式1发送,2关停并发送", width = 15)
+    @ApiModelProperty(value = "预警达标处理方式1发送,2关停并发送")
+    private String processMethod;
+    /**
+     * 规则状态
+     */
+    @Excel(name = "规则状态", width = 15)
+    @ApiModelProperty(value = "规则状态")
+    private String eventRuleStatus;
+    /**
+     * createTime
+     */
+    @Excel(name = "createTime", 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 = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @Excel(name = "updateTime", 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 = "updateTime")
+    private Date updateTime;
+
+    @TableField(exist = false)
+    private List<AlarmEventMetric> alarmEventMetrics;
+
+}

+ 77 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/entity/AlarmEventSend.java

@@ -0,0 +1,77 @@
+package cn.com.ctop.alarm.modules.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-10-29
+ */
+@Data
+@TableName("ctop_alarm_event_send")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_alarm_event_send对象", description = "预警事件发送表")
+public class AlarmEventSend {
+
+    /**
+     * 主键id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键id")
+    private Integer alarmSendId;
+    /**
+     * 规则id
+     */
+    @Excel(name = "规则id", width = 15)
+    @ApiModelProperty(value = "规则id")
+    private Integer eventRuleId;
+    /**
+     * 预警指标
+     */
+    @Excel(name = "预警指标", width = 15)
+    @ApiModelProperty(value = "预警指标")
+    private String metricValueCode;
+    /**
+     * 预警发送内容
+     */
+    @Excel(name = "预警发送内容", width = 15)
+    @ApiModelProperty(value = "预警发送内容")
+    private String alarmDetail;
+    /**
+     * 预警发送状态 0未发送,1已发送
+     */
+    @Excel(name = "预警发送状态 0未发送,1已发送", width = 15)
+    @ApiModelProperty(value = "预警发送状态 0未发送,1已发送")
+    private String alarmStatus;
+    /**
+     * createTime
+     */
+    @Excel(name = "createTime", 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 = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @Excel(name = "updateTime", 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 = "updateTime")
+    private Date updateTime;
+}

+ 83 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/entity/AlarmMetricValue.java

@@ -0,0 +1,83 @@
+package cn.com.ctop.alarm.modules.entity;
+
+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;
+import java.util.List;
+
+/**
+ * 指标字段记录表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-10-29
+ */
+@Data
+@TableName("ctop_alarm_metric_value")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_alarm_metric_value对象", description = "指标字段记录表")
+public class AlarmMetricValue {
+
+    /**
+     * 指标值编号
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "指标值编号")
+    private Integer metricValueId;
+    /**
+     * 父级编码
+     */
+    @Excel(name = "父级编码", width = 15)
+    @ApiModelProperty(value = "父级编码")
+    private Integer metricParentId;
+    /**
+     * 指标值名称
+     */
+    @Excel(name = "指标值名称", width = 15)
+    @ApiModelProperty(value = "指标值名称")
+    private String metricValueName;
+    /**
+     * 指标值编码
+     */
+    @Excel(name = "指标值编码", width = 15)
+    @ApiModelProperty(value = "指标值编码")
+    private String metricValueCode;
+    /**
+     * metricValueType
+     */
+    @Excel(name = "metricValueType", width = 15)
+    @ApiModelProperty(value = "metricValueType")
+    private String metricValueType;
+    /**
+     * createTime
+     */
+    @Excel(name = "createTime", 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 = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @Excel(name = "updateTime", 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 = "updateTime")
+    private Date updateTime;
+
+    @TableField(exist = false)
+    private List<AlarmMetricValue> childs;
+
+}

+ 18 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/AlarmEventMetricMapper.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.alarm.modules.mapper;
+
+import cn.com.ctop.alarm.modules.entity.AlarmEventMetric;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+
+/**
+ * 制定详细规则表
+ *
+ * @author: jeecg-boot
+ * @date: 2020-10-29
+ * @cersion: V1.0
+ */
+public interface AlarmEventMetricMapper extends BaseMapper<AlarmEventMetric> {
+
+    List<AlarmEventMetric> selectByEventRuleId(String id);
+}

+ 15 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/AlarmEventRuleMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.alarm.modules.mapper;
+
+import cn.com.ctop.alarm.modules.entity.AlarmEventRule;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 预警事件规则表
+ *
+ * @author: jeecg-boot
+ * @date: 2020-10-29
+ * @cersion: V1.0
+ */
+public interface AlarmEventRuleMapper extends BaseMapper<AlarmEventRule> {
+
+}

+ 17 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/AlarmEventSendMapper.java

@@ -0,0 +1,17 @@
+package cn.com.ctop.alarm.modules.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import cn.com.ctop.alarm.modules.entity.AlarmEventSend;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 预警事件发送表
+ * @author: jeecg-boot
+ * @date:   2020-10-29
+ * @cersion: V1.0
+ */
+public interface AlarmEventSendMapper extends BaseMapper<AlarmEventSend> {
+
+}

+ 17 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/AlarmMetricValueMapper.java

@@ -0,0 +1,17 @@
+package cn.com.ctop.alarm.modules.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import cn.com.ctop.alarm.modules.entity.AlarmMetricValue;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 指标字段记录表
+ * @author: jeecg-boot
+ * @date:   2020-10-29
+ * @cersion: V1.0
+ */
+public interface AlarmMetricValueMapper extends BaseMapper<AlarmMetricValue> {
+
+}

+ 10 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/xml/AlarmEventMetricMapper.xml

@@ -0,0 +1,10 @@
+<?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.alarm.modules.mapper.AlarmEventMetricMapper">
+
+    <select id="selectByEventRuleId" resultType="cn.com.ctop.alarm.modules.entity.AlarmEventMetric">
+        SELECT *
+        FROM ctop_alarm_event_metric
+        WHERE event_metric_id = #{id}
+    </select>
+</mapper>

+ 5 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/xml/AlarmEventRuleMapper.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.AlarmEventRule.mapper.AlarmEventRuleMapper">
+
+</mapper>

+ 5 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/xml/AlarmEventSendMapper.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.alarm.modules.mapper.AlarmEventSendMapper">
+
+</mapper>

+ 5 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/mapper/xml/AlarmMetricValueMapper.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.alarm.modules.mapper.AlarmMetricValueMapper">
+
+</mapper>

+ 14 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/IAlarmEventMetricService.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.alarm.modules.service;
+
+import cn.com.ctop.alarm.modules.entity.AlarmEventMetric;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 制定详细规则表
+ * @Author: jeecg-boot
+ * @Date: 2020-10-29
+ * @Version: V1.0
+ */
+public interface IAlarmEventMetricService extends IService<AlarmEventMetric> {
+
+}

+ 20 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/IAlarmEventRuleService.java

@@ -0,0 +1,20 @@
+package cn.com.ctop.alarm.modules.service;
+
+import cn.com.ctop.alarm.modules.entity.AlarmEventRule;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 预警事件规则表
+ * @Author: jeecg-boot
+ * @Date: 2020-10-29
+ * @Version: V1.0
+ */
+public interface IAlarmEventRuleService extends IService<AlarmEventRule> {
+
+    void addAlarmEventRule(JSONObject obj);
+
+    void editAlarmEventRule(JSONObject obj);
+
+    AlarmEventRule selectById(String id);
+}

+ 14 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/IAlarmEventSendService.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.alarm.modules.service;
+
+import cn.com.ctop.alarm.modules.entity.AlarmEventSend;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 预警事件发送表
+ * @Author: jeecg-boot
+ * @Date:   2020-10-29
+ * @Version: V1.0
+ */
+public interface IAlarmEventSendService extends IService<AlarmEventSend> {
+
+}

+ 16 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/IAlarmMetricValueService.java

@@ -0,0 +1,16 @@
+package cn.com.ctop.alarm.modules.service;
+
+import cn.com.ctop.alarm.modules.entity.AlarmMetricValue;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
+
+/**
+ * @Description: 指标字段记录表
+ * @Author: jeecg-boot
+ * @Date:   2020-10-29
+ * @Version: V1.0
+ */
+public interface IAlarmMetricValueService extends IService<AlarmMetricValue> {
+
+    Result<Object> queryParentChildList(AlarmMetricValue alarmMetricValue);
+}

+ 19 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/impl/AlarmEventMetricServiceImpl.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.alarm.modules.service.impl;
+
+import cn.com.ctop.alarm.modules.entity.AlarmEventMetric;
+import cn.com.ctop.alarm.modules.mapper.AlarmEventMetricMapper;
+import cn.com.ctop.alarm.modules.service.IAlarmEventMetricService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 制定详细规则表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-10-29
+ */
+@Service
+public class AlarmEventMetricServiceImpl extends ServiceImpl<AlarmEventMetricMapper, AlarmEventMetric> implements IAlarmEventMetricService {
+
+}

+ 143 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/impl/AlarmEventRuleServiceImpl.java

@@ -0,0 +1,143 @@
+package cn.com.ctop.alarm.modules.service.impl;
+
+import cn.com.ctop.alarm.modules.entity.AlarmEventMetric;
+import cn.com.ctop.alarm.modules.entity.AlarmEventRule;
+import cn.com.ctop.alarm.modules.mapper.AlarmEventMetricMapper;
+import cn.com.ctop.alarm.modules.mapper.AlarmEventRuleMapper;
+import cn.com.ctop.alarm.modules.service.IAlarmEventRuleService;
+import cn.com.ctop.common.module.utils.Check;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 预警事件规则表
+ * 完成Condition
+ * CURRENT_TODAY_DATA
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-10-29
+ */
+@Service
+public class AlarmEventRuleServiceImpl extends ServiceImpl<AlarmEventRuleMapper, AlarmEventRule> implements IAlarmEventRuleService {
+
+    @Autowired
+    private AlarmEventRuleMapper alarmEventRuleMapper;
+
+    @Autowired
+    private AlarmEventMetricMapper alarmEventMetricMapper;
+
+    @Override
+    public void addAlarmEventRule(JSONObject obj) {
+        AlarmEventRule rule = new AlarmEventRule();
+        rule.setAccountId(obj.getLong("accountId"));
+        rule.setUnitId(obj.getLong("unitId"));
+        rule.setEventRuleName(obj.getString("eventRuleName"));
+        rule.setEventRuleLevel(obj.getString("eventRuleLevel"));
+        rule.setCheckFrequency(obj.getString("checkFrequency"));
+        rule.setProcessMethod(obj.getString("processMethod"));
+        rule.setEventRuleStatus(obj.getString("eventRuleStatus"));
+        alarmEventRuleMapper.insert(rule);
+        JSONArray metrics = obj.getJSONArray("alarmEventMetric");
+        for (int i = 0; i < metrics.size(); i++) {
+            JSONObject mo = metrics.getJSONObject(i);
+            AlarmEventMetric metric = new AlarmEventMetric();
+            metric.setEventRuleId(rule.getEventRuleId());
+            metric.setMetricValueCode(mo.getString("metricValueCode"));
+            metric.setJudgeType(mo.getString("judgeType"));
+            metric.setJudgeMethod(mo.getString("judgeMethod"));
+            metric.setThreshold(mo.getString("threshold"));
+            metric.setMinThreshold(mo.getString("minThreshold"));
+            metric.setDataRange(mo.getString("dataRange"));
+            alarmEventMetricMapper.insert(metric);
+        }
+    }
+
+    @Override
+    public void editAlarmEventRule(JSONObject obj) {
+        AlarmEventRule rule = new AlarmEventRule();
+        Long accountId = obj.getLong("accountId");
+        if (!Check.isNull(accountId)) {
+            rule.setAccountId(accountId);
+        }
+        Long unitId = obj.getLong("unitId");
+        if (!Check.isNull(unitId)) {
+            rule.setUnitId(unitId);
+        }
+        String eventRuleName = obj.getString("eventRuleName");
+        if (!Check.isNull(eventRuleName)) {
+            rule.setEventRuleName(eventRuleName);
+        }
+        String eventRuleLevel = obj.getString("eventRuleLevel");
+        if (!Check.isNull(eventRuleLevel)) {
+            rule.setEventRuleLevel(eventRuleLevel);
+        }
+        String checkFrequency = obj.getString("checkFrequency");
+        if (!Check.isNull(checkFrequency)) {
+            rule.setCheckFrequency(checkFrequency);
+        }
+        String processMethod = obj.getString("processMethod");
+        if (!Check.isNull(processMethod)) {
+            rule.setProcessMethod(processMethod);
+
+        }
+        String eventRuleStatus = obj.getString("eventRuleStatus");
+        if (!Check.isNull(eventRuleStatus)) {
+            rule.setEventRuleStatus(eventRuleStatus);
+        }
+        QueryWrapper<AlarmEventRule> ruleWrapper = new QueryWrapper<>();
+        ruleWrapper.eq("event_rule_id", obj.getLong("eventRuleId"));
+        alarmEventRuleMapper.update(rule, ruleWrapper);
+        JSONArray metrics = obj.getJSONArray("alarmEventMetric");
+        for (int i = 0; i < metrics.size(); i++) {
+            JSONObject mo = metrics.getJSONObject(i);
+            AlarmEventMetric metric = new AlarmEventMetric();
+            Long eventRuleId = rule.getEventRuleId();
+            if (!Check.isNull(eventRuleId)) {
+                metric.setEventRuleId(eventRuleId);
+            }
+            String metricValueCode = mo.getString("metricValueCode");
+            if (!Check.isNull(metricValueCode)) {
+                metric.setMetricValueCode(metricValueCode);
+            }
+            String judgeType = mo.getString("judgeType");
+            if (!Check.isNull(judgeType)) {
+                metric.setJudgeType(judgeType);
+            }
+            String judgeMethod = mo.getString("judgeMethod");
+            if (!Check.isNull(judgeMethod)) {
+                metric.setJudgeMethod(judgeMethod);
+            }
+            String threshold = mo.getString("threshold");
+            if (!Check.isNull(threshold)) {
+                metric.setThreshold(threshold);
+            }
+            String minThreshold = mo.getString("minThreshold");
+            if (!Check.isNull(minThreshold)) {
+                metric.setMinThreshold(minThreshold);
+            }
+            String dataRange = mo.getString("dataRange");
+            if (!Check.isNull(dataRange)) {
+                metric.setDataRange(dataRange);
+            }
+            QueryWrapper<AlarmEventMetric> metricWrapper = new QueryWrapper<>();
+            metricWrapper.eq("event_metric_id", mo.getLong("eventMetricId"));
+            metricWrapper.eq("event_rule_id", obj.getLong("eventRuleId"));
+            alarmEventMetricMapper.update(metric, metricWrapper);
+        }
+    }
+
+    @Override
+    public AlarmEventRule selectById(String id) {
+        AlarmEventRule alarmEventRule = alarmEventRuleMapper.selectById(id);
+        List<AlarmEventMetric> alarmEventMetricList = alarmEventMetricMapper.selectByEventRuleId(id);
+        return alarmEventRule.setAlarmEventMetrics(alarmEventMetricList);
+
+    }
+}

+ 19 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/impl/AlarmEventSendServiceImpl.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.alarm.modules.service.impl;
+
+import cn.com.ctop.alarm.modules.entity.AlarmEventSend;
+import cn.com.ctop.alarm.modules.mapper.AlarmEventSendMapper;
+import cn.com.ctop.alarm.modules.service.IAlarmEventSendService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * 预警事件发送表
+ * @author jeecg-boot
+ * @date   2020-10-29
+ * @version V1.0
+ */
+@Service
+public class AlarmEventSendServiceImpl extends ServiceImpl<AlarmEventSendMapper, AlarmEventSend> implements IAlarmEventSendService {
+
+}

+ 59 - 0
module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/impl/AlarmMetricValueServiceImpl.java

@@ -0,0 +1,59 @@
+package cn.com.ctop.alarm.modules.service.impl;
+
+import cn.com.ctop.alarm.modules.entity.AlarmMetricValue;
+import cn.com.ctop.alarm.modules.mapper.AlarmMetricValueMapper;
+import cn.com.ctop.alarm.modules.service.IAlarmMetricValueService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.common.api.vo.Result;
+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;
+
+/**
+ * 指标字段记录表
+ * depletion
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-10-29
+ */
+@Service
+public class AlarmMetricValueServiceImpl extends ServiceImpl<AlarmMetricValueMapper, AlarmMetricValue> implements IAlarmMetricValueService {
+
+    @Autowired
+    private AlarmMetricValueMapper alarmMetricValueMapper;
+
+    @Override
+    public Result<Object> queryParentChildList(AlarmMetricValue alarmMetricValue) {
+        Result<Object> result = new Result<>();
+        List<AlarmMetricValue> list = alarmMetricValueMapper.selectList(null);
+        List<AlarmMetricValue> resultList = new ArrayList<>();
+        Map<Integer, List<AlarmMetricValue>> map = new HashMap<>();
+        List<Integer> parents = new ArrayList<>();
+        for (AlarmMetricValue metricValue : list) {
+            if (0 == metricValue.getMetricParentId()) {
+                parents.add(metricValue.getMetricValueId());
+                resultList.add(metricValue);
+            }
+        }
+        for (Integer id : parents) {
+            List<AlarmMetricValue> childs = new ArrayList<>();
+            for (AlarmMetricValue metricValue : list) {
+                if (0 != metricValue.getMetricParentId()) {
+                    if (id == metricValue.getMetricParentId()) {
+                        childs.add(metricValue);
+                    }
+                }
+                map.put(id, childs);
+            }
+        }
+        for (AlarmMetricValue metricValue : resultList) {
+            metricValue.setChilds(map.get(metricValue.getMetricValueId()));
+        }
+        return Result.ok(resultList);
+    }
+}

+ 3 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java

@@ -152,6 +152,9 @@ public class MaterialInfo {
     private BigDecimal cost;
 
     @TableField(exist = false)
+    private BigDecimal bytedanceCost;
+
+    @TableField(exist = false)
     private String realname;
 
     @TableField(exist = false)

+ 36 - 1
module-common/src/main/java/cn/com/ctop/common/module/enums/MaterialEnum.java

@@ -11,8 +11,43 @@ public enum MaterialEnum {
     VerticalVideo846Small(1, 846, 1536),
     VerticalVideo1080mall(1, 1080, 2200),
     VerticalVideoBig(1, 1080, 1920),
+    VerticalVideo360(1, 360, 640),
+    VerticalVideo362(1, 362, 640),
+    VerticalVideo368(1, 368, 490),
+    VerticalVideo363(1, 363, 640),
+    VerticalVideo438(1, 438, 640),
+    VerticalVideo480(1, 480, 640),
+    VerticalVideo525(1, 525, 640),
+    VerticalVideo540(1, 540, 960),
+    VerticalVideo544(1, 544, 726),
+    VerticalVideo590(1, 590, 1280),
+    VerticalVideo694(1, 694, 1236),
+    VerticalVideo704(1, 704, 1252),
+    VerticalVideo710(1, 710, 1264),
+    VerticalVideo714(1, 714, 1270),
+    VerticalVideo716(1, 716, 1276),
+    VerticalVideo718(1, 718, 1278),
+    VerticalVideo719(1, 719, 1170),
+    VerticalVideo720(1, 720, 960),
+    VerticalVideo750(1, 750, 1334),
+    VerticalVideo787(1, 787, 1280),
+    VerticalVideo864(1, 864, 1536),
+    VerticalVideo1088(1, 1088, 1920),
+    VerticalVideo1181(1, 1181, 1920),
+    VerticalVideo1216(1, 1216, 2160),
+    VerticalVideo1296(1, 1296, 2304),
+    VerticalVideo1440(1, 1440, 2560),
+    VerticalVideo2160(1, 2160, 3840),
     HorizontalVideoSmall(2, 1280, 720),
-    HorizontalVideoBig(2, 1920, 1080);
+    HorizontalVideoBig(2, 1920, 1080),
+    HorizontalVideo640(2, 640, 368),
+    HorizontalVideo1281(2, 1281, 720),
+    HorizontalVideo1400(2, 1400, 720),
+    HorizontalVideo1700(2, 1700, 1080),
+    HorizontalVideo1902(2, 1902, 1080),
+    HorizontalVideo1920(2, 1920, 1080),
+    BianlitieImageBig(4, 540, 540),
+    BianLitieImageSmall(4, 450, 450);
 
     private Integer type;
     private Integer width;

+ 4 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/MaterialCutFrameMapper.java

@@ -1,6 +1,8 @@
 package cn.com.ctop.common.module.mapper;
 
 import cn.com.ctop.common.module.entity.MaterialCutFrame;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -17,4 +19,6 @@ import java.util.List;
 public interface MaterialCutFrameMapper extends BaseMapper<MaterialCutFrame> {
 
     List<MaterialCutFrame> getListByVideoSignature(@Param(value = "videoSignature") String signature);
+
+    List<JSONObject> getProgramCreativeCover(@Param("signature") String signature);
 }

+ 6 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/MaterialParameterMapper.java

@@ -1,7 +1,9 @@
 package cn.com.ctop.common.module.mapper;
 
 import cn.com.ctop.common.module.entity.MaterialParameter;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 素材归属标
@@ -12,4 +14,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface MaterialParameterMapper extends BaseMapper<MaterialParameter> {
 
+    JSONObject getMaterialTotalCharge(@Param("signature") String signature);
+
+    JSONObject getByteDanceMaterialTotalCharge(@Param("signature") String signature);
+
 }

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/UserAllocationMapper.java

@@ -18,6 +18,8 @@ public interface UserAllocationMapper extends BaseMapper<UserAllocation> {
 
     String queryAdvertiserId(@Param("accountId") Long accountId);
 
+    String queryUserIdByAccountId(@Param("accountId") Long accountId);
+
     List<JSONObject> getAccountListByProject(@Param("projectId") Long projectId);
 
     List<JSONObject> getUserIdListByProjectId(@Param("projectId") Long projectId);

+ 12 - 1
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialCutFrameMapper.xml

@@ -19,8 +19,19 @@
         where frame.signature = a.signature
         order by id desc
         limit 1) as 'id'
-from (select distinct signature
+       from (select distinct signature
       from ctop_material_cut_frame
       where video_signature = #{videoSignature}) a;
     </select>
+
+
+    <select id="getProgramCreativeCover" resultType="com.alibaba.fastjson.JSONObject">
+      SELECT
+      signature as 'signature',
+      url as 'url'
+      FROM ctop_material_cut_frame
+      WHERE video_signature = #{signature}
+      ORDER BY RAND() LIMIT 5;
+    </select>
+
 </mapper>

+ 6 - 1
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml

@@ -119,7 +119,9 @@
         matInfo.project_id,
         matInfo.id
         from ctop_material_info matInfo
-        left join ctop_material_tag_info tagInfo on tagInfo.code = matInfo.code
+        <if test="tagCode!=null">
+            left join ctop_material_tag_info tagInfo on tagInfo.code = matInfo.code
+        </if>
         where 1=1
         <if test="tagCode!=null">
             and tagInfo.tag_code like concat(#{tagCode},'%')
@@ -130,6 +132,9 @@
         <if test="userId!=null">
             and matInfo.user_id = #{userId}
         </if>
+        <if test="code!=null">
+            and matInfo.code = #{code}
+        </if>
         <if test="materialName!=null">
             and matInfo.material_name like concat('%',#{materialName},'%')
         </if>

+ 15 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialParameterMapper.xml

@@ -2,4 +2,19 @@
 <!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.MaterialParameterMapper">
 
+    <select id="getMaterialTotalCharge" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        signature,
+        sum(charge) as charges
+        FROM ctop_kuaishou_report_daily_material
+        WHERE signature = #{signature}
+    </select>
+
+    <select id="getByteDanceMaterialTotalCharge" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        signature,
+        sum(cost) as charges
+        FROM ctop_bytedance_video_report_daily
+        WHERE signature = #{signature}
+    </select>
 </mapper>

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

@@ -21,6 +21,13 @@
             ctop_user_allocation
         where account_id=#{accountId}
     </select>
+    <select id="queryUserIdByAccountId" resultType="String">
+        select
+            distinct user_id
+        from
+            ctop_user_allocation
+        where account_id=#{accountId}
+    </select>
 
     <select id="getAccountListByProject" resultType="com.alibaba.fastjson.JSONObject">
        select

+ 1 - 0
module-common/src/main/java/cn/com/ctop/common/module/message/handle/impl/EmailSendMsgHandle.java

@@ -34,6 +34,7 @@ public class EmailSendMsgHandle implements ISendMsgHandle {
             helper.setSubject(es_title);
             helper.setText(es_content, true);
             mailSender.send(message);
+
         } catch (MessagingException e) {
             e.printStackTrace();
         }

+ 3 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialCutFrameService.java

@@ -2,6 +2,7 @@ package cn.com.ctop.common.module.service;
 
 
 import cn.com.ctop.common.module.entity.MaterialCutFrame;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 import java.io.IOException;
@@ -25,10 +26,11 @@ public interface IMaterialCutFrameService extends IService<MaterialCutFrame> {
 
     void loadCosCutFrame(String jobId, String videoSignature);  //腾讯云抽帧任务状态查询以及数据入库
 
-    void getTencentCutFrame(String videoUrl,String materialId,String coveUrl);
+    void getTencentCutFrame(String videoUrl, String materialId, String coveUrl);
 
     boolean updateTencentCutFrame(String videoMD5);
 
     MaterialCutFrame getCutFrameByCode(String code);
 
+    List<JSONObject> getProgramCreativeCover(String signature);
 }

+ 37 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/IMessageTemplate.java

@@ -1,8 +1,22 @@
 package cn.com.ctop.common.module.service;
 
+import com.alibaba.fastjson.JSONObject;
+
 public interface IMessageTemplate {
 
-    String getMaterialSyncTemplate(String projectName, Long accountId, String accountName, String materialName, String reason);
+    String getMaterialSyncTemplate(String projectName, String accountId, String accountName, String materialName, String reason);
+
+    /**
+     * 同步成功发送消息
+     *
+     * @param projectName
+     * @param accountId
+     * @param accountName
+     * @param materialName
+     * @param reason
+     * @return
+     */
+    String getMaterialSyncSucessTemplate(String projectName, String accountId, String accountName, String materialName, String reason);
 
 
     String getMaterialRejectTemplate(String projectName, String materialName, String refuseReason);
@@ -11,4 +25,26 @@ public interface IMessageTemplate {
 
 
     String getFeishuMaterialRejectTemplate(String projectName, String materialName, String refuseReason);
+
+    String getCreativeOverRunMessage(Long accountId, Integer creativeCount, String authName);
+
+    /**
+     * 获取僵尸创意提醒通知模板
+     *
+     * @param
+     * @return java.lang.String
+     * @throws
+     * @author ZHAOXA
+     */
+    String getZombieCreativeRemindTemplate(JSONObject obj);
+
+    /**
+     * 获取僵尸创意关停通知模板
+     *
+     * @param
+     * @return java.lang.String
+     * @throws
+     * @author ZHAOXA
+     */
+    String getZombieCreativeShutDownTemplate(JSONObject obj);
 }

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

@@ -77,7 +77,7 @@ public class BindAccountAuthServiceImpl extends ServiceImpl<BindAccountAuthMappe
                     .append ("?app_id=" + PropertiesUtils.getValue("kuaishou_config", "kuaishou_third_appid"))
                     .append("&state=" + URLEncoder.encode(URLEncoder.encode(state)))
                     .append("&scope=%5B%22report_service%22%2C%22ad_query%22%2C%22account_service%22%2C%22ad_manage%22%5D")
-                    .append("&redirect_uri=" + URLEncoder.encode(PropertiesUtils.getValue("kuaishou_config", "kuaishou_callback_url"), "UTF-8"));
+                    .append("&redirect_uri=" + URLEncoder.encode(PropertiesUtils.getValue("kuaishou_config", "kuaishou_third_callback_url"), "UTF-8"));
         }
 
         return sb.toString();

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

@@ -77,7 +77,7 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
                     log.error("头条上传素材失败,返回信息:{},accountId:{}", jsonObject, accountId);
                     UserAllocation allocation = userAllocationService.getByAccountId(Long.valueOf(accountId));
                     Project project = projectService.getById(allocation.getProjectId());
-                    String message = messageTemplate.getMaterialSyncTemplate(project.getProjectName(), Long.valueOf(accountId), allocation.getAuthName(), materialName, jsonObject.getString("message"));
+                    String message = messageTemplate.getMaterialSyncTemplate(project.getProjectName(), accountId, allocation.getAuthName(), materialName, jsonObject.getString("message"));
                     sendMessageService.sendMessage(userId, message);
                 }
 

+ 5 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialCutFrameServiceImpl.java

@@ -423,5 +423,10 @@ public class MaterialCutFrameServiceImpl extends ServiceImpl<MaterialCutFrameMap
         return this.getOne(queryWrapper);
     }
 
+    @Override
+    public  List<JSONObject>  getProgramCreativeCover(String signature) {
+        return materialCutFrameMapper.getProgramCreativeCover(signature);
+    }
+
 
 }

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

@@ -1,14 +1,39 @@
 package cn.com.ctop.common.module.service.impl;
 
 import cn.com.ctop.common.module.constant.CosConstant;
-import cn.com.ctop.common.module.entity.*;
+import cn.com.ctop.common.module.entity.MaterialAscription;
+import cn.com.ctop.common.module.entity.MaterialCutFrame;
+import cn.com.ctop.common.module.entity.MaterialImageInfo;
+import cn.com.ctop.common.module.entity.MaterialInfo;
+import cn.com.ctop.common.module.entity.MaterialParameter;
+import cn.com.ctop.common.module.entity.MaterialTag;
+import cn.com.ctop.common.module.entity.MaterialTagInfo;
+import cn.com.ctop.common.module.entity.Project;
+import cn.com.ctop.common.module.entity.SupplierWatermark;
+import cn.com.ctop.common.module.entity.TagInfo;
+import cn.com.ctop.common.module.entity.TencentWatermarkTemplate;
+import cn.com.ctop.common.module.entity.VideoWatermarkTask;
 import cn.com.ctop.common.module.enums.MaterialSupplierEnum;
 import cn.com.ctop.common.module.mapper.MaterialAscriptionMapper;
 import cn.com.ctop.common.module.mapper.MaterialInfoMapper;
 import cn.com.ctop.common.module.mapper.MaterialParameterMapper;
 import cn.com.ctop.common.module.mapper.MaterialTagMapper;
-import cn.com.ctop.common.module.service.*;
-import cn.com.ctop.common.module.utils.*;
+import cn.com.ctop.common.module.service.IMaterialCutFrameService;
+import cn.com.ctop.common.module.service.IMaterialImageInfoService;
+import cn.com.ctop.common.module.service.IMaterialInfoService;
+import cn.com.ctop.common.module.service.IMaterialTagInfoService;
+import cn.com.ctop.common.module.service.IProjectService;
+import cn.com.ctop.common.module.service.ISupplierWatermarkService;
+import cn.com.ctop.common.module.service.ITagInfoService;
+import cn.com.ctop.common.module.service.ITencentWatermarkTemplateService;
+import cn.com.ctop.common.module.service.IVideoWatermarkTaskService;
+import cn.com.ctop.common.module.utils.AesEncryptUtil;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.CloudVideoProcessUtil;
+import cn.com.ctop.common.module.utils.LoadFileUtil;
+import cn.com.ctop.common.module.utils.PropertiesUtils;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -32,7 +57,11 @@ import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.net.URLDecoder;
 import java.nio.channels.FileChannel;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
@@ -518,7 +547,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
             MaterialInfo info = new MaterialInfo();
             Long projectId = json.getLong("projectId");
             String code = json.getString("code");
-            info.setId(code + "_" + projectId);
+            info.setId(code + projectId);
             info.setCode(code);
             if (!Check.isNull(json.getString("watermarkUrl"))) {
                 info.setWatermarkUrl(json.getString("watermarkUrl"));
@@ -677,14 +706,14 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
     }
 
     @Override
-    public Map<String,Object> getListByParams(String tagCode,String type, Integer status, List<Long> projectIds, String materialName, String code, String startDate, String endDate, String userId, Integer pageNo, Integer pageSize) {
-        Map<String,Object> result = new HashMap<>();
-        PageHelper.startPage(pageNo,pageSize);
-        List<MaterialInfo> dailyList = materialInfoMapper.getListByParams(tagCode,type,status,projectIds,materialName,code,startDate,endDate, userId);
+    public Map<String, Object> getListByParams(String tagCode, String type, Integer status, List<Long> projectIds, String materialName, String code, String startDate, String endDate, String userId, Integer pageNo, Integer pageSize) {
+        Map<String, Object> result = new HashMap<>();
+        PageHelper.startPage(pageNo, pageSize);
+        List<MaterialInfo> dailyList = materialInfoMapper.getListByParams(tagCode, type, status, projectIds, materialName, code, startDate, endDate, userId);
         List<MaterialInfo> setList = new ArrayList<>();
         PageInfo<MaterialInfo> pageInfo = new PageInfo<>(dailyList);
-        if(null!=dailyList&&!dailyList.isEmpty()){
-            for(MaterialInfo info:dailyList){
+        if (null != dailyList && !dailyList.isEmpty()) {
+            for (MaterialInfo info : dailyList) {
                 MaterialInfo materialInfo = materialInfoMapper.selectById(info.getId());
                 //判断是否已经同步到快手平台
                 Integer kuaishouMaterialUpCount = this.getKuaishouUpVideoCount(info.getCode());
@@ -700,8 +729,20 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
                 } else {
                     materialInfo.setToutiaoVideoIsUp(0);
                 }
-
-                //TODO 消耗统计
+                //统计快手总消耗数据
+                JSONObject kuaishous = materialParameterMapper.getMaterialTotalCharge(info.getCode());
+                if (!Check.isNull(kuaishous)) {
+                    materialInfo.setCost(kuaishous.getBigDecimal("charges"));
+                } else {
+                    materialInfo.setCost(new BigDecimal(0));
+                }
+                //统计抖音总消耗数据
+                JSONObject bytedances = materialParameterMapper.getByteDanceMaterialTotalCharge(info.getCode());
+                if (!Check.isNull(bytedances)) {
+                    materialInfo.setBytedanceCost(bytedances.getBigDecimal("charges"));
+                } else {
+                    materialInfo.setBytedanceCost(new BigDecimal(0));
+                }
 
                 Project project = projectService.getById(info.getProjectId());
                 if (!Check.isNull(project)) {
@@ -723,8 +764,8 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
             }
         }
         pageInfo.setList(setList);
-        result.put("data",pageInfo);
-        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        result.put("data", pageInfo);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
         return result;
     }
 }

+ 64 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MessageTemplateImpl.java

@@ -2,6 +2,7 @@ package cn.com.ctop.common.module.service.impl;
 
 import cn.com.ctop.common.module.service.IMessageTemplate;
 import cn.com.ctop.common.module.utils.Check;
+import com.alibaba.fastjson.JSONObject;
 import org.springframework.stereotype.Service;
 
 @Service
@@ -19,7 +20,7 @@ public class MessageTemplateImpl implements IMessageTemplate {
      * @return
      */
     @Override
-    public String getMaterialSyncTemplate(String projectName, Long accountId, String accountName, String materialName, String reason) {
+    public String getMaterialSyncTemplate(String projectName, String accountId, String accountName, String materialName, String reason) {
         StringBuilder text = new StringBuilder();
         text.append("素材同步失败").append("<br/>")
                 .append("您的项目:").append(projectName + ",").append("<br/>")
@@ -32,6 +33,19 @@ public class MessageTemplateImpl implements IMessageTemplate {
     }
 
     @Override
+    public String getMaterialSyncSucessTemplate(String projectName, String accountId, String accountName, String materialName, String reason) {
+        StringBuilder text = new StringBuilder();
+        text.append("素材同步成功通知:").append("<br/>")
+                .append("您的项目:").append(projectName + ",").append("<br/>")
+                .append("下的快手账户:").append(accountId + ",").append("<br/>")
+                .append("授权名称为:" + accountName).append("<br/>")
+                .append("同步素材成功。").append("<br/>")
+                .append("素材名称为:").append(materialName).append("<br/>")
+                .append("请您前往查看。");
+        return text.toString();
+    }
+
+    @Override
     public String getFeishuMaterialSyncTemplate(String projectName, Long accountId, String accountName, String materialName, String reason) {
         StringBuilder text = new StringBuilder();
         text.append("素材同步失败").append("\n\r")
@@ -82,4 +96,53 @@ public class MessageTemplateImpl implements IMessageTemplate {
         text.append("请您联系相关同学及时调整");
         return text.toString();
     }
+
+    @Override
+    public String getCreativeOverRunMessage(Long accountId, Integer creativeCount, String authName) {
+        StringBuilder text = new StringBuilder();
+        text.append("创意超限通知:").append("<br/>")
+
+                .append("您的快手账户:").append(accountId + ",").append("<br/>")
+                .append("授权名称为:" + authName).append("<br/>")
+                .append("创意api创建超限。").append("<br/>")
+                .append("当前创建数为:").append(creativeCount).append("<br/>")
+                .append("如有疑问,请联系产品:吴永前。");
+        return text.toString();
+    }
+
+    @Override
+    public String getZombieCreativeRemindTemplate(JSONObject obj) {
+        StringBuilder text = new StringBuilder();
+        text.append("即将成为僵尸创意预警").append("<br/>")
+                .append("您的项目:").append(obj.getString("projectName"))
+                .append("(").append(obj.getString("projectId")).append(")").append("<br/>")
+                .append("广告计划:").append(obj.getString("campaignName"))
+                .append("(").append(obj.getString("campaignId")).append(")").append("<br/>")
+                .append("广告组:").append(obj.getString("unitName"))
+                .append("(").append(obj.getString("unitId")).append(")").append("<br/>")
+                .append("广告创意:").append(obj.getString("creativeName"))
+                .append("(").append(obj.getString("creativeId")).append(")").append("<br/>")
+                .append("当前创意0消耗即将超过5天").append("<br/>")
+                .append("即将变为僵尸创意").append("<br/>")
+                .append("请您及时查看!");
+        return text.toString();
+    }
+
+    @Override
+    public String getZombieCreativeShutDownTemplate(JSONObject obj) {
+        StringBuilder text = new StringBuilder();
+        text.append("已经成为僵尸创意预警").append("<br/>")
+                .append("您的项目:").append(obj.getString("projectName"))
+                .append("(").append(obj.getString("projectId")).append(")").append("<br/>")
+                .append("广告计划:").append(obj.getString("campaignName"))
+                .append("(").append(obj.getString("campaignId")).append(")").append("<br/>")
+                .append("广告组:").append(obj.getString("unitName"))
+                .append("(").append(obj.getString("unitId")).append(")").append("<br/>")
+                .append("广告创意:").append(obj.getString("creativeName"))
+                .append("(").append(obj.getString("creativeId")).append(")").append("<br/>")
+                .append("当前创意0消耗已经超过5天").append("<br/>")
+                .append("已经变为僵尸创意,且已被关停").append("<br/>")
+                .append("请您及时查看!");
+        return text.toString();
+    }
 }

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

@@ -1,10 +1,7 @@
 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;

+ 10 - 3
module-common/src/main/java/cn/com/ctop/common/module/utils/KuaishouInterfaceConstant.java

@@ -20,6 +20,10 @@ public class KuaishouInterfaceConstant {
      */
     public static final String CAMPAIGN_REPORT = "/rest/openapi/v1/report/campaign_report";
     /**
+     * 程序化2.0创意
+     */
+    public static final String PROGRAM_LIST = "/rest/openapi/v2/creative/advanced/program/list";
+    /**
      * 广告组报表数据
      */
     public static final String GTOUP_REPORT = "/rest/openapi/v1/report/unit_report";
@@ -48,10 +52,14 @@ public class KuaishouInterfaceConstant {
      */
     public static final String AD_UNIT_CREATE = "/rest/openapi/v2/ad_unit/create";
     /**
-     * 创建广告
+     * 创建广告创意
      */
     public static final String AD_CREATIVE_CREATE = "/rest/openapi/v2/creative/create";
     /**
+     * 程序化创意 2.0
+     */
+    public static final String PROGRAM_CREATE = "/rest/openapi/v2/creative/advanced/program/create";
+    /**
      * 获取可选的深度转化类型
      */
     public static final String DEEP_CONVERSION_INFOS = "/rest/openapi/v1/ad_unit/ocpc/conversion_infos";
@@ -123,6 +131,7 @@ public class KuaishouInterfaceConstant {
      * 获取可选的动态词包
      */
     public static final String CREATIVE_WORD = "/rest/openapi/v1/tool/creative_word/list";
+    public static final String ACTION_BAR_TEXT_LIST = "/rest/openapi/v1/creative/action_bar_text/list";
 
 
     /**
@@ -237,6 +246,4 @@ public class KuaishouInterfaceConstant {
     public static final String HTTPS_PREFIX = "https:";
 
 
-
-
 }

+ 4 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/LoadFileUtil.java

@@ -92,6 +92,10 @@ public class LoadFileUtil {
         return flag;
     }
 
+    public static void main(String[] args) throws IOException {
+        System.out.println(getMD5("D:\\data\\6ybjAGrL.mp4"));
+    }
+
     /**
      * 获取文件md5
      *

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 467 - 0
module-common/src/main/java/cn/com/ctop/common/module/vo/ByteDanceReportAccountDailyDTOEntity.java


+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/DTO/ImageCostVO.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.modules.report.DTO;
+package cn.com.ctop.common.module.vo;
 
 import lombok.Data;
 
@@ -6,7 +6,7 @@ import java.io.Serializable;
 import java.math.BigDecimal;
 
 @Data
-public class ImageCostVO implements Serializable {
+public class BytedanceImageCostVO implements Serializable {
     private String statDate;
     private String signature;
     private String projectName;

+ 123 - 0
module-common/src/main/java/cn/com/ctop/common/module/vo/BytedanceImageCostVOEntity.java

@@ -0,0 +1,123 @@
+package cn.com.ctop.common.module.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.metadata.BaseRowModel;
+
+import java.math.BigDecimal;
+
+public class BytedanceImageCostVOEntity extends BaseRowModel {
+    @ExcelProperty(index = 1, value = "图片链接")
+    private String imageUrl;
+    @ExcelProperty(index = 1, value = "上传时间")
+    private String statDate;
+    @ExcelProperty(index = 1, value = "图片标识")
+    private String signature;
+    @ExcelProperty(index = 1, value = "项目名称")
+    private String projectName;
+    @ExcelProperty(index = 1, value = "消耗")
+    private BigDecimal cost;
+    @ExcelProperty(index = 1, value = "点击数")
+    private Long click;
+    @ExcelProperty(index = 1, value = "展示数")
+    private Long showNum;
+    @ExcelProperty(index = 1, value = "转化数")
+    private Long convert;
+    @ExcelProperty(index = 1, value = "平面id")
+    private String userId;
+    @ExcelProperty(index = 1, value = "平面名称")
+    private String userName;
+
+    public BytedanceImageCostVOEntity() {
+    }
+
+    public BytedanceImageCostVOEntity(BytedanceImageCostVO vo) {
+        this.imageUrl = vo.getImageUrl();
+        this.statDate = vo.getStatDate();
+        this.signature = vo.getSignature();
+        this.projectName = vo.getProjectName();
+        this.cost = vo.getCost();
+        this.click = vo.getClick();
+        this.showNum = vo.getShowNum();
+        this.convert = vo.getConvert();
+    }
+
+    public String getImageUrl() {
+        return imageUrl;
+    }
+
+    public void setImageUrl(String imageUrl) {
+        this.imageUrl = imageUrl;
+    }
+
+    public String getStatDate() {
+        return statDate;
+    }
+
+    public void setStatDate(String statDate) {
+        this.statDate = statDate;
+    }
+
+    public String getSignature() {
+        return signature;
+    }
+
+    public void setSignature(String signature) {
+        this.signature = signature;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public BigDecimal getCost() {
+        return cost;
+    }
+
+    public void setCost(BigDecimal cost) {
+        this.cost = cost;
+    }
+
+    public Long getClick() {
+        return click;
+    }
+
+    public void setClick(Long click) {
+        this.click = click;
+    }
+
+    public Long getShowNum() {
+        return showNum;
+    }
+
+    public void setShowNum(Long showNum) {
+        this.showNum = showNum;
+    }
+
+    public Long getConvert() {
+        return convert;
+    }
+
+    public void setConvert(Long convert) {
+        this.convert = convert;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+}

+ 23 - 0
module-common/src/main/java/cn/com/ctop/common/module/vo/KuaishouImageCostVO.java

@@ -0,0 +1,23 @@
+package cn.com.ctop.common.module.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Data
+public class KuaishouImageCostVO implements Serializable {
+    String imageUrl;
+    String signature;
+    String projectName;
+    BigDecimal charge;
+    Long photoClick;
+    Long photoShow;
+    Long activation;
+    Long eventRegister;
+    Long eventPay;
+    Long formCount;
+    Long eventJinJianApp;
+    Long eventCreditGrantApp;
+    String userName;
+}

+ 152 - 0
module-common/src/main/java/cn/com/ctop/common/module/vo/KuaishouImageCostVOEntity.java

@@ -0,0 +1,152 @@
+package cn.com.ctop.common.module.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.metadata.BaseRowModel;
+
+import java.math.BigDecimal;
+
+public class KuaishouImageCostVOEntity extends BaseRowModel {
+    @ExcelProperty(index = 1, value = "图片url")
+    String imageUrl;
+    @ExcelProperty(index = 2, value = "图片标识")
+    String signature;
+    @ExcelProperty(index = 3, value = "所属项目")
+    String projectName;
+    @ExcelProperty(index = 4, value = "消耗")
+    BigDecimal charge;
+    @ExcelProperty(index = 5, value = "封面点击数")
+    Long photoClick;
+    @ExcelProperty(index = 6, value = "封面曝光数")
+    Long photoShow;
+    @ExcelProperty(index = 7, value = "激活数")
+    Long activation;
+    @ExcelProperty(index = 8, value = "注册数")
+    Long eventRegister;
+    @ExcelProperty(index = 9, value = "付费数")
+    Long eventPay;
+    @ExcelProperty(index = 10, value = "表单提交数")
+    Long formCount;
+    @ExcelProperty(index = 11, value = "完件数")
+    Long eventJinJianApp;
+    @ExcelProperty(index = 12, value = "授信数")
+    Long eventCreditGrantApp;
+    @ExcelProperty(index = 13, value = "所属平面id")
+    String userId;
+    @ExcelProperty(index = 14, value = "所属平面")
+    String userName;
+
+    public KuaishouImageCostVOEntity() {
+    }
+
+    public String getImageUrl() {
+        return imageUrl;
+    }
+
+    public void setImageUrl(String imageUrl) {
+        this.imageUrl = imageUrl;
+    }
+
+    public String getSignature() {
+        return signature;
+    }
+
+    public void setSignature(String signature) {
+        this.signature = signature;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public BigDecimal getCharge() {
+        return charge;
+    }
+
+    public void setCharge(BigDecimal charge) {
+        this.charge = charge;
+    }
+
+    public Long getPhotoClick() {
+        return photoClick;
+    }
+
+    public void setPhotoClick(Long photoClick) {
+        this.photoClick = photoClick;
+    }
+
+    public Long getPhotoShow() {
+        return photoShow;
+    }
+
+    public void setPhotoShow(Long photoShow) {
+        this.photoShow = photoShow;
+    }
+
+    public Long getActivation() {
+        return activation;
+    }
+
+    public void setActivation(Long activation) {
+        this.activation = activation;
+    }
+
+    public Long getEventRegister() {
+        return eventRegister;
+    }
+
+    public void setEventRegister(Long eventRegister) {
+        this.eventRegister = eventRegister;
+    }
+
+    public Long getEventPay() {
+        return eventPay;
+    }
+
+    public void setEventPay(Long eventPay) {
+        this.eventPay = eventPay;
+    }
+
+    public Long getFormCount() {
+        return formCount;
+    }
+
+    public void setFormCount(Long formCount) {
+        this.formCount = formCount;
+    }
+
+    public Long getEventJinJianApp() {
+        return eventJinJianApp;
+    }
+
+    public void setEventJinJianApp(Long eventJinJianApp) {
+        this.eventJinJianApp = eventJinJianApp;
+    }
+
+    public Long getEventCreditGrantApp() {
+        return eventCreditGrantApp;
+    }
+
+    public void setEventCreditGrantApp(Long eventCreditGrantApp) {
+        this.eventCreditGrantApp = eventCreditGrantApp;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+}

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 367 - 0
module-common/src/main/java/cn/com/ctop/common/module/vo/KuaishouReportAccountDailyDTOEntity.java


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

@@ -3,7 +3,7 @@ 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);
+    void getHotMusicList();
+    MusicInfo getMusicInfo(MusicInfo musicInfo);
+    void parseTag(MusicInfo musicInfo);
 }

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/douyin/service/impl/DouyinMusicServiceImpl.java


+ 74 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/entity/BytedanceMusicInfo.java

@@ -0,0 +1,74 @@
+package cn.com.ctop.crawler.modules.music.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
+ * @date   2020-10-28
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_music_info")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_music_info对象", description="音乐信息")
+public class BytedanceMusicInfo {
+
+	/**id*/
+	@TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+	private Integer id;
+	/**name*/
+	@Excel(name = "name", width = 15)
+    @ApiModelProperty(value = "name")
+	private String name;
+	/**author*/
+	@Excel(name = "author", width = 15)
+    @ApiModelProperty(value = "author")
+	private String author;
+	/**usedCount*/
+	@Excel(name = "usedCount", width = 15)
+    @ApiModelProperty(value = "usedCount")
+	private Integer usedCount;
+	/**musicUrl*/
+	@Excel(name = "musicUrl", width = 15)
+    @ApiModelProperty(value = "musicUrl")
+	private String musicUrl;
+	/**coverUrl*/
+	@Excel(name = "coverUrl", width = 15)
+    @ApiModelProperty(value = "coverUrl")
+	private String coverUrl;
+	/**duration*/
+	@Excel(name = "duration", width = 15)
+    @ApiModelProperty(value = "duration")
+	private Integer duration;
+	/**source*/
+	@Excel(name = "source", width = 15)
+    @ApiModelProperty(value = "source")
+	private String source;
+	/**extId*/
+	@Excel(name = "extId", width = 15)
+    @ApiModelProperty(value = "extId")
+	private String extId;
+	/**extInfo*/
+	@Excel(name = "extInfo", width = 15)
+    @ApiModelProperty(value = "extInfo")
+	private Object extInfo;
+	/**createTime*/
+    @ApiModelProperty(value = "createTime")
+	private Date createTime;
+	/**updateTime*/
+    @ApiModelProperty(value = "updateTime")
+	private Date updateTime;
+}

+ 40 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/entity/BytedanceMusicType.java

@@ -0,0 +1,40 @@
+package cn.com.ctop.crawler.modules.music.entity;
+
+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 io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+/**
+ * 音乐类型信息
+ * @author jeecg-boot
+ * @date   2020-10-28
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_music_type")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_music_type对象", description="音乐类型信息")
+public class BytedanceMusicType {
+
+	@TableId(type = IdType.AUTO)
+	private Long id;
+	private String type;
+	private String typeValue;
+	private String extType;
+	private String extTypeValue;
+	private Long musicId;
+	private String musicName;
+	private String author;
+	private Date createTime;
+
+	@TableField(exist = false)
+	private BytedanceMusicInfo musicInfo;
+}

+ 41 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/entity/DictMusicType.java

@@ -0,0 +1,41 @@
+package cn.com.ctop.crawler.modules.music.entity;
+
+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 io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 抖音音乐类型
+ * @author jeecg-boot
+ * @date   2020-10-28
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_dict_music_type_zh")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_dict_music_type_zh对象", description="抖音音乐类型")
+public class DictMusicType {
+
+	/**id*/
+	@TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+	private Long id;
+	private String extType;
+	private String extTypeValue;
+	private String extTypeZh;
+	private String extTypeValueZh;
+	private Date createTime;
+	private Date updateTime;
+	@TableField(exist = false)
+	private List<DictMusicType> detail;
+}

+ 14 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/BytedanceMusicInfoMapper.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.crawler.modules.music.mapper;
+
+import cn.com.ctop.crawler.modules.music.entity.BytedanceMusicInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 音乐信息
+ * @author: jeecg-boot
+ * @date:   2020-10-28
+ * @cersion: V1.0
+ */
+public interface BytedanceMusicInfoMapper extends BaseMapper<BytedanceMusicInfo> {
+
+}

+ 14 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/BytedanceMusicTypeMapper.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.crawler.modules.music.mapper;
+
+import cn.com.ctop.crawler.modules.music.entity.BytedanceMusicType;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 音乐类型信息
+ * @author: jeecg-boot
+ * @date:   2020-10-28
+ * @cersion: V1.0
+ */
+public interface BytedanceMusicTypeMapper extends BaseMapper<BytedanceMusicType> {
+
+}

+ 20 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/DictMusicTypeMapper.java

@@ -0,0 +1,20 @@
+package cn.com.ctop.crawler.modules.music.mapper;
+
+import cn.com.ctop.crawler.modules.music.entity.DictMusicType;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 抖音音乐类型
+ * @author: jeecg-boot
+ * @date:   2020-10-28
+ * @cersion: V1.0
+ */
+public interface DictMusicTypeMapper extends BaseMapper<DictMusicType> {
+
+    List<DictMusicType> getAllExtTypeZh();
+
+    List<DictMusicType> getAllExtInfoByExtTypeZh(@Param(value = "extTypeZh")String extTypeZh);
+}

+ 5 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/xml/BytedanceMusicInfoMapper.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.crawler.modules.music.mapper.BytedanceMusicInfoMapper">
+
+</mapper>

+ 5 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/xml/BytedanceMusicTypeMapper.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.crawler.modules.music.mapper.BytedanceMusicTypeMapper">
+
+</mapper>

+ 13 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/xml/DictMusicTypeMapper.xml

@@ -0,0 +1,13 @@
+<?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.music.mapper.DictMusicTypeMapper">
+
+    <select id="getAllExtTypeZh" resultType="cn.com.ctop.crawler.modules.music.entity.DictMusicType">
+        select distinct ext_type_zh,ext_type from ctop_dict_music_type_zh
+    </select>
+
+    <select id="getAllExtInfoByExtTypeZh" resultType="cn.com.ctop.crawler.modules.music.entity.DictMusicType">
+        select distinct ext_type_value,ext_type_zh from ctop_dict_music_type_zh
+        where ext_type_zh = #{extTypeZh}
+    </select>
+</mapper>

+ 14 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/IBytedanceMusicInfoService.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.crawler.modules.music.service;
+
+import cn.com.ctop.crawler.modules.music.entity.BytedanceMusicInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 音乐信息
+ * @Author: jeecg-boot
+ * @Date:   2020-10-28
+ * @Version: V1.0
+ */
+public interface IBytedanceMusicInfoService extends IService<BytedanceMusicInfo> {
+
+}

+ 14 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/IBytedanceMusicTypeService.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.crawler.modules.music.service;
+
+import cn.com.ctop.crawler.modules.music.entity.BytedanceMusicType;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 音乐类型信息
+ * @Author: jeecg-boot
+ * @Date:   2020-10-28
+ * @Version: V1.0
+ */
+public interface IBytedanceMusicTypeService extends IService<BytedanceMusicType> {
+
+}

+ 16 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/IDictMusicTypeService.java

@@ -0,0 +1,16 @@
+package cn.com.ctop.crawler.modules.music.service;
+
+import cn.com.ctop.crawler.modules.music.entity.DictMusicType;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 抖音音乐类型
+ * @Author: jeecg-boot
+ * @Date:   2020-10-28
+ * @Version: V1.0
+ */
+public interface IDictMusicTypeService extends IService<DictMusicType> {
+
+    JSONObject listAll();
+}

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

@@ -0,0 +1,18 @@
+package cn.com.ctop.crawler.modules.music.service.impl;
+
+import cn.com.ctop.crawler.modules.music.entity.BytedanceMusicInfo;
+import cn.com.ctop.crawler.modules.music.mapper.BytedanceMusicInfoMapper;
+import cn.com.ctop.crawler.modules.music.service.IBytedanceMusicInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 音乐信息
+ * @author jeecg-boot
+ * @date   2020-10-28
+ * @version V1.0
+ */
+@Service
+public class BytedanceMusicInfoServiceImpl extends ServiceImpl<BytedanceMusicInfoMapper, BytedanceMusicInfo> implements IBytedanceMusicInfoService {
+
+}

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

@@ -0,0 +1,18 @@
+package cn.com.ctop.crawler.modules.music.service.impl;
+
+import cn.com.ctop.crawler.modules.music.entity.BytedanceMusicType;
+import cn.com.ctop.crawler.modules.music.mapper.BytedanceMusicTypeMapper;
+import cn.com.ctop.crawler.modules.music.service.IBytedanceMusicTypeService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 音乐类型信息
+ * @author jeecg-boot
+ * @date   2020-10-28
+ * @version V1.0
+ */
+@Service
+public class BytedanceMusicTypeServiceImpl extends ServiceImpl<BytedanceMusicTypeMapper, BytedanceMusicType> implements IBytedanceMusicTypeService {
+
+}

+ 38 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/impl/DictMusicTypeServiceImpl.java

@@ -0,0 +1,38 @@
+package cn.com.ctop.crawler.modules.music.service.impl;
+
+import cn.com.ctop.crawler.modules.music.entity.DictMusicType;
+import cn.com.ctop.crawler.modules.music.mapper.DictMusicTypeMapper;
+import cn.com.ctop.crawler.modules.music.service.IDictMusicTypeService;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 抖音音乐类型
+ * @author jeecg-boot
+ * @date   2020-10-28
+ * @version V1.0
+ */
+@Service
+public class DictMusicTypeServiceImpl extends ServiceImpl<DictMusicTypeMapper, DictMusicType> implements IDictMusicTypeService {
+    @Autowired
+    private DictMusicTypeMapper musicTypeMapper;
+    @Override
+    public JSONObject listAll() {
+        JSONObject data = new JSONObject();
+        List<DictMusicType> musicTypeList = musicTypeMapper.getAllExtTypeZh();
+        if(null!=musicTypeList&&!musicTypeList.isEmpty()){
+            List<DictMusicType> setList = musicTypeMapper.getAllExtTypeZh();
+            for (DictMusicType type:musicTypeList) {
+                List<DictMusicType>children = musicTypeMapper.getAllExtInfoByExtTypeZh(type.getExtTypeZh());
+                type.setDetail(children);
+                setList.add(type);
+            }
+            data.put("data",setList);
+        }
+        return data;
+    }
+}

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

@@ -10,6 +10,8 @@ import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
 import cn.com.ctop.common.module.utils.LoadFileUtil;
 import cn.com.ctop.common.module.utils.PropertiesUtils;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouAdvertiserBaseInfo;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouAdvertiserBaseInfoService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.manage.modules.material.service.IMaterialUploadImageService;
 import cn.com.ctop.manage.modules.material.service.IMaterialUploadService;
@@ -91,16 +93,16 @@ public class MaterialUploadServiceImpl implements IMaterialUploadService {
         for (int j = 0; j < materialArray.size(); j++) {
             String materialId = materialArray.getString(j);
             MaterialInfo materialInfo = materialInfoMapper.selectById(materialId);
-            MaterialImageInfo materialImageInfo= materialImageInfoMapper.selectById(materialId);
-            if (Check.isNull(materialInfo)&&Check.isNull(materialImageInfo)) {
+            MaterialImageInfo materialImageInfo = materialImageInfoMapper.selectById(materialId);
+            if (Check.isNull(materialInfo) && Check.isNull(materialImageInfo)) {
                 continue;
             }
             try {
                 String url = "";
-                if(Check.isNull(materialInfo)){
-                    url= (String) materialImageInfo.getUrl();
-                }else {
-                    url= materialInfo.getUrl();
+                if (Check.isNull(materialInfo)) {
+                    url = (String) materialImageInfo.getUrl();
+                } else {
+                    url = materialInfo.getUrl();
                 }
                 String localUrl = LoadFileUtil.downLoadFromUrl(url, downloadUrl);
 
@@ -115,7 +117,7 @@ public class MaterialUploadServiceImpl implements IMaterialUploadService {
                         public void run() {
                             try {
                                 log.info("头条文件多线程上传:{},accountId:{}", Thread.currentThread().getName(), accountId);
-                                if (materialInfo!=null&&"VIDEO".equals(materialInfo.getType())) {
+                                if (materialInfo != null && "VIDEO".equals(materialInfo.getType())) {
                                     fileInfoService.uploadVideoToBytedance(String.valueOf(accountId), localUrl, userId, materialInfo.getMaterialName());
 
                                 } else if ("IMAGE".equals(materialImageInfo.getType())) {
@@ -133,6 +135,9 @@ public class MaterialUploadServiceImpl implements IMaterialUploadService {
         }
     }
 
+    @Autowired
+    private IKuaiShouAdvertiserBaseInfoService advertiserBaseInfoService;
+
     private void kuaiShouUpload(String mediaId, JSONArray materialArray, JSONArray accountArray, String userId) {
         for (int j = 0; j < materialArray.size(); j++) {
             String materialId = materialArray.getString(j);
@@ -182,41 +187,23 @@ public class MaterialUploadServiceImpl implements IMaterialUploadService {
                                 String result = exceptInfoForRestTemplate(url, requestJson, headerMap);
                                 JSONObject resultJson = JSONObject.parseObject(result);
                                 if (!Check.isNull(resultJson)) {
+                                    KuaiShouAdvertiserBaseInfo baseInfo = advertiserBaseInfoService.getBaseInfo(accountId);
+
                                     if (resultJson.getInteger("code") == 0) {
                                         JSONObject dataJson = resultJson.getJSONObject("data");
                                         if (!Check.isNull(dataJson)) {
-
                                             String signature = dataJson.getString("signature");
-                                           /*
-                                             String photoId = dataJson.getString("photo_id");
-                                            KuaiShouVideoGet videoGet = new KuaiShouVideoGet();
-                                            videoGet.setAccountId(accountId);
-                                            videoGet.setId(accountId + photoId);
-                                            videoGet.setUrl(materialInfo.getUrl());
-                                            QueryWrapper<MaterialParameter> parameterQueryWrapper = new QueryWrapper<>();
-                                            parameterQueryWrapper.eq("material_id", signature);
-                                            parameterQueryWrapper.last("limit 1");
-
-                                            MaterialParameter materialParameter = parameterMapper.selectOne(parameterQueryWrapper);
-                                            if (!Check.isNull(materialParameter)) {
-                                                String width = materialParameter.getWidth();
-                                                String height = materialParameter.getHeight();
-                                                videoGet.setWidth(Integer.valueOf(width));
-                                                videoGet.setHeight(Integer.valueOf(height));
-                                                Integer type = MaterialEnum.getTypeBySize(Integer.valueOf(width), Integer.valueOf(height));
-                                                if (!Check.isNull(type)) {
-                                                    videoGet.setMaterialType(type);
-                                                }
-                                            }
-                                            videoGet.setPhotoId(photoId);
-                                            videoGet.setSignature(signature);
-                                            String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
-                                            videoGet.setStatDate(DateUtils.parseDate(nowDate, "yyyy-MM-dd"));
-                                            videoGet.setCoverUrl(materialInfo.getUrl() + "?x-oss-process=video/snapshot,t_0,m_fast");
-                                            videoGet.setUploadDate(new Date());
-                                            kuaiShouVideoGetService.saveOrUpdate(videoGet);*/
+                                            //同步 视频关联的封面
                                             materialUploadImageService.uploadImage(signature, accountId, ctopOauthToken.getAccessToken());
+                                            // 发送推送成功通知
+                                            UserAllocation allocation = userAllocationService.getByAccountId(accountId);
+                                            Project project = projectService.getById(allocation.getProjectId());
+                                            String message = messageTemplate.getMaterialSyncSucessTemplate(project.getProjectName(), baseInfo.getUserId(), baseInfo.getUserName(), materialInfo.getMaterialName(), resultJson.getString("message"));
+                                            sendMessageService.sendMessage(userId, message);
 
+                                            /**
+                                             * 异步获取视频信息
+                                             */
                                             Thread thread = new Thread() {
                                                 @Override
                                                 public void run() {
@@ -233,10 +220,10 @@ public class MaterialUploadServiceImpl implements IMaterialUploadService {
                                         log.info("快手素材同步完成,accountId:{},code:{},返回信息:{}", accountId, materialInfo.getCode(), resultJson);
                                     } else {
                                         log.error("快手同步素材失败,返回信息:{},请求参数:{}", resultJson, requestJson);
-                                        //  发送消息到上传人
+                                        //  发送推送失败消息到上传人
                                         UserAllocation allocation = userAllocationService.getByAccountId(accountId);
                                         Project project = projectService.getById(allocation.getProjectId());
-                                        String message = messageTemplate.getMaterialSyncTemplate(project.getProjectName(), accountId, allocation.getAuthName(), materialInfo.getMaterialName(), resultJson.getString("message"));
+                                        String message = messageTemplate.getMaterialSyncTemplate(project.getProjectName(), baseInfo.getUserId(), baseInfo.getUserName(), materialInfo.getMaterialName(), resultJson.getString("message"));
                                         sendMessageService.sendMessage(userId, message);
                                     }
                                 }

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

@@ -1,6 +1,7 @@
 package cn.com.ctop.job.bytedance.handler;
 
 import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceCreativeDailyReportService;
 import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import com.xxl.job.core.log.XxlJobLogger;
@@ -19,17 +20,17 @@ import java.util.concurrent.Executors;
 @Component
 public class ByteDanceCleanMaterialJob {
     @Autowired
-    private IByteDanceCleanMaterialReportService cleanMaterialService;
+    private IBytedanceCreativeDailyReportService creativeDailyReportService;
     static ExecutorService executorService = Executors.newFixedThreadPool(3);
 
     @XxlJob("byteDanceCleanMaterial")
     public ReturnT<String> execute(String param) throws Exception {
-        List<String> signatureList = cleanMaterialService.getSignature();
+        List<String> signatureList = creativeDailyReportService.getSignatureList();
         if (Check.isNull(signatureList)) {
             XxlJobLogger.log("头条素材数据获取为空");
             return ReturnT.FAIL;
         }
-        signatureList.forEach(signature -> executorService.submit(() -> cleanMaterialService.calculationMaterialReport(signature)));
+        signatureList.forEach(signature -> executorService.submit(() -> creativeDailyReportService.calculationMaterialReport(signature)));
         return ReturnT.SUCCESS;
     }
 }

+ 26 - 18
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceDailyMaterialReportJob.java

@@ -2,20 +2,18 @@ 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.material.service.IByteDanceAdvertiserDataService;
+import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 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.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.Date;
 import java.util.List;
+import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
@@ -32,41 +30,51 @@ public class BytedanceDailyMaterialReportJob {
     public ReturnT<String> execute(String param) throws Exception {
         Date getDate2 = DateUtils.addDay(new Date(), -2);
         String date2 = DateUtils.formatDate(getDate2);
-
+        Long start = System.currentTimeMillis();
         Date getDate = DateUtils.addDay(new Date(), -1);
         String date = DateUtils.formatDate(getDate);
         XxlJobLogger.log("头条获取素材报表数据任务开始,任务时间:" + date2 + "~" + date);
 
         List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
-        if (null == tokens || tokens.size() <= 0) {
+        if (null == tokens || tokens.isEmpty()) {
             XxlJobLogger.log("头条获取素材报表数据任务执行失败:未获取到可用的token");
             return ReturnT.FAIL;
         }
+        CountDownLatch countDownLatch = new CountDownLatch(tokens.size());
 
-        tokens.forEach(token -> {
-            executorService.submit(new Runnable() {
+        tokens.forEach(token -> executorService.submit(new Runnable() {
                 @Override
                 public void run() {
                     try {
                         //获取头条素材报表两天前的数据
-                        XxlJobLogger.log("账户"+token.getAccountId() + "素材报表数据任务开始,任务时间:" + date2 + "~" + date2);
+                        XxlJobLogger.log("账户"+token.getAccountId() + "素材报表数据任务开始,任务时间:" + date + "~" + date2);
                         bytedanceReportService.bytedanceMaterialReport(token, date2, date2);
-                        XxlJobLogger.log("账户"+token.getAccountId() + "素材报表数据任务完成,任务时间:" + date2 + "~" + date2);
-
-                        //获取头条素材报表数据
-                        XxlJobLogger.log("账户"+token.getAccountId() + "素材报表数据任务开始,任务时间:" + date + "~" + date);
                         bytedanceReportService.bytedanceMaterialReport(token, date, date);
-                        XxlJobLogger.log("账户"+token.getAccountId() + "素材报表数据任务完成,任务时间:" + date + "~" + date);
+                        //获取头条素材报表数据
+                        bytedanceReportService.bytedanceVideoMaterialReport(token, date2, date2);
+                        bytedanceReportService.bytedanceVideoMaterialReport(token, date, date);
+                        XxlJobLogger.log("账户"+token.getAccountId() + "素材报表数据任务完成,任务时间:" + date + "~" + date2);
                     } catch (Exception e) {
                         e.printStackTrace();
                     } finally {
+                        countDownLatch.countDown();
                     }
                 }
-            });
-        });
-        return ReturnT.SUCCESS;
-    }
+            }));
 
+        try {
+            countDownLatch.await();
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        Long end = System.currentTimeMillis();
+        XxlJobLogger.log("头条素材数据获取耗时:{}毫秒", end - start);
 
+        videoReportDailyService.videoInfoList(date, date);
+        videoReportDailyService.videoInfoList(date2, date2);
+        return ReturnT.SUCCESS;
+    }
 
+    @Autowired
+    private IByteDanceVideoReportDailyService videoReportDailyService;
 }

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


Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov