Przeglądaj źródła

Merge remote-tracking branch 'origin/V1.1.3' into V1.1.3

syh 4 lat temu
rodzic
commit
543ccd5d29
22 zmienionych plików z 546 dodań i 156 usunięć
  1. 1 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyAccountReportLoadJob.java
  2. 245 0
      module-common/src/main/java/cn/com/ctop/common/module/controller/KuaiShouOcpxActionTypeConfigController.java
  3. 65 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/KuaiShouOcpxActionTypeConfig.java
  4. 15 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/KuaiShouOcpxActionTypeConfigMapper.java
  5. 5 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/KuaiShouOcpxActionTypeConfigMapper.xml
  6. 14 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IKuaiShouOcpxActionTypeConfigService.java
  7. 19 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/KuaiShouOcpxActionTypeConfigServiceImpl.java
  8. 2 3
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAccountReportLoadJob.java
  9. 41 5
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaiShouAppInfoController.java
  10. 34 28
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaiShouCreateServiceImpl.java
  11. 2 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java
  12. 0 27
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouConversionTypesController.java
  13. 42 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaishouBatchCampaignPreviewController.java
  14. 12 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaishouTemplateController.java
  15. 5 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaishouTemplateMapper.java
  16. 17 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouTemplateMapper.xml
  17. 0 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouVideoRelateCreativesMapper.xml
  18. 1 9
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouInterfaceService.java
  19. 4 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouTemplateService.java
  20. 1 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouBatchGroupPreviewServiceImpl.java
  21. 14 76
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  22. 7 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouTemplateServiceImpl.java

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

@@ -29,7 +29,7 @@ public class KuaishouHourlyAccountReportLoadJob implements Job {
     @Autowired
     private IKuaishouInterfaceService kuaishouInterfaceService;
 
-    static ExecutorService executorService = null;
+    static ExecutorService executorService = Executors.newFixedThreadPool(8);
     //线程计数器
     static CountDownLatch countDownLatch = null;
 
@@ -50,7 +50,6 @@ public class KuaishouHourlyAccountReportLoadJob implements Job {
                     log.info("定时获取快手数据异常:未获取到可用的token");
                     return;
                 }
-                executorService = Executors.newFixedThreadPool(5);
                 countDownLatch = new CountDownLatch(tokens.size());
                 Date finalGetDate = getDate;
                 tokens.forEach(token -> {

+ 245 - 0
module-common/src/main/java/cn/com/ctop/common/module/controller/KuaiShouOcpxActionTypeConfigController.java

@@ -0,0 +1,245 @@
+package cn.com.ctop.common.module.controller;
+
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.entity.KuaiShouOcpxActionTypeConfig;
+import cn.com.ctop.common.module.service.IKuaiShouOcpxActionTypeConfigService;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 转化目标字典表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-02-22
+ */
+@Slf4j
+@Api(tags = "转化目标字典表")
+@RestController
+@RequestMapping("/ocpx/kuaiShouOcpxActionTypeConfig")
+public class KuaiShouOcpxActionTypeConfigController {
+    @Autowired
+    private IKuaiShouOcpxActionTypeConfigService kuaiShouOcpxActionTypeConfigService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param kuaiShouOcpxActionTypeConfig
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "转化目标字典表-分页列表查询")
+    @ApiOperation(value = "转化目标字典表-分页列表查询", notes = "转化目标字典表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<List<KuaiShouOcpxActionTypeConfig>> queryPageList(KuaiShouOcpxActionTypeConfig kuaiShouOcpxActionTypeConfig,
+                                                                    @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                    HttpServletRequest req) {
+        Result<List<KuaiShouOcpxActionTypeConfig>> result = new Result<>();
+        QueryWrapper<KuaiShouOcpxActionTypeConfig> queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouOcpxActionTypeConfig, req.getParameterMap());
+        List<KuaiShouOcpxActionTypeConfig> pageList = kuaiShouOcpxActionTypeConfigService.list(queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param kuaiShouOcpxActionTypeConfig
+     * @return
+     */
+    @AutoLog(value = "转化目标字典表-添加")
+    @ApiOperation(value = "转化目标字典表-添加", notes = "转化目标字典表-添加")
+    @PostMapping(value = "/add")
+    public Result<KuaiShouOcpxActionTypeConfig> add(@RequestBody KuaiShouOcpxActionTypeConfig kuaiShouOcpxActionTypeConfig) {
+        Result<KuaiShouOcpxActionTypeConfig> result = new Result<>();
+        try {
+            kuaiShouOcpxActionTypeConfigService.save(kuaiShouOcpxActionTypeConfig);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param kuaiShouOcpxActionTypeConfig
+     * @return
+     */
+    @AutoLog(value = "转化目标字典表-编辑")
+    @ApiOperation(value = "转化目标字典表-编辑", notes = "转化目标字典表-编辑")
+    @PutMapping(value = "/edit")
+    public Result<KuaiShouOcpxActionTypeConfig> edit(@RequestBody KuaiShouOcpxActionTypeConfig kuaiShouOcpxActionTypeConfig) {
+        Result<KuaiShouOcpxActionTypeConfig> result = new Result<KuaiShouOcpxActionTypeConfig>();
+        KuaiShouOcpxActionTypeConfig kuaiShouOcpxActionTypeConfigEntity = kuaiShouOcpxActionTypeConfigService.getById(kuaiShouOcpxActionTypeConfig.getId());
+        if (kuaiShouOcpxActionTypeConfigEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = kuaiShouOcpxActionTypeConfigService.updateById(kuaiShouOcpxActionTypeConfig);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "转化目标字典表-通过id删除")
+    @ApiOperation(value = "转化目标字典表-通过id删除", notes = "转化目标字典表-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            kuaiShouOcpxActionTypeConfigService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "转化目标字典表-批量删除")
+    @ApiOperation(value = "转化目标字典表-批量删除", notes = "转化目标字典表-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<KuaiShouOcpxActionTypeConfig> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<KuaiShouOcpxActionTypeConfig> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.kuaiShouOcpxActionTypeConfigService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "转化目标字典表-通过id查询")
+    @ApiOperation(value = "转化目标字典表-通过id查询", notes = "转化目标字典表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<KuaiShouOcpxActionTypeConfig> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<KuaiShouOcpxActionTypeConfig> result = new Result<>();
+        KuaiShouOcpxActionTypeConfig kuaiShouOcpxActionTypeConfig = kuaiShouOcpxActionTypeConfigService.getById(id);
+        if (kuaiShouOcpxActionTypeConfig == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(kuaiShouOcpxActionTypeConfig);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<KuaiShouOcpxActionTypeConfig> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                KuaiShouOcpxActionTypeConfig kuaiShouOcpxActionTypeConfig = JSON.parseObject(deString, KuaiShouOcpxActionTypeConfig.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouOcpxActionTypeConfig, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<KuaiShouOcpxActionTypeConfig> pageList = kuaiShouOcpxActionTypeConfigService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "转化目标字典表列表");
+        mv.addObject(NormalExcelConstants.CLASS, KuaiShouOcpxActionTypeConfig.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<KuaiShouOcpxActionTypeConfig> listKuaiShouOcpxActionTypeConfigs = ExcelImportUtil.importExcel(file.getInputStream(), KuaiShouOcpxActionTypeConfig.class, params);
+                kuaiShouOcpxActionTypeConfigService.saveBatch(listKuaiShouOcpxActionTypeConfigs);
+                return Result.ok("文件导入成功!数据行数:" + listKuaiShouOcpxActionTypeConfigs.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("文件导入失败!");
+    }
+
+}

+ 65 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/KuaiShouOcpxActionTypeConfig.java

@@ -0,0 +1,65 @@
+package cn.com.ctop.common.module.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import 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-02-22
+ */
+@Data
+@TableName("ctop_kuaishou_ocpx_action_type_config")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_ocpx_action_type_config对象", description = "转化目标字典表")
+public class KuaiShouOcpxActionTypeConfig {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 优化目标
+     */
+    @Excel(name = "优化目标", width = 15)
+    @ApiModelProperty(value = "优化目标")
+    private Integer ocpxActionType;
+    /**
+     * 优化名称
+     */
+    @Excel(name = "优化名称", width = 15)
+    @ApiModelProperty(value = "优化名称")
+    private String ocpxActionName;
+    /**
+     * 创建时间
+     */
+    @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;
+}

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

@@ -0,0 +1,15 @@
+package cn.com.ctop.common.module.mapper;
+
+import cn.com.ctop.common.module.entity.KuaiShouOcpxActionTypeConfig;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 转化目标字典表
+ *
+ * @author: jeecg-boot
+ * @date: 2021-02-22
+ * @cersion: V1.0
+ */
+public interface KuaiShouOcpxActionTypeConfigMapper extends BaseMapper<KuaiShouOcpxActionTypeConfig> {
+
+}

+ 5 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/KuaiShouOcpxActionTypeConfigMapper.xml

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

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

@@ -0,0 +1,14 @@
+package cn.com.ctop.common.module.service;
+
+import cn.com.ctop.common.module.entity.KuaiShouOcpxActionTypeConfig;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 转化目标字典表
+ * @Author: jeecg-boot
+ * @Date: 2021-02-22
+ * @Version: V1.0
+ */
+public interface IKuaiShouOcpxActionTypeConfigService extends IService<KuaiShouOcpxActionTypeConfig> {
+
+}

+ 19 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/KuaiShouOcpxActionTypeConfigServiceImpl.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.common.module.service.impl;
+
+import cn.com.ctop.common.module.entity.KuaiShouOcpxActionTypeConfig;
+import cn.com.ctop.common.module.mapper.KuaiShouOcpxActionTypeConfigMapper;
+import cn.com.ctop.common.module.service.IKuaiShouOcpxActionTypeConfigService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 转化目标字典表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-02-22
+ */
+@Service
+public class KuaiShouOcpxActionTypeConfigServiceImpl extends ServiceImpl<KuaiShouOcpxActionTypeConfigMapper, KuaiShouOcpxActionTypeConfig> implements IKuaiShouOcpxActionTypeConfigService {
+
+}

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

@@ -31,7 +31,7 @@ public class KuaishouDailyAccountReportLoadJob {
     public void execute() throws Exception {
         Date getDate = DateUtils.addDay(new Date(), -1);
         Date getDate2 = DateUtils.addDay(new Date(), -2);
-        Date getDate3 = DateUtils.addDay(new Date(), -3);
+
         //1:查询当日数据
         List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
         if (null == tokens || tokens.isEmpty()) {
@@ -42,8 +42,7 @@ public class KuaishouDailyAccountReportLoadJob {
         tokens.forEach(token -> executorService.submit(() ->{
                     kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate2, getDate2);
                     kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate, getDate);
-                    kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate3, getDate3);
-                    kuaishouInterfaceService.getAdvertiserReportHourly(token, getDate3, getDate3);
+
 
         }));
     }

+ 41 - 5
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaiShouAppInfoController.java

@@ -153,6 +153,41 @@ public class AiKuaiShouAppInfoController {
 
 
     /**
+     * 查询 app列表
+     *
+     * @param requestJson
+     * @return
+     */
+
+    @PostMapping(value = "/list")
+    public JSONObject queryPageList(@RequestBody JSONObject requestJson) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            Long account_id = requestJson.getLong("accountId");
+            if (Check.isNull(account_id)) {
+                throw new Exception("账户id不能为空");
+            }
+            QueryWrapper<AiKuaiShouAppInfo> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("account_id", account_id);
+            queryWrapper.eq("status", 2);
+            List<AiKuaiShouAppInfo> list = aiKuaiShouAppInfoService.list(queryWrapper);
+            if (Check.isNull(list)) {
+                throw new Exception("未获取到对应的app集合");
+            }
+            returnJson.put("code", 0);
+            returnJson.put("message", "success");
+            returnJson.put("data", list);
+        } catch (Exception e) {
+            e.printStackTrace();
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+        }
+
+        return returnJson;
+    }
+
+
+    /**
      * 分页列表查询
      *
      * @param aiKuaiShouAppInfo
@@ -163,13 +198,14 @@ public class AiKuaiShouAppInfoController {
      */
     @AutoLog(value = "ai批量上传应用-分页列表查询")
     @ApiOperation(value = "ai批量上传应用-分页列表查询", notes = "ai批量上传应用-分页列表查询")
-    @GetMapping(value = "/list")
-    public Result<IPage<AiKuaiShouAppInfo>> queryPageList(AiKuaiShouAppInfo aiKuaiShouAppInfo,
-                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                          HttpServletRequest req) {
+    @GetMapping(value = "/pageList")
+    public Result<IPage<AiKuaiShouAppInfo>> pageList(AiKuaiShouAppInfo aiKuaiShouAppInfo,
+                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                     HttpServletRequest req) {
         Result<IPage<AiKuaiShouAppInfo>> result = new Result<>();
         QueryWrapper<AiKuaiShouAppInfo> queryWrapper = QueryGenerator.initQueryWrapper(aiKuaiShouAppInfo, req.getParameterMap());
+        queryWrapper.orderByDesc("create_time");
         Page<AiKuaiShouAppInfo> page = new Page<AiKuaiShouAppInfo>(pageNo, pageSize);
         IPage<AiKuaiShouAppInfo> pageList = aiKuaiShouAppInfoService.page(page, queryWrapper);
         result.setSuccess(true);

+ 34 - 28
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaiShouCreateServiceImpl.java

@@ -188,12 +188,12 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
                         if (code == 0) {
                             JSONObject target = unionJson.getJSONObject("target");
                             createJson.put("target", target);
-                        }else{
+                        } else {
                             throw new Exception("联盟广告位定向模板错误");
                         }
                     }
                 } else {
-                    JSONObject target = getTarget(groupCreateJson);
+                    JSONObject target = getTarget(groupCreateJson, sceneId);
                     if (!Check.isNull(target)) {
                         createJson.put("target", target); // 定向数据
                     }
@@ -511,7 +511,7 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
      * @param unitJson
      * @return
      */
-    private JSONObject getTarget(JSONObject unitJson) {
+    private JSONObject getTarget(JSONObject unitJson, Integer sceneId) {
         JSONObject target = new JSONObject();
         if (!Check.isNull(unitJson.getJSONArray("region"))) {
             target.put("region", unitJson.getJSONArray("region")); // 地域
@@ -552,17 +552,19 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
         if (!Check.isNull(unitJson.getJSONArray("device_price"))) {
             target.put("device_price", unitJson.getJSONArray("device_price")); // 设备价格
         }
-        if (!Check.isNull(unitJson.getInteger("business_interest_type"))) {
-            target.put("business_interest_type", unitJson.getInteger("business_interest_type")); // 商业兴趣类型
-        }
-        if (!Check.isNull(unitJson.getJSONArray("business_interest"))) {
-            target.put("business_interest", unitJson.getJSONArray("business_interest")); // 商业兴趣
-        }
-        if (!Check.isNull(unitJson.getJSONArray("fans_star"))) {
-            target.put("fans_star", unitJson.getJSONArray("fans_star")); // 网红粉丝
-        }
-        if (!Check.isNull(unitJson.getJSONArray("interest_video"))) {
-            target.put("interest_video", unitJson.getJSONArray("interest_video")); // 兴趣视频用户
+        if (sceneId != 5) {
+            if (!Check.isNull(unitJson.getInteger("business_interest_type"))) {
+                target.put("business_interest_type", unitJson.getInteger("business_interest_type")); // 商业兴趣类型
+            }
+            if (!Check.isNull(unitJson.getJSONArray("business_interest"))) {
+                target.put("business_interest", unitJson.getJSONArray("business_interest")); // 商业兴趣
+            }
+            if (!Check.isNull(unitJson.getJSONArray("fans_star"))) {
+                target.put("fans_star", unitJson.getJSONArray("fans_star")); // 网红粉丝
+            }
+            if (!Check.isNull(unitJson.getJSONArray("interest_video"))) {
+                target.put("interest_video", unitJson.getJSONArray("interest_video")); // 兴趣视频用户
+            }
         }
         if (!Check.isNull(unitJson.getJSONArray("app_interest"))) {
             target.put("app_interest", unitJson.getJSONArray("app_interest")); // APP行为-按分类
@@ -570,8 +572,10 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
         if (!Check.isNull(unitJson.getJSONArray("app_ids"))) {
             target.put("app_ids", unitJson.getJSONArray("app_ids")); // APP行为-按APP名称
         }
-        if (!Check.isNull(unitJson.getInteger("filter_converted_level"))) {
-            target.put("filter_converted_level", unitJson.getInteger("filter_converted_level")); // APP行为-按APP名称
+        if (sceneId != 5) {
+            if (!Check.isNull(unitJson.getInteger("filter_converted_level"))) {
+                target.put("filter_converted_level", unitJson.getInteger("filter_converted_level")); // APP行为-按APP名称
+            }
         }
         if (!Check.isNull(unitJson.getJSONArray("population"))) {
             target.put("population", unitJson.getJSONArray("population")); // 人群包定向
@@ -582,19 +586,21 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
         if (!Check.isNull(unitJson.getJSONArray("paid_audience"))) {
             target.put("paid_audience", unitJson.getJSONArray("paid_audience")); // 付费人群包id
         }
-        if (!Check.isNull(unitJson.getInteger("is_open")) && unitJson.getInteger("is_open") == 1) {
-            JSONObject intelli_extend = new JSONObject();
-            intelli_extend.put("is_open", unitJson.getInteger("is_open")); // 开启智能扩量
-            if (!Check.isNull(unitJson.getInteger("no_age_break"))) {
-                intelli_extend.put("no_age_break", unitJson.getInteger("no_age_break")); //  不可突破年龄
-            }
-            if (!Check.isNull(unitJson.getInteger("no_gender_break"))) {
-                intelli_extend.put("no_gender_break", unitJson.getInteger("no_gender_break")); //  不可突破性别
-            }
-            if (!Check.isNull(unitJson.getInteger("no_area_break"))) {
-                intelli_extend.put("no_area_break", unitJson.getInteger("no_area_break")); //  不可突破地域
+        if (sceneId != 5) {
+            if (!Check.isNull(unitJson.getInteger("is_open")) && unitJson.getInteger("is_open") == 1) {
+                JSONObject intelli_extend = new JSONObject();
+                intelli_extend.put("is_open", unitJson.getInteger("is_open")); // 开启智能扩量
+                if (!Check.isNull(unitJson.getInteger("no_age_break"))) {
+                    intelli_extend.put("no_age_break", unitJson.getInteger("no_age_break")); //  不可突破年龄
+                }
+                if (!Check.isNull(unitJson.getInteger("no_gender_break"))) {
+                    intelli_extend.put("no_gender_break", unitJson.getInteger("no_gender_break")); //  不可突破性别
+                }
+                if (!Check.isNull(unitJson.getInteger("no_area_break"))) {
+                    intelli_extend.put("no_area_break", unitJson.getInteger("no_area_break")); //  不可突破地域
+                }
+                target.put("intelli_extend", intelli_extend); // 智能扩量
             }
-            target.put("intelli_extend", intelli_extend); // 智能扩量
         }
         if (Check.isNull(unitJson.getJSONObject("behavior_interest"))) {
             // TODO 只是单独结构体 后续需要优化

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

@@ -568,14 +568,14 @@ public class BatchController {
      * @return
      */
     @GetMapping(value = "/getIsActivate")
-    public Result<JSONObject> getIsActivate(Long accountId) {
+    public Result<JSONObject> getIsActivate(Long accountId, Integer campaignType, Long appId) {
         Result result = new Result<JSONObject>();
         try {
             CtopOauthToken token = oauthTokenService.getTokenByAccountId(accountId);
             if (Check.isNull(token)) {
                 throw new Exception("未获取授权信息");
             }
-            JSONObject deepConversionJson = iKuaishouInterfaceService.getDeepConversionInfosV2(accountId, token.getAccessToken());
+            JSONObject deepConversionJson = iKuaishouInterfaceService.getDeepConversionInfosV2(accountId, token.getAccessToken(), campaignType, appId);
             if (Check.isNull(deepConversionJson)) {
                 throw new Exception("深度类型数据返回为空");
             }

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

@@ -1,13 +1,9 @@
 package cn.com.ctop.kuaishou.modules.batch.controller;
 
 import cn.com.ctop.common.module.annotation.AutoLog;
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.StringUtils;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouConversionTypes;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouConversionTypesService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -51,29 +47,6 @@ import java.util.Map;
 public class KuaiShouConversionTypesController {
     @Autowired
     private IKuaiShouConversionTypesService kuaiShouConversionTypesService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-    @Autowired
-    private ICtopOauthTokenService oauthTokenService;
-
-    @GetMapping(value = "/getIsActivate")
-    public Result<IPage<KuaiShouConversionTypes>> queryPageList(Long accountId) {
-        Result result = new Result<IPage<KuaiShouConversionTypes>>();
-        CtopOauthToken token = oauthTokenService.getOauthTokenByAccountId(String.valueOf(accountId));
-        if (Check.isNull(token)) {
-            result.setSuccess(false);
-            result.setMessage("未获取到授权信息");
-            return result;
-        }
-        Map<String, Object> resultMap = kuaishouInterfaceService.getDeepConversionInfos(accountId, token.getAccessToken());
-        if ((Integer) resultMap.get("code") == 0) {
-            result.setResult(resultMap);
-        }
-        result.setSuccess(true);
-
-        return result;
-
-    }
 
 
     /**

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

@@ -1,8 +1,11 @@
 package cn.com.ctop.kuaishou.modules.batch.controller;
 
 import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouBatchCampaignPreview;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouUpdateService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouBatchCampaignPreviewService;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
@@ -21,7 +24,6 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
 import org.jeecgframework.poi.excel.entity.ImportParams;
 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -56,6 +58,12 @@ import java.util.Map;
 public class KuaishouBatchCampaignPreviewController {
     @Autowired
     private IKuaishouBatchCampaignPreviewService kuaishouBatchCampaignPreviewService;
+    @Autowired
+    private IKuaishouBatchCampaignPreviewService campaignPreviewService;
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaiShouUpdateService kuaiShouUpdateService;
 
     /**
      * 分页列表查询
@@ -168,6 +176,39 @@ public class KuaishouBatchCampaignPreviewController {
     }
 
     /**
+     * 手动修改定时启动
+     *
+     * @param kuaishouBatchCampaignPreview
+     * @return
+     */
+    @AutoLog(value = "手动修改定时启动")
+    @ApiOperation(value = "手动修改定时启动", notes = "手动修改定时启动")
+    @PostMapping(value = "/updateStatus")
+    public Result<Object> kuaishouBatchCampaignTimeStartJob() {
+        try {
+            List<KuaishouBatchCampaignPreview> campaignPreviewList = campaignPreviewService.queryListByTime();
+            if (!Check.isNull(campaignPreviewList)) {
+                for (KuaishouBatchCampaignPreview campaignPreview : campaignPreviewList) {
+                    CtopOauthToken token = tokenService.getTokenByAccountId(campaignPreview.getAccountId());
+                    if (!Check.isNull(token)) {
+                        Map<String, Object> map = kuaiShouUpdateService.updateCampaignStatus(token.getAccessToken(), campaignPreview.getAccountId(), campaignPreview.getCampaignId(), 1, "timingStart");
+                        if ((boolean) map.get("success")) {
+                            QueryWrapper<KuaishouBatchCampaignPreview> queryWrapper = new QueryWrapper<>();
+                            queryWrapper.eq("id", campaignPreview.getId());
+                            KuaishouBatchCampaignPreview campaign = new KuaishouBatchCampaignPreview();
+                            campaign.setMessage("定时启动成功!");
+                            campaignPreviewService.update(campaign, queryWrapper);
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            return Result.error("error:" + e.getMessage());
+        }
+        return Result.ok("success");
+    }
+
+    /**
      * 通过id删除
      *
      * @param id

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

@@ -55,6 +55,17 @@ public class KuaishouTemplateController {
     @Autowired
     private ICtopOauthTokenService oauthTokenService;
 
+
+    @AutoLog(value = "快手-定向模板-分页列表查询")
+    @ApiOperation(value = "快手-定向模板-分页列表查询", notes = "快手-定向模板-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<List<JSONObject>> list(Long accountId,Integer platformOs) {
+        Result<List<JSONObject>> result = new Result<>();
+        List<JSONObject> list = kuaishouTemplateService.getJsonArrByAccountId(accountId,platformOs);
+        result.setSuccess(true);
+        result.setResult(list);
+        return result;
+    }
     /**
      * 分页列表查询
      *
@@ -66,7 +77,7 @@ public class KuaishouTemplateController {
      */
     @AutoLog(value = "快手-定向模板-分页列表查询")
     @ApiOperation(value = "快手-定向模板-分页列表查询", notes = "快手-定向模板-分页列表查询")
-    @GetMapping(value = "/list")
+    @GetMapping(value = "/queryPageList")
     public Result<IPage<KuaishouTemplate>> queryPageList(KuaishouTemplate kuaishouTemplate,
                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,

+ 5 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaishouTemplateMapper.java

@@ -1,7 +1,11 @@
 package cn.com.ctop.kuaishou.modules.batch.mapper;
 
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouTemplate;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 快手-定向模板
@@ -11,5 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @cersion: V1.0
  */
 public interface KuaishouTemplateMapper extends BaseMapper<KuaishouTemplate> {
-
+    List<JSONObject> getJsonArrByAccountId(@Param("accountId") Long accountId,@Param("platformOs") Integer platformOs);
 }

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

@@ -2,4 +2,21 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.kuaishou.modules.batch.mapper.KuaishouTemplateMapper">
 
+    <select id="getJsonArrByAccountId" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+            t1.account_id AS 'accountId',
+            t1.template_id AS 'templateId',
+            t1.template_name AS 'templateName',
+            t1.unit_count AS 'unitCount',
+            t2.platform_os AS 'platformOs'
+        FROM
+            ctop_kuaishou_template t1
+                LEFT JOIN ctop_kuaishou_template_target t2 ON t1.template_id = t2.template_id
+        WHERE
+            t1.account_id = #{accountId}
+        <if test="platformOs != null">
+            AND t2.platform_os = #{platformOs}
+        </if>
+    </select>
+
 </mapper>

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

@@ -89,7 +89,6 @@
         (
         SELECT
         sum(charge) as 'charge',
-        photo_id as 'photo_id',
         signature
         FROM
         ctop_kuaishou_report_daily_material

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

@@ -174,21 +174,13 @@ public interface IKuaishouInterfaceService {
 
 
     /**
-     * 获取可选的深度转化类型
-     *
-     * @param advertiserId
-     * @return
-     */
-    Map<String, Object> getDeepConversionInfos(Long advertiserId, String accessToken);
-
-    /**
      * 取可选的深度转化类型
      *
      * @param advertiserId
      * @param accessToken
      * @return
      */
-    JSONObject getDeepConversionInfosV2(Long advertiserId, String accessToken);
+    JSONObject getDeepConversionInfosV2(Long advertiserId, String accessToken, Integer campaignType, Long appId);
 
 
     /**

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

@@ -4,6 +4,8 @@ import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouTemplate;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * @Description: 快手-定向模板
  * @Author: jeecg-boot
@@ -17,4 +19,6 @@ public interface IKuaishouTemplateService extends IService<KuaishouTemplate> {
     JSONObject createTemplate(Long accountId, String accessToken, JSONObject requestJson);
 
     JSONObject updateTemplate(Long accountId, String accessToken, JSONObject requestJson);
+
+    List<JSONObject> getJsonArrByAccountId(Long accountId,Integer platformOs);
 }

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

@@ -52,6 +52,7 @@ public class KuaishouBatchGroupPreviewServiceImpl extends ServiceImpl<KuaishouBa
             groupPreview.setBid(data.getInteger("bid"));
             groupPreview.setCpaBid(data.getInteger("cpaBid"));
             groupPreview.setDayBudget(data.getInteger("dayBudget"));
+            groupPreview.setDeepConversionBid(data.getInteger("deepConversionBid"));
             groupWrapper.eq("id", groupIds.getString(i));
             if (!Check.isNull(groupPreview.getBid()) || !Check.isNull(groupPreview.getCpaBid()) || !Check.isNull(groupPreview.getDayBudget())) {
                 groupPreviewMapper.update(groupPreview, groupWrapper);

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

@@ -183,7 +183,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
     private void getVideoListByPage(CtopOauthToken token, String startDate, String endDate, int page) {
         try {
-          //  log.info("获取视频数据,accountId:{}", token.getAccountId());
+            //  log.info("获取视频数据,accountId:{}", token.getAccountId());
             String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.VIDEO_LIST;
             Map<String, String> headers = new HashMap<>();
             headers.put("Content-Type", "application/json");
@@ -1936,86 +1936,18 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         return kuaiShouResult;
     }
 
-    @Override
-    public Map<String, Object> getDeepConversionInfos(Long advertiserId, String accessToken) {
-        String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.DEEP_CONVERSION_INFOS;
-        JSONObject param = new JSONObject();
-        param.put("advertiser_id", advertiserId);
-        Map<String, String> headers = new HashMap<String, String>();
-        headers.put("Access-Token", accessToken);
-        headers.put("Content-Type", " application/json");
-        Map<String, Object> resultMap = new HashMap<>();
-        try {
-            String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
-            JSONObject resultJson = JSONObject.parseObject(result);
-            log.info(resultJson.toJSONString());
-            if (!Check.isNullMap(resultJson)) {
-                Integer code = resultJson.getInteger("code");
-                Integer isActivate;
-                Integer isFormSubmit;
-                if (code == 0) {
-                    Map<String, Object> deleteMap = new HashMap<>();
-                    deleteMap.put("account_id", advertiserId);
-                    //删除历史数据
-                    conversionInfosMapper.deleteByMap(deleteMap);
-                    conversionTypesMapper.deleteByMap(deleteMap);
-                    JSONObject dataJson = resultJson.getJSONObject("data");
-                    if (!Check.isNullMap(dataJson)) {
-                        KuaiShouConversionInfos conversionInfos = new KuaiShouConversionInfos();
-                        conversionInfos.setAccountId(advertiserId);
-                        isActivate = dataJson.getInteger("is_activate");
-                        isFormSubmit = dataJson.getInteger("is_form_submit");
-                        conversionInfos.setIsActivate(isActivate);
-                        conversionInfos.setIsFormSubmit(isFormSubmit);
-                        conversionInfosMapper.insert(conversionInfos);
-                        JSONArray conversionTypeArr = dataJson.getJSONArray("deep_conversion_types");
-                        if (!Check.isNull(conversionTypeArr)) {
-                            for (int i = 0; i < conversionTypeArr.size(); i++) {
-                                JSONObject conversionType = JSONObject.parseObject(conversionTypeArr.get(i).toString());
-                                if (!Check.isNull(conversionType)) {
-                                    KuaiShouConversionTypes conversionTypes = new KuaiShouConversionTypes();
-                                    conversionTypes.setAccountId(advertiserId);
-                                    conversionTypes.setDeepConversionTypes(conversionType.getInteger("deep_conversion_type"));
-                                    conversionTypes.setDescStr(conversionType.getString("desc"));
-                                    conversionTypesMapper.insert(conversionTypes);
-                                }
-                            }
-                        }
-                        resultMap.put("isActivate", isActivate);
-                        resultMap.put("isFormSubmit", isFormSubmit);
-                        resultMap.put("deepConversionTypes", conversionTypeArr);
-                        resultMap.put("code", 0);
-                        resultMap.put("success", true);
-                        resultMap.put("message", "查询成功");
-                    }
-                } else {
-                    log.error("获取可选的深度转化类型返回异常,advertiserId:{},异常信息:{}", advertiserId, resultJson);
-                    resultMap.put("code", -1);
-                    resultMap.put("success", false);
-                    resultMap.put("message", "获取可选的深度转化类型返回异常");
-                }
-            } else {
-                log.error("快手,获取可选的深度转化类型返回为空,advertiserId:{}", advertiserId);
-                resultMap.put("code", -1);
-                resultMap.put("success", false);
-                resultMap.put("message", "获取可选的深度转化类型返回为空");
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            resultMap.put("code", -1);
-            resultMap.put("success", false);
-            resultMap.put("message", "接口异常");
-        }
-        return resultMap;
-
-    }
-
 
     @Override
-    public JSONObject getDeepConversionInfosV2(Long advertiserId, String accessToken) {
+    public JSONObject getDeepConversionInfosV2(Long advertiserId, String accessToken, Integer campaignType, Long appId) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.DEEP_CONVERSION_INFOS;
         JSONObject param = new JSONObject();
         param.put("advertiser_id", advertiserId);
+        if (!Check.isNull(campaignType)) {
+            param.put("campaign_type", campaignType);
+        }
+        if (!Check.isNull(appId)) {
+            param.put("app_id", appId);
+        }
         Map<String, String> headers = new HashMap<String, String>();
         headers.put("Access-Token", accessToken);
         headers.put("Content-Type", " application/json");
@@ -2038,6 +1970,12 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                         returnJson.put("isFirstdayRoi", dataJson.getInteger("is_firstday_roi"));
                         returnJson.put("isRegister", dataJson.getInteger("is_register"));
                         returnJson.put("isOrderSubmit", dataJson.getInteger("is_order_submit"));
+                        returnJson.put("isAddWechat", dataJson.getInteger("is_add_wechat"));
+                        returnJson.put("isAppInvoked", dataJson.getInteger("is_app_invoked"));
+                        returnJson.put("isMultiConversion", dataJson.getInteger("is_multi_conversion"));
+                        returnJson.put("isAdWatchTimes", dataJson.getInteger("is_ad_watch_times"));
+
+
                         JSONArray deep_conversion_types = dataJson.getJSONArray("deep_conversion_types");
                         JSONArray deepConversionTypes = new JSONArray();
                         if (!Check.isNull(deep_conversion_types)) {

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

@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -31,8 +32,14 @@ import java.util.Map;
 public class KuaishouTemplateServiceImpl extends ServiceImpl<KuaishouTemplateMapper, KuaishouTemplate> implements IKuaishouTemplateService {
     @Autowired
     private IKuaishouTemplateTargetService templateTargetService;
+ @Autowired
+    private KuaishouTemplateMapper templateMapper;
 
     @Override
+    public List<JSONObject> getJsonArrByAccountId(Long accountId,Integer platformOs) {
+        return templateMapper.getJsonArrByAccountId(accountId,platformOs);
+    }
+    @Override
     public void getTemplateByAccountId(Long accountId, String accessToken, Integer page) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.TEMPLATE_LIST;
         JSONObject param = new JSONObject();