Ver código fonte

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

songyh 3 anos atrás
pai
commit
6c5606d4fb
100 arquivos alterados com 2168 adições e 851 exclusões
  1. 6 0
      jeecg-boot-base/jeecg-boot-base-api/jeecg-system-local-api/src/main/java/org/jeecg/common/system/api/ISysBaseApi.java
  2. 1 1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/util/JwtUtil.java
  3. 1 1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/PasswordUtil.java
  4. 4 4
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/oConvertUtils.java
  5. 16 16
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/WebMvcConfiguration.java
  6. 3 3
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisInterceptor.java
  7. 0 1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
  8. 5 0
      jeecg-boot-base/jeecg-boot-base-tools/src/main/java/org/jeecg/common/modules/redis/writer/JeecgRedisCacheWriter.java
  9. 6 4
      jeecg-boot-bytedance-ad/pom.xml
  10. 4 4
      jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/advertise/controller/AiBytedanceAdvertiserStrategyController.java
  11. 1 1
      jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/advertise/controller/BytedanceGeneralCopywriterController.java
  12. 1 1
      jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/advertise/controller/BytedanceReportController.java
  13. 1 1
      jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/advertise/controller/BytedanceVideoSlogenInfoController.java
  14. 11 11
      jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/advertise/service/impl/AiBytedanceAdvertiserStrategyServiceImpl.java
  15. 1 0
      jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/advertise/service/impl/ByteDanceAdvertisePlanServiceImpl.java
  16. 2 1
      jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/advertise/service/impl/BytedanceRejectReasonServiceImpl.java
  17. 1 1
      jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/common/utils/Check.java
  18. 1 1
      jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/common/utils/ExcelUtil.java
  19. 1 1
      jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/report/service/impl/BytedanceAdvertiserHourlyReportServiceImpl.java
  20. 35 8
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/agent/controller/AgentManagementController.java
  21. 1 1
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/agent/mapper/CtopAccountTransactionDayMapper.java
  22. 1 1
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/agent/mapper/xml/CtopAccountTransactionDayMapper.xml
  23. 4 4
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/agent/service/AgentManagementService.java
  24. 61 38
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/agent/service/impl/AgentManagementServiceImpl.java
  25. 10 163
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/controller/ExportReportController.java
  26. 2 0
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/entity/vo/SettlementReportBytedanceVo.java
  27. 90 0
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/entity/vo/SettlementReportKuaiShouVo.java
  28. 25 2
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/ReportSettlementMapper.java
  29. 65 4
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/xml/ReportSettlementMapper.xml
  30. 6 0
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/IReportSettlementService.java
  31. 389 1
      jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/serviceImpl/ReportSettlementServiceImpl.java
  32. 2 2
      jeecg-boot-module-system/pom.xml
  33. 4 4
      jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleSwitchController.java
  34. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/MaterialImageInfoServiceImpl.java
  35. 2 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java
  36. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java
  37. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/utils/StatusCode.java
  38. 0 131
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/utils/TokenUtils.java
  39. 2 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaiShouAppInfoServiceImpl.java
  40. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreateCreativeServiceImpl.java
  41. 15 15
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouProjectCreateCreativeServiceImpl.java
  42. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouStrategyTargetBaseServiceImpl.java
  43. 11 11
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiStrategyServiceImpl.java
  44. 2 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaishouAppPackageServiceImpl.java
  45. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouVideoGetServiceImpl.java
  46. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  47. 18 7
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/controller/KuaiShouAccountCleanController.java
  48. 4 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/entity/KuaiShouAccountCleanLogInfo.java
  49. 7 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/KuaishouAccountCleanTemplateMapper.java
  50. 176 164
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/xml/KuaishouAccountCleanTemplateMapper.xml
  51. 9 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/service/KuaiShouAccountCleanService.java
  52. 99 66
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/service/impl/KuaiShouAccountCleanServiceImpl.java
  53. 2 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/dimension/controller/KuaiShouDimensionStrategyController.java
  54. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/dimension/service/impl/KuaiShouDimensionStrategyServiceImpl.java
  55. 36 8
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/label/controller/LbelController.java
  56. 34 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/label/entity/LabelStandardInfo.java
  57. 62 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/label/entity/MaterialLabelInfo.java
  58. 56 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/label/mapper/MaterialLabelMapper.java
  59. 154 7
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/label/mapper/xml/MaterialTagMapper.xml
  60. 6 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/label/service/MaterialLabelService.java
  61. 380 21
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/label/service/impl/MaterialLabelServiceImpl.java
  62. 7 7
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/material/service/impl/EtlKuaishouVideoInfoServiceImpl.java
  63. 2 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KsNewGroupReportCtrl.java
  64. 2 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KsNewPlanReportCtrl.java
  65. 3 3
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/EtlKuaiShouNewlyServiceImpl.java
  66. 3 3
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/EtlKuaishouReportAccountHourlyServiceImpl.java
  67. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouProjectVideoEtlInfoServiceImpl.java
  68. 15 15
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouVideoEtlInfoServiceImpl.java
  69. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/oa/modules/service/impl/AppchatCreateServiceImpl.java
  70. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/shiwan/modules/controller/ShiwanFileUploadController.java
  71. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/controller/BytedanceNewPlanReportCtrl.java
  72. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceVideoReportMapper.xml
  73. 30 30
      jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceVideoEtlInfoServiceImpl.java
  74. 10 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceVideoReportServiceImpl.java
  75. 4 4
      jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ReportServiceImpl.java
  76. 1 1
      jeecg-boot-module-system/src/main/java/com/xxl/job/core/executor/impl/XxlJobSpringExecutor.java
  77. 6 6
      jeecg-boot-module-system/src/main/java/org/jeecg/config/Elasticsearch/ElasticsearchConfig.java
  78. 4 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ads/controller/AiKuaiShouReportAnalyzeCtrl.java
  79. 8 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/cas/util/XmlUtils.java
  80. 6 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BytedanceVideoEtlInfoController.java
  81. 3 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java
  82. 6 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouVideoEtlInfoController.java
  83. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java
  84. 46 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java
  85. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  86. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UserAllocationController.java
  87. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/MaterialReportOverViewServiceImpl.java
  88. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/orderplatform/service/impl/PlatformMaterialServiceImpl.java
  89. 81 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/LoginController.java
  90. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysPermissionController.java
  91. 6 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/rule/CategoryCodeRule.java
  92. 3 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/rule/OrderNumberRule.java
  93. 3 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/rule/OrgCodeRule.java
  94. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/controller/WpsFileController.java
  95. 17 2
      jeecg-cloud-module/jeecg-cloud-gateway/src/main/resources/application-test.yml
  96. 10 0
      jeecg-cloud-module/jeecg-cloud-system-start/pom.xml
  97. 7 0
      jeecg-cloud-module/jeecg-cloud-system-start/src/main/resources/application-dev.yml
  98. 8 1
      jeecg-cloud-module/jeecg-cloud-system-start/src/main/resources/application-prod.yml
  99. 21 2
      jeecg-cloud-module/jeecg-cloud-system-start/src/main/resources/application-test.yml
  100. 0 0
      jeecg-cloud-module/jeecg-cloud-system-start/src/main/resources/application.yml

+ 6 - 0
jeecg-boot-base/jeecg-boot-base-api/jeecg-system-local-api/src/main/java/org/jeecg/common/system/api/ISysBaseApi.java

@@ -295,10 +295,13 @@ public interface ISysBaseApi extends CommonAPI {
      * @param username
      * @return
      */
+    @Override
     LoginUser getUserByName(String username);
 
+    @Override
     List<SysPermissionDataRuleModel> queryPermissionDataRule(String component, String requestPath, String username);
 
+    @Override
     SysUserCacheInfo getCacheUser(String username);
 
     /**
@@ -313,6 +316,7 @@ public interface ISysBaseApi extends CommonAPI {
      * @param code
      * @return
      */
+    @Override
     public List<DictModel> queryDictItemsByCode(String code);
 
 
@@ -323,6 +327,7 @@ public interface ISysBaseApi extends CommonAPI {
      * @param code
      * @return
      */
+    @Override
     List<DictModel> queryTableDictItemsByCode(String table, String text, String code);
 
     /**
@@ -426,6 +431,7 @@ public interface ISysBaseApi extends CommonAPI {
      * @param dbSourceId
      * @return
      */
+    @Override
     DynamicDataSourceModel getDynamicDbSourceById(String dbSourceId);
 
     /**

+ 1 - 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/util/JwtUtil.java

@@ -29,7 +29,7 @@ import org.jeecg.common.util.oConvertUtils;
 public class JwtUtil {
 
 	// Token过期时间30分钟(用户登录过期时间是此时间的两倍,以token在reids缓存时间为准)
-	public static final long EXPIRE_TIME = 30 * 60 * 1000;
+	public static final long EXPIRE_TIME = 8 * 60 * 60 * 1000;
 
 	/**
 	 * 校验token是否正确

+ 1 - 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/PasswordUtil.java

@@ -158,7 +158,7 @@ public class PasswordUtil {
 	 * @return
 	 */
 	public static byte[] hexStringToBytes(String hexString) {
-		if (hexString == null || hexString.equals("")) {
+		if (hexString == null || "".equals(hexString)) {
 			return null;
 		}
 		hexString = hexString.toUpperCase();

+ 4 - 4
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/oConvertUtils.java

@@ -41,7 +41,7 @@ public class oConvertUtils {
 	}
 	
 	public static boolean isNotEmpty(Object object) {
-		if (object != null && !object.equals("") && !object.equals("null")) {
+		if (object != null && !"".equals(object) && !"null".equals(object)) {
 			return (true);
 		}
 		return (false);
@@ -66,7 +66,7 @@ public class oConvertUtils {
 
 	private static String code2code(String strIn, String sourceCode, String targetCode) {
 		String strOut = null;
-		if (strIn == null || (strIn.trim()).equals("")) {
+		if (strIn == null || "".equals(strIn.trim())) {
 			return strIn;
 		}
 		try {
@@ -396,7 +396,7 @@ public class oConvertUtils {
 		long bEnd = getIpNum("172.31.255.255");
 		long cBegin = getIpNum("192.168.0.0");
 		long cEnd = getIpNum("192.168.255.255");
-		isInnerIp = isInner(ipNum, aBegin, aEnd) || isInner(ipNum, bBegin, bEnd) || isInner(ipNum, cBegin, cEnd) || ipAddress.equals("127.0.0.1");
+		isInnerIp = isInner(ipNum, aBegin, aEnd) || isInner(ipNum, bBegin, bEnd) || isInner(ipNum, cBegin, cEnd) || "127.0.0.1".equals(ipAddress);
 		return isInnerIp;
 	}
 
@@ -467,7 +467,7 @@ public class oConvertUtils {
 	 * @return 转换后的驼峰式命名的字符串
 	 */
 	public static String camelNames(String names) {
-		if(names==null||names.equals("")){
+		if(names==null|| "".equals(names)){
 			return null;
 		}
 		StringBuffer sf = new StringBuffer();

+ 16 - 16
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/WebMvcConfiguration.java

@@ -54,22 +54,22 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
         registry.addViewController("/").setViewName("doc.html");
     }
 
-//    @Bean
-//    @Conditional(CorsFilterCondition.class)
-//    public CorsFilter corsFilter() {
-//        final UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource();
-//        final CorsConfiguration corsConfiguration = new CorsConfiguration();
-//        //是否允许请求带有验证信息
-//        corsConfiguration.setAllowCredentials(true);
-//        // 允许访问的客户端域名
-//        corsConfiguration.addAllowedOrigin("*");
-//        // 允许服务端访问的客户端请求头
-//        corsConfiguration.addAllowedHeader("*");
-//        // 允许访问的方法名,GET POST等
-//        corsConfiguration.addAllowedMethod("*");
-//        urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration);
-//        return new CorsFilter(urlBasedCorsConfigurationSource);
-//    }
+    @Bean
+    @Conditional(CorsFilterCondition.class)
+    public CorsFilter corsFilter() {
+        final UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource();
+        final CorsConfiguration corsConfiguration = new CorsConfiguration();
+        //是否允许请求带有验证信息
+        corsConfiguration.setAllowCredentials(true);
+        // 允许访问的客户端域名
+        corsConfiguration.addAllowedOrigin("*");
+        // 允许服务端访问的客户端请求头
+        corsConfiguration.addAllowedHeader("*");
+        // 允许访问的方法名,GET POST等
+        corsConfiguration.addAllowedMethod("*");
+        urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration);
+        return new CorsFilter(urlBasedCorsConfigurationSource);
+    }
 
     /**
     * 添加Long转json精度丢失的配置

+ 3 - 3
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisInterceptor.java

@@ -48,7 +48,7 @@ public class MybatisInterceptor implements Interceptor {
 						field.setAccessible(true);
 						Object local_createBy = field.get(parameter);
 						field.setAccessible(false);
-						if (local_createBy == null || local_createBy.equals("")) {
+						if (local_createBy == null || "".equals(local_createBy)) {
 							if (sysUser != null) {
 								// 登录人账号
 								field.setAccessible(true);
@@ -62,7 +62,7 @@ public class MybatisInterceptor implements Interceptor {
 						field.setAccessible(true);
 						Object local_createDate = field.get(parameter);
 						field.setAccessible(false);
-						if (local_createDate == null || local_createDate.equals("")) {
+						if (local_createDate == null || "".equals(local_createDate)) {
 							field.setAccessible(true);
 							field.set(parameter, new Date());
 							field.setAccessible(false);
@@ -73,7 +73,7 @@ public class MybatisInterceptor implements Interceptor {
 						field.setAccessible(true);
 						Object local_sysOrgCode = field.get(parameter);
 						field.setAccessible(false);
-						if (local_sysOrgCode == null || local_sysOrgCode.equals("")) {
+						if (local_sysOrgCode == null || "".equals(local_sysOrgCode)) {
 							// 获取登录用户信息
 							if (sysUser != null) {
 								field.setAccessible(true);

+ 0 - 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java

@@ -207,7 +207,6 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/ai/batchUpdate/*", "anon");
         filterChainDefinitionMap.put("/ctop/kuaishou/videoReport/*", "anon");
         filterChainDefinitionMap.put("/ai/create/*", "anon");
-        filterChainDefinitionMap.put("/overView/*", "anon");
         filterChainDefinitionMap.put("/kuaishouCrowdPack/**", "anon");
         filterChainDefinitionMap.put("/kuaishou/batch/*", "anon");
         filterChainDefinitionMap.put("/dimension/kuaiShouDimensionAccount/*", "anon");

+ 5 - 0
jeecg-boot-base/jeecg-boot-base-tools/src/main/java/org/jeecg/common/modules/redis/writer/JeecgRedisCacheWriter.java

@@ -39,6 +39,7 @@ public class JeecgRedisCacheWriter implements RedisCacheWriter {
         this.sleepTime = sleepTime;
     }
 
+    @Override
     public void put(String name, byte[] key, byte[] value, @Nullable Duration ttl) {
         Assert.notNull(name, "Name must not be null!");
         Assert.notNull(key, "Key must not be null!");
@@ -54,6 +55,7 @@ public class JeecgRedisCacheWriter implements RedisCacheWriter {
         });
     }
 
+    @Override
     public byte[] get(String name, byte[] key) {
         Assert.notNull(name, "Name must not be null!");
         Assert.notNull(key, "Key must not be null!");
@@ -62,6 +64,7 @@ public class JeecgRedisCacheWriter implements RedisCacheWriter {
         });
     }
 
+    @Override
     public byte[] putIfAbsent(String name, byte[] key, byte[] value, @Nullable Duration ttl) {
         Assert.notNull(name, "Name must not be null!");
         Assert.notNull(key, "Key must not be null!");
@@ -97,6 +100,7 @@ public class JeecgRedisCacheWriter implements RedisCacheWriter {
         });
     }
 
+    @Override
     public void remove(String name, byte[] key) {
         Assert.notNull(name, "Name must not be null!");
         Assert.notNull(key, "Key must not be null!");
@@ -119,6 +123,7 @@ public class JeecgRedisCacheWriter implements RedisCacheWriter {
         }
     }
 
+    @Override
     public void clean(String name, byte[] pattern) {
         Assert.notNull(name, "Name must not be null!");
         Assert.notNull(pattern, "Pattern must not be null!");

+ 6 - 4
jeecg-boot-bytedance-ad/pom.xml

@@ -26,10 +26,7 @@
             <groupId>org.jeecgframework.boot</groupId>
             <artifactId>jeecg-boot-starter-cloud</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.jeecgframework.boot</groupId>
-            <artifactId>jeecg-system-cloud-api</artifactId>
-        </dependency>
+
 
         <dependency>
             <groupId>org.apache.httpcomponents</groupId>
@@ -48,6 +45,11 @@
             <version>1.16</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.jeecgframework.boot</groupId>
+            <artifactId>jeecg-system-local-api</artifactId>
+        </dependency>
+
 
     </dependencies>
     <build>

+ 4 - 4
jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/advertise/controller/AiBytedanceAdvertiserStrategyController.java

@@ -200,7 +200,7 @@ public class AiBytedanceAdvertiserStrategyController {
 			//账户预算 同步 头条
 			//BUDGET_MODE_DAY-日预算
 			// BUDGET_MODE_INFINITE-不限
-			String accountBudgetMode = aiBytedanceAdvertiserStrategy.getAccountBudgetMode().equals("1") ? "BUDGET_MODE_INFINITE" : "BUDGET_MODE_DAY";
+			String accountBudgetMode = "1".equals(aiBytedanceAdvertiserStrategy.getAccountBudgetMode()) ? "BUDGET_MODE_INFINITE" : "BUDGET_MODE_DAY";
 			Result resultBudget = marketingService.updateBudget(token,accountBudgetMode,aiBytedanceAdvertiserStrategy.getAccountBudget());
 			/*if (!resultBudget.isSuccess()){
 				return Result.errorMsg(resultBudget.getMessage());
@@ -416,16 +416,16 @@ public class AiBytedanceAdvertiserStrategyController {
 			urlPath = LoadFileUtil.downLoadFromUrl(urlPath, "appFiles");
 			// android 根据附件地址 读取 apk 信息
 			map = ApkUtils.readAPK(urlPath);
-			if (!map.get("code").toString().equals("-1")){
+			if (!"-1".equals(map.get("code").toString())){
 				map.put("platform", "APP_ANDROID");
 			}else {
 				//ios
 				map = ApkUtils.readIPA(urlPath);
-				if (!map.get("code").toString().equals("-1")){
+				if (!"-1".equals(map.get("code").toString())){
 					map.put("platform", "APP_IOS");
 				}
 			}
-			if (map.get("code").toString().equals("-1")){
+			if ("-1".equals(map.get("code").toString())){
 				return Result.error(map.get("error").toString()+"请输入正确的链接。");
 			}
 			return Result.successMsg("根据下载链接获取应用包名成功", map);

+ 1 - 1
jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/advertise/controller/BytedanceGeneralCopywriterController.java

@@ -288,7 +288,7 @@ public class BytedanceGeneralCopywriterController {
         try {
             ByteDanceGeneralCopywriter generalCopywriter = byteDanceGeneralCopywriterService.getById(id);
             if(null == generalCopywriter||generalCopywriter.getStatus() == 0){
-                return result.ok("此文案不存在或者已经被删除");
+                return Result.ok("此文案不存在或者已经被删除");
             }
             generalCopywriter.setStatus(0);
             generalCopywriter.setUpdateTime(new Date());

+ 1 - 1
jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/advertise/controller/BytedanceReportController.java

@@ -273,7 +273,7 @@ public class BytedanceReportController {
 			if (result.isSuccess()){
 				ByteDanceAdvertisePlan byteDanceAdvertisePlan = new ByteDanceAdvertisePlan();
 				byteDanceAdvertisePlan.setId(adId);
-				byteDanceAdvertisePlan.setOptStatus(optStatus.equalsIgnoreCase("enable") ? "AD_STATUS_ENABLE" : "AD_STATUS_DISABLE");
+				byteDanceAdvertisePlan.setOptStatus("enable".equalsIgnoreCase(optStatus) ? "AD_STATUS_ENABLE" : "AD_STATUS_DISABLE");
 				//更新 表 计划状态
 				byteDanceAdvertisePlanService.updatePlanOrPackage(byteDanceAdvertisePlan);
 				return Result.successMsg(result.getMessage(), null);

+ 1 - 1
jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/advertise/controller/BytedanceVideoSlogenInfoController.java

@@ -314,7 +314,7 @@ public class BytedanceVideoSlogenInfoController {
 			Result result = new Result();
 			List<BytedanceVideoSlogenInfo> videoSlogenInfoList = bytedanceVideoSlogenInfoService.getVideoSlogenBySlogenAndProjectId(slogan,projectId);
 			if(Check.isNull(videoSlogenInfoList)) {
-				return result.ok("此文案不存在或者已经被删除");
+				return Result.ok("此文案不存在或者已经被删除");
 			}
 			LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 			videoSlogenInfoList.forEach(videoSlogenInfo->{

+ 11 - 11
jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/advertise/service/impl/AiBytedanceAdvertiserStrategyServiceImpl.java

@@ -391,7 +391,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
                 JSONObject titleObject = new JSONObject();
                 titleObject.put("title",slogenInfo.getSlogan());
                 String creativeWordsIds = slogenInfo.getCreativeWordIds();
-                if(null!=creativeWordsIds&&!creativeWordsIds.trim().equals("")){
+                if(null!=creativeWordsIds&&!"".equals(creativeWordsIds.trim())){
                     JSONArray creativeWordsArray = JSON.parseArray(creativeWordsIds);
                     if(null!=creativeWordsArray&&!creativeWordsArray.isEmpty()){
                         titleObject.put("creative_word_ids",creativeWordsArray);
@@ -412,7 +412,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
                     JSONObject titleObject = new JSONObject();
                     titleObject.put("title",byteDanceGeneralCopywriter.get(i).getTextCopywriter());
                     String creativeWordsIds = byteDanceGeneralCopywriter.get(i).getCreativeWordIds();
-                    if(null!=creativeWordsIds&&!creativeWordsIds.trim().equals("")){
+                    if(null!=creativeWordsIds&&!"".equals(creativeWordsIds.trim())){
                         JSONArray creativeWordsArray = JSON.parseArray(creativeWordsIds);
                         if(null!=creativeWordsArray&&!creativeWordsArray.isEmpty()){
                             titleObject.put("creative_word_ids",creativeWordsArray);
@@ -429,7 +429,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
                     JSONObject titleObject = new JSONObject();
                     titleObject.put("title",byteDanceGeneralCopywriter.getTextCopywriter());
                     String creativeWordsIds = byteDanceGeneralCopywriter.getCreativeWordIds();
-                    if(null!=creativeWordsIds&&!creativeWordsIds.trim().equals("")){
+                    if(null!=creativeWordsIds&&!"".equals(creativeWordsIds.trim())){
                         JSONArray creativeWordsArray = JSON.parseArray(creativeWordsIds);
                         if(null!=creativeWordsArray&&!creativeWordsArray.isEmpty()){
                             titleObject.put("creative_word_ids",creativeWordsArray);
@@ -885,7 +885,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
                 }
             }
         }
-        if(!Check.isNull(strategy.getAdDeviceType())&&!strategy.getAdDeviceType().trim().equals("NONE")){
+        if(!Check.isNull(strategy.getAdDeviceType())&&!"NONE".equals(strategy.getAdDeviceType().trim())){
             String[] deviceType = strategy.getAdDeviceType().split(",");
             if(deviceType.length>0){
                 params.put("device_type",deviceType);
@@ -900,7 +900,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
         if(!Check.isNull(strategy.getAdHideIfConverted())){
             String hideIfConverted = strategy.getAdHideIfConverted();
             params.put("hide_if_converted",hideIfConverted);
-            if(hideIfConverted.equals("APP")||hideIfConverted.equals("CUSTOMER")){
+            if("APP".equals(hideIfConverted)|| "CUSTOMER".equals(hideIfConverted)){
                 if(!Check.isNull(strategy.getAdConvertedTimeDuration())){
                     params.put("converted_time_duration",strategy.getAdConvertedTimeDuration());
                 }
@@ -1113,7 +1113,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
             String campaignSufix = getRangeIndex(strategy.getDpLinkStartIndex(),strategy.getDpLinkEndIndex(),strategy.getCampaignAdCnt(),dplinkIndex);
             result = result + campaignSufix;
         }
-        if(null!=date&&!date.trim().equals("")) {
+        if(null!=date&&!"".equals(date.trim())) {
             result = result + "-" + date;
         }
 
@@ -1202,8 +1202,8 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
 
     private List<ByteDanceVideoInfo> getvideoOrImageInfoByCreateType(Long projectId,AiBytedanceAdvertiserStrategy strategy, String startTime, String endTime, Integer createType, Long videoCnt) {
         //横板视频 || 竖版视频
-        if (strategy.getCreativeImageMode().equalsIgnoreCase("CREATIVE_IMAGE_MODE_VIDEO")
-                || strategy.getCreativeImageMode().equalsIgnoreCase("CREATIVE_IMAGE_MODE_VIDEO_VERTICAL")){
+        if ("CREATIVE_IMAGE_MODE_VIDEO".equalsIgnoreCase(strategy.getCreativeImageMode())
+                || "CREATIVE_IMAGE_MODE_VIDEO_VERTICAL".equalsIgnoreCase(strategy.getCreativeImageMode())){
             //获取 视频 素材
             return getVideoInfoByCreateType(projectId,strategy,startTime,endTime,createType,videoCnt);
         }
@@ -1283,7 +1283,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
         if (BytedanceConstant.UPDTYPE_BUDGET.equals(updAdStaOrCpaOrBudget.getType())) {
 
             //指定预算
-            if (updAdStaOrCpaOrBudget.getBudgetType().equals("2")){
+            if ("2".equals(updAdStaOrCpaOrBudget.getBudgetType())){
                 //  前者 < 后者
                 int a = new BigDecimal(updAdStaOrCpaOrBudget.getBudget()).compareTo(updAdStaOrCpaOrBudget.getCost().multiply(new BigDecimal(1.05)));
                 if (a == -1){
@@ -1295,7 +1295,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
             //账户预算 同步 头条
             //BUDGET_MODE_DAY-日预算
             // BUDGET_MODE_INFINITE-不限
-            String accountBudgetMode = updAdStaOrCpaOrBudget.getBudgetType().equals("1") ? "BUDGET_MODE_INFINITE" : "BUDGET_MODE_DAY";
+            String accountBudgetMode = "1".equals(updAdStaOrCpaOrBudget.getBudgetType()) ? "BUDGET_MODE_INFINITE" : "BUDGET_MODE_DAY";
             Result resultBudget = marketingService.updateBudget(token,accountBudgetMode,new BigDecimal(updAdStaOrCpaOrBudget.getBudget()));
            /* if (!resultBudget.isSuccess()){
                 return Result.error(resultBudget.getMessage());
@@ -1561,7 +1561,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
         //账户预算 同步 头条
         //BUDGET_MODE_DAY-日预算
         // BUDGET_MODE_INFINITE-不限
-        String accountBudgetMode = aiBytedanceAdvertiserStrategy.getAccountBudgetMode().equals("1") ? "BUDGET_MODE_INFINITE" : "BUDGET_MODE_DAY";
+        String accountBudgetMode = "1".equals(aiBytedanceAdvertiserStrategy.getAccountBudgetMode()) ? "BUDGET_MODE_INFINITE" : "BUDGET_MODE_DAY";
         Result resultBudget = marketingService.updateBudget(token,accountBudgetMode,aiBytedanceAdvertiserStrategy.getAccountBudget());
        /* if (!resultBudget.isSuccess()){
             return Result.error(resultBudget.getMessage());

+ 1 - 0
jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/advertise/service/impl/ByteDanceAdvertisePlanServiceImpl.java

@@ -107,6 +107,7 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         return resultMap;
     }
 
+    @Override
     public Map<String, Object> getAdvertiserPlanRejectReason(CtopOauthToken token, Long advertiserId, List<Long> adIds) {
 
         Map<String, Object> resultMap = new HashMap<>();

+ 2 - 1
jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/advertise/service/impl/BytedanceRejectReasonServiceImpl.java

@@ -41,7 +41,8 @@ public class BytedanceRejectReasonServiceImpl implements BytedanceRejectReasonSe
 
     @Resource
     LowQualityRejectReasonMapper lowQualityRejectReasonMapper;
-    public void saveRejectReasonToDb(JSONArray jsonArray,Long accountId){
+    @Override
+    public void saveRejectReasonToDb(JSONArray jsonArray, Long accountId){
         for(int i=0; i<jsonArray.size(); i++){
             JSONObject jsonObject = jsonArray.getJSONObject(i);
             JSONObject ad_reject = jsonObject.getJSONObject("ad_reject");

+ 1 - 1
jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/common/utils/Check.java

@@ -83,7 +83,7 @@ public class Check {
     public static JSONObject jsonRemoveEmpty(JSONObject jsonObject){
         JSONObject jsonResult = new JSONObject();
         for (Object key :jsonObject.keySet() ) {
-            if (!Check.isNull(jsonObject.get(key)) && !jsonObject.get(key).equals("")){
+            if (!Check.isNull(jsonObject.get(key)) && !"".equals(jsonObject.get(key))){
                 jsonResult.put(key.toString(), jsonObject.get(key));
             }
         }

+ 1 - 1
jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/common/utils/ExcelUtil.java

@@ -117,7 +117,7 @@ public class ExcelUtil {
         }
         //如果当前单元格内容为日期类型,需要特殊处理
         String dataFormatString = cell.getCellStyle().getDataFormatString();
-        if(dataFormatString.equals("m/d/yy")){
+        if("m/d/yy".equals(dataFormatString)){
             cellValue = new SimpleDateFormat(DATE_FORMAT).format(cell.getDateCellValue());
             return cellValue;
         }

+ 1 - 1
jeecg-boot-bytedance-ad/src/main/java/ctop/bytedance/ad/report/service/impl/BytedanceAdvertiserHourlyReportServiceImpl.java

@@ -84,7 +84,7 @@ public class BytedanceAdvertiserHourlyReportServiceImpl extends ServiceImpl<Byte
          * 日期相差不为 0 则 展示 日报(每天数据总和)数据
          * 日期相差天数为0  则 展示 24小时 数据
          */
-        if (!lastTimeMap.get("daysBetween").equals("0")){
+        if (!"0".equals(lastTimeMap.get("daysBetween"))){
             // 账户 日报 阶段 数据
             nowCostList = bytedanceAdvertiserHourlyReportMapper.selectPlanCostInfoCount(accountId,null,startTime,endTime);
             lastCostList = bytedanceAdvertiserHourlyReportMapper.selectPlanCostInfoCount(accountId,null,lastTimeMap.get("lastTimeStart"),lastTimeMap.get("lastTimeEnd"));

+ 35 - 8
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/agent/controller/AgentManagementController.java

@@ -2,12 +2,18 @@ package org.jeecg.ctop.finance.agent.controller;
 
 
 import lombok.extern.slf4j.Slf4j;
+import org.apache.ibatis.annotations.Param;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.ctop.finance.agent.service.AgentManagementService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
 @RestController
 @RequestMapping("/agent")
 @Slf4j
@@ -17,25 +23,46 @@ public class AgentManagementController {
     AgentManagementService agentManagementService;
 
     @RequestMapping("/queryAccountTransactionDetails")
-    public void getList() {
-        Result recharge = agentManagementService.synchronousAccountTransactionDetails();
-        log.info("123");
+    public void getList(@Param("starDate")String startDate,@Param("endDate")String endDate) {
+        Result recharge = agentManagementService.synchronousAccountTransactionDetails(startDate,endDate);
 
     }
 
     @RequestMapping("/synchronousAccount")
     public void synchronousAccount() {
         Result recharge = agentManagementService.synchronousAccount();
-        log.info("123");
-
     }
 
 
     @RequestMapping("/synchronousAccountTransactionDay")
-    public void synchronousAccountTransactionDay() {
-        Result recharge = agentManagementService.synchronousAccountTransactionDay();
-        log.info("123");
+    public void synchronousAccountTransactionDay(@Param("starDate")String startDate,@Param("endDate")String endDate) {
+        Result recharge = agentManagementService.synchronousAccountTransactionDay(startDate,endDate);
+    }
+
 
+    @RequestMapping("/synchronous")
+    public void synchronous() throws ParseException {
+        String date1="2021-05-01";
+        String date2="2021-05-31";
+        String date3="2021-06-01";
+        String date4="2021-06-30";
+        String date5="2021-07-01";
+        String date6="2021-07-31";
+        String date7="2021-08-01";
+        String date8="2021-08-31";
+        agentManagementService.synchronousAccount();
+        //5月份
+         agentManagementService.synchronousAccountTransactionDetails(date1,date2);
+         agentManagementService.synchronousAccountTransactionDay(date1,date2);
+        //6月份
+         agentManagementService.synchronousAccountTransactionDetails(date3,date4);
+         agentManagementService.synchronousAccountTransactionDay(date3,date4);
+        //7月份
+         agentManagementService.synchronousAccountTransactionDetails(date5,date6);
+         agentManagementService.synchronousAccountTransactionDay(date5,date6);
+        //8月份
+          agentManagementService.synchronousAccountTransactionDetails(date7,date8);
+          agentManagementService.synchronousAccountTransactionDay(date7,date8);
     }
 
 

+ 1 - 1
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/agent/mapper/CtopAccountTransactionDayMapper.java

@@ -9,7 +9,7 @@ import java.util.List;
 @Mapper
 public interface CtopAccountTransactionDayMapper {
 
-    List<String> getAdvertiserIdByDate(@Param("date") String date);
+    List<String> getAdvertiserIdByDate(@Param("date") String date,@Param("advertiserId") String advertiserId);
 
     void saveAccountTransactionDay(@Param("list") List<TransactionDay> list, @Param("date") String date);
 

+ 1 - 1
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/agent/mapper/xml/CtopAccountTransactionDayMapper.xml

@@ -24,7 +24,7 @@
     </insert>
 
     <select id="getAdvertiserIdByDate" parameterType="String" resultType="String">
-        select t.advertiser_id from ctop_account_transaction_day t where t.date=#{date}
+        select t.advertiser_id from ctop_account_transaction_day t where t.date=#{date} and t.advertiser_id=#{advertiserId}
     </select>
 
 </mapper>

+ 4 - 4
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/agent/service/AgentManagementService.java

@@ -12,17 +12,17 @@ public interface AgentManagementService {
 
 
     //查询账号流水
-    public JSONObject queryAccountTransactionDetails(String AccountId, String transaction_type, int pageNum, int pageSize);
+    public JSONObject queryAccountTransactionDetails(String AccountId, String transaction_type, int pageNum, int pageSize,String startDate,String endDate);
 
     //查询账号流水
-    public JSONObject queryAccountTransactionDay(String AccountId, int pageNum, int pageSize);
+    public JSONObject queryAccountTransactionDay(String AccountId, int pageNum, int pageSize,String startDate,String endDate);
 
     //同步代理商账户入库
     public Result synchronousAccount();
 
     //同步账户交易流水
-    public Result synchronousAccountTransactionDetails();
+    public Result synchronousAccountTransactionDetails(String startDate,String endDate);
 
     //同步账户日流水
-    public Result synchronousAccountTransactionDay();
+    public Result synchronousAccountTransactionDay(String startDate,String endDate);
 }

+ 61 - 38
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/agent/service/impl/AgentManagementServiceImpl.java

@@ -1,7 +1,6 @@
 package org.jeecg.ctop.finance.agent.service.impl;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
@@ -125,7 +124,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
      * @create: 2021-07-15
      */
     @Override
-    public Result synchronousAccountTransactionDetails() {
+    public Result synchronousAccountTransactionDetails(String startDate,String endDate) {
         log.info("开始同步账号交易流水");
         Result result = new Result();
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
@@ -137,11 +136,17 @@ public class AgentManagementServiceImpl implements AgentManagementService {
                 accountIdList.stream().forEach(str -> {
                     if (!str.isEmpty()) {
                         //查询账号下充值的交易流水
-                        JSONObject jsonObject = queryAccountTransactionDetails(str, RECHARGE, 1, 1000);
+                        JSONObject jsonObject = queryAccountTransactionDetails(str, RECHARGE, 1, 1000, startDate,endDate);
+                        int code = (int) jsonObject.get("code");
+                        if(code!=0){
+                            result.setMessage((String) jsonObject.get("message"));
+                            log.info((String) jsonObject.get("message"));
+                            return;
+                        }
                         JSONObject data = (JSONObject) jsonObject.get("data");
-                        if(data!=null){
+                        if (data != null) {
                             List<Object> dataList = (List<Object>) data.get("list");
-                            if (dataList!=null&&!dataList.isEmpty()) {
+                            if (dataList != null && !dataList.isEmpty()) {
                                 //充值类存在记录
                                 //保存第一页数据
                                 dataList.stream().forEach(ob -> {
@@ -157,7 +162,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
                                 //查询其他页数据
                                 if (total_page > 1) {
                                     for (int i = 2; i <= total_page; i++) {
-                                        JSONObject jo = queryAccountTransactionDetails(str, RECHARGE, i, 1000);
+                                        JSONObject jo = queryAccountTransactionDetails(str, RECHARGE, i, 1000, startDate,endDate);
                                         JSONObject accountData = (JSONObject) jo.get("data");
                                         List<Object> rechargeList = (List<Object>) accountData.get("list");
                                         rechargeList.stream().forEach(transactionDetails -> {
@@ -173,9 +178,15 @@ public class AgentManagementServiceImpl implements AgentManagementService {
                         }
 
                         //查询账号下转账的交易流水
-                        JSONObject transferJsonObject = queryAccountTransactionDetails(str, TRANSFER, 1, 1000);
+                        JSONObject transferJsonObject = queryAccountTransactionDetails(str, TRANSFER, 1, 1000, startDate,endDate);
                         JSONObject transferData = (JSONObject) transferJsonObject.get("data");
-                        if(transferData!=null){
+                        int code1 = (int) jsonObject.get("code");
+                        if(code1!=0){
+                            result.setMessage((String) jsonObject.get("message"));
+                            log.info((String) jsonObject.get("message"));
+                            return;
+                        }
+                        if (transferData != null) {
                             List<Object> transferDataList = (List<Object>) transferData.get("list");
                             if (!transferDataList.isEmpty()) {
                                 //转账类存在记录
@@ -192,7 +203,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
                                 //查询其他页数据
                                 if (transferTotalPage > 1) {
                                     for (int i = 2; i <= transferTotalPage; i++) {
-                                        JSONObject jo = queryAccountTransactionDetails(str, TRANSFER, i, 1000);
+                                        JSONObject jo = queryAccountTransactionDetails(str, TRANSFER, i, 1000, startDate,endDate);
                                         JSONObject accountData = (JSONObject) jo.get("data");
                                         List<Object> rechargeList = (List<Object>) accountData.get("list");
                                         rechargeList.stream().forEach(transactionDetails -> {
@@ -227,6 +238,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
 
         return result;
     }
+
     /**
      * 同步账户日流水
      *
@@ -234,7 +246,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
      * @create: 2021-07-15
      */
     @Override
-    public Result synchronousAccountTransactionDay() {
+    public Result synchronousAccountTransactionDay(String startDate,String endDate) {
         log.info("开始同步账号日流水");
         Result result = new Result();
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
@@ -245,21 +257,32 @@ public class AgentManagementServiceImpl implements AgentManagementService {
         try {
             List<String> accountIdList = ctopAgentAccountMapper.getAllAccountId();
             if (!accountIdList.isEmpty()) {
-                List<String> advertiserIdList = ctopAccountTransactionDayMapper.getAdvertiserIdByDate(df.format(ca.getTime()));
                 accountIdList.stream().forEach(str -> {
                     if (!str.isEmpty()) {
                         //查询账号下充值的交易流水
-                        JSONObject jsonObject = queryAccountTransactionDay(str, 1, 1000);
-                        JSONObject data = (JSONObject) jsonObject.get("data");
-                        if(data!=null){
+                        JSONObject jsonObject = queryAccountTransactionDay(str, 1, 1000, startDate,endDate);
+                        JSONObject data=null;
+                        int code=1;
+                        if(jsonObject!=null){
+                             data = (JSONObject) jsonObject.get("data");
+                             code = (int) jsonObject.get("code");
+                        }else {
+                            log.info("返回数据jsonObject为null:");
+                        }
+                        if(code!=0){
+                            result.setMessage((String) jsonObject.get("message"));
+                            log.info("返回数据:"+jsonObject.toJSONString()+":"+str);
+                        }
+                        if (data != null) {
                             List<Object> dataList = (List<Object>) data.get("list");
-                            if (dataList!=null&&!dataList.isEmpty()) {
+                            if (dataList != null && !dataList.isEmpty()) {
                                 //充值类存在记录
                                 //保存第一页数据
                                 dataList.stream().forEach(ob -> {
                                     TransactionDay transactionDay = JSONObject.toJavaObject((JSON) ob, TransactionDay.class);
+                                    List<String> advertiserIdList = ctopAccountTransactionDayMapper.getAdvertiserIdByDate(transactionDay.getDate(),transactionDay.getAdvertiserId());
                                     //订单号不存在
-                                    if (advertiserIdList.isEmpty() || !advertiserIdList.contains(transactionDay.getAdvertiserId())) {
+                                    if (advertiserIdList.isEmpty() || advertiserIdList.size()<=0) {
                                         transactionDetailsList.add(transactionDay);
                                     }
 
@@ -269,13 +292,15 @@ public class AgentManagementServiceImpl implements AgentManagementService {
                                 //查询其他页数据
                                 if (total_page > 1) {
                                     for (int i = 2; i <= total_page; i++) {
-                                        JSONObject jo = queryAccountTransactionDetails(str, RECHARGE, i, 1000);
+                                        JSONObject jo = queryAccountTransactionDay(str, i, 1000, startDate,endDate);
                                         JSONObject accountData = (JSONObject) jo.get("data");
                                         List<Object> rechargeList = (List<Object>) accountData.get("list");
                                         rechargeList.stream().forEach(obj -> {
                                             TransactionDay transactionDay = JSONObject.toJavaObject((JSON) obj, TransactionDay.class);
+                                            List<String> advertiserIdList = ctopAccountTransactionDayMapper.getAdvertiserIdByDate(transactionDay.getDate(),transactionDay.getAdvertiserId());
+
                                             //订单号不存在
-                                            if (advertiserIdList.isEmpty() || !advertiserIdList.contains(transactionDay.getAdvertiserId())) {
+                                            if (advertiserIdList.isEmpty() || advertiserIdList.size()<=0) {
                                                 transactionDetailsList.add(transactionDay);
                                             }
                                         });
@@ -288,7 +313,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
             }
             //保存数据
             if (!transactionDetailsList.isEmpty()) {
-                ctopAccountTransactionDayMapper.saveAccountTransactionDay(transactionDetailsList,df.format(new Date()));
+                ctopAccountTransactionDayMapper.saveAccountTransactionDay(transactionDetailsList, df.format(new Date()));
                 log.info("新增日流水记录:{}条", transactionDetailsList.size());
             }
             result.setSuccess(true);
@@ -313,17 +338,13 @@ public class AgentManagementServiceImpl implements AgentManagementService {
      * @create: 2021-07-14
      */
     @Override
-    public JSONObject queryAccountTransactionDetails(String AccountId, String transaction_type, int pageNum, int pageSize) {
-        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
-        Calendar ca = Calendar.getInstance();
-        ca.setTime(new Date());
-        ca.add(Calendar.DATE, -1);
+    public JSONObject queryAccountTransactionDetails(String AccountId, String transaction_type, int pageNum, int pageSize, String startDate,String endDate) {
         // 请求参数
         Map data = new HashMap() {
             {
                 put("advertiser_id", AccountId);
-                put("start_date", df.format(ca.getTime()));
-                put("end_date", df.format(ca.getTime()));
+                put("start_date", startDate);
+                put("end_date", endDate);
                 put("transaction_type", transaction_type);
                 put("page", pageNum);
                 put("page_size", pageSize);
@@ -341,22 +362,24 @@ public class AgentManagementServiceImpl implements AgentManagementService {
      * @create: 2021-07-14
      */
     @Override
-    public JSONObject queryAccountTransactionDay(String AccountId, int pageNum, int pageSize) {
+    public JSONObject queryAccountTransactionDay(String AccountId, int pageNum, int pageSize,String startDate,String endDate) {
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
         Calendar ca = Calendar.getInstance();
         ca.setTime(new Date());
         ca.add(Calendar.DATE, -1);
-        // 请求参数
-        Map data = new HashMap() {
-            {
-                put("advertiser_id", AccountId);
-                put("start_date", df.format(ca.getTime()));
-                put("end_date", df.format(ca.getTime()));
-                put("page", pageNum);
-                put("page_size", pageSize);
-            }
-        };
-        return sendHttpRequest(data, ACCOUNT_TRANSACTION_DAY_URL);
+            // 请求参数
+            Map data = new HashMap() {
+                {
+                    put("advertiser_id", AccountId);
+                    put("start_date", startDate);
+                    put("end_date", endDate);
+                    put("page", pageNum);
+                    put("page_size", pageSize);
+                }
+            };
+            return sendHttpRequest(data, ACCOUNT_TRANSACTION_DAY_URL);
+
+
     }
 
 

+ 10 - 163
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/controller/ExportReportController.java

@@ -2,22 +2,13 @@ package org.jeecg.ctop.finance.settlement.controller;
 
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.poi.hssf.usermodel.*;
-import org.apache.poi.ss.usermodel.ClientAnchor;
-import org.apache.poi.ss.usermodel.HorizontalAlignment;
-import org.apache.poi.ss.util.CellRangeAddress;
-import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportBytedanceVo;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementFileParamsVo;
 import org.jeecg.ctop.finance.settlement.service.IReportSettlementService;
-import org.jeecg.ctop.finance.utils.createExcelByTemplate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import javax.imageio.ImageIO;
 import javax.servlet.http.HttpServletResponse;
-import java.awt.image.BufferedImage;
-import java.io.*;
-import java.net.URLEncoder;
-import java.util.List;
 
 
 /**
@@ -35,166 +26,22 @@ public class ExportReportController {
     private IReportSettlementService reportSettlementService;
 
 
-
-    @ApiOperation(value="财务结算-结算单导出", notes="财务结算-结算单导出")
+    @ApiOperation(value = "财务结算-结算单导出-头条", notes = "财务结算-结算单导出-头条")
     @GetMapping(value = "/settlementReportBytedance")
-    public String settlementReportBytedance(HttpServletResponse response) throws Exception {
-        //第一步创建workbook
-        HSSFWorkbook wb = new HSSFWorkbook();
-
-        //设置样式
-        HSSFCellStyle style = wb.createCellStyle();
-        style.setAlignment(HorizontalAlignment.CENTER);//水平居中
-
-        //设置字体
-        HSSFFont font = wb.createFont();
-        font.setFontName("黑体");
-        font.setFontHeightInPoints((short) 12);//设置字体大小
-        style.setFont(font);
-
-
-
-        for (int j = 0; j< 2;j++){
-
-
-
-
-        //2:创建sheet
-        HSSFSheet sheet = wb.createSheet("账户id"+j);
-
-
-        //3:添加 第一行单元格
-        HSSFRow row0 = sheet.createRow(0);
-        HSSFCell cell0 = row0.createCell(0);
-        //设置 第一行 表头
-        cell0.setCellValue("头条结算单");
-        CellRangeAddress region = new CellRangeAddress(0, 0, 0, 10);
-        sheet.addMergedRegion(region);//合并行
-        cell0.setCellStyle(style);
-
-
-
-
-        //4:添加表头2行
-        HSSFRow row = sheet.createRow(1);
+    public Result settlementReportBytedance(SettlementFileParamsVo paramsVo, HttpServletResponse response) {
 
-        //5:创建第2行的单元格
-        HSSFCell cell = row.createCell(0);     //第一个单元格
-        cell.setCellValue("      广告主ID      ");         //设定值
-        cell.setCellStyle(style);          //内容居中
+        return reportSettlementService.settlementReportBytedance(paramsVo,response);
 
+    }
 
-        cell = row.createCell(1);
-        cell.setCellValue("   日期   ");
-        cell.setCellStyle(style);
-
-        cell = row.createCell(2);
-        cell.setCellValue("日终结余(单位元)");
-        cell.setCellStyle(style);
-
-        cell = row.createCell(3);
-        cell.setCellValue("现金支出(单位元)");
-        cell.setCellStyle(style);
-
-        cell = row.createCell(4);
-        cell.setCellValue("总支出(单位元)");
-        cell.setCellStyle(style);
-
-        cell = row.createCell(5);
-        cell.setCellValue("冻结(单位元)");
-        cell.setCellStyle(style);
-
-        cell = row.createCell(6);
-        cell.setCellValue("总存入(单位元)");
-        cell.setCellStyle(style);
-
-        cell = row.createCell(7);
-        cell.setCellValue("赠款支出(单位元)");
-        cell.setCellStyle(style);
-
-        cell = row.createCell(8);
-        cell.setCellValue("共享钱包支出(单位元)");
-        cell.setCellStyle(style);
-
-        cell = row.createCell(9);
-        cell.setCellValue("总转入(单位元)");
-        cell.setCellStyle(style);
-
-        cell = row.createCell(10);
-        cell.setCellValue("总转出(单位元)");
-        cell.setCellStyle(style);
-
-
-
-        //添加数据
-        List<SettlementReportBytedanceVo> list = reportSettlementService.getAccountTransactionDayBytedance();
-        for (int i = 0; i < list.size(); i++) {
-            SettlementReportBytedanceVo vo = list.get(i);
-            //创建行 (表头占0-1行 所以 从 2开始)
-            row = sheet.createRow(i+2);
-            sheet.autoSizeColumn(0,true);
-            sheet.autoSizeColumn(i+1,true);
-
-            //创建单元格并且添加数据
-            row.createCell(0).setCellValue(vo.getAdvertiserId());
-            row.createCell(1).setCellValue(vo.getDate());
-            row.createCell(2).setCellValue(vo.getBalance());
-            row.createCell(3).setCellValue(vo.getCashCost());
-            row.createCell(4).setCellValue(vo.getCost());
-            row.createCell(5).setCellValue(vo.getFrozen());
-            row.createCell(6).setCellValue(vo.getIncome());
-            row.createCell(7).setCellValue(vo.getRewardCost());
-            row.createCell(8).setCellValue(vo.getSharedWalletCost());
-            row.createCell(9).setCellValue(vo.getTransferIn());
-            row.createCell(10).setCellValue(vo.getTransferOut());
-
-        }
 
+    @ApiOperation(value = "财务结算-结算单导出-快手", notes = "财务结算-结算单导出-快手")
+    @GetMapping(value = "/settlementReportKuaiShou")
+    public Result settlementReportKuaiShou(SettlementFileParamsVo paramsVo, HttpServletResponse response) {
 
+        return reportSettlementService.settlementReportKuaiShou(paramsVo,response);
 
-        //先把读进来的图片放到一个ByteArrayOutputStream中,以便产生ByteArray
-        ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
-        //bufferImg = ImageIO.read(new File("C:\\Users\\Administrator\\Desktop\\汇创\\20210507161223.jpg"));
-        //bufferImg = ImageIO.read(new File(URLDecoder.decode("https://media-1301855440.cos.ap-chongqing.myqcloud.com/image/2021-08-05/2-1628129040416.jpg","utf-8")));
-        String imagePath = "https://media-1301855440.cos.ap-chongqing.myqcloud.com/image/2021-08-05/2-1628129040416.jpg";
-        //InputStream is = new FileInputStream(imagePath);
-        //通过图片网络地址 获取输入流
-        InputStream is = createExcelByTemplate.getInputStreamByUrl(imagePath);
-        BufferedImage bufferImg = ImageIO.read(is);
-
-        ImageIO.write(bufferImg, imagePath.substring(imagePath.lastIndexOf(".")+1), byteArrayOut);
-
-        //画图的顶级管理器,一个sheet只能获取一个
-        HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
-        //anchor主要用于设置图片的属性
-        //HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 255, 255,(short) 1, 1, (short) 5, 8);
-        HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 255, 255,(short) 5, list.size()+6, (short) 10, 40);
-        HSSFClientAnchor anchor2 = new HSSFClientAnchor(0, 0, 255, 255,(short) 5, list.size()+40, (short) 10, 40*2);
-        anchor.setAnchorType(ClientAnchor.AnchorType.DONT_MOVE_AND_RESIZE);
-        anchor2.setAnchorType(ClientAnchor.AnchorType.DONT_MOVE_AND_RESIZE);
-        //插入图片
-        patriarch.createPicture(anchor, wb.addPicture(byteArrayOut.toByteArray(), HSSFWorkbook.PICTURE_TYPE_JPEG));
-        patriarch.createPicture(anchor2, wb.addPicture(byteArrayOut.toByteArray(), HSSFWorkbook.PICTURE_TYPE_JPEG));
-
-
-
-        }
-        response.setCharacterEncoding("UTF-8");
-        response.setContentType("application/vnd.ms-excel;charset=UTF-8");
-        response.setHeader("Pragma", "no-cache");
-        response.setHeader("Cache-Control", "no-cache");
-        response.setDateHeader("Expires", 0);
-        response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("文件名称.xlsx", "UTF-8"));
-        OutputStream output = response.getOutputStream();
-        BufferedOutputStream bufferedOutPut = new BufferedOutputStream(output);
-        wb.write(bufferedOutPut);
-        bufferedOutPut.flush();
-        bufferedOutPut.close();
-        output.close();
-
-       return "success";
     }
 
 
-
 }

+ 2 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/entity/vo/SettlementReportBytedanceVo.java

@@ -49,6 +49,8 @@ public class SettlementReportBytedanceVo implements Serializable {
     private String transferOut;
 
 
+    private String accountName;
+
 
 
 

+ 90 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/entity/vo/SettlementReportKuaiShouVo.java

@@ -0,0 +1,90 @@
+package org.jeecg.ctop.finance.settlement.entity.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ *
+ * @description: 快手 结算单
+ * @return:
+ * @author: zianY
+ */
+@Data
+public class SettlementReportKuaiShouVo implements Serializable {
+
+    private Long id;
+    /**
+     * 账户ID
+     */
+    @ApiModelProperty(value = "账户ID")
+    private String accountId;
+    /**
+     * 时间
+     */
+    @ApiModelProperty(value = "时间")
+    private String date;
+    /**
+     * 总花费(元)
+     */
+    @ApiModelProperty(value = "总花费(元)")
+    private String dailyCharge;
+    /**
+     * 充值话费(元)
+     */
+    @ApiModelProperty(value = "充值花费(元)")
+    private String realCharged;
+    /**
+     * 框返花费(元)
+     */
+    @ApiModelProperty(value = "框返花费(元)")
+    private String contractRebateRealCharged;
+    /**
+     * 激励花费(元)
+     */
+    @ApiModelProperty(value = "激励花费(元)")
+    private String directRebateRealCharged;
+    /**
+     * 转入(元)
+     */
+    @ApiModelProperty(value = "转入(元)")
+    private String dailyTransferIn;
+    /**
+     * 转出(元)
+     */
+    @ApiModelProperty(value = "转出(元)")
+    private String dailyTransferOut;
+    /**
+     * 日终结余(元)
+     */
+    @ApiModelProperty(value = "日终结余(元)")
+    private String balance;
+    /**
+     * 充值转入(元)
+     */
+    @ApiModelProperty(value = "充值转入(元)")
+    private String realRecharged;
+    /**
+     * 框返转入(元)
+     */
+    @org.jeecgframework.poi.excel.annotation.Excel(name = "框返转入(元)", width = 15)
+    @ApiModelProperty(value = "框返转入(元)")
+    private String contractRebateRealRecharged;
+    /**
+     * 激励转入(元)
+     */
+    @ApiModelProperty(value = "激励转入(元)")
+    private String directRebateRealRecharged;
+
+    private String ksId;
+
+
+
+}

+ 25 - 2
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/ReportSettlementMapper.java

@@ -3,7 +3,9 @@ package org.jeecg.ctop.finance.settlement.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import io.lettuce.core.dynamic.annotation.Param;
 import org.jeecg.ctop.finance.settlement.entity.pojo.ctopCwjsSettlementInfo;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementFileParamsVo;
 import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportBytedanceVo;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportKuaiShouVo;
 
 import java.util.List;
 
@@ -19,10 +21,31 @@ import java.util.List;
 public interface ReportSettlementMapper {
 
     /**
-     *获取头条 账户 日流水信息
+     *获取头条 账户 日流水信息 根据账户id 和 年月 查询数据
      * @param
      * @return
      */
-    List<SettlementReportBytedanceVo> getAccountTransactionDayBytedance();
+    List<SettlementReportBytedanceVo> getAccountTransactionDayBytedance(SettlementFileParamsVo paramsVo);
+
+    /**
+     * 获取快手 账户 日流水信息 根据账户id 和 年月 查询数据
+     * @param paramsVo
+     * @return
+     */
+    List<SettlementReportKuaiShouVo> getAccountTransactionDayKuaiShou(SettlementFileParamsVo paramsVo);
+
+
+    /**
+     * 查询 头条 账户id
+     * @return
+     */
+   List<String> getAccountIdBytedance(SettlementFileParamsVo paramsVo);
+
+    /**
+     * 查询 头条 账户 图片
+     * @param accountId
+     * @return
+     */
+   List<String> getAccountImagesBytedance(String accountId);
 
 }

+ 65 - 4
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/mapper/xml/ReportSettlementMapper.xml

@@ -3,15 +3,76 @@
 <mapper namespace="org.jeecg.ctop.finance.settlement.mapper.ReportSettlementMapper">
 
     <!-- 获取头条 账户 日流水信息 -->
-
     <select id="getAccountTransactionDayBytedance" resultType="org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportBytedanceVo">
-        select * from
-            ctop_account_transaction_day
-limit 10
+        select t.*,c.auth_name as accountName from (select id,
+        advertiser_id,
+        date,DATE_FORMAT(date,'%Y-%m') as uploadYears,
+        balance,cash_cost,cost,frozen,income,reward_cost,shared_wallet_cost,transfer_in,transfer_out,create_time
+         from
+        ctop_account_transaction_day
+        where advertiser_id = #{accountId}
+            )t
+      LEFT JOIN ctop_user_allocation c on t.advertiser_id = c.account_id
+        where uploadYears = #{uploadYears}
+    </select>
+
+    <!-- 查询 头条 账户id-->
+    <select id="getAccountIdBytedance" resultType="java.lang.String">
+        SELECT
+         account_id as accountId
+        FROM
+        ctop_cwjs_settlement_info
+        where del_flag = 0
+        <if test="advertiserId !=null and advertiserId != ''">
+            AND advertiser_id = #{advertiserId}
+        </if>
+        <if test="productId !=null and productId != ''">
+            AND product_id = #{productId}
+        </if>
+        <if test="mediaId !=null and mediaId != ''">
+            AND media_id = #{mediaId}
+        </if>
+
+    </select>
+
 
+    <!-- 查询 头条 账户 图片-->
+    <select id="getAccountImagesBytedance" resultType="java.lang.String">
+        SELECT
+        file_url as fileUrl
+        FROM
+        ctop_cwjs_settlement_file_info
+        where del_flag = 0
+        AND account_id = #{accountId}
 
     </select>
 
 
 
+
+
+    <!-- 获取快手 账户 日流水信息 -->
+    <select id="getAccountTransactionDayKuaiShou" resultType="org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportKuaiShouVo">
+        select t.*,c.auth_name as accountName,
+               base.user_id as ksId from (select id,
+                                                           account_id,
+                                                        date,DATE_FORMAT(date,'%Y-%m') as uploadYears,
+                                                        daily_charge,real_charged,contract_rebate_real_charged,direct_rebate_real_charged,
+                                                        daily_transfer_in,daily_transfer_out,balance,
+                                                        real_recharged,contract_rebate_real_recharged,direct_rebate_real_recharged,
+                                                      create_time
+                                                    from
+                                                        ctop_kuaishou_daily_flows
+                                                    where account_id = #{accountId}
+                                                   )t
+                                                       LEFT JOIN ctop_user_allocation c on t.account_id = c.account_id
+                                                       LEFT JOIN ctop_kuaishou_advertiser_base_info base on base.account_id = t.account_id
+        where uploadYears = #{uploadYears}
+    </select>
+
+
+
+
+
+
 </mapper>

+ 6 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/IReportSettlementService.java

@@ -3,13 +3,19 @@ package org.jeecg.ctop.finance.settlement.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.ctop.finance.settlement.entity.pojo.ctopCwjsSettlementInfo;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementFileParamsVo;
 import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportBytedanceVo;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 
 public interface IReportSettlementService {
 
     List<SettlementReportBytedanceVo> getAccountTransactionDayBytedance();
 
+    Result settlementReportBytedance(SettlementFileParamsVo paramsVo,HttpServletResponse response);
+
+    Result settlementReportKuaiShou(SettlementFileParamsVo paramsVo,HttpServletResponse response);
+
 }

+ 389 - 1
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/settlement/service/serviceImpl/ReportSettlementServiceImpl.java

@@ -1,12 +1,29 @@
 package org.jeecg.ctop.finance.settlement.service.serviceImpl;
 
 import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.hssf.usermodel.*;
+import org.apache.poi.ss.usermodel.ClientAnchor;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.ctop.finance.policy.utils.Check;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementFileParamsVo;
 import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportBytedanceVo;
+import org.jeecg.ctop.finance.settlement.entity.vo.SettlementReportKuaiShouVo;
 import org.jeecg.ctop.finance.settlement.mapper.ReportSettlementMapper;
 import org.jeecg.ctop.finance.settlement.service.IReportSettlementService;
+import org.jeecg.ctop.finance.utils.createExcelByTemplate;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import javax.imageio.ImageIO;
+import javax.servlet.http.HttpServletResponse;
+import java.awt.image.BufferedImage;
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URLEncoder;
 import java.util.List;
 
 
@@ -19,6 +36,377 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
 
     @Override
     public List<SettlementReportBytedanceVo> getAccountTransactionDayBytedance() {
-        return reportSettlementMapper.getAccountTransactionDayBytedance();
+        return reportSettlementMapper.getAccountTransactionDayBytedance(null);
     }
+
+    @Override
+    public Result settlementReportBytedance(SettlementFileParamsVo paramsVo, HttpServletResponse response) {
+
+        try {
+
+            //第一步创建workbook
+            HSSFWorkbook wb = new HSSFWorkbook();
+
+            //设置样式
+            HSSFCellStyle style = wb.createCellStyle();
+            style.setAlignment(HorizontalAlignment.CENTER);//水平居中
+
+            //设置字体
+            HSSFFont font = wb.createFont();
+            font.setFontName("黑体");
+            font.setFontHeightInPoints((short) 12);//设置字体大小
+            style.setFont(font);
+
+            //查询 账户id
+            List<String> accountIdList = reportSettlementMapper.getAccountIdBytedance(paramsVo);
+
+            if (Check.isNull(accountIdList)){
+                return Result.errorMsg("该广告主和产品下无法查询到绑定的账户信息。");
+            }
+
+            int num = 0;
+
+            for (int k = 0; k < accountIdList.size(); k++) {
+
+                String accountId = accountIdList.get(k);
+                paramsVo.setAccountId(accountId);
+
+                //获取账户 日流水数据  根据账户id 和 年月 查询数据
+                List<SettlementReportBytedanceVo> settlementList = reportSettlementMapper.getAccountTransactionDayBytedance(paramsVo);
+                if (Check.isNull(settlementList)){
+                    num++;
+                    continue;
+                }
+
+                //2:创建sheet 设置sheet名称
+                HSSFSheet sheet = wb.createSheet(accountId);
+
+                //画图的顶级管理器,一个sheet只能获取一个 (插入图片时 使用)
+                HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
+
+                //3:添加 第一行单元格
+                HSSFRow row0 = sheet.createRow(0);
+                HSSFCell cell0 = row0.createCell(0);
+                //设置 第一行 表头
+                cell0.setCellValue(paramsVo.getUploadYears()+"-头条结算单");
+                CellRangeAddress region = new CellRangeAddress(0, 0, 0, 10);
+                sheet.addMergedRegion(region);//合并行
+                cell0.setCellStyle(style);
+
+                //4:添加表头2行
+                HSSFRow row = sheet.createRow(1);
+
+                //5:创建第2行的单元格
+                HSSFCell cell = row.createCell(0);     //第一个单元格
+                cell.setCellValue("   日期   ");         //设定值
+                cell.setCellStyle(style);          //内容居中
+
+                cell = row.createCell(1);
+                cell.setCellValue("      账户名称      ");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(2);
+                cell.setCellValue("      账户ID      ");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(3);
+                cell.setCellValue("      所属代理商名称      ");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(4);
+                cell.setCellValue("      所属代理商ID      ");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(5);
+                cell.setCellValue("账户总支出(¥)");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(6);
+                cell.setCellValue("账户现金支出(¥)");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(7);
+                cell.setCellValue("账户赠款支出(¥)");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(8);
+                cell.setCellValue("账户总存入(¥)");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(9);
+                cell.setCellValue("账户总转入(¥)");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(10);
+                cell.setCellValue("账户总转出(¥)");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(11);
+                cell.setCellValue("账户日终结余(¥)");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(12);
+                cell.setCellValue("冻结(¥)");
+                cell.setCellStyle(style);
+
+
+
+
+                for (int i = 0; i < settlementList.size(); i++) {
+                    SettlementReportBytedanceVo vo = settlementList.get(i);
+                    //创建行 (表头占0-1行 所以 从 2开始)
+                    row = sheet.createRow(i + 2);
+                    sheet.autoSizeColumn(0, true);
+                    sheet.autoSizeColumn(i + 1, true);
+                    //创建单元格并且添加数据
+                    row.createCell(0).setCellValue(vo.getDate());
+                    row.createCell(1).setCellValue(vo.getAccountName());
+                    row.createCell(2).setCellValue(vo.getAdvertiserId());
+                    row.createCell(3).setCellValue("北京汇创思拓数字科技有限公司-ka");
+                    row.createCell(4).setCellValue("73970348172");
+                    row.createCell(5).setCellValue(vo.getCost());
+                    row.createCell(6).setCellValue(vo.getCashCost());
+                    row.createCell(7).setCellValue(vo.getRewardCost());
+                    row.createCell(8).setCellValue(vo.getIncome());
+                    row.createCell(9).setCellValue(vo.getTransferIn());
+                    row.createCell(10).setCellValue(vo.getTransferOut());
+                    row.createCell(11).setCellValue(vo.getBalance());
+                    row.createCell(12).setCellValue(vo.getFrozen());
+                }
+
+                //先把读进来的图片放到一个ByteArrayOutputStream中,以便产生ByteArray
+                ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
+
+                //查询 图片 url
+                List<String> imageUrlList = reportSettlementMapper.getAccountImagesBytedance(accountId);
+
+                if (!Check.isNull(imageUrlList)){
+                    for (int j = 0; j < imageUrlList.size(); j++) {
+                        String imagePath = imageUrlList.get(j);
+                        //通过图片网络地址 获取输入流
+                        InputStream is = createExcelByTemplate.getInputStreamByUrl(imagePath);
+                        BufferedImage bufferImg = ImageIO.read(is);
+                        ImageIO.write(bufferImg, imagePath.substring(imagePath.lastIndexOf(".") + 1), byteArrayOut);
+                        //anchor主要用于设置图片的属性
+                        HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 255, 255, (short) 2, settlementList.size() + 6 +(j*40), (short) 10, 90*(j+1));
+                        //HSSFClientAnchor anchor2 = new HSSFClientAnchor(0, 0, 255, 255, (short) 5, settlementList.size() + 40, (short) 10, 40 * 2);
+                        anchor.setAnchorType(ClientAnchor.AnchorType.DONT_MOVE_AND_RESIZE);
+                        //插入图片
+                        patriarch.createPicture(anchor, wb.addPicture(byteArrayOut.toByteArray(), HSSFWorkbook.PICTURE_TYPE_JPEG));
+                    }
+                }
+
+            }
+
+            if(accountIdList.size() == num){
+                return Result.errorMsg("暂无数据。");
+            }
+
+            response.setCharacterEncoding("UTF-8");
+            response.setContentType("application/vnd.ms-excel;charset=UTF-8");
+            response.setHeader("Pragma", "no-cache");
+            response.setHeader("Cache-Control", "no-cache");
+            response.setDateHeader("Expires", 0);
+            response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(paramsVo.getUploadYears()+"头条结算单.xlsx", "UTF-8"));
+            OutputStream output = response.getOutputStream();
+            BufferedOutputStream bufferedOutPut = new BufferedOutputStream(output);
+            wb.write(bufferedOutPut);
+            bufferedOutPut.flush();
+            bufferedOutPut.close();
+            output.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("====>>>>", e.getMessage());
+            return Result.errorMsg(e.getMessage());
+        }
+        return null;
+    }
+
+
+
+    @Override
+    public Result settlementReportKuaiShou(SettlementFileParamsVo paramsVo, HttpServletResponse response) {
+
+        try {
+
+            //第一步创建workbook
+            HSSFWorkbook wb = new HSSFWorkbook();
+
+            //设置样式
+            HSSFCellStyle style = wb.createCellStyle();
+            style.setAlignment(HorizontalAlignment.CENTER);//水平居中
+
+            //设置字体
+            HSSFFont font = wb.createFont();
+            font.setFontName("黑体");
+            font.setFontHeightInPoints((short) 12);//设置字体大小
+            style.setFont(font);
+
+            //查询 账户id
+            List<String> accountIdList = reportSettlementMapper.getAccountIdBytedance(paramsVo);
+
+            if (Check.isNull(accountIdList)){
+                return Result.errorMsg("该广告主和产品下无法查询到绑定的快手账户信息。");
+            }
+
+            int num = 0;
+
+            for (int k = 0; k < accountIdList.size(); k++) {
+
+                String accountId = accountIdList.get(k);
+                paramsVo.setAccountId(accountId);
+
+                //获取账户 日流水数据  根据账户id 和 年月 查询数据
+                List<SettlementReportKuaiShouVo> settlementList = reportSettlementMapper.getAccountTransactionDayKuaiShou(paramsVo);
+                if (Check.isNull(settlementList)){
+                    num++;
+                    continue;
+                }
+
+                //2:创建sheet 设置sheet名称
+                HSSFSheet sheet = wb.createSheet(accountId);
+
+                //画图的顶级管理器,一个sheet只能获取一个 (插入图片时 使用)
+                HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
+
+                //3:添加 第一行单元格
+                HSSFRow row0 = sheet.createRow(0);
+                HSSFCell cell0 = row0.createCell(0);
+                //设置 第一行 表头
+                cell0.setCellValue(paramsVo.getUploadYears()+"-快手结算单");
+                CellRangeAddress region = new CellRangeAddress(0, 0, 0, 10);
+                sheet.addMergedRegion(region);//合并行
+                cell0.setCellStyle(style);
+
+                //4:添加表头2行
+                HSSFRow row = sheet.createRow(1);
+
+                //5:创建第2行的单元格
+                HSSFCell cell = row.createCell(0);     //第一个单元格
+                cell.setCellValue("   日期   ");         //设定值
+                cell.setCellStyle(style);          //内容居中
+
+                cell = row.createCell(1);
+                cell.setCellValue("      账户快手ID      ");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(2);
+                cell.setCellValue("      广告主账户ID      ");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(3);
+                cell.setCellValue("      日总花费      ");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(4);
+                cell.setCellValue("      充值花费      ");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(5);
+                cell.setCellValue("框返花费");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(6);
+                cell.setCellValue("激励花费");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(7);
+                cell.setCellValue("充值转入");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(8);
+                cell.setCellValue("框返转入");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(9);
+                cell.setCellValue("激励转入");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(10);
+                cell.setCellValue("总转入");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(11);
+                cell.setCellValue("转出");
+                cell.setCellStyle(style);
+
+                cell = row.createCell(12);
+                cell.setCellValue("日终结余");
+                cell.setCellStyle(style);
+
+
+
+
+                for (int i = 0; i < settlementList.size(); i++) {
+                    SettlementReportKuaiShouVo vo = settlementList.get(i);
+                    //创建行 (表头占0-1行 所以 从 2开始)
+                    row = sheet.createRow(i + 2);
+                    sheet.autoSizeColumn(0, true);
+                    sheet.autoSizeColumn(i + 1, true);
+                    //创建单元格并且添加数据
+                    row.createCell(0).setCellValue(vo.getDate());
+                    row.createCell(1).setCellValue(vo.getKsId());
+                    row.createCell(2).setCellValue(vo.getAccountId());
+                    row.createCell(3).setCellValue(vo.getDailyCharge());
+                    row.createCell(4).setCellValue(vo.getRealCharged());
+                    row.createCell(5).setCellValue(vo.getContractRebateRealCharged());
+                    row.createCell(6).setCellValue(vo.getDirectRebateRealCharged());
+                    row.createCell(7).setCellValue(vo.getRealRecharged());
+                    row.createCell(8).setCellValue(vo.getContractRebateRealRecharged());
+                    row.createCell(9).setCellValue(vo.getDirectRebateRealRecharged());
+                    row.createCell(10).setCellValue(vo.getDailyTransferIn());
+                    row.createCell(11).setCellValue(vo.getDailyTransferOut());
+                    row.createCell(12).setCellValue(vo.getBalance());
+                }
+
+                //先把读进来的图片放到一个ByteArrayOutputStream中,以便产生ByteArray
+                ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
+
+                //查询 图片 url
+                List<String> imageUrlList = reportSettlementMapper.getAccountImagesBytedance(accountId);
+
+                if (!Check.isNull(imageUrlList)){
+                    for (int j = 0; j < imageUrlList.size(); j++) {
+                        String imagePath = imageUrlList.get(j);
+                        //通过图片网络地址 获取输入流
+                        InputStream is = createExcelByTemplate.getInputStreamByUrl(imagePath);
+                        BufferedImage bufferImg = ImageIO.read(is);
+                        ImageIO.write(bufferImg, imagePath.substring(imagePath.lastIndexOf(".") + 1), byteArrayOut);
+                        //anchor主要用于设置图片的属性
+                        int startIndex = settlementList.size()+7;
+
+                        HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 255, 255, (short) 2, startIndex+(5*j)+50*j, (short) 10, startIndex+(5*j)+50*(j+1));
+                        //HSSFClientAnchor anchor2 = new HSSFClientAnchor(0, 0, 255, 255, (short) 5, settlementList.size() + 40, (short) 10, 40 * 2);
+                        anchor.setAnchorType(ClientAnchor.AnchorType.DONT_MOVE_AND_RESIZE);
+                        //插入图片
+                        patriarch.createPicture(anchor, wb.addPicture(byteArrayOut.toByteArray(), HSSFWorkbook.PICTURE_TYPE_JPEG));
+                    }
+                }
+
+            }
+
+            if(accountIdList.size() == num){
+                return Result.errorMsg("暂无数据。");
+            }
+
+            response.setCharacterEncoding("UTF-8");
+            response.setContentType("application/vnd.ms-excel;charset=UTF-8");
+            response.setHeader("Pragma", "no-cache");
+            response.setHeader("Cache-Control", "no-cache");
+            response.setDateHeader("Expires", 0);
+            response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(paramsVo.getUploadYears()+"快手结算单.xlsx", "UTF-8"));
+            OutputStream output = response.getOutputStream();
+            BufferedOutputStream bufferedOutPut = new BufferedOutputStream(output);
+            wb.write(bufferedOutPut);
+            bufferedOutPut.flush();
+            bufferedOutPut.close();
+            output.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("====>>>>", e.getMessage());
+            return Result.errorMsg(e.getMessage());
+        }
+        return null;
+    }
+
 }

+ 2 - 2
jeecg-boot-module-system/pom.xml

@@ -69,7 +69,7 @@
 			<artifactId>opencv</artifactId>
 			<version>4.2.0</version>
 			<scope>system</scope>
-			<systemPath>${project.basedir}/src/main/resources/lib/opencv-4.2.0.jar</systemPath>
+			<systemPath>${basedir}/../lib/opencv-4.2.0.jar</systemPath>
 		</dependency>
 		<!-- commons -->
 		<dependency>
@@ -99,7 +99,7 @@
 			<artifactId>jave</artifactId>
 			<version>1.0</version>
 			<scope>system</scope>
-			<systemPath>${project.basedir}/src/main/resources/lib/jave-1.0.jar</systemPath>
+			<systemPath>${project.basedir}/../lib/jave-1.0.jar</systemPath>
 		</dependency>
 
 		<dependency>

+ 4 - 4
jeecg-boot-module-system/src/main/java/cn/com/ctop/alarm/modules/controller/RuleSwitchController.java

@@ -28,14 +28,14 @@ public class RuleSwitchController {
         userAllocation.setAccountId(accountId);
         UpdateWrapper<UserAllocation> wrapper=new UpdateWrapper<>();
         //开启预警
-        if(switchType.equals("on")){
+        if("on".equals(switchType)){
             wrapper.set("monitoring_link",0);
             wrapper.setEntity(userAllocation);
             boolean update = userAllocationService.update(wrapper);
             if(update){
                 result.success("监测链接预警开启成功");
             }
-        }else if(switchType.equals("off")){
+        }else if("off".equals(switchType)){
             wrapper.set("monitoring_link",1);
             wrapper.setEntity(userAllocation);
             boolean update = userAllocationService.update(wrapper);
@@ -58,14 +58,14 @@ public class RuleSwitchController {
         userAllocation.setAccountId(accountId);
         UpdateWrapper<UserAllocation> wrapper=new UpdateWrapper<>();
         //开启预警
-        if(switchType.equals("on")){
+        if("on".equals(switchType)){
             wrapper.set("landing_page",0);
             wrapper.setEntity(userAllocation);
             boolean update = userAllocationService.update(wrapper);
             if(update){
                 result.success("落地页链接预警开启成功");
             }
-        }else if(switchType.equals("off")){
+        }else if("off".equals(switchType)){
             wrapper.set("landing_page",1);
             wrapper.setEntity(userAllocation);
             boolean update = userAllocationService.update(wrapper);

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/MaterialImageInfoServiceImpl.java

@@ -155,7 +155,7 @@ public class MaterialImageInfoServiceImpl extends ServiceImpl<MaterialImageInfoM
     @Override
     public List<MaterialImageInfo> getListByVideoSignature(String signature) {
         QueryWrapper<MaterialImageInfo>queryWrapper =new QueryWrapper<>();
-        if(null!=signature&&!signature.trim().equals("")){
+        if(null!=signature&&!"".equals(signature.trim())){
             queryWrapper.eq("video_id",signature);
         }
         return this.list(queryWrapper);

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

@@ -19,6 +19,7 @@ import com.github.pagehelper.PageInfo;
 import com.tencentcloudapi.mps.v20190612.models.DescribeTaskDetailResponse;
 import it.sauronsoftware.jave.Encoder;
 import it.sauronsoftware.jave.EncoderException;
+import it.sauronsoftware.jave.MultimediaInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.system.vo.LoginUser;
@@ -399,7 +400,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
                     String url = materialInfo.getUrl();
                     log.info("replaceUrl:{}", url);
                     String localUrl = null;
-                    it.sauronsoftware.jave.MultimediaInfo m = null;
+                    MultimediaInfo m = null;
                     FileInputStream fis = null;
                     try {
                         localUrl = LoadFileUtil.downLoadFromUrl(url, downloadUrl);

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java

@@ -129,7 +129,7 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
     @Override
     public List<JSONObject> getAccountIdsByUserId(String userId) {
         List<JSONObject> result = new ArrayList<>();
-        if (userId.equals("e9ca23d68d884d4ebb19d07889727dae")) {
+        if ("e9ca23d68d884d4ebb19d07889727dae".equals(userId)) {
             result = userAllocationMapper.getAllAccountIdsByMediaId("2");
         } else {
             result = userAllocationMapper.getAccountIdsByUserId(userId);

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/utils/StatusCode.java

@@ -26,7 +26,7 @@ public enum StatusCode {
     BYTEDANCE_PLAN_DATA_NOT_EXIST("此计划不存在或者已经被删除", -101, false),
     BYTEDANCE_ACCOUNT_DATA_NOT_EXIST("此账户尚未绑定或已停投", -101, false),
     COMMON_VERSION_NOT_EXIST("版本号不存在", -102, false),
-    BYTEDANCE_VIDEO_UPLOAD_FAIL("今日头条视频文件上传失败", -201, false),
+    BYTEDANCE_VIDEO_UPLOAD_FAIL("视频文件上传失败", -201, false),
     MATERIAL_UPLOAD_FAIL("素材文件上传失败", -201, false),
     IMAGE_NUMBER_SHORTAGE("今日头条图片文件上传失败", -202, false),
     BYTEDANCE_IMAGE_UPLOAD_FAIL("今日头条图片文件上传失败", -203, false),

+ 0 - 131
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/utils/TokenUtils.java

@@ -1,131 +0,0 @@
-package cn.com.ctop.common.module.utils;
-
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang.StringUtils;
-import org.apache.shiro.authc.AuthenticationException;
-import org.jeecg.common.constant.CommonConstant;
-import org.jeecg.common.system.api.ISysBaseApi;
-import org.jeecg.common.system.util.JwtUtil;
-import org.jeecg.common.system.vo.LoginUser;
-import org.jeecg.common.util.RedisUtil;
-import org.jeecg.common.util.oConvertUtils;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * @Author scott
- * @Date 2019/9/23 14:12
- * @Description: 编程校验token有效性
- */
-@Slf4j
-public class TokenUtils {
-
-    /**
-     * 获取 request 里传递的 token
-     *
-     * @param request
-     * @return
-     */
-    public static String getTokenByRequest(HttpServletRequest request) {
-        String token = request.getParameter("token");
-        if (token == null) {
-            token = request.getHeader("X-Access-Token");
-        }
-        return token;
-    }
-
-    /**
-     * 验证Token
-     */
-    public static boolean verifyToken(String token, ISysBaseApi sysBaseApi, RedisUtil redisUtil) {
-        if (StringUtils.isBlank(token)) {
-            throw new AuthenticationException("token不能为空!");
-        }
-
-        // 解密获得username,用于和数据库进行对比
-        String username = JwtUtil.getUsername(token);
-        if (username == null) {
-            throw new AuthenticationException("token非法无效!");
-        }
-
-        // 查询用户信息
-        LoginUser user = sysBaseApi.getUserByName(username);
-        if (user == null) {
-            throw new AuthenticationException("用户不存在!");
-        }
-        // 判断用户状态
-        if (user.getStatus() != 1) {
-            throw new AuthenticationException("账号已被锁定,请联系管理员!");
-        }
-        // 校验token是否超时失效 & 或者账号密码是否错误
-        if (!jwtTokenRefresh(token, username, user.getPassword(), redisUtil)) {
-            throw new AuthenticationException("Token失效,请重新登录!");
-        }
-        return true;
-    }
-
-
-    /**
-     * 验证Token
-     */
-    public static boolean verifyToken(HttpServletRequest request, ISysBaseApi sysBaseApi, RedisUtil redisUtil) {
-        log.info(" -- url --" + request.getRequestURL());
-        String token = getTokenByRequest(request);
-
-        if (StringUtils.isBlank(token)) {
-            throw new AuthenticationException("token不能为空!");
-        }
-
-        // 解密获得username,用于和数据库进行对比
-        String username = JwtUtil.getUsername(token);
-        if (username == null) {
-            throw new AuthenticationException("token非法无效!");
-        }
-
-        // 查询用户信息
-        LoginUser user = sysBaseApi.getUserByName(username);
-        if (user == null) {
-            throw new AuthenticationException("用户不存在!");
-        }
-        // 判断用户状态
-        if (user.getStatus() != 1) {
-            throw new AuthenticationException("账号已被锁定,请联系管理员!");
-        }
-        // 校验token是否超时失效 & 或者账号密码是否错误
-        if (!jwtTokenRefresh(token, username, user.getPassword(), redisUtil)) {
-            throw new AuthenticationException("Token失效,请重新登录!");
-        }
-        return true;
-    }
-
-    /**
-     * 刷新token(保证用户在线操作不掉线)
-     * @param token
-     * @param userName
-     * @param passWord
-     * @param redisUtil
-     * @return
-     */
-    private static boolean jwtTokenRefresh(String token, String userName, String passWord, RedisUtil redisUtil) {
-        String cacheToken = String.valueOf(redisUtil.get(CommonConstant.PREFIX_USER_TOKEN + token));
-        if (oConvertUtils.isNotEmpty(cacheToken)) {
-            // 校验token有效性
-            if (!JwtUtil.verify(cacheToken, userName, passWord)) {
-                String newAuthorization = JwtUtil.sign(userName, passWord);
-                // 设置Toekn缓存有效时间
-                redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, newAuthorization);
-                redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME*2 / 1000);
-            }
-            //update-begin--Author:scott  Date:20191005  for:解决每次请求,都重写redis中 token缓存问题
-//            else {
-//                redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, cacheToken);
-//                // 设置超时时间
-//                redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME / 1000);
-//            }
-            //update-end--Author:scott  Date:20191005  for:解决每次请求,都重写redis中 token缓存问题
-            return true;
-        }
-        return false;
-    }
-
-}

+ 2 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaiShouAppInfoServiceImpl.java

@@ -61,9 +61,9 @@ public class AiKuaiShouAppInfoServiceImpl extends ServiceImpl<AiKuaiShouAppInfoM
             Workbook workbook = null;
             String fileName = myFile.getOriginalFilename();
             String substring = fileName.substring(fileName.lastIndexOf(".") + 1).toUpperCase();
-            if (substring.equals("XLS")) {
+            if ("XLS".equals(substring)) {
                 workbook = new HSSFWorkbook(myFile.getInputStream());
-            } else if (substring.equals("XLSX")) {
+            } else if ("XLSX".equals(substring)) {
                 workbook = new XSSFWorkbook(myFile.getInputStream());
             } else {
                 throw new Exception("文件不是Excel文件");

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreateCreativeServiceImpl.java

@@ -1581,7 +1581,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         }
         Date date = new Date();
         String nowDate = DateUtils.formatDate(date, "yy-MMdd");
-        if (type.equals("plan")) {
+        if ("plan".equals(type)) {
             if (wildcard.contains("{{日期}}")) {
                 wildcard = wildcard.replace("{{日期}}", nowDate);
             } else {

+ 15 - 15
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouProjectCreateCreativeServiceImpl.java

@@ -1068,7 +1068,7 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
                         continue;
                     }
                     if (!Check.isNull(dir.getUserType()) && dir.getUserType() != 2) {
-                        if (dir.getUserType() != target.getUserType()) {
+                        if (!dir.getUserType().equals(target.getUserType())) {
                             continue;
                         }
                     }
@@ -1084,37 +1084,37 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
                         }
                     }
                     if (!Check.isNull(dir.getGender()) && dir.getGender() != 0) {
-                        if (dir.getGender() != target.getGender()) {
+                        if (!dir.getGender().equals(target.getGender())) {
                             continue;
                         }
                     }
                     if (!Check.isNull(dir.getPlatformOs()) && dir.getPlatformOs() != 0) {
-                        if (dir.getPlatformOs() != target.getPlatformOs()) {
+                        if (!dir.getPlatformOs().equals(target.getPlatformOs())) {
                             continue;
                         }
                     }
                     if (!Check.isNull(dir.getAndroidOsv()) && dir.getAndroidOsv() != 3) {
-                        if (dir.getAndroidOsv() != target.getAndroidOsv()) {
+                        if (!dir.getAndroidOsv().equals(target.getAndroidOsv())) {
                             continue;
                         }
                     }
                     if (!Check.isNull(dir.getIosOsv()) && dir.getIosOsv() != 6) {
-                        if (dir.getIosOsv() != target.getIosOsv()) {
+                        if (!dir.getIosOsv().equals(target.getIosOsv())) {
                             continue;
                         }
                     }
                     if (!Check.isNull(dir.getNetwork()) && dir.getNetwork() != 0) {
-                        if (dir.getNetwork() != target.getNetwork()) {
+                        if (!dir.getNetwork().equals(target.getNetwork())) {
                             continue;
                         }
                     }
                     if (!Check.isNull(dir.getFilterConvertedLevel()) && dir.getFilterConvertedLevel() != 0) {
-                        if (dir.getFilterConvertedLevel() != target.getFilterConvertedLevel()) {
+                        if (!dir.getFilterConvertedLevel().equals(target.getFilterConvertedLevel())) {
                             continue;
                         }
                     }
                     if (!Check.isNull(dir.getBusinessInterestType()) && dir.getBusinessInterestType() != 0) {
-                        if (dir.getBusinessInterestType() != target.getBusinessInterestType()) {
+                        if (!dir.getBusinessInterestType().equals(target.getBusinessInterestType())) {
                             continue;
                         }
                     }
@@ -1140,22 +1140,22 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
                         continue;
                     }
                     if (!Check.isNull(dir.getIsOpen()) && dir.getIsOpen() != 0) {
-                        if (dir.getIsOpen() != target.getIsOpen()) {
+                        if (!dir.getIsOpen().equals(target.getIsOpen())) {
                             continue;
                         }
                     }
                     if (!Check.isNull(dir.getNoAgeBreak()) && dir.getNoAgeBreak() != 0) {
-                        if (dir.getNoAgeBreak() != target.getNoAgeBreak()) {
+                        if (!dir.getNoAgeBreak().equals(target.getNoAgeBreak())) {
                             continue;
                         }
                     }
                     if (!Check.isNull(dir.getNoGenderBreak()) && dir.getNoGenderBreak() != 0) {
-                        if (dir.getNoGenderBreak() != target.getNoGenderBreak()) {
+                        if (!dir.getNoGenderBreak().equals(target.getNoGenderBreak())) {
                             continue;
                         }
                     }
                     if (!Check.isNull(dir.getNoAreaBreak()) && dir.getNoAreaBreak() != 0) {
-                        if (dir.getNoAreaBreak() != target.getNoAreaBreak()) {
+                        if (!dir.getNoAreaBreak().equals(target.getNoAreaBreak())) {
                             continue;
                         }
                     }
@@ -1172,12 +1172,12 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
                         continue;
                     }
                     if (!Check.isNull(dir.getTimeType()) && dir.getTimeType() != -1) {
-                        if (dir.getTimeType() != target.getTimeType()) {
+                        if (!dir.getTimeType().equals(target.getTimeType())) {
                             continue;
                         }
                     }
                     if (!Check.isNull(dir.getStrengthType()) && dir.getStrengthType() != 0) {
-                        if (dir.getStrengthType() != target.getStrengthType()) {
+                        if (!dir.getStrengthType().equals(target.getStrengthType())) {
                             continue;
                         }
                     }
@@ -1453,7 +1453,7 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
         }
         Date date = new Date();
         String nowDate = DateUtils.formatDate(date, "yy-MMdd");
-        if (type.equals("plan")) {
+        if ("plan".equals(type)) {
             if (wildcard.contains("{{日期}}")) {
                 wildcard = wildcard.replace("{{日期}}", nowDate);
             } else {

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouStrategyTargetBaseServiceImpl.java

@@ -21,7 +21,7 @@ public class AiKuaishouStrategyTargetBaseServiceImpl extends ServiceImpl<AiKuais
     @Override
     public List<AiKuaishouStrategyTargetBase> listByType(String testDirection) {
         QueryWrapper<AiKuaishouStrategyTargetBase>queryWrapper =new QueryWrapper<>();
-        if(null!=testDirection&&!testDirection.trim().equals("")){
+        if(null!=testDirection&&!"".equals(testDirection.trim())){
             queryWrapper.eq("target_type",testDirection);
         }
         queryWrapper.eq("status",1);

+ 11 - 11
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiStrategyServiceImpl.java

@@ -124,7 +124,7 @@ public class AiStrategyServiceImpl implements IAiStrategyService {
         String materialFixType = strategyTemplate.getMaterialFixType();
         Date campaignDate = new Date();
         String timestamp = DateUtils.formatDate(campaignDate,"yyyyMMddHHmmss");
-        if(scenes.equals("1")){
+        if("1".equals(scenes)){
             //素材+出价
             List<Long>getCapbids = splitCapBidByDomain(strategy.getCpaBidMin(),strategy.getCpaBidMax(),strategy.getStepSize());
             if(null == getCapbids||getCapbids.isEmpty()){
@@ -150,7 +150,7 @@ public class AiStrategyServiceImpl implements IAiStrategyService {
             // 8、根据素材和出价,两层循环 创建组和创意
             for (Long item:getCapbids) {
                 //判定素材搭配方式
-                if(null!=materialFixType&&materialFixType.trim().equals("single")){
+                if(null!=materialFixType&& "single".equals(materialFixType.trim())){
                     // 选择素材,创建创意
                     for(KuaiShouVideoGet videoItem: fullVideos){
                         //拼装广告组参数
@@ -314,7 +314,7 @@ public class AiStrategyServiceImpl implements IAiStrategyService {
             int unitCnt = 0;
             // 8、根据定向和素材,两层循环 创建组和创意
             for (AiKuaishouStrategyTargetBase item:getBases) {
-                if(null!=materialFixType&&materialFixType.trim().equals("single")){
+                if(null!=materialFixType&& "single".equals(materialFixType.trim())){
                     // 策略定向拆分数据,写入数据库
                     AiKuaishouStrategyTargetUnion targetUnion = new AiKuaishouStrategyTargetUnion(strategyMiddle.getId(),item.getId(),item.getTargetContent());
                     targetUnionService.save(targetUnion);
@@ -546,16 +546,16 @@ public class AiStrategyServiceImpl implements IAiStrategyService {
 
     private String getStragyDefDomain(AiKuaishouStrategyTemplate strategyTemplate,KuaishouStrategy strategy){
         String definitionDomain = null;
-        if (strategyTemplate.getTestDirection().equals("age")){
+        if ("age".equals(strategyTemplate.getTestDirection())){
             definitionDomain = strategy.getAgesRange();
         }
-        if (strategyTemplate.getTestDirection().equals("gender")){
+        if ("gender".equals(strategyTemplate.getTestDirection())){
             definitionDomain = strategy.getGender().toString();
         }
-        if (strategyTemplate.getTestDirection().equals("region")){
+        if ("region".equals(strategyTemplate.getTestDirection())){
             definitionDomain = strategy.getRegion();
         }
-        if (strategyTemplate.getTestDirection().equals("operation_system")){
+        if ("operation_system".equals(strategyTemplate.getTestDirection())){
             definitionDomain = strategy.getPlatformOs().toString();
         }
         return definitionDomain;
@@ -606,28 +606,28 @@ public class AiStrategyServiceImpl implements IAiStrategyService {
         // 设置定向内容
         JSONObject targetJsonObject = new JSONObject();
         //TODO 34
-        if (strategyTemplate.getTestDirection().equals("region")){
+        if ("region".equals(strategyTemplate.getTestDirection())){
             targetJsonObject.put("region",JSONArray.parseArray(item.getTargetContent()));
         } else {
             targetJsonObject.put("region",JSONArray.parseArray(strategy.getRegion()));
         }
 
         //TODO 5
-        if (strategyTemplate.getTestDirection().equals("age")){
+        if ("age".equals(strategyTemplate.getTestDirection())){
             targetJsonObject.put("ages_range",JSONArray.parseArray(item.getTargetContent()));
         } else{
             targetJsonObject.put("ages_range",JSONArray.parseArray(strategy.getAgesRange()));
         }
 
         //TODO 3
-        if (strategyTemplate.getTestDirection().equals("gender")){
+        if ("gender".equals(strategyTemplate.getTestDirection())){
             targetJsonObject.put("gender",item.getTargetContent());
         } else {
             targetJsonObject.put("gender",strategy.getGender());
         }
 
         //TODO
-        if (strategyTemplate.getTestDirection().equals("operation_system")){
+        if ("operation_system".equals(strategyTemplate.getTestDirection())){
             targetJsonObject.put("platform_os",item.getTargetContent());
         } else {
             targetJsonObject.put("platform_os",strategy.getPlatformOs());

+ 2 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaishouAppPackageServiceImpl.java

@@ -84,9 +84,9 @@ public class KuaishouAppPackageServiceImpl extends ServiceImpl<KuaishouAppPackag
         Workbook workbook = null;
         String fileName = file.getOriginalFilename();
         String substring = fileName.substring(fileName.lastIndexOf(".") + 1).toUpperCase();
-        if (substring.equals("XLS")) {
+        if ("XLS".equals(substring)) {
             workbook = new HSSFWorkbook(file.getInputStream());
-        } else if (substring.equals("XLSX")) {
+        } else if ("XLSX".equals(substring)) {
             workbook = new XSSFWorkbook(file.getInputStream());
         } else {
             throw new Exception("文件不是Excel文件");

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouVideoGetServiceImpl.java

@@ -163,7 +163,7 @@ public class KuaiShouVideoGetServiceImpl extends ServiceImpl<KuaiShouVideoGetMap
             queryWrapper.eq("channel_type", channelType);
         }
 
-        if (null != appVersion && !appVersion.trim().equals("")) {
+        if (null != appVersion && !"".equals(appVersion.trim())) {
             queryWrapper.likeRight("photo_name", appVersion);
         }
         if (null != videoCnt && videoCnt != 0) {

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -967,7 +967,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     }
 
                 } else {
-                    if (code == 400001 && resultJson.getString("message").equals("/rest/openapi/v2/ad_unit/create调用已超日限,次日可恢复调用")) {
+                    if (code == 400001 && "/rest/openapi/v2/ad_unit/create调用已超日限,次日可恢复调用".equals(resultJson.getString("message"))) {
                         String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
                         String key = advertiserId + "_" + nowDate + "unit_create_overrun";
                         redisUtil.set(key, 1, 60 * 60 * 24);

+ 18 - 7
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/controller/KuaiShouAccountCleanController.java

@@ -33,15 +33,26 @@ public class KuaiShouAccountCleanController {
     }
 
     /**
+     * 根据模板名称查询
+     *
+     * @param templateName
+     * @return
+     */
+    @GetMapping("/getTemplateNameSize")
+    public Result getTemplateName(@Param("templateName")String templateName){
+        return   kuaiShouAccountCleanService.getTemplateName(templateName);
+    }
+
+    /**
      * 查询模板列表
      *
-     * @param templateId 模板id  createUser创建人  userId当前登录人id
+     * @param templateName 模板名称  createUser创建人  userId当前登录人id
      * @return
      */
     @GetMapping("/getTemplateList")
-    public Result getTemplateList(@Param("templateId")String templateId,@Param("createUser")String createUser,@Param("userId")String userId,
+    public Result getTemplateList(@Param("templateName")String templateName,@Param("createUser")String createUser,@Param("userId")String userId,
                                   @Param("pageNum")String pageNum,@Param("pageSize")String pageSize  ){
-        return   kuaiShouAccountCleanService.getTemplateList(templateId,createUser,userId,pageNum,pageSize);
+        return   kuaiShouAccountCleanService.getTemplateList(templateName,createUser,userId,pageNum,pageSize);
     }
 
     /**
@@ -117,17 +128,17 @@ public class KuaiShouAccountCleanController {
     /**
      * 查询清理记录
      *
-     * @param userName 运营名称  accountId 账户id
+     * @param templateId 模板名称  userId 账户id
      * @return
      */
     @GetMapping("/getCleanUpLog")
-    public Result getCleanUpLog(@Param("userName")String userName,@Param("accountId")String accountId,
+    public Result getCleanUpLog(@Param("templateId")String templateId,@Param("userId")String userId,
                                   @Param("pageNum")String pageNum,@Param("pageSize")String pageSize  ){
-        return   kuaiShouAccountCleanService.getCleanUpLog(userName,accountId,pageNum,pageSize);
+        return   kuaiShouAccountCleanService.getCleanUpLog(templateId,userId,pageNum,pageSize);
     }
 
     /**
-     * 查询清理记录
+     * 执行清理计划
      *
      * @param
      * @return

+ 4 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/entity/KuaiShouAccountCleanLogInfo.java

@@ -8,6 +8,10 @@ public class KuaiShouAccountCleanLogInfo {
     private  String id;
     //账户id
     private  String accountId;
+    //账户id
+    private  String templateId;
+    //账户id
+    private  String createTemplateId;
     //运营
     private  String userName;
     //操作类型  1-投放、2-暂停、3-删除

+ 7 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/KuaishouAccountCleanTemplateMapper.java

@@ -19,7 +19,7 @@ public interface KuaishouAccountCleanTemplateMapper {
     //创建模板
      void saveAccountCleanTemplate(KuaiShouAccountCleanTemplateInfo kuaiShouAccountCleanTemplateInfo);
     //根据id 创建人查询模板列表
-    List<KuaiShouAccountCleanTemplateInfo> getTemplateList(@Param("templateId")String templateId, @Param("createUser")String createUser, @Param("createId")String createId);
+    List<KuaiShouAccountCleanTemplateInfo> getTemplateList(@Param("templateName")String templateName, @Param("createUser")String createUser, @Param("createId")String createId);
     //根据id查询数据
     KuaiShouAccountCleanTemplateInfo getInfoById(@Param("templateId")String templateId);
     //查询账户关联模板个数
@@ -33,7 +33,7 @@ public interface KuaishouAccountCleanTemplateMapper {
     //根据id和accountId 删除关联表信息
     void removeBinding(@Param("templateId")String templateId,@Param("accountId")String accountId);
     //查询清理日志记录
-    List<KuaiShouAccountCleanLogInfo> getCleanUpLog(@Param("userName")String userName, @Param("accountId")String accountId);
+    List<KuaiShouAccountCleanLogInfo> getCleanUpLog(@Param("templateId")String templateId, @Param("userId")String userId);
 
     //根据账户id 运营名称 查询个人模板信息
     List<KuaiShouAccountCleanTemplateInfo> getMyselfTemplateList(@Param("accountId")String accountId, @Param("userName")String userName, @Param("createId")String createId);
@@ -47,4 +47,9 @@ public interface KuaishouAccountCleanTemplateMapper {
 
     Map<String,String> getUserNameByAccountId(@Param("accountId")String accountId);
 
+    String getUserRealName(@Param("userId")String userId);
+    /**
+     * 根据模板名称查询
+     */
+    int getTemplateName(@Param("templateName")String templateName);
 }

+ 176 - 164
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/mapper/xml/KuaishouAccountCleanTemplateMapper.xml

@@ -2,71 +2,75 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.kuaishou.modules.clean.mapper.KuaishouAccountCleanTemplateMapper">
 
-  <resultMap id="templateResultMap" type="cn.com.ctop.kuaishou.modules.clean.entity.KuaiShouAccountCleanTemplateInfo">
-    <id column="id" property="id"/>
-    <result column="template_name" property="templateName"/>
-    <result column="applied_media" property="appliedMedia"/>
-    <result column="clean_time" property="cleanTime"/>
-    <result column="optimization_objective" property="optimizationObjective"/>
-    <result column="charge" property="charge"/>
-    <result column="conversion" property="conversion"/>
-    <result column="promotion_group_status" property="promotionGroupStatus"/>
-    <result column="perform_operations" property="performOperations"/>
-    <result column="status" property="status"/>
-    <result column="create_user" property="createUser"/>
-    <result column="create_id" property="createId"/>
-    <result column="create_time" property="createTime"/>
-    <result column="account_id" property="accountId"/>
-    <result column="user_name" property="userName"/>
-    <result column="account_status" property="accountStatus"/>
-    <result column="account_name" property="accountName"/>
-  </resultMap>
-
-  <resultMap id="logResultMap" type="cn.com.ctop.kuaishou.modules.clean.entity.KuaiShouAccountCleanLogInfo">
-    <id column="id" property="id"/>
-    <result column="account_id" property="accountId"/>
-    <result column="user_name" property="userName"/>
-    <result column="operation_type" property="operationType"/>
-    <result column="create_time" property="createTime"/>
-    <result column="executive_information" property="executiveInformation"/>
-  </resultMap>
-  <!--保存清理模板-->
-  <insert id="saveAccountCleanTemplate" parameterType="cn.com.ctop.kuaishou.modules.clean.entity.KuaiShouAccountCleanTemplateInfo">
+    <resultMap id="templateResultMap" type="cn.com.ctop.kuaishou.modules.clean.entity.KuaiShouAccountCleanTemplateInfo">
+        <id column="id" property="id"/>
+        <result column="template_name" property="templateName"/>
+        <result column="applied_media" property="appliedMedia"/>
+        <result column="clean_time" property="cleanTime"/>
+        <result column="optimization_objective" property="optimizationObjective"/>
+        <result column="charge" property="charge"/>
+        <result column="conversion" property="conversion"/>
+        <result column="promotion_group_status" property="promotionGroupStatus"/>
+        <result column="perform_operations" property="performOperations"/>
+        <result column="status" property="status"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_id" property="createId"/>
+        <result column="create_time" property="createTime"/>
+        <result column="account_id" property="accountId"/>
+        <result column="user_name" property="userName"/>
+        <result column="account_status" property="accountStatus"/>
+        <result column="account_name" property="accountName"/>
+    </resultMap>
+
+    <resultMap id="logResultMap" type="cn.com.ctop.kuaishou.modules.clean.entity.KuaiShouAccountCleanLogInfo">
+        <id column="id" property="id"/>
+        <result column="account_id" property="accountId"/>
+        <result column="template_id" property="templateId"/>
+        <result column="create_template_id" property="createTemplateId"/>
+        <result column="user_name" property="userName"/>
+        <result column="operation_type" property="operationType"/>
+        <result column="create_time" property="createTime"/>
+        <result column="executive_information" property="executiveInformation"/>
+    </resultMap>
+    <!--保存清理模板-->
+    <insert id="saveAccountCleanTemplate"
+            parameterType="cn.com.ctop.kuaishou.modules.clean.entity.KuaiShouAccountCleanTemplateInfo">
     insert into ctop_kuaishou_account_clean_template values (#{id},#{templateName},#{appliedMedia},#{cleanTime},#{optimizationObjective},#{charge},
     #{conversion},#{performOperations},#{promotionGroupStatus},#{status},#{createUser},#{createId},#{createTime})
   </insert>
 
-  <!--根据创建人查询模板-->
-  <select id="getTemplateList" resultMap="templateResultMap" >
-    select t.id,t.template_name,t.applied_media,t.create_user  from ctop_kuaishou_account_clean_template t
-    <where>
-      <if test="templateId!=null and templateId!=''">
-         t.id=#{templateId}
-      </if >
-
-      <if test="createUser!=null and createUser!=''">
-        and t.create_user=#{createUser}
-      </if >
-      <if test="createId!=null and createId!=''">
-        and t.create_id=#{createId}
-      </if >
-    </where>
-  </select>
-
-   <select id="getInfoById" parameterType="String" resultMap="templateResultMap">
+    <!--根据创建人查询模板-->
+    <select id="getTemplateList" resultMap="templateResultMap">
+        select t.id,t.template_name,t.applied_media,t.create_user from ctop_kuaishou_account_clean_template t
+        <where>
+            <if test="templateName!=null and templateName!=''">
+                t.template_name like CONCAT(CONCAT('%', #{templateName}), '%')
+            </if>
+
+            <if test="createUser!=null and createUser!=''">
+                and t.create_user=#{createUser}
+            </if>
+            <if test="createId!=null and createId!=''">
+                and t.create_id=#{createId}
+            </if>
+        </where>
+        order by create_time desc
+    </select>
+
+    <select id="getInfoById" parameterType="String" resultMap="templateResultMap">
       select  t.id,t.template_name,t.clean_time,t.optimization_objective,t.charge,t.conversion,t.promotion_group_status,t.perform_operations  from ctop_kuaishou_account_clean_template t
       where t.id=#{templateId}
    </select>
 
-  <select id="getAccountAssociatedSize" resultType="int">
+    <select id="getAccountAssociatedSize" resultType="int">
         select count(*) from ctop_kuaishou_account_clean_center where account_id=#{accountId}
   </select>
 
-  <insert id="savePushTemplateAssociated" >
+    <insert id="savePushTemplateAssociated">
     insert into ctop_kuaishou_account_clean_center (account_id,template_id,create_time)values (#{accountId},#{templateId},#{createTime})
   </insert>
 
-  <update id="updateTemplate" >
+    <update id="updateTemplate">
     update ctop_kuaishou_account_clean_template set
     template_name=#{templateName},clean_time=#{cleanTime},
     optimization_objective=#{optimizationObjective},charge=#{charge},
@@ -74,139 +78,147 @@
     perform_operations=#{performOperations}
     where id=#{id}
   </update>
-  <update id="updateTemplateStatus" >
+    <update id="updateTemplateStatus">
     update ctop_kuaishou_account_clean_template set status=#{status}
     where id=#{templateId}
   </update>
 
-  <delete id="removeBinding">
+    <delete id="removeBinding">
     delete  from ctop_kuaishou_account_clean_center where account_id=#{accountId} and template_id=#{templateId}
   </delete>
 
-  <select id="getCleanUpLog" parameterType="cn.com.ctop.kuaishou.modules.clean.entity.KuaiShouAccountCleanLogInfo" resultMap="logResultMap">
-    select *  from  ctop_kuaishou_account_clean_logs t
-    <where>
-      <if test="accountId!=null and accountId!=''">
-        t.account_id=#{accountId}
-      </if >
-
-      <if test="userName!=null and userName!=''">
-        and t.user_name like concat('%',#{userName},'%')
-      </if >
-    </where>
-  </select>
-
-
-
-
-  <!--根据账户id 运营名称 查询个人模板信息-->
-  <select id="getMyselfTemplateList" resultMap="templateResultMap" >
-    select t.status,t.id,t.template_name,t.applied_media,t2.account_id,t3.auth_name as account_name,t3.account_status,t3.user_name from ctop_kuaishou_account_clean_template t
-    LEFT JOIN ctop_kuaishou_account_clean_center t2 on t.id=t2.template_id
-    LEFT JOIN ctop_user_allocation t3 on t2.account_id=t3.account_id
-    <where>
-        t2.account_id is not null
-      <if test="accountId!=null and accountId!=''">
-        and t2.account_id=#{accountId}
-      </if >
-
-      <if test="userName!=null and userName!=''">
-        and t3.user_name like concat('%',#{userName},'%')
-      </if >
-      <if test="createId!=null and createId!=''">
-        and t.create_id=#{createId}
-      </if >
-    </where>
-
-  </select>
-
-  <select id="getTemplateListBystatus" resultMap="templateResultMap">
+    <select id="getCleanUpLog" parameterType="cn.com.ctop.kuaishou.modules.clean.entity.KuaiShouAccountCleanLogInfo"
+            resultMap="logResultMap">
+        select * from ctop_kuaishou_account_clean_logs t
+        <where>
+            <if test="templateId!=null and templateId!=''">
+                t.template_id=#{templateId}
+            </if>
+
+            <if test="userId!=null and userId!=''">
+                and t.create_template_id =#{userId}
+            </if>
+        </where>
+    </select>
+
+
+    <!--根据账户id 运营名称 查询个人模板信息-->
+    <select id="getMyselfTemplateList" resultMap="templateResultMap">
+        select t.status,t.id,t.template_name,t.applied_media,t2.account_id,t3.auth_name as
+        account_name,t3.account_status,t.create_user as 'user_name' from ctop_kuaishou_account_clean_template t
+        LEFT JOIN ctop_kuaishou_account_clean_center t2 on t.id=t2.template_id
+        LEFT JOIN ctop_user_allocation t3 on t2.account_id=t3.account_id
+        <where>
+            t2.account_id is not null
+            <if test="accountId!=null and accountId!=''">
+                and t2.account_id=#{accountId}
+            </if>
+
+            <if test="userName!=null and userName!=''">
+                and t3.user_name like concat('%',#{userName},'%')
+            </if>
+            <if test="createId!=null and createId!=''">
+                and t.create_id=#{createId}
+            </if>
+        </where>
+
+    </select>
+
+    <select id="getTemplateListBystatus" resultMap="templateResultMap">
        select  t.id,t.template_name,t.clean_time,t.optimization_objective,t.charge,t.conversion,t.promotion_group_status,t.perform_operations,t2.account_id  from ctop_kuaishou_account_clean_template t
        left join  ctop_kuaishou_account_clean_center t2 on t.id=t2.template_id where t.status='0'
   </select>
 
-  <select id="getGroupMessage" resultType="java.lang.String">
+    <select id="getGroupMessage" resultType="java.lang.String">
 
-      SELECT t.unit_id from ctop_kuaishou_group  t  LEFT JOIN ctop_kuaishou_report_daily_group  t2
+        SELECT t.unit_id from ctop_kuaishou_group t LEFT JOIN ctop_kuaishou_report_daily_group t2
         on t.unit_id=t2.unit_id
         where t.account_id=#{template.accountId}
         and t.group_create_time &lt;= #{startDate}
         and t2.stat_date &gt;= #{startDate}
-       <if test="template.promotionGroupStatus!=null and template.promotionGroupStatus!='' and template.promotionGroupStatus!='3'">
-          and t.put_status=#{template.promotionGroupStatus}
-       </if >
-         group by t.unit_id
+        <if test="template.promotionGroupStatus!=null and template.promotionGroupStatus!='' and template.promotionGroupStatus!='3'">
+            and t.put_status=#{template.promotionGroupStatus}
+        </if>
+        group by t.unit_id
         having sum(t2.charge) &lt;= #{template.charge}
-      <foreach item="item" index="index" collection="list"  open="and (" separator="or" close=")">
-
-          <if test='item=="activation"'>
-              /* 激活数*/
-              sum(t2.activation) &lt; #{template.conversion}
-          </if >
-
-          <if test='item=="bclick"'>
-              /*行为数*/
-              sum(t2.bclick) &lt; #{template.conversion}
-          </if >
-
-          <if test='item=="formSize"'>
-              /*表单数*/
-              sum(t2.form_count) &lt; #{template.conversion}
-          </if >
-
-          <if test='item=="pay"'>
-              /*付费数*/
-              sum(t2.event_pay) &lt; #{template.conversion}
-          </if >
-
-          <if test='item=="roi"'>
-              /*首日roi*/
-              sum(t2.event_pay_first_day_roi) &lt; #{template.conversion}
-          </if >
-
-          <if test='item=="evocativeApplication"'>
-              /*唤起应用*/
-              sum(t2.event_app_invoked) &lt; #{template.conversion}
-          </if >
-
-          <if test='item=="effectiveClues"'>
-              /*落地页有效线索*/
-              sum(t2.event_valid_clues) &lt; #{template.conversion}
-          </if >
-
-          <if test='item=="creditApp"'>
-              /*授信数APP*/
-              sum(t2.event_credit_grant_app) &lt; #{template.conversion}
-          </if >
-
-          <if test='item=="creditGrant"'>
-              /*落地页授信数*/
-              sum(t2.event_credit_grant_landing_page) &lt; #{template.conversion}
-          </if >
-
-          <if test='item=="finishedPieceApp"'>
-              /*完件数App*/
-              sum(t2.event_jin_jian_app) &lt; #{template.conversion}
-          </if >
-
-          <if test='item=="finishedPieceGrant"'>
-              /*落地页完件数*/
-              sum(t2.event_jin_jian_landing_page) &lt; #{template.conversion}
-          </if >
-
-          <if test='item=="registered"'>
-              /*注册*/
-              sum(t2.event_register) &lt; #{template.conversion}
-          </if >
-      </foreach>
-
-  </select>
-
-  <select id="getUserNameByAccountId" resultType="Map">
+        <foreach item="item" index="index" collection="list" open="and (" separator="or" close=")">
+
+            <if test='item=="activation"'>
+                /* 激活数*/
+                sum(t2.activation) &lt; #{template.conversion}
+            </if>
+
+            <if test='item=="bclick"'>
+                /*行为数*/
+                sum(t2.bclick) &lt; #{template.conversion}
+            </if>
+
+            <if test='item=="formSize"'>
+                /*表单数*/
+                sum(t2.form_count) &lt; #{template.conversion}
+            </if>
+
+            <if test='item=="pay"'>
+                /*付费数*/
+                sum(t2.event_pay) &lt; #{template.conversion}
+            </if>
+
+            <if test='item=="roi"'>
+                /*首日roi*/
+                sum(t2.event_pay_first_day_roi) &lt; #{template.conversion}
+            </if>
+
+            <if test='item=="evocativeApplication"'>
+                /*唤起应用*/
+                sum(t2.event_app_invoked) &lt; #{template.conversion}
+            </if>
+
+            <if test='item=="effectiveClues"'>
+                /*落地页有效线索*/
+                sum(t2.event_valid_clues) &lt; #{template.conversion}
+            </if>
+
+            <if test='item=="creditApp"'>
+                /*授信数APP*/
+                sum(t2.event_credit_grant_app) &lt; #{template.conversion}
+            </if>
+
+            <if test='item=="creditGrant"'>
+                /*落地页授信数*/
+                sum(t2.event_credit_grant_landing_page) &lt; #{template.conversion}
+            </if>
+
+            <if test='item=="finishedPieceApp"'>
+                /*完件数App*/
+                sum(t2.event_jin_jian_app) &lt; #{template.conversion}
+            </if>
+
+            <if test='item=="finishedPieceGrant"'>
+                /*落地页完件数*/
+                sum(t2.event_jin_jian_landing_page) &lt; #{template.conversion}
+            </if>
+
+            <if test='item=="registered"'>
+                /*注册*/
+                sum(t2.event_register) &lt; #{template.conversion}
+            </if>
+        </foreach>
+
+    </select>
+
+    <select id="getUserNameByAccountId" resultType="Map">
        select t.user_name as userName,t.auth_name as authName from ctop_user_allocation t where t.account_id=#{accountId}
   </select>
 
-  <insert id="saveCleamLog" >
+    <insert id="saveCleamLog">
     insert into ctop_kuaishou_account_clean_logs (account_id,user_name,operation_type,create_time,executive_information) values (#{accountId},#{userName},#{operationType},#{createTime},#{executiveInformation})
   </insert>
+
+    <select id="getUserRealName" resultType="String">
+        select t.realname from sys_user t where t.id=#{userId}
+    </select>
+
+    <select id="getTemplateName" parameterType="String" resultType="int">
+         select count(*) from ctop_kuaishou_account_clean_template t  where t.template_name=#{templateName}
+    </select>
 </mapper>

+ 9 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/service/KuaiShouAccountCleanService.java

@@ -61,10 +61,10 @@ public interface KuaiShouAccountCleanService {
     /**
      * 查询清理记录
      *
-     * @param userName 运营名称  accountId 账户id
+     * @param templateId 模板名称  userId 账户id
      * @return
      */
-    Result getCleanUpLog(String userName, String accountId, String pageNum, String pageSize);
+    Result getCleanUpLog(String templateId, String userId, String pageNum, String pageSize);
     /**
      * 查询个人清理模板列表
      *
@@ -81,4 +81,11 @@ public interface KuaiShouAccountCleanService {
      * @return
      */
     Result cleanAccount();
+    /**
+     * 根据模板名称查询
+     *
+     * @param templateName
+     * @return
+     */
+    Result getTemplateName(String templateName);
 }

+ 99 - 66
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/clean/service/impl/KuaiShouAccountCleanServiceImpl.java

@@ -53,6 +53,7 @@ public class KuaiShouAccountCleanServiceImpl implements KuaiShouAccountCleanServ
         SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
         Random rand = new Random();
         int id = 100000 + rand.nextInt(99900000);
+
         //设置6-8位数字
         kuaiShouAccountCleanTemplateInfo.setId(String.valueOf(id));
         //设置应用媒体 固定写死
@@ -62,6 +63,8 @@ public class KuaiShouAccountCleanServiceImpl implements KuaiShouAccountCleanServ
         //设置创建日期
         kuaiShouAccountCleanTemplateInfo.setCreateTime(sd.format(new Date()));
         try {
+            String userRealName = kuaishouAccountCleanTemplateMapper.getUserRealName(kuaiShouAccountCleanTemplateInfo.getCreateId());
+            kuaiShouAccountCleanTemplateInfo.setCreateUser(userRealName);
             kuaishouAccountCleanTemplateMapper.saveAccountCleanTemplate(kuaiShouAccountCleanTemplateInfo);
             result.success("创建模板成功");
         } catch (Exception e) {
@@ -74,11 +77,11 @@ public class KuaiShouAccountCleanServiceImpl implements KuaiShouAccountCleanServ
     /**
      * 查询模板列表
      *
-     * @param templateId 模板id  createUser创建人
+     * @param templateName 模板名称  createUser创建人
      * @return
      */
     @Override
-    public Result getTemplateList(String templateId, String createUser, String userId, String pageNum, String pageSize) {
+    public Result getTemplateList(String templateName, String createUser, String userId, String pageNum, String pageSize) {
         Result result = new Result();
         PageHelper pageHelper = new PageHelper();
         List<KuaiShouAccountCleanTemplateInfo> templateList = new ArrayList<>();
@@ -88,10 +91,10 @@ public class KuaiShouAccountCleanServiceImpl implements KuaiShouAccountCleanServ
             PageHelper.startPage(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
             if (roleCode != null && roleCode.equals("admin")) {
                 //管理员查询全部
-                templateList = kuaishouAccountCleanTemplateMapper.getTemplateList(templateId, createUser, null);
+                templateList = kuaishouAccountCleanTemplateMapper.getTemplateList(templateName, createUser, null);
             } else {
                 //其他角色查询自己拥有的
-                templateList = kuaishouAccountCleanTemplateMapper.getTemplateList(templateId, createUser, userId);
+                templateList = kuaishouAccountCleanTemplateMapper.getTemplateList(templateName, createUser, userId);
             }
             PageInfo pageInfo = new PageInfo(templateList);
             result.success("查询成功");
@@ -222,11 +225,20 @@ public class KuaiShouAccountCleanServiceImpl implements KuaiShouAccountCleanServ
     }
 
     @Override
-    public Result getCleanUpLog(String userName, String accountId, String pageNum, String pageSize) {
+    public Result getCleanUpLog(String templateId, String userId, String pageNum, String pageSize) {
         Result result = new Result();
+        List<KuaiShouAccountCleanLogInfo> cleanUpLog=new ArrayList<>();
         try {
+            //查询当前登录人角色
+            String roleCode = sysRoleService.getRoleCodeByUserId(userId);
             PageHelper.startPage(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
-            List<KuaiShouAccountCleanLogInfo> cleanUpLog = kuaishouAccountCleanTemplateMapper.getCleanUpLog(userName, accountId);
+            if (roleCode != null && roleCode.equals("admin")) {
+                cleanUpLog = kuaishouAccountCleanTemplateMapper.getCleanUpLog(templateId, null);
+            }else {
+                cleanUpLog = kuaishouAccountCleanTemplateMapper.getCleanUpLog(templateId, userId);
+            }
+            PageHelper.startPage(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
+
             PageInfo pageInfo = new PageInfo(cleanUpLog);
             result.success("查询成功");
             result.setResult(pageInfo);
@@ -284,74 +296,95 @@ public class KuaiShouAccountCleanServiceImpl implements KuaiShouAccountCleanServ
             List<KuaiShouAccountCleanTemplateInfo> templateListBystatus = kuaishouAccountCleanTemplateMapper.getTemplateListBystatus();
             if (!templateListBystatus.isEmpty()) {
                 templateListBystatus.stream().forEach(ob -> {
-                    //获取各项优化目标
-                    List<String> optimizationObjectiveList = Arrays.asList(ob.getOptimizationObjective().split(";"));
-                    //获取清理时间范围
-                    String cleanTime = ob.getCleanTime();
-                    //计算最早清理时间
-                    Calendar calendar = Calendar.getInstance();//此时打印它获取的是系统当前时间
-                    calendar.add(Calendar.DATE, -Integer.parseInt(cleanTime));
-                    String startDate = new SimpleDateFormat("yyyy-MM-dd").format(calendar.getTime());
-                    //查询符合模板规则的组
-                    List<String> groupMessage = kuaishouAccountCleanTemplateMapper.getGroupMessage(ob, optimizationObjectiveList, startDate);
-                    AtomicReference<Boolean> falg = new AtomicReference<>(true);
-                    if (!groupMessage.isEmpty()) {
-                        //获取Token
-                        CtopOauthToken ctopOauthToken = ctopOauthTokenMapper.selectByAccountId(Long.parseLong(ob.getAccountId()));
-                        if (ctopOauthToken != null) {
-                            groupMessage.stream().forEach(item -> {
-                                //修改广告组状态
-                                Map<String, Object> resultMap = iKuaiShouUpdateService.updateUnitStatus(ctopOauthToken.getAccessToken(), Long.parseLong(ob.getAccountId()), Long.parseLong(item), Integer.parseInt(ob.getPerformOperations()), null);
-                                Boolean resultFlag = (Boolean) resultMap.get("success");
-                                //判断有没有失败
-                                if (!resultFlag) {
-                                    falg.set(false);
-                                }
-                            });
+                    if(ob.getAccountId()!=null){
+                        //获取各项优化目标
+                        List<String> optimizationObjectiveList = Arrays.asList(ob.getOptimizationObjective().split(";"));
+                        //获取清理时间范围
+                        String cleanTime = ob.getCleanTime();
+                        //计算最早清理时间
+                        Calendar calendar = Calendar.getInstance();//此时打印它获取的是系统当前时间
+                        calendar.add(Calendar.DATE, -Integer.parseInt(cleanTime));
+                        String startDate = new SimpleDateFormat("yyyy-MM-dd").format(calendar.getTime());
+                        //查询符合模板规则的组
+                        List<String> groupMessage = kuaishouAccountCleanTemplateMapper.getGroupMessage(ob, optimizationObjectiveList, startDate);
+                        AtomicReference<Boolean> falg = new AtomicReference<>(true);
+                        if (!groupMessage.isEmpty()) {
+                            //获取Token
+                            CtopOauthToken ctopOauthToken = ctopOauthTokenMapper.selectByAccountId(Long.parseLong(ob.getAccountId()));
+                            if (ctopOauthToken != null) {
+                                groupMessage.stream().forEach(item -> {
+                                    //修改广告组状态
+                                    Map<String, Object> resultMap = iKuaiShouUpdateService.updateUnitStatus(ctopOauthToken.getAccessToken(), Long.parseLong(ob.getAccountId()), Long.parseLong(item), Integer.parseInt(ob.getPerformOperations()), null);
+                                    Boolean resultFlag = (Boolean) resultMap.get("success");
+                                    //判断有没有失败
+                                    if (!resultFlag) {
+                                        falg.set(false);
+                                    }
+                                });
 
+                            }
                         }
-                    }
-                    if (!groupMessage.isEmpty() && falg.get()) {
-                        //修改成功插入日志记录
-                        KuaiShouAccountCleanLogInfo kuaiShouAccountCleanLogInfo = new KuaiShouAccountCleanLogInfo();
-                        //设置账户id
-                        kuaiShouAccountCleanLogInfo.setAccountId(ob.getAccountId());
-                        // 1-投放、2-暂停、3-删除
-                        kuaiShouAccountCleanLogInfo.setOperationType(ob.getPerformOperations());
-                        //设置运营
-                        Map<String, String> map = kuaishouAccountCleanTemplateMapper.getUserNameByAccountId(ob.getAccountId());
-                        String authName = "";
-                        if (map != null) {
-                            kuaiShouAccountCleanLogInfo.setUserName(map.get("userName"));
-                            authName = map.get("authName");
-                        }
-                        //设置时间
-                        kuaiShouAccountCleanLogInfo.setCreateTime(sd.format(new Date()));
-                        StringBuilder unitIds = new StringBuilder();
-                        groupMessage.stream().forEach(unid -> {
-                            unitIds.append(unid).append(",");
-                        });
-                        //操作类型
-                        String operationType = null;
-                        if (ob.getPerformOperations().equals("2")) {
-                            operationType = "暂停";
-                        }
-                        if (ob.getPerformOperations().equals("3")) {
-                            operationType = "删除";
+                        if (!groupMessage.isEmpty() && falg.get()) {
+                            //修改成功插入日志记录
+                            KuaiShouAccountCleanLogInfo kuaiShouAccountCleanLogInfo = new KuaiShouAccountCleanLogInfo();
+                            //设置账户id
+                            kuaiShouAccountCleanLogInfo.setAccountId(ob.getAccountId());
+                            // 1-投放、2-暂停、3-删除
+                            kuaiShouAccountCleanLogInfo.setOperationType(ob.getPerformOperations());
+                            //设置运营
+                            Map<String, String> map = kuaishouAccountCleanTemplateMapper.getUserNameByAccountId(ob.getAccountId());
+                            String authName = "";
+                            if (map != null) {
+                                kuaiShouAccountCleanLogInfo.setUserName(map.get("userName"));
+                                authName = map.get("authName");
+                            }
+                            //设置时间
+                            kuaiShouAccountCleanLogInfo.setCreateTime(sd.format(new Date()));
+                            StringBuilder unitIds = new StringBuilder();
+                            groupMessage.stream().forEach(unid -> {
+                                unitIds.append(unid).append(",");
+                            });
+                            //操作类型
+                            String operationType = null;
+                            if (ob.getPerformOperations().equals("2")) {
+                                operationType = "暂停";
+                            }
+                            if (ob.getPerformOperations().equals("3")) {
+                                operationType = "删除";
+                            }
+                            //执行信息
+                            String textMessage = "清理规则执行:  账户:" + ob.getAccountId() + ", 授权名称: " + authName + ",推广组:" + unitIds + "已经被清理规则" + operationType;
+                            kuaiShouAccountCleanLogInfo.setExecutiveInformation(textMessage);
+                            kuaiShouAccountCleanLogInfo.setTemplateId(ob.getId());
+                            kuaiShouAccountCleanLogInfo.setCreateTemplateId(ob.getCreateId());
+                            kuaishouAccountCleanTemplateMapper.saveCleamLog(kuaiShouAccountCleanLogInfo);
                         }
-                        //执行信息
-                        String textMessage = "清理规则执行:  账户:" + ob.getAccountId() + ", 授权名称: " + authName + ",推广组:" + unitIds + "已经被清理规则" + operationType;
-                        kuaiShouAccountCleanLogInfo.setExecutiveInformation(textMessage);
-                        kuaishouAccountCleanTemplateMapper.saveCleamLog(kuaiShouAccountCleanLogInfo);
                     }
-
                 });
             }
 
-            result.success("修改成功");
+            result.success("执行计划成功");
         } catch (Exception e) {
-            log.info("修改失败:{}", e.toString());
-            result.error500("修改失败");
+            log.info("执行计划失败:{}", e.toString());
+            result.error500("执行计划失败");
+        }
+        return result;
+    }
+    /**
+     * 根据模板名称查询
+     *
+     * @param templateName
+     * @return
+     */
+    @Override
+    public Result getTemplateName(String templateName) {
+        Result result = new Result();
+        try {
+            int number = kuaishouAccountCleanTemplateMapper.getTemplateName(templateName);
+            result.setResult(number);
+        }catch (Exception e){
+            log.info("查询失败:{}", e.toString());
+            result.error500("查询失败");
         }
         return result;
     }

+ 2 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/dimension/controller/KuaiShouDimensionStrategyController.java

@@ -93,7 +93,7 @@ public class KuaiShouDimensionStrategyController {
             KuaiShouDimensionStrategy one = kuaiShouDimensionStrategyService.getOne(dimensionStrategyQueryWrapper);
             Boolean trueOrFalse = false;
             if (!Check.isNull(one)) {
-                if (one.getId() != id) {
+                if (!one.getId().equals(id)) {
                     trueOrFalse = true;
                 }
 
@@ -186,7 +186,7 @@ public class KuaiShouDimensionStrategyController {
         queryWrapper.orderByDesc("create_time");
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String roleCode = sysRoleService.getRoleCodeByUserId(sysUser.getId());
-        if (!roleCode.equals("admin")) {
+        if (!"admin".equals(roleCode)) {
             queryWrapper.eq("user_id", sysUser.getId());
         }
 

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/dimension/service/impl/KuaiShouDimensionStrategyServiceImpl.java

@@ -412,7 +412,7 @@ public class KuaiShouDimensionStrategyServiceImpl extends ServiceImpl<KuaiShouDi
                     String intention_target = variableJson.getString("intention_target");
                     if (!Check.isNull(intention_target)) {
                         if (!"unlimited".equals(intention_target)) {
-                            if (intention_target.equals("1")) {
+                            if ("1".equals(intention_target)) {
                                 unit.setIntentionTarget(true);
                             } else {
                                 unit.setIntentionTarget(false);

+ 36 - 8
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/label/controller/LbelController.java

@@ -1,12 +1,14 @@
 package cn.com.ctop.kuaishou.modules.label.controller;
 
-import cn.com.ctop.kuaishou.modules.clean.entity.KuaiShouAccountCleanTemplateInfo;
+import cn.com.ctop.kuaishou.modules.label.service.MaterialLabelService;
+import org.apache.ibatis.annotations.Param;
 import org.jeecg.common.api.vo.Result;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
+
 /**
  * @Description: 标签管理
  * @Author: zzy
@@ -17,14 +19,40 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/label")
 public class LbelController {
 
+
+    @Resource
+    MaterialLabelService materialTagService;
+
+    /**
+     * 查询所有指标数据
+     *
+     * @param
+     * @return
+     */
+    @GetMapping("/filterMaterial")
+    public Result createCleanTemplate(@Param("type") String type) {
+        return materialTagService.filterMaterial(type);
+    }
+
+    /**
+     * 根据指标数据打标签
+     *
+     * @param
+     * @return
+     */
+    @GetMapping("/materialSpecificationLabel")
+    public Result materialSpecificationLabel(@Param("type") String type) {
+        return materialTagService.materialSpecificationLabel(type);
+    }
+
     /**
-     * 查询标签
+     * 同步标签到ES
      *
-     * @param kuaiShouAccountCleanTemplateInfo
+     * @param
      * @return
      */
-    @PostMapping("/createTemplate")
-    public Result createCleanTemplate(@RequestBody KuaiShouAccountCleanTemplateInfo kuaiShouAccountCleanTemplateInfo){
-        return   null;
+    @GetMapping("/SynchronousLabel")
+    public Result SynchronousLabel(@Param("type") String type) {
+        return materialTagService.SynchronousLabel(type);
     }
 }

+ 34 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/label/entity/LabelStandardInfo.java

@@ -0,0 +1,34 @@
+package cn.com.ctop.kuaishou.modules.label.entity;
+
+import lombok.Data;
+
+@Data
+public class LabelStandardInfo {
+    //主键
+    private String id;
+    //素材标识
+    private String signature;
+    //素材产生消耗的最早日期
+    private String chargeDate;
+    //三十天内累计激活数
+    private String activationThirtyDays;
+    //两天内累计激活数
+    private String activationTwoDays;
+    //30天内表单提交数
+    private String formCountThirtyDays;
+    //两天内表单提交数
+    private String formCountTwoDays;
+    //30天内3s完播率
+    private String play3sRatio;
+    //30天内转化率
+    private String conversionRatio;
+    //30天内行为率
+    private String behaviorRation;
+    //30天内次留率
+    private String eventNextDayStayRatio;
+    //创建时间
+    private String createTime;
+    //更新时间
+    private String updateTime;
+
+}

+ 62 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/label/entity/MaterialLabelInfo.java

@@ -0,0 +1,62 @@
+package cn.com.ctop.kuaishou.modules.label.entity;
+
+
+import lombok.Data;
+import org.jeecg.common.aspect.annotation.Document;
+import org.jeecg.common.aspect.annotation.EsId;
+import org.jeecg.common.aspect.annotation.FieId;
+import org.jeecg.common.constant.AnalyzerType;
+import org.jeecg.common.constant.FieldType;
+
+@Data
+@Document(index = "material_label", type = "material")
+public class MaterialLabelInfo {
+    @FieId(type = FieldType.KEYWORD)
+    private String id;
+
+    @EsId
+    @FieId(type = FieldType.KEYWORD)
+    private String code;
+
+    @FieId(type = FieldType.KEYWORD)
+    private String slogansCount;
+
+    @FieId(type = FieldType.KEYWORD)
+    private String offlineFlag;
+
+    @FieId(type = FieldType.KEYWORD)
+    private String confirmTime;
+
+    @FieId(type = FieldType.KEYWORD, analyzer = AnalyzerType.IK_SMART)
+    private String tagCode;
+
+    @FieId(type = FieldType.KEYWORD, analyzer = AnalyzerType.IK_SMART)
+    private String tagName;
+
+    @FieId(type = FieldType.KEYWORD)
+    private String tagId;
+
+    @FieId(type = FieldType.KEYWORD)
+    private String clipId;
+
+    @FieId(type = FieldType.KEYWORD)
+    private String shotId;
+
+    @FieId(type = FieldType.KEYWORD)
+    private String planId;
+
+    @FieId(type = FieldType.KEYWORD)
+    private String status;
+
+    @FieId(type = FieldType.KEYWORD)
+    private String userId;
+
+    @FieId(type = FieldType.KEYWORD)
+    private String materialName;
+
+    @FieId(type = FieldType.KEYWORD)
+    private String projectId;
+
+    @FieId(type = FieldType.KEYWORD)
+    private String createTime;
+}

+ 56 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/label/mapper/MaterialLabelMapper.java

@@ -1,5 +1,8 @@
 package cn.com.ctop.kuaishou.modules.label.mapper;
 
+import cn.com.ctop.common.module.entity.TagInfo;
+import cn.com.ctop.kuaishou.modules.label.entity.LabelStandardInfo;
+import cn.com.ctop.kuaishou.modules.label.entity.MaterialLabelInfo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -19,7 +22,60 @@ public interface MaterialLabelMapper {
     List<String> getMateriaSignature();
 
     /**
+     * 查询增量素材
+     */
+    List<String> getMateriaSignatureCharge(@Param("date")String date);
+
+    /**
      * 获取素材产生消耗的最早日期
      */
     String getMaterialFirstDate(@Param("signature")String signature);
+    /**
+     * 查询素材30日数据
+     */
+    LabelStandardInfo getLabermessage(@Param("signature")String signature, @Param("startDate")String startDate, @Param("endDate")String endDate);
+    /**
+     * 查询素材2日数据
+     */
+    LabelStandardInfo getLabermessageByTwoDays(@Param("signature")String signature,@Param("startDate")String startDate,@Param("endDate")String endDate);
+    /**
+     * 保存素材判断标准数据
+     */
+    void saveLabelMessage(LabelStandardInfo LabelStandardInfo);
+    /**
+     * 素材标准数据判断是否存在此素材
+     */
+    LabelStandardInfo  getMaterialRecord(@Param("signature")String signature);
+    /**
+     * 修改素材标准数据
+     */
+    void updateMaterialRecord(LabelStandardInfo LabelStandardInfo);
+    /**
+     * 查询所有标签
+     */
+    List<TagInfo> getTagInfo();
+    /**
+     * 查询所有素材标准数据
+     */
+    List<LabelStandardInfo> getAllMaterialData();
+
+    /**
+     * 查询所有素材标准数据
+     */
+    List<LabelStandardInfo> getAllMaterialDataCharge(@Param("date")String date);
+
+    /**
+     * 保存素材标签数据
+     */
+    void saveMaterialTag(@Param("code")String code,@Param("tagName")String tagName,@Param("tagCode")String tagCode,@Param("tagId")String tagId,@Param("categoryId")String categoryId,@Param("createTime")String createTime);
+
+    /**
+     * 根据素材标识和标签编码查询数据
+     */
+    int getDataByCodeAndSignature(@Param("signature")String code,@Param("tagCode")String tagCode);
+
+    /**
+     * 查询素材数据以及标签
+     */
+    List<MaterialLabelInfo> getMaterialLabelData(@Param("date")String date);
 }

+ 154 - 7
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/label/mapper/xml/MaterialTagMapper.xml

@@ -3,23 +3,170 @@
 <mapper namespace="cn.com.ctop.kuaishou.modules.label.mapper.MaterialLabelMapper">
 
 
-  <resultMap id="logResultMap" type="cn.com.ctop.kuaishou.modules.clean.entity.KuaiShouAccountCleanLogInfo">
+  <resultMap id="BaseResultMap" type="cn.com.ctop.kuaishou.modules.label.entity.LabelStandardInfo">
     <id column="id" property="id"/>
-    <result column="account_id" property="accountId"/>
-    <result column="user_name" property="userName"/>
-    <result column="operation_type" property="operationType"/>
+    <result column="signature" property="signature"/>
+    <result column="charge_date" property="chargeDate"/>
+    <result column="activation_thirty_days" property="activationThirtyDays"/>
+    <result column="activation_two_days" property="activationTwoDays"/>
+    <result column="form_count_thirty_days" property="formCountThirtyDays"/>
+    <result column="form_count_two_days" property="formCountTwoDays"/>
+    <result column="play_3s_ratio" property="play3sRatio"/>
+    <result column="conversion_ratio" property="conversionRatio"/>
+    <result column="behavior_ration" property="behaviorRation"/>
+    <result column="event_next_day_stay_ratio" property="eventNextDayStayRatio"/>
     <result column="create_time" property="createTime"/>
-    <result column="executive_information" property="executiveInformation"/>
+    <result column="update_time" property="updateTime"/>
   </resultMap>
 
-    <select id="getMateriaSignature" resultType="String">
+
+
+  <resultMap id="TagResultMap" type="cn.com.ctop.common.module.entity.TagInfo">
+    <id column="id" property="id"/>
+    <result column="tag_name" property="tagName"/>
+    <result column="tag_code" property="tagCode"/>
+  </resultMap>
+
+  <resultMap id="MaterialLabelResultMap" type="cn.com.ctop.kuaishou.modules.label.entity.MaterialLabelInfo">
+    <id column="id" property="id"/>
+    <result column="code" property="code"/>
+    <result column="slogansCount" property="slogansCount"/>
+    <result column="offline_flag" property="offlineFlag"/>
+    <result column="confirm_time" property="confirmTime"/>
+    <result column="tag_code" property="tagCode"/>
+    <result column="tag_name" property="tagName"/>
+    <result column="tag_id" property="tagId"/>
+    <result column="clip_id" property="clipId"/>
+    <result column="shot_id" property="shotId"/>
+    <result column="plan_id" property="planId"/>
+    <result column="status" property="status"/>
+    <result column="user_id" property="userId"/>
+    <result column="material_name" property="materialName"/>
+    <result column="project_id" property="projectId"/>
+    <result column="create_time" property="createTime"/>
+  </resultMap>
+
+  <select id="getMateriaSignature" resultType="String">
         SELECT  signature from ctop_etl_kuaishou_video_base_info t  GROUP BY t.signature
     </select>
 
+    <select id="getMateriaSignatureCharge" resultType="String">
+        SELECT  signature from ctop_kuaishou_report_daily_material t  where t.stat_date=#{date}  GROUP BY t.signature
+    </select>
 
-    <select id="getMaterialFirstDate" parameterType="String" resultType="String">
+  <select id="getMaterialFirstDate" parameterType="String" resultType="String">
         SELECT  MIN(stat_date) from ctop_kuaishou_report_daily_material t where t.charge>0 and  t.signature=#{signature}
     </select>
 
+  <select id="getLabermessage"  resultMap="BaseResultMap">
+        SELECT  SUM(activation) as 'activation_thirty_days',SUM(form_count) as 'form_count_thirty_days',
+        SUM(play_3s_ratio*aclick)/SUM(aclick) as 'play_3s_ratio',
+        SUM(activation)/SUM(bclick) as 'conversion_ratio',
+        SUM(bclick)/SUM(aclick) as 'behavior_ration',
+        SUM(event_next_day_stay)/SUM(activation) as 'event_next_day_stay_ratio'
+        from ctop_kuaishou_report_daily_material t
+        where  t.signature=#{signature}
+        and t.stat_date &gt;=#{startDate}
+        and t.stat_date &lt;=#{endDate}
+    </select>
+
+  <select id="getLabermessageByTwoDays"  resultMap="BaseResultMap">
+        SELECT  SUM(activation) as 'activation_two_days',SUM(form_count) as 'form_count_two_days'
+        from ctop_kuaishou_report_daily_material t
+        where  t.signature=#{signature}
+        and t.stat_date &gt;=#{startDate}
+        and t.stat_date &lt;=#{endDate}
+    </select>
+
+  <insert id="saveLabelMessage" parameterType="cn.com.ctop.kuaishou.modules.label.entity.LabelStandardInfo">
+        insert into ctop_label_standard (signature,charge_date,activation_thirty_days,activation_two_days,form_count_thirty_days,
+        form_count_two_days,play_3s_ratio,conversion_ratio,behavior_ration,event_next_day_stay_ratio,create_time,update_time)
+        values
+        (#{signature},#{chargeDate},#{activationThirtyDays},#{activationTwoDays},#{formCountThirtyDays},#{formCountTwoDays},#{play3sRatio},#{conversionRatio},
+        #{behaviorRation},#{eventNextDayStayRatio},#{createTime},#{updateTime})
+    </insert>
+
+  <select id="getMaterialRecord" resultMap="BaseResultMap">
+        select * from ctop_label_standard where signature=#{signature}
+    </select>
+
+  <select id="getAllMaterialData" resultMap="BaseResultMap">
+         select * from ctop_label_standard
+    </select>
+
+    <select id="getAllMaterialDataCharge" resultMap="BaseResultMap">
+         select * from ctop_label_standard t where t.create_time=#{date}
+    </select>
+
+  <update id="updateMaterialRecord">
+        update ctop_label_standard set charge_date=#{chargeDate},activation_thirty_days=#{activationThirtyDays},activation_two_days=#{activationTwoDays},
+        form_count_thirty_days=#{formCountThirtyDays},form_count_two_days=#{formCountTwoDays},play_3s_ratio=#{play3sRatio},conversion_ratio=#{conversionRatio},
+        conversionRatio=#{behaviorRation},event_next_day_stay_ratio=#{eventNextDayStayRatio},update_time=#{updateTime} where signature=#{signature}
+    </update>
+
+  <select id="getTagInfo"  resultMap="TagResultMap">
+        select id,tag_name,tag_code from ctop_tag_info t
+    </select>
+
+  <select id="getDataByCodeAndSignature" resultType="int">
+        select count(*) from ctop_material_tag_info t where t.code=#{signature} and t.tag_code=#{tagCode}
+    </select>
+
+  <insert id="saveMaterialTag" >
+        insert into ctop_material_tag_info (code,status,tag_name,tag_code,user_id,tag_id,category_id,create_time) values
+        (#{code},'1',#{tagName},#{tagCode},null,#{tagId},#{categoryId},#{createTime})
+    </insert>
+
+  <select id="getMaterialLabelData" resultMap="MaterialLabelResultMap">
+    SELECT
+    matInfo.id,
+    matInfo.code,
+    matInfo.project_id,
+    t.slogansCount,
+    matInfo.offline_flag,
+    matInfo.confirm_time,
+    tagInfo.tag_code,
+    tagInfo.tag_name,
+    tagInfo.id AS 'tag_id',
+    ascription.clip_id,
+    ascription.shot_id,
+    ascription.plan_id,
+    matInfo. STATUS,
+    matInfo.user_id,
+    matInfo.material_name,
+    matInfo.project_id,
+    matInfo.create_time
+    FROM
+    ctop_material_info matInfo
+    LEFT JOIN (
+    SELECT
+    video_code,
+    count(*) AS slogansCount
+    FROM
+    ctop_bytedance_video_slogen_info
+    WHERE
+    STATUS = 1
+    GROUP BY
+    video_code
+    ) t ON matInfo. CODE = t.video_code
+    LEFT JOIN (
+    SELECT
+    id,
+    t.code,
+    group_concat(tag_code SEPARATOR ';') AS 'tag_code',
+    group_concat(tag_name SEPARATOR ';') AS 'tag_name'
+    FROM
+    ctop_material_tag_info t
+    GROUP BY
+    code
+    ) tagInfo ON tagInfo.code = matInfo.code
+    LEFT JOIN ctop_material_ascription ascription ON matInfo.code = ascription.material_id
+    <where>
+      <if test="date!=null and date!=''">
+        and (tagInfo.create_time &gt;=#{date} or tagInfo.update_time &gt;=#{date})
+      </if >
+    </where>
+  </select>
+
 
 </mapper>

+ 6 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/label/service/MaterialLabelService.java

@@ -10,5 +10,10 @@ import org.jeecg.common.api.vo.Result;
  */
 public interface MaterialLabelService {
 
-    public Result filterMaterial ();
+    public Result filterMaterial (String type);
+
+    public Result materialSpecificationLabel(String type);
+
+
+    public Result SynchronousLabel(String type);
 }

+ 380 - 21
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/label/service/impl/MaterialLabelServiceImpl.java

@@ -1,15 +1,19 @@
 package cn.com.ctop.kuaishou.modules.label.service.impl;
 
+import cn.com.ctop.common.module.entity.TagInfo;
+import cn.com.ctop.common.module.utils.ElasticsearchUtil;
+import cn.com.ctop.kuaishou.modules.label.entity.LabelStandardInfo;
+import cn.com.ctop.kuaishou.modules.label.entity.MaterialLabelInfo;
 import cn.com.ctop.kuaishou.modules.label.mapper.MaterialLabelMapper;
 import cn.com.ctop.kuaishou.modules.label.service.MaterialLabelService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.List;
+import java.util.*;
 
 /**
  * @Description: 素材标签
@@ -25,6 +29,9 @@ public class MaterialLabelServiceImpl implements MaterialLabelService {
     @Resource
     MaterialLabelMapper materialLabelMapper;
 
+    @Autowired
+    ElasticsearchUtil elasticsearchUtil;
+
 
     /**
      * 清洗各素材指标入库
@@ -33,48 +40,400 @@ public class MaterialLabelServiceImpl implements MaterialLabelService {
      * @return
      */
     @Override
-    public Result filterMaterial() {
+    public Result filterMaterial(String type) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
 
+        Result result = new Result();
         try {
-            //查询所有素材标签
-            List<String> materiaSignature = materialLabelMapper.getMateriaSignature();
-            if(!materiaSignature.isEmpty()){
-                materiaSignature.stream().forEach(str->{
-                    if(!str.isEmpty()){
+            List<String> materiaSignature = new ArrayList<>();
+            if (type.equals("1")) {
+                //查询所有素材标签
+                materiaSignature = materialLabelMapper.getMateriaSignature();
+            } else {
+                //查询增量素材
+                Calendar calc = Calendar.getInstance();
+                calc.setTime(new Date());
+                calc.add(Calendar.DAY_OF_MONTH, -1);
+                materiaSignature = materialLabelMapper.getMateriaSignatureCharge(sdf.format(calc.getTime()));
+            }
+
+            if (!materiaSignature.isEmpty()) {
+                materiaSignature.stream().forEach(str -> {
+                    if (!str.isEmpty()) {
                         //获取素材产生消耗的最早日期
                         String materialFirstDate = materialLabelMapper.getMaterialFirstDate(str);
-                        //获取30天之后的日期
-                        String afterDate = getDateByNumber(materialFirstDate, -30);
-                        //查询素材各项指标入库
-                        
+                        if (materialFirstDate != null) {
+                            //获取30天之后的日期
+                            String afterDate = getDateByNumber(materialFirstDate, 30);
+                            //获取2天之后的日期
+                            String afterDate2 = getDateByNumber(materialFirstDate, 2);
+                            //根据日期查询素材各项指标入库
+                            LabelStandardInfo labermessage = materialLabelMapper.getLabermessage(str, materialFirstDate, afterDate);
+                            if (labermessage != null) {
+                                //查询两天内数据
+                                LabelStandardInfo labermessageByTwoDays = materialLabelMapper.getLabermessageByTwoDays(str, materialFirstDate, afterDate2);
+                                if (labermessageByTwoDays.getActivationTwoDays() != null) {
+                                    labermessage.setActivationTwoDays(labermessageByTwoDays.getActivationTwoDays());
+                                }
+                                if (labermessageByTwoDays.getFormCountTwoDays() != null) {
+                                    labermessage.setFormCountTwoDays(labermessageByTwoDays.getFormCountTwoDays());
+                                }
+                                labermessage.setSignature(str);
+                                labermessage.setChargeDate(materialFirstDate);
+                                labermessage.setCreateTime(sdf.format(new Date()));
+                                labermessage.setUpdateTime(sdf.format(new Date()));
+                                //查询素材标签标准表是否存在此素材
+                                LabelStandardInfo materialRecord = materialLabelMapper.getMaterialRecord(str);
+                                if (materialRecord != null) {
+                                    //存在则更新
+                                    materialLabelMapper.updateMaterialRecord(labermessage);
+                                } else {
+                                    //不存在插入
+                                    materialLabelMapper.saveLabelMessage(labermessage);
+                                }
+
+                            }
+                        }
+
                     }
 
                 });
             }
-        }catch (Exception e){
+            result.success("success");
+        } catch (Exception e) {
+            result.error500("error");
+            log.info("清洗标签指标数据错误:{}", e.toString());
+        }
+
+        return result;
+    }
+
+    /**
+     * 根据素材指标制定素材标签
+     *
+     * @param
+     * @return
+     */
+    @Override
+    public Result materialSpecificationLabel(String type) {
+        Result result = new Result();
+        Map<String, String> tgaMap = new HashMap<>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        List<LabelStandardInfo> allMaterialData = new ArrayList<>();
+        try {
+            String date = sdf.format(new Date());
+            //查询所有标签
+            List<TagInfo> tagInfo = materialLabelMapper.getTagInfo();
+            if (!tagInfo.isEmpty()) {
+                tagInfo.stream().forEach(tag -> {
+                    tgaMap.put(tag.getTagName(), tag.getTagCode() + ";" + tag.getId());
+                });
+            }
+            if (type.equals("0")) {
+                //查询全量素材标签判断标准数据
+                allMaterialData = materialLabelMapper.getAllMaterialData();
+            } else {
+                allMaterialData = materialLabelMapper.getAllMaterialDataCharge(sdf.format(new Date()));
+            }
+
+            if (!allMaterialData.isEmpty()) {
+                allMaterialData.stream().forEach(obj -> {
+                    //三十天内累计激活数
+                    String activationThirtyDays = obj.getActivationThirtyDays();
+                    //两天内累计激活数
+                    String activationTwoDays = obj.getActivationTwoDays();
+                    //30天内表单提交数
+                    String formCountThirtyDays = obj.getFormCountThirtyDays();
+                    //两天内表单提交数
+                    String formCountTwoDays = obj.getFormCountTwoDays();
+                    //30天内3s完播率
+                    String play3sRatio = obj.getPlay3sRatio();
+                    //30天内转化率
+                    String conversionRatio = obj.getConversionRatio();
+                    //30天内行为率
+                    String behaviorRation = obj.getBehaviorRation();
+                    //30天内次留率
+                    String eventNextDayStayRatio = obj.getEventNextDayStayRatio();
+                    //应用下载--合格素材
+                    if (activationThirtyDays != null && formCountThirtyDays != null && Integer.parseInt(activationThirtyDays) >= 100 && Integer.parseInt(formCountThirtyDays) == 0) {
+                        String[] split = tgaMap.get("应用下载--合格素材").split(";");
+                        int count = materialLabelMapper.getDataByCodeAndSignature(obj.getSignature(), split[0]);
+                        //次素材没有打此标签
+                        if (count == 0) {
+                            materialLabelMapper.saveMaterialTag(obj.getSignature(), "应用下载--合格素材", split[0], split[1], "1", date);
+                        }
+                    }
+
+                    //应应用下载--起量快
+                    if (activationTwoDays != null && formCountTwoDays != null && Integer.parseInt(activationTwoDays) >= 96 && Integer.parseInt(formCountTwoDays) == 0) {
+                        String[] split = tgaMap.get("应用下载--起量快").split(";");
+                        int count = materialLabelMapper.getDataByCodeAndSignature(obj.getSignature(), split[0]);
+                        //次素材没有打此标签
+                        if (count == 0) {
+                            materialLabelMapper.saveMaterialTag(obj.getSignature(), "应用下载--起量快", split[0], split[1], "1", date);
+                        }
+                    }
+
+                    //应用下载-高-3s完播率
+                    if (activationThirtyDays != null && play3sRatio != null && Integer.parseInt(activationThirtyDays) >= 100 && Double.parseDouble(play3sRatio) > 0.657) {
+                        String[] split = tgaMap.get("应用下载-高-3s完播率").split(";");
+                        int count = materialLabelMapper.getDataByCodeAndSignature(obj.getSignature(), split[0]);
+                        //次素材没有打此标签
+                        if (count == 0) {
+                            materialLabelMapper.saveMaterialTag(obj.getSignature(), "应用下载-高-3s完播率", split[0], split[1], "1", date);
+                        }
+                    }
+
+                    // 应用下载-低-3s完播率
+                    if (activationThirtyDays != null && play3sRatio != null && Integer.parseInt(activationThirtyDays) >= 100 && Double.parseDouble(play3sRatio) < 0.132) {
+                        String[] split = tgaMap.get("应用下载-低-3s完播率").split(";");
+                        int count = materialLabelMapper.getDataByCodeAndSignature(obj.getSignature(), split[0]);
+                        //次素材没有打此标签
+                        if (count == 0) {
+                            materialLabelMapper.saveMaterialTag(obj.getSignature(), "应用下载-低-3s完播率", split[0], split[1], "1", date);
+                        }
+                    }
+
+                    // 应用下载-高-转化率
+                    if (activationThirtyDays != null && conversionRatio != null && Integer.parseInt(activationThirtyDays) >= 100 && Double.parseDouble(conversionRatio) > 0.366) {
+                        String[] split = tgaMap.get("应用下载-高-转化率").split(";");
+                        int count = materialLabelMapper.getDataByCodeAndSignature(obj.getSignature(), split[0]);
+                        //次素材没有打此标签
+                        if (count == 0) {
+                            materialLabelMapper.saveMaterialTag(obj.getSignature(), "应用下载-高-转化率", split[0], split[1], "1", date);
+                        }
+                    }
+
+                    // 应用下载-低-转化率
+                    if (activationThirtyDays != null && conversionRatio != null && Integer.parseInt(activationThirtyDays) >= 100 && Double.parseDouble(conversionRatio) < 0.009) {
+                        String[] split = tgaMap.get("应用下载-低-转化率").split(";");
+                        int count = materialLabelMapper.getDataByCodeAndSignature(obj.getSignature(), split[0]);
+                        //次素材没有打此标签
+                        if (count == 0) {
+                            materialLabelMapper.saveMaterialTag(obj.getSignature(), "应用下载-低-转化率", split[0], split[1], "1", date);
+                        }
+                    }
+
+                    // 应用下载-高-行为率
+                    if (activationThirtyDays != null && behaviorRation != null && Integer.parseInt(activationThirtyDays) >= 100 && Double.parseDouble(behaviorRation) > 0.059) {
+                        String[] split = tgaMap.get("应用下载-高-行为率").split(";");
+                        int count = materialLabelMapper.getDataByCodeAndSignature(obj.getSignature(), split[0]);
+                        //次素材没有打此标签
+                        if (count == 0) {
+                            materialLabelMapper.saveMaterialTag(obj.getSignature(), "应用下载-高-行为率", split[0], split[1], "1", date);
+                        }
+                    }
+
+                    // 应用下载-低-行为率
+                    if (activationThirtyDays != null && behaviorRation != null && Integer.parseInt(activationThirtyDays) >= 100 && Double.parseDouble(behaviorRation) < 0.003) {
+                        String[] split = tgaMap.get("应用下载-低-行为率").split(";");
+                        int count = materialLabelMapper.getDataByCodeAndSignature(obj.getSignature(), split[0]);
+                        //次素材没有打此标签
+                        if (count == 0) {
+                            materialLabelMapper.saveMaterialTag(obj.getSignature(), "应用下载-低-行为率", split[0], split[1], "1", date);
+                        }
+                    }
+
+                    // 应用下载-高-次留率
+                    if (activationThirtyDays != null && eventNextDayStayRatio != null && Integer.parseInt(activationThirtyDays) >= 100 && Double.parseDouble(eventNextDayStayRatio) > 0.453) {
+                        String[] split = tgaMap.get("应用下载-高-次留率").split(";");
+                        int count = materialLabelMapper.getDataByCodeAndSignature(obj.getSignature(), split[0]);
+                        //次素材没有打此标签
+                        if (count == 0) {
+                            materialLabelMapper.saveMaterialTag(obj.getSignature(), "应用下载-高-次留率", split[0], split[1], "1", date);
+                        }
+                    }
+
+                    // 应用下载-低-次留率
+                    if (activationThirtyDays != null && eventNextDayStayRatio != null && Integer.parseInt(activationThirtyDays) >= 100 && Double.parseDouble(eventNextDayStayRatio) == 0.000) {
+                        String[] split = tgaMap.get("应用下载-低-次留率").split(";");
+                        int count = materialLabelMapper.getDataByCodeAndSignature(obj.getSignature(), split[0]);
+                        //次素材没有打此标签
+                        if (count == 0) {
+                            materialLabelMapper.saveMaterialTag(obj.getSignature(), "应用下载-低-次留率", split[0], split[1], "1", date);
+                        }
+                    }
+
+
+                    // 表单提交--合格素材
+                    if (formCountThirtyDays != null && activationThirtyDays != null && Integer.parseInt(formCountThirtyDays) >= 20 && Integer.parseInt(activationThirtyDays) == 0) {
+                        String[] split = tgaMap.get("表单提交--合格素材").split(";");
+                        int count = materialLabelMapper.getDataByCodeAndSignature(obj.getSignature(), split[0]);
+                        //次素材没有打此标签
+                        if (count == 0) {
+                            materialLabelMapper.saveMaterialTag(obj.getSignature(), "表单提交--合格素材", split[0], split[1], "1", date);
+                        }
+                    }
+
+                    // 表单提交--起量快
+                    if (formCountTwoDays != null && activationTwoDays != null && Integer.parseInt(formCountTwoDays) >= 30 && Integer.parseInt(activationTwoDays) == 0) {
+                        String[] split = tgaMap.get("表单提交--起量快").split(";");
+                        int count = materialLabelMapper.getDataByCodeAndSignature(obj.getSignature(), split[0]);
+                        //次素材没有打此标签
+                        if (count == 0) {
+                            materialLabelMapper.saveMaterialTag(obj.getSignature(), "表单提交--起量快", split[0], split[1], "1", date);
+                        }
+                    }
 
+                    // 表单提交-低-3s完播率
+                    if (formCountThirtyDays != null && play3sRatio != null && Integer.parseInt(formCountThirtyDays) >= 20 && Double.parseDouble(play3sRatio) < 0.157) {
+                        String[] split = tgaMap.get("表单提交-低-3s完播率").split(";");
+                        int count = materialLabelMapper.getDataByCodeAndSignature(obj.getSignature(), split[0]);
+                        //次素材没有打此标签
+                        if (count == 0) {
+                            materialLabelMapper.saveMaterialTag(obj.getSignature(), "表单提交-低-3s完播率", split[0], split[1], "1", date);
+                        }
+                    }
+
+                    // 表单提交-高-3s完播率
+                    if (formCountThirtyDays != null && play3sRatio != null && Integer.parseInt(formCountThirtyDays) >= 20 && Double.parseDouble(play3sRatio) > 0.515) {
+                        String[] split = tgaMap.get("表单提交-高-3s完播率").split(";");
+                        int count = materialLabelMapper.getDataByCodeAndSignature(obj.getSignature(), split[0]);
+                        //次素材没有打此标签
+                        if (count == 0) {
+                            materialLabelMapper.saveMaterialTag(obj.getSignature(), "表单提交-高-3s完播率", split[0], split[1], "1", date);
+                        }
+                    }
+
+                    // 表单提交-低-转化率
+                    if (formCountThirtyDays != null && conversionRatio != null && Integer.parseInt(formCountThirtyDays) >= 20 && Double.parseDouble(conversionRatio) < 0.017) {
+                        String[] split = tgaMap.get("表单提交-低-转化率").split(";");
+                        int count = materialLabelMapper.getDataByCodeAndSignature(obj.getSignature(), split[0]);
+                        //次素材没有打此标签
+                        if (count == 0) {
+                            materialLabelMapper.saveMaterialTag(obj.getSignature(), "表单提交-低-转化率", split[0], split[1], "1", date);
+                        }
+                    }
+
+
+                    // 表单提交-高-转化率
+                    if (formCountThirtyDays != null && conversionRatio != null && Integer.parseInt(formCountThirtyDays) >= 20 && Double.parseDouble(conversionRatio) > 0.159) {
+                        String[] split = tgaMap.get("表单提交-高-转化率").split(";");
+                        int count = materialLabelMapper.getDataByCodeAndSignature(obj.getSignature(), split[0]);
+                        //次素材没有打此标签
+                        if (count == 0) {
+                            materialLabelMapper.saveMaterialTag(obj.getSignature(), "表单提交-高-转化率", split[0], split[1], "1", date);
+                        }
+                    }
+
+                    // 表单提交-低-行为率
+                    if (formCountThirtyDays != null && behaviorRation != null && Integer.parseInt(formCountThirtyDays) >= 20 && Double.parseDouble(behaviorRation) < 0.004) {
+                        String[] split = tgaMap.get("表单提交-低-行为率").split(";");
+                        int count = materialLabelMapper.getDataByCodeAndSignature(obj.getSignature(), split[0]);
+                        //次素材没有打此标签
+                        if (count == 0) {
+                            materialLabelMapper.saveMaterialTag(obj.getSignature(), "表单提交-低-行为率", split[0], split[1], "1", date);
+                        }
+                    }
+
+                    // 表单提交-高-行为率
+                    if (formCountThirtyDays != null && behaviorRation != null && Integer.parseInt(formCountThirtyDays) >= 20 && Double.parseDouble(behaviorRation) > 0.015) {
+                        String[] split = tgaMap.get("表单提交-高-行为率").split(";");
+                        int count = materialLabelMapper.getDataByCodeAndSignature(obj.getSignature(), split[0]);
+                        //次素材没有打此标签
+                        if (count == 0) {
+                            materialLabelMapper.saveMaterialTag(obj.getSignature(), "表单提交-高-行为率", split[0], split[1], "1", date);
+                        }
+                    }
+
+                });
+            }
+            result.success("success");
+        } catch (Exception e) {
+            result.error500("error");
+            log.info("素材规定标签失败:{}", e.toString());
         }
+        return result;
 
+    }
 
-        return null;
+    /**
+     * 同步标签到ES
+     *
+     * @param
+     * @return
+     */
+    @Override
+    public Result SynchronousLabel(String type) {
+        Result result = new Result();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        List<MaterialLabelInfo> materialLabelData = new ArrayList<>();
+        try {
+            if (type.equals("0")) {
+                //查询所有素材
+                materialLabelData = materialLabelMapper.getMaterialLabelData(null);
+            } else {
+                //查询增量素材
+                materialLabelData = materialLabelMapper.getMaterialLabelData(sdf.format(new Date()));
+            }
+            //创建索引
+            boolean indexIfNotExist = elasticsearchUtil.createIndexIfNotExist(MaterialLabelInfo.class);
+            //同步ES
+            if (materialLabelData.size() > 0) {
+                //每5000条数据, 拆成一个list
+                List<List<MaterialLabelInfo>> repayEntityVoList = getSubList(100, materialLabelData);
+                if (!repayEntityVoList.isEmpty()) {
+                    for (List<MaterialLabelInfo> materialLabelInfos : repayEntityVoList) {
+                        elasticsearchUtil.batchSaveOrUpdate(materialLabelInfos);
+                        //防止es队列满
+                        Thread.sleep(500);
+                    }
+                }
+            }
+            result.setSuccess(true);
+            log.info("同步标签至es成功:{}");
+        } catch (Exception e) {
+            result.setSuccess(false);
+            log.info("同步标签至ES失败:{}", e.toString());
+        }
+        return result;
     }
+
+
     /**
      * 获取指定日期number天之后之前的日期
      *
      * @param
      * @return
      */
-    public String getDateByNumber(String date,int number){
+    public String getDateByNumber(String date, int number) {
         Calendar calc = Calendar.getInstance();
-        SimpleDateFormat sdf  = new SimpleDateFormat("yyyy-MM-dd");
-        String AfterDate=null;
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        String AfterDate = null;
         try {
             calc.setTime(sdf.parse(date));
-            calc.add(calc.DATE, number);
-            AfterDate=sdf.format(calc.getTime());
-        }catch (Exception e){
-            log.info("获取日期失败:{}",e.toString());
+            calc.add(Calendar.DAY_OF_MONTH, number);
+            AfterDate = sdf.format(calc.getTime());
+        } catch (Exception e) {
+            log.info("获取日期失败:{}", e.toString());
         }
         return AfterDate;
     }
+
+
+    /**
+     * 将list拆分成指定数量的小list
+     * 注: 使用的subList方式,返回的是list的内部类,不可做元素的删除,修改,添加操作
+     *
+     * @param length 数量
+     * @param list   大list
+     */
+    public List<List<MaterialLabelInfo>> getSubList(int length, List<MaterialLabelInfo> list) {
+        int size = list.size();
+        int temp = size / length + 1;
+        boolean result = size % length == 0;
+        List<List<MaterialLabelInfo>> subList = new ArrayList<>();
+        for (int i = 0; i < temp; i++) {
+            if (i == temp - 1) {
+                if (result) {
+                    break;
+                }
+                subList.add(list.subList(length * i, size));
+            } else {
+                subList.add(list.subList(length * i, length * (i + 1)));
+            }
+        }
+        return subList;
+    }
+
 }

+ 7 - 7
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/material/service/impl/EtlKuaishouVideoInfoServiceImpl.java

@@ -75,13 +75,13 @@ public class EtlKuaishouVideoInfoServiceImpl extends ServiceImpl<EtlKuaishouVide
                         JSONObject ascription = ascriptionService.getDetailByCode(videoGet.getSignature());
                         if(null!=ascription){
                             String clipId = ascription.getString("clipId");
-                            if(null!=clipId&&!clipId.trim().equals("")){
+                            if(null!=clipId&&!"".equals(clipId.trim())){
                                 etlKuaishouVideoInfo.setClipId(clipId);
                                 //根据id查询剪辑所属的设计负责人
                                 SysUser user = sysUserService.getById(clipId);
                                 if(null!=user){
                                     String roleCode = sysUserService.getRoleCodeByUserId(user.getId());
-                                    if(null!=roleCode&&roleCode.trim().equals("designTeamLeader")){
+                                    if(null!=roleCode&& "designTeamLeader".equals(roleCode.trim())){
                                         etlKuaishouVideoInfo.setDesignTeamLeaderId(user.getId());
                                         etlKuaishouVideoInfo.setDesignTeamLeaderName(user.getRealname());
                                     }else{
@@ -91,23 +91,23 @@ public class EtlKuaishouVideoInfoServiceImpl extends ServiceImpl<EtlKuaishouVide
                                 }
                             }
                             String clipName = ascription.getString("clipName");
-                            if(null!=clipName&&!clipName.trim().equals("")){
+                            if(null!=clipName&&!"".equals(clipName.trim())){
                                 etlKuaishouVideoInfo.setClipName(clipName);
                             }
                             String planId = ascription.getString("planId");
-                            if(null!=planId&&!planId.trim().equals("")){
+                            if(null!=planId&&!"".equals(planId.trim())){
                                 etlKuaishouVideoInfo.setPlanId(planId);
                             }
                             String planName = ascription.getString("planName");
-                            if(null!=planName&&!planName.trim().equals("")){
+                            if(null!=planName&&!"".equals(planName.trim())){
                                 etlKuaishouVideoInfo.setPlanName(planName);
                             }
                             String shotId = ascription.getString("shotId");
-                            if(null!=shotId&&!shotId.trim().equals("")){
+                            if(null!=shotId&&!"".equals(shotId.trim())){
                                 etlKuaishouVideoInfo.setShotId(shotId);
                             }
                             String shotName = ascription.getString("shotName");
-                            if(null!=shotName&&!shotName.trim().equals("")){
+                            if(null!=shotName&&!"".equals(shotName.trim())){
                                 etlKuaishouVideoInfo.setShotName(shotName);
                             }
                         }

+ 2 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KsNewGroupReportCtrl.java

@@ -48,7 +48,7 @@ public class KsNewGroupReportCtrl {
         JSONArray accountIds = requestBody.getJSONArray("accountIds");
         String userId = requestBody.getString("userId");
         //TODO 没有维护快手事业部负责人角色,增加判断
-        if (userId.equals("b73c6a1cafb4469a8c0081acd50f703b") || userId.equals("228c45f913924639bf20c79ce5dadb16")) {
+        if ("b73c6a1cafb4469a8c0081acd50f703b".equals(userId) || "228c45f913924639bf20c79ce5dadb16".equals(userId)) {
             accountIds = newPlanReportService.getAccountIdsByMedia();
         } else {
             if (!userId.isEmpty()) {
@@ -109,7 +109,7 @@ public class KsNewGroupReportCtrl {
         JSONArray accountIds = requestBody.getJSONArray("accountIds");
         String userId = requestBody.getString("userId");
         //TODO 没有维护快手事业部负责人角色,增加判断
-        if (userId.equals("6b4c821adc414dc8b7718ab63ccbfcaf")) {
+        if ("6b4c821adc414dc8b7718ab63ccbfcaf".equals(userId)) {
             accountIds = newPlanReportService.getAccountIdsByMedia();
         } else {
             if (!userId.isEmpty()) {

+ 2 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KsNewPlanReportCtrl.java

@@ -44,7 +44,7 @@ public class KsNewPlanReportCtrl {
         JSONArray accountIds = requestBody.getJSONArray("accountIds");
         String userId = requestBody.getString("userId");
         //TODO 没有维护快手事业部负责人角色,增加判断
-        if (userId.equals("6b4c821adc414dc8b7718ab63ccbfcaf")) {
+        if ("6b4c821adc414dc8b7718ab63ccbfcaf".equals(userId)) {
             accountIds = newPlanReportService.getAccountIdsByMedia();
         } else {
             if (!userId.isEmpty()) {
@@ -108,7 +108,7 @@ public class KsNewPlanReportCtrl {
         JSONArray accountIds = requestBody.getJSONArray("accountIds");
         String userId = requestBody.getString("userId");
         //TODO 没有维护快手事业部负责人角色,增加判断
-        if (userId.equals("6b4c821adc414dc8b7718ab63ccbfcaf")) {
+        if ("6b4c821adc414dc8b7718ab63ccbfcaf".equals(userId)) {
             accountIds = newPlanReportService.getAccountIdsByMedia();
         } else {
             if (!userId.isEmpty()) {

+ 3 - 3
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/EtlKuaiShouNewlyServiceImpl.java

@@ -88,11 +88,11 @@ public class EtlKuaiShouNewlyServiceImpl extends ServiceImpl<EtlKuaiShouNewlyMap
                     addNewly.setUserName(userMap.get(allocation.getUserId()));
                 }
                 Integer count = 0;
-                if (newType.equals("campaign")) {
+                if ("campaign".equals(newType)) {
                     count = campaignService.getNewDataByAccountIdAndDate(allocation.getAccountId(), statDate);
-                } else if (newType.equals("unit")) {
+                } else if ("unit".equals(newType)) {
                     count = groupService.getNewDataByAccountIdAndDate(allocation.getAccountId(), statDate);
-                } else if (newType.equals("creative")) {
+                } else if ("creative".equals(newType)) {
                     count = creativeService.getNewDataByAccountIdAndDate(allocation.getAccountId(), statDate);
                 }
                 addNewly.setNewCount(count);

+ 3 - 3
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/EtlKuaishouReportAccountHourlyServiceImpl.java

@@ -85,7 +85,7 @@ public class EtlKuaishouReportAccountHourlyServiceImpl extends ServiceImpl<EtlKu
         List<EtlKuaishouReportAccountHourly> list = etlDailyAccountMapper.selectList(lastStartDate, lastStartDate);
         if (!Check.isNull(list)) {
             for (EtlKuaishouReportAccountHourly accountHourly : list) {
-                accountHourly.setStatHour(23l);
+                accountHourly.setStatHour(23L);
             }
             etlHourlyAccountMapper.replaceBatch(list);
         }
@@ -163,7 +163,7 @@ public class EtlKuaishouReportAccountHourlyServiceImpl extends ServiceImpl<EtlKu
             completionTime(todayList);
             completionTime(yesterdayList);
         } else {
-            if (value.equals("play_3s_ratio")) {
+            if ("play_3s_ratio".equals(value)) {
                 value = request.getString("value");
                 type = "more";
             }
@@ -450,7 +450,7 @@ public class EtlKuaishouReportAccountHourlyServiceImpl extends ServiceImpl<EtlKu
             updateTime = etlHourlyAccountMapper.getNewlyUpdateTime();
         } else {
             updateTime = etlDailyAccountMapper.getNewlyUpdateTime();
-            if (parameterCode.equals("campaign") || parameterCode.equals("unit")) {
+            if ("campaign".equals(parameterCode) || "unit".equals(parameterCode)) {
                 data = etlDailyAccountMapper.queryEveryDayCount(request);
             } else {
                 data = etlDailyAccountMapper.queryEveryDayCharge(request);

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouProjectVideoEtlInfoServiceImpl.java

@@ -19,7 +19,7 @@ public class KuaishouProjectVideoEtlInfoServiceImpl extends ServiceImpl<Kuaishou
     @Override
     public KuaishouProjectVideoEtlInfo getByProjectVideoEtlInfoByParams(String signature, Long projectId) {
         QueryWrapper<KuaishouProjectVideoEtlInfo>queryWrapper = new QueryWrapper<>();
-        if(null!=signature&&!signature.trim().equals("")){
+        if(null!=signature&&!"".equals(signature.trim())){
             queryWrapper.eq("video_code",signature);
         }
         if(null!=projectId&&projectId!=0){

+ 15 - 15
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouVideoEtlInfoServiceImpl.java

@@ -55,7 +55,7 @@ public class KuaishouVideoEtlInfoServiceImpl extends ServiceImpl<KuaishouVideoEt
             materials.forEach(material -> {
                 executorService.submit(() -> {
                     try {
-                        if (null == material.getSignature() || material.getSignature().trim().equals("")) {
+                        if (null == material.getSignature() || "".equals(material.getSignature().trim())) {
                             return;
                         }
 
@@ -72,33 +72,33 @@ public class KuaishouVideoEtlInfoServiceImpl extends ServiceImpl<KuaishouVideoEt
                             String clipId = null;
                             if (null != ascription) {
                                 String planId = ascription.getString("planId");
-                                if (null != planId && !planId.trim().equals("")) {
+                                if (null != planId && !"".equals(planId.trim())) {
                                     etlInfo.setPlanId(planId);
                                 }
                                 String planName = ascription.getString("planName");
-                                if (null != planName && !planName.trim().equals("")) {
+                                if (null != planName && !"".equals(planName.trim())) {
                                     etlInfo.setPlanName(planName);
                                 }
                                 clipId = ascription.getString("clipId");
-                                if (null != clipId && !clipId.trim().equals("")) {
+                                if (null != clipId && !"".equals(clipId.trim())) {
                                     etlInfo.setClipId(clipId);
                                 }
                                 String clipName = ascription.getString("clipName");
-                                if (null != clipName && !clipName.trim().equals("")) {
+                                if (null != clipName && !"".equals(clipName.trim())) {
                                     etlInfo.setClipName(clipName);
                                 }
                                 String shotId = ascription.getString("shotId");
-                                if (null != shotId && !shotId.trim().equals("")) {
+                                if (null != shotId && !"".equals(shotId.trim())) {
                                     etlInfo.setShotId(shotId);
                                 }
                                 String shotName = ascription.getString("shotName");
-                                if (null != shotName && !shotName.trim().equals("")) {
+                                if (null != shotName && !"".equals(shotName.trim())) {
                                     etlInfo.setShotName(shotName);
                                 }
                             }
                             if (null != clipId) {
                                 String companyName = kuaishouVideoEtlInfoMapper.getCompanyNameByUserId(clipId);
-                                if (null != companyName && !companyName.trim().equals("")) {
+                                if (null != companyName && !"".equals(companyName.trim())) {
                                     etlInfo.setCompanyName(companyName);
                                 }
                             }
@@ -131,33 +131,33 @@ public class KuaishouVideoEtlInfoServiceImpl extends ServiceImpl<KuaishouVideoEt
                             String clipId = null;
                             if (null != ascription) {
                                 String planId = ascription.getString("planId");
-                                if (null != planId && !planId.trim().equals("")) {
+                                if (null != planId && !"".equals(planId.trim())) {
                                     etlInfo.setPlanId(planId);
                                 }
                                 String planName = ascription.getString("planName");
-                                if (null != planName && !planName.trim().equals("")) {
+                                if (null != planName && !"".equals(planName.trim())) {
                                     etlInfo.setPlanName(planName);
                                 }
                                 clipId = ascription.getString("clipId");
-                                if (null != clipId && !clipId.trim().equals("")) {
+                                if (null != clipId && !"".equals(clipId.trim())) {
                                     etlInfo.setClipId(clipId);
                                 }
                                 String clipName = ascription.getString("clipName");
-                                if (null != clipName && !clipName.trim().equals("")) {
+                                if (null != clipName && !"".equals(clipName.trim())) {
                                     etlInfo.setClipName(clipName);
                                 }
                                 String shotId = ascription.getString("shotId");
-                                if (null != shotId && !shotId.trim().equals("")) {
+                                if (null != shotId && !"".equals(shotId.trim())) {
                                     etlInfo.setShotId(shotId);
                                 }
                                 String shotName = ascription.getString("shotName");
-                                if (null != shotName && !shotName.trim().equals("")) {
+                                if (null != shotName && !"".equals(shotName.trim())) {
                                     etlInfo.setShotName(shotName);
                                 }
                             }
                             if (null != clipId) {
                                 String companyName = kuaishouVideoEtlInfoMapper.getCompanyNameByUserId(clipId);
-                                if (null != companyName && !companyName.trim().equals("")) {
+                                if (null != companyName && !"".equals(companyName.trim())) {
                                     etlInfo.setCompanyName(companyName);
                                 }
                             }

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/oa/modules/service/impl/AppchatCreateServiceImpl.java

@@ -88,7 +88,7 @@ public class AppchatCreateServiceImpl implements IAppchatCreateService {
             if (Check.isNull(userInfo)) {
                 continue;
             }
-            if (userInfo.getWexinName().equals("于蒙蒙") || userInfo.getWexinName().equals("吴永前")) {
+            if ("于蒙蒙".equals(userInfo.getWexinName()) || "吴永前".equals(userInfo.getWexinName())) {
                 continue;
             }
             text.append("@" + userInfo.getWexinName() + "");

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/shiwan/modules/controller/ShiwanFileUploadController.java

@@ -121,7 +121,7 @@ public class ShiwanFileUploadController {
                 result.success("查询成功!");
                 result.setResult(list);
             } else {
-                result.error(-1, "查询失败");
+                Result.error(-1, "查询失败");
             }
         }
         return result;

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/controller/BytedanceNewPlanReportCtrl.java

@@ -36,7 +36,7 @@ public class BytedanceNewPlanReportCtrl {
         JSONArray accountIds = requestBody.getJSONArray("accountIds");
         //TODO 没有维护头条事业部负责人角色,增加判断
         String userId = requestBody.getString("userId");
-        if (userId.equals("0c2113fb63b94941be024efce2d83369")) {
+        if ("0c2113fb63b94941be024efce2d83369".equals(userId)) {
             accountIds = newPlanReportService.getAccountIdsByMedia();
         } else {
             if (!userId.isEmpty()) {

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceVideoReportMapper.xml

@@ -16,7 +16,7 @@
         t1.material_name AS materialName,
         t1.project_name AS projectName,
         t1.material_create_time AS createTime,
-        sum (t1.material_show) as showMaterial,
+        sum(t1.material_show) as showMaterial,
         ${filed}
         FROM
         etl_report_bytedance_video t1

+ 30 - 30
jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceVideoEtlInfoServiceImpl.java

@@ -48,7 +48,7 @@ public class BytedanceVideoEtlInfoServiceImpl extends ServiceImpl<BytedanceVideo
             materials.forEach(material->{
                 executorService.submit(()->{
                     try {
-                        if(null == material.getVideoCode()||material.getVideoCode().trim().equals("")){
+                        if(null == material.getVideoCode()|| "".equals(material.getVideoCode().trim())){
                             return;
                         }
                         String signature = material.getVideoCode();
@@ -64,33 +64,33 @@ public class BytedanceVideoEtlInfoServiceImpl extends ServiceImpl<BytedanceVideo
                             String planId = null;
                             if(null!=ascription){
                                 planId = ascription.getString("planId");
-                                if(null!=planId&&!planId.trim().equals("")){
+                                if(null!=planId&&!"".equals(planId.trim())){
                                     etlInfo.setPlanId(planId);
                                 }
                                 String planName =  ascription.getString("planName");
-                                if(null!=planName&&!planName.trim().equals("")){
+                                if(null!=planName&&!"".equals(planName.trim())){
                                     etlInfo.setPlanName(planName);
                                 }
                                 String clipId = ascription.getString("clipId");
-                                if(null!=clipId&&!clipId.trim().equals("")){
+                                if(null!=clipId&&!"".equals(clipId.trim())){
                                     etlInfo.setClipId(clipId);
                                 }
                                 String clipName = ascription.getString("clipName");
-                                if(null!=clipName&&!clipName.trim().equals("")){
+                                if(null!=clipName&&!"".equals(clipName.trim())){
                                     etlInfo.setClipName(clipName);
                                 }
                                 String shotId = ascription.getString("shotId");
-                                if(null!=shotId&&!shotId.trim().equals("")){
+                                if(null!=shotId&&!"".equals(shotId.trim())){
                                     etlInfo.setShotId(shotId);
                                 }
                                 String shotName = ascription.getString("shotName");
-                                if(null!=shotName&&!shotName.trim().equals("")){
+                                if(null!=shotName&&!"".equals(shotName.trim())){
                                     etlInfo.setShotName(shotName);
                                 }
                             }
                             if(null!=planId){
                                 String companyName = userAllocationMapper.getCompanyNameByUserId(planId);
-                                if (null!=companyName&&!companyName.trim().equals("")){
+                                if (null!=companyName&&!"".equals(companyName.trim())){
                                     etlInfo.setCompanyName(companyName);
                                 }
                             }
@@ -123,33 +123,33 @@ public class BytedanceVideoEtlInfoServiceImpl extends ServiceImpl<BytedanceVideo
                             String planId = null;
                             if(null!=ascription){
                                 planId = ascription.getString("planId");
-                                if(null!=planId&&!planId.trim().equals("")){
+                                if(null!=planId&&!"".equals(planId.trim())){
                                     etlInfo.setPlanId(planId);
                                 }
                                 String planName =  ascription.getString("planName");
-                                if(null!=planName&&!planName.trim().equals("")){
+                                if(null!=planName&&!"".equals(planName.trim())){
                                     etlInfo.setPlanName(planName);
                                 }
                                 String clipId = ascription.getString("clipId");
-                                if(null!=clipId&&!clipId.trim().equals("")){
+                                if(null!=clipId&&!"".equals(clipId.trim())){
                                     etlInfo.setClipId(clipId);
                                 }
                                 String clipName = ascription.getString("clipName");
-                                if(null!=clipName&&!clipName.trim().equals("")){
+                                if(null!=clipName&&!"".equals(clipName.trim())){
                                     etlInfo.setClipName(clipName);
                                 }
                                 String shotId = ascription.getString("shotId");
-                                if(null!=shotId&&!shotId.trim().equals("")){
+                                if(null!=shotId&&!"".equals(shotId.trim())){
                                     etlInfo.setShotId(shotId);
                                 }
                                 String shotName = ascription.getString("shotName");
-                                if(null!=shotName&&!shotName.trim().equals("")){
+                                if(null!=shotName&&!"".equals(shotName.trim())){
                                     etlInfo.setShotName(shotName);
                                 }
                             }
                             if(null!=planId){
                                 String companyName = userAllocationMapper.getCompanyNameByUserId(planId);
-                                if (null!=companyName&&!companyName.trim().equals("")){
+                                if (null!=companyName&&!"".equals(companyName.trim())){
                                     etlInfo.setCompanyName(companyName);
                                 }
                             }
@@ -220,7 +220,7 @@ public class BytedanceVideoEtlInfoServiceImpl extends ServiceImpl<BytedanceVideo
             materials.forEach(material->{
                 executorService.submit(()->{
                     try {
-                        if(null == material.getVideoCode()||material.getVideoCode().trim().equals("")){
+                        if(null == material.getVideoCode()|| "".equals(material.getVideoCode().trim())){
                             return;
                         }
                         String signature = material.getVideoCode();
@@ -236,33 +236,33 @@ public class BytedanceVideoEtlInfoServiceImpl extends ServiceImpl<BytedanceVideo
                             String planId = null;
                             if(null!=ascription){
                                 planId = ascription.getString("planId");
-                                if(null!=planId&&!planId.trim().equals("")){
+                                if(null!=planId&&!"".equals(planId.trim())){
                                     etlInfo.setPlanId(planId);
                                 }
                                 String planName =  ascription.getString("planName");
-                                if(null!=planName&&!planName.trim().equals("")){
+                                if(null!=planName&&!"".equals(planName.trim())){
                                     etlInfo.setPlanName(planName);
                                 }
                                 String clipId = ascription.getString("clipId");
-                                if(null!=clipId&&!clipId.trim().equals("")){
+                                if(null!=clipId&&!"".equals(clipId.trim())){
                                     etlInfo.setClipId(clipId);
                                 }
                                 String clipName = ascription.getString("clipName");
-                                if(null!=clipName&&!clipName.trim().equals("")){
+                                if(null!=clipName&&!"".equals(clipName.trim())){
                                     etlInfo.setClipName(clipName);
                                 }
                                 String shotId = ascription.getString("shotId");
-                                if(null!=shotId&&!shotId.trim().equals("")){
+                                if(null!=shotId&&!"".equals(shotId.trim())){
                                     etlInfo.setShotId(shotId);
                                 }
                                 String shotName = ascription.getString("shotName");
-                                if(null!=shotName&&!shotName.trim().equals("")){
+                                if(null!=shotName&&!"".equals(shotName.trim())){
                                     etlInfo.setShotName(shotName);
                                 }
                             }
                             if(null!=planId){
                                 String companyName = userAllocationMapper.getCompanyNameByUserId(planId);
-                                if (null!=companyName&&!companyName.trim().equals("")){
+                                if (null!=companyName&&!"".equals(companyName.trim())){
                                     etlInfo.setCompanyName(companyName);
                                 }
                             }
@@ -295,33 +295,33 @@ public class BytedanceVideoEtlInfoServiceImpl extends ServiceImpl<BytedanceVideo
                             String planId = null;
                             if(null!=ascription){
                                 planId = ascription.getString("planId");
-                                if(null!=planId&&!planId.trim().equals("")){
+                                if(null!=planId&&!"".equals(planId.trim())){
                                     etlInfo.setPlanId(planId);
                                 }
                                 String planName =  ascription.getString("planName");
-                                if(null!=planName&&!planName.trim().equals("")){
+                                if(null!=planName&&!"".equals(planName.trim())){
                                     etlInfo.setPlanName(planName);
                                 }
                                 String clipId = ascription.getString("clipId");
-                                if(null!=clipId&&!clipId.trim().equals("")){
+                                if(null!=clipId&&!"".equals(clipId.trim())){
                                     etlInfo.setClipId(clipId);
                                 }
                                 String clipName = ascription.getString("clipName");
-                                if(null!=clipName&&!clipName.trim().equals("")){
+                                if(null!=clipName&&!"".equals(clipName.trim())){
                                     etlInfo.setClipName(clipName);
                                 }
                                 String shotId = ascription.getString("shotId");
-                                if(null!=shotId&&!shotId.trim().equals("")){
+                                if(null!=shotId&&!"".equals(shotId.trim())){
                                     etlInfo.setShotId(shotId);
                                 }
                                 String shotName = ascription.getString("shotName");
-                                if(null!=shotName&&!shotName.trim().equals("")){
+                                if(null!=shotName&&!"".equals(shotName.trim())){
                                     etlInfo.setShotName(shotName);
                                 }
                             }
                             if(null!=planId){
                                 String companyName = userAllocationMapper.getCompanyNameByUserId(planId);
-                                if (null!=companyName&&!companyName.trim().equals("")){
+                                if (null!=companyName&&!"".equals(companyName.trim())){
                                     etlInfo.setCompanyName(companyName);
                                 }
                             }

+ 10 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceVideoReportServiceImpl.java

@@ -33,7 +33,17 @@ public class BytedanceVideoReportServiceImpl implements IBytedanceVideoReportSer
 
     @Override
     public PageInfo<JSONObject> getVideoReportBy(JSONArray accountIds, String startDate, String endDate, String filed, String target, String order, String clip, String shot, String plan,String leader, int pageSize, int pageNo) {
+        System.out.println("#################################################");
+        System.out.println("startDate:"+startDate);
+        System.out.println("endDate:"+endDate);
+        System.out.println("accountIds:"+accountIds);
         System.out.println("filed:"+filed);
+        System.out.println("target:"+target);
+        System.out.println("order:"+order);
+        System.out.println("accountIds:"+accountIds);
+        System.out.println("accountIds:"+accountIds);
+        System.out.println("accountIds:"+accountIds);
+        System.out.println("#################################################");
         PageHelper.startPage(pageNo,pageSize);
         List<JSONObject> jsonObjectList=bytedanceVideoReportMapper.queryVideoReportBy(accountIds,startDate,endDate,filed,target,order,clip,shot,plan,leader);
         return new PageInfo<>(jsonObjectList);

+ 4 - 4
jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ReportServiceImpl.java

@@ -195,12 +195,12 @@ public class ReportServiceImpl implements IReportService {
             if(null!=plan){
                 String status = plan.getToutiaoStatus();
                 String optStatus = plan.getOptStatus();
-                if(null == optStatus||optStatus.equals("AD_STATUS_DISABLE")||optStatus.trim().equals("")){
+                if(null == optStatus|| "AD_STATUS_DISABLE".equals(optStatus)|| "".equals(optStatus.trim())){
                     continue;
                 }
-                if(null == status||status.trim().equals("")||status.equals("AD_STATUS_DISABLE")
-                        ||status.equals("AD_STATUS_DONE")||status.equals("AD_STATUS_AUDIT_DENY")||status.equals("AD_STATUS_BALANCE_EXCEED")
-                        ||status.equals("AD_STATUS_CAMPAIGN_DISABLE")||status.equals("AD_STATUS_CAMPAIGN_EXCEED")||status.equals("AD_STATUS_DELETE")){
+                if(null == status|| "".equals(status.trim())|| "AD_STATUS_DISABLE".equals(status)
+                        || "AD_STATUS_DONE".equals(status)|| "AD_STATUS_AUDIT_DENY".equals(status)|| "AD_STATUS_BALANCE_EXCEED".equals(status)
+                        || "AD_STATUS_CAMPAIGN_DISABLE".equals(status)|| "AD_STATUS_CAMPAIGN_EXCEED".equals(status)|| "AD_STATUS_DELETE".equals(status)){
                     continue;
                 }
                 ruleDataPlan.setBudget(plan.getBudget());

+ 1 - 1
jeecg-boot-module-system/src/main/java/com/xxl/job/core/executor/impl/XxlJobSpringExecutor.java

@@ -162,7 +162,7 @@ public class XxlJobSpringExecutor extends XxlJobExecutor implements ApplicationC
 
     @Override
     public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
-        this.applicationContext = applicationContext;
+        XxlJobSpringExecutor.applicationContext = applicationContext;
     }
 
     public static ApplicationContext getApplicationContext() {

+ 6 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/config/Elasticsearch/ElasticsearchConfig.java

@@ -20,37 +20,37 @@ import java.util.ArrayList;
  */
 @Configuration
 public class ElasticsearchConfig {
-    @Value("${jeecg.elasticsearch.address}")
+    @Value("${elasticsearch.address}")
     private String address;
 
     /**
      *  连接超时时间
      */
-    @Value("${jeecg.elasticsearch.connect-timeout}")
+    @Value("${elasticsearch.connect-timeout}")
     private String connectTimeOut = "1000";
 
     /**
      * 连接超时时间
      */
-    @Value("${jeecg.elasticsearch.socket-timeout}")
+    @Value("${elasticsearch.socket-timeout}")
     private String socketTimeOut = "30000";
 
     /**
      * 获取连接的超时时间
      */
-    @Value("${jeecg.elasticsearch.connection-request-timeout}")
+    @Value("${elasticsearch.connection-request-timeout}")
     private String connectionRequestTimeOut = "500";
 
     /**
      * 最大连接数
      */
-    @Value("${jeecg.elasticsearch.max-connect-num}")
+    @Value("${elasticsearch.max-connect-num}")
     private String maxConnectNum = "100";
 
     /**
      * 最大路由连接数
      */
-    @Value("${jeecg.elasticsearch.max-connect-per-route}")
+    @Value("${elasticsearch.max-connect-per-route}")
     private String maxConnectPerRoute = "100";
 
 

+ 4 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ads/controller/AiKuaiShouReportAnalyzeCtrl.java

@@ -39,10 +39,10 @@ public class AiKuaiShouReportAnalyzeCtrl {
         if(params.isEmpty()){
             result.error500("参数为空");
         }else {
-            if(params.getString("type").equals("target")){
+            if("target".equals(params.getString("type"))){
                 result.setResult(aiKuaiShouReportAnalyzeService.getTargetReportBy(params));
             }
-            else if(params.getString("type").equals("material")){
+            else if("material".equals(params.getString("type"))){
                 result.setResult(aiKuaiShouReportAnalyzeService.getMaterialReportBy(params));
             }
             result.setSuccess(true);
@@ -57,10 +57,10 @@ public class AiKuaiShouReportAnalyzeCtrl {
         if(params.isEmpty()){
             result.error500("参数为空");
         }else {
-            if(params.getString("type").equals("target")){
+            if("target".equals(params.getString("type"))){
                 result.setResult(aiKuaiShouReportAnalyzeService.getTargetChartBy(params));
             }
-            else if(params.getString("type").equals("material")){
+            else if("material".equals(params.getString("type"))){
                 result.setResult(aiKuaiShouReportAnalyzeService.getMaterialChartBy(params));
             }
             result.setSuccess(true);

+ 8 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cas/util/XmlUtils.java

@@ -94,13 +94,15 @@ public final class XmlUtils {
 
             private StringBuilder buffer = new StringBuilder();
 
+            @Override
             public void startElement(final String uri, final String localName, final String qName,
-                    final Attributes attributes) throws SAXException {
+                                     final Attributes attributes) throws SAXException {
                 if (localName.equals(element)) {
                     this.foundElement = true;
                 }
             }
 
+            @Override
             public void endElement(final String uri, final String localName, final String qName) throws SAXException {
                 if (localName.equals(element)) {
                     this.foundElement = false;
@@ -109,6 +111,7 @@ public final class XmlUtils {
                 }
             }
 
+            @Override
             public void characters(char[] ch, int start, int length) throws SAXException {
                 if (this.foundElement) {
                     this.buffer.append(ch, start, length);
@@ -145,19 +148,22 @@ public final class XmlUtils {
 
             private boolean foundElement = false;
 
+            @Override
             public void startElement(final String uri, final String localName, final String qName,
-                    final Attributes attributes) throws SAXException {
+                                     final Attributes attributes) throws SAXException {
                 if (localName.equals(element)) {
                     this.foundElement = true;
                 }
             }
 
+            @Override
             public void endElement(final String uri, final String localName, final String qName) throws SAXException {
                 if (localName.equals(element)) {
                     this.foundElement = false;
                 }
             }
 
+            @Override
             public void characters(char[] ch, int start, int length) throws SAXException {
                 if (this.foundElement) {
                     builder.append(ch, start, length);

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

@@ -65,8 +65,8 @@ public class BytedanceVideoEtlInfoController {
 		String endDate = bytedanceVideoEtlInfo.getEndDate();
 		bytedanceVideoEtlInfo.setEndDate(null);
 		QueryWrapper<BytedanceVideoEtlInfo> queryWrapper = QueryGenerator.initQueryWrapper(bytedanceVideoEtlInfo, req.getParameterMap());
-		if(null!=type&&!type.equals("")){
-			if(type.trim().equals("valid")){
+		if(null!=type&&!"".equals(type)){
+			if("valid".equals(type.trim())){
 				//有效
 				if(null!=startDate&&!"".equals(startDate.trim())){
 					queryWrapper.ge("effect_date",startDate);
@@ -75,7 +75,7 @@ public class BytedanceVideoEtlInfoController {
 					queryWrapper.le("effect_date",endDate);
 				}
 				queryWrapper.le("effect_day_num",7);
-			}else if(type.trim().equals("hot")){
+			}else if("hot".equals(type.trim())){
 				//爆款
 				if(null!=startDate&&!"".equals(startDate.trim())){
 					queryWrapper.ge("faddish_date",startDate);
@@ -177,8 +177,8 @@ public class BytedanceVideoEtlInfoController {
 		String endDate = bytedanceVideoEtlInfo.getEndDate();
 		bytedanceVideoEtlInfo.setEndDate(null);
 		QueryWrapper<BytedanceVideoEtlInfo> queryWrapper = QueryGenerator.initQueryWrapper(bytedanceVideoEtlInfo, request.getParameterMap());
-		if(null!=type&&!type.equals("")){
-			if(type.trim().equals("valid")){
+		if(null!=type&&!"".equals(type)){
+			if("valid".equals(type.trim())){
 				//有效
 				if(null!=startDate&&!"".equals(startDate.trim())){
 					queryWrapper.ge("effect_date",startDate);
@@ -187,7 +187,7 @@ public class BytedanceVideoEtlInfoController {
 					queryWrapper.le("effect_date",endDate);
 				}
 				queryWrapper.le("effect_day_num",7);
-			}else if(type.trim().equals("hot")){
+			}else if("hot".equals(type.trim())){
 				//爆款
 				if(null!=startDate&&!"".equals(startDate.trim())){
 					queryWrapper.ge("faddish_date",startDate);

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

@@ -203,7 +203,7 @@ public class CallbackController {
                     userAllocation.setSystemType(systemType);
                     // 获取快手昵称
                     userAllocation.setAuthName((String) advertiseBaseInfoMap.get("userName"));
-                    if (null != authBeginTime && !authBeginTime.trim().equals("")) {
+                    if (null != authBeginTime && !"".equals(authBeginTime.trim())) {
                         userAllocation.setAuthBeginTime(authBeginTime);
                     }
                     userAllocation.setMediaId(mediaId);
@@ -385,7 +385,7 @@ public class CallbackController {
                             userAllocation.setProjectId(projectId);
                             userAllocation.setSystemType(systemType);
                             userAllocation.setAuthName((String) advertiserDataMap.get("name"));
-                            if (null != authBeginTime && !authBeginTime.trim().equals("")) {
+                            if (null != authBeginTime && !"".equals(authBeginTime.trim())) {
                                 userAllocation.setAuthBeginTime(authBeginTime);
                             }
                             userAllocation.setAdvertiserId(advertiserId);
@@ -440,7 +440,7 @@ public class CallbackController {
                     userAllocation.setProjectId(projectId);
                     userAllocation.setSystemType(systemType);
                     userAllocation.setAuthName((String) advertiserDataMap.get("name"));
-                    if (null != authBeginTime && !authBeginTime.trim().equals("")) {
+                    if (null != authBeginTime && !"".equals(authBeginTime.trim())) {
                         userAllocation.setAuthBeginTime(authBeginTime);
                     }
                     userAllocation.setAdvertiserId(advertiserId);

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

@@ -62,8 +62,8 @@ public class KuaishouVideoEtlInfoController {
        String endDate = kuaishouVideoEtlInfo.getEndDate();
        kuaishouVideoEtlInfo.setEndDate(null);
        QueryWrapper<KuaishouVideoEtlInfo> queryWrapper = QueryGenerator.initQueryWrapper(kuaishouVideoEtlInfo, req.getParameterMap());
-       if(null!=type&&!type.equals("")){
-           if(type.trim().equals("valid")){
+       if(null!=type&&!"".equals(type)){
+           if("valid".equals(type.trim())){
                //有效
                if(null!=startDate&&!"".equals(startDate.trim())){
                    queryWrapper.ge("effect_date",startDate);
@@ -72,7 +72,7 @@ public class KuaishouVideoEtlInfoController {
                    queryWrapper.le("effect_date",endDate);
                }
                queryWrapper.lt("effect_day_num",7);
-           }else if(type.trim().equals("hot")){
+           }else if("hot".equals(type.trim())){
                //爆款
                if(null!=startDate&&!"".equals(startDate.trim())){
                    queryWrapper.ge("faddish_date",startDate);
@@ -185,8 +185,8 @@ public class KuaishouVideoEtlInfoController {
      String endDate = kuaishouVideoEtlInfo.getEndDate();
      kuaishouVideoEtlInfo.setEndDate(null);
      QueryWrapper<KuaishouVideoEtlInfo> queryWrapper = QueryGenerator.initQueryWrapper(kuaishouVideoEtlInfo, request.getParameterMap());
-     if(null!=type&&!type.equals("")){
-         if(type.trim().equals("valid")){
+     if(null!=type&&!"".equals(type)){
+         if("valid".equals(type.trim())){
              //有效
              if(null!=startDate&&!"".equals(startDate.trim())){
                  queryWrapper.ge("effect_date",startDate);
@@ -195,7 +195,7 @@ public class KuaishouVideoEtlInfoController {
                  queryWrapper.le("effect_date",endDate);
              }
              queryWrapper.lt("effect_day_num",7);
-         }else if(type.trim().equals("hot")){
+         }else if("hot".equals(type.trim())){
              //爆款
              if(null!=startDate&&!"".equals(startDate.trim())){
                  queryWrapper.ge("faddish_date",startDate);

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

@@ -782,6 +782,7 @@ public class MaterialInfoController {
         if (materialInfoEntity == null) {
             return result.error500("未找到对应实体");
         }
+        //TODO 驳回重新上传素材时需要清空素材的水印信息数据
         String url = materialInfo.getUrl();
         if (!Check.isNull(url)) {
             if (!url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {

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

@@ -90,18 +90,60 @@ public class ProjectMemberController {
      * @param userId
      * @return
      */
+    @Autowired
+    private IProductService productService;
+
     @GetMapping(value = "/participateList")
     public Map<String, Object> participateList(String userId) {
         Map<String, Object> map = new HashMap<>();
         try {
+            QueryWrapper<ProjectMember> queryWrapper = new QueryWrapper<>();
             String roleCode = sysRoleService.getRoleCodeByUserId(userId);
             if (!"admin".equals(roleCode) && !roleCode.contains("sale") && !"meidaManager".equals(roleCode)) {
-                userId = null;
+                queryWrapper.eq("user_id", userId);
+            }
+            queryWrapper.groupBy("project_id");
+            queryWrapper.orderByDesc("create_time");
+            List<ProjectMember> projectMembers = projectMemberMapper.selectList(queryWrapper);
+            List<ProjectMember> projectMemberList = new ArrayList<>();
+            if (!Check.isNull(projectMembers)) {
+                for (ProjectMember projectMember : projectMembers) {
+                    if (Check.isNull(projectMember)) {
+                        continue;
+                    }
+                    Project project = projectService.getById(projectMember.getProjectId());
+                    if (!Check.isNull(project)) {
+                        SysUser responsible = sysUserService.getById(project.getResponsibleId());
+
+                        if (!Check.isNull(responsible)) {
+                            projectMember.setResponsibleName(responsible.getRealname());
+                        }
+
+                        SysUser designResponsible = sysUserService.getById(project.getDesignResponsibleId());
+                        if (!Check.isNull(designResponsible)) {
+                            projectMember.setDesignResponsibleName(designResponsible.getRealname());
+                        }
+
+                        projectMember.setProjectName(project.getProjectName());
+                        Product product = productService.getById(project.getProductId());
+                        if (!Check.isNull(product)) {
+                            projectMember.setProductId(product.getId());
+                            projectMember.setProductName(product.getProductName());
+                        }
+                        Advertiser advertiser = advertiserService.getById(project.getAdvertiserId());
+                        if (!Check.isNull(advertiser)) {
+                            projectMember.setAdvertiserName(advertiser.getName());
+                        }
+                        projectMember.setAdvertiserId(project.getAdvertiserId());
+                        projectMember.setMediaId(project.getMediaId());
+                        projectMember.setMaxBid(project.getMaxBid());
+                        projectMemberList.add(projectMember);
+                    }
+                }
             }
-            List <ProjectMember> projectMembers = projectMemberMapper.getlistByUserId(userId);
             map.put("code", 0);
             map.put("success", true);
-            map.put("result", projectMembers);
+            map.put("result", projectMemberList);
         } catch (Exception e) {
             e.printStackTrace();
             map.put("success", false);
@@ -281,7 +323,7 @@ public class ProjectMemberController {
                 throw new Exception("请选择项目");
             }
             Project project = projectService.getById(projectId);
-            if(Check.isNull(project)){
+            if (Check.isNull(project)) {
                 throw new Exception("项目不存在");
             }
             JSONArray memberArr = jsonObject.getJSONArray("memberArr");

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

@@ -674,7 +674,7 @@ public class TestController {
     public Map<String, Object> getKuaishouPlanHourlyReport(String params) {
         Long start = System.currentTimeMillis();
         Map<String, Object> result = new HashMap<>();
-        if (null == params || params.trim().equals("")) {
+        if (null == params || "".equals(params.trim())) {
             ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
             result.put("message", "COMMON_PARAM_ERROR");
             return result;

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

@@ -195,7 +195,7 @@ public class UserAllocationController {
         projectMemberService.getOwnProjects(mediaList);
         List<ProjectMember> projectMemberList = new ArrayList<>();
         for (ProjectMember projectMember : projectList) {
-            if (projectMember.getProductId() != productId) {
+            if (!projectMember.getProductId().equals(productId)) {
                 continue;
             }
             List<UserAllocation> userAllocationList = userAllocationService.getAccountListByUserIdAndProductId(userId, projectMember.getProjectId(), productId);

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

@@ -488,7 +488,7 @@ public class MaterialReportOverViewServiceImpl implements IMaterialReportOverVie
         //String currentUser = "e9ca23d68d884d4ebb19d07889727dae";
         //TODO 为了解决管理员等角色初始化查全部项目查询效率慢的问题判断角色,待优化
         String roleCode = roleService.getRoleCodeByUserId(currentUser);
-        if (roleCode.equals("admin")) {
+        if ("admin".equals(roleCode)) {
             return null;
         }
         return Check.isNull(queryProjectIdBy(recursiveQuerySubordinate(currentUser), mediaId)) ? null : queryProjectIdBy(recursiveQuerySubordinate(currentUser), mediaId);

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

@@ -68,7 +68,7 @@ public class PlatformMaterialServiceImpl extends ServiceImpl<PlatformMaterialMap
     public List<JSONObject> queryMaterialsByDesignUserId(String materialStatus, String designUserId) {
         JSONArray materialStatusJsonArray = JsonArrayUtil.Varchar2JSONArray(materialStatus);
         List<JSONObject> result = new ArrayList<>();
-        if (materialStatus.equals("0")) {
+        if ("0".equals(materialStatus)) {
             result = platformMaterialMapper.queryMaterialsByDesignLeader(materialStatusJsonArray, designUserId);
         } else {
             result = platformMaterialMapper.queryMaterialsByDesignUserId(materialStatusJsonArray, designUserId);

+ 81 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/LoginController.java

@@ -1,13 +1,23 @@
 package org.jeecg.modules.system.controller;
 
-import cn.com.ctop.common.module.service.ISysDepartService;
-import cn.com.ctop.common.module.service.ISysDictService;
-import cn.com.ctop.common.module.service.ISysUserService;
+import cn.com.ctop.common.module.entity.CtopCorpWexinUser;
+import cn.com.ctop.common.module.entity.WexinConfig;
+import cn.com.ctop.common.module.service.*;
+import cn.com.ctop.common.module.utils.Check;
 import cn.hutool.core.util.RandomUtil;
 import com.alibaba.fastjson.JSONObject;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import lombok.val;
+import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.cp.api.WxCpOAuth2Service;
+import me.chanjar.weixin.cp.api.WxCpUserService;
+import me.chanjar.weixin.cp.api.impl.WxCpServiceImpl;
+import me.chanjar.weixin.cp.api.impl.WxCpUserServiceImpl;
+import me.chanjar.weixin.cp.bean.WxCpOauth2UserInfo;
+import me.chanjar.weixin.cp.bean.WxCpUser;
+import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.constant.CacheConstant;
@@ -91,6 +101,74 @@ public class LoginController {
 		sysBaseApi.addLog("用户名: " + username + ",登录成功!", CommonConstant.LOG_TYPE_1, null);
 		return result;
 	}
+
+	@Autowired
+	private ICtopCorpWexinUserService ctopCorpWexinUserService;
+	@Autowired
+	private IWexinConfigService wexinConfigService;
+
+	@RequestMapping(value = "/wxlogin", method = RequestMethod.POST)
+	@ApiOperation("企业微信登录接口")
+	public Result<JSONObject> wxlogin(@RequestParam(name = "code") String code, @RequestParam(name = "corpId") String corpId) throws Exception {
+		Result<JSONObject> result = new Result<>();
+		WexinConfig wexinConfig = wexinConfigService.getInfoByCorpId(corpId);
+		if (Check.isNull(wexinConfig)) {
+			result.error500("未找到用户配置,请联系管理员");
+			return result;
+		}
+		val configStorage = new WxCpDefaultConfigImpl();
+		configStorage.setCorpId(wexinConfig.getCorpId());
+		configStorage.setAgentId(wexinConfig.getAgentId());
+		configStorage.setCorpSecret(wexinConfig.getCorpSecret());
+		configStorage.setToken(wexinConfig.getToken());
+		configStorage.setAesKey(wexinConfig.getAesKey());
+		val service = new WxCpServiceImpl();
+		service.setWxCpConfigStorage(configStorage);
+		WxCpOAuth2Service wxCpOAuth2Service = service.getOauth2Service();
+		try {
+			WxCpOauth2UserInfo userInfo = wxCpOAuth2Service.getUserInfo(1000002, code);
+			if (userInfo != null && userInfo.getUserId() != null) {
+				WxCpUserService wxCpUserService = new WxCpUserServiceImpl(service);
+				WxCpUser user = wxCpUserService.getById(userInfo.getUserId());
+				String email = user.getEmail();
+				SysUser sysUser = sysUserService.getUserByEmail(email);
+				if (sysUser == null) {
+					result.error500("该用户未注册系统账户,请联系管理员");
+					return result;
+				}
+				if (sysUser.getStatus() != 1) {
+					result.error500("该用户已冻结,请联系管理员");
+					return result;
+				}
+				String departId = sysDepartService.selectIdByOrdCode(sysUser.getOrgCode());
+				sysUser.setDepartId(departId);
+				result = sysUserService.checkUserIsEffective(sysUser);
+				if (!result.isSuccess()) {
+					return result;
+				}
+				//用户登录信息
+				userInfo(sysUser, result);
+				sysBaseApi.addLog("用户名: " + email + ",登录成功!", CommonConstant.LOG_TYPE_1, null);
+				CtopCorpWexinUser ctopCorpWexinUser = ctopCorpWexinUserService.getById(sysUser.getId());
+				if (ctopCorpWexinUser == null) {
+					ctopCorpWexinUser = new CtopCorpWexinUser();
+					ctopCorpWexinUser.setCorpId(corpId);
+					ctopCorpWexinUser.setUserId(sysUser.getId());
+					ctopCorpWexinUser.setWexinEmail(user.getEmail());
+					ctopCorpWexinUser.setWexinGender(user.getGender().getGenderName());
+					ctopCorpWexinUser.setWexinName(user.getName());
+					ctopCorpWexinUser.setWexinId(user.getUserId());
+					ctopCorpWexinUser.setWexinMobile(user.getMobile());
+					ctopCorpWexinUserService.save(ctopCorpWexinUser);
+				}
+				return result;
+			}
+		} catch (WxErrorException e) {
+			result.error500("企业微信授权错误");
+			e.printStackTrace();
+		}
+		return result;
+	}
 	
 	/**
 	 * 退出登录

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysPermissionController.java

@@ -237,7 +237,7 @@ public class SysPermissionController {
 			result.setResult(json);
 			result.success("查询成功");
 		} catch (Exception e) {
-			result.error500("查询失败:" + e.getMessage());  
+			result.error500("查询失败:" + e.getMessage());
 			log.error(e.getMessage(), e);
 		}
 		return result;

+ 6 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/rule/CategoryCodeRule.java

@@ -28,11 +28,15 @@ public class CategoryCodeRule implements IFillRuleHandler {
 
         if (formData != null && formData.size() > 0) {
             Object obj = formData.get("pid");
-            if (oConvertUtils.isNotEmpty(obj)) categoryPid = obj.toString();
+            if (oConvertUtils.isNotEmpty(obj)){
+                categoryPid = obj.toString();
+            }
         } else {
             if (params != null) {
                 Object obj = params.get("pid");
-                if (oConvertUtils.isNotEmpty(obj)) categoryPid = obj.toString();
+                if (oConvertUtils.isNotEmpty(obj)){
+                    categoryPid = obj.toString();
+                }
             }
         }
 

+ 3 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/rule/OrderNumberRule.java

@@ -20,7 +20,9 @@ public class OrderNumberRule implements IFillRuleHandler {
         //订单前缀默认为CN 如果规则参数不为空,则取自定义前缀
         if (params != null) {
             Object obj = params.get("prefix");
-            if (obj != null) prefix = obj.toString();
+            if (obj != null) {
+                prefix = obj.toString();
+            }
         }
         SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
         int random = RandomUtils.nextInt(90) + 10;

+ 3 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/rule/OrgCodeRule.java

@@ -38,7 +38,9 @@ public class OrgCodeRule implements IFillRuleHandler {
         String parentId = null;
         if (formData != null && formData.size() > 0) {
             Object obj = formData.get("parentId");
-            if (obj != null) parentId = obj.toString();
+            if (obj != null) {
+                parentId = obj.toString();
+            }
         } else {
             if (params != null) {
                 Object obj = params.get("parentId");

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/controller/WpsFileController.java

@@ -76,7 +76,7 @@ public class WpsFileController {
 		wpsFile.setName(null);
 		Result<IPage<WpsFile>> result = new Result<>();
 		QueryWrapper<WpsFile> queryWrapper = QueryGenerator.initQueryWrapper(wpsFile, req.getParameterMap());
-		if(null!=name&&!name.trim().equals("")){
+		if(null!=name&&!"".equals(name.trim())){
 			queryWrapper.like("name",name);
 		}
 		//只查询题库的文件

+ 17 - 2
jeecg-cloud-module/jeecg-cloud-gateway/src/main/resources/application-test.yml

@@ -1,11 +1,23 @@
 spring:
+  redis:
+    database: 0
+    host: 127.0.0.1
+    password:
+    port: 6379
+    lettuce:
+      pool:
+        max-active: 8   #最大连接数据库连接数,设 0 为没有限制
+        max-idle: 8     #最大等待连接中的数量,设 0 为没有限制
+        max-wait: -1ms  #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
+        min-idle: 0     #最小等待连接中的数量,设 0 为没有限制
+      shutdown-timeout: 100ms
   cloud:
     nacos:
       config:
         password:
         username:
       discovery:
-        server-addr: 172.30.0.7:8848
+        server-addr: 172.30.0.14:8848
         service: jeecg-gateway
         namespace:
     gateway:
@@ -21,12 +33,15 @@ spring:
             allowedHeaders: "*"
       routes:
       - id: jeecg-system
-#        uri: http://localhost:7001
         uri: lb://jeecg-system
+        filters:
+          - DedupeResponseHeader=Access-Control-Allow-Credentials Access-Control-Allow-Origin
         predicates:
           - Path=/jeecg-boot/**
       - id: jeecg-bytedance-ad
         uri: lb://jeecg-bytedance-ad
+        filters:
+          - DedupeResponseHeader=Access-Control-Allow-Credentials Access-Control-Allow-Origin
         predicates:
           - Path=/bytedance/ad/**
 # hystrix 信号量隔离,3秒后自动超时

+ 10 - 0
jeecg-cloud-module/jeecg-cloud-system-start/pom.xml

@@ -59,6 +59,13 @@
     <build>
         <resources>
             <resource>
+                <directory>../../lib</directory>
+                <targetPath>BOOT-INF/lib/</targetPath>
+                <includes>
+                    <include>**/*.jar</include>
+                </includes>
+            </resource>
+            <resource>
                 <directory>src/main/resources</directory>
                 <!--先排除所有的配置文件-->
                 <excludes>
@@ -79,6 +86,9 @@
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <includeSystemScope>true</includeSystemScope>
+                </configuration>
             </plugin>
         </plugins>
     </build>

+ 7 - 0
jeecg-cloud-module/jeecg-cloud-system-start/src/main/resources/application-dev.yml

@@ -1,3 +1,10 @@
+server:
+  port: 7001
+  servlet:
+    context-path: /jeecg-boot
+    compression:
+      enabled: true
+      mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
 dubbo:
   application:
     id: sys-center-dubbo-prodiver

+ 8 - 1
jeecg-cloud-module/jeecg-cloud-system-start/src/main/resources/application-prod.yml

@@ -1,3 +1,10 @@
+server:
+  port: 7001
+  servlet:
+    context-path: /jeecg-boot
+    compression:
+      enabled: true
+      mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
 dubbo:
   application:
     id: sys-center-dubbo-prodiver
@@ -69,7 +76,7 @@ spring:
   autoconfigure:
     exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
   datasource:
-    url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=GMT%2B8
+    url: jdbc:mysql://172.30.0.4:3390/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=GMT%2B8
     username: data
     password: hcst@2021
     driver-class-name: com.mysql.jdbc.Driver

+ 21 - 2
jeecg-cloud-module/jeecg-cloud-system-start/src/main/resources/application-test.yml

@@ -1,9 +1,16 @@
+server:
+  port: 8806
+  servlet:
+    context-path: /jeecg-boot
+    compression:
+      enabled: true
+      mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
 dubbo:
   application:
     id: sys-center-dubbo-prodiver
     name: sys-center-dubbo-prodiver
   registry:
-    address: nacos://127.0.0.1:8848
+    address: nacos://172.30.0.14:8848
   protocol:
     name: dubbo
     port: 20880
@@ -20,6 +27,11 @@ management:
       exposure:
         include: metrics,httptrace
 spring:
+  cloud:
+    nacos:
+      discovery:
+        server-addr: 172.30.0.14:8848
+        service: jeecg-system
   servlet:
     multipart:
       max-file-size: -1
@@ -111,7 +123,6 @@ spring:
   #redis 配置
   redis:
     database: 0
-    #    host: 172.30.0.17
     host: 127.0.0.1
     password:
     port: 6379
@@ -254,3 +265,11 @@ ai:
     callback-creative-url: http://192.168.1.193:31012/ai_callback_add_creative
 xxl-job:
   requestUrl: http://jiaoyangapi.shyouteng.com.cn
+
+elasticsearch:
+  address: 192.168.1.251:9200  #如果是集群,用逗号隔开
+  connect-timeout: 1000   #连接超时时间
+  socket-timeout: 30000   #连接超时时间
+  connection-request-timeout: 500
+  max-connect-num: 100
+  max-connect-per-route: 100

+ 0 - 0
jeecg-cloud-module/jeecg-cloud-system-start/src/main/resources/application.yml


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff