Parcourir la source

合并最新master代码

syh il y a 4 ans
Parent
commit
573563d5f6
100 fichiers modifiés avec 4582 ajouts et 1475 suppressions
  1. 13 12
      jeecg-boot-base-common/src/main/java/org/jeecg/common/api/vo/Result.java
  2. 54 0
      jeecg-boot-module-system/pom.xml
  3. 0 0
      jeecg-boot-module-system/src/main/java/org/jeecg/JeecgOneGui.java
  4. 60 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/RuleEngineConfig.java
  5. 7 3
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  6. 0 5
      jeecg-boot-module-system/src/main/java/org/jeecg/config/mybatis/MybatisInterceptor.java
  7. 0 11
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ByteDanceTemplateController.java
  8. 0 203
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/DramaInfoController.java
  9. 0 162
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/DramaItemInfoController.java
  10. 0 164
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/DramaRoleInfoController.java
  11. 66 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectController.java
  12. 115 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java
  13. 0 75
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/DramaInfo.java
  14. 0 100
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/DramaItemInfo.java
  15. 0 77
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/DramaRoleInfo.java
  16. 6 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/ProjectMember.java
  17. 0 14
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/DramaInfoMapper.java
  18. 0 15
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/DramaItemInfoMapper.java
  19. 0 15
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/DramaRoleInfoMapper.java
  20. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/ProjectMemberMapper.java
  21. 0 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/DramaItemInfoMapper.xml
  22. 0 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/DramaRoleInfoMapper.xml
  23. 43 15
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ProjectMemberMapper.xml
  24. 0 17
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IDramaInfoService.java
  25. 0 23
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IDramaItemInfoService.java
  26. 0 18
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IDramaRoleInfoService.java
  27. 6 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IProjectMemberService.java
  28. 9 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IRuleEngineService.java
  29. 0 35
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/DramaInfoServiceImpl.java
  30. 0 77
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/DramaItemInfoServiceImpl.java
  31. 0 28
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/DramaRoleInfoServiceImpl.java
  32. 67 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java
  33. 21 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/RuleEngineServiceImpl.java
  34. 9 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/vo/QueryParam.java
  35. 8 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/vo/RuleResult.java
  36. 3 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/wps/entity/WpsFile.java
  37. 0 2
      jeecg-boot-module-system/src/main/resources/application-wps.yml
  38. 17 0
      jeecg-boot-module-system/src/main/resources/drools/rule.drl
  39. 17 0
      jeecg-boot-module-system/src/main/resources/drools/rule2.drl
  40. 85 6
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  41. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IFileInfoService.java
  42. 2 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/BindAccountAuthServiceImpl.java
  43. 24 5
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/FileInfoServiceImpl.java
  44. 0 8
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/entity/KuaishouHotPhotoInfo.java
  45. 0 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java
  46. 216 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouController.java
  47. 158 27
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/MaterialRefuseController.java
  48. 16 5
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouUpdateServiceImpl.java
  49. 1 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/MaterialRefuseServiceImpl.java
  50. 23 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouInfoDTO.java
  51. 54 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyAccountDTO.java
  52. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouVideoInfoDTO.java
  53. 45 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/ProjectAccountDTO.java
  54. 100 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/ProjectMember.java
  55. 34 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyAccountMapper.java
  56. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaiShouYiCheReportMapper.xml
  57. 576 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml
  58. 20 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouReportDailyAccountService.java
  59. 171 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouReportDailyAccountServiceImpl.java
  60. 11 0
      module-toutiao/pom.xml
  61. 109 26
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/batch/controller/ByteDanceBatchController.java
  62. 150 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/batch/controller/BytedanceIndustryInfoController.java
  63. 53 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/batch/entity/BytedanceIndustryInfo.java
  64. 14 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/batch/mapper/BytedanceIndustryInfoMapper.java
  65. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/DramaInfoMapper.xml
  66. 19 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/batch/service/IBytedanceIndustryInfoService.java
  67. 116 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/batch/service/impl/BytedanceIndustryInfoServiceImpl.java
  68. 91 34
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceAdvertisePlanController.java
  69. 13 13
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceCampaignController.java
  70. 39 16
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceCreativeController.java
  71. 241 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/BytedanceImageInfoController.java
  72. 75 20
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceAdvertisePlan.java
  73. 3 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceAudiencePackage.java
  74. 1 11
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceCampaign.java
  75. 7 4
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceCreative.java
  76. 1 17
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceVideoInfo.java
  77. 95 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/BytedanceImageInfo.java
  78. 18 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/BytedanceImageInfoMapper.java
  79. 35 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/xml/BytedanceImageInfoMapper.xml
  80. 4 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IByteDanceAdvertisePlanService.java
  81. 2 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IByteDanceAdvertiserDataService.java
  82. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IByteDanceCampaignService.java
  83. 3 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IByteDanceCreativeService.java
  84. 17 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IBytedanceImageInfoService.java
  85. 223 161
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceAdvertisePlanServiceImpl.java
  86. 52 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceAdvertiserDataServiceImpl.java
  87. 2 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceCampaignServiceImpl.java
  88. 293 9
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceCreativeServiceImpl.java
  89. 26 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/BytedanceImageInfoServiceImpl.java
  90. 101 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/DTO/ByteDanceReportAccountDailyDTO.java
  91. 21 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/DTO/BytedanceInfoDTO.java
  92. 74 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/controller/BytedanceReportController.java
  93. 21 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/BytedanceAccountReportMapper.java
  94. 257 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceAccountReportMapper.xml
  95. 10 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IBytedanceAccountReportService.java
  96. 62 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceAccountReportServiceImpl.java
  97. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceHomepageReportServiceImpl.java
  98. 251 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/utils/ApkUtils.java
  99. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/utils/LinkUtils.java
  100. 0 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/tool/constants/QueryToolUrlConstant.java

+ 13 - 12
jeecg-boot-base-common/src/main/java/org/jeecg/common/api/vo/Result.java

@@ -1,10 +1,11 @@
 package org.jeecg.common.api.vo;
 
-import java.io.Serializable;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
-import org.jeecg.common.constant.CommonConstant;
 import lombok.Data;
+import org.jeecg.common.constant.CommonConstant;
+
+import java.io.Serializable;
 
 /**
  *   接口返回数据格式
@@ -35,7 +36,7 @@ public class Result<T> implements Serializable {
 	 */
 	@ApiModelProperty(value = "返回代码")
 	private Integer code = 0;
-	
+
 	/**
 	 * 返回数据对象 data
 	 */
@@ -49,7 +50,7 @@ public class Result<T> implements Serializable {
 	private long timestamp = System.currentTimeMillis();
 
 	public Result() {
-		
+
 	}
 
 	public Result<T> success(String message) {
@@ -60,35 +61,35 @@ public class Result<T> implements Serializable {
 	}
 
 	public static Result<Object> ok() {
-		Result<Object> r = new Result<Object>();
+		Result<Object> r = new Result<>();
 		r.setSuccess(true);
 		r.setCode(CommonConstant.SC_OK_200);
 		r.setMessage("成功");
 		return r;
 	}
-	
+
 	public static Result<Object> ok(String msg) {
-		Result<Object> r = new Result<Object>();
+		Result<Object> r = new Result<>();
 		r.setSuccess(true);
 		r.setCode(CommonConstant.SC_OK_200);
 		r.setMessage(msg);
 		return r;
 	}
-	
+
 	public static Result<Object> ok(Object data) {
-		Result<Object> r = new Result<Object>();
+		Result<Object> r = new Result<>();
 		r.setSuccess(true);
 		r.setCode(CommonConstant.SC_OK_200);
 		r.setResult(data);
 		return r;
 	}
-	
+
 	public static Result<Object> error(String msg) {
 		return error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, msg);
 	}
-	
+
 	public static Result<Object> error(int code, String msg) {
-		Result<Object> r = new Result<Object>();
+		Result<Object> r = new Result<>();
 		r.setCode(code);
 		r.setMessage(msg);
 		r.setSuccess(false);

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

@@ -176,6 +176,60 @@
             <artifactId>pagehelper</artifactId>
             <version>5.1.11</version>
         </dependency>
+
+        <!--drools规则引擎-->
+        <dependency>
+            <groupId>org.drools</groupId>
+            <artifactId>drools-core</artifactId>
+            <version>7.6.0.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>org.drools</groupId>
+            <artifactId>drools-compiler</artifactId>
+            <version>7.6.0.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>org.drools</groupId>
+            <artifactId>drools-templates</artifactId>
+            <version>7.6.0.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>org.kie</groupId>
+            <artifactId>kie-api</artifactId>
+            <version>7.6.0.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>org.kie</groupId>
+            <artifactId>kie-spring</artifactId>
+            <version>7.6.0.Final</version>
+        </dependency>
+
+        <!--drools规则引擎-->
+        <dependency>
+            <groupId>org.drools</groupId>
+            <artifactId>drools-core</artifactId>
+            <version>7.6.0.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>org.drools</groupId>
+            <artifactId>drools-compiler</artifactId>
+            <version>7.6.0.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>org.drools</groupId>
+            <artifactId>drools-templates</artifactId>
+            <version>7.6.0.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>org.kie</groupId>
+            <artifactId>kie-api</artifactId>
+            <version>7.6.0.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>org.kie</groupId>
+            <artifactId>kie-spring</artifactId>
+            <version>7.6.0.Final</version>
+        </dependency>
     </dependencies>
 
     <dependencyManagement>

jeecg-boot-module-system/src/main/java/org/jeecg/JeecgOneGUI.java → jeecg-boot-module-system/src/main/java/org/jeecg/JeecgOneGui.java


+ 60 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/RuleEngineConfig.java

@@ -0,0 +1,60 @@
+package org.jeecg.config;
+
+import org.kie.api.KieBase;
+import org.kie.api.KieServices;
+import org.kie.api.builder.KieBuilder;
+import org.kie.api.builder.KieFileSystem;
+import org.kie.api.builder.KieRepository;
+import org.kie.api.runtime.KieContainer;
+import org.kie.api.runtime.KieSession;
+import org.kie.internal.io.ResourceFactory;
+import org.kie.spring.KModuleBeanFactoryPostProcessor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.core.io.support.ResourcePatternResolver;
+
+import java.io.IOException;
+
+@Configuration
+public class RuleEngineConfig {
+    private static final Logger LOGGER = LoggerFactory.getLogger(RuleEngineConfig.class) ;
+    private static final String RULES_PATH = "drools/";
+    private final KieServices kieServices = KieServices.Factory.get();
+    @Bean
+    public KieFileSystem kieFileSystem() throws IOException {
+        KieFileSystem kieFileSystem = kieServices.newKieFileSystem();
+        ResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver();
+        Resource[] files = resourcePatternResolver.getResources("classpath*:" + RULES_PATH + "*.*");
+        String path = null;
+        for (Resource file : files) {
+            path = RULES_PATH + file.getFilename();
+            LOGGER.info("path="+path);
+            kieFileSystem.write(ResourceFactory.newClassPathResource(path, "UTF-8"));
+        }
+        return kieFileSystem;
+    }
+    @Bean
+    public KieContainer kieContainer() throws IOException {
+        KieRepository kieRepository = kieServices.getRepository();
+        kieRepository.addKieModule(kieRepository::getDefaultReleaseId);
+        KieBuilder kieBuilder = kieServices.newKieBuilder(kieFileSystem());
+        kieBuilder.buildAll();
+        return kieServices.newKieContainer(kieRepository.getDefaultReleaseId());
+    }
+    @Bean
+    public KieBase kieBase() throws IOException {
+        return kieContainer().getKieBase();
+    }
+    @Bean
+    public KieSession kieSession() throws IOException {
+        return kieContainer().newKieSession();
+    }
+    @Bean
+    public KModuleBeanFactoryPostProcessor kiePostProcessor() {
+        return new KModuleBeanFactoryPostProcessor();
+    }
+}

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

@@ -89,6 +89,11 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/ctop/bytedanceAreaInfo/**", "anon");
         filterChainDefinitionMap.put("/ctop/bytedanceInterestCategory/**", "anon");
         filterChainDefinitionMap.put("/template/creative/words/get", "anon");
+        filterChainDefinitionMap.put("template/bytedance/industry/list", "anon");
+
+        filterChainDefinitionMap.put("/bytedance/batch/creative/words/get", "anon");
+        filterChainDefinitionMap.put("/bytedance/batch/action/text", "anon");
+        filterChainDefinitionMap.put("/bytedance/batch/industry/list", "anon");
         filterChainDefinitionMap.put("/appium/crawler/*", "anon");
 
         filterChainDefinitionMap.put("/ctop/kuaishouChannelRegInfo/*", "anon");
@@ -141,9 +146,7 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/toutiao/loadSingleData", "anon");
         filterChainDefinitionMap.put("/kuaishou/getReport/historyData", "anon");
         filterChainDefinitionMap.put("/toutiao/advertiser/**", "anon");
-        filterChainDefinitionMap.put("/template/convert/list", "anon");
-        filterChainDefinitionMap.put("/template/convert/list/url", "anon");
-        //文件上传接口
+        filterChainDefinitionMap.put("/template/convert/**", "anon");//文件上传接口
         filterChainDefinitionMap.put("/upload/**", "anon");
         filterChainDefinitionMap.put("/appium/appiumTask/run", "anon");
 
@@ -163,6 +166,7 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/ks/web/test", "anon");
         filterChainDefinitionMap.put("/ureport/**", "anon");
         filterChainDefinitionMap.put("/job/test/*", "anon");
+        //filterChainDefinitionMap.put("/kuaishou/**", "anon");
 
         // 添加自己的过滤器并且取名为jwt
         Map<String, Filter> filterMap = new HashMap<>(1);

+ 0 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/config/mybatis/MybatisInterceptor.java

@@ -34,12 +34,8 @@ public class MybatisInterceptor implements Interceptor {
 	@Override
 	public Object intercept(Invocation invocation) throws Throwable {
 		MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0];
-		String sqlId = mappedStatement.getId();
-		log.debug("------sqlId------" + sqlId);
 		SqlCommandType sqlCommandType = mappedStatement.getSqlCommandType();
 		Object parameter = invocation.getArgs()[1];
-		log.debug("------sqlCommandType------" + sqlCommandType);
-
 		if (parameter == null) {
 			return invocation.proceed();
 		}
@@ -47,7 +43,6 @@ public class MybatisInterceptor implements Interceptor {
 			LoginUser sysUser = this.getLoginUser();
 			Field[] fields = oConvertUtils.getAllFields(parameter);
 			for (Field field : fields) {
-				log.debug("------field.name------" + field.getName());
 				try {
 					if ("createBy".equals(field.getName())) {
 						field.setAccessible(true);

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

@@ -128,15 +128,4 @@ public class ByteDanceTemplateController {
         return fileInfoService.getSiteList(accountId);
     }
 
-    /**
-     * 获取动态词包信息
-     *
-     * @param accountId
-     * @return
-     */
-    @GetMapping("creative/words/get")
-    public Map<String, Object> getCreativeWords(Long accountId) {
-        return fileInfoService.getCreativeWords(accountId);
-    }
-
 }

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

@@ -1,203 +0,0 @@
-package org.jeecg.modules.ctop.controller;
-
-import cn.com.ctop.common.module.annotation.AutoLog;
-import cn.com.ctop.common.module.utils.ResultMapUtils;
-import cn.com.ctop.common.module.utils.StatusCode;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shiro.SecurityUtils;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.system.vo.LoginUser;
-import org.jeecg.modules.ctop.entity.DramaInfo;
-import org.jeecg.modules.ctop.entity.DramaItemInfo;
-import org.jeecg.modules.ctop.entity.DramaRoleInfo;
-import org.jeecg.modules.ctop.service.IDramaInfoService;
-import org.jeecg.modules.ctop.service.IDramaItemInfoService;
-import org.jeecg.modules.ctop.service.IDramaRoleInfoService;
-import org.jeecg.modules.system.entity.SysCategory;
-import org.jeecg.modules.system.service.ISysCategoryService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.*;
-
-/**
- * 剧本信息
- * @author jeecg-boot
- * @date   2020-03-04
- * @version V1.0
- */
-@Slf4j
-@Api(tags="剧本信息")
-@RestController
-@RequestMapping("/ctop/dramaInfo")
-public class DramaInfoController {
-	@Autowired
-	private IDramaInfoService dramaInfoService;
-	@Autowired
-	private IDramaItemInfoService dramaItemInfoService;
-	@Autowired
-	private IDramaRoleInfoService dramaRoleInfoService;
-	@Autowired
-	private ISysCategoryService categoryService;
-
-	@GetMapping("/detail")
-	public Map<String, Object> getDetail(Long dramaId) {
-		Map<String, Object> result = new HashMap<>();
-		List<DramaItemInfo> itemInfos = dramaItemInfoService.getByDramaId(dramaId);
-        List<DramaItemInfo> getItemInfos = new ArrayList<>();
-        for (DramaItemInfo itemInfo : itemInfos) {
-            if (itemInfo.getType() == 2) {
-                DramaRoleInfo roleInfo = dramaRoleInfoService.getById(itemInfo.getRoleId());
-                itemInfo.setRoleName(roleInfo.getName());
-            }
-            getItemInfos.add(itemInfo);
-        }
-		List<DramaRoleInfo> roleInfos = dramaRoleInfoService.getByDramaId(dramaId);
-        result.put("itemInfos", getItemInfos);
-        result.put("roleInfos", roleInfos);
-		ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
-		return result;
-	}
-	/**
-	  * 分页列表查询
-	 * @param dramaInfo
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	@AutoLog(value = "剧本信息-分页列表查询")
-	@ApiOperation(value="剧本信息-分页列表查询", notes="剧本信息-分页列表查询")
-	@GetMapping(value = "/list")
-	public Result<IPage<DramaInfo>> queryPageList(DramaInfo dramaInfo,
-												  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-												  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-												  HttpServletRequest req) {
-        Result<IPage<DramaInfo>> result = new Result<>();
-		QueryWrapper<DramaInfo> queryWrapper = QueryGenerator.initQueryWrapper(dramaInfo, req.getParameterMap());
-        Page<DramaInfo> page = new Page<>(pageNo, pageSize);
-		IPage<DramaInfo> pageList = dramaInfoService.page(page, queryWrapper);
-        if (pageList != null && pageList.getRecords() != null && !pageList.getRecords().isEmpty()) {
-			List<DramaInfo> list = new ArrayList<>();
-			for (int i = 0; i < pageList.getRecords().size(); i++) {
-				DramaInfo getDramaInfo = pageList.getRecords().get(i);
-				SysCategory sysCategory = categoryService.getById(getDramaInfo.getCategory());
-				if (sysCategory != null) {
-					getDramaInfo.setCategory(sysCategory.getName());
-				}
-				list.add(getDramaInfo);
-			}
-			pageList.setRecords(list);
-		}
-		result.setSuccess(true);
-		result.setResult(pageList);
-		return result;
-	}
-
-	/**
-	  *   添加
-	 * @param dramaInfo
-	 * @return
-	 */
-	@AutoLog(value = "剧本信息-添加")
-	@ApiOperation(value="剧本信息-添加", notes="剧本信息-添加")
-	@PostMapping(value = "/add")
-	public Result<DramaInfo> add(@RequestBody DramaInfo dramaInfo) {
-		Result<DramaInfo> result = new Result<>();
-		try {
-			// 获取登录用户信息
-			LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-			dramaInfo.setUserId(sysUser.getId());
-			dramaInfo.setUserName(sysUser.getUsername());
-			dramaInfo.setUpdateTime(new Date());
-			dramaInfoService.save(dramaInfo);
-
-			result.success("添加成功!");
-		} catch (Exception e) {
-			log.error(e.getMessage(),e);
-			result.error500("操作失败");
-		}
-		return result;
-	}
-
-	/**
-	  *  编辑
-	 * @param dramaInfo
-	 * @return
-	 */
-	@AutoLog(value = "剧本信息-编辑")
-	@ApiOperation(value="剧本信息-编辑", notes="剧本信息-编辑")
-	@PostMapping(value = "/edit")
-	public Result<DramaInfo> edit(@RequestBody DramaInfo dramaInfo) {
-        Result<DramaInfo> result = new Result<>();
-		DramaInfo dramaInfoEntity = dramaInfoService.getById(dramaInfo.getId());
-		if(dramaInfoEntity==null) {
-			result.error500("未找到对应实体");
-		}else {
-			boolean ok = dramaInfoService.updateById(dramaInfo);
-			if(ok) {
-				result.success("修改成功!");
-			}
-		}
-
-		return result;
-	}
-
-	/**
-	  *   通过id删除
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "剧本信息-通过id删除")
-	@ApiOperation(value="剧本信息-通过id删除", notes="剧本信息-通过id删除")
-	@DeleteMapping(value = "/delete")
-    public Map<String, Object> delete(@RequestParam(name = "id", required = true) String id) {
-        return dramaInfoService.delete(id);
-	}
-
-	/**
-	  *  批量删除
-	 * @param ids
-	 * @return
-	 */
-	@AutoLog(value = "剧本信息-批量删除")
-	@ApiOperation(value="剧本信息-批量删除", notes="剧本信息-批量删除")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<DramaInfo> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-        Result<DramaInfo> result = new Result<>();
-		if(ids==null || "".equals(ids.trim())) {
-			result.error500("参数不识别!");
-		}else {
-			this.dramaInfoService.removeByIds(Arrays.asList(ids.split(",")));
-			result.success("删除成功!");
-		}
-		return result;
-	}
-
-	/**
-	  * 通过id查询
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "剧本信息-通过id查询")
-	@ApiOperation(value="剧本信息-通过id查询", notes="剧本信息-通过id查询")
-	@GetMapping(value = "/queryById")
-	public Result<DramaInfo> queryById(@RequestParam(name="id",required=true) String id) {
-        Result<DramaInfo> result = new Result<>();
-		DramaInfo dramaInfo = dramaInfoService.getById(id);
-		if(dramaInfo==null) {
-			result.error500("未找到对应实体");
-		}else {
-			result.setResult(dramaInfo);
-			result.setSuccess(true);
-		}
-		return result;
-	}
-}

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

@@ -1,162 +0,0 @@
-package org.jeecg.modules.ctop.controller;
-
-import cn.com.ctop.common.module.annotation.AutoLog;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.modules.ctop.entity.DramaItemInfo;
-import org.jeecg.modules.ctop.service.IDramaItemInfoService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.Map;
-
-/**
- * 剧本内容信息
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2020-03-06
- */
-@Slf4j
-@Api(tags = "剧本内容信息")
-@RestController
-@RequestMapping("/ctop/dramaItemInfo")
-public class DramaItemInfoController {
-    @Autowired
-    private IDramaItemInfoService dramaItemInfoService;
-
-    /**
-     * 分页列表查询
-     *
-     * @param dramaItemInfo
-     * @param pageNo
-     * @param pageSize
-     * @param req
-     * @return
-     */
-    @AutoLog(value = "剧本内容信息-分页列表查询")
-    @ApiOperation(value = "剧本内容信息-分页列表查询", notes = "剧本内容信息-分页列表查询")
-    @GetMapping(value = "/list")
-    public Result<IPage<DramaItemInfo>> queryPageList(DramaItemInfo dramaItemInfo,
-                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                      HttpServletRequest req) {
-        Result<IPage<DramaItemInfo>> result = new Result<>();
-        QueryWrapper<DramaItemInfo> queryWrapper = QueryGenerator.initQueryWrapper(dramaItemInfo, req.getParameterMap());
-        Page<DramaItemInfo> page = new Page<>(pageNo, pageSize);
-        queryWrapper.orderByAsc("rank").orderByDesc("update_time");
-        IPage<DramaItemInfo> pageList = dramaItemInfoService.page(page, queryWrapper);
-        result.setSuccess(true);
-        result.setResult(pageList);
-        return result;
-    }
-
-    /**
-     * 添加
-     *
-     * @param dramaItemInfo
-     * @return
-     */
-    @AutoLog(value = "剧本内容信息-添加")
-    @ApiOperation(value = "剧本内容信息-添加", notes = "剧本内容信息-添加")
-    @PostMapping(value = "/add")
-    public Result<DramaItemInfo> add(@RequestBody DramaItemInfo dramaItemInfo) {
-        Result<DramaItemInfo> result = new Result<>();
-        try {
-            int rank = dramaItemInfoService.getMaxRankByDramaId(dramaItemInfo.getDramaId());
-            dramaItemInfo.setRank(rank);
-            dramaItemInfoService.save(dramaItemInfo);
-            result.success("添加成功!");
-        } catch (Exception e) {
-            log.error(e.getMessage(), e);
-            result.error500("操作失败");
-        }
-        return result;
-    }
-
-    /**
-     * 编辑
-     *
-     * @param dramaItemInfo
-     * @return
-     */
-    @AutoLog(value = "剧本内容信息-编辑")
-    @ApiOperation(value = "剧本内容信息-编辑", notes = "剧本内容信息-编辑")
-    @PostMapping(value = "/edit")
-    public Result<DramaItemInfo> edit(@RequestBody DramaItemInfo dramaItemInfo) {
-        Result<DramaItemInfo> result = new Result<>();
-        DramaItemInfo dramaItemInfoEntity = dramaItemInfoService.getById(dramaItemInfo.getId());
-        if (dramaItemInfoEntity == null) {
-            result.error500("未找到对应实体");
-        } else {
-            dramaItemInfo.setUpdateTime(new Date());
-            boolean ok = dramaItemInfoService.updateById(dramaItemInfo);
-            if (ok) {
-                result.success("修改成功!");
-            }
-        }
-        return result;
-    }
-
-    /**
-     * 通过id删除
-     *
-     * @return
-     */
-    @AutoLog(value = "剧本内容信息-通过id删除")
-    @ApiOperation(value = "剧本内容信息-通过id删除", notes = "剧本内容信息-通过id删除")
-    @PostMapping(value = "/delete")
-    public Map<String, Object> delete(@RequestBody DramaItemInfo dramaItemInfo) {
-        return dramaItemInfoService.delete(dramaItemInfo.getId());
-    }
-
-    /**
-     * 批量删除
-     *
-     * @param ids
-     * @return
-     */
-    @AutoLog(value = "剧本内容信息-批量删除")
-    @ApiOperation(value = "剧本内容信息-批量删除", notes = "剧本内容信息-批量删除")
-    @DeleteMapping(value = "/deleteBatch")
-    public Result<DramaItemInfo> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<DramaItemInfo> result = new Result<>();
-        if (ids == null || "".equals(ids.trim())) {
-            result.error500("参数不识别!");
-        } else {
-            this.dramaItemInfoService.removeByIds(Arrays.asList(ids.split(",")));
-            result.success("删除成功!");
-        }
-        return result;
-    }
-
-    /**
-     * 通过id查询
-     *
-     * @param id
-     * @return
-     */
-    @AutoLog(value = "剧本内容信息-通过id查询")
-    @ApiOperation(value = "剧本内容信息-通过id查询", notes = "剧本内容信息-通过id查询")
-    @GetMapping(value = "/queryById")
-    public Result<DramaItemInfo> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<DramaItemInfo> result = new Result<>();
-        DramaItemInfo dramaItemInfo = dramaItemInfoService.getById(id);
-        if (dramaItemInfo == null) {
-            result.error500("未找到对应实体");
-        } else {
-            result.setResult(dramaItemInfo);
-            result.setSuccess(true);
-        }
-        return result;
-    }
-}

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

@@ -1,164 +0,0 @@
-package org.jeecg.modules.ctop.controller;
-
-import cn.com.ctop.common.module.annotation.AutoLog;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.modules.ctop.entity.DramaRoleInfo;
-import org.jeecg.modules.ctop.service.IDramaRoleInfoService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.Arrays;
-
-/**
- * 剧本角色信息
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2020-03-05
- */
-@Slf4j
-@Api(tags = "剧本角色信息")
-@RestController
-@RequestMapping("/ctop/dramaRoleInfo")
-public class DramaRoleInfoController {
-    @Autowired
-    private IDramaRoleInfoService dramaRoleInfoService;
-
-    /**
-     * 分页列表查询
-     *
-     * @param dramaRoleInfo
-     * @param pageNo
-     * @param pageSize
-     * @param req
-     * @return
-     */
-    @AutoLog(value = "剧本角色信息-分页列表查询")
-    @ApiOperation(value = "剧本角色信息-分页列表查询", notes = "剧本角色信息-分页列表查询")
-    @GetMapping(value = "/list")
-    public Result<IPage<DramaRoleInfo>> queryPageList(DramaRoleInfo dramaRoleInfo,
-                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                      HttpServletRequest req) {
-        Result<IPage<DramaRoleInfo>> result = new Result<>();
-        QueryWrapper<DramaRoleInfo> queryWrapper = QueryGenerator.initQueryWrapper(dramaRoleInfo, req.getParameterMap());
-        Page<DramaRoleInfo> page = new Page<>(pageNo, pageSize);
-        IPage<DramaRoleInfo> pageList = dramaRoleInfoService.page(page, queryWrapper);
-        result.setSuccess(true);
-        result.setResult(pageList);
-        return result;
-    }
-
-    /**
-     * 添加
-     *
-     * @param dramaRoleInfo
-     * @return
-     */
-    @AutoLog(value = "剧本角色信息-添加")
-    @ApiOperation(value = "剧本角色信息-添加", notes = "剧本角色信息-添加")
-    @PostMapping(value = "/add")
-    public Result<DramaRoleInfo> add(@RequestBody DramaRoleInfo dramaRoleInfo) {
-        Result<DramaRoleInfo> result = new Result<>();
-        try {
-            dramaRoleInfoService.save(dramaRoleInfo);
-            result.success("添加成功!");
-        } catch (Exception e) {
-            log.error(e.getMessage(), e);
-            result.error500("操作失败");
-        }
-        return result;
-    }
-
-    /**
-     * 编辑
-     *
-     * @param dramaRoleInfo
-     * @return
-     */
-    @AutoLog(value = "剧本角色信息-编辑")
-    @ApiOperation(value = "剧本角色信息-编辑", notes = "剧本角色信息-编辑")
-    @PutMapping(value = "/edit")
-    public Result<DramaRoleInfo> edit(@RequestBody DramaRoleInfo dramaRoleInfo) {
-        Result<DramaRoleInfo> result = new Result<>();
-        DramaRoleInfo dramaRoleInfoEntity = dramaRoleInfoService.getById(dramaRoleInfo.getId());
-        if (dramaRoleInfoEntity == null) {
-            result.error500("未找到对应实体");
-        } else {
-            boolean ok = dramaRoleInfoService.updateById(dramaRoleInfo);
-            if (ok) {
-                result.success("修改成功!");
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * 通过id删除
-     *
-     * @param id
-     * @return
-     */
-    @AutoLog(value = "剧本角色信息-通过id删除")
-    @ApiOperation(value = "剧本角色信息-通过id删除", notes = "剧本角色信息-通过id删除")
-    @DeleteMapping(value = "/delete")
-    public Result<Object> delete(@RequestParam(name = "id", required = true) String id) {
-        try {
-            dramaRoleInfoService.removeById(id);
-        } catch (Exception e) {
-            log.error("删除失败", e.getMessage());
-            return Result.error("删除失败!");
-        }
-        return Result.ok("删除成功!");
-    }
-
-    /**
-     * 批量删除
-     *
-     * @param ids
-     * @return
-     */
-    @AutoLog(value = "剧本角色信息-批量删除")
-    @ApiOperation(value = "剧本角色信息-批量删除", notes = "剧本角色信息-批量删除")
-    @DeleteMapping(value = "/deleteBatch")
-    public Result<DramaRoleInfo> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<DramaRoleInfo> result = new Result<>();
-        if (ids == null || "".equals(ids.trim())) {
-            result.error500("参数不识别!");
-        } else {
-            this.dramaRoleInfoService.removeByIds(Arrays.asList(ids.split(",")));
-            result.success("删除成功!");
-        }
-        return result;
-    }
-
-    /**
-     * 通过id查询
-     *
-     * @param id
-     * @return
-     */
-    @AutoLog(value = "剧本角色信息-通过id查询")
-    @ApiOperation(value = "剧本角色信息-通过id查询", notes = "剧本角色信息-通过id查询")
-    @GetMapping(value = "/queryById")
-    public Result<DramaRoleInfo> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<DramaRoleInfo> result = new Result<>();
-        DramaRoleInfo dramaRoleInfo = dramaRoleInfoService.getById(id);
-        if (dramaRoleInfo == null) {
-            result.error500("未找到对应实体");
-        } else {
-            result.setResult(dramaRoleInfo);
-            result.setSuccess(true);
-        }
-        return result;
-    }
-}

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

@@ -148,6 +148,72 @@ public class ProjectController {
         return map;
     }
 
+
+    @AutoLog(value = "项目-分页列表查询")
+    @ApiOperation(value = "项目-分页列表查询", notes = "项目-分页列表查询")
+    @GetMapping(value = "/responsibleListV2")
+    public Result<IPage<Project>> responsibleListV2(Project project,
+                                                    @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                    HttpServletRequest req) {
+        Result<IPage<Project>> result = new Result<>();
+        String userId = project.getUserId();
+        if (Check.isNull(userId)) {
+            result.setSuccess(false);
+            result.setMessage("用户信息不能为空");
+            return result;
+        }
+        project.setUserId(null);
+        String projectName = project.getProjectName();
+        project.setProjectName(null);
+        String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+
+        QueryWrapper<Project> queryWrapper = QueryGenerator.initQueryWrapper(project, req.getParameterMap());
+        if (!Check.isNull(projectName)) {
+            queryWrapper.like("project_name", projectName);
+        }
+        queryWrapper.orderByDesc("create_time");
+        Page<Project> page = new Page<>(pageNo, pageSize);
+        IPage<Project> pageList = null;
+        // 查询所有
+        if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || "sale".equals(roleCode) || "saleDirector".equals(roleCode)) {
+            pageList = projectService.page(page, queryWrapper);
+            // 经理岗查询所在项目
+        } else if ("designTeamLeader".equals(roleCode) || "touTiaoOperationManager".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "planeLeader".equals(roleCode)) {
+
+            List<Long> projectIds = projectMemberService.getProjectByMap(userId);
+            if (!Check.isNull(projectIds)) {
+                queryWrapper.in("id", projectIds);
+                pageList = projectService.page(page, queryWrapper);
+
+            }
+            // 剪辑 编导 平面 拍摄 查询自己为设计负责人项目
+        } else if ("clip".equals(roleCode) || "shot".equals(roleCode) || "plan".equals(roleCode) || "plane".equals(roleCode)) {
+            queryWrapper.eq("design_responsible_id", userId);
+            pageList = projectService.page(page, queryWrapper);
+            // 运营 运营助理查询 自己负责项目
+        } else if ("operator".equals(roleCode) || "operationAssistant".equals(roleCode)) {
+            queryWrapper.eq("responsible_id", userId);
+            pageList = projectService.page(page, queryWrapper);
+        }
+        List<Project> records = pageList.getRecords();
+        if (!Check.isNull(records)) {
+            if (!Check.isNull(records)) {
+                for (Project project2 : records) {
+                    QueryWrapper<TransferAccount> transferAccountQueryWrapper = new QueryWrapper<>();
+                    transferAccountQueryWrapper.eq("project_id", project2.getId());
+                    transferAccountQueryWrapper.eq("status", 0);
+                    List<TransferAccount> list = transferAccountService.list(transferAccountQueryWrapper);
+                    project2.setNeedExamine(list.size());
+                }
+
+            }
+        }
+        result.setResult(pageList);
+        return result;
+    }
+
+
     @Autowired
     private ISysCategoryService sysCategoryService;
     @Autowired

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

@@ -125,6 +125,65 @@ public class ProjectMemberController {
     }
 
 
+    @GetMapping(value = "/participateListV2")
+    public Result<IPage<ProjectMember>> participateListV2(ProjectMember projectMember,
+                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                          HttpServletRequest req) {
+        Result<IPage<ProjectMember>> result = new Result<>();
+
+        String userId = projectMember.getUserId();
+        if (Check.isNull(userId)) {
+            result.setSuccess(false);
+            result.setMessage("未获取到用户信息");
+            return result;
+
+        }
+        String projectName = projectMember.getProjectName();
+        projectMember.setUserId(null);
+        projectMember.setProjectName(null);
+        QueryWrapper<ProjectMember> queryWrapper = QueryGenerator.initQueryWrapper(projectMember, req.getParameterMap());
+
+        String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+        if (!"admin".equals(roleCode) && !"sale".equals(roleCode) && !"saleDirector".equals(roleCode)) {
+            queryWrapper.eq("user_id", userId);
+        }
+        if (!Check.isNull(projectName)) {
+            queryWrapper.like("project_name", projectName);
+        }
+        queryWrapper.groupBy("project_id");
+        queryWrapper.orderByDesc("create_time");
+
+
+        Page<ProjectMember> page = new Page<>(pageNo, pageSize);
+        IPage<ProjectMember> pageList = projectMemberService.page(page, queryWrapper);
+        List<ProjectMember> projectMembers = pageList.getRecords();
+        List<ProjectMember> projectMemberList = new ArrayList<>();
+        if (!Check.isNull(projectMembers)) {
+            for (ProjectMember member : projectMembers) {
+                if (Check.isNull(member)) {
+                    continue;
+                }
+                Project project = projectService.getById(member.getProjectId());
+                if (!Check.isNull(project)) {
+                    member.setResponsibleName(project.getResponsibleName());
+                    member.setDesignResponsibleName(project.getDesignResponsibleName());
+                    member.setAdvertiserName(project.getAdvertiserName());
+                    member.setAdvertiserId(project.getAdvertiserId());
+                    member.setMediaId(project.getMediaId());
+                    member.setMaxBid(project.getMaxBid());
+                    projectMemberList.add(member);
+                }
+            }
+        }
+
+
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+
     /**
      * 分页列表查询
      *
@@ -325,11 +384,11 @@ public class ProjectMemberController {
      *
      * @return
      */
-    @GetMapping(value = "/getProjectAccountByUserId")
+    @GetMapping("/getProjectAccountByUserId")
     public Result<List<Map<String, Object>>> getProjectAccountBy() {
         Result<List<Map<String, Object>>> resultBody = new Result<>();
         try {
-            String userId=((LoginUser) SecurityUtils.getSubject().getPrincipal()).getId();
+            String userId = ((LoginUser) SecurityUtils.getSubject().getPrincipal()).getId();
             List<Map<String, Object>> result = projectMemberService.getProjectAccountByUserId(userId);
             resultBody.setSuccess(true);
             resultBody.setResult(result);
@@ -341,4 +400,58 @@ public class ProjectMemberController {
     }
 
 
+    /**
+     * 销售的项目
+     *
+     * @return
+     */
+    @PostMapping(value = "/getSaleOwnProjects")
+    public Result<List<ProjectMember>> getSaleOwnProjects(@RequestBody JSONObject data) {
+        Result<List<ProjectMember>> result = new Result<>();
+
+        JSONArray ids = data.getJSONArray("mediaIds");
+        List<Integer> mediaIds = new ArrayList<>();
+        if (null != ids && !ids.isEmpty()) {
+            for (int i = 0; i < ids.size(); i++) {
+                mediaIds.add(ids.getIntValue(i));
+            }
+        }
+        List<ProjectMember> projectMemberList = projectMemberService.getSaleOwnProjects(mediaIds);
+        if (projectMemberList == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(projectMemberList);
+            result.setSuccess(true);
+        }
+        return result;
+
+    }
+
+    /**
+     * 自己所在的项目
+     *
+     * @return
+     */
+    @PostMapping("/getOwnProjects")
+    public Result<List<ProjectMember>> getOwnProjects(@RequestBody JSONObject data) {
+        Result<List<ProjectMember>> result = new Result<>();
+        JSONArray ids = data.getJSONArray("mediaIds");
+        List<Integer> mediaIds = new ArrayList<>();
+        if (null != ids && !ids.isEmpty()) {
+            for (int i = 0; i < ids.size(); i++) {
+                mediaIds.add(ids.getIntValue(i));
+            }
+        }
+        List<ProjectMember> projectMemberList = projectMemberService.getOwnProjects(mediaIds);
+        if (projectMemberList == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(projectMemberList);
+            result.setSuccess(true);
+        }
+        return result;
+
+    }
+
+
 }

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

@@ -1,75 +0,0 @@
-package org.jeecg.modules.ctop.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-
-import java.util.Date;
-
-/**
- * 剧本信息
- * @author jeecg-boot
- * @date   2020-03-04
- * @version V1.0
- */
-@Data
-@TableName("ctop_drama_info")
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-@ApiModel(value="ctop_drama_info对象", description="剧本信息")
-public class DramaInfo {
-	@TableId(type = IdType.AUTO)
-	private Long id;
-	private String userId;
-	private String category;
-	private String dramaName;
-	private String tag;
-	private String userName;
-	private Integer nonpublic;
-	private String introduction;
-	private Integer status;
-    private Integer enabled;
-    /**
-     * 场景
-     */
-    private String scnece;
-    /**
-     * 视频类型
-     */
-    private String videoType;
-    /**
-     * 时长
-     */
-    private Long timeLong;
-    /**
-     * 演员id
-     */
-    private String actorId;
-    /**
-     * 卖点
-     */
-    private String usp;
-    /**
-     * 演员/服化道备注
-     */
-    private String actorRemark;
-    /**
-     * 拍摄要求
-     */
-    private String shootReq;
-    /**
-     * 封面文案
-     */
-    private String coverText;
-    /**
-     * 剪辑备注
-     */
-    private String clipRemark;
-
-	private Date createTime;
-	private Date updateTime;
-}

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

@@ -1,100 +0,0 @@
-package org.jeecg.modules.ctop.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecgframework.poi.excel.annotation.Excel;
-
-import java.util.Date;
-
-/**
- * 剧本内容信息
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2020-03-06
- */
-@Data
-@TableName("ctop_drama_item_info")
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-@ApiModel(value = "ctop_drama_item_info对象", description = "剧本内容信息")
-public class DramaItemInfo {
-
-    /**
-     * id
-     */
-    @TableId(type = IdType.AUTO)
-    @ApiModelProperty(value = "id")
-    private Long id;
-    /**
-     * 元素类型1:描述 2:对话
-     */
-    @Excel(name = "元素类型1:情节描述 2:对话", width = 15)
-    @ApiModelProperty(value = "元素类型1:描述 2:对话")
-    private Integer type;
-    private Integer plainSeq;
-    /**
-     * 剧本id
-     */
-    @Excel(name = "剧本id", width = 15)
-    @ApiModelProperty(value = "剧本id")
-    private Long dramaId;
-    /**
-     * roleId
-     */
-    @Excel(name = "roleId", width = 15)
-    @ApiModelProperty(value = "roleId")
-    private Long roleId;
-    /**
-     * 台词
-     */
-    @Excel(name = "line", width = 15)
-    @ApiModelProperty(value = "content")
-    private String line;
-    /**
-     * 排序号
-     */
-    @Excel(name = "排序号", width = 15)
-    @ApiModelProperty(value = "排序号")
-    private Integer rank;
-    /**
-     * enabled
-     */
-    @Excel(name = "enabled", width = 15)
-    @ApiModelProperty(value = "enabled")
-    private Integer enabled;
-    /**
-     * createTime
-     */
-    @ApiModelProperty(value = "createTime")
-    private Date createTime;
-    /**
-     * updateTime
-     */
-    @ApiModelProperty(value = "updateTime")
-    private Date updateTime;
-
-    /**
-     * 场景
-     */
-    private String scene;
-    /**
-     * 剪辑描述
-     */
-    private String clipRemark;
-    /**
-     * 画面内容
-     */
-    private String picContent;
-
-    @TableField(exist = false)
-    private String roleName;
-
-}

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

@@ -1,77 +0,0 @@
-package org.jeecg.modules.ctop.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecgframework.poi.excel.annotation.Excel;
-
-import java.util.Date;
-
-/**
- * 剧本角色信息
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2020-03-05
- */
-@Data
-@TableName("ctop_drama_role_info")
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-@ApiModel(value = "ctop_drama_role_info对象", description = "剧本角色信息")
-public class DramaRoleInfo {
-
-    /**
-     * id
-     */
-    @TableId(type = IdType.AUTO)
-    @ApiModelProperty(value = "id")
-    private Long id;
-
-    private Long dramaId;
-    /**
-     * name
-     */
-    @Excel(name = "name", width = 15)
-    @ApiModelProperty(value = "name")
-    private String name;
-    /**
-     * introduction
-     */
-    @Excel(name = "introduction", width = 15)
-    @ApiModelProperty(value = "introduction")
-    private String introduction;
-    /**
-     * sex
-     */
-    @Excel(name = "sex", width = 15)
-    @ApiModelProperty(value = "sex")
-    private Integer sex;
-    /**
-     * createTime
-     */
-    @ApiModelProperty(value = "createTime")
-    private Date createTime;
-    /**
-     * updateTime
-     */
-    @ApiModelProperty(value = "updateTime")
-    private Date updateTime;
-
-    @TableField(exist = false)
-    private String buttonType;
-
-    public DramaRoleInfo(String name, String buttonType) {
-        this.name = name;
-        this.buttonType = buttonType;
-    }
-
-    public DramaRoleInfo() {
-    }
-}

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

@@ -80,6 +80,12 @@ public class ProjectMember implements  Serializable{
     @TableField(exist = false)
     private String mediaId;
 
+    @TableField(exist = false)
+    private String saleId;
+
+    @TableField(exist = false)
+    private String saleName;
+
 
     /**
      * 创建时间

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

@@ -1,14 +0,0 @@
-package org.jeecg.modules.ctop.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.jeecg.modules.ctop.entity.DramaInfo;
-
-/**
- * 剧本信息
- * @author: jeecg-boot
- * @date:   2020-03-04
- * @cersion: V1.0
- */
-public interface DramaInfoMapper extends BaseMapper<DramaInfo> {
-
-}

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

@@ -1,15 +0,0 @@
-package org.jeecg.modules.ctop.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.jeecg.modules.ctop.entity.DramaItemInfo;
-
-/**
- * 剧本内容信息
- *
- * @author: jeecg-boot
- * @date: 2020-03-06
- * @cersion: V1.0
- */
-public interface DramaItemInfoMapper extends BaseMapper<DramaItemInfo> {
-
-}

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

@@ -1,15 +0,0 @@
-package org.jeecg.modules.ctop.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.jeecg.modules.ctop.entity.DramaRoleInfo;
-
-/**
- * 剧本角色信息
- *
- * @author: jeecg-boot
- * @date: 2020-03-05
- * @cersion: V1.0
- */
-public interface DramaRoleInfoMapper extends BaseMapper<DramaRoleInfo> {
-
-}

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

@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.ctop.entity.ProjectMember;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 项目成员
@@ -31,4 +32,8 @@ public interface ProjectMemberMapper extends BaseMapper<ProjectMember> {
 
     List<ProjectMember> queryProjectMemberByUserId(@Param("userId")String userId, @Param("mediaIds")List<Integer> mediaIds);
 
+
+    List<ProjectMember> getSaleProjects(@Param("userId")String userId, @Param("mediaIds")List<Integer> mediaIds);
+
+    List<Long> getProjectByMap(@Param("userId") String userId);
 }

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

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.jeecg.modules.ctop.mapper.DramaItemInfoMapper">
-
-</mapper>

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

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.jeecg.modules.ctop.mapper.DramaRoleInfoMapper">
-
-</mapper>

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

@@ -33,11 +33,11 @@
     <!-- 视频报表设计师leader展示自己所在公司的所有项目 -->
     <select id="designLeaderProjects" resultType="org.jeecg.modules.ctop.entity.ProjectMember">
         select
-            distinct b.id as projectId,
-            b.project_name as projectName,
-            b.advertiser_id as advertiserId,
-            b.advertiser_name as advertiserName,
-            b.media_id as mediaId
+        distinct b.id as projectId,
+        b.project_name as projectName,
+        b.advertiser_id as advertiserId,
+        b.advertiser_name as advertiserName,
+        b.media_id as mediaId
         from
         ctop_project_member a
         left join ctop_project b on a.project_id = b.id
@@ -53,11 +53,11 @@
     <!-- 设计师展示所有自己的角色下制作的视频 -->
     <select id="designProjects" resultType="org.jeecg.modules.ctop.entity.ProjectMember">
         select
-            distinct a.project_id as projectId,
-            b.project_name as projectName,
-            b.advertiser_id as advertiserId,
-            b.advertiser_name as advertiserName,
-            b.media_id as mediaId
+        distinct a.project_id as projectId,
+        b.project_name as projectName,
+        b.advertiser_id as advertiserId,
+        b.advertiser_name as advertiserName,
+        b.media_id as mediaId
         from
         ctop_project_member a
         left join ctop_project b on a.project_id = b.id
@@ -72,11 +72,11 @@
     <!-- 运营和运营负责人展示所在项目视频 -->
     <select id="operationProjects" resultType="org.jeecg.modules.ctop.entity.ProjectMember">
         select
-           distinct b.id as projectId,
-           b.project_name as projectName,
-           b.advertiser_id as advertiserId,
-           b.advertiser_name as advertiserName,
-           b.media_id as mediaId
+        distinct b.id as projectId,
+        b.project_name as projectName,
+        b.advertiser_id as advertiserId,
+        b.advertiser_name as advertiserName,
+        b.media_id as mediaId
         from
         ctop_user_allocation a
         left join ctop_project b on a.project_id = b.id
@@ -122,4 +122,32 @@
             #{item}
         </foreach>
     </select>
+
+    <select id="getSaleProjects" resultType="org.jeecg.modules.ctop.entity.ProjectMember">
+        select
+        distinct a.id as projectId,
+        a.project_name as projectName,
+        a.advertiser_id as advertiserId,
+        a.advertiser_name as advertiserName,
+        a.media_id as mediaId,
+        a.sale_id as saleId,
+        b.realname as saleName
+        from
+        ctop_project a
+        left join sys_user b on a.sale_id = b.id
+        where a.sale_id = #{userId}
+        and a.media_id in
+        <foreach collection="mediaIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+    </select>
+
+    <select id="getProjectByMap" resultType="java.lang.Long">
+        select project_id
+        from ctop_project_member
+        where user_id = #{userId}
+        group by project_id
+    </select>
+
 </mapper>

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

@@ -1,17 +0,0 @@
-package org.jeecg.modules.ctop.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.modules.ctop.entity.DramaInfo;
-
-import java.util.Map;
-
-/**
- * 剧本信息
- * @author jeecg-boot
- * @date   2020-03-04
- * @version V1.0
- */
-public interface IDramaInfoService extends IService<DramaInfo> {
-
-    Map<String, Object> delete(String id);
-}

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

@@ -1,23 +0,0 @@
-package org.jeecg.modules.ctop.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.modules.ctop.entity.DramaItemInfo;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 剧本内容信息
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2020-03-06
- */
-public interface IDramaItemInfoService extends IService<DramaItemInfo> {
-
-    List<DramaItemInfo> getByDramaId(Long dramaId);
-
-    int getMaxRankByDramaId(Long dramaId);
-
-    Map<String, Object> delete(Long id);
-}

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

@@ -1,18 +0,0 @@
-package org.jeecg.modules.ctop.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.modules.ctop.entity.DramaRoleInfo;
-
-import java.util.List;
-
-/**
- * 剧本角色信息
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2020-03-05
- */
-public interface IDramaRoleInfoService extends IService<DramaRoleInfo> {
-
-    List<DramaRoleInfo> getByDramaId(Long dramaId);
-}

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

@@ -25,4 +25,10 @@ public interface IProjectMemberService extends IService<ProjectMember> {
     List<Map<String, Object>> getProjectAccountByUserId(String userId);
 
     ProjectMember getProjectByParams(Long targetProject, String userId);
+
+    List<ProjectMember> getOwnProjects(List<Integer> mediaIds);
+
+    List<ProjectMember> getSaleOwnProjects(List<Integer> mediaIds);
+
+    List<Long> getProjectByMap(String userId);
 }

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

@@ -0,0 +1,9 @@
+package org.jeecg.modules.ctop.service;
+
+import org.jeecg.modules.ctop.vo.QueryParam;
+
+public interface IRuleEngineService {
+    void executeAddRule(QueryParam param);
+
+    void executeRemoveRule(QueryParam param);
+}

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

@@ -1,35 +0,0 @@
-package org.jeecg.modules.ctop.service.impl;
-
-import cn.com.ctop.common.module.utils.ResultMapUtils;
-import cn.com.ctop.common.module.utils.StatusCode;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.jeecg.modules.ctop.entity.DramaInfo;
-import org.jeecg.modules.ctop.mapper.DramaInfoMapper;
-import org.jeecg.modules.ctop.service.IDramaInfoService;
-import org.springframework.stereotype.Service;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 剧本信息
- * @author jeecg-boot
- * @date   2020-03-04
- * @version V1.0
- */
-@Service
-public class DramaInfoServiceImpl extends ServiceImpl<DramaInfoMapper, DramaInfo> implements IDramaInfoService {
-    @Override
-    public Map<String, Object> delete(String id) {
-        Map<String, Object> result = new HashMap<>();
-        DramaInfo info = this.getById(id);
-        if (null == info) {
-            ResultMapUtils.setResultMap(result, StatusCode.COMMON_DATA_NOT_EXIST);
-            return result;
-        }
-        info.setEnabled(0);
-        this.updateById(info);
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
-        return result;
-    }
-}

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

@@ -1,77 +0,0 @@
-package org.jeecg.modules.ctop.service.impl;
-
-import cn.com.ctop.common.module.utils.ResultMapUtils;
-import cn.com.ctop.common.module.utils.StatusCode;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.jeecg.modules.ctop.entity.DramaItemInfo;
-import org.jeecg.modules.ctop.entity.DramaRoleInfo;
-import org.jeecg.modules.ctop.mapper.DramaItemInfoMapper;
-import org.jeecg.modules.ctop.service.IDramaItemInfoService;
-import org.jeecg.modules.ctop.service.IDramaRoleInfoService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 剧本内容信息
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2020-03-06
- */
-@Service
-public class DramaItemInfoServiceImpl extends ServiceImpl<DramaItemInfoMapper, DramaItemInfo> implements IDramaItemInfoService {
-
-    @Autowired
-    private IDramaRoleInfoService roleInfoService;
-
-    @Override
-    public List<DramaItemInfo> getByDramaId(Long dramaId) {
-        QueryWrapper<DramaItemInfo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("drama_id", dramaId).eq("enabled", 1).orderByAsc("rank").orderByDesc("update_time");
-        List<DramaItemInfo> infos = this.list(queryWrapper);
-        List<DramaItemInfo> returnInfos = new ArrayList<>();
-        if (null != infos && infos.size() > 0) {
-            for (DramaItemInfo itemInfo : infos) {
-                if (null != itemInfo.getRoleId()) {
-                    DramaRoleInfo roleInfo = roleInfoService.getById(itemInfo.getRoleId());
-                    itemInfo.setRoleName(roleInfo.getName());
-                }
-                returnInfos.add(itemInfo);
-            }
-        }
-        return returnInfos;
-    }
-
-    @Override
-    public int getMaxRankByDramaId(Long dramaId) {
-        QueryWrapper<DramaItemInfo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("drama_id", dramaId);
-        queryWrapper.orderByDesc("rank").last(" limit 1");
-        DramaItemInfo itemInfo = this.getOne(queryWrapper);
-        if (null == itemInfo) {
-            return 1;
-        } else {
-            return itemInfo.getRank() + 1;
-        }
-    }
-
-    @Override
-    public Map<String, Object> delete(Long id) {
-        Map<String, Object> result = new HashMap<>();
-        DramaItemInfo info = this.getById(id);
-        if (null == info) {
-            ResultMapUtils.setResultMap(result, StatusCode.COMMON_DATA_NOT_EXIST);
-            return result;
-        }
-        info.setEnabled(0);
-        this.updateById(info);
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
-        return result;
-    }
-}

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

@@ -1,28 +0,0 @@
-package org.jeecg.modules.ctop.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.jeecg.modules.ctop.entity.DramaRoleInfo;
-import org.jeecg.modules.ctop.mapper.DramaRoleInfoMapper;
-import org.jeecg.modules.ctop.service.IDramaRoleInfoService;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * 剧本角色信息
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2020-03-05
- */
-@Service
-public class DramaRoleInfoServiceImpl extends ServiceImpl<DramaRoleInfoMapper, DramaRoleInfo> implements IDramaRoleInfoService {
-
-    @Override
-    public List<DramaRoleInfo> getByDramaId(Long dramaId) {
-        QueryWrapper<DramaRoleInfo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("drama_id", dramaId);
-        return this.list(queryWrapper);
-    }
-}

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

@@ -89,7 +89,14 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
         } else if (roleCode.equals("admin")) {
             projectMemberList = memberMapper.adminProjects(mediaIds);
         } else if (roleCode.equals("operator") || roleCode.equals("operationAssistant") || roleCode.equals("touTiaoOperationManager")) {
-            projectMemberList = memberMapper.operationProjects(userId, mediaIds);
+            projectMemberList = memberMapper.designProjects(userId, mediaIds);
+        } else {
+            //如果以上角色都不是的话直接查询此角色所属项目
+            projectMemberList = memberMapper.designProjects(userId, mediaIds);
+        }
+
+        if (null == projectMemberList) {
+            projectMemberList = new ArrayList<>();
         }
 
         return projectMemberList;
@@ -117,12 +124,12 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
 
     @Override
     public ProjectMember getProjectByParams(Long targetProject, String userId) {
-        QueryWrapper<ProjectMember>queryWrapper = new QueryWrapper<>();
-        if(null!=targetProject){
-            queryWrapper.eq("project_id",targetProject);
+        QueryWrapper<ProjectMember> queryWrapper = new QueryWrapper<>();
+        if (null != targetProject) {
+            queryWrapper.eq("project_id", targetProject);
         }
-        if(null!=userId){
-            queryWrapper.eq("user_id",userId);
+        if (null != userId) {
+            queryWrapper.eq("user_id", userId);
         }
         queryWrapper.last("limit 1");
         return null;
@@ -151,4 +158,58 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
         }
         return memberMapper.queryProjectMemberByUserId(userId, mediaIds);
     }
+
+
+    //查看销售所在平台项目
+    @Override
+    public List<ProjectMember> getSaleOwnProjects(List<Integer> mediaIds) {
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        String userId = sysUser.getId();
+        String roleCode = memberMapper.getRoleCodeByUserId(userId);
+
+        //角色权限判断
+        List<ProjectMember> projectMemberList = null;
+        if (roleCode.equals("admin")) {
+            projectMemberList = memberMapper.adminProjects(mediaIds);
+        } else {
+            //如果以上角色都不是的话直接查询此角色所属项目
+            projectMemberList = memberMapper.getSaleProjects(userId, mediaIds);
+        }
+
+        if (null == projectMemberList) {
+            projectMemberList = new ArrayList<>();
+        }
+
+        return projectMemberList;
+    }
+
+    @Override
+    public List<Long> getProjectByMap(String userId) {
+        return memberMapper.getProjectByMap(userId);
+    }
+
+    //视频报表
+    @Override
+    public List<ProjectMember> getOwnProjects(List<Integer> mediaIds) {
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        String userId = sysUser.getId();
+        String roleCode = memberMapper.getRoleCodeByUserId(userId);
+
+        //角色权限判断
+        List<ProjectMember> projectMemberList = null;
+        if (roleCode.equals("admin")) {
+            projectMemberList = memberMapper.adminProjects(mediaIds);
+        } else {
+            //如果以上角色都不是的话直接查询此角色所属项目
+            projectMemberList = memberMapper.designProjects(userId, mediaIds);
+        }
+
+        if (null == projectMemberList) {
+            projectMemberList = new ArrayList<>();
+        }
+
+        return projectMemberList;
+    }
+
+
 }

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

@@ -0,0 +1,21 @@
+package org.jeecg.modules.ctop.service.impl;
+
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.modules.ctop.service.IRuleEngineService;
+import org.jeecg.modules.ctop.vo.QueryParam;
+import org.springframework.stereotype.Service;
+
+@Service
+@Slf4j
+public class RuleEngineServiceImpl implements IRuleEngineService {
+    @Override
+    public void executeAddRule(QueryParam param) {
+        log.info("参数数据:"+param.getParamId()+";"+param.getParamSign());
+        System.out.println("add success");
+    }
+    @Override
+    public void executeRemoveRule(QueryParam param) {
+        log.info("参数数据:"+param.getParamId()+";"+param.getParamSign());
+        System.out.println("remove success");
+    }
+}

+ 9 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/vo/QueryParam.java

@@ -0,0 +1,9 @@
+package org.jeecg.modules.ctop.vo;
+
+import lombok.Data;
+
+@Data
+public class QueryParam {
+    private String paramId;
+    private String paramSign;
+}

+ 8 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/vo/RuleResult.java

@@ -0,0 +1,8 @@
+package org.jeecg.modules.ctop.vo;
+
+import lombok.Data;
+
+@Data
+public class RuleResult {
+    private boolean postCodeResult;
+}

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

@@ -1,5 +1,6 @@
 package org.jeecg.modules.wps.entity;
 
+import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -40,8 +41,7 @@ public class WpsFile {
     @ApiModelProperty(value = "size")
 	private Integer size;
 	/**creator*/
-	@Excel(name = "creator", width = 15)
-    @ApiModelProperty(value = "creator")
+	@Dict(dicCode = "id",dictTable="sys_user",dicText="realname")
     private String creator;
 	/**createTime*/
 	@Excel(name = "createTime", width = 15)
@@ -60,13 +60,10 @@ public class WpsFile {
     @ApiModelProperty(value = "downloadUrl")
 	private String downloadUrl;
 	/**deleted*/
-	@Excel(name = "deleted", width = 15)
-    @ApiModelProperty(value = "deleted")
 	private String deleted;
 	/**canDelete*/
-	@Excel(name = "canDelete", width = 15)
-    @ApiModelProperty(value = "canDelete")
 	private String canDelete;
+	@Dict(dicCode = "id",dictTable="ctop_project",dicText="project_name")
 	private Long projectId;
 
 	private String code;

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

@@ -57,7 +57,6 @@ spring:
     exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
   datasource:
     url: jdbc:mysql://139.186.27.96:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-#    url: jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
     username: hcst
     password: test@20190531
     driver-class-name: com.mysql.jdbc.Driver
@@ -97,7 +96,6 @@ spring:
       datasource:
         master:
           url: jdbc:mysql://139.186.27.96:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-#          url: jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
           username: hcst
           password: test@20190531
           driver-class-name: com.mysql.jdbc.Driver

+ 17 - 0
jeecg-boot-module-system/src/main/resources/drools/rule.drl

@@ -0,0 +1,17 @@
+import org.jeecg.modules.ctop.service.impl.RuleEngineServiceImpl
+import org.slf4j.LoggerFactory
+import org.slf4j.Logger
+import org.jeecg.modules.ctop.vo.QueryParam;
+import org.jeecg.modules.ctop.vo.RuleResult;
+dialect  "java"
+rule "paramcheck1"
+    salience 99
+    when queryParam : QueryParam(paramId != null && paramSign.equals("+"))
+        resultParam : RuleResult()
+    then
+        final Logger LOGGER = LoggerFactory.getLogger("param-check-one 规则引擎") ;
+        LOGGER.info("参数:getParamId="+queryParam.getParamId()+";getParamSign="+queryParam.getParamSign());
+        RuleEngineServiceImpl ruleEngineService = new RuleEngineServiceImpl() ;
+        ruleEngineService.executeAddRule(queryParam);
+        resultParam.setPostCodeResult(true);
+end

+ 17 - 0
jeecg-boot-module-system/src/main/resources/drools/rule2.drl

@@ -0,0 +1,17 @@
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
+import org.jeecg.modules.ctop.service.impl.RuleEngineServiceImpl
+import org.jeecg.modules.ctop.vo.QueryParam;
+import org.jeecg.modules.ctop.vo.RuleResult;
+dialect  "java"
+rule "paramcheck2"
+    salience 88
+    when queryParam : QueryParam(paramId != null && paramSign.equals("-"))
+        resultParam : RuleResult()
+    then
+        final Logger LOGGER = LoggerFactory.getLogger("param-check-two 规则引擎") ;
+        LOGGER.info("参数:getParamId="+queryParam.getParamId()+";getParamSign="+queryParam.getParamSign());
+        RuleEngineServiceImpl ruleEngineService = new RuleEngineServiceImpl() ;
+        ruleEngineService.executeRemoveRule(queryParam);
+        resultParam.setPostCodeResult(true);
+end

+ 85 - 6
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -1,11 +1,25 @@
 package org.jeecg;
 
+import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.ctop.crawler.modules.pangolin.entity.PangolinApp;
+import cn.com.ctop.crawler.modules.pangolin.service.PangolinAppService;
+import cn.com.ctop.crawler.modules.pangolin.service.PangolinCrawlerService;
+import cn.com.ctop.crawler.modules.pangolin.service.PangolinLoginService;
+import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceCampaignService;
 import cn.com.ctop.toutiao.modules.report.service.IReportService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceCreativeService;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.ctop.entity.KuaishouEffectVideoInfo;
 import org.jeecg.modules.ctop.service.IKuaishouEffectVideoInfoService;
 import org.jeecg.modules.demo.mock.MockController;
@@ -14,14 +28,23 @@ import org.jeecg.modules.demo.test.mapper.JeecgDemoMapper;
 import org.jeecg.modules.demo.test.service.IJeecgDemoService;
 import org.jeecg.modules.system.service.ISysDataLogService;
 import org.junit.Assert;
+import org.jeecg.modules.ctop.service.IRuleEngineService;
+import org.jeecg.modules.ctop.vo.QueryParam;
+import org.jeecg.modules.ctop.vo.RuleResult;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.kie.api.runtime.KieSession;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 
 import javax.annotation.Resource;
+import javax.annotation.Resource;
+import java.util.HashMap;
 import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 @RunWith(SpringRunner.class)
 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@@ -42,6 +65,22 @@ public class SampleTest {
 	private ISysDataLogService sysDataLogService;
 	@Resource
 	private MockController mock;
+    private IByteDanceCreativeService creativeService;
+
+    @Test
+    public void loadBytedanceCreativeData() {
+        /**
+         *
+         */
+        CtopOauthToken token = oauthTokenService.getTokenByAccountId(1649600126891015L);
+        creativeService.getAdvertiserCreative(token,null,null);
+//        advertiserDataService.getMaterialList(token);
+    }
+
+    @Autowired
+    private IBindAccountLoginService bindAccountLoginService;
+    @Autowired
+    private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
 
 	@Test
 	public void testSelect() {
@@ -96,13 +135,53 @@ public class SampleTest {
         List<KuaishouEffectVideoInfo>videoInfos = effectVideoInfoService.list();
         for (KuaishouEffectVideoInfo video:videoInfos) {
             if(null!=video.getSignature()&&!"".equals(video.getSignature())){
-//                effectVideoInfoService.updateFinalCostDateBySignature(video.getSignature());
-//                effectVideoInfoService.updateInitialCostDateBySignature(video.getSignature());
-//                effectVideoInfoService.updateTotalCostBySignature(video.getSignature());
-                if(null==video.getTwoWeekCost()){
-                    effectVideoInfoService.updateTowWeekCostBySignature(video.getSignature());
-                }
+                effectVideoInfoService.updateFinalCostDateBySignature(video.getSignature());
+                effectVideoInfoService.updateInitialCostDateBySignature(video.getSignature());
+                effectVideoInfoService.updateTotalCostBySignature(video.getSignature());
+//                effectVideoInfoService.updateTowWeekCostBySignature(video.getSignature());
             }
         }
     }
+
+    @Test
+    public void getIndustryInfo(){
+        String access_token = "cbdf6502c04978ae401cb92a64530fb73a8c7dbe";
+        // 请求地址
+        String url = "https://ad.oceanengine.com/open_api/2/tools/industry/get/";
+        JSONObject jsonObject = HttpUtils.bytedanceGetRequest(access_token, url, new JSONObject());
+        System.out.println(jsonObject.toJSONString());
+    }
+
+    @Test
+    public void loadImageInfo()throws Exception{
+        List<CtopOauthToken>tokens = oauthTokenService.selectToutiaoToken();
+        for (CtopOauthToken token:tokens) {
+            advertiserDataService.getImageByPage(token,null,1);
+            Thread.sleep(1000L);
+        }
+    }
+
+    @Resource
+    private KieSession kieSession;
+    @Autowired
+    private IRuleEngineService ruleEngineService ;
+
+    @Test
+    public void testEngine(){
+        QueryParam queryParam1 = new QueryParam() ;
+        queryParam1.setParamId("1");
+        queryParam1.setParamSign("+");
+        QueryParam queryParam2 = new QueryParam() ;
+        queryParam2.setParamId("2");
+        queryParam2.setParamSign("-");
+        // 入参
+        kieSession.insert(queryParam1);
+        kieSession.insert(queryParam2);
+        kieSession.insert(this.ruleEngineService);
+        // 返参
+        RuleResult resultParam = new RuleResult();
+        kieSession.insert(resultParam);
+        kieSession.fireAllRules();
+        System.out.println(resultParam.isPostCodeResult());
+    }
 }

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/IFileInfoService.java

@@ -29,4 +29,6 @@ public interface IFileInfoService extends IService<FileInfo> {
     JSONObject getCreativeWord(CtopOauthToken token, Long advertiserId);
 
     String downLoadByUrl(String fileUrl);
+
+    JSONObject getActionText(Long accountId, String landingType);
 }

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

@@ -32,6 +32,7 @@ public class BindAccountAuthServiceImpl extends ServiceImpl<BindAccountAuthMappe
     @Autowired
     private BindAccountAuthMapper bindAccountAuthMapper;
 
+
     /**
      * 授权 绑定账号信息
      *
@@ -73,7 +74,7 @@ public class BindAccountAuthServiceImpl extends ServiceImpl<BindAccountAuthMappe
             // &scope=%5B%22report_service%22%2C%22ad_query%22%2C%22account_service%22%2C%22ad_manage%22%5D
             sb.append(PropertiesUtils.getValue("kuaishou_config", "kuaishou_auth_url"))
                     .append(KuaishouInterfaceConstant.AUTH_PATH)
-                    .append("?app_id=" + PropertiesUtils.getValue("kuaishou_config", "kuaishou_third_appid"))
+                    .append ("?app_id=" + PropertiesUtils.getValue("kuaishou_config", "kuaishou_third_appid"))
                     .append("&state=" + URLEncoder.encode(URLEncoder.encode(state)))
                     .append("&scope=%5B%22report_service%22%2C%22ad_query%22%2C%22account_service%22%2C%22ad_manage%22%5D")
                     .append("&redirect_uri=" + URLEncoder.encode(PropertiesUtils.getValue("kuaishou_config", "kuaishou_callback_url"), "UTF-8"));

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

@@ -132,21 +132,40 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
         JSONArray creativeWords = resultObject.getJSONObject("data").getJSONArray("creative_word");
         resultObject.remove("data");
         JSONArray array = new JSONArray();
-        if (null != creativeWords && creativeWords.size() > 0) {
+        if (null != creativeWords && !creativeWords.isEmpty()) {
             creativeWords.forEach(word -> {
                 JSONObject getWord = (JSONObject) word;
-                getWord.remove("user_rate");
-                getWord.remove("content_type");
-                getWord.remove("default_word");
+                String name = getWord.getString("name");
+                getWord.remove("words");
+                getWord.put("name",name);
                 getWord.remove("words");
                 getWord.remove("max_word_len");
-                array.add(getWord);
+                String status = getWord.getString("status");
+                if(null!=status&&status.trim().equals("CREATIVE_WORD_STATUS_APPROVE")){
+                    array.add(getWord);
+                }
             });
         }
         resultObject.put("creative_word", array);
         return resultObject;
     }
 
+    /**
+     * 行动号召数据获取
+     * @return
+     */
+    @Override
+    public JSONObject getActionText(Long accountId,String landingType) {
+        CtopOauthToken token = ctopOauthTokenService.getTokenByAccountId(accountId);
+        // 请求地址
+        String url = "https://ad.oceanengine.com/open_api/2/tools/action_text/get/";
+        // 请求参数
+        JSONObject data = new JSONObject();
+        data.put("advertiser_id", accountId);
+        data.put("landing_type",landingType);
+        return HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, data);
+    }
+
     private JSONObject imageUpload(CtopOauthToken token, String advertiserId, String imageUrl) {
         // 请求地址
         String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_file_image_ad");

+ 0 - 8
module-crawler/src/main/java/cn/com/ctop/crawler/modules/kuaishoucce/entity/KuaishouHotPhotoInfo.java

@@ -119,21 +119,13 @@ public class KuaishouHotPhotoInfo {
         this.coverThumbnailUrl = data.getJSONArray("coverThumbnailUrls").getJSONObject(0).getString("url");
         this.width = data.getInteger("width");
         this.height = data.getInteger("height");
-        ;
         this.videoDuration = data.getInteger("videoDuration");
-        ;
         this.playingTime = data.getInteger("playingTimes");
-        ;
         this.likeTime = data.getInteger("likeTimes");
-        ;
         this.commentTime = data.getInteger("commentTimes");
-        ;
         this.headUrl = data.getJSONArray("headUrls").getJSONObject(0).getString("url");
-        ;
         this.nickName = data.getString("nickName");
-        ;
         this.caption = data.getString("caption");
-        ;
         this.createTime = new Date();
         this.updateTime = new Date();
     }

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

@@ -1148,7 +1148,6 @@ public class BatchController {
         return result;
     }
 
-
     /**
      * 获取素材信息
      *

+ 216 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouController.java

@@ -3,17 +3,27 @@ package cn.com.ctop.kuaishou.modules.batch.controller;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouInfoDTO;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountDTO;
+import cn.com.ctop.kuaishou.modules.report.entity.ProjectAccountDTO;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAccountService;
+import com.baomidou.mybatisplus.extension.api.R;
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageInfo;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
  * @author yumeng
  * 2019年11月12日10:04:00
  */
+@Slf4j
 @RestController
 @RequestMapping("/kuaishou")
 public class KuaiShouController {
@@ -22,6 +32,8 @@ public class KuaiShouController {
     private IKuaishouInterfaceService kuaishouInterfaceService;
     @Autowired
     private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouReportDailyAccountService accountService;
 
     @RequestMapping("report")
     public Map<String, Object> getReport(String accountId, String startDate, String endDate, Integer type, String temporalGranularity) {
@@ -56,4 +68,206 @@ public class KuaiShouController {
         }
         return result;
     }
+
+
+    @ResponseBody
+    @RequestMapping("/getKuaishouProjectInfo")
+    public Result<PageInfo<ProjectAccountDTO>> getKuaishouProjectInfo(@RequestBody KuaishouInfoDTO dto) {
+        Result<PageInfo<ProjectAccountDTO>> result = new Result<>();
+        result.setSuccess(true);
+
+        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null){
+            result.setSuccess(false);
+            result.setMessage("参数有误");
+            return result;
+        }
+        if(dto.getPageSize() == 0){
+            dto.setPageSize(20);
+        }
+
+        try{
+            PageInfo<ProjectAccountDTO> projectAccountDTOList = accountService.getKuaishouProjectInfo(dto.getStartDate(), dto.getEndDate(), dto.getProjectList(),dto.getPageSize(),dto.getPageNum(), "", dto.getYn());
+            result.setResult(projectAccountDTOList);
+        }catch(Exception e){
+            log.error(e.getMessage());
+            result.setSuccess(false);
+            result.setMessage("执行出错");
+        }finally {
+        }
+
+        return result;
+    }
+
+    @ResponseBody
+    @RequestMapping("/getKuaishouSaleProjectInfo")
+    public Result<PageInfo<ProjectAccountDTO>> getKuaishouSaleProjectInfo(@RequestBody KuaishouInfoDTO dto) {
+        Result<PageInfo<ProjectAccountDTO>> result = new Result<>();
+        result.setSuccess(true);
+
+        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null){
+            result.setSuccess(false);
+            result.setMessage("参数有误");
+            return result;
+        }
+        if(dto.getPageSize() == 0){
+            dto.setPageSize(20);
+        }
+
+        try{
+            PageInfo<ProjectAccountDTO> projectAccountDTOList = accountService.getKuaishouSaleProjectInfo(dto.getStartDate(), dto.getEndDate(), dto.getProjectList(),dto.getPageSize(),dto.getPageNum(), "",dto.getYn());
+            result.setResult(projectAccountDTOList);
+        }catch(Exception e){
+            log.error(e.getMessage());
+            result.setSuccess(false);
+            result.setMessage("执行出错");
+        }finally {
+        }
+
+        return result;
+    }
+
+
+    @ResponseBody
+    @RequestMapping("/getKuaishouAccountInfoByProjectId")
+    public Result<PageInfo<KuaishouReportDailyAccountDTO>> getKuaishouAccountInfoByProjectId(@RequestBody KuaishouInfoDTO dto) {
+        Result<PageInfo<KuaishouReportDailyAccountDTO>> result = new Result<>();
+        result.setSuccess(true);
+
+        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null){
+            result.setSuccess(false);
+            result.setMessage("参数有误");
+            return result;
+        }
+
+        if(dto.getPageSize() == 0){
+            dto.setPageSize(20);
+        }
+
+        try{
+            PageInfo<KuaishouReportDailyAccountDTO> kuaishouReportDailyAccountDTOList = accountService.getKuaishouAccountInfoByProjectId(dto.getProjectId(), dto.getStartDate(), dto.getEndDate(),dto.getPageSize(),dto.getPageNum(),dto.getYn());
+            result.setResult(kuaishouReportDailyAccountDTOList);
+        }catch(Exception e){
+            log.error(e.getMessage());
+            result.setSuccess(false);
+            result.setMessage("执行出错");
+        }finally {
+        }
+
+        return result;
+    }
+
+    @ResponseBody
+    @RequestMapping("/getKuaishouSaleAccountInfoByProjectId")
+    public Result<PageInfo<KuaishouReportDailyAccountDTO>> getKuaishouSaleAccountInfoByProjectId(@RequestBody KuaishouInfoDTO dto) {
+        Result<PageInfo<KuaishouReportDailyAccountDTO>> result = new Result<>();
+        result.setSuccess(true);
+
+        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null){
+            result.setSuccess(false);
+            result.setMessage("参数有误");
+            return result;
+        }
+
+        if(dto.getPageSize() == 0){
+            dto.setPageSize(20);
+        }
+
+        try{
+            PageInfo<KuaishouReportDailyAccountDTO> kuaishouReportDailyAccountDTOList = accountService.getKuaishouSaleAccountInfoByProjectId(dto.getProjectId(), dto.getStartDate(), dto.getEndDate(),dto.getPageSize(),dto.getPageNum(),dto.getYn());
+            result.setResult(kuaishouReportDailyAccountDTOList);
+        }catch(Exception e){
+            log.error(e.getMessage());
+            result.setSuccess(false);
+            result.setMessage("执行出错");
+        }finally {
+        }
+
+        return result;
+    }
+
+    @ResponseBody
+    @RequestMapping("/getKuaishouCampaignInfoByAccountId")
+    public Result<PageInfo<KuaishouReportDailyAccountDTO>> getKuaishouCampaignInfoByAccountId(@RequestBody KuaishouInfoDTO dto) {
+        Result<PageInfo<KuaishouReportDailyAccountDTO>> result = new Result<>();
+        result.setSuccess(true);
+
+        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null){
+            result.setSuccess(false);
+            result.setMessage("参数有误");
+            return result;
+        }
+
+        if(dto.getPageSize() == 0){
+            dto.setPageSize(20);
+        }
+
+        try{
+            PageInfo<KuaishouReportDailyAccountDTO> kuaishouCampaignInfoList = accountService.getKuaishouCampaignInfoByAccountId(dto.getAccountId(), dto.getStartDate(), dto.getEndDate(),dto.getPageSize(),dto.getPageNum(),dto.getYn());
+            result.setResult(kuaishouCampaignInfoList);
+        }catch(Exception e){
+            log.error(e.getMessage());
+            result.setSuccess(false);
+            result.setMessage("执行出错");
+        }finally {
+        }
+
+        return result;
+    }
+
+
+    @ResponseBody
+    @RequestMapping("/getKuaishouUnitInfoByCampaignId")
+    public Result<PageInfo<KuaishouReportDailyAccountDTO>> getKuaishouUnitInfoByCampaignId(@RequestBody KuaishouInfoDTO dto) {
+        Result<PageInfo<KuaishouReportDailyAccountDTO>> result = new Result<>();
+        result.setSuccess(true);
+
+        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null){
+            result.setSuccess(false);
+            result.setMessage("参数有误");
+            return result;
+        }
+        if(dto.getPageSize() == 0){
+            dto.setPageSize(20);
+        }
+
+        try{
+            PageInfo<KuaishouReportDailyAccountDTO> kuaishouCampaignInfoList = accountService.getKuaishouUnitInfoByCampaignId(dto.getCampaignId(), dto.getStartDate(), dto.getEndDate(),dto.getPageSize(),dto.getPageNum(),dto.getYn());
+            result.setResult(kuaishouCampaignInfoList);
+        }catch(Exception e){
+            log.error(e.getMessage());
+            result.setSuccess(false);
+            result.setMessage("执行出错");
+        }finally {
+        }
+
+        return result;
+    }
+
+    @ResponseBody
+    @RequestMapping("/getKuaishouCreativeInfoByUnitId")
+    public Result<PageInfo<KuaishouReportDailyAccountDTO>> getKuaishouCreativeInfoByUnitId(@RequestBody KuaishouInfoDTO dto) {
+        Result<PageInfo<KuaishouReportDailyAccountDTO>> result = new Result<>();
+        result.setSuccess(true);
+
+        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null){
+            result.setSuccess(false);
+            result.setMessage("参数有误");
+            return result;
+        }
+        if(dto.getPageSize() == 0){
+            dto.setPageSize(20);
+        }
+
+        try{
+            PageInfo<KuaishouReportDailyAccountDTO> kuaishouCampaignInfoList = accountService.getKuaishouCreativeInfoByUnitId(dto.getUnitId(), dto.getStartDate(), dto.getEndDate(),dto.getPageSize(),dto.getPageNum(),dto.getYn());
+            result.setResult(kuaishouCampaignInfoList);
+        }catch(Exception e){
+            log.error(e.getMessage());
+            result.setSuccess(false);
+            result.setMessage("执行出错");
+        }finally {
+        }
+
+        return result;
+    }
 }

+ 158 - 27
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/MaterialRefuseController.java

@@ -4,21 +4,25 @@ import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCreative;
-import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouCreativeMapper;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCreativeService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouUpdateService;
 import cn.com.ctop.kuaishou.modules.batch.service.IMaterialRefuseService;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
+@Slf4j
 @RestController
 @RequestMapping("/MaterialRefuse")
 public class MaterialRefuseController {
@@ -29,21 +33,29 @@ public class MaterialRefuseController {
     @Autowired
     private IKuaiShouUpdateService updateService;
     @Autowired
-    private KuaiShouCreativeMapper creativeMapper;
+    private IKuaiShouCreativeService creativeService;
 
 
-    @PostMapping(value = "/getRefuseCreative")
-    public Map<String, Object> getRefuseCreative(@RequestBody JSONObject jsonObject) {
-        Map<String, Object> map = new HashMap<>();
+    @GetMapping(value = "/getRefuseCreative")
+    public Result<IPage<KuaiShouCreative>> getRefuseCreative(KuaiShouCreative creative,
+                                                             @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                             @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                             HttpServletRequest req) {
+        Result<IPage<KuaiShouCreative>> result = new Result<>();
         try {
-            List<JSONObject> list = materialRefuseService.getRefuseCreative(jsonObject.getLong("accountId"));
-            map.put("code", 0);
-            map.put("data", list);
+
+            QueryWrapper<KuaiShouCreative> queryWrapper = QueryGenerator.initQueryWrapper(creative, req.getParameterMap());
+            queryWrapper.eq("status", 42);
+            queryWrapper.orderByDesc("creative_create_time");
+            Page<KuaiShouCreative> page = new Page<KuaiShouCreative>(pageNo, pageSize);
+            IPage<KuaiShouCreative> pageList = creativeService.page(page, queryWrapper);
+            result.setSuccess(true);
+            result.setResult(pageList);
+
         } catch (Exception e) {
-            map.put("code", -1);
-            e.printStackTrace();
+            result.setSuccess(false);
         }
-        return map;
+        return result;
     }
 
     @PostMapping(value = "/updateCreative")
@@ -82,19 +94,138 @@ public class MaterialRefuseController {
             return map;
         }
 
-        QueryWrapper<KuaiShouCreative> creativeQueryWrapper = new QueryWrapper<>();
-        creativeQueryWrapper.eq("account_id", accountId);
-        creativeQueryWrapper.eq("creative_id", jsonObject.getString("creativeId"));
-        creativeQueryWrapper.eq("unit_id", jsonObject.getString("unitId"));
-        creativeQueryWrapper.eq("campaign_id", jsonObject.getString("campaignId"));
-        int i = creativeMapper.delete(creativeQueryWrapper);
-        if (i > 0) {
-            map.put("code", 0);
-            map.put("message", "重审成功");
-            return map;
+        return null;
+    }
+
+
+    @PostMapping(value = "/batchUpdateCreative")
+    public Result<JSONObject> batchUpdateCreative(@RequestBody JSONObject jsonObject) {
+
+        Result<JSONObject> result = new Result<>();
+        JSONObject returnJson = new JSONObject();
+        if (Check.isNull(jsonObject)) {
+            result.setSuccess(false);
+            result.setMessage("入参为空");
+            return result;
         }
 
-        return null;
+        Long accountId = jsonObject.getLong("accountId");
+        QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("account_id", accountId);
+        queryWrapper.eq("media_id", 2);
+        queryWrapper.orderByDesc("create_time");
+        queryWrapper.last("limit 1");
+        CtopOauthToken ctopOauthToken = oauthTokenMapper.selectOne(queryWrapper);
+        if (Check.isNull(ctopOauthToken)) {
+            result.setSuccess(false);
+            result.setMessage("未获取到授权信息");
+            return result;
+        }
+
+        JSONArray creativeArr = jsonObject.getJSONArray("creativeArr");
+        Integer successCount = 0;
+        Integer failCount = 0;
+        if (!Check.isNull(creativeArr)) {
+
+            for (int i = 0; i < creativeArr.size(); i++) {
+                JSONObject creativeJson = creativeArr.getJSONObject(i);
+                if (!Check.isNull(creativeJson)) {
+                    Long creativeId = creativeJson.getLong("creativeId");
+                    JSONObject requestJson = new JSONObject();
+                    requestJson.put("creativeId", creativeId);
+                    String description = creativeJson.getString("description");
+                    if (!Check.isNull(description)) {
+                        requestJson.put("description", convertMoString(description));
+                        Map<String, Object> creativeMap = updateService.updateCreative(ctopOauthToken.getAccessToken(), accountId, requestJson);
+                        Integer code = (Integer) creativeMap.get("code");
+                        if (code == 0) {
+                            log.info("拒审重提成功,accountId:{},creativeId:{}", accountId, creativeId);
+                            successCount += 1;
+
+                        } else {
+                            log.info("拒审重提失败,accountId:{},creativeId:{}", accountId, creativeId);
+                            failCount += 1;
+                        }
+                    }
+
+                }
+
+            }
+
+        }
+        returnJson.put("successCount", successCount);
+        returnJson.put("failCount", failCount);
+
+        result.setSuccess(true);
+        result.setResult(returnJson);
+        return result;
+    }
+
+
+    public static synchronized String convertMoString(String sMo) {
+
+        if (Check.isNull(sMo)) {
+            return null;
+        }
+        String newString = null;
+        try {
+            if (sMo.contains(",")) {
+                return sMo.replace(',', ',');
+            } else if (sMo.contains("~")) {
+                newString = sMo.replace('~', '~');
+            } else if (sMo.contains("。")) {
+                newString = sMo.replace('。', '.');
+            } else if (sMo.contains(";")) {
+                newString = sMo.replace(';', ';');
+            } else if (sMo.contains("!")) {
+                newString = sMo.replace("!", "!");
+
+            } else if (sMo.contains("?")) {
+                newString = sMo.replace('?', '?');
+
+            } else if (sMo.contains(":")) {
+                newString = sMo.replace(':', ':');
+
+            } else if (sMo.contains("“")) {
+                newString = sMo.replace('“', '"');
+
+            } else if (sMo.contains("”")) {
+                newString = sMo.replace('”', '"');
+
+            } else if (sMo.contains("<")) {
+                newString = sMo.replace('>', '》').replace('<', '《');
+            } else if (sMo.contains(",")) {
+                newString = sMo.replace(',', ',');
+            } else if (sMo.contains(".")) {
+                newString = sMo.replace('.', '。');
+            } else if (sMo.contains(";")) {
+                newString = sMo.replace(';', ';');
+            } else if (sMo.contains("!")) {
+                newString = sMo.replace("!", "!");
+
+            } else if (sMo.contains("?")) {
+                newString = sMo.replace('?', '?');
+
+            } else if (sMo.contains(":")) {
+                newString = sMo.replace(':', ':');
+
+            } else if (sMo.contains(""")) {
+                newString = sMo.replace('"', '“');
+
+            } else if (sMo.contains(""")) {
+                newString = sMo.replace('"', '”');
+            } else if (sMo.contains("《")) {
+                newString = sMo.replace('》', '>').replace('《', '<');
+            } else if (sMo.contains("~")) {
+                newString = sMo.replace('~', '~');
+            } else {
+                newString = sMo;
+            }
+
+        } catch (Exception ex) {
+            return sMo;
+        }
+        return newString;
     }
 
 }

+ 16 - 5
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouUpdateServiceImpl.java

@@ -116,6 +116,7 @@ public class KuaiShouUpdateServiceImpl implements IKuaiShouUpdateService {
      */
     @Autowired
     private IKuaiShouGroupService groupService;
+
     @Override
     public Map<String, Object> updateUnitDayBudget(String token, Long advertiserId, Long unitId, Long dayBudget, String loginId) {
         Map<String, Object> returnMap = new HashMap<>();
@@ -484,14 +485,21 @@ public class KuaiShouUpdateServiceImpl implements IKuaiShouUpdateService {
             header.put("Content-Type", "application/json");
             JSONObject params = new JSONObject();
 
-
+            params.put("advertiser_id", advertiserId);
             String creativeId = requestJson.getString("creativeId");
             String creativeName = requestJson.getString("creativeName");
             String description = requestJson.getString("description");
-            params.put("advertiser_id", advertiserId);
-            params.put("creative_id", creativeId);
-            params.put("creative_name", creativeName);
-            params.put("description", description);
+            if (!Check.isNull(creativeId)) {
+                params.put("creative_id", creativeId);
+            }
+            if (!Check.isNull(creativeName)) {
+                params.put("creative_name", creativeName);
+            }
+            if (!Check.isNull(description)) {
+                params.put("description", description);
+            }
+
+
             String result = HttpUtils.httpPostRequest(url, params, header);
             JSONObject resultJson = JSONObject.parseObject(result);
             if (!Check.isNull(resultJson)) {
@@ -500,6 +508,9 @@ public class KuaiShouUpdateServiceImpl implements IKuaiShouUpdateService {
                     returnMap.put("code", 0);
                     returnMap.put("success", true);
                     returnMap.put("message", "修改成功");
+                    Thread.sleep(100);
+                    interfaceService.getCreativeByCreativeId(token, advertiserId, Long.valueOf(creativeId));
+
                 } else {
                     log.error("修改广告创意状态失败,advertiserId:{},creativeId:{},返回信息:{}", advertiserId, creativeId, resultJson);
                     returnMap.put("code", -1);

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

@@ -22,6 +22,7 @@ public class MaterialRefuseServiceImpl implements IMaterialRefuseService {
 
     @Override
     public List<JSONObject> getRefuseCreative(Long accountId) {
+
         List<JSONObject> refuseCreativeList = materialRefuseMapper.selectRefuseCreativeByAccountId(accountId);
         return refuseCreativeList;
     }

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

@@ -0,0 +1,23 @@
+package cn.com.ctop.kuaishou.modules.report.entity;
+
+import com.github.pagehelper.PageInfo;
+import com.github.pagehelper.page.PageMethod;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+
+@Data
+public class KuaishouInfoDTO extends PageInfo implements Serializable {
+    private String startDate;
+    private String endDate;
+    private Long unitId;
+    private List<Long> projectList;
+    private Long accountId;  //广告主名称
+    private Long campaignId;
+    private Long projectId;
+    private Integer yn;
+
+}

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

@@ -0,0 +1,54 @@
+package cn.com.ctop.kuaishou.modules.report.entity;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Data
+public class KuaishouReportDailyAccountDTO implements Serializable {
+    private String statDate;
+    private String accountId;
+    private String authName;
+    private Long projectId;
+    private String projectName;
+    private Long campaignId;
+    private String campaignName;
+    private Long creativeId;
+    private String creativeName;
+    private Long unitId;
+    private String unitName;
+    private BigDecimal charge;  //消耗
+    private Long photoShow;  //封面曝光数
+    private Long photoClick;  //封面点击数
+    private Long aclick;  //素材曝光数
+    private Long bclick;  //行为数
+    private Long activation;  //激活数
+    private Long submit;  //提交按钮点击数
+    private Long eventRegister;  //注册数
+    private Long eventNextDayStay;  //次日留存数
+    private BigDecimal activationCost;  //激活成本
+    private String photoClickRatio;  //封面点击率
+    private String actionRate;  //行为率
+    //@JsonSerialize(using = ToStringSerializer.class)
+    private BigDecimal impression1kCost;  //均千次封面曝光花费
+    private BigDecimal photoClickCost;  //平均封面点击单价
+    private BigDecimal actionCost;  //平均行为单价
+    private Long photoShare;  //分享数
+    private Long photoComment;  //评论数
+    private Long photoLike;  //点赞数
+    private Long follow;  //新增关注数
+    private Long report;  //举报数
+    private Long cancelFollow;  //取消关注数
+    private Long block;  //拉黑数
+    private Long nagative;  //减少此类作品数
+    private Long downloadStarted;  //应用下载数据-安卓下载开始数
+    private Long downloadCompleted;  //应用下载数据-安卓下载完成数
+    private BigDecimal eventNextDayStayCost;  //次日留存成本
+    private Long photoId;
+    private String url;
+    private String coverUrl;
+    private Integer materialType;
+}

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

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.report.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+
+@Data
+public class KuaishouVideoInfoDTO implements Serializable {
+    private String url;
+    private String coverUrl;
+
+}

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

@@ -0,0 +1,45 @@
+package cn.com.ctop.kuaishou.modules.report.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+
+@Data
+public class ProjectAccountDTO implements Serializable {
+    private String statDate;
+    private Long projectId;
+    private String projectName;
+    private String responsibleName;
+    private String advertiserName;  //广告主名称
+    private String designResponsibleName;
+    private String saleId;
+    private String saleName;
+    private BigDecimal charge;
+    private Long photoShow;
+    private Long photoClick;
+    private Long aclick;
+    private Long bclick;
+    private Long activation;
+    private Long submit;
+    private Long eventRegister;
+    private Long eventNextDayStay;
+    private BigDecimal activationCost;
+    private String photoClickRate;
+    private String bclickRate;
+    private BigDecimal impression1kCost;
+    private BigDecimal photoClickCost;
+    private BigDecimal actionCost;
+    private Long photoShare;
+    private Long photoComment;
+    private Long photoLike;
+    private Long follow;
+    private Long report;
+    private Long cancelFollow;
+    private Long block;
+    private Long nagative;
+    private Long downloadStarted;
+    private Long downloadCompleted;
+    private BigDecimal eventNextDayStayCost;
+}

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

@@ -0,0 +1,100 @@
+package cn.com.ctop.kuaishou.modules.report.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 项目成员
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-11-19
+ */
+@Data
+@TableName("ctop_project_member")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_project_member对象", description = "项目成员")
+public class ProjectMember implements  Serializable{
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 项目id
+     */
+    @Excel(name = "项目id", width = 15)
+    @ApiModelProperty(value = "项目id")
+    private Long projectId;
+
+
+    @Excel(name = "项目名称", width = 15)
+    @ApiModelProperty(value = "项目名称")
+    private String projectName;
+    /**
+     * 成员id
+     */
+    @Excel(name = "成员id", width = 15)
+    @ApiModelProperty(value = "成员id")
+    private String userId;
+
+    @Excel(name = "成员名称", width = 15)
+    @ApiModelProperty(value = "成员名称")
+    private String userName;
+
+    private String roleCode;
+
+    @TableField(exist = false)
+    private Long maxBid;
+
+
+    @TableField(exist = false)
+    private String responsibleName;
+
+
+    @TableField(exist = false)
+    private String designResponsibleName;
+
+    @TableField(exist = false)
+    private String advertiserName;
+    @TableField(exist = false)
+    private String advertiserId;
+
+
+    @TableField(exist = false)
+    private String mediaId;
+
+
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+}

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

@@ -1,6 +1,9 @@
 package cn.com.ctop.kuaishou.modules.report.mapper;
 
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountDTO;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouVideoInfoDTO;
+import cn.com.ctop.kuaishou.modules.report.entity.ProjectAccountDTO;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
@@ -15,4 +18,35 @@ public interface KuaishouReportDailyAccountMapper extends BaseMapper<KuaishouRep
 
     List<JSONObject> selectCost(@Param("accountId") Long accountId, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
+    List<ProjectAccountDTO> getKuaishouProjectInfo(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("projectList")List<Long> projectList, @Param("yn")Integer yn);
+
+    List<KuaishouReportDailyAccountDTO> getKuaishouAccountInfoByProjectId(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("projectId")Long projectId, @Param("accountIds")List<Long> accountIds, @Param("yn")Integer yn);
+
+    List<KuaishouReportDailyAccountDTO> getKuaishouCampaignInfoByAccountId(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("accountId")Long accountId, @Param("accountIds")List<Long> accountIds, @Param("yn")Integer yn);
+
+    List<KuaishouReportDailyAccountDTO> getKuaishouUnitInfoByCampaignId(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("campaignId")Long campaignId, @Param("accountIds")List<Long> accountIds, @Param("yn")Integer yn);
+
+    List<Long> queryProjectMemberByUserId(@Param("userId")String userId, @Param("mediaIds")List<Long> mediaIds);
+
+    List<Long> queryProjectInfoBySaleId(@Param("userId")String userId, @Param("mediaIds")List<Long> mediaIds);
+
+    List<ProjectAccountDTO> queryProjectMemberByIds(@Param("projectIds")List<Long> projectIds);
+
+    String getRoleCodeByUserId(@Param("userId")String userId);
+
+    List<Long> queryProjectMemberByAdmins(@Param("mediaIds")List<Long> mediaIds);
+
+    List<KuaishouReportDailyAccountDTO> getKuaishouCreativeInfoByUnitId(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("unitId")Long unitId, @Param("accountIds") List<Long> accoundIds, @Param("yn")Integer yn);
+
+    KuaishouVideoInfoDTO getVideoUrl(@Param("photoId")Long photoId);
+
+    List<Long> getUserProjectAccountIds(@Param("userId")String userId);
+
+    List<Long> getUserProjectAccountIdsByAdmin();
+
+
+
+    List<Long> getSaleProjectAccountIds(@Param("userId")String userId);
+
+
 }

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaiShouYiCheReportMapper.xml

@@ -446,7 +446,7 @@
             and t1.stat_date = #{statDate}
         </if>
         ) t2
-        WHERE t2.campaignName in(845,846,847,848,849,850,1070,1071,1072,1066,1069,1064)
+        WHERE t2.campaignName in(680,681,845,846,847,848,849,850,1070,1071,1072,1066,1069,1064)
 
     </select>
 

+ 576 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml

@@ -530,4 +530,579 @@
         group by stat_date
     </select>
 
-</mapper>
+    <select id="getKuaishouAccountInfoByProjectId" resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountDTO">
+--         select * from
+--         (
+        select
+        #{yn} as 'yn',
+        concat(#{startDate}, '~' ,#{endDate}) as 'statDate',
+        a.account_id as 'accountId',
+        b.auth_name as 'authName',
+        b.project_id as 'projectId',
+        b.project_name as 'projectName',
+        round(sum(a.charge),2) as 'charge',
+        sum(a.photo_show) as 'photoShow', -- 封面曝光数
+        sum(a.photo_click) as 'photoClick', -- 封面点击数
+        sum(a.aclick) as 'aclick', -- 素材曝光数
+        sum(a.bclick) as 'bclick', -- 行为数
+        sum(a.activation) as 'activation', -- 激活数
+        sum(a.submit) as 'submit', -- 提交按钮点击数
+        sum(a.event_register) as 'eventRegister', -- 注册数
+        sum(a.event_next_day_stay) as 'eventNextDayStay', -- 次日留存数
+        ROUND(IFNULL(sum(a.charge)/sum(a.activation),0),2) as 'activationCost', -- 激活成本
+        case when photo_show!=0 then concat(round(sum(a.photo_click)/sum(a.photo_show) * 100 ,2),'%') else 0 end as
+        'photoClickRatio', -- 封面点击率
+        case when aclick!=0 then concat(round(sum(a.bclick)/sum(a.aclick) * 100 ,2),'%') else 0 end as 'actionRate', -- 行为率
+        (case
+        when sum(a.photo_show) != 0
+        then round((sum(a.charge) / sum(a.photo_show)) * 1000,2)
+        else 0
+        end
+        ) as 'impression1kCost', -- 均千次封面曝光花费
+        (case
+        when sum(a.photo_click) != 0
+        then round(sum(a.charge) / sum(a.photo_click),2)
+        else 0
+        end
+        ) as 'photoClickCost', -- 平均封面点击单价
+        (CASE
+        WHEN sum(a.photo_click) != 0
+        THEN round(sum(a.charge) / sum(a.photo_click),2)
+        ELSE 0
+        end
+        ) as 'actionCost', -- 平均行为单价
+        sum(a.photo_share) as 'photoShare', -- 分享数
+        sum(a.photo_comment) as 'photoComment', -- 评论数
+        sum(a.photo_like) as 'photoLike', -- 点赞数
+        sum(a.follow) as 'follow', -- 新增关注数
+        sum(a.report) as 'report', -- 举报数
+        sum(a.cancel_follow) as 'cancelFollow', -- 取消关注数
+        sum(a.block) as 'block', -- 拉黑数
+        sum(a.negative) as 'nagative', -- 减少此类作品数
+        sum(a.download_started) as 'downloadStarted', -- 应用下载数据-安卓下载开始数
+        sum(a.download_completed) as 'downloadCompleted', -- 应用下载数据-安卓下载完成数
+        (CASE
+        WHEN sum(a.event_next_day_stay) != 0
+        THEN round(sum(a.charge) / sum(a.event_next_day_stay),2)
+        ELSE 0
+        end
+        ) as 'eventNextDayStayCost' -- 次日留存成本
+        from
+        ctop_kuaishou_report_daily_account a
+        left join (select * from ctop_user_allocation group by account_id) b on a.account_id = b.account_id
+        where
+        a.stat_date &gt;= #{startDate}
+        and
+        a.stat_date &lt;= #{endDate}
+
+        <if test="projectId!=null and projectId != '' ">
+            and
+            b.project_id = #{projectId}
+        </if>
+        <if test="accountIds !=null">
+            and a.account_id in
+            <foreach collection="accountIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        group by a.account_id
+        order by sum(a.charge) desc
+<!--        )m-->
+<!--        <if test="yn=1">-->
+<!--            where-->
+<!--            m.charge != 0-->
+<!--        </if>-->
+    </select>
+
+    <select id="getKuaishouProjectInfo" resultType="cn.com.ctop.kuaishou.modules.report.entity.ProjectAccountDTO">
+--         select* from (
+             select
+        #{yn} as 'yn',
+            concat(#{startDate}, '~' , #{endDate}) as 'statDate',
+            (select project_id from ctop_user_allocation where account_id = a.account_id limit 1) as 'projectId',
+            (select project_name from ctop_user_allocation where account_id = a.account_id limit 1) as 'projectName',
+            (select advertiser_name from ctop_project where id = (select project_id from ctop_user_allocation where
+                                account_id = a.account_id limit 1
+                        )) as 'advertiserName',
+            (select responsible_name from ctop_project where id = (select project_id from ctop_user_allocation where
+                                account_id = a.account_id limit 1
+                        )) as 'responsibleName',
+            (select design_responsible_name from ctop_project where id = (select project_id from ctop_user_allocation where account_id = a.account_id limit 1
+                        )) as 'designResponsibleName',
+            ifnull(round(sum(a.charge),2),0) as 'charge',
+            ifnull(sum(a.photo_show),0) as 'photoShow',  -- 封面曝光数
+            ifnull(sum(a.photo_click),0) as 'photoClick', -- 封面点击数
+            ifnull(sum(a.aclick),0) as 'aclick',  -- 素材曝光数
+            ifnull(sum(a.bclick),0) as 'bclick',  -- 行为数
+            ifnull(sum(a.activation),0) as 'activation',  -- 激活数
+            ifnull(sum(a.submit),0) as 'submit',   -- 提交按钮点击数
+            ifnull(sum(a.event_register),0) as 'eventRegister',   -- 注册数
+            ifnull(sum(event_next_day_stay),0) as 'eventNextDayStay',  -- 次日留存数
+            ROUND(IFNULL(sum(a.charge)/sum(a.activation),0),2) as 'activationCost',   -- 激活成本
+            case when (sum(a.photo_show) is not null and sum(a.photo_show)!=0) then concat(round(ifnull(sum(a.photo_click),0)/sum(a.photo_show) * 100 ,2),'%') else 0 end as 'photoClickRate',   -- 封面点击率
+            case when (sum(a.aclick) is not null and sum(a.aclick)!=0) then concat(round(ifnull(sum(a.bclick),0)/sum(a.aclick) * 100 ,2),'%') else 0 end as 'bclickRate',  -- 行为率
+            (case
+            when (sum(a.photo_show) is not null and sum(a.photo_show) != 0)
+            then round((ifnull(sum(a.charge),0) / sum(a.photo_show)) * 1000,2)
+            else 0
+            end
+            ) as 'impression1kCost', -- 均千次封面曝光花费
+            (case
+            when (sum(a.photo_click) is not null and sum(a.photo_click) != 0)
+            then round( ifnull(sum(a.charge),0) / sum(a.photo_click),2)
+            else 0
+            end
+            ) as 'photoClickCost', -- 平均封面点击单价
+            (CASE
+            WHEN ( sum(a.photo_click) is not null and sum(a.photo_click) != 0)
+            THEN round(sum(a.charge) / sum(a.photo_click),2)
+            ELSE 0
+            end
+            ) as 'actionCost', -- 平均行为单价
+            ifnull(sum(a.photo_share),0) as 'photoShare',  -- 分享数
+            ifnull(sum(a.photo_comment),0) as 'photoComment', -- 评论数
+            ifnull(sum(a.photo_like),0) as 'photoLike', -- 点赞数
+            ifnull(sum(a.follow),0) as 'follow', -- 新增关注数
+            ifnull(sum(a.report),0) as 'report', -- 举报数
+            ifnull(sum(a.cancel_follow),0) as 'cancelFollow', -- 取消关注数
+            ifnull(sum(a.block),0) as 'block', -- 拉黑数
+            ifnull(sum(a.negative),0) as 'nagative', -- 减少此类作品数
+            ifnull(sum(a.download_started),0) as 'downloadStarted',  -- 应用下载数据-安卓下载开始数
+            ifnull(sum(a.download_completed),0) as 'downloadCompleted',  -- 应用下载数据-安卓下载完成数
+            (CASE
+            WHEN ( sum(a.event_next_day_stay) is not null and sum(a.event_next_day_stay) != 0)
+            THEN round(  ifnull(sum(a.charge),0) / sum(a.event_next_day_stay)  ,2)
+            ELSE 0
+            end
+            ) as 'eventNextDayStayCost'  -- 次日留存成本
+            from
+            ctop_kuaishou_report_daily_account a
+            left join  (select * from ctop_user_allocation group by account_id) b on a.account_id = b.account_id
+            -- left join ctop_project c on b.project_id = c.id
+            where
+            a.stat_date &gt;= #{startDate}
+            and
+            a.stat_date &lt;= #{endDate}
+            and
+            b.project_id in
+            <foreach collection="projectList" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+            group by b.project_id
+            order by sum(a.charge) desc
+<!--        ) m-->
+<!--        <if test="yn = 1">-->
+<!--        where-->
+<!--            m.charge != 0-->
+<!--        </if>-->
+    </select>
+
+    <!-- 计划汇总 -->
+    <select id="getKuaishouCampaignInfoByAccountId" resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountDTO">
+--         select * from(
+        select
+        #{yn} as 'yn',
+        concat(#{startDate}, '~' ,#{endDate}) as 'statDate',
+        b.project_id as 'projectId',
+        b.project_name as 'projectName',
+        b.auth_name as 'authName',
+        a.account_id as 'accountId',
+        a.campaign_id as 'campaignId',  -- 计划id
+        a.campaign_name as 'campaignName',   -- 计划名称
+        round(sum(a.charge),2) as 'charge',
+        sum(a.photo_show) as 'photoShow',  -- 封面曝光数
+        sum(a.photo_click) as 'photoClick', -- 封面点击数
+        sum(a.aclick) as 'aclick',  -- 素材曝光数
+        sum(a.bclick) as 'bclick',  -- 行为数
+        sum(a.activation) as 'activation',  -- 激活数
+        sum(a.submit) as 'submit',   -- 提交按钮点击数
+        sum(a.event_register) as 'eventRegister',   -- 注册数
+        sum(event_next_day_stay) as 'eventNextDayStay',  -- 次日留存数
+        ROUND(IFNULL(sum(a.charge)/sum(a.activation),0),2) as 'activationCost',   -- 激活成本
+        case when photo_show!=0 then concat(round(sum(a.photo_click)/sum(a.photo_show) * 100 ,2),'%') else 0 end as 'photoClickRatio',   -- 封面点击率
+        case when aclick!=0 then concat(round(sum(a.bclick)/sum(a.aclick) * 100 ,2),'%') else 0 end as 'actionRate',  -- 行为率
+        (case
+        when sum(a.photo_show) != 0
+        then round((sum(a.charge) / sum(a.photo_show)) * 1000,2)
+        else 0
+        end
+        ) as 'impression1kCost', -- 均千次封面曝光花费
+        (case
+        when sum(a.photo_click) != 0
+        then round(sum(a.charge) / sum(a.photo_click),2)
+        else 0
+        end
+        ) as 'photoClickCost', -- 平均封面点击单价
+        (CASE
+        WHEN sum(a.photo_click) != 0
+        THEN round(sum(a.charge) / sum(a.photo_click),2)
+        ELSE 0
+        end
+        ) as 'actionCost', -- 平均行为单价
+        sum(a.photo_share) as 'photoShare',  -- 分享数
+        sum(a.photo_comment) as 'photoComment', -- 评论数
+        sum(a.photo_like) as 'photoLike', -- 点赞数
+        sum(a.follow) as 'follow', -- 新增关注数
+        sum(a.report) as 'report', -- 举报数
+        sum(a.cancel_follow) as 'cancelFollow', -- 取消关注数
+        sum(a.block) as 'block', -- 拉黑数
+        sum(a.negative) as 'nagative', -- 减少此类作品数
+        sum(a.download_started) as 'downloadStarted',  -- 应用下载数据-安卓下载开始数
+        sum(a.download_completed) as 'downloadCompleted',  -- 应用下载数据-安卓下载完成数
+        (CASE
+        WHEN sum(a.event_next_day_stay) != 0
+        THEN round(sum(a.charge) / sum(a.event_next_day_stay),2)
+        ELSE 0
+        end
+        ) as 'eventNextDayStayCost'  -- 次日留存成本
+        from
+        ctop_kuaishou_report_daily_campaign a
+        left join (select * from ctop_user_allocation group by account_id) b on a.account_id = b.account_id
+        where
+        a.stat_date &gt;= #{startDate}
+        and
+        a.stat_date &lt;= #{endDate}
+        <if test="accountId !=null and accountId != '' ">
+            and
+            a.account_id = #{accountId}
+        </if>
+        <if test="accountIds !=null">
+            and a.account_id in
+            <foreach collection="accountIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+
+        group by a.campaign_id
+        order by sum(a.charge) desc
+<!--        ) m-->
+
+<!--        <if test="yn = 1">-->
+<!--            where-->
+<!--            m.charge != 0-->
+<!--        </if>-->
+    </select>
+
+    <!-- 根据计划id获取组信息 -->
+    <select id="getKuaishouUnitInfoByCampaignId" resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountDTO">
+--         select * from (
+        select
+        #{yn} as 'yn',
+        concat(#{startDate}, '~' ,#{endDate}) as 'statDate',
+        b.project_id as 'projectId',
+        b.project_name as 'projectName',
+        a.account_id as 'accountId',
+        b.auth_name as 'authName',
+        a.campaign_id as 'campaignId', -- 计划id
+        a.campaign_name as 'campaignName', -- 计划名称
+        a.unit_id as 'unitId', -- 组id,
+        a.unit_name as 'unitName', -- 组名称
+        round(sum(a.charge),2) as 'charge',
+        sum(a.photo_show) as 'photoShow', -- 封面曝光数
+        sum(a.photo_click) as 'photoClick', -- 封面点击数
+        sum(a.aclick) as 'aclick', -- 素材曝光数
+        sum(a.bclick) as 'bclick', -- 行为数
+        sum(a.activation) as 'activation', -- 激活数
+        sum(a.submit) as 'submit', -- 提交按钮点击数
+        sum(a.event_register) as 'eventRegister', -- 注册数
+        sum(event_next_day_stay) as 'eventNextDayStay', -- 次日留存数
+        ROUND(IFNULL(sum(a.charge)/sum(a.activation),0),2) as 'activationCost', -- 激活成本
+        case when photo_show!=0 then concat(round(sum(a.photo_click)/sum(a.photo_show) * 100 ,2),'%') else 0 end as
+        'photoClickRatio', -- 封面点击率
+        case when aclick!=0 then concat(round(sum(a.bclick)/sum(a.aclick) * 100 ,2),'%') else 0 end as 'actionRate', -- 行为率
+        (case
+        when sum(a.photo_show) != 0
+        then round((sum(a.charge) / sum(a.photo_show)) * 1000,2)
+        else 0
+        end
+        ) as 'impression1kCost', -- 均千次封面曝光花费
+        (case
+        when sum(a.photo_click) != 0
+        then round(sum(a.charge) / sum(a.photo_click),2)
+        else 0
+        end
+        ) as 'photoClickCost', -- 平均封面点击单价
+        (CASE
+        WHEN sum(a.photo_click) != 0
+        THEN round(sum(a.charge) / sum(a.photo_click),2)
+        ELSE 0
+        end
+        ) as 'actionCost', -- 平均行为单价
+        sum(a.photo_share) as 'photoShare', -- 分享数
+        sum(a.photo_comment) as 'photoComment', -- 评论数
+        sum(a.photo_like) as 'photoLike', -- 点赞数
+        sum(a.follow) as 'follow', -- 新增关注数
+        sum(a.report) as 'report', -- 举报数
+        sum(a.cancel_follow) as 'cancelFollow', -- 取消关注数
+        sum(a.block) as 'block', -- 拉黑数
+        sum(a.negative) as 'nagative', -- 减少此类作品数
+        sum(a.download_started) as 'downloadStarted', -- 应用下载数据-安卓下载开始数
+        sum(a.download_completed) as 'downloadCompleted', -- 应用下载数据-安卓下载完成数
+        (CASE
+        WHEN sum(a.event_next_day_stay) != 0
+        THEN round(sum(a.charge) / sum(a.event_next_day_stay),2)
+        ELSE 0
+        end
+        ) as 'eventNextDayStayCost' -- 次日留存成本
+        from
+        ctop_kuaishou_report_daily_group a
+        left join (select * from ctop_user_allocation group by account_id) b on a.account_id = b.account_id
+        -- left join ctop_kuaishou_campaign c on a.campaign_id = c.campaign_id
+        where
+        a.stat_date &gt;= #{startDate}
+        and
+        a.stat_date &lt;= #{endDate}
+            <if test="campaignId != null and campaignId != ''">and
+                a.campaign_id = #{campaignId}
+            </if>
+            <if test="accountIds !=null">
+                and a.account_id in
+                <foreach collection="accountIds" item="item" separator=","
+                         open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            group by unit_id
+            order by sum(a.charge) desc
+<!--            ) m-->
+<!--        <if test="yn = 1">-->
+<!--            where-->
+<!--            m.charge != 0-->
+<!--        </if>-->
+    </select>
+
+    <select id="queryProjectMemberByUserId" resultType="long">
+        select
+        distinct a.project_id as projectId
+       -- a.project_name as projectName,
+--         a.advertiser_id as advertiserId,
+       -- a.advertiser_name as advertiserName,
+--         (SELECT media_id from ctop_project c where c.id=a.project_id limit 1) as mediaId,
+       -- c.responsible_name as responsibleName,
+       -- c.design_responsible_name as designResponsibleName
+        from
+        ctop_user_allocation a
+        left join ctop_project_member b on a.project_id = b.project_id
+        left join ctop_project c on a.project_id = c.id
+        where b.user_id = #{userId}
+        and a.media_id in
+        <foreach collection="mediaIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+        order by c.create_time desc
+    </select>
+
+    <select id="queryProjectInfoBySaleId" resultType="long">
+        select
+        distinct c.id as projectId
+        -- c.project_name as projectName,
+        --         a.advertiser_id as advertiserId,
+        -- c.advertiser_name as advertiserName,
+        --         (SELECT media_id from ctop_project c where c.id=a.project_id limit 1) as mediaId,
+        -- c.responsible_name as responsibleName,
+        -- c.design_responsible_name as designResponsibleName,
+        -- c.sale_id as saleId,
+        -- u.realname as saleName
+        from
+        ctop_project c
+        left join sys_user u on c.sale_id = u.id
+        where c.sale_id = #{userId}
+        and c.media_id in
+        <foreach collection="mediaIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+        order by c.create_time desc
+    </select>
+
+    <select id="queryProjectMemberByIds" resultType="cn.com.ctop.kuaishou.modules.report.entity.ProjectAccountDTO">
+        select
+        distinct id as projectId,
+                project_name as projectName,
+        --         a.advertiser_id as advertiserId,
+                advertiser_name as advertiserName,
+        --         (SELECT media_id from ctop_project c where c.id=a.project_id limit 1) as mediaId,
+                responsible_name as responsibleName,
+                design_responsible_name as designResponsibleName
+        from ctop_project
+        where
+        id in
+            <foreach collection="projectIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        order by create_time desc
+    </select>
+
+    <select id="getRoleCodeByUserId" resultType="string">
+        select
+        role_code
+        from
+        sys_user_role a
+        left join sys_role b on a.role_id = b.id
+        where a.user_id = #{userId}
+    </select>
+
+    <!-- 设计师展示所有自己的角色下制作的视频 -->
+    <select id="queryProjectMemberByAdmins" resultType="long">
+        select
+        id as projectId
+        -- project_name as projectName,
+        -- advertiser_name as advertiserName ,
+        -- responsible_name as responsibleName,
+        -- design_responsible_name as designResponsibleName
+        from
+        ctop_project
+        where
+        media_id in
+        <foreach collection="mediaIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+        order by create_time desc
+    </select>
+
+    <select id="getKuaishouCreativeInfoByUnitId" resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountDTO">
+--         select * from (
+            select
+        #{yn} as 'yn',
+            concat(#{startDate}, '~' ,#{endDate}) as 'statDate',
+            b.project_id as 'projectId',
+            b.project_name as 'projectName',
+            a.account_id as 'accountId',
+            b.auth_name as 'authName',
+            a.creative_id as 'creativeId',
+            a.creative_name as 'creativeName',
+            a.campaign_id as 'campaignId',  -- 计划id
+            a.campaign_name as 'campaignName',  -- 计划名称
+            a.unit_id as 'unitId',  -- 组id,
+            a.unit_name as 'unitName',  -- 组名称
+            round(sum(a.charge),2) as 'charge',
+            sum(a.photo_show) as 'photoShow',  -- 封面曝光数
+            sum(a.photo_click) as 'photoClick', -- 封面点击数
+            sum(a.aclick) as 'aclick',  -- 素材曝光数
+            sum(a.bclick) as 'bclick',  -- 行为数
+            sum(a.activation) as 'activation',  -- 激活数
+            sum(a.submit) as 'submit',   -- 提交按钮点击数
+            sum(a.event_register) as 'eventRegister',   -- 注册数
+            sum(event_next_day_stay) as 'eventNextDayStay',  -- 次日留存数
+            ROUND(IFNULL(sum(a.charge)/sum(a.activation),0),2) as 'activationCost',   -- 激活成本
+            case when photo_show!=0 then concat(round(sum(a.photo_click)/sum(a.photo_show) * 100 ,2),'%') else 0 end as 'photoClickRatio',   -- 封面点击率
+            case when aclick!=0 then concat(round(sum(a.bclick)/sum(a.aclick) * 100 ,2),'%') else 0 end as 'actionRate',  -- 行为率
+            (case
+            when sum(a.photo_show) != 0 and sum(a.photo_show) is not null
+            then round((sum(a.charge) / sum(a.photo_show)) * 1000,2)
+            else 0
+            end
+            ) as 'impression1kCost', -- 均千次封面曝光花费
+            (case
+            when sum(a.photo_click) != 0
+            then round(sum(a.charge) / sum(a.photo_click),2)
+            else 0
+            end
+            ) as 'photoClickCost', -- 平均封面点击单价
+            (CASE
+            WHEN sum(a.photo_click) != 0
+            THEN round(sum(a.charge) / sum(a.photo_click),2)
+            ELSE 0
+            end
+            ) as 'actionCost', -- 平均行为单价
+            sum(a.photo_share) as 'photoShare',  -- 分享数
+            sum(a.photo_comment) as 'photoComment', -- 评论数
+            sum(a.photo_like) as 'photoLike', -- 点赞数
+            sum(a.follow) as 'follow', -- 新增关注数
+            sum(a.report) as 'report', -- 举报数
+            sum(a.cancel_follow) as 'cancelFollow', -- 取消关注数
+            sum(a.block) as 'block', -- 拉黑数
+            sum(a.negative) as 'nagative', -- 减少此类作品数
+            sum(a.download_started) as 'downloadStarted',  -- 应用下载数据-安卓下载开始数
+            sum(a.download_completed) as 'downloadCompleted',  -- 应用下载数据-安卓下载完成数
+            (CASE
+            WHEN sum(a.event_next_day_stay) != 0
+            THEN round(sum(a.charge) / sum(a.event_next_day_stay),2)
+            ELSE 0
+            end
+            ) as 'eventNextDayStayCost',  -- 次日留存成本
+            (select url from ctop_kuaishou_video_get where photo_id = c.photo_id limit 1) as url,
+            (select cover_url from ctop_kuaishou_video_get where photo_id = c.photo_id limit 1) as coverUrl,
+            (select material_type from ctop_kuaishou_video_get where photo_id = c.photo_id limit 1) as materialType
+            from
+            ctop_kuaishou_report_daily_creative a
+            left join (select * from ctop_user_allocation group by account_id) b on a.account_id = b.account_id
+            left join ctop_kuaishou_creative c on a.creative_id = c.creative_id
+            where
+            a.stat_date &gt;= #{startDate}
+            and
+            a.stat_date &lt;= #{endDate}
+
+            <if test="unitId != null and unitId !='' ">
+                and
+                a.unit_id = #{unitId}
+            </if>
+            <if test="accountIds !=null">
+                and a.account_id in
+                <foreach collection="accountIds" item="item" separator=","
+                         open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            group by a.creative_id
+            order by sum(a.charge) desc
+<!--        )m-->
+<!--        <if test="yn=1">-->
+<!--            where m.charge != 0-->
+<!--        </if>-->
+    </select>
+
+    <!-- 获取项目成员所在所有项目下的所有账户id -->
+    <select id="getVideoUrl" resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaishouVideoInfoDTO">
+        select
+        url as url,
+        cover_url as coverUrl
+        from
+        ctop_kuaishou_video_get
+        where photo_id = #{photoId}
+        limit 1
+    </select>
+
+    <select id="getUserProjectAccountIds" resultType="long">
+        select
+        a.account_id
+        from
+        (select project_id,account_id,media_id from ctop_user_allocation  group by account_id) a
+        left join ctop_project_member b on a.project_id=b.project_id
+        where
+        and a.media_id in (2,4)
+        order by a.create_time desc
+        limit 50
+    </select>
+
+    <select id="getUserProjectAccountIdsByAdmin" resultType="long">
+        select
+        a.account_id
+        from
+        ctop_user_allocation a
+        left join ctop_project b on a.project_id = b.id
+        where
+        b.media_id in (2,4)
+        limit 50
+    </select>
+
+    <select id="getSaleProjectAccountIds" resultType="long">
+        select
+        a.account_id
+        from
+        (select project_id,account_id,media_id,create_time from ctop_user_allocation  group by account_id) a
+        left join ctop_project b on a.project_id=b.id
+        where
+        b.sale_id = #{userId}
+        and b.media_id in (1,3)
+        order by a.create_time desc
+        limit 50
+    </select>
+
+</mapper>

+ 20 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouReportDailyAccountService.java

@@ -1,13 +1,33 @@
 package cn.com.ctop.kuaishou.modules.report.service;
 
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountDTO;
+import cn.com.ctop.kuaishou.modules.report.entity.ProjectAccountDTO;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.github.pagehelper.PageInfo;
+import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.system.vo.LoginUser;
 
+import java.util.ArrayList;
 import java.util.List;
 
 public interface IKuaishouReportDailyAccountService extends IService<KuaishouReportDailyAccount> {
 
     List<JSONObject> selectCost(Long accountId, String startDate, String endDate);
 
+    PageInfo<ProjectAccountDTO> getKuaishouProjectInfo(String startDate, String endDate, List<Long> projectList , Integer pageSize, Integer pageNum, String sort, Integer yn );
+
+    PageInfo<ProjectAccountDTO> getKuaishouSaleProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageSize, Integer pageNum, String sort, Integer yn);
+
+    PageInfo<KuaishouReportDailyAccountDTO> getKuaishouSaleAccountInfoByProjectId(Long projectId, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn);
+
+    PageInfo<KuaishouReportDailyAccountDTO> getKuaishouAccountInfoByProjectId(Long projectId, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn);
+
+    PageInfo<KuaishouReportDailyAccountDTO> getKuaishouCampaignInfoByAccountId(Long accountId, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn);
+
+    PageInfo<KuaishouReportDailyAccountDTO> getKuaishouUnitInfoByCampaignId(Long campaignId, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn);
+
+    PageInfo<KuaishouReportDailyAccountDTO> getKuaishouCreativeInfoByUnitId(Long unitId, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn);
+
 }

+ 171 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouReportDailyAccountServiceImpl.java

@@ -1,13 +1,23 @@
 package cn.com.ctop.kuaishou.modules.report.service.impl;
 
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountDTO;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouVideoInfoDTO;
+import cn.com.ctop.kuaishou.modules.report.entity.ProjectAccountDTO;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAccountService;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.mgt.SecurityManager;
+import org.jeecg.common.system.vo.LoginUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.List;
 
 @Service
@@ -20,4 +30,165 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
     public List<JSONObject> selectCost(Long accountId, String startDate, String endDate) {
         return dailyAccountMapper.selectCost(accountId, startDate, endDate);
     }
+
+    //获取快手参与的项目的信息
+    @Override
+    public PageInfo<ProjectAccountDTO> getKuaishouProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageSize, Integer pageNum, String sort ,Integer yn){
+        List<ProjectAccountDTO> projectAccountDTOList = new ArrayList<>();
+
+        if(projectList==null || projectList.size()==0){
+            LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+            //String userId = "a6abfea0f27843bf8595a234410afb04";
+            String userId = sysUser.getId();
+            String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
+
+            List<Long> mediaIds = new ArrayList<>();
+            mediaIds.add(2L);
+            mediaIds.add(4L);
+
+            if("admin".equals(roleCode)){
+                projectList = dailyAccountMapper.queryProjectMemberByAdmins(mediaIds);
+            }else{
+                projectList = dailyAccountMapper.queryProjectMemberByUserId(userId,mediaIds);
+            }
+        }
+
+        PageHelper.startPage(pageNum,pageSize);
+        return new PageInfo<>(dailyAccountMapper.getKuaishouProjectInfo(startDate, endDate, projectList, yn));
+    }
+
+    @Override
+    public PageInfo<ProjectAccountDTO> getKuaishouSaleProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageSize, Integer pageNum, String sort,Integer yn ){
+        List<ProjectAccountDTO> projectAccountDTOList = new ArrayList<>();
+
+        if(projectList==null || projectList.size()==0){
+            LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+            //String userId = "e9ca23d68d884d4ebb19d07889727dae";
+            String userId = sysUser.getId();
+            String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
+
+            List<Long> mediaIds = new ArrayList<>();
+            mediaIds.add(2L);
+            mediaIds.add(4L);
+
+            if("admin".equals(roleCode)){
+                projectList = dailyAccountMapper.queryProjectMemberByAdmins(mediaIds);
+            }else{
+
+                projectList = dailyAccountMapper.queryProjectInfoBySaleId(userId,mediaIds);
+            }
+        }
+
+        PageHelper.startPage(pageNum,pageSize);
+        return new PageInfo<>(dailyAccountMapper.getKuaishouProjectInfo(startDate,endDate,projectList,yn));
+    }
+
+    @Override
+    public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouSaleAccountInfoByProjectId(Long projectId, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn){
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        //String userId = "e9ca23d68d884d4ebb19d07889727dae";
+        String userId = sysUser.getId();
+        String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
+
+        List<Long> accountIds = null;
+        if(projectId == null){
+            if("admin".equals(roleCode)){
+                accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin();
+            }else {
+                accountIds = dailyAccountMapper.getSaleProjectAccountIds(userId);
+            }
+        }
+
+        PageHelper.startPage(pageNum,pageSize);
+        return new PageInfo<>(dailyAccountMapper.getKuaishouAccountInfoByProjectId(startDate, endDate, projectId, accountIds, yn));
+    }
+
+
+    @Override
+    public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouAccountInfoByProjectId(Long projectId, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn){
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        //String userId = "e9ca23d68d884d4ebb19d07889727dae";
+        String userId = sysUser.getId();
+        String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
+
+        List<Long> accountIds = null;
+        if(projectId == null){
+            if("admin".equals(roleCode)){
+                accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin();
+            }else {
+                accountIds = dailyAccountMapper.getUserProjectAccountIds(userId);
+            }
+        }
+
+        PageHelper.startPage(pageNum,pageSize);
+        return new PageInfo<>(dailyAccountMapper.getKuaishouAccountInfoByProjectId(startDate, endDate, projectId, accountIds, yn));
+    }
+
+    @Override
+    public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouCampaignInfoByAccountId(Long accountId, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn){
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        //String userId = "e9ca23d68d884d4ebb19d07889727dae";
+        String userId = sysUser.getId();
+        String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
+
+        List<Long> accountIds = null;
+        if(accountId == null){
+            if("admin".equals(roleCode)){
+                accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin();
+            }else {
+                accountIds = dailyAccountMapper.getUserProjectAccountIds(userId);
+            }
+        }
+
+        PageHelper.startPage(pageNum,pageSize);
+        return new PageInfo<>(dailyAccountMapper.getKuaishouCampaignInfoByAccountId(startDate, endDate, accountId,accountIds,yn));
+    }
+
+    @Override
+    public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouUnitInfoByCampaignId(Long campaignId, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn){
+
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        //String userId = "e9ca23d68d884d4ebb19d07889727dae";
+        String userId = sysUser.getId();
+        String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
+
+        List<Long> accountIds = null;
+        if(campaignId == null){
+            if("admin".equals(roleCode)){
+                accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin();
+            }else {
+                accountIds = dailyAccountMapper.getUserProjectAccountIds(userId);
+            }
+        }
+
+        PageHelper.startPage(pageNum,pageSize);
+        return new PageInfo<>(dailyAccountMapper.getKuaishouUnitInfoByCampaignId(startDate, endDate, campaignId,accountIds, yn));
+    }
+
+    @Override
+    public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouCreativeInfoByUnitId(Long unitId, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn){
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        //String userId = "e9ca23d68d884d4ebb19d07889727dae";
+        String userId = sysUser.getId();
+        String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
+
+        List<Long> accountIds = null;
+        if(unitId == null){
+            if("admin".equals(roleCode)){
+                accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin();
+            }else {
+                accountIds = dailyAccountMapper.getUserProjectAccountIds(userId);
+            }
+        }
+
+        PageHelper.startPage(pageNum,pageSize);
+        List<KuaishouReportDailyAccountDTO> kuaishouCreativeInfoList = dailyAccountMapper.getKuaishouCreativeInfoByUnitId(startDate, endDate, unitId,accountIds, yn);
+        //for(KuaishouReportDailyAccountDTO creativeInfo:kuaishouCreativeInfoList){
+        //    KuaishouVideoInfoDTO videoInfo = dailyAccountMapper.getVideoUrl(creativeInfo.getPhotoId());
+        //    creativeInfo.setUrl(videoInfo.getUrl());
+        //    creativeInfo.setCoverUrl(videoInfo.getCoverUrl());
+        //}
+        return new PageInfo<>(kuaishouCreativeInfoList);
+    }
+
 }

+ 11 - 0
module-toutiao/pom.xml

@@ -32,6 +32,17 @@
             <artifactId>module-crawler</artifactId>
             <version>2.0.2</version>
         </dependency>
+
+        <dependency>
+            <groupId>com.googlecode.plist</groupId>
+            <artifactId>dd-plist</artifactId>
+            <version>1.16</version>
+        </dependency>
+        <dependency>
+            <groupId>com.github.tony19</groupId>
+            <artifactId>apktool-lib</artifactId>
+            <version>1.4.4-3</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 109 - 26
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/batch/controller/ByteDanceBatchController.java

@@ -1,56 +1,139 @@
 package cn.com.ctop.toutiao.modules.batch.controller;
 
-import cn.com.ctop.toutiao.modules.material.entity.ByteDanceAdvertisePlan;
+import cn.com.ctop.common.module.service.IFileInfoService;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.toutiao.modules.batch.service.IBytedanceIndustryInfoService;
+import cn.com.ctop.toutiao.modules.material.entity.ByteDanceVideoInfo;
+import cn.com.ctop.toutiao.modules.material.entity.BytedanceImageInfo;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertisePlanService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceCreativeService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceVideoInfoService;
+import cn.com.ctop.toutiao.modules.material.service.IBytedanceImageInfoService;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.ArrayList;
-import java.util.List;
+import javax.servlet.http.HttpServletRequest;
+import java.util.Map;
 
 
 @Slf4j
 @RestController
 @RequestMapping("/bytedance/batch")
 public class ByteDanceBatchController {
-
     @Autowired
     IByteDanceAdvertisePlanService byteDanceAdvertisePlanService;
+    @Autowired
+    private IBytedanceIndustryInfoService bytedanceIndustryInfoService;
+    @Autowired
+    private IFileInfoService fileInfoService;
+    @Autowired
+    private IByteDanceCreativeService creativeService;
+    @Autowired
+    private IByteDanceVideoInfoService videoInfoService;
 
     /**
-     *  批量创建计划
-     * @param byteDanceAdvertisePlan
-     * @param requestBody
+     * 获取动态词包信息
+     *
+     * @param accountId
      * @return
      */
-    @PostMapping(value = "/create/advertiserPlan")
-    public Result<List<ByteDanceAdvertisePlan>> add(@RequestBody ByteDanceAdvertisePlan byteDanceAdvertisePlan,
-                                                    @RequestBody JSONObject requestBody) {
-        Result<List<ByteDanceAdvertisePlan>> result = new Result<>();
-        List<ByteDanceAdvertisePlan> byteDanceAdvertisePlanList= new ArrayList<>();
-        if(requestBody.getJSONArray("accountIds").isEmpty()){
-            log.error("批量创建计划未选择账户");
+    @GetMapping("creative/words/get")
+    public Map<String, Object> getCreativeWords(Long accountId) {
+        return fileInfoService.getCreativeWords(accountId);
+    }
+
+    @GetMapping("action/text")
+    public Map<String,Object>getActionText(Long accountId,String landType){
+        return fileInfoService.getActionText(accountId,landType);
+    }
+
+    @GetMapping("industry/list")
+    public Map<String,Object>getIndustryList(){
+        return bytedanceIndustryInfoService.getIndustryList();
+    }
+    @GetMapping("load/industry")
+    public Map<String,Object>loadIndustryList(Long accountId,Integer level){
+        return bytedanceIndustryInfoService.getBytedanceIndustryList(accountId,level);
+    }
+
+    @GetMapping(value = "/getVideoList")
+    public Result<IPage<ByteDanceVideoInfo>> getBytedqanceVideoList(
+            @RequestParam(name = "type") Integer type,
+            @RequestParam(name = "accountId") Long accountId,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            @RequestParam(name = "startDate", defaultValue = "") String startDate,
+            @RequestParam(name = "endDate", defaultValue = "") String endDate) {
+        Result<IPage<ByteDanceVideoInfo>> result = new Result<>();
+        try {
+            if (Check.isNull(accountId)) {
+                throw new Exception("账户id不能为空");
+            }
+            QueryWrapper<ByteDanceVideoInfo> queryWrapper = new QueryWrapper<>();
+            if (null!=startDate&&!"".equals(startDate.trim()) && null!=endDate&&!"".equals(endDate.trim())) {
+                queryWrapper.between("create_time", startDate+" 00:00:00", endDate+" 23:59:59");
+            }
+            if(null!=type&&type!=0){
+                queryWrapper.eq("type",type);
+            }
+            queryWrapper.eq("account_id",accountId);
+            queryWrapper.orderByDesc("material_upload_time");
+            queryWrapper.groupBy("signature");
+            Page<ByteDanceVideoInfo> page = new Page<>(pageNo, pageSize);
+            IPage<ByteDanceVideoInfo> pageList = videoInfoService.page(page, queryWrapper);
+            result.setSuccess(true);
+            result.setResult(pageList);
+            return result;
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
         }
-        requestBody.getJSONArray("accountIds").forEach(it->{
-            byteDanceAdvertisePlan.setAccountId(it.toString());
-            try {
-                //TODO 需要先存入头条后台
-                byteDanceAdvertisePlanService.save(byteDanceAdvertisePlan);
-                byteDanceAdvertisePlanList.add(byteDanceAdvertisePlan);
-                result.success("添加成功!");
-            } catch (Exception e) {
-                log.error(e.getMessage(), e);
-                result.error500("操作失败");
+        return result;
+    }
+    @Autowired
+    private IBytedanceImageInfoService imageInfoService;
+
+    @GetMapping(value = "/getImageList")
+    public Result<IPage<BytedanceImageInfo>> getBytedqanceVideoList(@RequestParam(name = "accountId")Long accountId, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                    @RequestParam(name = "startDate", defaultValue = "") String startDate,
+                                                                    @RequestParam(name = "endDate", defaultValue = "") String endDate, HttpServletRequest req) {
+        Result<IPage<BytedanceImageInfo>> result = new Result<>();
+        try {
+            if (Check.isNull(accountId)) {
+                throw new Exception("账户id不能为空");
+            }
+            QueryWrapper<BytedanceImageInfo> queryWrapper = new QueryWrapper<>();
+            if (!Check.isNull(startDate) && !Check.isNull(endDate)) {
+                queryWrapper.between("image_create_time", startDate+" 00:00:00", endDate+" 23:59:59");
             }
-        });
-        result.setResult(byteDanceAdvertisePlanList);
+            queryWrapper.eq("account_id",accountId);
+            queryWrapper.orderByDesc("image_create_time");
+            queryWrapper.groupBy("signature");
+            Page<BytedanceImageInfo> page = new Page<>(pageNo, pageSize);
+            IPage<BytedanceImageInfo> pageList = imageInfoService.page(page, queryWrapper);
+            result.setSuccess(true);
+            result.setResult(pageList);
+            return result;
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
         return result;
     }
 
     /**
      *  批量创建创意
      */
+    @PostMapping("/create/creative")
+    public Map<String,Object>addCreative(@RequestBody JSONObject data){
+        return creativeService.batchCreate(data);
+    }
 }
+

+ 150 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/batch/controller/BytedanceIndustryInfoController.java

@@ -0,0 +1,150 @@
+package cn.com.ctop.toutiao.modules.batch.controller;
+
+import cn.com.ctop.toutiao.modules.batch.entity.BytedanceIndustryInfo;
+import cn.com.ctop.toutiao.modules.batch.service.IBytedanceIndustryInfoService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+
+ /**
+ * 头条行业类别
+ * @author jeecg-boot
+ * @date   2020-07-30
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="头条行业类别")
+@RestController
+@RequestMapping("/ctop/bytedanceIndustryInfo")
+public class BytedanceIndustryInfoController {
+	@Autowired
+	private IBytedanceIndustryInfoService bytedanceIndustryInfoService;
+
+	/**
+	  * 分页列表查询
+	 * @param bytedanceIndustryInfo
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@ApiOperation(value="头条行业类别-分页列表查询", notes="头条行业类别-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<BytedanceIndustryInfo>> queryPageList(BytedanceIndustryInfo bytedanceIndustryInfo,
+															  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+															  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+															  HttpServletRequest req) {
+		Result<IPage<BytedanceIndustryInfo>> result = new Result<>();
+		QueryWrapper<BytedanceIndustryInfo> queryWrapper = QueryGenerator.initQueryWrapper(bytedanceIndustryInfo, req.getParameterMap());
+		Page<BytedanceIndustryInfo> page = new Page<BytedanceIndustryInfo>(pageNo, pageSize);
+		IPage<BytedanceIndustryInfo> pageList = bytedanceIndustryInfoService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param bytedanceIndustryInfo
+	 * @return
+	 */
+	@ApiOperation(value="头条行业类别-添加", notes="头条行业类别-添加")
+	@PostMapping(value = "/add")
+	public Result<BytedanceIndustryInfo> add(@RequestBody BytedanceIndustryInfo bytedanceIndustryInfo) {
+		Result<BytedanceIndustryInfo> result = new Result<>();
+		try {
+			bytedanceIndustryInfoService.save(bytedanceIndustryInfo);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param bytedanceIndustryInfo
+	 * @return
+	 */
+	@ApiOperation(value="头条行业类别-编辑", notes="头条行业类别-编辑")
+	@PutMapping(value = "/edit")
+	public Result<BytedanceIndustryInfo> edit(@RequestBody BytedanceIndustryInfo bytedanceIndustryInfo) {
+		Result<BytedanceIndustryInfo> result = new Result<BytedanceIndustryInfo>();
+		BytedanceIndustryInfo bytedanceIndustryInfoEntity = bytedanceIndustryInfoService.getById(bytedanceIndustryInfo.getId());
+		if(bytedanceIndustryInfoEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = bytedanceIndustryInfoService.updateById(bytedanceIndustryInfo);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@ApiOperation(value="头条行业类别-通过id删除", notes="头条行业类别-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			bytedanceIndustryInfoService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@ApiOperation(value="头条行业类别-批量删除", notes="头条行业类别-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<BytedanceIndustryInfo> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<BytedanceIndustryInfo> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.bytedanceIndustryInfoService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@ApiOperation(value="头条行业类别-通过id查询", notes="头条行业类别-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<BytedanceIndustryInfo> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<BytedanceIndustryInfo> result = new Result<>();
+		BytedanceIndustryInfo bytedanceIndustryInfo = bytedanceIndustryInfoService.getById(id);
+		if(bytedanceIndustryInfo==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(bytedanceIndustryInfo);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+}

+ 53 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/batch/entity/BytedanceIndustryInfo.java

@@ -0,0 +1,53 @@
+package cn.com.ctop.toutiao.modules.batch.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 头条行业类别
+ * @author jeecg-boot
+ * @date   2020-07-30
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_bytedance_industry_info")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_bytedance_industry_info对象", description="头条行业类别")
+public class BytedanceIndustryInfo {
+
+	/**id*/
+	@TableId
+    @ApiModelProperty(value = "id")
+	private Long id;
+	/**name*/
+	@Excel(name = "name", width = 15)
+    @ApiModelProperty(value = "name")
+	private String name;
+	/**code*/
+	@Excel(name = "code", width = 15)
+    @ApiModelProperty(value = "code")
+	private String code;
+	/**parentCode*/
+	@Excel(name = "parentCode", width = 15)
+    @ApiModelProperty(value = "parentCode")
+	private String parentCode;
+	/**level*/
+	@Excel(name = "level", width = 15)
+    @ApiModelProperty(value = "level")
+	private Integer level;
+	/**createTime*/
+    @ApiModelProperty(value = "createTime")
+	private Date createTime;
+	/**updateTime*/
+    @ApiModelProperty(value = "updateTime")
+	private Date updateTime;
+}

+ 14 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/batch/mapper/BytedanceIndustryInfoMapper.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.toutiao.modules.batch.mapper;
+
+import cn.com.ctop.toutiao.modules.batch.entity.BytedanceIndustryInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 头条行业类别
+ * @author: jeecg-boot
+ * @date:   2020-07-30
+ * @cersion: V1.0
+ */
+public interface BytedanceIndustryInfoMapper extends BaseMapper<BytedanceIndustryInfo> {
+
+}

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

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

+ 19 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/batch/service/IBytedanceIndustryInfoService.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.toutiao.modules.batch.service;
+
+import cn.com.ctop.toutiao.modules.batch.entity.BytedanceIndustryInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.Map;
+
+/**
+ * 头条行业类别
+ * @author jeecg-boot
+ * @date   2020-07-30
+ * @version V1.0
+ */
+public interface IBytedanceIndustryInfoService extends IService<BytedanceIndustryInfo> {
+
+    Map<String, Object> getBytedanceIndustryList(Long accountId,Integer level);
+
+    Map<String, Object> getIndustryList();
+}

+ 116 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/batch/service/impl/BytedanceIndustryInfoServiceImpl.java

@@ -0,0 +1,116 @@
+package cn.com.ctop.toutiao.modules.batch.service.impl;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
+import cn.com.ctop.toutiao.modules.batch.entity.BytedanceIndustryInfo;
+import cn.com.ctop.toutiao.modules.batch.mapper.BytedanceIndustryInfoMapper;
+import cn.com.ctop.toutiao.modules.batch.service.IBytedanceIndustryInfoService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 头条行业类别
+ * @author jeecg-boot
+ * @date   2020-07-30
+ * @version V1.0
+ */
+@Service
+public class BytedanceIndustryInfoServiceImpl extends ServiceImpl<BytedanceIndustryInfoMapper, BytedanceIndustryInfo> implements IBytedanceIndustryInfoService {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Override
+    public Map<String, Object> getBytedanceIndustryList(Long accountId,Integer level) {
+        CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
+        // 请求地址
+        String url = "https://ad.oceanengine.com/open_api/2/tools/industry/get/";
+        // 请求参数
+        JSONObject data = new JSONObject();
+        if(null!=level&&level!=0){
+            data.put("level",level);
+        }
+        JSONObject result = HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, data);
+        JSONArray arrays = result.getJSONObject("data").getJSONArray("list");
+        for(int i=0;i<arrays.size();i++){
+            JSONObject getData = arrays.getJSONObject(i);
+            BytedanceIndustryInfo industryInfo = new BytedanceIndustryInfo();
+            Integer getLevel = getData.getInteger("level");
+            industryInfo.setLevel(getLevel);
+            industryInfo.setName(getData.getString("industry_name"));
+            industryInfo.setCode(getData.getLong("industry_id")+"");
+            industryInfo.setId(getData.getLong("industry_id"));
+            if(getLevel == 1){
+                industryInfo.setParentCode("0");
+            }
+            if(getLevel == 2){
+                industryInfo.setParentCode(getData.getLong("first_industry_id")+"");
+            }
+            if(getLevel == 3){
+                industryInfo.setParentCode(getData.getLong("second_industry_id")+"");
+            }
+            industryInfo.setUpdateTime(new Date());
+            this.saveOrUpdate(industryInfo);
+        }
+        return result;
+    }
+
+    @Override
+    public Map<String, Object> getIndustryList() {
+        Map<String,Object>result = new HashMap<>();
+        List<BytedanceIndustryInfo>firstLevelIndustry = this.getListByParams(1,"0");
+        JSONArray array = new JSONArray();
+        for (BytedanceIndustryInfo firstInfo:firstLevelIndustry) {
+            JSONObject firstData = new JSONObject();
+            firstData.put("id",firstInfo.getId());
+            firstData.put("name",firstInfo.getName());
+            List<BytedanceIndustryInfo>secondLevelIndustry = this.getListByParams(2,firstInfo.getCode());
+            if(null!=secondLevelIndustry&&!secondLevelIndustry.isEmpty()){
+                JSONArray firstChildrenArray = new JSONArray();
+                for(BytedanceIndustryInfo secendInfo:secondLevelIndustry){
+                    JSONObject secondData = new JSONObject();
+                    secondData.put("id",secendInfo.getId());
+                    secondData.put("name",secendInfo.getName());
+                    List<BytedanceIndustryInfo>thirdLevelIndustry = this.getListByParams(3,secendInfo.getCode());
+                    if(null!=thirdLevelIndustry&&!thirdLevelIndustry.isEmpty()){
+                        JSONArray secondChildrenArray = new JSONArray();
+                        for (BytedanceIndustryInfo thirdInfo:thirdLevelIndustry) {
+                            JSONObject thirdChData = new JSONObject();
+                            thirdChData.put("id",thirdInfo.getId());
+                            thirdChData.put("name",thirdInfo.getName());
+                            secondChildrenArray.add(thirdChData);
+                        }
+                        secondData.put("children",secondChildrenArray);
+                    }
+                    firstChildrenArray.add(secondData);
+                }
+                firstData.put("children",firstChildrenArray);
+            }
+            array.add(firstData);
+        }
+        result.put("data",array);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    public List<BytedanceIndustryInfo>getListByParams(Integer level,String parentCode){
+        QueryWrapper<BytedanceIndustryInfo>queryWrapper = new QueryWrapper<>();
+        if(null!=level&&level!=0){
+            queryWrapper.eq("level",level);
+        }
+        if(null!=parentCode&&!parentCode.trim().equals("")){
+            queryWrapper.eq("parent_code",parentCode);
+        }
+       return this.list(queryWrapper);
+    }
+}

+ 91 - 34
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceAdvertisePlanController.java

@@ -1,9 +1,11 @@
 package cn.com.ctop.toutiao.modules.material.controller;
 
+import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.StringUtils;
 import cn.com.ctop.toutiao.modules.material.entity.ByteDanceAdvertisePlan;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertisePlanService;
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -14,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
@@ -42,19 +45,23 @@ public class ByteDanceAdvertisePlanController {
                                                                @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                                HttpServletRequest req) {
         Result<IPage<ByteDanceAdvertisePlan>> result = new Result<>();
-        if(!accountId.isEmpty()){
+        if (!accountId.isEmpty()) {
             byteDanceAdvertisePlan.setAccountId(accountId);
         }
+        if(byteDanceAdvertisePlan.getToutiaoStatus()!=null){
+            String toutiaoStatus="AD_STATUS"+byteDanceAdvertisePlan.getToutiaoStatus();
+            byteDanceAdvertisePlan.setToutiaoStatus(toutiaoStatus);
+        }
         QueryWrapper<ByteDanceAdvertisePlan> queryWrapper = QueryGenerator.initQueryWrapper(byteDanceAdvertisePlan, req.getParameterMap());
         Page<ByteDanceAdvertisePlan> page = new Page<>(pageNo, pageSize);
         IPage<ByteDanceAdvertisePlan> pageList = byteDanceAdvertisePlanService.page(page, queryWrapper);
         //处理计划投放状态
-        if(!pageList.getRecords().isEmpty()){
-            pageList.getRecords().forEach(it->{
-                if(it.getToutiaoStatus().equals("AD_STATUS_DELIVERY_OK")){
-                    it.setStatus(true);
-                }else{
-                    it.setStatus(false);
+        if (!pageList.getRecords().isEmpty()) {
+            pageList.getRecords().forEach(it -> {
+                if (it.getToutiaoStatus().equals("AD_STATUS_DELIVERY_OK")) {
+                    it.setPlanStatus(true);
+                } else {
+                    it.setPlanStatus(false);
                 }
             });
         }
@@ -67,21 +74,30 @@ public class ByteDanceAdvertisePlanController {
      * 添加
      */
     @PostMapping(value = "/add")
-    public Result<ByteDanceAdvertisePlan> add(@RequestBody ByteDanceAdvertisePlan byteDanceAdvertisePlan,
-                                              @RequestParam String landingType) {
-        Result<ByteDanceAdvertisePlan> result = new Result<>();
+    public Result<List<ByteDanceAdvertisePlan>> add(@RequestBody ByteDanceAdvertisePlan byteDanceAdvertisePlan) {
+
+        Result<List<ByteDanceAdvertisePlan>> result = new Result<>();
+        List<String> names = (List) byteDanceAdvertisePlan.getNames();
+        String landingType = byteDanceAdvertisePlan.getLandingType();
+        List<ByteDanceAdvertisePlan> byteDanceAdvertisePlanList = new ArrayList<>();
         try {
-            Map<String, Object> advertiserPlan = byteDanceAdvertisePlanService.createAdvertiserPlan(ctopOauthTokenService.getTokenByAccountId(Long.valueOf(byteDanceAdvertisePlan.getAccountId())), landingType, byteDanceAdvertisePlan);
-            if(advertiserPlan.get("code").equals(0)){
-                byteDanceAdvertisePlanService.save(byteDanceAdvertisePlan);
-                result.success("添加成功!");
-            }else {
-                result.error500(advertiserPlan.get("message").toString());
+            for (String name : names) {
+                byteDanceAdvertisePlan.setName(name);
+                Map<String, Object> advertiserPlan = byteDanceAdvertisePlanService.createAdvertiserPlan(ctopOauthTokenService.getTokenByAccountId(Long.valueOf(byteDanceAdvertisePlan.getAccountId())), landingType, byteDanceAdvertisePlan);
+                if (advertiserPlan.get("code").equals(0)) {
+                    byteDanceAdvertisePlan.setId(((ByteDanceAdvertisePlan)advertiserPlan.get("data")).getId());
+                    byteDanceAdvertisePlanService.save((ByteDanceAdvertisePlan)advertiserPlan.get("data"));
+                    byteDanceAdvertisePlanList.add(byteDanceAdvertisePlanService.getById(((ByteDanceAdvertisePlan) advertiserPlan.get("data")).getId()));
+                } else {
+                    result.setCode(-200);
+                    result.setMessage(advertiserPlan.get("message").toString());
+                }
             }
         } catch (Exception e) {
             log.error(e.getMessage(), e);
             result.error500("操作失败");
         }
+        result.setResult(byteDanceAdvertisePlanList);
         return result;
     }
 
@@ -91,35 +107,76 @@ public class ByteDanceAdvertisePlanController {
     @PostMapping(value = "/edit")
     public Result<ByteDanceAdvertisePlan> edit(@RequestBody ByteDanceAdvertisePlan byteDanceAdvertisePlan) {
         Result<ByteDanceAdvertisePlan> result = new Result<>();
-        ByteDanceAdvertisePlan byteDanceAdvertisePlanEntity = byteDanceAdvertisePlanService.getById(byteDanceAdvertisePlan.getId());
-        if (byteDanceAdvertisePlanEntity == null) {
-            result.error500("未找到数据");
-        } else {
+        String landingType = byteDanceAdvertisePlan.getLandingType();
+        Map<String, Object> map = byteDanceAdvertisePlanService.updateAdvertiserPlan(ctopOauthTokenService.getTokenByAccountId(Long.valueOf(byteDanceAdvertisePlan.getAccountId())), landingType, byteDanceAdvertisePlan);
+        if(!map.get("code").equals(0)){
+            result.error500(map.get("message").toString());
+        }else {
             boolean ok = byteDanceAdvertisePlanService.updateById(byteDanceAdvertisePlan);
             if (ok) {
                 result.success("修改成功!");
-            }else {
+            } else {
                 result.error500("未知错误");
             }
         }
-
         return result;
     }
 
-    @PostMapping(value = "/batchEdit")
-    public Result<List<ByteDanceAdvertisePlan>> edit(@RequestBody List<ByteDanceAdvertisePlan> byteDanceAdvertisePlanList) {
+    @PostMapping(value = "/batchEdit/{operate}")
+    public Result<List<ByteDanceAdvertisePlan>> edit(@RequestBody List<ByteDanceAdvertisePlan> byteDanceAdvertisePlanList,
+                                                     @PathVariable String operate) {
         Result<List<ByteDanceAdvertisePlan>> result = new Result<>();
-        byteDanceAdvertisePlanList.forEach(it->{
-            ByteDanceAdvertisePlan byteDanceAdvertisePlanEntity = byteDanceAdvertisePlanService.getById(it.getId());
-            if (byteDanceAdvertisePlanEntity == null) {
-                result.error500("未找到数据");
-            } else {
-                boolean ok = byteDanceAdvertisePlanService.updateById(it);
-                if (ok) {
-                    result.success("修改成功!");
-                }else {
-                    result.error500("未知错误");
+        if (byteDanceAdvertisePlanList.isEmpty()) {
+            log.error("未选择数据");
+            result.error500("请选择数据");
+        }
+        CtopOauthToken token = ctopOauthTokenService.getTokenByAccountId(Long.valueOf(byteDanceAdvertisePlanList.get(0).getAccountId()));
+        try {
+            if ("status".equals(operate)) {
+                JSONArray adIds = new JSONArray();
+                String optStatus = byteDanceAdvertisePlanList.get(0).getOptStatus();
+                byteDanceAdvertisePlanList.forEach(it -> {
+                    adIds.add(it.getId());
+                });
+                Map<String, Object> map = byteDanceAdvertisePlanService.updateAdvertiserPlanStatus(token, adIds, optStatus);
+                if (!map.get("code").equals(0)) {
+                    result.error500(map.get("message").toString());
+                    return result;
+                }
+            } else if ("bid".equals(operate)) {
+                JSONArray adIds = new JSONArray();
+                JSONArray bids = new JSONArray();
+                byteDanceAdvertisePlanList.forEach(it -> {
+                    adIds.add(it.getId());
+                    bids.add(it.getBid());
+                });
+                Map<String, Object> map = byteDanceAdvertisePlanService.updateAdvertiserPlanBid(token, adIds, bids);
+                if (!map.get("code").equals(0)) {
+                    result.error500(map.get("message").toString());
+                    return result;
                 }
+            } else if ("budget".equals(operate)) {
+                JSONArray adIds = new JSONArray();
+                JSONArray budgets = new JSONArray();
+                byteDanceAdvertisePlanList.forEach(it -> {
+                    adIds.add(it.getId());
+                    budgets.add(it.getBudget());
+                });
+                Map<String, Object> map = byteDanceAdvertisePlanService.updateAdvertiserPlanBudget(token, adIds, budgets);
+                if (!map.get("code").equals(0)) {
+                    result.error500(map.get("message").toString());
+                    return result;
+                }
+            }
+        } catch (Exception e) {
+            log.error("头条批量更新接口错误");
+        }
+        byteDanceAdvertisePlanList.forEach(it -> {
+            boolean ok = byteDanceAdvertisePlanService.updateById(it);
+            if (ok) {
+                result.success("修改成功!");
+            } else {
+                result.error500("未知错误");
             }
         });
         result.setResult(byteDanceAdvertisePlanList);

+ 13 - 13
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceCampaignController.java

@@ -14,7 +14,6 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -41,8 +40,6 @@ public class ByteDanceCampaignController {
 
     /**
      * 分页列表查询
-     *
-     * @param byteDanceCampaign
      * @param pageNo
      * @param pageSize
      * @param req
@@ -51,19 +48,22 @@ public class ByteDanceCampaignController {
     @AutoLog(value = "今日头条广告组信息-分页列表查询")
     @ApiOperation(value = "今日头条广告组信息-分页列表查询", notes = "今日头条广告组信息-分页列表查询")
     @GetMapping(value = "/list")
-    public Result<IPage<ByteDanceCampaign>> queryPageList(ByteDanceCampaign byteDanceCampaign,
-                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                          @RequestParam(name="startDate",defaultValue = "")String startDate,
-                                                          @RequestParam(name="endDate",defaultValue = "")String endDate,
-                                                          HttpServletRequest req) {
+    public Result<IPage<ByteDanceCampaign>> queryPageList(
+            @RequestParam(name = "name",defaultValue = "")String name,
+            @RequestParam(name = "status",defaultValue = "")String status,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            @RequestParam(name="startDate",defaultValue = "")String startDate,
+            @RequestParam(name="endDate",defaultValue = "")String endDate,
+            HttpServletRequest req) {
         Result<IPage<ByteDanceCampaign>> result = new Result<>();
-        String name = byteDanceCampaign.getName();
-        byteDanceCampaign.setName(null);
-        QueryWrapper<ByteDanceCampaign> queryWrapper = QueryGenerator.initQueryWrapper(byteDanceCampaign, req.getParameterMap());
+        QueryWrapper<ByteDanceCampaign> queryWrapper = new QueryWrapper<>();
         if(null!=name&&!"".equalsIgnoreCase(name)){
             queryWrapper.like("name",name);
         }
+        if(null!=status&&!"".equals(status.trim())){
+            queryWrapper.eq("status","CAMPAIGN_STATUS_"+status);
+        }
         if(null!=startDate&&!"".equals(startDate)){
             queryWrapper.ge("campaign_create_time",startDate+" 00:00:00");
         }
@@ -94,7 +94,7 @@ public class ByteDanceCampaignController {
     public Map<String,Object> add(@RequestParam(name = "accountId") Long accountId,
                                   @RequestParam(name = "campaignName") String campaignName,
                                   @RequestParam(name = "budgetMode") String budgetMode,
-                                  @RequestParam(name = "budget",required = false) Integer budget,
+                                  @RequestParam(name = "budget",required = false) String budget,
                                   @RequestParam(name = "landingType") String landingType) {
         return byteDanceCampaignService.createCampaign(accountId,campaignName,null,budgetMode,budget,landingType,null);
     }

+ 39 - 16
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceCreativeController.java

@@ -1,6 +1,8 @@
 package cn.com.ctop.toutiao.modules.material.controller;
 
 import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.common.module.utils.StringUtils;
 import cn.com.ctop.toutiao.modules.material.entity.ByteDanceCreative;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceCreativeService;
@@ -11,13 +13,13 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletRequest;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -37,39 +39,44 @@ public class ByteDanceCreativeController {
     /**
      * 分页列表查询
      *
-     * @param byteDanceCreative
      * @param pageNo
      * @param pageSize
-     * @param req
      * @return
      */
     @AutoLog(value = "今日头条创意信息-分页列表查询")
     @ApiOperation(value = "今日头条创意信息-分页列表查询", notes = "今日头条创意信息-分页列表查询")
     @GetMapping(value = "/list")
-    public Result<IPage<ByteDanceCreative>> queryPageList(ByteDanceCreative byteDanceCreative,
-                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                          @RequestParam(name="startDate",defaultValue = "")String startDate,
-                                                          @RequestParam(name="endDate",defaultValue = "")String endDate,
-                                                          HttpServletRequest req) {
+    public Result<IPage<ByteDanceCreative>> queryPageList(
+            @RequestParam(name = "accountId", defaultValue = "0") Long accountId,
+            @RequestParam(name = "status",required = false) String status,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            @RequestParam(name="startDate",defaultValue = "",required = false)String startDate,
+            @RequestParam(name="endDate",defaultValue = "",required = false)String endDate,
+            @RequestParam(name = "name",defaultValue = "",required = false)String name) {
         Result<IPage<ByteDanceCreative>> result = new Result<>();
-        String title = byteDanceCreative.getTitle();
-        byteDanceCreative.setTitle(null);
-        QueryWrapper<ByteDanceCreative> queryWrapper = QueryGenerator.initQueryWrapper(byteDanceCreative, req.getParameterMap());
+        QueryWrapper<ByteDanceCreative> queryWrapper = new QueryWrapper<>();
         if(null!=startDate&&!startDate.trim().equals("")){
             queryWrapper.ge("",startDate+" 00:00:00");
         }
+        if(null!=accountId){
+            queryWrapper.eq("account_id",accountId);
+        }
         if(null!=endDate&&!endDate.trim().equals("")){
             queryWrapper.le("",startDate+" 23:59:59");
         }
-        if(null!=title&&!"".equals(title.trim())){
-            queryWrapper.like("title",title);
+        if(null!=name&&!"".equals(name.trim())){
+            queryWrapper.like("title",name);
+        }
+        if(null!=status&&!status.trim().equals("")){
+            queryWrapper.eq("opt_status","CREATIVE_STATUS_"+status);
         }
+        queryWrapper.orderByDesc("creative_create_time");
         Page<ByteDanceCreative> page = new Page<>(pageNo, pageSize);
         IPage<ByteDanceCreative> pageList = byteDanceCreativeService.page(page, queryWrapper);
         List<ByteDanceCreative> records = pageList.getRecords();
         if(null!=records&&!records.isEmpty()){
-            List<ByteDanceCreative> creatives = records.stream().map(creative-> creative.setCreateStatus(creative.getStatus().equalsIgnoreCase("CAMPAIGN_STATUS_ENABLE"))).collect(Collectors.toList());
+            List<ByteDanceCreative> creatives = records.stream().map(creative-> creative.setCreateStatus(creative.getOptStatus().equalsIgnoreCase("CREATIVE_STATUS_ENABLE"))).collect(Collectors.toList());
             pageList.setRecords(creatives);
         }
         result.setSuccess(true);
@@ -99,6 +106,22 @@ public class ByteDanceCreativeController {
     }
 
     /**
+     * 修改广告组状态
+     * @return
+     */
+    @PostMapping("/editStatus")
+    public Map<String,Object> editStatus(@RequestParam(name = "accountId",defaultValue = "0")Long accountId,
+                                         @RequestParam(name = "ids") String ids,
+                                         @RequestParam(name = "status")String status){
+        Map<String,Object>result = new HashMap();
+        if(null == accountId||accountId==0||null == ids||ids.trim().equals("")||null==status||status.trim().equals("")){
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+            return result;
+        }
+        return byteDanceCreativeService.advertiserCreativeUpdateStatus(accountId,ids,status);
+    }
+
+    /**
      * 编辑
      *
      * @param byteDanceCreative

+ 241 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/BytedanceImageInfoController.java

@@ -0,0 +1,241 @@
+package cn.com.ctop.toutiao.modules.material.controller;
+
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.toutiao.modules.material.entity.BytedanceImageInfo;
+import cn.com.ctop.toutiao.modules.material.service.IBytedanceImageInfoService;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+ /**
+ * 头条图片素材
+ * @author jeecg-boot
+ * @date   2020-08-01
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="头条图片素材")
+@RestController
+@RequestMapping("/ctop/bytedanceImageInfo")
+public class BytedanceImageInfoController {
+	@Autowired
+	private IBytedanceImageInfoService bytedanceImageInfoService;
+
+	/**
+	  * 分页列表查询
+	 * @param bytedanceImageInfo
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "头条图片素材-分页列表查询")
+	@ApiOperation(value="头条图片素材-分页列表查询", notes="头条图片素材-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<BytedanceImageInfo>> queryPageList(BytedanceImageInfo bytedanceImageInfo,
+														   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+														   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+														   HttpServletRequest req) {
+		Result<IPage<BytedanceImageInfo>> result = new Result<>();
+		QueryWrapper<BytedanceImageInfo> queryWrapper = QueryGenerator.initQueryWrapper(bytedanceImageInfo, req.getParameterMap());
+		Page<BytedanceImageInfo> page = new Page<BytedanceImageInfo>(pageNo, pageSize);
+		IPage<BytedanceImageInfo> pageList = bytedanceImageInfoService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param bytedanceImageInfo
+	 * @return
+	 */
+	@AutoLog(value = "头条图片素材-添加")
+	@ApiOperation(value="头条图片素材-添加", notes="头条图片素材-添加")
+	@PostMapping(value = "/add")
+	public Result<BytedanceImageInfo> add(@RequestBody BytedanceImageInfo bytedanceImageInfo) {
+		Result<BytedanceImageInfo> result = new Result<>();
+		try {
+			bytedanceImageInfoService.save(bytedanceImageInfo);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param bytedanceImageInfo
+	 * @return
+	 */
+	@AutoLog(value = "头条图片素材-编辑")
+	@ApiOperation(value="头条图片素材-编辑", notes="头条图片素材-编辑")
+	@PutMapping(value = "/edit")
+	public Result<BytedanceImageInfo> edit(@RequestBody BytedanceImageInfo bytedanceImageInfo) {
+		Result<BytedanceImageInfo> result = new Result<BytedanceImageInfo>();
+		BytedanceImageInfo bytedanceImageInfoEntity = bytedanceImageInfoService.getById(bytedanceImageInfo.getId());
+		if(bytedanceImageInfoEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = bytedanceImageInfoService.updateById(bytedanceImageInfo);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "头条图片素材-通过id删除")
+	@ApiOperation(value="头条图片素材-通过id删除", notes="头条图片素材-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			bytedanceImageInfoService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "头条图片素材-批量删除")
+	@ApiOperation(value="头条图片素材-批量删除", notes="头条图片素材-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<BytedanceImageInfo> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<BytedanceImageInfo> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.bytedanceImageInfoService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "头条图片素材-通过id查询")
+	@ApiOperation(value="头条图片素材-通过id查询", notes="头条图片素材-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<BytedanceImageInfo> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<BytedanceImageInfo> result = new Result<>();
+		BytedanceImageInfo bytedanceImageInfo = bytedanceImageInfoService.getById(id);
+		if(bytedanceImageInfo==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(bytedanceImageInfo);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+  /**
+      * 导出excel
+   *
+   * @param request
+   * @param response
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+      // Step.1 组装查询条件
+      QueryWrapper<BytedanceImageInfo> queryWrapper = null;
+      try {
+          String paramsStr = request.getParameter("paramsStr");
+          if (oConvertUtils.isNotEmpty(paramsStr)) {
+              String deString = URLDecoder.decode(paramsStr, "UTF-8");
+              BytedanceImageInfo bytedanceImageInfo = JSON.parseObject(deString, BytedanceImageInfo.class);
+              queryWrapper = QueryGenerator.initQueryWrapper(bytedanceImageInfo, request.getParameterMap());
+          }
+      } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+      }
+
+      //Step.2 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      List<BytedanceImageInfo> pageList = bytedanceImageInfoService.list(queryWrapper);
+      //导出文件名称
+      mv.addObject(NormalExcelConstants.FILE_NAME, "头条图片素材列表");
+      mv.addObject(NormalExcelConstants.CLASS, BytedanceImageInfo.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("头条图片素材列表数据", "导出人:Jeecg", "导出信息"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+  }
+
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          MultipartFile file = entity.getValue();
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<BytedanceImageInfo> listBytedanceImageInfos = ExcelImportUtil.importExcel(file.getInputStream(), BytedanceImageInfo.class, params);
+              bytedanceImageInfoService.saveBatch(listBytedanceImageInfos);
+              return Result.ok("文件导入成功!数据行数:" + listBytedanceImageInfos.size());
+          } catch (Exception e) {
+              log.error(e.getMessage(),e);
+              return Result.error("文件导入失败:"+e.getMessage());
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+  }
+
+}

+ 75 - 20
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceAdvertisePlan.java

@@ -4,14 +4,13 @@ import cn.com.ctop.common.module.annotation.Dict;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
-import org.jeecgframework.poi.excel.annotation.Excel;
 
 import java.math.BigDecimal;
 import java.util.Date;
@@ -29,24 +28,22 @@ import java.util.Date;
 @Accessors(chain = true)
 @ApiModel(value = "ctop_bytedance_advertise_plan对象", description = "今日头条广告计划信息")
 public class ByteDanceAdvertisePlan {
-
-    /**
-     * 头条平台广告计划id
-     */
     @TableId
-    @ApiModelProperty(value = "头条平台广告计划id")
     private Long id;
 
-
-    // 账户Id
     @Dict(dicCode = "account_id",dictTable="ctop_user_allocation",dicText="auth_name")
     private String accountId;
 
     // 计划名称
     private String name;
 
-    // 广告组id
-    @Dict(dicCode = "campaign_id",dictTable="ctop_bytedance_campaign",dicText="name")
+    @TableField(exist=false)
+    private Object names;
+
+    @TableField(exist=false)
+    private String landingType;
+
+    @Dict(dicCode = "id",dictTable="ctop_bytedance_campaign",dicText="name")
     private Long campaignId;
 
     private String operation;
@@ -75,8 +72,7 @@ public class ByteDanceAdvertisePlan {
     private String toutiaoStatus;
 
     //true:投放中 false:暂停
-    private Boolean status;
-
+    private Boolean planStatus;
 
     // 广告计划操作状态
     private String optStatus;
@@ -108,6 +104,9 @@ public class ByteDanceAdvertisePlan {
     // 应用下载方式
     private String downloadType;
 
+    // 应用下载方式
+    private String downloadUrl;
+
     // 广告落地页链接
     private String externalUrl;
 
@@ -122,6 +121,7 @@ public class ByteDanceAdvertisePlan {
 
     // ocpc广告转化出价
     private BigDecimal cpaBid;
+
     private BigDecimal deepCpaBid;  // 深度优化出价
 
     private String deepBidType;
@@ -142,18 +142,73 @@ public class ByteDanceAdvertisePlan {
     // audience
     private String audience;
 
-
     private String modifyTime;
 
-    // 受众性别
-    private String gender;
-
-    // 受众平台
-    private String platform;
-
     private Date createTime;
 
     private Date updateTime;
+    /**
+     *  受众公共参数
+     */
+    // 受众性别
+    private String gender;
+    // 受众平台
+    @TableField(exist=false)
+    private Object platform;
+    @TableField(exist=false)
+    private Object retargetingTags;
+    @TableField(exist=false)
+    private Object retargetingTagsExclude;
+    @TableField(exist=false)
+    private Object age;
+    @TableField(exist=false)
+    private Object carrier;
+    @TableField(exist=false)
+    private Object ac;
+    @TableField(exist=false)
+    private Object deviceBrand;
+    @TableField(exist=false)
+    private Object articleCategory;
+    @TableField(exist=false)
+    private Object activateType;
+    @TableField(exist=false)
+    private Object city;
+    @TableField(exist=false)
+    private Object businessIds;
+    @TableField(exist=false)
+    private String locationType;
+    @TableField(exist=false)
+    private Object superiorPopularityType;
+    @TableField(exist=false)
+    private Object flowPackage;
+    @TableField(exist=false)
+    private Object excludeFlowPackage;
+    @TableField(exist=false)
+    private Object deviceType;
+    @TableField(exist=false)
+    private Object autoExtendEnabled;
+    @TableField(exist=false)
+    private Object launchPrice;
+    @TableField(exist=false)
+    private Object interestActionMode;
+    @TableField(exist=false)
+    private Object actionScene;
+    @TableField(exist=false)
+    private Object actionDays;
+    @TableField(exist=false)
+    private Object actionCategories;
+    @TableField(exist=false)
+    private Object actionWords;
+    @TableField(exist=false)
+    private Object interestCategories;
+    @TableField(exist=false)
+    private Object interestWords;
+    @TableField(exist=false)
+    private Object geolocation;
+    @TableField(exist=false)
+    private String externalAction;
+    @TableField(exist=false)
+    private String useOpenUrl;
 
     public ByteDanceAdvertisePlan(JSONObject dataObject, String accountId) {
         this.id = dataObject.getLong("id");

+ 3 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceAudiencePackage.java

@@ -28,6 +28,7 @@ public class ByteDanceAudiencePackage {
 	/**账户Id*/
 	private String userId;
 
+
 	/**定向包名称*/
 	private String name;
 
@@ -124,6 +125,8 @@ public class ByteDanceAudiencePackage {
 	/**需要传json对象!地图位置,district为BUSINESS_DISTRICT才有效*/
 	private Object geolocation;
 
+	private String filterConvertedUsers;
+
 	/**(抖音推广特有)账号粉丝相似人群(添加抖音账号,会将广告投放给对应账号的相似人群粉丝)	*/
 	private Object awemeFansNumbers;
 

+ 1 - 11
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceCampaign.java

@@ -34,20 +34,15 @@ public class ByteDanceCampaign {
      * 今日头条广告组id
      */
     @TableId
-    @ApiModelProperty(value = "今日头条广告组id")
     private Long id;
     private Long accountId;
     /**
      * 广告组名称
      */
-    @Excel(name = "广告组名称", width = 15)
-    @ApiModelProperty(value = "广告组名称")
     private String name;
     /**
      * 广告组预算
      */
-    @Excel(name = "广告组预算", width = 15)
-    @ApiModelProperty(value = "广告组预算")
     private BigDecimal budget;
     /**
      * 广告组预算类型
@@ -56,8 +51,6 @@ public class ByteDanceCampaign {
     private String budgetMode;
     /**
      * 广告组推广目的
-     */
-    /**
      * extendsValue在此处为固定值,切忌胡乱修改
      */
     @Dict(dicCode = "item_value", dictTable = "sys_dict_item", dicText = "item_text",extendsKey = "dict_id",extendsValue = "181afbae847dd3bc7e27795d89538c9c")
@@ -68,19 +61,16 @@ public class ByteDanceCampaign {
     @Excel(name = "广告组时间戳,用于更新时提交,服务端判断是否基于最新信息修改", width = 15)
     @ApiModelProperty(value = "广告组时间戳,用于更新时提交,服务端判断是否基于最新信息修改")
     private String modifyTime;
+
     @Dict(dicCode = "item_value", dictTable = "sys_dict_item", dicText = "item_text",extendsKey = "dict_id",extendsValue = "fbc3e2fc9e6f5cfa5f6aeddd4c3bf818")
     private String status;
     /**
      * 广告组创建时间
      */
-    @Excel(name = "广告组创建时间", width = 15)
-    @ApiModelProperty(value = "广告组创建时间")
     private String campaignCreateTime;
     /**
      * 广告组修改时间
      */
-    @Excel(name = "广告组修改时间", width = 15)
-    @ApiModelProperty(value = "广告组修改时间")
     private String campaignModifyTime;
     /**
      * createTime

+ 7 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceCreative.java

@@ -61,6 +61,7 @@ public class ByteDanceCreative {
      */
     @Dict(dicCode = "item_value", dictTable = "sys_dict_item", dicText = "item_text",extendsKey = "dict_id",extendsValue = "57b60cec65bbc7cd3d6da4fbda589594")
     private String status;
+    private String optStatus;
     /**
      * 创意素材类型
      */
@@ -76,14 +77,12 @@ public class ByteDanceCreative {
     /**
      * 视频素材封面
      */
-    @Excel(name = "视频素材封面", width = 15)
-    @ApiModelProperty(value = "视频素材封面")
+    @Dict(dicCode = "id",dictTable="ctop_bytedance_image_info",dicText="image_url")
     private String imageId;
     /**
      * 视频id
      */
-    @Excel(name = "视频id", width = 15)
-    @ApiModelProperty(value = "视频id")
+    @Dict(dicCode = "id",dictTable="ctop_bytedance_video_info",dicText="video_url")
     private String videoId;
     /**
      * 创意审核信息
@@ -142,6 +141,10 @@ public class ByteDanceCreative {
         if (null != status && !"".equals(status.trim())) {
             this.status = status;
         }
+        String optStatus = dataObject.getString("opt_status");
+        if(null!=optStatus&&!"".equals(optStatus.trim())){
+            this.optStatus = optStatus;
+        }
         String imageMode = dataObject.getString("image_mode");
         if (null != imageMode && !"".equals(imageMode.trim())) {
             this.imageMode = imageMode;

+ 1 - 17
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceVideoInfo.java

@@ -59,48 +59,32 @@ public class ByteDanceVideoInfo {
     /**
      * 视频高度
      */
-    @Excel(name = "视频高度", width = 15)
-    @ApiModelProperty(value = "视频高度")
     private Integer height;
     /**
      * 视频时长
      */
-    @Excel(name = "视频时长", width = 15)
-    @ApiModelProperty(value = "视频时长")
     private Double duration;
     /**
      * 视频大小
      */
-    @Excel(name = "视频大小", width = 15)
-    @ApiModelProperty(value = "视频大小")
     private Long size;
     /**
      * 视频地址
      */
-    @ApiModelProperty(value = "视频地址")
     private String videoUrl;
-    @ApiModelProperty(value = "md5码")
     private String signature;
     private Integer status;
     private Date createTime;
-
     private Date updateTime;
-
     private String url;
-
     private String format;
-
     private String posterUrl;
-
     private Long bitRate;
-
     private Long materialId;
-
     private String source;
-
     private Date materialUploadTime;
-
     private String filename;
+    private Integer type;
 
     public ByteDanceVideoInfo(JSONObject data, CtopOauthToken token) {
         this.id = data.getString("id");

+ 95 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/BytedanceImageInfo.java

@@ -0,0 +1,95 @@
+package cn.com.ctop.toutiao.modules.material.entity;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 头条图片素材
+ * @author jeecg-boot
+ * @date   2020-08-01
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_bytedance_image_info")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_bytedance_image_info对象", description="头条图片素材")
+public class BytedanceImageInfo {
+
+	/**id*/
+	@TableId()
+    @ApiModelProperty(value = "id")
+	private String id;
+	/**头条平台账号id*/
+	private Long accountId;
+	/**advertiserId*/
+	private Long materialId;
+	/**图片大小*/
+	@Excel(name = "图片大小", width = 15)
+    @ApiModelProperty(value = "图片大小")
+	private Long size;
+	/**图片宽度*/
+	@Excel(name = "图片宽度", width = 15)
+    @ApiModelProperty(value = "图片宽度")
+	private Long width;
+	/**图片高度*/
+	@Excel(name = "图片高度", width = 15)
+    @ApiModelProperty(value = "图片高度")
+	private Long height;
+	/**预览地址*/
+	@Excel(name = "预览地址", width = 15)
+    @ApiModelProperty(value = "预览地址")
+	private String url;
+	private String imageUrl;
+	/**图片格式*/
+	@Excel(name = "图片格式", width = 15)
+    @ApiModelProperty(value = "图片格式")
+	private String format;
+	/**图片Md5*/
+	@Excel(name = "图片Md5", width = 15)
+    @ApiModelProperty(value = "图片Md5")
+	private String signature;
+	private String imageCreateTime;
+	private String fileName;
+	/**createTime*/
+    @ApiModelProperty(value = "createTime")
+	private Date createTime;
+	/**updateTime*/
+    @ApiModelProperty(value = "updateTime")
+	private Date updateTime;
+
+	public BytedanceImageInfo(JSONObject dataObject, CtopOauthToken token) {
+		String id = dataObject.getString("id");
+		if(null!=id&&id.contains("web")){
+			this.imageUrl = "https://sf6-ttcdn-tos.pstatp.com/obj/"+id;
+		}else{
+			this.imageUrl = "https://sf6-ttcdn-tos.pstatp.com/obj/mosaic-legacy/"+id;
+		}
+		this.id = dataObject.getString("id");
+		this.accountId = token.getAccountId();
+		this.materialId = dataObject.getLong("material_id");
+		this.size = dataObject.getLong("size");
+		this.width = dataObject.getLong("width");
+		this.height = dataObject.getLong("height");
+		this.url = dataObject.getString("url");
+		this.format = dataObject.getString("format");
+		this.signature = dataObject.getString("signature");
+		this.imageCreateTime = dataObject.getString("create_time");
+		this.fileName = dataObject.getString("filename");
+		this.createTime = new Date();
+		this.updateTime = new Date();
+	}
+
+	public BytedanceImageInfo() {
+	}
+}

+ 18 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/BytedanceImageInfoMapper.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.toutiao.modules.material.mapper;
+
+import cn.com.ctop.toutiao.modules.material.entity.BytedanceImageInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 头条图片素材
+ * @author: jeecg-boot
+ * @date:   2020-08-01
+ * @cersion: V1.0
+ */
+public interface BytedanceImageInfoMapper extends BaseMapper<BytedanceImageInfo> {
+
+    void replaceBatch(@Param(value = "imageInfos")List<BytedanceImageInfo> imageInfos);
+}

+ 35 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/xml/BytedanceImageInfoMapper.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.toutiao.modules.material.mapper.BytedanceImageInfoMapper">
+
+    <insert id="replaceBatch">
+        replace into ctop_bytedance_image_info(
+        id,
+        account_id,
+        material_id,
+        size,
+        width,
+        height,
+        url,
+        format,
+        signature,
+        image_create_time,
+        create_time,
+        update_time,image_url)
+        values
+        <foreach collection="imageInfos" item="imageInfo" separator=",">
+            (#{imageInfo.id},
+            #{imageInfo.accountId},
+            #{imageInfo.materialId},
+            #{imageInfo.size},
+            #{imageInfo.width},
+            #{imageInfo.height},
+            #{imageInfo.url},
+            #{imageInfo.format},
+            #{imageInfo.signature},
+            #{imageInfo.imageCreateTime},
+            #{imageInfo.createTime},
+            #{imageInfo.updateTime},#{imageInfo.imageUrl})
+        </foreach>
+    </insert>
+</mapper>

+ 4 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IByteDanceAdvertisePlanService.java

@@ -2,6 +2,7 @@ package cn.com.ctop.toutiao.modules.material.service;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.toutiao.modules.material.entity.ByteDanceAdvertisePlan;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 import jdk.nashorn.internal.scripts.JS;
@@ -28,13 +29,13 @@ public interface IByteDanceAdvertisePlanService extends IService<ByteDanceAdvert
     Map<String, Object> updateAdvertiserPlan(CtopOauthToken token,String landingType, ByteDanceAdvertisePlan byteDanceAdvertisePlan);
 
     //更新计划状态  https://ad.oceanengine.com/open_api/2/ad/update/status/
-    Map<String, Object> updateAdvertiserPlanStatus(CtopOauthToken token, String adIds,String optStatus);
+    Map<String, Object> updateAdvertiserPlanStatus(CtopOauthToken token, JSONArray adIds, String optStatus);
 
     //更新计划预算  https://ad.oceanengine.com/open_api/2/ad/update/budget/
-    Map<String, Object> updateAdvertiserPlanBudget(CtopOauthToken token, String adIds, String budgets);
+    Map<String, Object> updateAdvertiserPlanBudget(CtopOauthToken token, JSONArray adIds, JSONArray budgets);
 
     //更新计划出价  https://ad.oceanengine.com/open_api/2/ad/update/bid/
-    Map<String, Object> updateAdvertiserPlanBid(CtopOauthToken token, String adIds,String bids);
+    Map<String, Object> updateAdvertiserPlanBid(CtopOauthToken token, JSONArray adIds,JSONArray bids);
 
     //获取计划审核建议  https://ad.oceanengine.com/open_api/2/ad/reject_reason/
     Map<String, Object> getAdvertiserPlanRejectReason(CtopOauthToken token, Long advertiserId, List<Long> adIds);

+ 2 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IByteDanceAdvertiserDataService.java

@@ -33,4 +33,6 @@ public interface IByteDanceAdvertiserDataService {
     Map<String, Object> flowPackageGet(String accountId);
 
     void getMaterialList(CtopOauthToken token);
+
+    void getImageByPage(CtopOauthToken token, String imageIds, int page);
 }

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IByteDanceCampaignService.java

@@ -14,7 +14,7 @@ import java.util.Map;
  * @Version: V1.0
  */
 public interface IByteDanceCampaignService extends IService<ByteDanceCampaign> {
-    Map<String,Object> createCampaign(Long accountId, String campaignName, String operation, String budgetMode, Integer budget, String landingType, String uniqueFk);
+    Map<String,Object> createCampaign(Long accountId, String campaignName, String operation, String budgetMode, String budget, String landingType, String uniqueFk);
     Map<String,Object>updateCampaign(CtopOauthToken token, Long campaignId, String campaignName, String modifyTime,Integer budget);
     Map<String, Object> updateCampaignStatus(Long accountId, String campaignIds, String optStatus);
     Map<String, Object> getAdvertiserCampaign(CtopOauthToken token, String ids, String date);

+ 3 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IByteDanceCreativeService.java

@@ -20,7 +20,7 @@ public interface IByteDanceCreativeService extends IService<ByteDanceCreative> {
 
     Map<String, Object> getAdvertiserCreative(CtopOauthToken token, String ids, String date);
 
-    Map<String, Object> advertiserCreativeUpdateStatus(String accountId, String creativeIds, String optStatus);
+    Map<String, Object> advertiserCreativeUpdateStatus(Long accountId, String creativeIds, String optStatus);
 
     void replaceBatch(List<ByteDanceCreative> creatives);
 
@@ -29,4 +29,6 @@ public interface IByteDanceCreativeService extends IService<ByteDanceCreative> {
     Map<String,Object> updateCreative(Long accountId, JSONObject data);
 
     Map<String,Object> getCreativeRejectReason(Long accountId, Long creativeId);
+
+    Map<String, Object> batchCreate(JSONObject data);
 }

+ 17 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IBytedanceImageInfoService.java

@@ -0,0 +1,17 @@
+package cn.com.ctop.toutiao.modules.material.service;
+
+import cn.com.ctop.toutiao.modules.material.entity.BytedanceImageInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * 头条图片素材
+ * @author jeecg-boot
+ * @date   2020-08-01
+ * @version V1.0
+ */
+public interface IBytedanceImageInfoService extends IService<BytedanceImageInfo> {
+
+    void replaceBatch(List<BytedanceImageInfo> videoInfoList);
+}

+ 223 - 161
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceAdvertisePlanServiceImpl.java

@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -22,10 +23,8 @@ import java.util.Map;
 @Slf4j
 @Service
 public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdvertisePlanMapper, ByteDanceAdvertisePlan> implements IByteDanceAdvertisePlanService {
-
     @Autowired
     private ByteDanceAdvertisePlanMapper byteDanceAdvertisePlanMapper;
-
     @Override
     public Map<String, Object> getAdvertiserPlan(CtopOauthToken token, String ids, String date, String updateDate) {
         getAd(token, 1, ids, date, updateDate);
@@ -36,7 +35,7 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
     }
 
     @Override
-    public Map<String, Object> createAdvertiserPlan(CtopOauthToken token,String landingType, ByteDanceAdvertisePlan byteDanceAdvertisePlan) {
+    public Map<String, Object> createAdvertiserPlan(CtopOauthToken token, String landingType, ByteDanceAdvertisePlan byteDanceAdvertisePlan) {
 
         Map<String, Object> resultMap = new HashMap<>();
         //拼接访问参数
@@ -45,176 +44,222 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         headers.put("Access-Token", token.getAccessToken());
 
         JSONObject params = new JSONObject();
-        params.put("advertiser_id",byteDanceAdvertisePlan.getAccountId());
-        params.put("campaign_id",byteDanceAdvertisePlan.getCampaignId());
-        params.put("name",byteDanceAdvertisePlan.getName());
-        params.put("operation",byteDanceAdvertisePlan.getOperation()==null?"enable":byteDanceAdvertisePlan.getOperation());
-        params.put("delivery_range",byteDanceAdvertisePlan.getDeliveryRange()==null?"DEFAULT":byteDanceAdvertisePlan.getDeliveryRange());
-        params.put("union_video_type",byteDanceAdvertisePlan.getUnionVideoType()==null?"ORIGINAL_VIDEO":byteDanceAdvertisePlan.getUnionVideoType());
-        params.put("budget_mode",byteDanceAdvertisePlan.getBudgetMode());
-        params.put("budget",byteDanceAdvertisePlan.getBudget());
-        params.put("schedule_type",byteDanceAdvertisePlan.getScheduleType());
-        params.put("start_time",byteDanceAdvertisePlan.getStartTime());
-        params.put("end_time",byteDanceAdvertisePlan.getEndTime());
+        params.put("advertiser_id", byteDanceAdvertisePlan.getAccountId());
+        params.put("campaign_id", byteDanceAdvertisePlan.getCampaignId());
+        params.put("name", byteDanceAdvertisePlan.getName());
+        params.put("operation", byteDanceAdvertisePlan.getOperation() == null ? "enable" : byteDanceAdvertisePlan.getOperation());
+        params.put("delivery_range", byteDanceAdvertisePlan.getDeliveryRange() == null ? "DEFAULT" : byteDanceAdvertisePlan.getDeliveryRange());
+        params.put("union_video_type", byteDanceAdvertisePlan.getUnionVideoType() == null ? "ORIGINAL_VIDEO" : byteDanceAdvertisePlan.getUnionVideoType());
+        params.put("budget_mode", byteDanceAdvertisePlan.getBudgetMode());
+        params.put("budget", byteDanceAdvertisePlan.getBudget());
+        params.put("schedule_type", byteDanceAdvertisePlan.getScheduleType());
+        params.put("start_time", byteDanceAdvertisePlan.getStartTime());
+        params.put("end_time", byteDanceAdvertisePlan.getEndTime());
         //广告投放时段
-        //params.put("schedule_time",byteDanceAdvertisePlan.getString("scheduleTime"));
-        params.put("pricing",byteDanceAdvertisePlan.getPricing());
-        params.put("bid",byteDanceAdvertisePlan.getBid()==null?0:byteDanceAdvertisePlan.getBid());
-        params.put("cpa_bid",byteDanceAdvertisePlan.getCpaBid()==null?0.1:byteDanceAdvertisePlan.getCpaBid());
-        params.put("flow_control_mode",byteDanceAdvertisePlan.getFlowControlMode());
-        if(byteDanceAdvertisePlan.getPricing().equals("OCPM")){
-            params.put("convert_id",byteDanceAdvertisePlan.getConvertId());
+        if(!byteDanceAdvertisePlan.getScheduleTime().equals("")){
+            params.put("schedule_time",byteDanceAdvertisePlan.getScheduleTime());
         }
-        params.put("deep_bid_type",byteDanceAdvertisePlan.getDeepBidType());
-        params.put("deep_cpabid",byteDanceAdvertisePlan.getDeepCpaBid());
-        params.put("hide_if_converted",byteDanceAdvertisePlan.getHideIfConverted());
-        params.put("hide_if_exists",byteDanceAdvertisePlan.getHideIfExists() == null ? 0 : byteDanceAdvertisePlan.getHideIfExists());
-        params.put("converted_time_duration",byteDanceAdvertisePlan.getConvertedTimeDuration());
+        params.put("pricing", byteDanceAdvertisePlan.getPricing());
+        params.put("bid", byteDanceAdvertisePlan.getBid());
+        params.put("cpa_bid", byteDanceAdvertisePlan.getCpaBid());
+        params.put("flow_control_mode", byteDanceAdvertisePlan.getFlowControlMode());
+        if (byteDanceAdvertisePlan.getPricing().equals("PRICING_OCPM")) {
+            if(byteDanceAdvertisePlan.getConvertId()!=null){
+                //查询必填参数convert_id
+                params.put("convert_id", byteDanceAdvertisePlan.getConvertId());
+            }else{
+                int convertId=getConvertIdByExternalAction(byteDanceAdvertisePlan.getExternalAction());
+                params.put("convert_id",convertId);
+                byteDanceAdvertisePlan.setConvertId((long) convertId);
+            }
+        }
+        params.put("deep_bid_type", byteDanceAdvertisePlan.getDeepBidType());
+        params.put("deep_cpabid", byteDanceAdvertisePlan.getDeepCpaBid());
+        params.put("hide_if_converted", byteDanceAdvertisePlan.getHideIfConverted());
+        params.put("hide_if_exists", byteDanceAdvertisePlan.getHideIfExists() == null ? 0 : byteDanceAdvertisePlan.getHideIfExists());
+        params.put("converted_time_duration", byteDanceAdvertisePlan.getConvertedTimeDuration());
         //params.put("luban_roi_goal",byteDanceAdvertisePlan.getLubanRoiGoal()==null?0.00:byteDanceAdvertisePlan.getFloat("lubanRoiGoal"));
         //params.put("roi_goal",byteDanceAdvertisePlan.getFroiGoal")==null?0.00:byteDanceAdvertisePlan.getFloat("roiGoal"));
         //params.put("unique_fk",byteDanceAdvertisePlan.getUniqueFk")==null?"":byteDanceAdvertisePlan.getString("uniqueFk"));
         //params.put("smart_bid_type",byteDanceAdvertisePlan.getSmartBidType")==null?"":byteDanceAdvertisePlan.getString("smartBidType"));
-        params.put("adjust_cpa",0);
+        params.put("adjust_cpa", 0);
+        //暂时不需要定向包id
         //params.put("audience_package_id",byteDanceAdvertisePlan.getLong("audiencePackageId"));
-        params.put("open_url",byteDanceAdvertisePlan.getOpenUrl());
+        if(byteDanceAdvertisePlan.getUseOpenUrl().equals("YES")){
+            params.put("open_url", byteDanceAdvertisePlan.getOpenUrl());
+        }
         //判断推广目的
-        if(landingType.equals("Link")){
-            params.put("external_url",byteDanceAdvertisePlan.getExternalUrl());
+        if (landingType.equals("LINK")) {
+            params.put("external_url", byteDanceAdvertisePlan.getExternalUrl());
         }
-        if(landingType.equals("APP")){
-            params.put("download_type",byteDanceAdvertisePlan.getExternalUrl());
-
+        if (landingType.equals("APP")) {
+            params.put("download_type", byteDanceAdvertisePlan.getDownloadType());
+            params.put("download_url", byteDanceAdvertisePlan.getDownloadUrl());
+            params.put("package", byteDanceAdvertisePlan.getToutiaoPackage());
+            params.put("app_type",byteDanceAdvertisePlan.getAppType());
         }
-        JSONObject jsonObject = JSONObject.parseObject( HttpUtils.httpPostRequest(PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_create"), params, headers));
-        if (jsonObject.getInteger("code") != 0) {
+
+        //公共参数--受众相关
+        params.put("retargeting_tags_include", byteDanceAdvertisePlan.getRetargetingTags());
+        params.put("retargeting_tags_exclude", byteDanceAdvertisePlan.getRetargetingTagsExclude());
+        params.put("gender", byteDanceAdvertisePlan.getGender());
+        params.put("age", byteDanceAdvertisePlan.getAge());
+        params.put("carrier", byteDanceAdvertisePlan.getCarrier());
+        params.put("ac", byteDanceAdvertisePlan.getAc());
+        params.put("device_brand", byteDanceAdvertisePlan.getDeviceBrand());
+        params.put("article_category", byteDanceAdvertisePlan.getArticleCategory());
+        params.put("activate_type", byteDanceAdvertisePlan.getActivateType());
+        params.put("city", byteDanceAdvertisePlan.getCity());
+        params.put("business_ids", byteDanceAdvertisePlan.getBusinessIds());
+        params.put("location_type", byteDanceAdvertisePlan.getLocationType());
+        params.put("superior_popularity_type", byteDanceAdvertisePlan.getSuperiorPopularityType());
+        params.put("flow_package", byteDanceAdvertisePlan.getFlowPackage());
+        params.put("exclude_flow_package", byteDanceAdvertisePlan.getExcludeFlowPackage());
+        params.put("device_type", byteDanceAdvertisePlan.getDeviceType());
+        params.put("auto_extend_enabled", byteDanceAdvertisePlan.getAutoExtendEnabled());
+        params.put("launch_price", byteDanceAdvertisePlan.getLaunchPrice());
+        params.put("interest_action_mode", byteDanceAdvertisePlan.getInterestActionMode());
+        params.put("action_scene", byteDanceAdvertisePlan.getActionScene());
+        params.put("action_days", byteDanceAdvertisePlan.getActionDays());
+        params.put("action_categories", byteDanceAdvertisePlan.getActionCategories());
+        params.put("action_words", byteDanceAdvertisePlan.getActionWords());
+        params.put("interest_categories", byteDanceAdvertisePlan.getInterestWords());
+        params.put("interest_words", byteDanceAdvertisePlan.getGeolocation());
+
+        JSONObject jsonObject = JSONObject.parseObject(HttpUtils.httpPostRequest(PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_create"), params, headers));
+        if (jsonObject.getInteger("code") == 0) {
+            resultMap.put("code", 0);
+            byteDanceAdvertisePlan.setId(jsonObject.getJSONObject("data").getLong("ad_id"));
+            resultMap.put("data",byteDanceAdvertisePlan);
+        } else {
             log.error("广告计划创建失败==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
-            resultMap.put("code", -1);
+            resultMap.put("code",-200);
             resultMap.put("message", jsonObject.getString("message"));
-            return resultMap;
         }
-        resultMap.put("code", 0);
-        resultMap.put("message", "广告组状态修改成功");
         return resultMap;
     }
 
     @Override
-    public Map<String, Object> updateAdvertiserPlan(CtopOauthToken token,String landingType, ByteDanceAdvertisePlan byteDanceAdvertisePlan) {
+    public Map<String, Object> updateAdvertiserPlan(CtopOauthToken token, String landingType, ByteDanceAdvertisePlan byteDanceAdvertisePlan) {
 
         Map<String, Object> resultMap = new HashMap<>();
 
-        //拼接访问参数
-        Map<String, String> headers = new HashMap<>();
-        headers.put("Content-Type", "application/json");
-        headers.put("Access-Token", token.getAccessToken());
-
-        JSONObject params = new JSONObject();
-        params.put("advertiser_id",byteDanceAdvertisePlan.getAccountId());
-        params.put("ad_id",byteDanceAdvertisePlan.getId());
-        params.put("name",byteDanceAdvertisePlan.getName());
-        params.put("modify_time",byteDanceAdvertisePlan.getModifyTime());
-        params.put("budget",byteDanceAdvertisePlan.getBudget());
-        params.put("schedule_type",byteDanceAdvertisePlan.getScheduleType());
-        params.put("start_time",byteDanceAdvertisePlan.getStartTime());
-        params.put("end_time",byteDanceAdvertisePlan.getEndTime());
-        //广告投放时段
-        //params.put("schedule_time",byteDanceAdvertisePlan.getString("scheduleTime"));
-        params.put("bid",byteDanceAdvertisePlan.getBid()==null?0:byteDanceAdvertisePlan.getBid());
-        params.put("cpa_bid",byteDanceAdvertisePlan.getCpaBid()==null?0.1:byteDanceAdvertisePlan.getCpaBid());
-        params.put("flow_control_mode",byteDanceAdvertisePlan.getFlowControlMode());
-        if(byteDanceAdvertisePlan.getPricing().equals("OCPM")){
-            params.put("convert_id",byteDanceAdvertisePlan.getConvertId());
+        //查询记录,获取修改时间等字段
+        List adId=new ArrayList();
+        adId.add(byteDanceAdvertisePlan.getId());
+        Map<String, Object> map = queryAdByAdId(token, Long.valueOf(byteDanceAdvertisePlan.getAccountId()), adId);
+        if(!map.get("code").equals(0)){
+            log.error("获取修改时间接口错误");
+        }else {
+            Object modifyTime = ((Map) ((JSONObject) map.get("data")).getJSONArray("list").get(0)).get("modify_time");
+            Map<String, String> headers = new HashMap<>();
+            headers.put("Content-Type", "application/json");
+            headers.put("Access-Token", token.getAccessToken());
+
+            JSONObject params = new JSONObject();
+            params.put("advertiser_id", byteDanceAdvertisePlan.getAccountId());
+            params.put("ad_id", byteDanceAdvertisePlan.getId());
+            params.put("name", byteDanceAdvertisePlan.getName());
+            params.put("modify_time", modifyTime);
+            params.put("budget", byteDanceAdvertisePlan.getBudget());
+            params.put("schedule_type", byteDanceAdvertisePlan.getScheduleType());
+            params.put("start_time", byteDanceAdvertisePlan.getStartTime());
+            params.put("end_time", byteDanceAdvertisePlan.getEndTime());
+            //广告投放时段
+            if(!byteDanceAdvertisePlan.getScheduleTime().equals("")){
+                params.put("schedule_time",byteDanceAdvertisePlan.getScheduleTime());
+            }
+            params.put("bid", byteDanceAdvertisePlan.getBid());
+            params.put("cpa_bid", byteDanceAdvertisePlan.getCpaBid());
+            params.put("flow_control_mode", byteDanceAdvertisePlan.getFlowControlMode());
+            params.put("convert_id", byteDanceAdvertisePlan.getConvertId());
+            params.put("deep_bid_type", byteDanceAdvertisePlan.getDeepBidType());
+            params.put("deep_cpabid", byteDanceAdvertisePlan.getDeepCpaBid());
+            params.put("hide_if_converted", byteDanceAdvertisePlan.getHideIfConverted());
+            params.put("hide_if_exists", byteDanceAdvertisePlan.getHideIfExists() == null ? 0 : byteDanceAdvertisePlan.getHideIfExists());
+            //params.put("converted_time_duration", byteDanceAdvertisePlan.getConvertedTimeDuration());
+            //params.put("luban_roi_goal",byteDanceAdvertisePlan.getLubanRoiGoal()==null?0.00:byteDanceAdvertisePlan.getFloat("lubanRoiGoal"));
+            //params.put("roi_goal",byteDanceAdvertisePlan.getFroiGoal")==null?0.00:byteDanceAdvertisePlan.getFloat("roiGoal"));
+            //params.put("audience_package_id",byteDanceAdvertisePlan.getLong("audiencePackageId"));
+            params.put("adjust_cpa", 0);
+            //暂时不需要定向包id
+            //params.put("audience_package_id",byteDanceAdvertisePlan.getLong("audiencePackageId"));
+        /*if(byteDanceAdvertisePlan.getUseOpenUrl().equals("YES")){
+            params.put("open_url", byteDanceAdvertisePlan.getOpenUrl());
+        }*/
+            //判断推广目的
+        /*if (landingType.equals("LINK")) {
+            params.put("external_url", byteDanceAdvertisePlan.getExternalUrl());
         }
-        params.put("deep_bid_type",byteDanceAdvertisePlan.getDeepBidType());
-        params.put("deep_cpabid",byteDanceAdvertisePlan.getDeepCpaBid());
-        params.put("hide_if_converted",byteDanceAdvertisePlan.getHideIfConverted());
-        params.put("hide_if_exists",byteDanceAdvertisePlan.getHideIfExists() == null ? 0 : byteDanceAdvertisePlan.getHideIfExists());
-        params.put("converted_time_duration",byteDanceAdvertisePlan.getConvertedTimeDuration());
-        //params.put("luban_roi_goal",byteDanceAdvertisePlan.getLubanRoiGoal()==null?0.00:byteDanceAdvertisePlan.getFloat("lubanRoiGoal"));
-        //params.put("roi_goal",byteDanceAdvertisePlan.getFroiGoal")==null?0.00:byteDanceAdvertisePlan.getFloat("roiGoal"));
-        //params.put("audience_package_id",byteDanceAdvertisePlan.getLong("audiencePackageId"));
-        params.put("open_url",byteDanceAdvertisePlan.getOpenUrl());
-        //判断推广目的
-        if(landingType.equals("Link")){
-            params.put("external_url",byteDanceAdvertisePlan.getExternalUrl());
+        if (landingType.equals("APP")) {
+            params.put("download_type", byteDanceAdvertisePlan.getDownloadType());
+            params.put("download_url", byteDanceAdvertisePlan.getDownloadUrl());
+            params.put("package", byteDanceAdvertisePlan.getToutiaoPackage());
+            params.put("app_type",byteDanceAdvertisePlan.getAppType());
+        }*/
+            JSONObject jsonObject = JSONObject.parseObject(HttpUtils.httpPostRequest(PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_update"), params, headers));
+            if (jsonObject.getInteger("code") != 0) {
+                log.error("广告计划修改失败==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
+                resultMap.put("code", -1);
+                resultMap.put("message", jsonObject.getString("message"));
+                return resultMap;
+            }
+            resultMap.put("code", 0);
+            resultMap.put("message", "广告组状态修改成功");
         }
-        if(landingType.equals("APP")){
-            params.put("download_type",byteDanceAdvertisePlan.getExternalUrl());
 
-        }
-        JSONObject jsonObject = JSONObject.parseObject( HttpUtils.httpPostRequest(PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_update"), params, headers));
-        if (jsonObject.getInteger("code") != 0) {
-            log.error("广告计划创建失败==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
-            resultMap.put("code", -1);
-            resultMap.put("message", jsonObject.getString("message"));
-            return resultMap;
-        }
-        resultMap.put("code", 0);
-        resultMap.put("message", "广告组状态修改成功");
         return resultMap;
     }
 
     @Override
-    public Map<String, Object> updateAdvertiserPlanStatus(CtopOauthToken token, String adIds, String optStatus) {
-        JSONArray ids = new JSONArray();
-        String[] getIds = adIds.split(StringUtils.COMMA);
-        if (getIds.length > 0) {
-            for (String getId : getIds) {
-                ids.add(Long.parseLong(getId));
-            }
-        }
-        //2: 根据token以及用户id获取用户信息数据
-        String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_update_status");
+    public Map<String, Object> updateAdvertiserPlanStatus(CtopOauthToken token, JSONArray adIds, String optStatus) {
+
         Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", "application/json");
         headers.put("Access-Token", token.getAccessToken());
-
+        switch (optStatus) {
+            case "AD_STATUS_DISABLE":
+                optStatus = "disable";
+                break;
+            case "AD_STATUS_ENABLE":
+                optStatus = "enable";
+                break;
+            case "AD_STATUS_DELETE":
+                optStatus = "delete";
+                break;
+        }
         JSONObject params = new JSONObject();
         params.put("advertiser_id", token.getAccountId());
-        params.put("ad_ids", ids.toJSONString());
+        params.put("ad_ids", adIds.toJSONString());
         params.put("opt_status", optStatus);
-        String result = HttpUtils.httpPostRequest(url, params, headers);
+        String result = HttpUtils.httpPostRequest(PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_update_status"), params, headers);
         JSONObject jsonObject = JSONObject.parseObject(result);
         int code = jsonObject.getInteger("code");
         Map<String, Object> resultMap = new HashMap<>();
         if (code != 0) {
             log.error("广告计划更新状态接口异常==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
             resultMap.put("code", -1);
-            resultMap.put("message", "广告计划更新状态接口异常");
-            return resultMap;
-        }
-        JSONObject data = jsonObject.getJSONObject("data");
-        if (null == data) {
-            log.info("广告计划更新状态异常==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
-            resultMap.put("code", -1);
             resultMap.put("message", jsonObject.getString("message"));
             return resultMap;
         }
-        JSONArray getAdIds = data.getJSONArray("ad_ids");
-        if (null != getAdIds && !getAdIds.isEmpty()) {
-            //获取广告计划信息
-            getAdvertiserPlan(token, adIds, null, null);
-        }
         resultMap.put("code", 0);
         resultMap.put("message", "广告组状态修改成功");
         return resultMap;
     }
 
-    public Map<String, Object> updateAdvertiserPlanBudget(CtopOauthToken token, String adIds, String budgets) {
+    @Override
+    public Map<String, Object> updateAdvertiserPlanBudget(CtopOauthToken token, JSONArray adIds, JSONArray budgets) {
         JSONArray data = new JSONArray();
-        String[] getadIds = adIds.split(StringUtils.COMMA);
-        String[] getBudgets = budgets.split(StringUtils.COMMA);
-        if (getadIds.length > 0) {
-            for (int i = 0; i < getadIds.length; i++) {
+        if (adIds.size() > 0) {
+            for (int i = 0; i < adIds.size(); i++) {
                 JSONObject object = new JSONObject();
-                Long adId = Long.parseLong(getadIds[i]);
-                Long budget = Long.parseLong(getBudgets[i]);
+                Long adId = Long.valueOf(adIds.get(i).toString());
+                Long budget = Long.valueOf(budgets.get(i).toString());
                 object.put("ad_id", adId);
                 object.put("budget", budget);
                 data.add(object);
             }
         }
-        //2: 根据token以及用户id获取用户信息数据
-        String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_update_budget");
         Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", "application/json");
         headers.put("Access-Token", token.getAccessToken());
@@ -222,50 +267,35 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         JSONObject params = new JSONObject();
         params.put("advertiser_id", token.getAccountId());
         params.put("data", data.toJSONString());
-        String result = HttpUtils.httpPostRequest(url, params, headers);
+        String result = HttpUtils.httpPostRequest(PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_update_budget"), params, headers);
         JSONObject jsonObject = JSONObject.parseObject(result);
         Map<String, Object> resultMap = new HashMap<>();
-        Integer code = jsonObject.getInteger("code");
-        if (null == code || !code.equals(0)) {
+        int code = jsonObject.getInteger("code");
+        if (code!=0) {
             log.info("修改计划预算接口异常==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
             resultMap.put("code", -1);
             resultMap.put("message", jsonObject.getString("message"));
             return resultMap;
         }
-        JSONObject getData = jsonObject.getJSONObject("data");
-        if (null == getData) {
-            log.info("修改计划预算异常==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
-            resultMap.put("code", -1);
-            resultMap.put("message", jsonObject.getString("message"));
-            return resultMap;
-        }
-        JSONArray getAdIds = getData.getJSONArray("ad_ids");
-        if (null != getAdIds && !getAdIds.isEmpty()) {
-            //获取广告计划信息
-            getAdvertiserPlan(token, adIds, null, null);
-        }
         resultMap.put("code", 0);
         resultMap.put("message", "修改计划预算成功");
         return resultMap;
     }
 
     @Override
-    public Map<String, Object> updateAdvertiserPlanBid(CtopOauthToken token, String adIds, String bids) {
-        String[] getadIds = adIds.split(StringUtils.COMMA);
-        String[] getBids = bids.split(StringUtils.COMMA);
+    public Map<String, Object> updateAdvertiserPlanBid(CtopOauthToken token, JSONArray adIds, JSONArray bids) {
         JSONArray data = new JSONArray();
-        if (getadIds.length > 0) {
-            for (int i = 0; i < getadIds.length; i++) {
+        if (adIds.size() > 0) {
+            for (int i = 0; i < adIds.size(); i++) {
                 JSONObject object = new JSONObject();
-                Long adId = Long.parseLong(getadIds[i]);
-                Long bid = Long.parseLong(getBids[i]);
+                Long adId = Long.valueOf(adIds.get(i).toString());
+                Long bid = Long.valueOf(bids.get(i).toString());
                 object.put("ad_id", adId);
                 object.put("bid", bid);
                 data.add(object);
             }
         }
         //2: 根据token以及用户id获取用户信息数据
-        String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_update_bid");
         Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", "application/json");
         headers.put("Access-Token", token.getAccessToken());
@@ -273,8 +303,7 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         JSONObject params = new JSONObject();
         params.put("advertiser_id", token.getAccountId());
         params.put("data", data.toJSONString());
-        String result = HttpUtils.httpPostRequest(url, params, headers);
-        JSONObject jsonObject = JSONObject.parseObject(result);
+        JSONObject jsonObject = JSONObject.parseObject(HttpUtils.httpPostRequest(PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_update_bid"), params, headers));
         int code = jsonObject.getInteger("code");
         Map<String, Object> resultMap = new HashMap<>();
         if (code != 0) {
@@ -283,18 +312,6 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
             resultMap.put("message", jsonObject.getString("message"));
             return resultMap;
         }
-        JSONObject getData = jsonObject.getJSONObject("data");
-        if (null == getData) {
-            log.info("修改计划出价异常==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
-            resultMap.put("code", -1);
-            resultMap.put("message", jsonObject.getString("message"));
-            return resultMap;
-        }
-        JSONArray getAdIds = getData.getJSONArray("ad_ids");
-        if (null != getAdIds && !getAdIds.isEmpty()) {
-            //获取广告计划信息
-            getAdvertiserPlan(token, adIds, null, null);
-        }
         resultMap.put("code", 0);
         resultMap.put("message", "修改计划出价成功");
         return resultMap;
@@ -310,16 +327,16 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         headers.put("Content-Type", "application/json");
         headers.put("Access-Token", token.getAccessToken());
 
-        JSONObject params=new JSONObject();
-        params.put("advertiser_id",advertiserId);
-        params.put("ad_ids",adIds);
+        JSONObject params = new JSONObject();
+        params.put("advertiser_id", advertiserId);
+        params.put("ad_ids", adIds);
         String result = HttpUtils.httpPostRequest(url, params, headers);
         JSONObject jsonObject = JSONObject.parseObject(result);
         int code = jsonObject.getInteger("code");
-        if(code!=0){
+        if (code != 0) {
             log.info("获取计划审核建议接口异常==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
             resultMap.put("code", -1);
-            resultMap.put("message",jsonObject.getString("message"));
+            resultMap.put("message", jsonObject.getString("message"));
             return resultMap;
         }
         resultMap.put("code", 0);
@@ -391,5 +408,50 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         return byteDanceAdvertisePlanMapper.selectWarningCpaBid(accountId, maxCapBid);
     }
 
+    private Map<String, Object> queryAdByAdId(CtopOauthToken token, Long accountId, List adId){
+
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Content-Type", "application/json");
+        headers.put("Access-Token", token.getAccessToken());
+
+        JSONObject params = new JSONObject();
+        params.put("advertiser_id", accountId);
+        Map<String, Object> filtering = new HashMap<>();
+        filtering.put("ids",adId);
+        params.put("filtering", filtering);
+        JSONObject jsonObject = JSONObject.parseObject(HttpUtils.httpGetRequest(PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_get"), headers, params));
+        Map<String, Object> resultMap = new HashMap<>();
+        if (jsonObject.getInteger("code") == 0) {
+            resultMap.put("code", 0);
+            resultMap.put("data",jsonObject.getJSONObject("data"));
+        } else {
+            log.error("广告计划查询失败==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
+            resultMap.put("code",-200);
+            resultMap.put("message", jsonObject.getString("message"));
+        }
+        return resultMap;
+    }
+
+    private int getConvertIdByExternalAction(String externalAction){
+        int result=0;
+        switch (externalAction) {
+            case "AD_CONVERT_TYPE_DOWNLOAD_FINISH":
+                result = 4;
+                break;
+            case "AD_CONVERT_TYPE_BUTTON":
+                result = 5;
+                break;
+            case "AD_CONVERT_TYPE_DOWNLOAD_START":
+                result = 9;
+                break;
+            case "AD_CONVERT_TYPE_INSTALL_FINISH":
+                result = 15;
+                break;
+            case "AD_CONVERT_TYPE_REDIRECT":
+                result = 95;
+                break;
+        }
+        return result;
+    }
 
 }

+ 52 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceAdvertiserDataServiceImpl.java

@@ -576,6 +576,54 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
     @Override
     public void getMaterialList(CtopOauthToken token) {
         getVideoByPage(token, "", 1);
+        getImageByPage(token, "", 1);
+    }
+
+    @Autowired
+    private IBytedanceImageInfoService imageInfoService;
+    @Override
+    public void getImageByPage(CtopOauthToken token, String imageIds, int page) {
+        // 请求地址
+        String url = "https://ad.oceanengine.com/open_api/2/file/image/get/";
+        // 请求参数
+        JSONObject param = new JSONObject();
+        param.put("advertiser_id", token.getAccountId());
+        param.put("page", page);
+        param.put("page_size", 100);
+        if (null != imageIds && !"".equals(imageIds.trim())) {
+            String[] getIds = imageIds.split(StringUtils.COMMA);
+            if (getIds.length > 0) {
+                JSONObject filter = new JSONObject();
+                JSONArray idArray = new JSONArray();
+                Collections.addAll(idArray, getIds);
+                filter.put("image_ids", idArray);
+                param.put("filtering", filter);
+            }
+        }
+
+        JSONObject resultObject = HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, param);
+        if(null==resultObject){
+            log.error("获取图片素材库接口异常==》accountId:{}", token.getAccountId());
+            return;
+        }
+        Integer code = resultObject.getInteger("code");
+        if (null == code || !code.equals(0)) {
+            log.error("获取图片素材库接口异常==》accountId:{},message:{}", token.getAccountId(), resultObject.getString("message"));
+            return;
+        }
+        JSONArray data = resultObject.getJSONObject("data").getJSONArray("list");
+        if (null == data || data.isEmpty()) {
+            log.info("获取图片素材完成==》accountId:{},message:{}", token.getAccountId(), resultObject.getString("message"));
+            return;
+        }
+        List<BytedanceImageInfo> videoInfoList = new ArrayList<>();
+        for (int i = 0; i < data.size(); i++) {
+            JSONObject dataObject = data.getJSONObject(i);
+            BytedanceImageInfo imageInfo = new BytedanceImageInfo(dataObject, token);
+            videoInfoList.add(imageInfo);
+        }
+        imageInfoService.replaceBatch(videoInfoList);
+        getImageByPage(token, imageIds, page + 1);
     }
 
     private void getVideoByPage(CtopOauthToken token, String videoIds, int page) {
@@ -598,6 +646,10 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         }
 
         JSONObject resultObject = HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, param);
+        if(null==resultObject){
+            log.error("获取视频素材库接口异常==》accountId:{}", token.getAccountId());
+            return;
+        }
         Integer code = resultObject.getInteger("code");
         if (null == code || !code.equals(0)) {
             log.error("获取视频素材库接口异常==》accountId:{},message:{}", token.getAccountId(), resultObject.getString("message"));

+ 2 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceCampaignServiceImpl.java

@@ -42,7 +42,7 @@ public class ByteDanceCampaignServiceImpl extends ServiceImpl<ByteDanceCampaignM
      * @return
      */
     @Override
-    public Map<String, Object> createCampaign(Long accountId, String campaignName, String operation, String budgetMode, Integer budget, String landingType, String uniqueFk) {
+    public Map<String, Object> createCampaign(Long accountId, String campaignName, String operation, String budgetMode, String budget, String landingType, String uniqueFk) {
         Map<String,Object>result = new HashMap<>();
         CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
         // 请求地址
@@ -55,7 +55,7 @@ public class ByteDanceCampaignServiceImpl extends ServiceImpl<ByteDanceCampaignM
             param.put("operation",operation);
         }
         param.put("budget_mode", budgetMode);
-        if(null != budget){
+        if(null != budget&&!budget.trim().equals("")){
             param.put("budget",budget);
         }
         param.put("landing_type", landingType);
@@ -124,7 +124,6 @@ public class ByteDanceCampaignServiceImpl extends ServiceImpl<ByteDanceCampaignM
             return resultMap;
         }
         this.getAdvertiserCampaign(token,campaignId+"",null);
-
         resultMap.put("code", 0);
         resultMap.put("message", "广告组信息修改成功");
         resultMap.put("success",true);

+ 293 - 9
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceCreativeServiceImpl.java

@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
@@ -42,7 +43,7 @@ public class ByteDanceCreativeServiceImpl extends ServiceImpl<ByteDanceCreativeM
      * @return
      */
     @Override
-    public Map<String, Object> advertiserCreativeUpdateStatus(String accountId, String creativeIds, String optStatus) {
+    public Map<String, Object> advertiserCreativeUpdateStatus(Long accountId, String creativeIds, String optStatus) {
         Map<String, Object> resultMap = new HashMap<>();
         JSONArray ids = new JSONArray();
         String[] getCreativeIds = creativeIds.split(StringUtils.COMMA);
@@ -51,7 +52,7 @@ public class ByteDanceCreativeServiceImpl extends ServiceImpl<ByteDanceCreativeM
                 ids.add(Long.parseLong(getCreativeIds[i]));
             }
         }
-        CtopOauthToken cTopOauthToken = tokenService.getOauthTokenByAccountId(accountId);
+        CtopOauthToken cTopOauthToken = tokenService.getOauthTokenByAccountId(accountId+"");
         //2: 根据token以及用户id获取用户信息数据
         String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_creative_update_status");
         Map<String, String> headers = new HashMap<>();
@@ -65,24 +66,27 @@ public class ByteDanceCreativeServiceImpl extends ServiceImpl<ByteDanceCreativeM
         String result = HttpUtils.httpPostRequest(url, params, headers);
         JSONObject jsonObject = JSONObject.parseObject(result);
         Integer code = jsonObject.getInteger("code");
-
+        String message = jsonObject.getString("message");
         if (null == code || !code.equals(0)) {
-            log.info("修改创意状态接口异常==》accountId:{},message:{}", accountId, jsonObject.getString("message"));
+            log.info("修改创意状态接口异常==》accountId:{},message:{}", accountId, message);
+            resultMap.put("success", false);
             resultMap.put("code", -1);
-            resultMap.put("message", "修改创意状态接口异常");
+            resultMap.put("message", message);
             return resultMap;
         }
         JSONObject data = jsonObject.getJSONObject("data");
         if (null == data) {
-            log.info("修改创意状态异常==》accountId:{},message:{}", accountId, jsonObject.getString("message"));
+            log.info("修改创意状态异常==》accountId:{},message:{}", accountId, message);
+            resultMap.put("success", false);
             resultMap.put("code", -1);
-            resultMap.put("message", "修改创意状态异常");
+            resultMap.put("message", message);
             return resultMap;
         }
         JSONArray returnCreativeIds = data.getJSONArray("creative_ids");
         if (null != returnCreativeIds && !returnCreativeIds.isEmpty()) {
             getAdvertiserCreative(cTopOauthToken, creativeIds, null);
         }
+        resultMap.put("success", true);
         resultMap.put("code", 0);
         resultMap.put("message", "广告创意状态修改成功");
         return resultMap;
@@ -133,6 +137,7 @@ public class ByteDanceCreativeServiceImpl extends ServiceImpl<ByteDanceCreativeM
         params.put("filtering", filtering.toJSONString());
         params.put("advertiser_id", token.getAccountId());
         params.put("page", pageNumber + "");
+        params.put("page_size",100);
         String result = HttpUtils.httpGetRequest(url, headers, params);
         JSONObject jsonObject = JSONObject.parseObject(result);
         Integer code = jsonObject.getInteger("code");
@@ -176,12 +181,12 @@ public class ByteDanceCreativeServiceImpl extends ServiceImpl<ByteDanceCreativeM
             log.info("广告创意创建失败,accountId:{},message:{}", accountId, message);
             resultMap.put("success", false);
             resultMap.put("code", -1);
-            resultMap.put("message", message);
+            resultMap.put("message", "广告计划("+adId+"):"+message);
             return resultMap;
         }
         resultMap.put("success", true);
         resultMap.put("code", 0);
-        resultMap.put("message", "广告创意创建成功");
+        resultMap.put("message", "广告计划("+adId+"):"+"创意创建成功");
         return resultMap;
     }
 
@@ -267,4 +272,283 @@ public class ByteDanceCreativeServiceImpl extends ServiceImpl<ByteDanceCreativeM
         ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS);
         return resultMap;
     }
+
+    @Override
+    public Map<String, Object> batchCreate(JSONObject data) {
+        log.info(data.toJSONString());
+        Map<String,Object>result = new HashMap<>();
+        Long accountId = data.getLong("accountId");
+        CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
+        if(null == token){
+            ResultMapUtils.setResultMap(result,StatusCode.COMMON_PARAM_ERROR);
+            return result;
+        }
+        JSONArray planIds = data.getJSONArray("adIds");
+        if(null == planIds||planIds.isEmpty()){
+            ResultMapUtils.setResultMap(result,StatusCode.COMMON_PARAM_ERROR);
+            return result;
+        }
+        //拼接参数
+        JSONObject params  = initParams(data);
+        JSONArray array = new JSONArray();
+        for(int i=0;i<planIds.size();i++){
+            Map<String,Object> getData = creativeCreate(accountId+"",planIds.getLong(i),params);
+            array.add(getData);
+        }
+        getAdvertiserCreative(token,null, DateUtils.formatDate());
+        result.put("data",array);
+        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    private JSONObject initParams(JSONObject data) {
+        JSONObject params = new JSONObject();
+        String creativeWay = data.getString("creativeWay");
+        params.put("advertiser_id",data.getLong("accountId"));
+        //###############公共参数开始################################
+        //优选广告位
+        Integer smartInventory = data.getInteger("smartInventory");
+        if(null!=smartInventory){
+            params.put("smart_inventory",smartInventory);
+        }
+        //媒体指定位置
+        JSONArray inventoryType = data.getJSONArray("inventoryType");
+        if(null!=inventoryType){
+            params.put("inventory_type",inventoryType);
+        }
+        //场景指定位置
+        String sceneInventory = data.getString("sceneInventory");
+        if(null!=sceneInventory&&!sceneInventory.trim().equals("")){
+            params.put("scene_inventory",sceneInventory);
+        }
+        JSONArray adKeywords = data.getJSONArray("adKeywords");
+        if(null!=adKeywords&&!adKeywords.isEmpty()){
+            params.put("ad_keywords",adKeywords);
+        }
+        Long thirdIndustryId = data.getLong("thirdIndustryId");
+        if(null!=thirdIndustryId&&thirdIndustryId!=0){
+            params.put("third_industry_id",thirdIndustryId);
+        }
+
+        /**
+         * 创意展现方式
+         */
+        String creativeDisplayMode = data.getString("creativeDisplayMode");
+        if(null!=creativeDisplayMode&&creativeDisplayMode.trim().equals("")){
+            params.put("creative_display_mode",creativeDisplayMode);
+        }
+        String trackUrl = data.getString("trackUrl");
+        if(null!=trackUrl&&trackUrl.trim().equals("")){
+            params.put("track_url",trackUrl);
+        }
+        String actionTrackUrl = data.getString("actionTrackUrl");
+        if(null!=actionTrackUrl&&actionTrackUrl.trim().equals("")){
+            params.put("action_track_url",actionTrackUrl);
+        }
+        String videoPlayEffectiveTrackUrl = data.getString("videoPlayEffectiveTrackUrl");
+        if(null!=videoPlayEffectiveTrackUrl&&videoPlayEffectiveTrackUrl.trim().equals("")){
+            params.put("video_play_effective_track_url",videoPlayEffectiveTrackUrl);
+        }
+        String videoPlayDoneTrackUrl = data.getString("videoPlayDoneTrackUrl");
+        if(null!=videoPlayDoneTrackUrl&&videoPlayDoneTrackUrl.trim().equals("")){
+            params.put("video_play_done_track_url",videoPlayDoneTrackUrl);
+        }
+        String videoPlayTrackUrl = data.getString("videoPlayTrackUrl");
+        if(null!=videoPlayTrackUrl&&videoPlayTrackUrl.trim().equals("")){
+            params.put("video_play_track_url",videoPlayTrackUrl);
+        }
+        Long isCommentDisable = data.getLong("isCommentDisable");
+        if(null!=isCommentDisable&&isCommentDisable!=0){
+            params.put("is_comment_disable",isCommentDisable);
+        }
+        Long closeVideoDetail = data.getLong("closeVideoDetail");
+        if(null!=closeVideoDetail){
+            params.put("close_video_detail",closeVideoDetail);
+        }
+        Long generateDerivedAd = data.getLong("generateDerivedAd");
+        if(null!=generateDerivedAd&&generateDerivedAd!=0){
+            params.put("generate_derived_ad",generateDerivedAd);
+        }
+        String playableUrl = data.getString("playableUrl");
+        if(null!=playableUrl&&!"".equals(playableUrl.trim())){
+            params.put("playable_url",playableUrl);
+        }
+        Long isPresentedVideo = data.getLong("isPresentedVideo");
+        if(null!=isPresentedVideo&&isPresentedVideo!=0){
+            params.put("is_presented_video",isPresentedVideo);
+        }
+        Long creativeAutoGenerateSwitch = data.getLong("creativeAutoGenerateSwitch");
+        if(null!=creativeAutoGenerateSwitch&&creativeAutoGenerateSwitch!=0){
+            params.put("creative_auto_generate_switch",creativeAutoGenerateSwitch);
+        }
+        String trackUrlSendType = data.getString("trackUrlSendType");
+        if(null!=trackUrlSendType&&!"".equals(trackUrlSendType.trim())){
+            params.put("track_url_send_type",trackUrlSendType);
+        }
+        String iesCoreUserId = data.getString("iesCoreUserId");
+        if(null!=iesCoreUserId&&!"".equals(iesCoreUserId)){
+            params.put("ies_core_user_id",iesCoreUserId);
+        }
+        Long isFeedAndFavSee = data.getLong("isFeedAndFavSee");
+        if(null!=isFeedAndFavSee&&isFeedAndFavSee!=0){
+            params.put("is_feed_and_fav_see",isFeedAndFavSee);
+        }
+        JSONArray subLinkIdList = data.getJSONArray("subLinkIdList");
+        if(null!=subLinkIdList&&!subLinkIdList.isEmpty()){
+            params.put("sub_link_id_list",subLinkIdList);
+        }
+
+        String source = data.getString("source");
+        if(null!=source&&!source.trim().equals("")){
+            params.put("source",source);
+        }
+        //###############公共参数结束################################
+
+        //#######推广目的为APP######################################
+        String appName = data.getString("appName");
+        if(null!=appName&&!appName.trim().equals("")){
+            params.put("app_name",appName);
+        }
+        String webUrl = data.getString("webUrl");
+        if(null!=webUrl&&!webUrl.trim().equals("")){
+            params.put("web_url",webUrl);
+        }
+        String actionText = data.getString("actionText");
+        if(null!=actionText&&!actionText.trim().equals("")){
+            params.put("action_text",actionText);
+        }
+        String subTitle = data.getString("subTitle");
+        if(null!=subTitle&&!subTitle.trim().equals("")){
+            params.put("sub_title",subTitle);
+        }
+        //###############################################
+        //############创意推广目的为link的时候###################
+        String advancedCreativeType = data.getString("advancedCreativeType");
+        if(null!=advancedCreativeType&&!advancedCreativeType.trim().equals("")){
+            params.put("advanced_creative_type",advancedCreativeType);
+        }
+        String advancedCreativeTitle = data.getString("advancedCreativeTitle");
+        if(null!=advancedCreativeTitle&&!advancedCreativeTitle.trim().equals("")){
+            params.put("advanced_creative_title",advancedCreativeTitle);
+        }
+        String phoneNumber = data.getString("phoneNumber");
+        if(null!=phoneNumber&&!phoneNumber.trim().equals("")){
+            params.put("phone_number",phoneNumber);
+        }
+        String buttonText = data.getString("buttonText");
+        if(null!=buttonText&&!buttonText.trim().equals("")){
+            params.put("button_text",buttonText);
+        }
+        String formUrl = data.getString("formUrl");
+        if(null!=formUrl&&!formUrl.trim().equals("")){
+            params.put("form_url",formUrl);
+        }
+
+        if(null!=creativeWay&&creativeWay.trim().equals("proceduralCreativity")){
+            //程序化
+            params.put("creative_material_mode","STATIC_ASSEMBLE");
+            JSONArray titleList = data.getJSONArray("titleList");
+            if(null!=titleList&&!titleList.isEmpty()){
+                JSONArray setTitleList = new JSONArray();
+                for (int i=0;i<titleList.size();i++){
+                    JSONObject titleObject = titleList.getJSONObject(i);
+                    JSONArray creativeWordIds = titleObject.getJSONArray("creativeWordIds");
+                    titleObject.remove("creativeWordIds");
+                    if(null!=creativeWordIds&&!creativeWordIds.isEmpty()){
+                        titleObject.put("creative_word_ids",creativeWordIds);
+                    }
+                    setTitleList.add(titleObject);
+                }
+                params.put("title_list",setTitleList);
+            }
+            JSONArray imageList = data.getJSONArray("imageList");
+            if(null!=imageList&&!imageList.isEmpty()){
+                JSONArray setImageList = new JSONArray();
+                for (int i=0;i<imageList.size();i++){
+                    JSONObject imageObject = imageList.getJSONObject(i);
+                    String imageMode = imageObject.getString("imageMode");
+                    JSONArray imageIds = imageObject.getJSONArray("imageIds");
+                    String imageId = imageObject.getString("imageId");
+                    String videoId = imageObject.getString("videoId");
+                    Integer templateId = imageObject.getInteger("templateId");
+                    imageObject.remove("imageMode");
+                    imageObject.remove("imageIds");
+                    imageObject.remove("imageId");
+                    imageObject.remove("videoId");
+                    imageObject.remove("templateId");
+                    imageObject.put("image_mode",imageMode);
+                    if(null!=imageIds&&!imageIds.isEmpty()){
+                        imageObject.put("image_ids",imageIds);
+                    }
+                    if(null!=imageId&&!"".equals(imageId.trim())){
+                        imageObject.put("image_id",imageId);
+                    }
+                    if(null!=videoId&&!"".equals(videoId.trim())){
+                        imageObject.put("video_id",videoId);
+                    }
+                    if(null!=templateId&&templateId!=0){
+                        imageObject.put("template_id",templateId);
+                    }
+
+                    setImageList.add(imageObject);
+                }
+                params.put("image_list",setImageList);
+            }
+        }else{
+            //自定义创意
+            JSONArray creatives = data.getJSONArray("creatives");
+            if(null!=creatives&&!creatives.isEmpty()){
+                JSONArray setCreatives = new JSONArray();
+                for(int i=0;i<creatives.size();i++){
+                    JSONObject creativeObject = creatives.getJSONObject(i);
+                    JSONArray creativeWordIds = creativeObject.getJSONArray("creativeWordIds");
+                    creativeObject.remove("creativeWordIds");
+                    if(null!=creativeWordIds&&!creativeWordIds.isEmpty()){
+                        creativeObject.put("creative_word_ids",creativeWordIds);
+                    }
+                    String imageMode = creativeObject.getString("imageMode");
+                    creativeObject.remove("imageMode");
+                    creativeObject.put("image_mode",imageMode);
+                    JSONArray imageIds = creativeObject.getJSONArray("imageIds");
+                    creativeObject.remove("imageIds");
+                    if(null!=imageIds&&!imageIds.isEmpty()){
+                        creativeObject.put("image_ids",imageIds);
+                    }
+                    String imageId = creativeObject.getString("imageId");
+                    creativeObject.remove("imageId");
+                    if(null!=imageId&&!"".equals(imageId.trim())){
+                        creativeObject.put("image_id",imageId);
+                    }
+                    String videoId = creativeObject.getString("videoId");
+                    creativeObject.remove("videoId");
+                    if(null!=videoId&&!"".equals(videoId.trim())){
+                        creativeObject.put("video_id",videoId);
+                    }
+                    Integer templateId = creativeObject.getInteger("templateId");
+                    creativeObject.remove("templateId");
+                    if(null!=templateId&&templateId!=0){
+                        creativeObject.put("template_id",templateId);
+                    }
+                    JSONArray dpaDictIds = creativeObject.getJSONArray("dpaDictIds");
+                    creativeObject.remove("dpaDictIds");
+                    if(null!=dpaDictIds&&!dpaDictIds.isEmpty()){
+                        creativeObject.put("dpa_dict_ids",dpaDictIds);
+                    }
+                    String text = creativeObject.getString("text");
+                    creativeObject.remove("text");
+                    if(null!=text&&!"".equals(text.trim())){
+                        creativeObject.put("title",text);
+                    }
+                    Integer derivePosterCid = creativeObject.getInteger("derivePosterCid");
+                    creativeObject.remove("derivePosterCid");
+                    if(null!=derivePosterCid&&derivePosterCid!=0){
+                        creativeObject.put("derive_poster_cid",derivePosterCid);
+                    }
+                    setCreatives.add(creativeObject);
+                }
+                params.put("creatives",setCreatives);
+            }
+        }
+        return params;
+    }
 }

+ 26 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/BytedanceImageInfoServiceImpl.java

@@ -0,0 +1,26 @@
+package cn.com.ctop.toutiao.modules.material.service.impl;
+
+import cn.com.ctop.toutiao.modules.material.entity.BytedanceImageInfo;
+import cn.com.ctop.toutiao.modules.material.mapper.BytedanceImageInfoMapper;
+import cn.com.ctop.toutiao.modules.material.service.IBytedanceImageInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 头条图片素材
+ * @author jeecg-boot
+ * @date   2020-08-01
+ * @version V1.0
+ */
+@Service
+public class BytedanceImageInfoServiceImpl extends ServiceImpl<BytedanceImageInfoMapper, BytedanceImageInfo> implements IBytedanceImageInfoService {
+    @Autowired
+    private BytedanceImageInfoMapper bytedanceImageInfoMapper;
+    @Override
+    public void replaceBatch(List<BytedanceImageInfo> videoInfoList) {
+        bytedanceImageInfoMapper.replaceBatch(videoInfoList);
+    }
+}

+ 101 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/DTO/ByteDanceReportAccountDailyDTO.java

@@ -0,0 +1,101 @@
+package cn.com.ctop.toutiao.modules.report.DTO;
+
+import lombok.Data;
+
+@Data
+public class ByteDanceReportAccountDailyDTO {
+	private Integer mediaId;
+
+	private String advertiserId;
+
+	private String advertiserName;
+
+	private String responsibleName;
+
+	private String designResponsibleName;
+
+	private String saleId;
+
+	private String saleName;
+
+	private String statDate;
+
+	private String accountId;
+
+	private String authName;
+
+	private Long projectId;
+
+	private String projectName;
+
+	private java.math.BigDecimal cost;  //消耗
+
+	private Long active;  //应用下载-激活
+
+	private Long downloadFinish;  //应用下载-安卓下载完成
+
+	private Long downloadStart;  //应用下载-安卓下载开始
+
+	private Long installFinish;  //应用下载-安卓安装完成
+
+	private Long register;  //应用下载-注册
+
+	private Long payCount;  //应用下载-付费数
+
+	private Long form;  //表单提交数
+
+	private Long totalPlay;  //视频-总播放
+
+	private Long validPlay;  //视频-有效播放
+
+	private Long wifiPlay;  //视频-wifi播放
+
+	private java.math.BigDecimal play25FeedBreakRate;  //25%进度播放率
+
+	private Long play25FeedBreak;  //视频-播放25%进度总数
+
+	private Long play50FeedBreak;  //视频-播放50%进度总数
+
+	private Long play75FeedBreak;  //视频-播放75%进度总数
+
+	private Long play100FeedBreak;  //视频-播放100%进度总数
+
+	private Long shareMaterial;  //互动数据-分享数
+
+	private Long follow;  //互动数据-新增关注数
+
+	private Long nextDayOpen;  //次留数
+
+	private java.math.BigDecimal nextDayOpenRate;  //次留率 = 次留数/激活数
+
+	private java.math.BigDecimal nextDayOpenCost;  //次留成本 = 消耗/次留数
+
+	private Long convertMaterial;  //转化数据-转化数
+
+	private java.math.BigDecimal cpc;  //平均点击单价
+
+	private java.math.BigDecimal ctr;  //展现数据-点击率   广告被点击的次数占展示次数的百分比。计算方法:点击数/展示数*100%
+
+	private java.math.BigDecimal cpm;  //平均千次展现费用  广告平均每一千次展现所付出的费用,计算公式是:总花费/展示数*1000。
+
+	private Long likeMaterial;  //互动数据-点赞数
+
+	private java.math.BigDecimal activeCost;  //应用下载广告数据-激活成本  计算方式:总花费/激活数。
+
+	private java.math.BigDecimal activeRate;  //应用下载广告数据-激活率   计算方式:激活数/点击数*100%
+
+	private java.math.BigDecimal activeRegisterRate;  //应用下载广告数据-注册率   注册用户占激活用户的比例
+
+	private java.math.BigDecimal activeRegisterCost;  //应用下载广告数据-注册成本  总花费/注册数,当天数据可能会有波动,次日早8点后稳定。
+
+	private Long showMaterial;  //展现数据-展示数
+
+	private java.math.BigDecimal convertRate;  //转化率  转化数/点击数*100%
+
+	private java.math.BigDecimal convertCost;  //转化数据-转化成本=总花费/转化数
+
+    private Long clickMaterial;  //点击数
+
+	private Long clickInstall;  //应用下载-点击安装数
+
+}

+ 21 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/DTO/BytedanceInfoDTO.java

@@ -0,0 +1,21 @@
+package cn.com.ctop.toutiao.modules.report.DTO;
+
+import com.github.pagehelper.PageInfo;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+
+@Data
+public class BytedanceInfoDTO extends PageInfo implements Serializable{
+    private String startDate;
+    private String endDate;
+    private Long unitId;
+    private List<Long> projectList;
+    private Long accountId;  //广告主名称
+    private Long campaignId;
+    private Long projectId;
+    private String sort;
+    private Integer yn;
+}

+ 74 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/controller/BytedanceReportController.java

@@ -2,10 +2,14 @@ package cn.com.ctop.toutiao.modules.report.controller;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.toutiao.modules.report.DTO.ByteDanceReportAccountDailyDTO;
+import cn.com.ctop.toutiao.modules.report.DTO.BytedanceInfoDTO;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportMaterialRetry;
 import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyService;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceAccountReportService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import com.alibaba.fastjson.JSONObject;
+import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.api.vo.Result;
@@ -13,7 +17,9 @@ import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -28,6 +34,8 @@ public class BytedanceReportController {
     private ICtopOauthTokenService tokenService;
     @Autowired
     private IByteDanceVideoReportDailyService byteDanceVideoReportDailyService;
+    @Autowired
+    private IBytedanceAccountReportService bytedanceAccountReportService;
 
     @PostMapping("/kuaiShou/accountReport")
     public Result<JSONObject> getKuaiShouAccountReport(@RequestBody JSONObject requestJson) {
@@ -383,4 +391,70 @@ public class BytedanceReportController {
         return result;
     }
 
+    @ResponseBody
+    @RequestMapping("/getBytedanceAccountInfoByProjectId")
+    public Result<PageInfo<ByteDanceReportAccountDailyDTO>> getBytedanceAccountInfoByProjectId(@RequestBody BytedanceInfoDTO dto) {
+        Result<PageInfo<ByteDanceReportAccountDailyDTO>> result = new Result<>();
+        result.setSuccess(true);
+
+        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null){
+            result.setSuccess(false);
+            result.setMessage("参数有误");
+            return result;
+        }
+
+        if(dto.getPageSize() == 0 ){
+            dto.setPageSize(20);
+        }
+
+        try{
+            PageInfo<ByteDanceReportAccountDailyDTO> byteDanceReportAccountDailyDTOList = bytedanceAccountReportService.getBytedanceAccountInfoByProjectId(dto.getStartDate(), dto.getEndDate(), dto.getProjectId(),dto.getPageNum(),dto.getPageSize(),dto.getSort(), dto.getYn());
+            result.setResult(byteDanceReportAccountDailyDTOList);
+        }catch(Exception e){
+            log.error(e.getMessage());
+            result.setSuccess(false);
+            result.setMessage("执行出错");
+        }finally {
+        }
+
+        return result;
+    }
+
+    @ResponseBody
+    @RequestMapping("/getBytedanceSaleProjectInfo")
+    public Result<PageInfo<ByteDanceReportAccountDailyDTO>> getBytedanceSaleProjectInfo(@RequestBody BytedanceInfoDTO dto) {
+        Result<PageInfo<ByteDanceReportAccountDailyDTO>> result = new Result<>();
+        result.setSuccess(true);
+
+        if(dto == null || dto.getStartDate() ==null || dto.getEndDate() == null){
+            //result.setSuccess(false);
+            //result.setMessage("参数有误");
+            //return result;
+
+            Date getDate = DateUtils.addDay(new Date(), -1);
+            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+            String dateString = dateFormat.format(getDate);
+
+            dto = new BytedanceInfoDTO();
+            dto.setStartDate(dateString);
+            dto.setEndDate(dateString);
+        }
+
+        if(dto.getPageSize() == 0 ){
+            dto.setPageSize(20);
+        }
+
+        try{
+            PageInfo<ByteDanceReportAccountDailyDTO> byteDanceReportAccountDailyDTOList = bytedanceAccountReportService.getBytedanceSaleProjectInfo(dto.getStartDate(), dto.getEndDate(), dto.getProjectList(),dto.getPageNum(),dto.getPageSize(),dto.getSort(), dto.getYn());
+            result.setResult(byteDanceReportAccountDailyDTOList);
+        }catch(Exception e){
+            log.error(e.getMessage());
+            result.setSuccess(false);
+            result.setMessage("执行出错");
+        }finally {
+        }
+
+        return result;
+    }
+
 }

+ 21 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/BytedanceAccountReportMapper.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.toutiao.modules.report.mapper;
 
+import cn.com.ctop.toutiao.modules.report.DTO.ByteDanceReportAccountDailyDTO;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import org.apache.ibatis.annotations.Param;
@@ -44,4 +45,24 @@ public interface BytedanceAccountReportMapper {
     //查询固定月的明细数据
     List<JSONObject> queryDetailGroupDayByMonth(@Param("month") String month);
 
+    List<ByteDanceReportAccountDailyDTO> getBytedanceAccountInfoByProjectId(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("projectId")Long projectId, @Param("accountIds")List<Long> accountIds, @Param("yn")Integer yn);
+
+    List<ByteDanceReportAccountDailyDTO> getBytedanceProjectInfo(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("projectList")List<Long> projectList, @Param("yn")Integer yn);
+
+    String getRoleCodeByUserId(@Param("userId")String userId);
+
+    //List<Long> queryProjectInfoByAdmin(@Param("userId")String userId, @Param("mediaIds")List<Long> mediaIds);
+
+    List<Long> getSaleProjects(@Param("userId")String userId, @Param("mediaIds")List<Long> mediaIds);
+
+    List<Long> queryProjectInfoByAdmin(@Param("mediaIds")List<Long> mediaIds);
+
+    List<ByteDanceReportAccountDailyDTO> queryProjectMemberByIds(@Param("projectIds")List<Long> projectIds);
+
+    List<Long> getUserProjectAccountIds(@Param("userId")String userId);
+
+    List<Long> getSaleProjectAccountIds(@Param("userId")String userId);
+
+    List<Long> getUserProjectAccountIdsByAdmin();
+
 }

+ 257 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceAccountReportMapper.xml

@@ -212,4 +212,261 @@
         order by stat_datetime asc
     </select>
 
+    <sql id="selectSql">
+        ifnull(sum(a.show_num),0)                          as showMaterial,                   -- 展现数据-展示数
+        ifnull(sum(a.click),0)                             as clickMaterial,                  -- 点击数
+        ifnull(sum(a.convert_num),0)                       as convertMaterial,                -- 转化数据-转化数
+        ifnull(sum(a.cost),0)                              as cost,                           -- 消耗
+        ifnull(sum(a.active),0)                            as active,                         -- 应用下载-激活
+        ifnull(sum(a.download_finish),0)                   as downloadFinish,                 -- 应用下载-安卓下载完成
+        ifnull(sum(a.download_start),0)                    as downloadStart,                  -- 应用下载-安卓下载开始
+		ifnull(sum(a.click_install),0)                     as clickInstall,                   -- 应用下载-点击安装数
+		ifnull(sum(a.install_finish),0)                    as installFinish,                  -- 应用下载-安卓安装完成
+		ifnull(sum(a.register),0)                          as register,                       -- 应用下载-注册
+        ifnull(sum(a.pay_count),0)                         as payCount,                       -- 应用下载-付费数
+		ifnull(sum(a.form),0)                              as form,                           --  表单提交数
+		ifnull(sum(a.total_play),0)                        as totalPlay,                      -- 视频-总播放
+        ifnull(sum(a.valid_play),0)                        as validPlay,                      -- 视频-有效播放
+        ifnull(sum(a.wifi_play),0)                         as wifiPlay,                       -- 视频-wifi播放
+        ifnull(sum(a.play25_feed_break),0)                 as play25FeedBreak,                -- 视频-播放25%进度总数
+        ifnull(sum(a.play50_feed_break),0)                 as play50FeedBreak,                -- 视频-播放50%进度总数
+        ifnull(sum(a.play75_feed_break),0)                 as play75FeedBreak,                -- 视频-播放75%进度总数
+        ifnull(sum(a.play100_feed_break),0)                as play100FeedBreak,               -- 视频-播放100%进度总数
+		ifnull(sum(a.share),0)                             as shareMaterial,                  -- 互动数据-分享数
+		ifnull(sum(a.like_num),0)                          as likeMaterial,                   -- 互动数据-点赞数
+		case
+        when sum(a.total_play) != 0 and sum(a.total_play) is not null and sum(a.play25_feed_break) is not null
+        then round(sum(a.play25_feed_break) / sum(a.total_play),2)
+        else 0 end                               as play25FeedBreakRate,            -- 25%进度播放率
+		case
+        when sum(a.click) != 0 and sum(a.click) is not null and sum(a.convert_num) is not null
+        then round(sum(a.convert_num) / sum(a.click),2)
+        else 0 end                               as convertRate,                    -- 转化率  转化数/点击数*100% !
+        case
+        when sum(a.convert_num) != 0 and sum(a.convert_num) is not null and sum(a.cost) is not null
+        then round(sum(a.cost)/sum(a.convert_num),2)
+        else 0 end as convertCost, --  转化数据-转化成本=总花费/转化数
+		ifnull(sum(a.follow),0)                            as follow,                         -- 互动数据-新增关注数
+        ifnull(sum(a.next_day_open),0)                     as nextDayOpen,                    -- 次留数
+        case
+        when sum(a.active) != 0 and sum(a.next_day_open) is not null and sum(a.active) is not null
+        then round(sum(a.next_day_open) / sum(a.active),2)
+        else 0 end                               as nextDayOpenRate,                -- 次留率 = 次留数/激活数
+        case
+        when sum(a.next_day_open) != 0 and sum(a.next_day_open) is not null and sum(a.cost) is not null
+        then round(sum(a.cost) / sum(a.next_day_open),2)
+        else 0 end                               as nextDayOpenCost,                -- 次留成本 = 消耗/次留数
+		case
+        when sum(a.click) != 0 and sum(a.click) is not null and sum(a.cost) is not null
+        then round(sum(a.cost) / sum(a.click),2)
+        else 0 end                               as cpc,                            -- 平均点击单价
+        case
+        when sum(a.show_num) != 0 and sum(a.show_num) is not null and sum(a.click) is not null
+        then round(sum(a.click) / sum(a.show_num),2)
+        else 0 end                               as ctr,                            -- 展现数据-点击率   广告被点击的次数占展示次数的百分比。计算方法:点击数/展示数*100%
+        case
+        when sum(a.show_num) != 0 and sum(a.cost) is not null and sum(a.show_num) is not null
+        then round(sum(a.cost) / sum(a.show_num) * 1000,2)
+        else 0 end                               as cpm,                            -- 平均千次展现费用  广告平均每一千次展现所付出的费用,计算公式是:总花费/展示数*1000。
+		case
+        when sum(a.active) != 0 and sum(a.cost) is not null and sum(a.active) is not null
+        then round(sum(a.cost) / sum(a.active),2)
+        else 0 end                               as activeCost,                     -- 应用下载广告数据-激活成本  计算方式:总花费/激活数。
+		case
+        when sum(a.click) != 0 and sum(a.active) is not null and sum(a.click) is not null
+        then round(sum(a.active) / sum(a.click),2)
+        else 0 end                               as activeRate,                     -- 应用下载广告数据-激活率   计算方式:激活数/点击数*100%
+        case
+        when sum(a.active) != 0 and sum(a.register) is not null and sum(a.active) is not null
+        then round(sum(a.register) / sum(a.active),2)
+        else 0 end                               as activeRegisterRate,             -- 应用下载广告数据-注册率   注册用户占激活用户的比例
+        case
+        when sum(a.register) != 0 and sum(a.cost) is not null and sum(a.register) is not null
+        then round(sum(a.cost) / sum(a.register),2)
+        else 0 end                               as activeRegisterCost               -- 应用下载广告数据-注册成本  总花费/注册数,当天数据可能会有波动,次日早8点后稳定。
+    </sql>
+
+    <select id="getBytedanceAccountInfoByProjectId" resultType="cn.com.ctop.toutiao.modules.report.DTO.ByteDanceReportAccountDailyDTO">
+        select * from (
+        select
+        concat(#{startDate},'~',#{endDate}) as statDate,
+        a.advertiser_id as 'accountId',
+        c.advertiser_id as 'advertiserId',
+        c.advertiser_name as 'advertiserName',
+        c.responsible_name as 'responsibleName',
+        c.design_responsible_name as 'designResponsibleName',
+        b.auth_name as 'authName',
+        b.project_id as 'projectId',
+        b.project_name as 'projectName',
+        c.media_id as 'mediaId',
+        <include refid="selectSql"></include>
+        from
+        ctop_bytedance_report_advertiser_daily a
+        left join (select * from ctop_user_allocation group by account_id) b on a.advertiser_id = b.account_id
+        left join ctop_project c on b.project_id = c.id
+        where
+        date_format(a.stat_datetime,'%Y-%m-%d') &gt;= #{startDate}
+        and
+        date_format(a.stat_datetime,'%Y-%m-%d') &lt;= #{endDate}
+        <if test="projectId!=null and projectId!=''">
+            and
+            b.project_id = #{projectId}
+        </if>
+        <if test="accountIds !=null">
+            and a.advertiser_id in
+            <foreach collection="accountIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        group by a.advertiser_id
+        order by sum(a.cost) desc
+        )m
+        <if test="yn =1">
+            where
+            m.cost != 0
+        </if>
+    </select>
+
+    <select id="getBytedanceProjectInfo" resultType="cn.com.ctop.toutiao.modules.report.DTO.ByteDanceReportAccountDailyDTO">
+        select * from (
+        select
+        concat(#{startDate},'~',#{endDate}) as statDate,
+        a.advertiser_id as 'accountId',
+        c.advertiser_id as 'advertiserId',
+        c.advertiser_name as 'advertiserName',
+        c.responsible_name as 'responsibleName',
+        c.design_responsible_name as 'designResponsibleName',
+        b.auth_name as 'authName',
+        b.project_id as 'projectId',
+        b.project_name as 'projectName',
+        c.media_id as 'mediaId',
+        <include refid="selectSql"></include>
+        from
+        ctop_bytedance_report_advertiser_daily a
+        left join (select * from ctop_user_allocation group by account_id) b on a.advertiser_id = b.account_id
+        left join ctop_project c on b.project_id = c.id
+        where
+        date_format(a.stat_datetime, '%Y-%m-%d') &gt;= #{startDate}
+        and
+        date_format(a.stat_datetime, '%Y-%m-%d') &lt;= #{endDate}
+        and
+        b.project_id in
+        <foreach collection="projectList" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+        group by b.project_id
+        )m
+        <if test="yn = 1">
+            where
+            m.cost != 0
+        </if>
+    </select>
+
+    <select id="getRoleCodeByUserId" resultType="string">
+        select
+        role_code
+        from
+        sys_user_role a
+        left join sys_role b on a.role_id = b.id
+        where a.user_id = #{userId}
+    </select>
+
+    <select id="queryProjectInfoByAdmin" resultType="long">
+        select
+        id as projectId
+        -- project_name as projectName,
+        -- advertiser_id as advertiserId,
+        -- advertiser_name as advertiserName,
+        -- responsible_name as responsibleName,
+        -- media_id as mediaId
+        from
+        ctop_project
+        where
+        media_id in
+        <foreach collection="mediaIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+    </select>
+
+    <select id="getSaleProjects" resultType="long">
+        select
+        distinct a.id as projectId
+        -- a.project_name as projectName,
+        -- a.advertiser_id as advertiserId,
+        -- a.advertiser_name as advertiserName,
+        -- a.media_id as mediaId,
+        -- a.sale_id as saleId,
+        -- b.realname as saleName
+        from
+        ctop_project a
+        left join sys_user b on a.sale_id = b.id
+        where a.sale_id = #{userId}
+        and a.media_id in
+        <foreach collection="mediaIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+    </select>
+
+    <select id="queryProjectMemberByIds" resultType="cn.com.ctop.toutiao.modules.report.DTO.ByteDanceReportAccountDailyDTO">
+        select
+        distinct id as projectId,
+        project_name as projectName,
+        advertiser_id as advertiserId,
+        advertiser_name as advertiserName,
+        media_id as mediaId,
+        responsible_name as responsibleName,
+        design_responsible_name as designResponsibleName
+        from
+        left join ctop_project
+        where
+        id in
+        <foreach collection="projectIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+        order by create_time desc
+    </select>
+
+    <select id="getUserProjectAccountIds" resultType="long">
+        select
+        a.account_id
+        from
+        (select project_id,account_id,media_id,create_time from ctop_user_allocation  group by account_id) a
+        left join ctop_project_member b on a.project_id=b.project_id
+        where
+        a.user_id = #{userId}
+        and a.media_id in (1,3)
+        order by a.create_time desc
+        limit 50
+    </select>
+
+
+    <select id="getSaleProjectAccountIds" resultType="long">
+        select
+        a.account_id
+        from
+        (select project_id,account_id,media_id,create_time from ctop_user_allocation  group by account_id) a
+        left join ctop_project b on a.project_id=b.id
+        where
+        b.sale_id = #{userId}
+        and b.media_id in (1,3)
+        order by a.create_time desc
+        limit 50
+    </select>
+
+    <select id="getUserProjectAccountIdsByAdmin" resultType="long">
+        select
+        a.account_id
+        from
+        ctop_user_allocation a
+        left join ctop_project b on a.project_id = b.id
+        where
+        b.media_id in (1,3)
+        limit 50
+    </select>
+
 </mapper>

+ 10 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IBytedanceAccountReportService.java

@@ -1,7 +1,9 @@
 package cn.com.ctop.toutiao.modules.report.service;
 
+import cn.com.ctop.toutiao.modules.report.DTO.ByteDanceReportAccountDailyDTO;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.github.pagehelper.PageInfo;
 
 import java.math.BigDecimal;
 import java.text.ParseException;
@@ -17,4 +19,12 @@ public interface IBytedanceAccountReportService {
     List<JSONObject> getListDataBy(String mediaId,BigDecimal discount, JSONArray accounts,String startDate ,String endDate, int hour, String target, String order);
 
     List<JSONObject> getExcelDataBy(String filed, String mediaId, JSONArray accounts,String startDate ,String endDate, int hour, String target, String order);
+
+    //List<ByteDanceReportAccountDailyDTO> getBytedanceSaleProjectInfo(String startDate, String endDate, List<Long> projectList);
+
+    PageInfo<ByteDanceReportAccountDailyDTO> getBytedanceAccountInfoByProjectId(String startDate, String endDate, Long projectId, Integer pageNo, Integer pageSize, String sort, Integer yn);
+
+    PageInfo<ByteDanceReportAccountDailyDTO> getBytedanceSaleProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageNum, Integer pageSize, String sort, Integer yn);
+
+    //List<ByteDanceReportAccountDailyDTO> getBytedanceSaleProjectInfo(String startDate, String endDate, Long projectId, int pageNum, int pageSize, String sort);
 }

+ 62 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceAccountReportServiceImpl.java

@@ -1,12 +1,18 @@
 package cn.com.ctop.toutiao.modules.report.service.impl;
 
 import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.toutiao.modules.report.DTO.ByteDanceReportAccountDailyDTO;
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceAccountReportMapper;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceAccountReportService;
-import cn.com.ctop.toutiao.modules.utils.LinkUtils;
+import cn.com.ctop.toutiao.modules.report.utils.LinkUtils;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.apache.commons.lang.StringUtils;
+import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.constant.SystemDateConstant;
+import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.JsonResourceUtil;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -181,4 +187,59 @@ public class BytedanceAccountReportServiceImpl implements IBytedanceAccountRepor
         });
         return jsonObject;
     }
+
+    @Override
+    public PageInfo<ByteDanceReportAccountDailyDTO> getBytedanceSaleProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageNum, Integer pageSize, String sort, Integer yn){
+        //List<ByteDanceReportAccountDailyDTO> list = new ArrayList<>();
+
+        if(projectList==null || projectList.size()==0){
+            LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+            String userId = sysUser.getId();
+            //String userId = "388e787edd294ecfb9243fe176a3ae56";
+            String roleCode = bytedanceAccountReportMapper.getRoleCodeByUserId(userId);
+
+            List<Long> mediaIds = new ArrayList<>();
+            mediaIds.add(1L);
+            mediaIds.add(3L);
+
+            if("admin".equals(roleCode)){
+                projectList = bytedanceAccountReportMapper.queryProjectInfoByAdmin(mediaIds);
+            }else{
+                projectList = bytedanceAccountReportMapper.getSaleProjects(userId,mediaIds);
+            }
+        }
+
+        PageHelper.startPage(pageNum,pageSize);
+        List<ByteDanceReportAccountDailyDTO> p = bytedanceAccountReportMapper.getBytedanceProjectInfo(startDate, endDate, projectList, yn);
+
+        return new PageInfo<>(p);
+    }
+
+    @Override
+    public PageInfo<ByteDanceReportAccountDailyDTO> getBytedanceAccountInfoByProjectId(String startDate, String endDate, Long projectId, Integer pageNo, Integer pageSize, String sort, Integer yn){
+
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        //String userId = "e9ca23d68d884d4ebb19d07889727dae";
+        String userId = sysUser.getId();
+        String roleCode = bytedanceAccountReportMapper.getRoleCodeByUserId(userId);
+
+        List<Long> accountIds = null;
+        if(projectId == null){
+            if("admin".equals(roleCode)){
+                accountIds = bytedanceAccountReportMapper.getUserProjectAccountIdsByAdmin();
+            }else {
+                accountIds = bytedanceAccountReportMapper.getSaleProjectAccountIds(userId);
+            }
+        }
+
+        if(StringUtils.isBlank(sort)){
+            sort = "cost-";
+        }
+        sort = sort.replace("-", " desc,").replace("+", " asc,");  //sort=id-name+age+
+        sort = sort.substring(0, sort.length() - 1);
+        PageHelper.startPage(pageNo,pageSize,sort);
+        return new PageInfo<>(bytedanceAccountReportMapper.getBytedanceAccountInfoByProjectId(startDate,endDate,projectId,accountIds,yn));
+    }
+
+
 }

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceHomepageReportServiceImpl.java

@@ -2,7 +2,7 @@ package cn.com.ctop.toutiao.modules.report.service.impl;
 
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceHomepageMapper;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceHomepageReportService;
-import cn.com.ctop.toutiao.modules.utils.LinkUtils;
+import cn.com.ctop.toutiao.modules.report.utils.LinkUtils;
 import com.alibaba.fastjson.JSONObject;
 import org.jeecg.common.constant.SystemDateConstant;
 import org.jeecg.common.util.DateUtils;

+ 251 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/utils/ApkUtils.java

@@ -0,0 +1,251 @@
+package cn.com.ctop.toutiao.modules.report.utils;
+
+import android.util.TypedValue;
+import brut.androlib.res.decoder.AXmlResourceParser;
+import com.dd.plist.NSArray;
+import com.dd.plist.NSDictionary;
+import com.dd.plist.NSString;
+import com.dd.plist.PropertyListParser;
+import org.xmlpull.v1.XmlPullParser;
+
+import java.io.*;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+import java.util.zip.ZipInputStream;
+
+public class ApkUtils {
+    /**
+     * 读取apk
+     * @param apkUrl
+     * @return
+     */
+    public static Map<String,Object> readAPK(String apkUrl){
+        ZipFile zipFile;
+        Map<String,Object> map = new HashMap<String, Object>();
+        try {
+            zipFile = new ZipFile(apkUrl);
+            Enumeration<?> enumeration = zipFile.entries();
+            ZipEntry zipEntry = null;
+            while (enumeration.hasMoreElements()) {
+                zipEntry = (ZipEntry) enumeration.nextElement();
+                if (zipEntry.isDirectory()) {
+
+                } else {
+                    if ("androidmanifest.xml".equals(zipEntry.getName().toLowerCase())) {
+                        AXmlResourceParser parser = new AXmlResourceParser();
+                        parser.open(zipFile.getInputStream(zipEntry));
+                        while (true) {
+                            int type = parser.next();
+                            if (type == XmlPullParser.END_DOCUMENT) {
+                                break;
+                            }
+                            String name = parser.getName();
+                            if(null != name && name.toLowerCase().equals("manifest")){
+                                for (int i = 0; i != parser.getAttributeCount(); i++) {
+                                    if ("versionName".equals(parser.getAttributeName(i))) {
+                                        String versionName = getAttributeValue(parser, i);
+                                        if(null == versionName){
+                                            versionName = "";
+                                        }
+                                        map.put("versionName", versionName);
+                                    } else if ("package".equals(parser.getAttributeName(i))) {
+                                        String packageName = getAttributeValue(parser, i);
+                                        if(null == packageName){
+                                            packageName = "";
+                                        }
+                                        map.put("package", packageName);
+                                    } else if("versionCode".equals(parser.getAttributeName(i))){
+                                        String versionCode = getAttributeValue(parser, i);
+                                        if(null == versionCode){
+                                            versionCode = "";
+                                        }
+                                        map.put("versionCode", versionCode);
+                                    }
+                                }
+                                break;
+                            }
+                        }
+                    }
+
+                }
+            }
+            zipFile.close();
+        } catch (Exception e) {
+            map.put("code", "fail");
+            map.put("error","读取apk失败");
+        }
+        return map;
+    }
+
+    private static String getAttributeValue(AXmlResourceParser parser, int index) {
+        int type = parser.getAttributeValueType(index);
+        int data = parser.getAttributeValueData(index);
+        if (type == TypedValue.TYPE_STRING) {
+            return parser.getAttributeValue(index);
+        }
+        if (type == TypedValue.TYPE_ATTRIBUTE) {
+            return String.format("?%s%08X", getPackage(data), data);
+        }
+        if (type == TypedValue.TYPE_REFERENCE) {
+            return String.format("@%s%08X", getPackage(data), data);
+        }
+        if (type == TypedValue.TYPE_FLOAT) {
+            return String.valueOf(Float.intBitsToFloat(data));
+        }
+        if (type == TypedValue.TYPE_INT_HEX) {
+            return String.format("0x%08X", data);
+        }
+        if (type == TypedValue.TYPE_INT_BOOLEAN) {
+            return data != 0 ? "true" : "false";
+        }
+        if (type == TypedValue.TYPE_DIMENSION) {
+            return Float.toString(complexToFloat(data)) + DIMENSION_UNITS[data & TypedValue.COMPLEX_UNIT_MASK];
+        }
+        if (type == TypedValue.TYPE_FRACTION) {
+            return Float.toString(complexToFloat(data)) + FRACTION_UNITS[data & TypedValue.COMPLEX_UNIT_MASK];
+        }
+        if (type >= TypedValue.TYPE_FIRST_COLOR_INT && type <= TypedValue.TYPE_LAST_COLOR_INT) {
+            return String.format("#%08X", data);
+        }
+        if (type >= TypedValue.TYPE_FIRST_INT && type <= TypedValue.TYPE_LAST_INT) {
+            return String.valueOf(data);
+        }
+        return String.format("<0x%X, type 0x%02X>", data, type);
+    }
+
+    private static String getPackage(int id) {
+        if (id >>> 24 == 1) {
+            return "android:";
+        }
+        return "";
+    }
+
+    // ///////////////////////////////// ILLEGAL STUFF, DONT LOOK :)
+    public static float complexToFloat(int complex) {
+        return (float) (complex & 0xFFFFFF00) * RADIX_MULTS[(complex >> 4) & 3];
+    }
+
+    private static final float RADIX_MULTS[] =
+            {
+                    0.00390625F, 3.051758E-005F,
+                    1.192093E-007F, 4.656613E-010F
+            };
+    private static final String DIMENSION_UNITS[] = { "px", "dip", "sp", "pt", "in", "mm", "", "" };
+    private static final String FRACTION_UNITS[] = { "%", "%p", "", "", "", "", "", "" };
+
+    /**
+     * 读取ipa
+     */
+    public static Map<String,Object> readIPA(String ipaURL){
+        Map<String,Object> map = new HashMap<String,Object>();
+        try {
+            File file = new File(ipaURL);
+            InputStream is = new FileInputStream(file);
+            InputStream is2 = new FileInputStream(file);
+            ZipInputStream zipIns = new ZipInputStream(is);
+            ZipInputStream zipIns2 = new ZipInputStream(is2);
+            ZipEntry ze;
+            ZipEntry ze2;
+            InputStream infoIs = null;
+            NSDictionary rootDict = null;
+            String icon = null;
+            while ((ze = zipIns.getNextEntry()) != null) {
+                if (!ze.isDirectory()) {
+                    String name = ze.getName();
+                    if (null != name &&
+                            name.toLowerCase().contains(".app/info.plist")) {
+                        ByteArrayOutputStream _copy = new
+                                ByteArrayOutputStream();
+                        int chunk = 0;
+                        byte[] data = new byte[1024];
+                        while(-1!=(chunk=zipIns.read(data))){
+                            _copy.write(data, 0, chunk);
+                        }
+                        infoIs = new ByteArrayInputStream(_copy.toByteArray());
+                        rootDict = (NSDictionary) PropertyListParser.parse(infoIs);
+
+                        //我们可以根据info.plist结构获取任意我们需要的东西
+                        //比如下面我获取图标名称,图标的目录结构请下面图片
+                        //获取图标名称
+                        NSDictionary iconDict = (NSDictionary) rootDict.get("CFBundleIcons");
+
+                        while (null != iconDict) {
+                            if(iconDict.containsKey("CFBundlePrimaryIcon")){
+                                NSDictionary CFBundlePrimaryIcon = (NSDictionary)iconDict.get("CFBundlePrimaryIcon");
+                                if(CFBundlePrimaryIcon.containsKey("CFBundleIconFiles")){
+                                    NSArray CFBundleIconFiles =(NSArray)CFBundlePrimaryIcon.get("CFBundleIconFiles");
+                                    icon = CFBundleIconFiles.getArray()[0].toString();
+                                    if(icon.contains(".png")){
+                                        icon = icon.replace(".png", "");
+                                    }
+                                    System.out.println("获取icon名称:" + icon);
+                                    break;
+                                }
+                            }
+                        }
+                        break;
+                    }
+                }
+            }
+
+            //根据图标名称下载图标文件到指定位置
+            while ((ze2 = zipIns2.getNextEntry()) != null) {
+                if (!ze2.isDirectory()) {
+                    String name = ze2.getName();
+                    System.out.println(name);
+                    if(name.contains(icon.trim())){
+                        System.out.println(11111);
+                        FileOutputStream fos = new FileOutputStream(new File("E:\\python\\img\\icon.png"));
+                        int chunk = 0;
+                        byte[] data = new byte[1024];
+                        while(-1!=(chunk=zipIns2.read(data))){
+                            fos.write(data, 0, chunk);
+                        }
+                        fos.close();
+                        break;
+                    }
+                }
+            }
+
+            ////////////////////////////////////////////////////////////////
+            //如果想要查看有哪些key ,可以把下面注释放开
+//            for (String keyName : rootDict.allKeys()) {
+//				System.out.println(keyName + ":" + rootDict.get(keyName).toString());
+//			  }
+
+
+            // 应用包名
+            NSString parameters = (NSString) rootDict.get("CFBundleIdentifier");
+            map.put("package", parameters.toString());
+            // 应用版本名
+            parameters = (NSString) rootDict.objectForKey("CFBundleShortVersionString");
+            map.put("versionName", parameters.toString());
+            //应用版本号
+            parameters = (NSString) rootDict.get("CFBundleVersion");
+            map.put("versionCode", parameters.toString());
+
+            /////////////////////////////////////////////////
+            infoIs.close();
+            is.close();
+            zipIns.close();
+
+        } catch (Exception e) {
+            map.put("code", "fail");
+            map.put("error","读取ipa文件失败");
+        }
+        return map;
+    }
+
+
+    public static void main(String[] args) {
+        System.out.println("======apk=========");
+        String apkUrl = "D:\\data\\YouYuan_1119929.apk";
+        Map<String,Object> mapApk = ApkUtils.readAPK(apkUrl);
+        for (String key : mapApk.keySet()) {
+            System.out.println(key + ":" + mapApk.get(key));
+        }
+    }
+}

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/utils/LinkUtils.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.modules.utils;
+package cn.com.ctop.toutiao.modules.report.utils;
 
 import com.alibaba.fastjson.JSONObject;
 

+ 0 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/tool/constants/QueryToolUrlConstant.java


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff