Pārlūkot izejas kodu

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

zhaoxian 4 gadi atpakaļ
vecāks
revīzija
c1b9b34792
40 mainītis faili ar 1573 papildinājumiem un 536 dzēšanām
  1. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  2. 15 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AiKuaishouAdvertiserStrategyController.java
  3. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java
  4. 15 15
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/MaterialReportOverViewMapper.xml
  5. 63 58
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/LoginController.java
  6. 2 2
      jeecg-boot-module-system/src/main/resources/application-dev.yml
  7. 2 2
      jeecg-boot-module-system/src/main/resources/application-prod.yml
  8. 6 6
      jeecg-boot-module-system/src/main/resources/application-test.yml
  9. 11 11
      jeecg-boot-module-system/src/main/resources/application-wps.yml
  10. 1 0
      jeecg-boot-module-system/src/main/resources/application.yml
  11. 17 15
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  12. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/entity/SysUserDepart.java
  13. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml
  14. 2 2
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/SysDepartServiceImpl.java
  15. 4 0
      module-ctop/src/main/java/cn/com/ctop/manage/modules/material/service/impl/MaterialUploadServiceImpl.java
  16. 3 3
      module-job-bytedance/src/main/resources/application-prod.yml
  17. 11 0
      module-job-bytedance/src/main/resources/application.yml
  18. 2 2
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouCreateUnitJob.java
  19. 1 1
      module-job-kuaishou/src/main/resources/application-prod.yml
  20. 12 1
      module-job-kuaishou/src/main/resources/application.yml
  21. 257 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/KuaiShouAppMultipleBidsController.java
  22. 7 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouAdvertiserStrategy.java
  23. 135 68
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouCreativeLevelOperationRecord.java
  24. 295 148
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouUnitLevelOperationRecord.java
  25. 79 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/KuaiShouAppMultipleBids.java
  26. 21 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/KuaiShouAppMultipleBidsMapper.java
  27. 36 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/KuaiShouAppMultipleBidsMapper.xml
  28. 21 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IKuaiShouAppMultipleBidsService.java
  29. 379 164
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreateCreativeServiceImpl.java
  30. 48 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaiShouAppMultipleBidsServiceImpl.java
  31. 1 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouAppListService.java
  32. 10 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouAppListServiceImpl.java
  33. 4 4
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupTemplateServiceImpl.java
  34. 3 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  35. 18 18
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KsNewGroupReportCtrl.java
  36. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouAccountMaterialReportDailyMapper.xml
  37. 8 11
      module-kuaishou/src/main/resources/kuaishou_config.properties
  38. 2 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/constant/QYWxConstant.java
  39. 9 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/IAppchatCreateService.java
  40. 67 0
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/AppchatCreateServiceImpl.java

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

@@ -198,6 +198,7 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/ai/create/*", "anon");
         //filterChainDefinitionMap.put("/overView/*", "anon");
         filterChainDefinitionMap.put("/kuaishouCrowdPack/**", "anon");
+        filterChainDefinitionMap.put("/kuaishou/batch/*", "anon");
 
         // 添加自己的过滤器并且取名为jwt
         Map<String, Filter> filterMap = new HashMap<>(1);

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

@@ -3,13 +3,16 @@ package org.jeecg.modules.ctop.controller;
 import cn.com.ctop.common.module.constant.CtopRoleCodeConstant;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.service.IUserAllocationService;
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.QueryGenerator;
 import cn.com.ctop.common.module.utils.ResultMapUtils;
 import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAdvertiserStrategy;
 import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAdvertiserStrategyService;
+import cn.com.ctop.kuaishou.modules.ai.service.IKuaiShouAppMultipleBidsService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouVideoRelateCreativesService;
 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;
@@ -43,6 +46,8 @@ public class AiKuaishouAdvertiserStrategyController {
     private IUserAllocationService allocationService;
     @Autowired
     private ISysRoleService sysRoleService;
+    @Autowired
+    private IKuaiShouAppMultipleBidsService kuaiShouAppMultipleBidsService;
 
     /**
      * 分页列表查询
@@ -254,6 +259,8 @@ public class AiKuaishouAdvertiserStrategyController {
      * @param id
      * @return
      */
+
+
     @GetMapping(value = "/queryById")
     public Result<AiKuaishouAdvertiserStrategy> queryById(@RequestParam(name = "id", required = true) String id) {
         Result<AiKuaishouAdvertiserStrategy> result = new Result<>();
@@ -261,6 +268,14 @@ public class AiKuaishouAdvertiserStrategyController {
         if (aiKuaishouAdvertiserStrategy == null) {
             result.error500("未找到对应实体");
         } else {
+            if (aiKuaishouAdvertiserStrategy.getMultipleBids() == 1) {
+                List<JSONObject> appInfoList = kuaiShouAppMultipleBidsService.getAppInfiList(aiKuaishouAdvertiserStrategy.getAccountId(), aiKuaishouAdvertiserStrategy.getAppIdArray());
+                if (!Check.isNull(appInfoList)) {
+                    aiKuaishouAdvertiserStrategy.setAppInfoList(appInfoList);
+
+                }
+            }
+
             result.setResult(aiKuaishouAdvertiserStrategy);
             result.setSuccess(true);
         }

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

@@ -64,6 +64,8 @@ public class CallbackController {
                         HttpServletResponse response,
                         @RequestParam("code") String code,
                         @RequestParam("state") String state) throws IOException {
+        System.err.println("code:" + code);
+        System.err.println("state:" + state);
         response.sendRedirect(state + "?code=" + code);
     }
 

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

@@ -88,7 +88,7 @@
                 #{item}
             </foreach>
         </if>
-        AND stat_datetime >= #{startDate}
+        AND stat_datetime &gt;= #{startDate}
         AND stat_datetime &lt;= #{endDate}
     </select>
 
@@ -106,7 +106,7 @@
                 #{item}
             </foreach>
         </if>
-        AND stat_date >= #{startDate}
+        AND stat_date &gt;= #{startDate}
         AND stat_date &lt;= #{endDate}
     </select>
 
@@ -122,7 +122,7 @@
                 #{item}
             </foreach>
         </if>
-        AND DATE_FORMAT(create_time, '%Y-%m-%d')>= #{startDate}
+        AND DATE_FORMAT(create_time, '%Y-%m-%d')&gt;= #{startDate}
         AND DATE_FORMAT(create_time, '%Y-%m-%d')&lt;= #{endDate}
     </select>
 
@@ -155,7 +155,7 @@
                 #{item}
             </foreach>
         </if>
-        AND stat_datetime >= #{startDate}
+        AND stat_datetime &gt;= #{startDate}
         AND stat_datetime &lt;= #{endDate}
         group by stat_datetime
         order by stat_datetime
@@ -176,7 +176,7 @@
                 #{item}
             </foreach>
         </if>
-        AND stat_datetime >= #{startDate}
+        AND stat_datetime &gt; #{startDate}
         AND stat_datetime &lt;= #{endDate}
         group by DATE_FORMAT(stat_datetime, '%Y-%m')
         order by stat_datetime asc
@@ -197,7 +197,7 @@
                 #{item}
             </foreach>
         </if>
-        AND stat_date >= #{startDate}
+        AND stat_date &gt;= #{startDate}
         AND stat_date &lt;= #{endDate}
         group by stat_date
         order by stat_date
@@ -218,7 +218,7 @@
                 #{item}
             </foreach>
         </if>
-        AND stat_date >= #{startDate}
+        AND stat_date &gt; #{startDate}
         AND stat_date &lt;= #{endDate}
         group by DATE_FORMAT(stat_date, '%Y-%m')
         order by stat_date
@@ -242,7 +242,7 @@
                 #{item}
             </foreach>
         </if>
-        AND stat_datetime >= #{startDate}
+        AND stat_datetime &gt; #{startDate}
         AND stat_datetime &lt;= #{endDate}
         AND md5!=''
         GROUP BY md5
@@ -274,7 +274,7 @@
                 #{item}
             </foreach>
         </if>
-        AND stat_datetime >= #{startDate}
+        AND stat_datetime &gt;= #{startDate}
         AND stat_datetime &lt;= #{endDate}
         GROUP BY t1.md5
         ORDER BY ${target} ${order}
@@ -298,7 +298,7 @@
                 #{item}
             </foreach>
         </if>
-        AND stat_datetime >= #{startDate}
+        AND stat_datetime &gt;= #{startDate}
         AND stat_datetime &lt;= #{endDate}
         GROUP BY t1.md5) t
     </select>
@@ -323,7 +323,7 @@
                 #{item}
             </foreach>
         </if>
-        AND t1.stat_date >= #{startDate}
+        AND t1.stat_date &gt;= #{startDate}
         AND t1.stat_date &lt;= #{endDate}
         GROUP BY t1.signature
         ORDER BY charge desc
@@ -357,7 +357,7 @@
                 #{item}
             </foreach>
         </if>
-        AND t1.stat_date >= #{startDate}
+        AND t1.stat_date &gt;= #{startDate}
         AND t1.stat_date &lt;= #{endDate}
         GROUP BY t1.signature
         ) t1
@@ -388,7 +388,7 @@
                 #{item}
             </foreach>
         </if>
-        AND t1.stat_date >= #{startDate}
+        AND t1.stat_date &gt;= #{startDate}
         AND t1.stat_date &lt;= #{endDate}
         GROUP BY t1.signature
         ) t1
@@ -418,7 +418,7 @@
         FROM
         etl_design_daily_report,(SELECT @i:=0) i
         where
-        stat_date >= #{startDate}
+        stat_date &gt;= #{startDate}
         AND stat_date &lt;= #{endDate}
         AND user_id IN
         <foreach collection="userIds" item="item" separator=","
@@ -441,7 +441,7 @@
         FROM
         etl_design_daily_report
         where
-        stat_date >= #{startDate}
+        stat_date &gt;= #{startDate}
         AND stat_date &lt;= #{endDate}
         AND user_id IN
         <foreach collection="userIds" item="item" separator=","

+ 63 - 58
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/LoginController.java

@@ -4,10 +4,7 @@ import cn.com.ctop.common.module.entity.CorpFeishuUser;
 import cn.com.ctop.common.module.entity.CtopCorpWexinUser;
 import cn.com.ctop.common.module.entity.SysDepart;
 import cn.com.ctop.common.module.entity.SysUser;
-import cn.com.ctop.common.module.service.ICorpFeishuUserService;
-import cn.com.ctop.common.module.service.ICtopCorpWexinUserService;
-import cn.com.ctop.common.module.service.ISysDepartService;
-import cn.com.ctop.common.module.service.ISysUserService;
+import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.utils.AesEncryptUtil;
 import cn.com.ctop.common.module.utils.ResultMapUtils;
 import cn.com.ctop.common.module.utils.StatusCode;
@@ -31,14 +28,12 @@ import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.constant.CacheConstant;
 import org.jeecg.common.constant.CommonConstant;
-import cn.com.ctop.common.module.service.ISysBaseApi;
 import org.jeecg.common.system.util.JwtUtil;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.*;
 import org.jeecg.common.util.encryption.EncryptedString;
 import org.jeecg.modules.shiro.vo.DefContants;
 import org.jeecg.modules.system.model.SysLoginModel;
-import cn.com.ctop.common.module.service.ISysDictService;
 import org.jeecg.modules.system.service.ISysLogService;
 import org.jeecg.modules.system.util.RandImageUtil;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -55,7 +50,7 @@ import java.util.*;
  */
 @RestController
 @RequestMapping("/sys")
-@Api(tags="用户登录")
+@Api(tags = "用户登录")
 @Slf4j
 public class LoginController {
     @Autowired
@@ -75,12 +70,13 @@ public class LoginController {
     @Autowired
     private ICtopCorpWexinUserService ctopCorpWexinUserService;
     private static final String BASE_CHECK_CODES = "qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890";
+
     @GetMapping("feishu/url")
-    public Map<String,Object> getUrl(){
-        Map<String,Object>result = new HashMap<>();
+    public Map<String, Object> getUrl() {
+        Map<String, Object> result = new HashMap<>();
         try {
             String url = AuthProvider.getAuthUrl("");
-            result.put("url",url);
+            result.put("url", url);
             ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
             return result;
         } catch (Exception e) {
@@ -89,19 +85,20 @@ public class LoginController {
             return result;
         }
     }
+
     @GetMapping("/feishu/auth")
     public Result<JSONObject> feishuAuth(HttpServletRequest request,
                                          HttpServletResponse response,
-                                         @RequestParam(name = "code",defaultValue = "code") String code,
-                                         @RequestParam(name = "state",defaultValue = "_t") String state) throws IOException {
+                                         @RequestParam(name = "code", defaultValue = "code") String code,
+                                         @RequestParam(name = "state", defaultValue = "_t") String state) throws IOException {
         Result<JSONObject> result = new Result<>();
         //1:根据code值获取用户飞书信息
         try {
-            if("code".equals(code.trim())){
+            if ("code".equals(code.trim())) {
                 JSONObject setData = new JSONObject();
                 String url = AuthProvider.getAuthUrl("");
-                setData.put("url",url);
-                setData.put("type",1);
+                setData.put("url", url);
+                setData.put("type", 1);
                 result.setResult(setData);
                 result.success("重定向");
                 return result;
@@ -113,14 +110,14 @@ public class LoginController {
             JSONObject userData = AuthProvider.getUserInfo(accessToken);
             JSONObject dataObject = userData.getJSONObject("data");
             String email = dataObject.getString("email");
-            if(null == email|| "".equals(email.trim())){
+            if (null == email || "".equals(email.trim())) {
                 return result.error500(StatusCode.CTOP_FEISHU_EMAIL_NOT_EXIST.getDesc());
             }
             SysUser sysUser = sysUserService.getUserByEmail(email);
             if (sysUser == null) {
                 return result.error500(StatusCode.CTOP_FEISHU_ACCOUNT_NOT_EXIST.getDesc());
             }
-            if(sysUser.getStatus() != 1){
+            if (sysUser.getStatus() != 1) {
                 return result.error500(StatusCode.CTOP_FEISHU_ACCOUNT_NOT_EXIST.getDesc());
             }
             String departId = sysDepartService.selectIdByOrdCode(sysUser.getOrgCode());
@@ -180,7 +177,7 @@ public class LoginController {
                     result.error500("该用户未注册系统账户,请联系管理员");
                     return result;
                 }
-                if(sysUser.getStatus() != 1){
+                if (sysUser.getStatus() != 1) {
                     result.error500("该用户已冻结,请联系管理员");
                     return result;
                 }
@@ -303,22 +300,23 @@ public class LoginController {
 
     /**
      * 退出登录
+     *
      * @param request
      * @param response
      * @return
      */
     @RequestMapping(value = "/logout")
-    public Result<Object> logout(HttpServletRequest request,HttpServletResponse response) {
+    public Result<Object> logout(HttpServletRequest request, HttpServletResponse response) {
         //用户退出逻辑
         String token = request.getHeader(DefContants.X_ACCESS_TOKEN);
-        if(oConvertUtils.isEmpty(token)) {
+        if (oConvertUtils.isEmpty(token)) {
             return Result.error("退出登录失败!");
         }
         String username = JwtUtil.getUsername(token);
         LoginUser sysUser = sysBaseApi.getUserByName(username);
-        if(sysUser!=null) {
-            sysBaseApi.addLog("用户名: "+sysUser.getRealname()+",退出成功!", CommonConstant.LOG_TYPE_1, null);
-            log.info(" 用户名:  "+sysUser.getRealname()+",退出成功! ");
+        if (sysUser != null) {
+            sysBaseApi.addLog("用户名: " + sysUser.getRealname() + ",退出成功!", CommonConstant.LOG_TYPE_1, null);
+            log.info(" 用户名:  " + sysUser.getRealname() + ",退出成功! ");
             //清空用户登录Token缓存
             redisUtil.del(CommonConstant.PREFIX_USER_TOKEN + token);
             //清空用户登录Shiro权限缓存
@@ -328,13 +326,14 @@ public class LoginController {
             //调用shiro的logout
             SecurityUtils.getSubject().logout();
             return Result.ok("退出登录成功!");
-        }else {
+        } else {
             return Result.error("Token无效!");
         }
     }
 
     /**
      * 获取访问量
+     *
      * @return
      */
     @GetMapping("loginfo")
@@ -354,9 +353,9 @@ public class LoginController {
         // 获取系统访问记录
         Long totalVisitCount = logService.findTotalVisitCount();
         obj.put("totalVisitCount", totalVisitCount);
-        Long todayVisitCount = logService.findTodayVisitCount(dayStart,dayEnd);
+        Long todayVisitCount = logService.findTodayVisitCount(dayStart, dayEnd);
         obj.put("todayVisitCount", todayVisitCount);
-        Long todayIp = logService.findTodayIp(dayStart,dayEnd);
+        Long todayIp = logService.findTodayIp(dayStart, dayEnd);
         //update-end--Author:zhangweijian  Date:20190428 for:传入开始时间,结束时间参数
         obj.put("todayIp", todayIp);
         result.setResult(obj);
@@ -366,21 +365,22 @@ public class LoginController {
 
     /**
      * 获取访问量
+     *
      * @return
      */
     @GetMapping("visitInfo")
-    public Result<List<Map<String,Object>>> visitInfo() {
-        Result<List<Map<String,Object>>> result = new Result<List<Map<String,Object>>>();
+    public Result<List<Map<String, Object>>> visitInfo() {
+        Result<List<Map<String, Object>>> result = new Result<List<Map<String, Object>>>();
         Calendar calendar = new GregorianCalendar();
-        calendar.set(Calendar.HOUR_OF_DAY,0);
-        calendar.set(Calendar.MINUTE,0);
-        calendar.set(Calendar.SECOND,0);
-        calendar.set(Calendar.MILLISECOND,0);
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        calendar.set(Calendar.MILLISECOND, 0);
         calendar.add(Calendar.DAY_OF_MONTH, 1);
         Date dayEnd = calendar.getTime();
         calendar.add(Calendar.DAY_OF_MONTH, -7);
         Date dayStart = calendar.getTime();
-        List<Map<String,Object>> list = logService.findVisitCount(dayStart, dayEnd);
+        List<Map<String, Object>> list = logService.findVisitCount(dayStart, dayEnd);
         result.setResult(oConvertUtils.toLowerCasePageList(list));
         return result;
     }
@@ -388,6 +388,7 @@ public class LoginController {
 
     /**
      * 登陆成功选择用户当前部门
+     *
      * @param user
      * @return
      */
@@ -395,11 +396,11 @@ public class LoginController {
     public Result<JSONObject> selectDepart(@RequestBody SysUser user) {
         Result<JSONObject> result = new Result<JSONObject>();
         String username = user.getUsername();
-        if(oConvertUtils.isEmpty(username)) {
-            LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
+        if (oConvertUtils.isEmpty(username)) {
+            LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
             username = sysUser.getUsername();
         }
-        String orgCode= user.getOrgCode();
+        String orgCode = user.getOrgCode();
         this.sysUserService.updateUserDepart(username, orgCode);
         SysUser sysUser = sysUserService.getUserByName(username);
         JSONObject obj = new JSONObject();
@@ -419,9 +420,9 @@ public class LoginController {
         Result<String> result = new Result<String>();
         String mobile = jsonObject.get("mobile").toString();
         //手机号模式 登录模式: "2"  注册模式: "1"
-        String smsmode=jsonObject.get("smsmode").toString();
+        String smsmode = jsonObject.get("smsmode").toString();
         log.info(mobile);
-        if(oConvertUtils.isEmpty(mobile)){
+        if (oConvertUtils.isEmpty(mobile)) {
             result.setMessage("手机号不允许为空!");
             result.setSuccess(false);
             return result;
@@ -442,17 +443,17 @@ public class LoginController {
             //注册模板
             if (CommonConstant.SMS_TPL_TYPE_1.equals(smsmode)) {
                 SysUser sysUser = sysUserService.getUserByPhone(mobile);
-                if(sysUser!=null) {
+                if (sysUser != null) {
                     result.error500(" 手机号已经注册,请直接登录!");
                     sysBaseApi.addLog("手机号已经注册,请直接登录!", CommonConstant.LOG_TYPE_1, null);
                     return result;
                 }
                 b = DySmsHelper.sendSms(mobile, obj, DySmsEnum.REGISTER_TEMPLATE_CODE);
-            }else {
+            } else {
                 //登录模式,校验用户有效性
                 SysUser sysUser = sysUserService.getUserByPhone(mobile);
                 result = sysUserService.checkUserIsEffective(sysUser);
-                if(!result.isSuccess()) {
+                if (!result.isSuccess()) {
                     return result;
                 }
 
@@ -462,7 +463,7 @@ public class LoginController {
                 if (CommonConstant.SMS_TPL_TYPE_0.equals(smsmode)) {
                     //登录模板
                     b = DySmsHelper.sendSms(mobile, obj, DySmsEnum.LOGIN_TEMPLATE_CODE);
-                } else if(CommonConstant.SMS_TPL_TYPE_2.equals(smsmode)) {
+                } else if (CommonConstant.SMS_TPL_TYPE_2.equals(smsmode)) {
                     //忘记密码模板
                     b = DySmsHelper.sendSms(mobile, obj, DySmsEnum.FORGET_PASSWORD_TEMPLATE_CODE);
                 }
@@ -504,7 +505,7 @@ public class LoginController {
         //校验用户有效性
         SysUser sysUser = sysUserService.getUserByPhone(phone);
         result = sysUserService.checkUserIsEffective(sysUser);
-        if(!result.isSuccess()) {
+        if (!result.isSuccess()) {
             return result;
         }
 
@@ -537,7 +538,7 @@ public class LoginController {
         String token = JwtUtil.sign(username, syspassword);
         // 设置token缓存有效时间
         redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
-        redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME*2 / 1000);
+        redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME * 2 / 1000);
 
         // 获取用户部门信息
         JSONObject obj = new JSONObject();
@@ -561,29 +562,31 @@ public class LoginController {
 
     /**
      * 获取加密字符串
+     *
      * @return
      */
     @GetMapping(value = "/getEncryptedString")
-    public Result<Map<String,String>> getEncryptedString(){
-        Result<Map<String,String>> result = new Result<>();
-        Map<String,String> map = new HashMap<>();
+    public Result<Map<String, String>> getEncryptedString() {
+        Result<Map<String, String>> result = new Result<>();
+        Map<String, String> map = new HashMap<>();
         map.put("key", EncryptedString.key);
-        map.put("iv",EncryptedString.iv);
+        map.put("iv", EncryptedString.iv);
         result.setResult(map);
         return result;
     }
 
     /**
      * 后台生成图形验证码 :有效
+     *
      * @param response
      * @param key
      */
     @ApiOperation("获取验证码")
     @GetMapping(value = "/randomImage/{key}")
-    public Result<String> randomImage(HttpServletResponse response,@PathVariable String key){
+    public Result<String> randomImage(HttpServletResponse response, @PathVariable String key) {
         Result<String> res = new Result<String>();
         try {
-            String code = RandomUtil.randomString(BASE_CHECK_CODES,4);
+            String code = RandomUtil.randomString(BASE_CHECK_CODES, 4);
             String lowerCaseCode = code.toLowerCase();
             String realKey = MD5Util.getMd5(lowerCaseCode);
             redisUtil.set(realKey, lowerCaseCode, 60);
@@ -591,7 +594,7 @@ public class LoginController {
             res.setSuccess(true);
             res.setResult(base64);
         } catch (Exception e) {
-            res.error500("获取验证码出错"+e.getMessage());
+            res.error500("获取验证码出错" + e.getMessage());
             e.printStackTrace();
         }
         return res;
@@ -599,6 +602,7 @@ public class LoginController {
 
     /**
      * app登录
+     *
      * @param sysLoginModel
      * @return
      * @throws Exception
@@ -612,7 +616,7 @@ public class LoginController {
         //1. 校验用户是否有效
         SysUser sysUser = sysUserService.getUserByName(username);
         result = sysUserService.checkUserIsEffective(sysUser);
-        if(!result.isSuccess()) {
+        if (!result.isSuccess()) {
             return result;
         }
 
@@ -625,7 +629,7 @@ public class LoginController {
         }
 
         String orgCode = sysUser.getOrgCode();
-        if(oConvertUtils.isEmpty(orgCode)) {
+        if (oConvertUtils.isEmpty(orgCode)) {
             //如果当前用户无选择部门 查看部门关联信息
             List<SysDepart> departs = sysDepartService.queryUserDeparts(sysUser.getId());
             if (departs == null || departs.size() == 0) {
@@ -644,7 +648,7 @@ public class LoginController {
         String token = JwtUtil.sign(username, syspassword);
         // 设置超时时间
         redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
-        redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME*2 / 1000);
+        redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME * 2 / 1000);
         //token 信息
         obj.put("token", token);
         result.setResult(obj);
@@ -656,20 +660,21 @@ public class LoginController {
 
     /**
      * 图形验证码
+     *
      * @param sysLoginModel
      * @return
      */
     @RequestMapping(value = "/checkCaptcha", method = RequestMethod.POST)
-    public Result<?> checkCaptcha(@RequestBody SysLoginModel sysLoginModel){
+    public Result<?> checkCaptcha(@RequestBody SysLoginModel sysLoginModel) {
         String captcha = sysLoginModel.getCaptcha();
         String checkKey = sysLoginModel.getCheckKey();
-        if(captcha==null){
+        if (captcha == null) {
             return Result.error("验证码无效");
         }
         String lowerCaseCaptcha = captcha.toLowerCase();
-        String realKey = MD5Util.getMd5(lowerCaseCaptcha+checkKey);
+        String realKey = MD5Util.getMd5(lowerCaseCaptcha + checkKey);
         Object checkCode = redisUtil.get(realKey);
-        if(checkCode==null || !checkCode.equals(lowerCaseCaptcha)) {
+        if (checkCode == null || !checkCode.equals(lowerCaseCaptcha)) {
             return Result.error("验证码错误");
         }
         return Result.ok();

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

@@ -130,12 +130,12 @@ spring:
         poolPreparedStatements: true
         maxPoolPreparedStatementPerConnectionSize: 20
         # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-        filters: stat,slf4j
+        filters: stat,wall,slf4j
         # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&allowMultiQueries=true
+          url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
           username: data
           password: hcst@2021
           driver-class-name: com.mysql.jdbc.Driver

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

@@ -28,8 +28,8 @@ spring:
           starttls:
             enable: true
             required: true
-  ## quartz定时任务,采用数据库方式
-  #quartz:
+    ## quartz定时任务,采用数据库方式
+    #quartz:
     #job-store-type: jdbc
   #json 时间戳统一转换
   jackson:

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

@@ -101,12 +101,12 @@ spring:
           username: hcst
           password: hcst@2020
           driver-class-name: com.mysql.jdbc.Driver
-#      datasource:
-#        master:
-#          url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true
-#          username: data
-#          password: hcst@2021
-#          driver-class-name: com.mysql.jdbc.Driver
+  #      datasource:
+  #        master:
+  #          url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true
+  #          username: data
+  #          password: hcst@2021
+  #          driver-class-name: com.mysql.jdbc.Driver
   #redis 配置
   redis:
     database: 0

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

@@ -95,21 +95,21 @@ spring:
         # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
-#        master:
-#          url: jdbc:mysql://139.186.27.96:4000/jiaoyang?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-#          username: data
-#          password: hcst@2021
-#          driver-class-name: com.mysql.jdbc.Driver
-#        master:
-#          url: jdbc:mysql://139.186.165.84:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true
-#          username: hcst
-#          password: hcst@2020
-#          driver-class-name: com.mysql.jdbc.Driver
         master:
-          url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          url: jdbc:mysql://139.186.27.96:4000/jiaoyang?characterEncoding=UTF-8&useUnicode=true&useSSL=false
           username: data
           password: hcst@2021
           driver-class-name: com.mysql.jdbc.Driver
+#        master:
+#          url: jdbc:mysql://139.186.151.174:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true
+#          username: hcst
+#          password: hcst@2020
+#          driver-class-name: com.mysql.jdbc.Driver
+#        master:
+#          url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+#          username: data
+#          password: hcst@2021
+#          driver-class-name: com.mysql.jdbc.Driver
   #redis 配置
   redis:
     database: 0

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

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

+ 17 - 15
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -9,12 +9,12 @@ import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.report.mapper.EtlKuaishouAccountMaterialReportDailyMapper;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyImageService;
+import cn.com.ctop.oa.modules.service.IAppchatCreateService;
 import cn.com.ctop.oa.modules.service.IWechatNoListService;
 import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
 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.*;
-import com.csvreader.CsvReader;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.RedisUtil;
@@ -26,10 +26,7 @@ import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
 import javax.annotation.Resource;
-import java.io.IOException;
-import java.nio.charset.Charset;
 import java.text.ParseException;
-import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -52,13 +49,18 @@ public class SampleTest {
     private IKuaishouInterfaceService kuaishouInterfaceService;
     @Autowired
     private RedisUtil redisUtil;
+    @Autowired
+    private IAppchatCreateService appchatCreateService;
+
 
     @Test
     public void loadKuaishouCookie() throws ParseException {
 
-        redisUtil.set("11sdfhgjksdhfjksdhfjksdhfkjsjkfhkjsddhfjksdhfkjhsjkfhjkshfjksdhfjksdhfjkshdjkfhsjkdfhkjsd1","hahahaha",5);
+        // appchatCreateService.createAppChat(null, null, null);
+        appchatCreateService.getChatInfo(null);
+       /* redisUtil.set("11sdfhgjksdhfjksdhfjksdhfkjsjkfhkjsddhfjksdhfkjhsjkfhjkshfjksdhfjksdhfjkshdjkfhsjkdfhkjsd1","hahahaha",5);
         Object o = redisUtil.get("11sdfhgjksdhfjksdhfjksdhfkjsjkfhkjsddhfjksdhfkjhsjkfhjkshfjksdhfjksdhfjkshdjkfhsjkdfhkjsd1");
-        System.err.println(o);
+        System.err.println(o);*/
 
 
         /*try {
@@ -222,7 +224,7 @@ public class SampleTest {
     private IEtlBytedanceReportVideoDailyService etlBytedanceReportVideoDailyService;
 
     @Test
-    public void etlBytedanceVideoReportInfo()throws Exception{
+    public void etlBytedanceVideoReportInfo() throws Exception {
         etlBytedanceReportVideoDailyService.etlBytedanceVideo();
     }
 
@@ -230,7 +232,7 @@ public class SampleTest {
     private IReportService reportService;
 
     @Test
-    public void loadBytedanceAccountReport(){
+    public void loadBytedanceAccountReport() {
         /**
          * 1692555408132110
          * 1692555631713287
@@ -238,19 +240,19 @@ public class SampleTest {
          * 1696734333251598
          */
         CtopOauthToken token1 = tokenService.getTokenByAccountId(1692555408132110L);
-        reportService.getAdvertiserReport(token1, DateUtils.parseDate("2021-05-01","yyyy-MM-dd"), DateUtils.parseDate("2021-05-12","yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        reportService.getAdvertiserReport(token1, DateUtils.parseDate("2021-05-01", "yyyy-MM-dd"), DateUtils.parseDate("2021-05-12", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
         CtopOauthToken token2 = tokenService.getTokenByAccountId(1692555631713287L);
-        reportService.getAdvertiserReport(token2, DateUtils.parseDate("2021-05-01","yyyy-MM-dd"), DateUtils.parseDate("2021-05-12","yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        reportService.getAdvertiserReport(token2, DateUtils.parseDate("2021-05-01", "yyyy-MM-dd"), DateUtils.parseDate("2021-05-12", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
         CtopOauthToken token3 = tokenService.getTokenByAccountId(1696734332089352L);
-        reportService.getAdvertiserReport(token3, DateUtils.parseDate("2021-05-01","yyyy-MM-dd"), DateUtils.parseDate("2021-05-12","yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        reportService.getAdvertiserReport(token3, DateUtils.parseDate("2021-05-01", "yyyy-MM-dd"), DateUtils.parseDate("2021-05-12", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
         CtopOauthToken token4 = tokenService.getTokenByAccountId(1696734333251598L);
-        reportService.getAdvertiserReport(token4, DateUtils.parseDate("2021-05-01","yyyy-MM-dd"), DateUtils.parseDate("2021-05-12","yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        reportService.getAdvertiserReport(token4, DateUtils.parseDate("2021-05-01", "yyyy-MM-dd"), DateUtils.parseDate("2021-05-12", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
 
         CtopOauthToken token5 = tokenService.getTokenByAccountId(10129666L);
-        kuaishouInterfaceService.getAdvertiserReportDaily(token5, DateUtils.parseDate("2021-05-07","yyyy-MM-dd"), DateUtils.parseDate("2021-05-11","yyyy-MM-dd"), null);
+        kuaishouInterfaceService.getAdvertiserReportDaily(token5, DateUtils.parseDate("2021-05-07", "yyyy-MM-dd"), DateUtils.parseDate("2021-05-11", "yyyy-MM-dd"), null);
         CtopOauthToken token6 = tokenService.getTokenByAccountId(10097961L);
-        kuaishouInterfaceService.getAdvertiserReportDaily(token6, DateUtils.parseDate("2021-05-07","yyyy-MM-dd"), DateUtils.parseDate("2021-05-11","yyyy-MM-dd"), null);
+        kuaishouInterfaceService.getAdvertiserReportDaily(token6, DateUtils.parseDate("2021-05-07", "yyyy-MM-dd"), DateUtils.parseDate("2021-05-11", "yyyy-MM-dd"), null);
         CtopOauthToken token7 = tokenService.getTokenByAccountId(10098039L);
-        kuaishouInterfaceService.getAdvertiserReportDaily(token7, DateUtils.parseDate("2021-05-07","yyyy-MM-dd"), DateUtils.parseDate("2021-05-11","yyyy-MM-dd"), null);
+        kuaishouInterfaceService.getAdvertiserReportDaily(token7, DateUtils.parseDate("2021-05-07", "yyyy-MM-dd"), DateUtils.parseDate("2021-05-11", "yyyy-MM-dd"), null);
     }
 }

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

@@ -14,7 +14,7 @@ public class SysUserDepart implements Serializable {
 	private static final long serialVersionUID = 1L;
 
 	/**主键id*/
-    @TableId(type = IdType.ID_WORKER_STR)
+	@TableId(type = IdType.ID_WORKER_STR)
 	private String id;
 	/**用户id*/
 	private String userId;

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

@@ -134,11 +134,11 @@
         and DATE_FORMAT(create_time,'%Y-%m-%d') &gt;= #{startDate}
         and DATE_FORMAT(create_time,'%Y-%m-%d') &lt;= #{endDate}
     </select>
+
     <select id="getIdListByProject" resultType="java.lang.String">
         select id  from  ctop_material_info
         where project_id = #{projectId}
         and status != 2
-        and DATE_FORMAT(create_time,'%Y-%m-%d') &gt;= '2021-04-28'
 
     </select>
 

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

@@ -81,7 +81,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
     /**
      * queryTreeList 对应 queryTreeList 查询所有的部门数据,以树结构形式响应给前端
      */
-    @Cacheable(value = CacheConstant.SYS_DEPARTS_CACHE)
+    // @Cacheable(value = CacheConstant.SYS_DEPARTS_CACHE)
     @Override
     public List<SysDepartTreeModel> queryTreeList() {
         LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();
@@ -101,7 +101,7 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
         return listResult;
     }
 
-    @Cacheable(value = CacheConstant.SYS_DEPART_IDS_CACHE)
+  //  @Cacheable(value = CacheConstant.SYS_DEPART_IDS_CACHE)
     @Override
     public List<DepartIdModel> queryDepartIdTreeList() {
         LambdaQueryWrapper<SysDepart> query = new LambdaQueryWrapper<SysDepart>();

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

@@ -168,6 +168,10 @@ public class MaterialUploadServiceImpl implements IMaterialUploadService {
                         requestJson.put("type", type);
                     }
                 }
+                String materialName = materialInfo.getMaterialName();
+                if (!Check.isNull(materialName)) {
+                    requestJson.put("photo_name", materialName);
+                }
                 for (int i = 0; i < accountArray.size(); i++) {
                     Long accountId = accountArray.getLong(i);
                     QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();

+ 3 - 3
module-job-bytedance/src/main/resources/application-prod.yml

@@ -47,9 +47,9 @@ spring:
   autoconfigure:
     exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
   datasource:
-    url: jdbc:mysql://172.30.0.4:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+    url: jdbc:mysql://127.0.0.1:3306/jiaoyang?characterEncoding=UTF-8&useUnicode=true&useSSL=false
     username: hcst
-    password: hcst@2020
+    password: test@20190531
     driver-class-name: com.mysql.jdbc.Driver
     druid:
       stat-view-servlet:
@@ -86,7 +86,7 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url: jdbc:mysql://172.30.0.4:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          url: jdbc:mysql://172.30.0.4:4000/jiaoyang?characterEncoding=UTF-8&useUnicode=true&allowMultiQueries=true&useSSL=false
           username: hcst
           password: hcst@2020
           driver-class-name: com.mysql.jdbc.Driver

+ 11 - 0
module-job-bytedance/src/main/resources/application.yml

@@ -12,3 +12,14 @@ swagger:
     enable: true
     username: jeecg
     password: jeecg1314
+xxl:
+  job:
+    accessToken:
+    executor:
+      appname: module-job-bytedance
+      port: 9998
+      ip:
+      logpath: /data/applogs/xxl-job/jobhandler
+      logretentiondays: 30
+    admin:
+      addresses: http://118.24.244.213:8090/xxl-job-admin

+ 2 - 2
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouCreateUnitJob.java

@@ -25,13 +25,13 @@ public class KuaishouCreateUnitJob {
     @XxlJob("kuaihouCreateUnit")
     public void execute() {
         String url = jobUrl + "/jeecg-boot/batch/kuaiShouGroupTemplate/createUnit";
-        System.err.println("请求地址" + url);
+        System.err.println("请求地址为:" + url);
         List<Long> idList = groupTemplateService.getIdList();
         if (Check.isNull(idList)) {
             XxlJobHelper.log("批量2.0暂时没有未创建的组");
             return;
         }
-    //    String url = jobUrl + "/jeecg-boot/batch/kuaiShouGroupTemplate/createUnit";
+
         for (int i = 0; i < idList.size(); i++) {
             Long id = idList.get(i);
             Map<String, Object> requestMap = new HashMap<>();

+ 1 - 1
module-job-kuaishou/src/main/resources/application-prod.yml

@@ -94,7 +94,7 @@ spring:
   redis:
     database: 0
     host: 172.30.0.17
-#    host: 127.0.0.1
+    #    host: 127.0.0.1
     lettuce:
       pool:
         max-active: 8   #最大连接数据库连接数,设 0 为没有限制

+ 12 - 1
module-job-kuaishou/src/main/resources/application.yml

@@ -3,6 +3,7 @@ server:
 spring:
   profiles:
     active: @activatedProperties@
+#    active: prod
   application:
     name: system-web
 swagger:
@@ -11,4 +12,14 @@ swagger:
     enable: true
     username: jeecg
     password: jeecg1314
-
+xxl:
+  job:
+    accessToken:
+    executor:
+      appname: module-job-kuaishou
+      port: 9997
+      ip:
+      logpath: /data/applogs/xxl-job/jobhandler
+      logretentiondays: 30
+    admin:
+      addresses: http://118.24.244.213:8090/xxl-job-admin

+ 257 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/KuaiShouAppMultipleBidsController.java

@@ -0,0 +1,257 @@
+package cn.com.ctop.kuaishou.modules.ai.controller;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaiShouAppMultipleBids;
+import cn.com.ctop.kuaishou.modules.ai.service.IKuaiShouAppMultipleBidsService;
+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.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 多应用分别出价
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-05-18
+ */
+@Slf4j
+@Api(tags = "多应用分别出价")
+@RestController
+@RequestMapping("/adsp/kuaiShouAppMultipleBids")
+public class KuaiShouAppMultipleBidsController {
+    @Autowired
+    private IKuaiShouAppMultipleBidsService kuaiShouAppMultipleBidsService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param kuaiShouAppMultipleBids
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @ApiOperation(value = "多应用分别出价-分页列表查询", notes = "多应用分别出价-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<KuaiShouAppMultipleBids>> queryPageList(KuaiShouAppMultipleBids kuaiShouAppMultipleBids,
+                                                                @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                HttpServletRequest req) {
+        Result<IPage<KuaiShouAppMultipleBids>> result = new Result<>();
+        QueryWrapper<KuaiShouAppMultipleBids> queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouAppMultipleBids, req.getParameterMap());
+        Page<KuaiShouAppMultipleBids> page = new Page<KuaiShouAppMultipleBids>(pageNo, pageSize);
+        IPage<KuaiShouAppMultipleBids> pageList = kuaiShouAppMultipleBidsService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param kuaiShouAppMultipleBids
+     * @return
+     */
+    @ApiOperation(value = "多应用分别出价-添加", notes = "多应用分别出价-添加")
+    @PostMapping(value = "/saveOrUpdate")
+    public Result<KuaiShouAppMultipleBids> add(@RequestBody KuaiShouAppMultipleBids kuaiShouAppMultipleBids) {
+        Result<KuaiShouAppMultipleBids> result = new Result<>();
+        try {
+            Long accountId = kuaiShouAppMultipleBids.getAccountId();
+            Long appId = kuaiShouAppMultipleBids.getAppId();
+            QueryWrapper<KuaiShouAppMultipleBids> appMultipleBidsQueryWrapper = new QueryWrapper<>();
+            appMultipleBidsQueryWrapper.eq("account_id", accountId);
+            appMultipleBidsQueryWrapper.eq("app_id", appId);
+            appMultipleBidsQueryWrapper.orderByDesc("create_time");
+            appMultipleBidsQueryWrapper.last("limit 1");
+            KuaiShouAppMultipleBids one = kuaiShouAppMultipleBidsService.getOne(appMultipleBidsQueryWrapper);
+            if (Check.isNull(one)) {
+                kuaiShouAppMultipleBidsService.save(kuaiShouAppMultipleBids);
+            } else {
+                kuaiShouAppMultipleBids.setId(one.getId());
+                kuaiShouAppMultipleBidsService.updateById(kuaiShouAppMultipleBids);
+            }
+
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param kuaiShouAppMultipleBids
+     * @return
+     */
+    @ApiOperation(value = "多应用分别出价-编辑", notes = "多应用分别出价-编辑")
+    @PutMapping(value = "/edit")
+    public Result<KuaiShouAppMultipleBids> edit(@RequestBody KuaiShouAppMultipleBids kuaiShouAppMultipleBids) {
+        Result<KuaiShouAppMultipleBids> result = new Result<KuaiShouAppMultipleBids>();
+        KuaiShouAppMultipleBids kuaiShouAppMultipleBidsEntity = kuaiShouAppMultipleBidsService.getById(kuaiShouAppMultipleBids.getId());
+        if (kuaiShouAppMultipleBidsEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = kuaiShouAppMultipleBidsService.updateById(kuaiShouAppMultipleBids);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "多应用分别出价-通过id删除", notes = "多应用分别出价-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id") String id) {
+        try {
+            kuaiShouAppMultipleBidsService.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<KuaiShouAppMultipleBids> deleteBatch(@RequestParam(name = "ids") String ids) {
+        Result<KuaiShouAppMultipleBids> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.kuaiShouAppMultipleBidsService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "多应用分别出价-通过id查询", notes = "多应用分别出价-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<KuaiShouAppMultipleBids> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<KuaiShouAppMultipleBids> result = new Result<>();
+        KuaiShouAppMultipleBids kuaiShouAppMultipleBids = kuaiShouAppMultipleBidsService.getById(id);
+        if (kuaiShouAppMultipleBids == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(kuaiShouAppMultipleBids);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<KuaiShouAppMultipleBids> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                KuaiShouAppMultipleBids kuaiShouAppMultipleBids = JSON.parseObject(deString, KuaiShouAppMultipleBids.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouAppMultipleBids, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<KuaiShouAppMultipleBids> pageList = kuaiShouAppMultipleBidsService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "多应用分别出价列表");
+        mv.addObject(NormalExcelConstants.CLASS, KuaiShouAppMultipleBids.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<KuaiShouAppMultipleBids> listKuaiShouAppMultipleBidss = ExcelImportUtil.importExcel(file.getInputStream(), KuaiShouAppMultipleBids.class, params);
+                kuaiShouAppMultipleBidsService.saveBatch(listKuaiShouAppMultipleBidss);
+                return Result.ok("文件导入成功!数据行数:" + listKuaiShouAppMultipleBidss.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("文件导入失败!");
+    }
+
+}

+ 7 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouAdvertiserStrategy.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.kuaishou.modules.ai.entity;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -8,6 +9,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * 快手账户策略设置信息表
@@ -71,7 +73,7 @@ public class AiKuaishouAdvertiserStrategy {
     /**
      * 深度出价
      */
-    private Long cpaBid;
+    private String cpaBid;
     private Long deepConversionBid;
     /**
      * 优先低成本出价
@@ -376,7 +378,11 @@ public class AiKuaishouAdvertiserStrategy {
     private Long programUnitCnt;
     private String materialKeyword;
     private Integer historyTop;
+    private Integer multipleBids;
 
     @TableField(exist = false)
     private String authName;
+
+    @TableField(exist = false)
+    private List<JSONObject> appInfoList;
 }

+ 135 - 68
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouCreativeLevelOperationRecord.java

@@ -9,79 +9,146 @@ import java.util.Date;
 
 /**
  * 自定义创意创建记录
+ *
  * @author jeecg-boot
- * @date   2021-04-12
  * @version V1.0
+ * @date 2021-04-12
  */
 @Data
 @TableName("ctop_ai_kuaishou_creative_level_operation_record")
 public class AiKuaishouCreativeLevelOperationRecord {
 
-	/**创意操作表uuid*/
-	@TableId(type = IdType.ASSIGN_UUID)
-	private String creativeUuid;
-	/**AI策略ID*/
-	private String aiStrategyUuid;
-	/**账户ID*/
-	private Long accountId;
-	/**广告计划ID*/
-	private Long campaignId;
-	/**广告组ID*/
-	private Long unitId;
-	/**广告创意ID*/
-	private Long creativeId;
-	/**是否为便利贴,默认为0*/
-	private Integer isSticky;
-	/**创意名称*/
-	private String creativeName;
-	/**视频ID*/
-	private String photoId;
-	/**封面md5*/
-	private String imageMd5;
-	/**封面图片token*/
-	private String imageToken;
-	/**素材类型*/
-	private Integer creativeMaterialType;
-	/**便利贴单图图片创意token*/
-	private String imageTokens;
-	/**行动号召按钮文案*/
-	private String actionBarText;
-	/**广告语*/
-	private String description;
-	/**便利贴创意短广告语*/
-	private String shortSlogan;
-	/**封面广告语标题*/
-	private String stickerTitle;
-	/**贴纸样式类型*/
-	private String overlayType;
-	/**广告标签*/
-	private String exposeTag;
-	/**广告标签2期*/
-	private String newExposeTag;
-	/**安卓下载中间页ID*/
-	private Integer siteId;
-	/**第三方点击检测链接*/
-	private String clickTrackUrl;
-	/**第三方开始播放监测链接*/
-	private String impressionUrl;
-	/**第三方有效播放监测链接*/
-	private String adPhotoPlayedT3sUrl;
-	/**第三方点击按钮监测链接*/
-	private String actionbarClickUrl;
-	/**创意分类*/
-	private Integer creativeCategory;
-	/**创意标签*/
-	private String creativeTag;
-	/**操作类型 1-新增 2-修改*/
-	private Integer operationType;
-	/**创意创建时间*/
-	private Date creativeCreateTime;
-	/**创意更新时间*/
-	private Date creativeUpdateTime;
-	/**创建时间*/
-	private Date createTime;
-	/**状态*/
-	private Integer status;
-	/**状态详情*/
-	private String message;
+    /**
+     * 创意操作表uuid
+     */
+    @TableId(type = IdType.ASSIGN_UUID)
+    private String creativeUuid;
+    /**
+     * AI策略ID
+     */
+    private String aiStrategyUuid;
+    /**
+     * 账户ID
+     */
+    private Long accountId;
+    /**
+     * 广告计划ID
+     */
+    private Long campaignId;
+    /**
+     * 广告组ID
+     */
+    private Long unitId;
+    /**
+     * 广告创意ID
+     */
+    private Long creativeId;
+    /**
+     * 是否为便利贴,默认为0
+     */
+    private Integer isSticky;
+    /**
+     * 创意名称
+     */
+    private String creativeName;
+    /**
+     * 视频ID
+     */
+    private String photoId;
+    /**
+     * 封面md5
+     */
+    private String imageMd5;
+    /**
+     * 封面图片token
+     */
+    private String imageToken;
+    /**
+     * 素材类型
+     */
+    private Integer creativeMaterialType;
+    /**
+     * 便利贴单图图片创意token
+     */
+    private String imageTokens;
+    /**
+     * 行动号召按钮文案
+     */
+    private String actionBarText;
+    /**
+     * 广告语
+     */
+    private String description;
+    /**
+     * 便利贴创意短广告语
+     */
+    private String shortSlogan;
+    /**
+     * 封面广告语标题
+     */
+    private String stickerTitle;
+    /**
+     * 贴纸样式类型
+     */
+    private String overlayType;
+    /**
+     * 广告标签
+     */
+    private String exposeTag;
+    /**
+     * 广告标签2期
+     */
+    private String newExposeTag;
+    /**
+     * 安卓下载中间页ID
+     */
+    private Integer siteId;
+    /**
+     * 第三方点击检测链接
+     */
+    private String clickTrackUrl;
+    /**
+     * 第三方开始播放监测链接
+     */
+    private String impressionUrl;
+    /**
+     * 第三方有效播放监测链接
+     */
+    private String adPhotoPlayedT3sUrl;
+    /**
+     * 第三方点击按钮监测链接
+     */
+    private String actionbarClickUrl;
+    /**
+     * 创意分类
+     */
+    private Integer creativeCategory;
+    /**
+     * 创意标签
+     */
+    private String creativeTag;
+    /**
+     * 操作类型 1-新增 2-修改
+     */
+    private Integer operationType;
+    /**
+     * 创意创建时间
+     */
+    private Date creativeCreateTime;
+    /**
+     * 创意更新时间
+     */
+    private Date creativeUpdateTime;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 状态
+     */
+    private Integer status;
+    /**
+     * 状态详情
+     */
+    private String message;
 }

+ 295 - 148
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouUnitLevelOperationRecord.java

@@ -9,159 +9,306 @@ import java.util.Date;
 
 /**
  * 组创建记录
+ *
  * @author jeecg-boot
- * @date   2021-04-12
  * @version V1.0
+ * @date 2021-04-12
  */
 @Data
 @TableName("ctop_ai_kuaishou_unit_level_operation_record")
 public class AiKuaishouUnitLevelOperationRecord {
 
-	/**组操作表uuid*/
-	@TableId(type = IdType.ASSIGN_UUID)
-	private String groupUuid;
-	/**AI策略ID*/
-	private String aiStrategyUuid;
-	/**账户ID*/
-	private Long accountId;
-	/**广告计划ID*/
-	private Long campaignId;
-	/**广告组ID*/
-	private Long unitId;
-	/**广告组名称*/
-	private String groupName;
-	/**定向模板id*/
-	private Integer templateId;
-	/**优化目标出价类型*/
-	private Integer bidType;
-	/**优先从系统应用商店下载*/
-	private Integer useAppMarket;
-	/**应用商店列表*/
-	private String appStore;
-	/**出价*/
-	private Integer bid;
-	/**出价*/
-	private Integer cpaBid;
-	/**优先低成本出价*/
-	private Integer smartBid;
-	/**优化目标*/
-	private Integer ocpxActionType;
-	/**深度转化目标*/
-	private Integer deepConversionType;
-	/**付费ROI系数*/
-	private Float roiRatio;
-	/**资源位置*/
-	private String sceneId;
-	/** 创意制作方式*/
-	private Integer unitType;
-	/**投放开始时间*/
-	private String beginTime;
-	/**投放结束时间*/
-	private String endTime;
-	/**投放时间段*/
-	private String scheduleTime;
-	/**单日预算*/
-	private Integer dayBudget;
-	/**分日预算*/
-	private String dayBudgetSchedule;
-	/**转化目标ID*/
-	private Integer convertId;
-	/**url类型*/
-	private Integer urlType;
-	/**url类型*/
-	private Integer webUriType;
-	/**投放链接*/
-	private String url;
-	/**调起链接*/
-	private String schemaUri;
-	/**应用ID*/
-	private Integer appId;
-	/**创意展现方式*/
-	private Integer showMode;
-	/**投放方式*/
-	private Integer speed;
-	/**预约广告*/
-	private Integer siteType;
-	/**游戏礼包码*/
-	private String giftData;
-	/**是否使用落地页前置功能*/
-	private Integer videoLandingPage;
-	/**智能定向*/
-	private Integer autoTarget;
-	/**是否开启自动生成视频*/
-	private Integer autoCreatePhoto;
-	/**地域*/
-	private String region;
-	/**商圈定向*/
-	private String districtIds;
-	/**用户类型*/
-	private Integer userType;
-	/**最大年龄*/
-	private Integer ageMin;
-	/**最小年龄*/
-	private Integer ageMax;
-	/**固定年龄段*/
-	private String agesRange;
-	/**性别*/
-	private Integer gender;
-	/**操作系统*/
-	private Integer platformOs;
-	/**Android版本*/
-	private Integer androidOsv;
-	/**iOS版本*/
-	private Integer iosOsv;
-	/**网络环境*/
-	private Integer network;
-	/**设备品牌*/
-	private String deviceBrand;
-	/**设备价格*/
-	private String devicePrice;
-	/**商业兴趣类型*/
-	private Integer businessInterestType;
-	/**商业兴趣*/
-	private String businessInterest;
-	/**网红粉丝*/
-	private String fansStar;
-	/**兴趣视频用户*/
-	private String interestVideo;
-	/**APP行为-按分类*/
-	private String appInterest;
-	/**APP行为-按APP名称*/
-	private String appIds;
-	/**过滤已转化人群纬度*/
-	private Integer filterConvertedLevel;
-	/**人群包定向*/
-	private String population;
-	/**人群包排除*/
-	private String excludePopulation;
-	/**付费人群包id*/
-	private String paidAudience;
-	/**开启智能扩量*/
-	private Integer isOpen;
-	/**不可突破年龄*/
-	private Integer noAgeBreak;
-	/**不可突破性别*/
-	private Integer noGenderBreak;
-	/**不可突破地域*/
-	private Integer noAreaBreak;
-	/**行为兴趣定向*/
-	private String behaviorInterest;
-	/**操作类型 1-新增 2-修改*/
-	private Integer operationType;
-	/**组创建时间*/
-	private Date groupCreateTime;
-	/**组更新时间*/
-	private Date groupUpdateTime;
-	/**创建时间*/
-	private Date createTime;
-	/**状态*/
-	private Integer status;
-	/**状态详情*/
-	private String message;
-	/**程序化创意2.0-是否开启智能抽帧*/
-	private Integer smartCover;
-	/**程序化创意2.0-是否开启素材挖掘*/
-	private Integer assetMining;
-	/**深度转化目标出价*/
-	private Integer deepConversionBid;
+    /**
+     * 组操作表uuid
+     */
+    @TableId(type = IdType.ASSIGN_UUID)
+    private String groupUuid;
+    /**
+     * AI策略ID
+     */
+    private String aiStrategyUuid;
+    /**
+     * 账户ID
+     */
+    private Long accountId;
+    /**
+     * 广告计划ID
+     */
+    private Long campaignId;
+    /**
+     * 广告组ID
+     */
+    private Long unitId;
+    /**
+     * 广告组名称
+     */
+    private String groupName;
+    /**
+     * 定向模板id
+     */
+    private Integer templateId;
+    /**
+     * 优化目标出价类型
+     */
+    private Integer bidType;
+    /**
+     * 优先从系统应用商店下载
+     */
+    private Integer useAppMarket;
+    /**
+     * 应用商店列表
+     */
+    private String appStore;
+    /**
+     * 出价
+     */
+    private Integer bid;
+    /**
+     * 出价
+     */
+    private Integer cpaBid;
+    /**
+     * 优先低成本出价
+     */
+    private Integer smartBid;
+    /**
+     * 优化目标
+     */
+    private Integer ocpxActionType;
+    /**
+     * 深度转化目标
+     */
+    private Integer deepConversionType;
+    /**
+     * 付费ROI系数
+     */
+    private Float roiRatio;
+    /**
+     * 资源位置
+     */
+    private String sceneId;
+    /**
+     * 创意制作方式
+     */
+    private Integer unitType;
+    /**
+     * 投放开始时间
+     */
+    private String beginTime;
+    /**
+     * 投放结束时间
+     */
+    private String endTime;
+    /**
+     * 投放时间段
+     */
+    private String scheduleTime;
+    /**
+     * 单日预算
+     */
+    private Integer dayBudget;
+    /**
+     * 分日预算
+     */
+    private String dayBudgetSchedule;
+    /**
+     * 转化目标ID
+     */
+    private Integer convertId;
+    /**
+     * url类型
+     */
+    private Integer urlType;
+    /**
+     * url类型
+     */
+    private Integer webUriType;
+    /**
+     * 投放链接
+     */
+    private String url;
+    /**
+     * 调起链接
+     */
+    private String schemaUri;
+    /**
+     * 应用ID
+     */
+    private Integer appId;
+    /**
+     * 创意展现方式
+     */
+    private Integer showMode;
+    /**
+     * 投放方式
+     */
+    private Integer speed;
+    /**
+     * 预约广告
+     */
+    private Integer siteType;
+    /**
+     * 游戏礼包码
+     */
+    private String giftData;
+    /**
+     * 是否使用落地页前置功能
+     */
+    private Integer videoLandingPage;
+    /**
+     * 智能定向
+     */
+    private Integer autoTarget;
+    /**
+     * 是否开启自动生成视频
+     */
+    private Integer autoCreatePhoto;
+    /**
+     * 地域
+     */
+    private String region;
+    /**
+     * 商圈定向
+     */
+    private String districtIds;
+    /**
+     * 用户类型
+     */
+    private Integer userType;
+    /**
+     * 最大年龄
+     */
+    private Integer ageMin;
+    /**
+     * 最小年龄
+     */
+    private Integer ageMax;
+    /**
+     * 固定年龄段
+     */
+    private String agesRange;
+    /**
+     * 性别
+     */
+    private Integer gender;
+    /**
+     * 操作系统
+     */
+    private Integer platformOs;
+    /**
+     * Android版本
+     */
+    private Integer androidOsv;
+    /**
+     * iOS版本
+     */
+    private Integer iosOsv;
+    /**
+     * 网络环境
+     */
+    private Integer network;
+    /**
+     * 设备品牌
+     */
+    private String deviceBrand;
+    /**
+     * 设备价格
+     */
+    private String devicePrice;
+    /**
+     * 商业兴趣类型
+     */
+    private Integer businessInterestType;
+    /**
+     * 商业兴趣
+     */
+    private String businessInterest;
+    /**
+     * 网红粉丝
+     */
+    private String fansStar;
+    /**
+     * 兴趣视频用户
+     */
+    private String interestVideo;
+    /**
+     * APP行为-按分类
+     */
+    private String appInterest;
+    /**
+     * APP行为-按APP名称
+     */
+    private String appIds;
+    /**
+     * 过滤已转化人群纬度
+     */
+    private Integer filterConvertedLevel;
+    /**
+     * 人群包定向
+     */
+    private String population;
+    /**
+     * 人群包排除
+     */
+    private String excludePopulation;
+    /**
+     * 付费人群包id
+     */
+    private String paidAudience;
+    /**
+     * 开启智能扩量
+     */
+    private Integer isOpen;
+    /**
+     * 不可突破年龄
+     */
+    private Integer noAgeBreak;
+    /**
+     * 不可突破性别
+     */
+    private Integer noGenderBreak;
+    /**
+     * 不可突破地域
+     */
+    private Integer noAreaBreak;
+    /**
+     * 行为兴趣定向
+     */
+    private String behaviorInterest;
+    /**
+     * 操作类型 1-新增 2-修改
+     */
+    private Integer operationType;
+    /**
+     * 组创建时间
+     */
+    private Date groupCreateTime;
+    /**
+     * 组更新时间
+     */
+    private Date groupUpdateTime;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 状态
+     */
+    private Integer status;
+    /**
+     * 状态详情
+     */
+    private String message;
+    /**
+     * 程序化创意2.0-是否开启智能抽帧
+     */
+    private Integer smartCover;
+    /**
+     * 程序化创意2.0-是否开启素材挖掘
+     */
+    private Integer assetMining;
+    /**
+     * 深度转化目标出价
+     */
+    private Integer deepConversionBid;
 }

+ 79 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/KuaiShouAppMultipleBids.java

@@ -0,0 +1,79 @@
+package cn.com.ctop.kuaishou.modules.ai.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 多应用分别出价
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-05-18
+ */
+@Data
+@TableName("ctop_ai_kuaishou_app_multiple_bids")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_ai_kuaishou_app_multiple_bids对象", description = "多应用分别出价")
+public class KuaiShouAppMultipleBids {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 账户id
+     */
+    @Excel(name = "账户id", width = 15)
+    @ApiModelProperty(value = "账户id")
+    private Long accountId;
+    /**
+     * app_id
+     */
+    @Excel(name = "app_id", width = 15)
+    @ApiModelProperty(value = "app_id")
+    private Long appId;
+    /**
+     * 出价
+     */
+    @Excel(name = "出价", width = 15)
+    @ApiModelProperty(value = "出价")
+    private Long cpaBid;
+    private Long deepConversionBid;
+    /**
+     * 监测链接
+     */
+    @Excel(name = "监测链接", width = 15)
+    @ApiModelProperty(value = "监测链接")
+    private String trackUrl;
+    private String channelCode;
+    /**
+     * 创建时间
+     */
+    @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;
+}

+ 21 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/KuaiShouAppMultipleBidsMapper.java

@@ -0,0 +1,21 @@
+package cn.com.ctop.kuaishou.modules.ai.mapper;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaiShouAppMultipleBids;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 多应用分别出价
+ *
+ * @author jeecg-boot
+ * 2021-05-18
+ * @version V1.0
+ */
+public interface KuaiShouAppMultipleBidsMapper extends BaseMapper<KuaiShouAppMultipleBids> {
+
+    List<JSONObject> getAppInfoList(@Param("accountId") Long accountId, @Param("appIds") JSONArray jsonArray);
+}

+ 36 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/KuaiShouAppMultipleBidsMapper.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.ai.mapper.KuaiShouAppMultipleBidsMapper">
+
+    <select id="getAppInfoList" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        t1.*, t2.app_name,t2.app_version,t2.platform
+        FROM
+        (
+        SELECT
+        *
+        FROM
+        ctop_ai_kuaishou_app_multiple_bids
+        WHERE
+        account_id = #{accountId}
+        <if test="appIds != null and appIds != '' ">
+            and app_id in
+            <foreach collection="appIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        ) t1
+        LEFT JOIN (
+        SELECT
+        app_id,
+        app_name,
+        app_version,
+        platform
+        FROM
+        ctop_kuaishou_app_list
+        WHERE
+        account_id =#{accountId}
+        ) t2 ON t1.app_id = t2.app_id
+    </select>
+</mapper>

+ 21 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IKuaiShouAppMultipleBidsService.java

@@ -0,0 +1,21 @@
+package cn.com.ctop.kuaishou.modules.ai.service;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaiShouAppMultipleBids;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * 多应用分别出价
+ *
+ * @author jeecg-boot
+ * 2021-05-18
+ * @version V1.0
+ */
+public interface IKuaiShouAppMultipleBidsService extends IService<KuaiShouAppMultipleBids> {
+
+    List<JSONObject> getAppInfiList(Long accountId, String appIdArray);
+
+    KuaiShouAppMultipleBids getInfoByAccountAndAppId(Long accountId, Long appId);
+}

+ 379 - 164
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreateCreativeServiceImpl.java

@@ -12,6 +12,7 @@ import cn.com.ctop.kuaishou.modules.ai.entity.*;
 import cn.com.ctop.kuaishou.modules.ai.enums.KuaishouCreativeAdsenceTypeEnum;
 import cn.com.ctop.kuaishou.modules.ai.enums.KuaishouCreativeMatTypeEnum;
 import cn.com.ctop.kuaishou.modules.ai.service.*;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouAppList;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouImageGet;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
 import cn.com.ctop.kuaishou.modules.batch.service.*;
@@ -26,6 +27,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
 import java.text.ParseException;
 import java.util.*;
 
@@ -60,6 +62,8 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
     private IAiKuaishouCreativeLevelOperationRecordService creativeLevelOperationRecordService;
     @Autowired
     private IKuaishouLandpagePackageService landpagePackageService;
+    @Autowired
+    private IKuaiShouAppMultipleBidsService kuaiShouAppMultipleBidsService;
 
 
     /**
@@ -91,51 +95,128 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         Integer singleAppid = strategy.getSingleAppid();
         if (null != singleAppid && singleAppid == 0) {
             //多应用
-            String appidString = strategy.getAppIdArray();
-            JSONArray appIdArray = JSONArray.parseArray(appidString);
-            if (null != appIdArray && !appIdArray.isEmpty()) {
-                for (int i = 0; i < appIdArray.size(); i++) {
-                    String replaceString = KuaishouCreativeMatTypeEnum.getNameByType(strategy.getUnitType().toString() + createType.toString());
-                    AiKuaiShouAppInfo appInfo = appInfoService.getByParams(strategy.getAccountId(), appIdArray.getLong(i));
-                    if (null == appInfo) {
-                        log.info("账户:{},appid({}) 数据不存在", accountId, appIdArray.getLong(i));
-                        continue;
-                    }
-
-                    if (null != strategy.getGeneralTrack() && strategy.getGeneralTrack() == 0) {
-                        strategy.setClickTrackUrl(appInfo.getTrackUrl());
-                        strategy.setImpressionUrl(appInfo.getTrackUrl());
+            JSONArray appIdArray = JSONArray.parseArray(strategy.getAppIdArray());
+            if (strategy.getMultipleBids() == 0) { // 非多应用多出价
+                if (null != appIdArray && !appIdArray.isEmpty()) {
+                    for (int i = 0; i < appIdArray.size(); i++) {
+                        String replaceString = KuaishouCreativeMatTypeEnum.getNameByType(strategy.getUnitType().toString() + createType.toString());
+
+                        AiKuaiShouAppInfo appInfo = appInfoService.getByParams(strategy.getAccountId(), appIdArray.getLong(i));
+                        if (null == appInfo) {
+                            log.info("账户:{},appid({}) 数据不存在", accountId, appIdArray.getLong(i));
+                            continue;
+                        }
+                        if (null != strategy.getGeneralTrack() && strategy.getGeneralTrack() == 0) {
+                            strategy.setClickTrackUrl(appInfo.getTrackUrl());
+                            strategy.setImpressionUrl(appInfo.getTrackUrl());
+                        }
+                        replaceString = appInfo.getAppVersion() + "-" + replaceString;
+                        //1:查询素材
+                        List<KuaiShouVideoGet> allVideos = getVideosByParams(strategy, startTime, endTime, appInfo, createType, videoCnt);
+                        if (null == allVideos || allVideos.isEmpty()) {
+                            log.info("账户:{},{} 到 {} 未获取到相应素材({})", accountId, startTime, endTime, replaceString);
+                            continue;
+                        }
+                        Long newCampaignId = getCampaignId(strategy, token, replaceString, "ALL_CAMPAIGN", createType, appInfo.getAppId(), strategyUuid);
+                        for (KuaiShouVideoGet videoItem : allVideos) {
+                            KuaishouAccountCreativeOverrunInfo overrunInfo = overrunInfoService.getByParams(accountId, DateUtils.formatDate(new Date()));
+                            if (null != overrunInfo) {
+                                log.info("该账户创意创建已超限=>accountId:{}", accountId);
+                                return 0L;
+                            }
+                            // 获取视频封面数据
+                            List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoItem.getSignature());
+                            if ((null == cutFrameList || cutFrameList.isEmpty())) {
+                                log.info("未获取到视频封面=>videoSignature:{}", videoItem.getSignature());
+                                continue;
+                            }
+                            //开始创建组+创意
+                            String unitName = getName(strategy.getGroupName(), strategy, createType, videoItem.getPhotoName(), "unit", newCampaignId, appInfo.getAppId());
+                            JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appInfo.getAppId());
+                            log.info("创建广告组入参:{}", unitParams);
+                            Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
+                            Integer unitCode = (Integer) unitCreateResult.get("code");
+                            String unitMessage = (String) unitCreateResult.get("message");
+                            AiKuaishouUnitLevelOperationRecord unitLevelOperationRecord = new AiKuaishouUnitLevelOperationRecord();
+                            BeanUtils.copyProperties(strategy, unitLevelOperationRecord);
+                            unitLevelOperationRecord.setGroupName(unitName);
+                            unitLevelOperationRecord.setCreateTime(new Date());
+                            unitLevelOperationRecord.setStatus(unitCode);
+                            unitLevelOperationRecord.setCampaignId(newCampaignId);
+                            unitLevelOperationRecord.setCpaBid(unitParams.getInteger("cpa_bid"));
+                            unitLevelOperationRecord.setBid(unitParams.getInteger("bid"));
+                            unitLevelOperationRecord.setDeepConversionBid(unitParams.getInteger("deep_conversion_bid"));
+                            unitLevelOperationRecord.setMessage(unitMessage);
+                            unitLevelOperationRecord.setCampaignId(newCampaignId);
+                            unitLevelOperationRecord.setAiStrategyUuid(strategyUuid);
+                            if (unitCode != 0) {
+                                log.info("组创建失败=>accountId:{};message:{}", accountId, unitMessage);
+                                unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
+                                continue;
+                            }
+                            Long unitId = (Long) unitCreateResult.get("unitId");
+                            unitLevelOperationRecord.setUnitId(unitId);
+                            unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
+                            videoCnt--;
+                            JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy);
+                            createCreativeByImage(cutFrameList, token, creativeParams, newCampaignId, unitId, videoItem, strategy.getImageCnt(), strategy, strategyUuid, appInfo.getAppVersion());
+                            if (videoCnt <= 0) {
+                                return videoCnt;
+                            }
+                        }
                     }
-                    replaceString = appInfo.getAppVersion() + "-" + replaceString;
-                    //1:查询素材
-                    List<KuaiShouVideoGet> allVideos = getVideosByParams(strategy, startTime, endTime, appInfo, createType, videoCnt);
-                    if (null == allVideos || allVideos.isEmpty()) {
-                        log.info("账户:{},{} 到 {} 未获取到相应素材({})", accountId, startTime, endTime, replaceString);
+                }
+            } else if (strategy.getMultipleBids() == 1) { //  多应用多出价
+                String replaceString = KuaishouCreativeMatTypeEnum.getNameByType(strategy.getUnitType().toString() + createType.toString());
+                List<KuaiShouVideoGet> allVideos = getVideosByParams(strategy, startTime, endTime, null, createType, videoCnt);
+                if (Check.isNull(allVideos)) {
+                    return videoCnt;
+                }
+                for (KuaiShouVideoGet videoItem : allVideos) {
+                    // 获取视频封面数据
+                    List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoItem.getSignature());
+                    if ((null == cutFrameList || cutFrameList.isEmpty())) {
+                        log.info("未获取到视频封面=>videoSignature:{}", videoItem.getSignature());
                         continue;
                     }
-                    Long newCampaignId = getCampaignId(strategy, token, replaceString, "ALL_CAMPAIGN", createType, appInfo, strategyUuid);
-                    int unitCnt = 0;
-                    for (KuaiShouVideoGet videoItem : allVideos) {
+                    for (int i = 0; i < appIdArray.size(); i++) {
+                        Long appId = appIdArray.getLong(i);
+                        if (Check.isNull(appId)) {
+                            continue;
+                        }
+                        KuaiShouAppMultipleBids multipleBids = kuaiShouAppMultipleBidsService.getInfoByAccountAndAppId(accountId, appId);
+                        if (Check.isNull(multipleBids)) {
+                            continue;
+                        }
+                        if (!Check.isNull(multipleBids.getTrackUrl())) {
+                            strategy.setClickTrackUrl(multipleBids.getTrackUrl());
+                        }
                         KuaishouAccountCreativeOverrunInfo overrunInfo = overrunInfoService.getByParams(accountId, DateUtils.formatDate(new Date()));
                         if (null != overrunInfo) {
                             log.info("该账户创意创建已超限=>accountId:{}", accountId);
                             return 0L;
                         }
-                        // 获取视频封面数据
-                        List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoItem.getSignature());
-                        if ((null == cutFrameList || cutFrameList.isEmpty())) {
-                            log.info("未获取到视频封面=>videoSignature:{}", videoItem.getSignature());
-                            continue;
-                        }
-                        unitCnt++;
+                        Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid);
                         //开始创建组+创意
-                        String unitName = getName(strategy.getGroupName(), strategy, createType, appInfo, videoItem.getPhotoName(), "unit", newCampaignId);
-                        JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appInfo.getAppId());
+                        String unitName = getName(strategy.getGroupName(), strategy, createType, videoItem.getPhotoName(), "unit", newCampaignId, appId);
+                        JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId);
+                        unitParams.remove("cpa_bid");
+                        unitParams.put("cpa_bid", multipleBids.getCpaBid());
+                        if (!Check.isNull(multipleBids.getDeepConversionBid())) {
+                            unitParams.remove("deep_conversion_bid");
+                            unitParams.put("deep_conversion_bid", multipleBids.getDeepConversionBid());
+                        }
+                        strategy.setCpaBid(multipleBids.getCpaBid() + "");
+                        log.info("创建广告组入参:{}", unitParams);
                         Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
                         Integer unitCode = (Integer) unitCreateResult.get("code");
                         String unitMessage = (String) unitCreateResult.get("message");
                         AiKuaishouUnitLevelOperationRecord unitLevelOperationRecord = new AiKuaishouUnitLevelOperationRecord();
                         BeanUtils.copyProperties(strategy, unitLevelOperationRecord);
+                        unitLevelOperationRecord.setCampaignId(newCampaignId);
+                        unitLevelOperationRecord.setCpaBid(unitParams.getInteger("cpa_bid"));
+                        unitLevelOperationRecord.setDeepConversionBid(unitParams.getInteger("deep_conversion_bid"));
+                        unitLevelOperationRecord.setBid(unitParams.getInteger("bid"));
                         unitLevelOperationRecord.setGroupName(unitName);
                         unitLevelOperationRecord.setCreateTime(new Date());
                         unitLevelOperationRecord.setStatus(unitCode);
@@ -152,7 +233,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
                         unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
                         videoCnt--;
                         JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy);
-                        createCreativeByImage(cutFrameList, token, creativeParams, newCampaignId, unitId, videoItem, strategy.getImageCnt(), strategy, strategyUuid, appInfo.getAppVersion());
+                        createCreativeByImage(cutFrameList, token, creativeParams, newCampaignId, unitId, videoItem, strategy.getImageCnt(), strategy, strategyUuid, null);
                         if (videoCnt <= 0) {
                             return videoCnt;
                         }
@@ -167,13 +248,18 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
                 log.info("账户:{},{} 到 {} 未获取到相应素材({})", accountId, startTime, endTime, replaceString);
                 return videoCnt;
             }
-            Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, null, strategyUuid);
+            Long appId = null;
+            if (strategy.getCampaignType() == 2 || strategy.getCampaignType() == 7) {
+                appId = JSONArray.parseArray(strategy.getAppIdArray()).getLong(0);
+                if (Check.isNull(appId)) {
+                    return videoCnt;
+                }
+            }
+            Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid);
             if (null == newCampaignId) {
                 return videoCnt;
             }
-
             //3、在“上新”计划中新增广告组,一个素材搭配n张封面,组成一个广告组
-            int unitCnt = 0;
             for (KuaiShouVideoGet videoItem : newVideos) {
                 KuaishouAccountCreativeOverrunInfo overrunInfo = overrunInfoService.getByParams(accountId, DateUtils.formatDate(new Date()));
                 if (null != overrunInfo) {
@@ -185,27 +271,19 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
                     log.info("未获取到视频封面=>videoSignature:{}", videoItem.getSignature());
                     continue;
                 }
-                unitCnt++;
-                String unitName = getName(strategy.getGroupName(), strategy, createType, null, videoItem.getPhotoName(), "unit", newCampaignId);
-
-                Long appId = null;
-                if (strategy.getCampaignType() == 2 || strategy.getCampaignType() == 7) {
-                    appId = JSONArray.parseArray(strategy.getAppIdArray()).getLong(0);
-                }
-
+                String unitName = getName(strategy.getGroupName(), strategy, createType, videoItem.getPhotoName(), "unit", newCampaignId, appId);
                 JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId);
+                log.info("创建广告组入参:{}", unitParams);
                 Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
                 Integer unitCode = (Integer) unitCreateResult.get("code");
                 String unitMessage = (String) unitCreateResult.get("message");
                 AiKuaishouUnitLevelOperationRecord unitLevelOperationRecord = new AiKuaishouUnitLevelOperationRecord();
                 BeanUtils.copyProperties(strategy, unitLevelOperationRecord);
                 unitLevelOperationRecord.setGroupName(unitName);
-                if (!Check.isNull(strategy.getCpaBid())) {
-                    unitLevelOperationRecord.setCpaBid(Integer.valueOf(strategy.getCpaBid() + ""));
-                }
-                if (!Check.isNull(strategy.getBid())) {
-                    unitLevelOperationRecord.setBid(Integer.valueOf(strategy.getBid() + ""));
-                }
+                unitLevelOperationRecord.setCampaignId(newCampaignId);
+                unitLevelOperationRecord.setCpaBid(unitParams.getInteger("cpa_bid"));
+                unitLevelOperationRecord.setBid(unitParams.getInteger("bid"));
+                unitLevelOperationRecord.setDeepConversionBid(unitParams.getInteger("deep_conversion_bid"));
                 unitLevelOperationRecord.setCreateTime(new Date());
                 unitLevelOperationRecord.setStatus(unitCode);
                 unitLevelOperationRecord.setMessage(unitMessage);
@@ -230,7 +308,6 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         return videoCnt;
     }
 
-
     /**
      * 创建程序化创意
      *
@@ -251,92 +328,175 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         //2:判定账户是否单一应用
         Long timeStart = null;
         Long timeEnd = null;
-
         Integer singleAppid = strategy.getSingleAppid();
         if (null != singleAppid && singleAppid == 0) {
             timeStart = -7 * 60 * 24L;
             timeEnd = -5L;
         } else {
-            timeStart = KuaishouCreativeMatTypeEnum.getStartTimeByType(strategy.getUnitType().toString() + createType.toString());
-            timeEnd = KuaishouCreativeMatTypeEnum.getEndTimeByType(strategy.getUnitType().toString() + createType.toString());
+            if (strategy.getMultipleBids() == 0) {
+                timeStart = KuaishouCreativeMatTypeEnum.getStartTimeByType(strategy.getUnitType().toString() + createType.toString());
+                timeEnd = KuaishouCreativeMatTypeEnum.getEndTimeByType(strategy.getUnitType().toString() + createType.toString());
+            } else if (strategy.getMultipleBids() == 1) {
+                if (createType == 1) {
+                    timeStart = -1 * 60 * 24L;
+                    timeEnd = -5L;
+                } else {
+                    timeStart = KuaishouCreativeMatTypeEnum.getStartTimeByType(strategy.getUnitType().toString() + createType.toString());
+                    timeEnd = KuaishouCreativeMatTypeEnum.getEndTimeByType(strategy.getUnitType().toString() + createType.toString());
+                }
+            }
         }
-
         Long now = System.currentTimeMillis();
         String startTime = DateUtils.formatDateTime(now + timeStart * 60 * 1000L);
         String endTime = DateUtils.formatDateTime(now + timeEnd * 60 * 1000L);
-
         String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
         String key = token.getAccountId() + "_ProgramCreative" + "_" + nowDate;
-
-
+        JSONArray appIdArray = JSON.parseArray(strategy.getAppIdArray());
         if (null != singleAppid && singleAppid == 0) {
-            //多应用
-            String appidString = strategy.getAppIdArray();
-            JSONArray appIdArray = JSON.parseArray(appidString);
-            if (null != appIdArray && !appIdArray.isEmpty()) {
-                for (int i = 0; i < appIdArray.size(); i++) {
-                    AiKuaiShouAppInfo appInfo = appInfoService.getByParams(strategy.getAccountId(), appIdArray.getLong(i));
-                    if (null == appInfo) {
-                        log.info("账户:{},appid({}) 数据不存在", accountId, appIdArray.getLong(i));
-                        continue;
-                    }
-                    //判定是否通用监测链接
-                    if (null != strategy.getGeneralTrack() && strategy.getGeneralTrack() == 0) {
-                        strategy.setClickTrackUrl(appInfo.getTrackUrl());
-                        strategy.setImpressionUrl(appInfo.getTrackUrl());
-                    }
-                    String replaceString = KuaishouCreativeMatTypeEnum.getNameByType(strategy.getUnitType().toString() + createType.toString());
-                    replaceString = appInfo.getAppVersion() + "-" + replaceString;
-                    //1:查询可用素材
-                    List<KuaiShouVideoGet> allVideos = getVideosByParams(strategy, startTime, endTime, appInfo, createType, videoCnt);
-                    if (null == allVideos || allVideos.isEmpty()) {
-                        return;
+            if (strategy.getMultipleBids() == 0) { //  非多应用多出价
+                //多应用
+                if (null != appIdArray && !appIdArray.isEmpty()) {
+                    for (int i = 0; i < appIdArray.size(); i++) {
+                        AiKuaiShouAppInfo appInfo = appInfoService.getByParams(strategy.getAccountId(), appIdArray.getLong(i));
+                        if (null == appInfo) {
+                            log.info("账户:{},appid({}) 数据不存在", accountId, appIdArray.getLong(i));
+                            continue;
+                        }
+                        String replaceString = KuaishouCreativeMatTypeEnum.getNameByType(strategy.getUnitType().toString() + createType.toString());
+
+                        //判定是否通用监测链接
+                        if (null != strategy.getGeneralTrack() && strategy.getGeneralTrack() == 0) {
+                            strategy.setClickTrackUrl(appInfo.getTrackUrl());
+                            strategy.setImpressionUrl(appInfo.getTrackUrl());
+                        }
+                        replaceString = appInfo.getAppVersion() + "-" + replaceString;
+                        //1:查询可用素材
+                        List<KuaiShouVideoGet> allVideos = getVideosByParams(strategy, startTime, endTime, appInfo, createType, videoCnt);
+                        if (null == allVideos || allVideos.isEmpty()) {
+                            return;
+                        }
+                        //判定创意创建是否超限
+                        KuaishouAccountCreativeOverrunInfo overrunInfo = overrunInfoService.getByParams(accountId, DateUtils.formatDate(new Date()));
+                        if (null != overrunInfo) {
+                            log.info("该账户创意创建已超限=>accountId:{}", accountId);
+                            return;
+                        }
+                        Long newCampaignId = getCampaignId(strategy, token, replaceString, "ALL_CAMPAIGN", createType, appInfo.getAppId(), strategyUuid);
+                        //创建组+创意
+                        List<List<KuaiShouVideoGet>> splitVideos = Lists.partition(allVideos, 5);
+                        for (int j = 1; j < splitVideos.size() + 1; j++) {
+                            Object redisObj = redisUtil.get(key);
+                            if (!Check.isNull(redisObj)) {
+                                Integer value = (Integer) redisObj;
+                                if (value == 1) {
+                                    log.error("程序化创意创建超限,accountId:{}", strategy.getAccountId());
+                                    return;
+                                }
+                            }
+                            //创建组
+                            String unitName = getName(strategy.getGroupName(), strategy, createType, null, "unit", newCampaignId, appInfo.getAppId());
+                            JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appInfo.getAppId());
+                            log.info("创建广告组入参:{}", unitParams);
+                            Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
+                            Integer unitCode = (Integer) unitCreateResult.get("code");
+                            String unitMessage = (String) unitCreateResult.get("message");
+                            AiKuaishouUnitLevelOperationRecord unitLevelOperationRecord = new AiKuaishouUnitLevelOperationRecord();
+                            BeanUtils.copyProperties(strategy, unitLevelOperationRecord);
+                            unitLevelOperationRecord.setGroupName(unitName);
+                            unitLevelOperationRecord.setCampaignId(newCampaignId);
+                            unitLevelOperationRecord.setCpaBid(unitParams.getInteger("cpa_bid"));
+                            unitLevelOperationRecord.setBid(unitParams.getInteger("bid"));
+                            unitLevelOperationRecord.setDeepConversionBid(unitParams.getInteger("deep_conversion_bid"));
+                            unitLevelOperationRecord.setCreateTime(new Date());
+                            unitLevelOperationRecord.setStatus(unitCode);
+                            unitLevelOperationRecord.setMessage(unitMessage);
+                            unitLevelOperationRecord.setCampaignId(newCampaignId);
+                            unitLevelOperationRecord.setAiStrategyUuid(strategyUuid);
+                            if (unitCode != 0) {
+                                log.info("组创建失败=>accountId:{};message:{}", accountId, unitMessage);
+                                unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
+                                continue;
+                            }
+                            Long unitId = (Long) unitCreateResult.get("unitId");
+                            unitLevelOperationRecord.setUnitId(unitId);
+                            unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
+                            JSONObject creativeParams = programCreativeParams(token, unitId, splitVideos.get(j - 1), strategy, j, appInfo.getAppVersion());
+                            createProgramCreative(token, creativeParams, strategy);
+                        }
                     }
-                    //判定创意创建是否超限
-                    KuaishouAccountCreativeOverrunInfo overrunInfo = overrunInfoService.getByParams(accountId, DateUtils.formatDate(new Date()));
-                    if (null != overrunInfo) {
-                        log.info("该账户创意创建已超限=>accountId:{}", accountId);
-                        return;
+                }
+            } else if (strategy.getMultipleBids() == 1) { // 多应用多出价
+                List<KuaiShouVideoGet> allVideos = getVideosByParams(strategy, startTime, endTime, null, createType, videoCnt);
+                if (Check.isNull(allVideos)) {
+                    return;
+                }
+                String replaceString = KuaishouCreativeMatTypeEnum.getNameByType(strategy.getUnitType().toString() + createType.toString());
+                List<List<KuaiShouVideoGet>> splitVideos = Lists.partition(allVideos, 1);
+                for (int j = 1; j < splitVideos.size() + 1; j++) {
+                    List<KuaiShouVideoGet> kuaiShouVideoGets = splitVideos.get(j);
+                    if (Check.isNull(kuaiShouVideoGets)) {
+                        continue;
                     }
-                    Long newCampaignId = getCampaignId(strategy, token, replaceString, "ALL_CAMPAIGN", createType, appInfo, strategyUuid);
-
-                    //创建组+创意
-                    List<List<KuaiShouVideoGet>> splitVideos = Lists.partition(allVideos, 5);
-                    for (int j = 1; j < splitVideos.size() + 1; j++) {
-
-                        Object redisObj = redisUtil.get(key);
-                        if (!Check.isNull(redisObj)) {
-                            Integer value = (Integer) redisObj;
-                            if (value == 1) {
-                                log.error("程序化创意创建超限,accountId:{}", strategy.getAccountId());
-                                return;
+                    for (KuaiShouVideoGet videoGet : kuaiShouVideoGets) {
+                        for (int i = 0; i < appIdArray.size(); i++) {
+                            Object redisObj = redisUtil.get(key);
+                            if (!Check.isNull(redisObj)) {
+                                Integer value = (Integer) redisObj;
+                                if (value == 1) {
+                                    log.error("程序化创意创建超限,accountId:{}", strategy.getAccountId());
+                                    return;
+                                }
                             }
-                        }
-
-                        //创建组
-                        String unitName = getName(strategy.getGroupName(), strategy, createType, appInfo, null, "unit", newCampaignId);
-                        JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appInfo.getAppId());
-                        Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
-                        Integer unitCode = (Integer) unitCreateResult.get("code");
-                        String unitMessage = (String) unitCreateResult.get("message");
-                        AiKuaishouUnitLevelOperationRecord unitLevelOperationRecord = new AiKuaishouUnitLevelOperationRecord();
-                        BeanUtils.copyProperties(strategy, unitLevelOperationRecord);
-                        unitLevelOperationRecord.setGroupName(unitName);
-                        unitLevelOperationRecord.setCreateTime(new Date());
-                        unitLevelOperationRecord.setStatus(unitCode);
-                        unitLevelOperationRecord.setMessage(unitMessage);
-                        unitLevelOperationRecord.setCampaignId(newCampaignId);
-                        unitLevelOperationRecord.setAiStrategyUuid(strategyUuid);
-                        if (unitCode != 0) {
-                            log.info("组创建失败=>accountId:{};message:{}", accountId, unitMessage);
+                            Long appId = appIdArray.getLong(i);
+                            if (Check.isNull(appId)) {
+                                continue;
+                            }
+                            KuaiShouAppMultipleBids multipleBids = kuaiShouAppMultipleBidsService.getInfoByAccountAndAppId(accountId, appId);
+                            if (Check.isNull(multipleBids)) {
+                                continue;
+                            }
+                            if (!Check.isNull(multipleBids.getTrackUrl())) {
+                                strategy.setClickTrackUrl(multipleBids.getTrackUrl());
+                            }
+                            Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid);
+                            //创建组
+                            String unitName = getName(strategy.getGroupName(), strategy, createType, videoGet.getPhotoName(), "unit", newCampaignId, appId);
+                            JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId);
+                            unitParams.remove("cpa_bid");
+                            unitParams.put("cpa_bid", multipleBids.getCpaBid());
+                            if (!Check.isNull(multipleBids.getDeepConversionBid())) {
+                                unitParams.remove("deep_conversion_bid");
+                                unitParams.put("deep_conversion_bid", multipleBids.getDeepConversionBid());
+                            }
+                            log.info("创建广告组入参:{}", unitParams);
+                            Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
+                            Integer unitCode = (Integer) unitCreateResult.get("code");
+                            String unitMessage = (String) unitCreateResult.get("message");
+                            AiKuaishouUnitLevelOperationRecord unitLevelOperationRecord = new AiKuaishouUnitLevelOperationRecord();
+                            BeanUtils.copyProperties(strategy, unitLevelOperationRecord);
+                            unitLevelOperationRecord.setGroupName(unitName);
+                            unitLevelOperationRecord.setCampaignId(newCampaignId);
+                            unitLevelOperationRecord.setCpaBid(unitParams.getInteger("cpa_bid"));
+                            unitLevelOperationRecord.setBid(unitParams.getInteger("bid"));
+                            unitLevelOperationRecord.setDeepConversionBid(unitParams.getInteger("deep_conversion_bid"));
+                            unitLevelOperationRecord.setCreateTime(new Date());
+                            unitLevelOperationRecord.setStatus(unitCode);
+                            unitLevelOperationRecord.setMessage(unitMessage);
+                            unitLevelOperationRecord.setCampaignId(newCampaignId);
+                            unitLevelOperationRecord.setDeepConversionBid(unitParams.getInteger("deep_conversion_bid"));
+
+                            unitLevelOperationRecord.setAiStrategyUuid(strategyUuid);
+                            if (unitCode != 0) {
+                                log.info("组创建失败=>accountId:{};message:{}", accountId, unitMessage);
+                                unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
+                                continue;
+                            }
+                            Long unitId = (Long) unitCreateResult.get("unitId");
+                            unitLevelOperationRecord.setUnitId(unitId);
                             unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
-                            continue;
+                            JSONObject creativeParams = programCreativeParams(token, unitId, splitVideos.get(j - 1), strategy, j, null);
+                            createProgramCreative(token, creativeParams, strategy);
                         }
-                        Long unitId = (Long) unitCreateResult.get("unitId");
-                        unitLevelOperationRecord.setUnitId(unitId);
-                        unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
-                        JSONObject creativeParams = programCreativeParams(token, unitId, splitVideos.get(j - 1), strategy, j, appInfo.getAppVersion());
-                        createProgramCreative(token, creativeParams, strategy);
                     }
                 }
             }
@@ -347,8 +507,17 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
             if (null == allVideos) {
                 return;
             }
-
-            Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, null, strategyUuid);
+            Long appId = null;
+            String appIdString = strategy.getAppIdArray();
+            if (strategy.getCampaignType() == 2 || strategy.getCampaignType() == 7) {
+                if (!Check.isNull(appIdString) && !Check.isNull(JSON.parseArray(appIdString))) {
+                    appId = JSON.parseArray(appIdString).getLong(0);
+                    if (Check.isNull(appId)) {
+                        return;
+                    }
+                }
+            }
+            Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid);
             if (null == newCampaignId) {
                 return;
             }
@@ -364,21 +533,19 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
                     }
                 }
                 //创建组
-                String unitName = getName(strategy.getGroupName(), strategy, createType, null, null, "unit", newCampaignId);
-                String appIdString = strategy.getAppIdArray();
-                Long appId = null;
-                if (strategy.getCampaignType() == 2 || strategy.getCampaignType() == 7) {
-                    if (!Check.isNull(appIdString) && !Check.isNull(JSON.parseArray(appIdString))) {
-                        appId = JSON.parseArray(appIdString).getLong(0);
-                    }
-                }
+                String unitName = getName(strategy.getGroupName(), strategy, createType, null, "unit", newCampaignId, appId);
                 JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId);
+                log.info("创建广告组入参:{}", unitParams);
                 Map<String, Object> unitCreateResult = kuaishouInterfaceService.adUnitCreate(token.getAccessToken(), token.getAccountId(), unitParams, 1);
                 Integer unitCode = (Integer) unitCreateResult.get("code");
                 String unitMessage = (String) unitCreateResult.get("message");
                 AiKuaishouUnitLevelOperationRecord unitLevelOperationRecord = new AiKuaishouUnitLevelOperationRecord();
                 BeanUtils.copyProperties(strategy, unitLevelOperationRecord);
                 unitLevelOperationRecord.setGroupName(unitName);
+                unitLevelOperationRecord.setCampaignId(newCampaignId);
+                unitLevelOperationRecord.setCpaBid(unitParams.getInteger("cpa_bid"));
+                unitLevelOperationRecord.setBid(unitParams.getInteger("bid"));
+                unitLevelOperationRecord.setDeepConversionBid(unitParams.getInteger("deep_conversion_bid"));
                 unitLevelOperationRecord.setCreateTime(new Date());
                 unitLevelOperationRecord.setStatus(unitCode);
                 unitLevelOperationRecord.setMessage(unitMessage);
@@ -396,6 +563,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
                 createProgramCreative(token, creativeParams, strategy);
             }
         }
+
     }
 
     @Override
@@ -565,8 +733,8 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         if (!Check.isNull(strategy.getActionbarClickUrl())) {
             programJson.put("actionbar_click_url", strategy.getActionbarClickUrl());
         }
-        JSONArray captions = new JSONArray();
-        captions.add(strategy.getDescription());
+
+        JSONArray captions = getCaptions(strategy.getDescription());
         programJson.put("captions", captions);
         if (!Check.isNull(strategy.getCreativeCategory())) {
             programJson.put("creative_category", strategy.getCreativeCategory());
@@ -575,6 +743,22 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         return programJson;
     }
 
+    private JSONArray getCaptions(String description) {
+        JSONArray jsonArray = JSONArray.parseArray(description);
+        if (jsonArray.size() <= 3) {
+            return jsonArray;
+        }
+        Collections.shuffle(jsonArray);
+        JSONArray captions = new JSONArray();
+        for (int i = 0; i < jsonArray.size(); i++) {
+            captions.add(jsonArray.getString(i));
+            if (captions.size() == 3) {
+                break;
+            }
+        }
+        return captions;
+    }
+
     private List<KuaiShouVideoGet> getNewVideoListByParams(AiKuaishouAdvertiserStrategy strategy, String startTime, String endTime, AiKuaiShouAppInfo appInfo) {
         if (null == appInfo) {
             if (Check.isNull(strategy.getMaterialKeyword())) { // 素材名称为空 不需要标注特殊素材
@@ -669,7 +853,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
     }
 
 
-    private Long getCampaignId(AiKuaishouAdvertiserStrategy strategy, CtopOauthToken token, String replaceString, String checkType, Integer createType, AiKuaiShouAppInfo appInfo, String uuid) {
+    private Long getCampaignId(AiKuaishouAdvertiserStrategy strategy, CtopOauthToken token, String replaceString, String checkType, Integer createType, Long appId, String uuid) {
         Long campaignId = null;
         if ("ALL_CAMPAIGN".equals(checkType)) {
             campaignId = campaignService.getCampaignIdByAccountAndName(strategy.getAccountId(), replaceString);
@@ -684,7 +868,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         // 不存在“上新”计划,则创建一个计划
         JSONObject campaignParams = new JSONObject();
         campaignParams.put("advertiser_id", token.getAccountId());
-        String campaignName = getName(strategy.getCampaignName(), strategy, createType, appInfo, null, "plan", null);
+        String campaignName = getName(strategy.getCampaignName(), strategy, createType, null, "plan", null, appId);
         campaignParams.put("campaign_name", campaignName);
         campaignParams.put("type", strategy.getCampaignType());
         if (null != strategy.getCampaignDayBudget() && strategy.getCampaignDayBudget() != 0) {
@@ -733,8 +917,9 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         if (null != strategy.getBid() && strategy.getBid() != 0) {
             unitParams.put("bid", strategy.getBid());
         }
-        if (null != strategy.getCpaBid() && strategy.getCpaBid() != 0) {
-            unitParams.put("cpa_bid", strategy.getCpaBid());
+        if (!Check.isNull(strategy.getCpaBid()) && !"0".equals((strategy.getCpaBid()))) {
+            Long cpdBid = getBidByString(strategy.getCpaBid());
+            unitParams.put("cpa_bid", cpdBid);
         }
         //优先低成本
         if (null != strategy.getSmartBid() && strategy.getSmartBid() != 0) {
@@ -915,14 +1100,16 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
             }
         }
 
-        JSONArray appInterest = JSONArray.parseArray(strategy.getAppInterest());
-        if (!Check.isNull(appInterest)) {
-            targetJsonObject.put("app_interest", appInterest);
-        }
         // APP行为-按APP名称
-        JSONArray appIds = JSONArray.parseArray(strategy.getAppIds());
-        if (!Check.isNull(appIds)) {
-            targetJsonObject.put("app_ids", appIds);
+        if (sceneId != 5) {
+            JSONArray appIds = JSONArray.parseArray(strategy.getAppIds());
+            if (!Check.isNull(appIds)) {
+                targetJsonObject.put("app_ids", appIds);
+            }
+            JSONArray appInterest = JSONArray.parseArray(strategy.getAppInterest());
+            if (!Check.isNull(appInterest)) {
+                targetJsonObject.put("app_interest", appInterest);
+            }
         }
         // 人群包定向
         JSONArray populationString = JSONArray.parseArray(strategy.getPopulation());
@@ -958,10 +1145,33 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
             }
         }
         unitParams.put("target", targetJsonObject);
-        log.info("广告组创建参数:{}", unitParams.toJSONString());
         return unitParams;
     }
 
+    private Long getBidByString(String cpaBid) {
+        if (Check.isNull(cpaBid)) {
+            return null;
+        }
+        String bidString = null;
+        if (cpaBid.contains("/")) { // 阶梯出价
+            String[] split = cpaBid.split("/");
+            int random = new Random().nextInt(split.length);
+            bidString = split[random];
+
+        } else if (cpaBid.contains("-")) { // 随机出价
+            String[] split = cpaBid.split("-");
+            Double min = Double.valueOf(split[0]) / 1000;
+            Double max = Double.valueOf(split[1]) / 1000;
+            Double randomNumber = new BigDecimal(min + Math.random() * (max - min)).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
+            bidString = String.valueOf(new Double(randomNumber * 1000).longValue());
+
+        } else {
+            bidString = cpaBid;
+        }
+
+        return Long.valueOf(bidString);
+    }
+
     private JSONArray cleanPramgramErrorScence(JSONArray scenceArray) {
         JSONArray result = new JSONArray();
         if (null == scenceArray || scenceArray.isEmpty()) {
@@ -1158,7 +1368,10 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         creativeParams.put("photo_id", videoItem.getPhotoId());
         creativeParams.put("creative_material_type", videoItem.getMaterialType());
         creativeParams.put("action_bar_text", strategy.getActionBarText());
-        creativeParams.put("description", strategy.getDescription());
+        JSONArray descArr = JSONArray.parseArray(strategy.getDescription());
+        int index = new Random().nextInt(descArr.size());
+        String description = descArr.getString(index);
+        creativeParams.put("description", description);
         // 封面广告语标题
         if (!Check.isNull(strategy.getStickerTitle())) {
             creativeParams.put("sticker_title", strategy.getStickerTitle());
@@ -1225,6 +1438,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         BeanUtils.copyProperties(strategy, record);
         record.setCreativeName(creativeName);
         record.setStatus(creativeCode);
+        record.setDescription(creativeParams.getString("description"));
         record.setMessage(creativeMessage);
         record.setUnitId(unitId);
         record.setAiStrategyUuid(uuid);
@@ -1246,14 +1460,20 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
      */
     @Autowired
     private RedisUtil redisUtil;
+    @Autowired
+    private IKuaiShouAppListService appListService;
 
-    private String getName(String wildcard, AiKuaishouAdvertiserStrategy strategy, Integer createType, AiKuaiShouAppInfo appInfo, String materialName, String type, Long campaignId) {
-        if (wildcard.contains("{{应用包名}}")) {
-            String appName = "";
-            if (null != appInfo) {
-                appName = appInfo.getAppName();
+
+    private String getName(String wildcard, AiKuaishouAdvertiserStrategy strategy, Integer createType, String materialName, String type, Long campaignId, Long appId) {
+        if (wildcard.contains("{{应用名称}}") || wildcard.contains("{{应用标记}}")) {
+            KuaiShouAppList getAppInfo = appListService.getAppInfo(strategy.getAccountId(), appId);
+            if (!Check.isNull(getAppInfo)) {
+                wildcard = wildcard.replace("{{应用名称}}", getAppInfo.getAppName());
+                wildcard = wildcard.replace("{{应用标记}}", getAppInfo.getAppVersion());
+            } else {
+                wildcard = wildcard.replace("{{应用名称}}", "");
+                wildcard = wildcard.replace("{{应用标记}}", "");
             }
-            wildcard = wildcard.replace("{{应用包名}}", appName);
         }
         if (wildcard.contains("{{创意制作方式}}")) {
             if (strategy.getUnitType() == 4) {
@@ -1274,6 +1494,14 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
                 wildcard = wildcard.replace("{{素材名称}}", materialName);
             }
         }
+        if (wildcard.contains("{{渠道号}}")) {
+            KuaiShouAppMultipleBids multipleBids = kuaiShouAppMultipleBidsService.getInfoByAccountAndAppId(strategy.getAccountId(), appId);
+            if (!Check.isNull(multipleBids)) {
+                wildcard = wildcard.replace("{{渠道号}}", multipleBids.getChannelCode());
+            } else {
+                wildcard = wildcard.replace("{{渠道号}}", "");
+            }
+        }
         if (!wildcard.contains("{{自定义}}")) {
             wildcard = wildcard + "{{自定义}}";
         }
@@ -1288,16 +1516,11 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         } else if ("unit".equals(type)) {
             wildcard = wildcard.replace("{{日期}}", nowDate);
         }
-
         String targetName = KuaishouCreativeMatTypeEnum.getNameByType(strategy.getUnitType().toString() + createType.toString());
-        if (null != appInfo) {
-            targetName = appInfo.getAppVersion() + "-" + targetName;
-        }
         wildcard = wildcard.replace("{{自定义}}", targetName);
-
         if (!Check.isNull(campaignId)) {
             Integer count = null;
-            if (null != strategy.getSingleAppid() && strategy.getSingleAppid() == 0) {
+            if (null != strategy.getSingleAppid() && strategy.getSingleAppid() == 0 && strategy.getMultipleBids() == 0) {
                 String redisKey = strategy.getAccountId() + "_" + campaignId;
                 Object redisValue = redisUtil.get(redisKey);
                 if (Check.isNull(redisValue)) {
@@ -1346,12 +1569,4 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
     }
 
 
-    public static void main(String[] args) {
-        Date date = new Date();
-        String s = DateUtils.formatDate(date, "yy-MMdd");
-        String timestamp = DateUtils.formatDate(new Date(), "HHmmss");
-        System.err.println(timestamp);
-    }
-
-
 }

+ 48 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaiShouAppMultipleBidsServiceImpl.java

@@ -0,0 +1,48 @@
+package cn.com.ctop.kuaishou.modules.ai.service.impl;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaiShouAppMultipleBids;
+import cn.com.ctop.kuaishou.modules.ai.mapper.KuaiShouAppMultipleBidsMapper;
+import cn.com.ctop.kuaishou.modules.ai.service.IKuaiShouAppMultipleBidsService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 多应用分别出价
+ *
+ * @author jeecg-boot
+ * 2021-05-18
+ * @version V1.0
+ */
+@Service
+public class KuaiShouAppMultipleBidsServiceImpl extends ServiceImpl<KuaiShouAppMultipleBidsMapper, KuaiShouAppMultipleBids> implements IKuaiShouAppMultipleBidsService {
+    @Autowired
+    private KuaiShouAppMultipleBidsMapper appMultipleBidsMapper;
+
+    @Override
+    public List<JSONObject> getAppInfiList(Long accountId, String appIdArray) {
+        if (!Check.isNull(appIdArray)) {
+            JSONArray jsonArray = JSONArray.parseArray(appIdArray);
+            List<JSONObject> appInfoList = appMultipleBidsMapper.getAppInfoList(accountId, jsonArray);
+            return appInfoList;
+
+        }
+        return null;
+    }
+
+    @Override
+    public KuaiShouAppMultipleBids getInfoByAccountAndAppId(Long accountId, Long appId) {
+        QueryWrapper<KuaiShouAppMultipleBids> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("account_id", accountId);
+        queryWrapper.eq("app_id", appId);
+        queryWrapper.orderByDesc("create_time");
+        queryWrapper.last("limit 1");
+        return this.getOne(queryWrapper);
+    }
+}

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

@@ -11,4 +11,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IKuaiShouAppListService extends IService<KuaiShouAppList> {
 
+    KuaiShouAppList getAppInfo(Long accountId, Long appId);
 }

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

@@ -3,6 +3,7 @@ package cn.com.ctop.kuaishou.modules.batch.service.impl;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouAppList;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouAppListMapper;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouAppListService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
@@ -15,4 +16,13 @@ import org.springframework.stereotype.Service;
 @Service
 public class KuaiShouAppListServiceImpl extends ServiceImpl<KuaiShouAppListMapper, KuaiShouAppList> implements IKuaiShouAppListService {
 
+    @Override
+    public KuaiShouAppList getAppInfo(Long accountId, Long appId) {
+        QueryWrapper<KuaiShouAppList> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("account_id", accountId);
+        queryWrapper.eq("app_id", appId);
+        queryWrapper.orderByDesc("create_time");
+        queryWrapper.last("limit 1");
+        return this.getOne(queryWrapper);
+    }
 }

+ 4 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupTemplateServiceImpl.java

@@ -503,10 +503,10 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
             target.put("paid_audience", JSONArray.parseArray(templateTarget.getPaidAudience()));
         }
         //-------------兴趣行为定向
-        JSONObject behaviorInterest = new JSONObject();
+    /*    JSONObject behaviorInterest = new JSONObject();
         JSONObject behavior = new JSONObject();
-        JSONObject interest = new JSONObject();
-        if (!Check.isNull(templateTarget.getKeyword())) {
+        JSONObject interest = new JSONObject();*/
+ /*       if (!Check.isNull(templateTarget.getKeyword())) {
             behavior.put("keyword", JSONArray.parseArray(templateTarget.getKeyword()));
         }
         if (!Check.isNull(templateTarget.getLabel())) {
@@ -532,7 +532,7 @@ public class KuaiShouGroupTemplateServiceImpl extends ServiceImpl<KuaiShouGroupT
         }
         if (!Check.isNull(behaviorInterest)) {
             target.put("behavior_interest", behaviorInterest);
-        }
+        }*/
         returnJson.put("target", target);
         returnJson.put("code", 0);
         return returnJson;

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

@@ -1019,7 +1019,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     log.info("创建组失败,重试,入参:{}", requestJson);
                     adUnitCreate(accessToken, advertiserId, requestJson, count + 1);
                 }
-                log.error("快手创建广告计划返回内容为空,advertiser_id:{},入参:{}", advertiserId, requestJson);
+                log.error("快手创建广告回内容为空,advertiser_id:{},入参:{}", advertiserId, requestJson);
                 returnMap.put("code", -1);
                 returnMap.put("message", "创建广告组异常");
                 returnMap.put("desc", "result is null");
@@ -2762,6 +2762,8 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     }
 
 
+
+
     /**
      * 获取定向标签
      *

+ 18 - 18
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KsNewGroupReportCtrl.java

@@ -25,7 +25,7 @@ import java.util.List;
 import java.util.Map;
 
 /**
- *  Created by JQ.bi on 2020.11.6
+ * Created by JQ.bi on 2020.11.6
  */
 @Slf4j
 @RestController
@@ -46,30 +46,30 @@ public class KsNewGroupReportCtrl {
         Result<Map<String, Object>> resultBody = new Result<>();
         Map<String, Object> result = new HashMap<>();
         JSONArray accountIds = requestBody.getJSONArray("accountIds");
-        String userId= requestBody.getString("userId");
+        String userId = requestBody.getString("userId");
         //TODO 没有维护快手事业部负责人角色,增加判断
-        if(userId.equals("6b4c821adc414dc8b7718ab63ccbfcaf")){
-            accountIds= newPlanReportService.getAccountIdsByMedia();
-        }else{
-            if(!userId.isEmpty()){
-                accountIds= newPlanReportService.getAccountIdsByUserId(userId);
+        if (userId.equals("b73c6a1cafb4469a8c0081acd50f703b") || userId.equals("228c45f913924639bf20c79ce5dadb16")) {
+            accountIds = newPlanReportService.getAccountIdsByMedia();
+        } else {
+            if (!userId.isEmpty()) {
+                accountIds = newPlanReportService.getAccountIdsByUserId(userId);
             }
-            if(accountIds.isEmpty()){
+            if (accountIds.isEmpty()) {
                 return resultBody;
             }
         }
 
         String startDate = requestBody.getString("startDate");
         String endDate = requestBody.getString("endDate");
-        String target= requestBody.getString("target");
-        String order= requestBody.getString("order");
+        String target = requestBody.getString("target");
+        String order = requestBody.getString("order");
         try {
             JSONObject sumData = newGroupReportService.getSumNewGroupBy(accountIds, startDate, endDate);
             List<JSONObject> chartData = newGroupReportService.getKsNewGroupGroupByStatDate(accountIds, startDate, endDate);
-            List<JSONObject> listData = newGroupReportService.getKsNewGroupGroupByAccount(accountIds, startDate, endDate,target,order);
-            result.put("sumData",sumData);
-            result.put("chartData",chartData);
-            result.put("listData",listData);
+            List<JSONObject> listData = newGroupReportService.getKsNewGroupGroupByAccount(accountIds, startDate, endDate, target, order);
+            result.put("sumData", sumData);
+            result.put("chartData", chartData);
+            result.put("listData", listData);
             resultBody.setResult(result);
             resultBody.setSuccess(true);
         } catch (Exception e) {
@@ -84,15 +84,15 @@ public class KsNewGroupReportCtrl {
         Result<List<JSONObject>> result = new Result<>();
 
         JSONArray accountIds = requestBody.getJSONArray("accountIds");
-        if(accountIds.isEmpty()){
+        if (accountIds.isEmpty()) {
             return result;
         }
         String startDate = requestBody.getString("startDate");
         String endDate = requestBody.getString("endDate");
-        String target= requestBody.getString("target");
-        String order= requestBody.getString("order");
+        String target = requestBody.getString("target");
+        String order = requestBody.getString("order");
         try {
-            List<JSONObject> listData = newGroupReportService.getKsNewGroupGroupByAccount(accountIds, startDate, endDate,target,order);
+            List<JSONObject> listData = newGroupReportService.getKsNewGroupGroupByAccount(accountIds, startDate, endDate, target, order);
             result.setResult(listData);
             result.setSuccess(true);
         } catch (Exception e) {

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

@@ -157,7 +157,7 @@
     sum(m.download_completed)as download_completed,
     sum(m.activation)as activation ,
     sum(m.submit)as submit,
-    stat_date,
+    date_format(m.stat_date,'%Y-%m-%d') as stat_date,
     sum(m.photo_click)as photo_click,
     sum(m.event_pay_first_day)as event_pay_first_day,
     sum(m.event_pay_purchase_amount_first_day)as event_pay_purchase_amount_first_day,

+ 8 - 11
module-kuaishou/src/main/resources/kuaishou_config.properties

@@ -1,12 +1,9 @@
 kuaishou_api_url=https://ad.e.kuaishou.com
 kuaishou_auth_url=https://ad.e.kuaishou.com
-kuaishou_appid=27
-kuaishou_third_appid=328
+kuaishou_appid=328
 oauth_type=agent
-kuaishou_secret=QovprB1tNhXptgDc
-kuaishou_third_secret=1iFTBiMdohkyEQQs
-kuaishou_callback_url=http://adsp.c-top.com.cn:8080/jeecg-boot/kuaishou
-kuaishou_third_callback_url=http://callback.shyouteng.com.cn/kuaishou
+kuaishou_secret=1iFTBiMdohkyEQQs
+kuaishou_callback_url=http://callback.shyouteng.com.cn/kuaishou
 apk_sava_path=/mnt/file/apk
 image_sava_path=/mnt/file/image
 video_sava_path=/mnt/file/video
@@ -18,7 +15,7 @@ model_video_fill_path=/mnt/data/fill/
 model_video_final_path=/mnt/data/final/
 
 
-# jiaoyang
+## jiaoyang
 #kuaishou_api_url=https://ad.e.kuaishou.com
 #kuaishou_auth_url=https://ad.e.kuaishou.com
 #kuaishou_appid=328
@@ -28,9 +25,9 @@ model_video_final_path=/mnt/data/final/
 #apk_sava_path=/mnt/file/apk
 #image_sava_path=/mnt/file/image
 #video_sava_path=/mnt/file/video
-## 模板视频存放路径
+### 模板视频存放路径
 #model_video_src_path=/mnt/data/src/
-## 片段合成视频存放路径
+### 片段合成视频存放路径
 #model_video_fill_path=/mnt/data/fill/
-##
-#model_video_final_path=/mnt/data/final/
+###
+#model_video_final_path=/mnt/data/final/

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

@@ -19,6 +19,8 @@ public class QYWxConstant {
     public static final String QYWX_CHECKIN_DATA = "https://qyapi.weixin.qq.com/cgi-bin/checkin/getcheckindata";  //获取部门下员工简单信息
     public static final String APP_ROVAL_INFO = "https://qyapi.weixin.qq.com/cgi-bin/oa/getapprovalinfo";  //批量获取审批单号
     public static final String APP_ROVAL_DETAIL = "https://qyapi.weixin.qq.com/cgi-bin/oa/getapprovaldetail";  //获取审批申请详情
+    public static final String APPCHAT_CREATE = "https://qyapi.weixin.qq.com/cgi-bin/appchat/create";  //创建群聊
+    public static final String APPCHAT_GET = "https://qyapi.weixin.qq.com/cgi-bin/appchat/get";  //创建群聊
 
     /**
      * 天津优容智汇 企业微信信息

+ 9 - 0
module-oa/src/main/java/cn/com/ctop/oa/modules/service/IAppchatCreateService.java

@@ -0,0 +1,9 @@
+package cn.com.ctop.oa.modules.service;
+
+import com.alibaba.fastjson.JSONArray;
+
+public interface IAppchatCreateService {
+    void createAppChat(String name, String owner, JSONArray userlist);
+
+    void getChatInfo(String chatid);
+}

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

@@ -0,0 +1,67 @@
+package cn.com.ctop.oa.modules.service.impl;
+
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.ctop.oa.modules.constant.QYWxConstant;
+import cn.com.ctop.oa.modules.service.IAppchatCreateService;
+import cn.com.ctop.oa.modules.service.IWechatTokenService;
+import cn.com.ctop.oa.modules.service.IWechatUserListService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+import static org.jeecg.common.constant.GeneralConstant.ACCESS_TOKEN;
+import static org.jeecg.common.constant.GeneralConstant.CODE;
+
+@Service
+@Slf4j
+public class AppchatCreateServiceImpl implements IAppchatCreateService {
+    @Autowired
+    private IWechatTokenService tokenService;
+    @Autowired
+    private IWechatUserListService userListService;
+
+
+    @Override
+    public void createAppChat(String name, String owner, JSONArray userlist) {
+        try {
+            Map<String, Object> qywxAccessToken = tokenService.getQYWXAccessToken();
+            if ((Integer) qywxAccessToken.get(CODE) != 0) {
+                throw new Exception("获取token失败");
+            }
+            System.err.println(qywxAccessToken);
+
+
+            JSONObject params = new JSONObject();
+            params.put("name", "易车时报发送");
+            params.put("owner", "qy01338f036d3ce902287758b529");
+            JSONArray userList = new JSONArray();
+            userList.add("qy01338f036d3ce902287758b529");
+            userList.add("qy01ae8f626d56e90128175730d2");
+            userList.add("YuMeng");
+            params.put("userlist", userList);
+            String resultStr = HttpUtils.httpPostRequestTest(QYWxConstant.APPCHAT_CREATE + "?access_token=" + qywxAccessToken.get(ACCESS_TOKEN), params.toJSONString(), null);
+            System.err.println(resultStr);
+        } catch (Exception e) {
+            log.error("员工考勤入库异常,", e);
+        }
+    }
+
+    @Override
+    public void getChatInfo(String chatid) {
+
+        Map<String, Object> qywxAccessToken = tokenService.getQYWXAccessToken();
+        System.err.println(qywxAccessToken);
+
+        TreeMap params = new TreeMap();
+
+        params.put("chatid", "wrSHhWEAAAhWApP92IL0nAuA9pQZ1W7w");
+        params.put("access_token", qywxAccessToken.get(ACCESS_TOKEN));
+        String resultStr = HttpUtils.httpGetRequest(QYWxConstant.APPCHAT_GET, null, params);
+        System.err.println(resultStr);
+    }
+}