Browse Source

直播投流,初版

zhaoxian 3 years ago
parent
commit
b78705937d
42 changed files with 5348 additions and 0 deletions
  1. 100 0
      ruixuan-common/src/main/java/com/ruixuan/common/utils/KuaishouAPIConstant.java
  2. 579 0
      ruixuan-common/src/main/java/com/ruixuan/common/utils/RedisUtil.java
  3. 80 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/controller/KuaishouLaunchCampaignAutoStrategyController.java
  4. 95 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/controller/KuaishouLaunchCampaignController.java
  5. 75 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/controller/KuaishouLaunchCreativeController.java
  6. 82 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/controller/KuaishouLaunchGroupController.java
  7. 106 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/controller/KuaishouLaunchGroupTargetController.java
  8. 73 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/controller/KuaishouLaunchTargetTemplateController.java
  9. 85 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/entity/KuaishouLaunchCampaign.java
  10. 272 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/entity/KuaishouLaunchCampaignAutoStrategy.java
  11. 136 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/entity/KuaishouLaunchCreative.java
  12. 169 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/entity/KuaishouLaunchGroup.java
  13. 224 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/entity/KuaishouLaunchGroupRecord.java
  14. 99 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/entity/KuaishouLaunchGroupTarget.java
  15. 106 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/entity/KuaishouLaunchTargetTemplate.java
  16. 56 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/mapper/KuaishouLaunchCampaignAutoStrategyMapper.java
  17. 65 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/mapper/KuaishouLaunchCampaignMapper.java
  18. 63 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/mapper/KuaishouLaunchCreativeMapper.java
  19. 62 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/mapper/KuaishouLaunchGroupMapper.java
  20. 62 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/mapper/KuaishouLaunchGroupRecordMapper.java
  21. 47 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/mapper/KuaishouLaunchGroupTargetMapper.java
  22. 63 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/mapper/KuaishouLaunchTargetTemplateMapper.java
  23. 50 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/service/IKuaishouLaunchCampaignAutoStrategyService.java
  24. 69 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/service/IKuaishouLaunchCampaignService.java
  25. 48 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/service/IKuaishouLaunchCreativeService.java
  26. 63 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/service/IKuaishouLaunchGroupService.java
  27. 45 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/service/IKuaishouLaunchGroupTargetService.java
  28. 66 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/service/IKuaishouLaunchTargetTemplateService.java
  29. 206 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/service/impl/KuaishouLaunchCampaignAutoStrategyServiceImpl.java
  30. 174 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/service/impl/KuaishouLaunchCampaignServiceImpl.java
  31. 120 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/service/impl/KuaishouLaunchCreativeServiceImpl.java
  32. 226 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/service/impl/KuaishouLaunchGroupServiceImpl.java
  33. 137 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/service/impl/KuaishouLaunchGroupTargetServiceImpl.java
  34. 100 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/service/impl/KuaishouLaunchTargetTemplateServiceImpl.java
  35. 60 0
      ruixuan-launch/src/main/java/com/ruixuan/launch/unitls/APIUtil.java
  36. 259 0
      ruixuan-launch/src/main/resources/mapper/launch/KuaishouLaunchCampaignAutoStrategyMapper.xml
  37. 123 0
      ruixuan-launch/src/main/resources/mapper/launch/KuaishouLaunchCampaignMapper.xml
  38. 170 0
      ruixuan-launch/src/main/resources/mapper/launch/KuaishouLaunchCreativeMapper.xml
  39. 200 0
      ruixuan-launch/src/main/resources/mapper/launch/KuaishouLaunchGroupMapper.xml
  40. 257 0
      ruixuan-launch/src/main/resources/mapper/launch/KuaishouLaunchGroupRecordMapper.xml
  41. 124 0
      ruixuan-launch/src/main/resources/mapper/launch/KuaishouLaunchGroupTargetMapper.xml
  42. 152 0
      ruixuan-launch/src/main/resources/mapper/launch/KuaishouLaunchTargetTemplateMapper.xml

+ 100 - 0
ruixuan-common/src/main/java/com/ruixuan/common/utils/KuaishouAPIConstant.java

@@ -0,0 +1,100 @@
+package com.ruixuan.common.utils;
+
+/**
+ * 快手磁力金牛API接口常量
+ */
+public class KuaishouAPIConstant {
+
+
+    /**
+     * 查询广告列表
+     */
+    public static final String SEARCH_AD = "/rest/openapi/gw/esp/v1/report/ad/search";
+
+    /**
+     * 创建广告计划
+     */
+    public static final String CREATE_CAMPAIGN = "/rest/openapi/gw/esp/v1/campaign/create";
+    /**
+     * 修改广告计划
+     */
+    public static final String UPDATE_CAMPAIGN = "/rest/openapi/gw/esp/v1/campaign/update";
+    /**
+     * 修改广告计划状态
+     */
+    public static final String UPDATE_CAMPAIGN_STATUS = "/rest/openapi/v1/campaign/update/status";
+
+    /**
+     * 创建广告组
+     */
+    public static final String CREATE_UNIT = "/rest/openapi/gw/esp/v1/unit/create";
+    /**
+     * 修改广告组
+     */
+    public static final String UPDATE_UNIT = "/rest/openapi/gw/esp/v1/unit/update";
+    /**
+     * 修改广告组状态
+     */
+    public static final String UPDATE_UNIT_STATUS = "/rest/openapi/gw/esp/v1/unit/update/status";
+    /**
+     * 修改广告组预算
+     */
+    public static final String UPDATE_UNIT_DAYBUDGET = "/rest/openapi/gw/esp/v1/unit/update/budget";
+    /**
+     * 修改广告组出价
+     */
+    public static final String UPDATE_UNIT_CPABID = "/rest/openapi/gw/esp/v1/unit/update/cpaBid";
+    /**
+     * 修改广告组 roi
+     */
+    public static final String UPDATE_UNIT_ROI = "/rest/openapi/gw/esp/v1/unit/update/roi";
+
+    /**
+     * 创建创意
+     */
+    public static final String CREATE_CREATIVE = "/rest/openapi/gw/esp/v1/creative/create";
+
+    /**
+     * 修改创意
+     */
+    public static final String UPDATE_CREATIVE = "/rest/openapi/gw/esp/v1/creative/update";
+
+    /**
+     * 修改创意状态
+     */
+    public static final String UPDATE_CREATIVE_STATUS  = "/rest/openapi/gw/esp/v1/creative/update/status";
+
+    /**
+     * 获取地域信息
+     */
+    public static final String REGION = "/rest/openapi/gw/esp/v1/tool/region/list";
+
+
+    /**
+     * 获取地域信息
+     */
+    public static final String POPULATION = "/rest/openapi/v2/dmp/population/list";
+
+    /**
+     * 获取购物意图信息
+     */
+    public static final String PURCHASE_INTENTION = "/rest/openapi/gw/esp/v1/tool/purchase_intention/list";
+
+
+    /**
+     * 获取网红信息-网红查询
+     */
+    public static final String CELEBRITY_QUERY = "/rest/openapi/gw/esp/v1/tool/celebrity/search";
+
+    /**
+     * 获取网红信息-网红分类
+     */
+    public static final String CELEBRITY_TYPE = "/rest/openapi/gw/esp/v1/tool/celebrity/list";
+
+  /**
+     *  查询视频库
+     */
+    public static final String VIDEO_QUERY = "/rest/openapi/gw/esp/v1/filemanage/video/list";
+
+
+}

+ 579 - 0
ruixuan-common/src/main/java/com/ruixuan/common/utils/RedisUtil.java

@@ -0,0 +1,579 @@
+package com.ruixuan.common.utils;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.Cursor;
+import org.springframework.data.redis.core.RedisCallback;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.core.ScanOptions;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * redis 工具类
+ * @Author Scott
+ *
+ */
+@Component
+public class RedisUtil {
+
+	@Autowired
+	public RedisTemplate redisTemplate;
+	@Autowired
+	private StringRedisTemplate stringRedisTemplate;
+
+	/**
+	 * 指定缓存失效时间
+	 * 
+	 * @param key  键
+	 * @param time 时间(秒)
+	 * @return
+	 */
+	public boolean expire(String key, long time) {
+		try {
+			if (time > 0) {
+				redisTemplate.expire(key, time, TimeUnit.SECONDS);
+			}
+			return true;
+		} catch (Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+	}
+
+	/**
+	 * 根据key 获取过期时间
+	 * 
+	 * @param key 键 不能为null
+	 * @return 时间(秒) 返回0代表为永久有效
+	 */
+	public long getExpire(String key) {
+		return redisTemplate.getExpire(key, TimeUnit.SECONDS);
+	}
+
+	/**
+	 * 判断key是否存在
+	 * 
+	 * @param key 键
+	 * @return true 存在 false不存在
+	 */
+	public boolean hasKey(String key) {
+		try {
+			return redisTemplate.hasKey(key);
+		} catch (Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+	}
+
+	/**
+	 * 删除缓存
+	 * 
+	 * @param key 可以传一个值 或多个
+	 */
+	@SuppressWarnings("unchecked")
+	public void del(String... key) {
+		if (key != null && key.length > 0) {
+			if (key.length == 1) {
+				redisTemplate.delete(key[0]);
+			} else {
+				redisTemplate.delete((Collection<String>) CollectionUtils.arrayToList(key));
+			}
+		}
+	}
+
+	// ============================String=============================
+	/**
+	 * 普通缓存获取
+	 * 
+	 * @param key 键
+	 * @return 值
+	 */
+	public Object get(String key) {
+		return key == null ? null : redisTemplate.opsForValue().get(key);
+	}
+
+	/**
+	 * 普通缓存放入
+	 * 
+	 * @param key   键
+	 * @param value 值
+	 * @return true成功 false失败
+	 */
+	public boolean set(String key, Object value) {
+		try {
+			redisTemplate.opsForValue().set(key, value);
+			return true;
+		} catch (Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+
+	}
+
+	/**
+	 * 普通缓存放入并设置时间
+	 * 
+	 * @param key   键
+	 * @param value 值
+	 * @param time  时间(秒) time要大于0 如果time小于等于0 将设置无限期
+	 * @return true成功 false 失败
+	 */
+	public boolean set(String key, Object value, long time) {
+		try {
+			if (time > 0) {
+				redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
+			} else {
+				set(key, value);
+			}
+			return true;
+		} catch (Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+	}
+
+	/**
+	 * 递增
+	 * 
+	 * @param key 键
+	 * @param by  要增加几(大于0)
+	 * @return
+	 */
+	public long incr(String key, long delta) {
+		if (delta < 0) {
+			throw new RuntimeException("递增因子必须大于0");
+		}
+		return redisTemplate.opsForValue().increment(key, delta);
+	}
+
+	/**
+	 * 递减
+	 * 
+	 * @param key 键
+	 * @param by  要减少几(小于0)
+	 * @return
+	 */
+	public long decr(String key, long delta) {
+		if (delta < 0) {
+			throw new RuntimeException("递减因子必须大于0");
+		}
+		return redisTemplate.opsForValue().increment(key, -delta);
+	}
+
+	// ================================Map=================================
+	/**
+	 * HashGet
+	 * 
+	 * @param key  键 不能为null
+	 * @param item 项 不能为null
+	 * @return 值
+	 */
+	public Object hget(String key, String item) {
+		return redisTemplate.opsForHash().get(key, item);
+	}
+
+	/**
+	 * 获取hashKey对应的所有键值
+	 * 
+	 * @param key 键
+	 * @return 对应的多个键值
+	 */
+	public Map<Object, Object> hmget(String key) {
+		return redisTemplate.opsForHash().entries(key);
+	}
+
+	/**
+	 * HashSet
+	 * 
+	 * @param key 键
+	 * @param map 对应多个键值
+	 * @return true 成功 false 失败
+	 */
+	public boolean hmset(String key, Map<String, Object> map) {
+		try {
+			redisTemplate.opsForHash().putAll(key, map);
+			return true;
+		} catch (Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+	}
+
+	/**
+	 * HashSet 并设置时间
+	 * 
+	 * @param key  键
+	 * @param map  对应多个键值
+	 * @param time 时间(秒)
+	 * @return true成功 false失败
+	 */
+	public boolean hmset(String key, Map<String, Object> map, long time) {
+		try {
+			redisTemplate.opsForHash().putAll(key, map);
+			if (time > 0) {
+				expire(key, time);
+			}
+			return true;
+		} catch (Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+	}
+
+	/**
+	 * 向一张hash表中放入数据,如果不存在将创建
+	 * 
+	 * @param key   键
+	 * @param item  项
+	 * @param value 值
+	 * @return true 成功 false失败
+	 */
+	public boolean hset(String key, String item, Object value) {
+		try {
+			redisTemplate.opsForHash().put(key, item, value);
+			return true;
+		} catch (Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+	}
+
+	/**
+	 * 向一张hash表中放入数据,如果不存在将创建
+	 * 
+	 * @param key   键
+	 * @param item  项
+	 * @param value 值
+	 * @param time  时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间
+	 * @return true 成功 false失败
+	 */
+	public boolean hset(String key, String item, Object value, long time) {
+		try {
+			redisTemplate.opsForHash().put(key, item, value);
+			if (time > 0) {
+				expire(key, time);
+			}
+			return true;
+		} catch (Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+	}
+
+	/**
+	 * 删除hash表中的值
+	 * 
+	 * @param key  键 不能为null
+	 * @param item 项 可以使多个 不能为null
+	 */
+	public void hdel(String key, Object... item) {
+		redisTemplate.opsForHash().delete(key, item);
+	}
+
+	/**
+	 * 判断hash表中是否有该项的值
+	 * 
+	 * @param key  键 不能为null
+	 * @param item 项 不能为null
+	 * @return true 存在 false不存在
+	 */
+	public boolean hHasKey(String key, String item) {
+		return redisTemplate.opsForHash().hasKey(key, item);
+	}
+
+	/**
+	 * hash递增 如果不存在,就会创建一个 并把新增后的值返回
+	 * 
+	 * @param key  键
+	 * @param item 项
+	 * @param by   要增加几(大于0)
+	 * @return
+	 */
+	public double hincr(String key, String item, double by) {
+		return redisTemplate.opsForHash().increment(key, item, by);
+	}
+
+	/**
+	 * hash递减
+	 * 
+	 * @param key  键
+	 * @param item 项
+	 * @param by   要减少记(小于0)
+	 * @return
+	 */
+	public double hdecr(String key, String item, double by) {
+		return redisTemplate.opsForHash().increment(key, item, -by);
+	}
+
+	// ============================set=============================
+	/**
+	 * 根据key获取Set中的所有值
+	 * 
+	 * @param key 键
+	 * @return
+	 */
+	public Set<Object> sGet(String key) {
+		try {
+			return redisTemplate.opsForSet().members(key);
+		} catch (Exception e) {
+			e.printStackTrace();
+			return null;
+		}
+	}
+
+	/**
+	 * 根据value从一个set中查询,是否存在
+	 * 
+	 * @param key   键
+	 * @param value 值
+	 * @return true 存在 false不存在
+	 */
+	public boolean sHasKey(String key, Object value) {
+		try {
+			return redisTemplate.opsForSet().isMember(key, value);
+		} catch (Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+	}
+
+	/**
+	 * 将数据放入set缓存
+	 * 
+	 * @param key    键
+	 * @param values 值 可以是多个
+	 * @return 成功个数
+	 */
+	public long sSet(String key, Object... values) {
+		try {
+			return redisTemplate.opsForSet().add(key, values);
+		} catch (Exception e) {
+			e.printStackTrace();
+			return 0;
+		}
+	}
+
+	/**
+	 * 将set数据放入缓存
+	 * 
+	 * @param key    键
+	 * @param time   时间(秒)
+	 * @param values 值 可以是多个
+	 * @return 成功个数
+	 */
+	public long sSetAndTime(String key, long time, Object... values) {
+		try {
+			Long count = redisTemplate.opsForSet().add(key, values);
+			if (time > 0) {
+				expire(key, time);
+			}
+			return count;
+		} catch (Exception e) {
+			e.printStackTrace();
+			return 0;
+		}
+	}
+
+	/**
+	 * 获取set缓存的长度
+	 * 
+	 * @param key 键
+	 * @return
+	 */
+	public long sGetSetSize(String key) {
+		try {
+			return redisTemplate.opsForSet().size(key);
+		} catch (Exception e) {
+			e.printStackTrace();
+			return 0;
+		}
+	}
+
+	/**
+	 * 移除值为value的
+	 * 
+	 * @param key    键
+	 * @param values 值 可以是多个
+	 * @return 移除的个数
+	 */
+	public long setRemove(String key, Object... values) {
+		try {
+			Long count = redisTemplate.opsForSet().remove(key, values);
+			return count;
+		} catch (Exception e) {
+			e.printStackTrace();
+			return 0;
+		}
+	}
+	// ===============================list=================================
+
+	/**
+	 * 获取list缓存的内容
+	 * 
+	 * @param key   键
+	 * @param start 开始
+	 * @param end   结束 0 到 -1代表所有值
+	 * @return
+	 */
+	public List<Object> lGet(String key, long start, long end) {
+		try {
+			return redisTemplate.opsForList().range(key, start, end);
+		} catch (Exception e) {
+			e.printStackTrace();
+			return null;
+		}
+	}
+
+	/**
+	 * 获取list缓存的长度
+	 * 
+	 * @param key 键
+	 * @return
+	 */
+	public long lGetListSize(String key) {
+		try {
+			return redisTemplate.opsForList().size(key);
+		} catch (Exception e) {
+			e.printStackTrace();
+			return 0;
+		}
+	}
+
+	/**
+	 * 通过索引 获取list中的值
+	 * 
+	 * @param key   键
+	 * @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推
+	 * @return
+	 */
+	public Object lGetIndex(String key, long index) {
+		try {
+			return redisTemplate.opsForList().index(key, index);
+		} catch (Exception e) {
+			e.printStackTrace();
+			return null;
+		}
+	}
+
+	/**
+	 * 将list放入缓存
+	 * 
+	 * @param key   键
+	 * @param value 值
+	 * @return
+	 */
+	public boolean lSet(String key, Object value) {
+		try {
+			redisTemplate.opsForList().rightPush(key, value);
+			return true;
+		} catch (Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+	}
+
+	/**
+	 * 将list放入缓存
+	 * 
+	 * @param key   键
+	 * @param value 值
+	 * @param time  时间(秒)
+	 * @return
+	 */
+	public boolean lSet(String key, Object value, long time) {
+		try {
+			redisTemplate.opsForList().rightPush(key, value);
+			if (time > 0) {
+				expire(key, time);
+			}
+			return true;
+		} catch (Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+	}
+
+	/**
+	 * 将list放入缓存
+	 * 
+	 * @param key   键
+	 * @param value 值
+	 * @param time  时间(秒)
+	 * @return
+	 */
+	public boolean lSet(String key, List<Object> value) {
+		try {
+			redisTemplate.opsForList().rightPushAll(key, value);
+			return true;
+		} catch (Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+	}
+
+	/**
+	 * 将list放入缓存
+	 * 
+	 * @param key   键
+	 * @param value 值
+	 * @param time  时间(秒)
+	 * @return
+	 */
+	public boolean lSet(String key, List<Object> value, long time) {
+		try {
+			redisTemplate.opsForList().rightPushAll(key, value);
+			if (time > 0) {
+				expire(key, time);
+			}
+			return true;
+		} catch (Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+	}
+
+	/**
+	 * 根据索引修改list中的某条数据
+	 * 
+	 * @param key   键
+	 * @param index 索引
+	 * @param value 值
+	 * @return
+	 */
+	public boolean lUpdateIndex(String key, long index, Object value) {
+		try {
+			redisTemplate.opsForList().set(key, index, value);
+			return true;
+		} catch (Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+	}
+
+	/**
+	 * 移除N个值为value
+	 * 
+	 * @param key   键
+	 * @param count 移除多少个
+	 * @param value 值
+	 * @return 移除的个数
+	 */
+	public long lRemove(String key, long count, Object value) {
+		try {
+			Long remove = redisTemplate.opsForList().remove(key, count, value);
+			return remove;
+		} catch (Exception e) {
+			e.printStackTrace();
+			return 0;
+		}
+	}
+
+}

+ 80 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/controller/KuaishouLaunchCampaignAutoStrategyController.java

@@ -0,0 +1,80 @@
+package com.ruixuan.launch.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.controller.BaseController;
+import com.ruixuan.common.core.domain.AjaxResult;
+import com.ruixuan.common.core.domain.ResultResponse;
+import com.ruixuan.common.core.page.TableDataInfo;
+import com.ruixuan.launch.service.IKuaishouLaunchCampaignAutoStrategyService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 投流策略Controller
+ *
+ * @author ruoyi
+ * @date 2022-07-05
+ */
+@Api(tags = "投流策略")
+@RestController
+@RequestMapping("/launch/strategy")
+public class KuaishouLaunchCampaignAutoStrategyController extends BaseController {
+    @Autowired
+    private IKuaishouLaunchCampaignAutoStrategyService kuaishouLaunchCampaignAutoStrategyService;
+
+    /**
+     * 查询投流策略列表
+     */
+    @GetMapping("/list")
+    @ApiOperation(value = "查询投流策略列表")
+    public TableDataInfo list(@ApiParam("计划名称") @RequestParam(value = "campaignName", required = false) String campaignName,
+                              @ApiParam("账户名称") @RequestParam(value = "accountName", required = false) String accountName) {
+        startPage();
+        List<JSONObject> list = kuaishouLaunchCampaignAutoStrategyService.selectKuaishouLaunchCampaignAutoStrategyList(campaignName, accountName);
+        return getDataTable(list);
+    }
+
+    /**
+     * 获取投流策略详细信息
+     */
+    @ApiOperation(value = "获取投流策略详细信息")
+    @GetMapping("/getById")
+    public AjaxResult getInfo(@ApiParam("id") @RequestParam(value = "id", required = true) Long id) {
+        return AjaxResult.success(kuaishouLaunchCampaignAutoStrategyService.selectKuaishouLaunchCampaignAutoStrategyById(id));
+    }
+
+    /**
+     * 新增投流策略
+     */
+    @PostMapping(value = "/add")
+    @ApiOperation(value = "新增投流策略")
+    public ResultResponse add(@RequestBody JSONObject requestJson) {
+        return kuaishouLaunchCampaignAutoStrategyService.insertKuaishouLaunchCampaignAutoStrategy(requestJson);
+    }
+
+    /**
+     * 修改投流策略
+     */
+    @PostMapping(value = "/edit")
+    @ApiOperation(value = "修改投流策略")
+    public AjaxResult edit(@RequestBody JSONObject requestJson) {
+        return toAjax(kuaishouLaunchCampaignAutoStrategyService.updateKuaishouLaunchCampaignAutoStrategy(requestJson));
+    }
+
+    @PostMapping(value = "/createByStrategy")
+    @ApiOperation(value = "执行策略")
+    public ResultResponse createByStrategy(@ApiParam("id") @RequestParam(value = "id", required = true) Long id) {
+        return kuaishouLaunchCampaignAutoStrategyService.createByStrategy(id);
+    }
+
+}

+ 95 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/controller/KuaishouLaunchCampaignController.java

@@ -0,0 +1,95 @@
+package com.ruixuan.launch.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.controller.BaseController;
+import com.ruixuan.common.core.domain.AjaxResult;
+import com.ruixuan.common.core.domain.ResultResponse;
+import com.ruixuan.common.core.page.TableDataInfo;
+import com.ruixuan.common.utils.Check;
+import com.ruixuan.launch.entity.KuaishouLaunchCampaign;
+import com.ruixuan.launch.service.IKuaishouLaunchCampaignService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 广告计划信息Controller
+ *
+ * @date 2022-06-23
+ */
+@Api(tags = "广告计划")
+@RestController
+@RequestMapping("/launch/campaign")
+public class KuaishouLaunchCampaignController extends BaseController {
+    @Autowired
+    private IKuaishouLaunchCampaignService kuaishouLaunchCampaignService;
+
+    /**
+     * 查询广告计划信息列表
+     */
+    @ApiOperation(value = "查询广告计划信息列表")
+    @GetMapping("/list")
+    public TableDataInfo list(KuaishouLaunchCampaign kuaishouLaunchCampaign) {
+        startPage();
+        List<KuaishouLaunchCampaign> list = kuaishouLaunchCampaignService.selectKuaishouLaunchCampaignList(kuaishouLaunchCampaign);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 获取广告计划信息详细信息
+     */
+    @ApiOperation(value = "获取广告计划信息详细信息")
+    @GetMapping("/getById")
+    public AjaxResult getInfo(@ApiParam("id") @RequestParam(value = "id", required = true) String id) {
+        return AjaxResult.success(kuaishouLaunchCampaignService.selectKuaishouLaunchCampaignById(id));
+    }
+
+    /**
+     * 新增广告计划信息
+     */
+    @PostMapping(value = "/add")
+    @ApiOperation(value = "新增广告计划")
+    public ResultResponse add(@RequestBody JSONObject requestJson) {
+        String token = "";
+        Long campaignId = kuaishouLaunchCampaignService.insertKuaishouLaunchCampaign(requestJson, token);
+        if (Check.isNotNull(campaignId) && campaignId > 0) {
+            return ResultResponse.success(campaignId);
+        }
+        return ResultResponse.error("创建失败");
+    }
+
+    /**
+     * 修改广告计划信息
+     */
+    @PostMapping(value = "/edit")
+    @ApiOperation(value = "修改广告计划信息")
+    public AjaxResult edit(@RequestBody KuaishouLaunchCampaign kuaishouLaunchCampaign) {
+        return toAjax(kuaishouLaunchCampaignService.updateKuaishouLaunchCampaign(kuaishouLaunchCampaign));
+    }
+
+    /**
+     * 修改广告计划信息
+     */
+    @PostMapping(value = "/getInfo")
+    @ApiOperation(value = "获取信息")
+    public ResultResponse getInfo(@ApiParam("accountId") @RequestParam(value = "accountId", required = true) Long accountId,
+                                  @ApiParam("1-计划 2-组 3-创意") @RequestParam(value = "level", required = true) String level,
+                                  @ApiParam("id") @RequestParam(value = "id", required = false) Long id,
+                                  @ApiParam("开始时间") @RequestParam(value = "startTime", required = true) String startTime,
+                                  @ApiParam("结束时间") @RequestParam(value = "endTime", required = true) String endTime
+
+    ) {
+        return kuaishouLaunchCampaignService.getCampaignInfo(accountId, id, level, startTime, endTime);
+    }
+
+}

+ 75 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/controller/KuaishouLaunchCreativeController.java

@@ -0,0 +1,75 @@
+package com.ruixuan.launch.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.controller.BaseController;
+import com.ruixuan.common.core.domain.AjaxResult;
+import com.ruixuan.common.core.domain.ResultResponse;
+import com.ruixuan.common.core.page.TableDataInfo;
+import com.ruixuan.launch.entity.KuaishouLaunchCreative;
+import com.ruixuan.launch.service.IKuaishouLaunchCreativeService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 广告创意信息Controller
+ *
+ * @author ruoyi
+ * @date 2022-07-05
+ */
+@Api(tags = "广告创意")
+@RestController
+@RequestMapping("/launch/creative")
+public class KuaishouLaunchCreativeController extends BaseController {
+    @Autowired
+    private IKuaishouLaunchCreativeService kuaishouLaunchCreativeService;
+
+    /**
+     * 查询广告创意信息列表
+     */
+    @ApiOperation(value = "查询广告创意信息列表")
+    @GetMapping("/list")
+    public TableDataInfo list(KuaishouLaunchCreative kuaishouLaunchCreative) {
+        startPage();
+        List<KuaishouLaunchCreative> list = kuaishouLaunchCreativeService.selectKuaishouLaunchCreativeList(kuaishouLaunchCreative);
+        return getDataTable(list);
+    }
+
+    /**
+     * 获取广告创意信息详细信息
+     */
+    @ApiOperation(value = "获取广告创意信息详细信息")
+    @GetMapping("/getById")
+    public AjaxResult getInfo(@ApiParam("id") @RequestParam(value = "id", required = true) String id) {
+        return AjaxResult.success(kuaishouLaunchCreativeService.selectKuaishouLaunchCreativeById(id));
+    }
+
+    /**
+     * 新增广告创意信息
+     */
+    @PostMapping(value = "/add")
+    @ApiOperation(value = "新增广告创意信息")
+    public ResultResponse add(@RequestBody JSONObject requestJson) {
+        String token = "";
+        return kuaishouLaunchCreativeService.insertKuaishouLaunchCreative(requestJson,token);
+    }
+
+    /**
+     * 修改广告创意信息
+     */
+    @PostMapping(value = "/edit")
+    @ApiOperation(value = "修改广告创意信息")
+    public AjaxResult edit(@RequestBody KuaishouLaunchCreative kuaishouLaunchCreative) {
+        return toAjax(kuaishouLaunchCreativeService.updateKuaishouLaunchCreative(kuaishouLaunchCreative));
+    }
+
+}

+ 82 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/controller/KuaishouLaunchGroupController.java

@@ -0,0 +1,82 @@
+package com.ruixuan.launch.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.controller.BaseController;
+import com.ruixuan.common.core.domain.AjaxResult;
+import com.ruixuan.common.core.domain.ResultResponse;
+import com.ruixuan.common.core.page.TableDataInfo;
+import com.ruixuan.launch.entity.KuaishouLaunchGroup;
+import com.ruixuan.launch.service.IKuaishouLaunchGroupService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 广告组信息Controller
+ *
+ * @date 2022-06-23
+ */
+@Api(tags = "广告组")
+@RestController
+@RequestMapping("/launch/group")
+public class KuaishouLaunchGroupController extends BaseController {
+
+    @Autowired
+    private IKuaishouLaunchGroupService kuaishouLaunchGroupService;
+
+    /**
+     * 查询广告组信息列表
+     */
+    @ApiOperation(value = "查询广告组信息列表")
+    @GetMapping("/list")
+    public TableDataInfo list(KuaishouLaunchGroup kuaishouLaunchGroup) {
+        startPage();
+        List<KuaishouLaunchGroup> list = kuaishouLaunchGroupService.selectKuaishouLaunchGroupList(kuaishouLaunchGroup);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 获取广告组信息详细信息
+     */
+    @ApiOperation(value = "获取广告组信息详细信息")
+    @GetMapping("/getById")
+    public AjaxResult getInfo(@ApiParam("id") @RequestParam(value = "id", required = true) String id) {
+        return AjaxResult.success(kuaishouLaunchGroupService.selectKuaishouLaunchGroupById(id));
+    }
+
+    /**
+     * 新增广告组信息
+     */
+    @PostMapping(value = "/add")
+    @ApiOperation(value = "新增广告组")
+    public ResultResponse add(@RequestBody JSONObject requestJson) {
+        try {
+            String token = "";
+            kuaishouLaunchGroupService.insertKuaishouLaunchGroup(requestJson, token);
+            return ResultResponse.success();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return ResultResponse.error();
+    }
+
+    /**
+     * 修改广告组信息
+     */
+    @PostMapping(value = "/edit")
+    @ApiOperation(value = "修改广告组信息")
+    public AjaxResult edit(@RequestBody KuaishouLaunchGroup kuaishouLaunchGroup) {
+        return toAjax(kuaishouLaunchGroupService.updateKuaishouLaunchGroup(kuaishouLaunchGroup));
+    }
+
+}

+ 106 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/controller/KuaishouLaunchGroupTargetController.java

@@ -0,0 +1,106 @@
+package com.ruixuan.launch.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.controller.BaseController;
+import com.ruixuan.common.core.domain.AjaxResult;
+import com.ruixuan.common.core.domain.ResultResponse;
+import com.ruixuan.common.core.page.TableDataInfo;
+import com.ruixuan.launch.entity.KuaishouLaunchGroupTarget;
+import com.ruixuan.launch.service.IKuaishouLaunchGroupTargetService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 广告组定向信息Controller
+ *
+ * @author ruoyi
+ * @date 2022-06-28
+ */
+@Api(tags = "定向信息")
+@RestController
+@RequestMapping("/launch/target")
+public class KuaishouLaunchGroupTargetController extends BaseController {
+    @Autowired
+    private IKuaishouLaunchGroupTargetService kuaishouLaunchGroupTargetService;
+
+    /**
+     * 查询广告组定向信息列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(KuaishouLaunchGroupTarget kuaishouLaunchGroupTarget) {
+        startPage();
+        List<KuaishouLaunchGroupTarget> list = kuaishouLaunchGroupTargetService.selectKuaishouLaunchGroupTargetList(kuaishouLaunchGroupTarget);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 获取地域信息
+     */
+    @PostMapping(value = "/getRegion")
+    @ApiOperation(value = "获取地域信息")
+    public ResultResponse getRegion(@ApiParam("账户id") @RequestParam(value = "accountId", required = true) Long accountId,
+                                    @ApiParam("类别") @RequestParam(value = "categoryType", required = true) Integer categoryType) {
+        return kuaishouLaunchGroupTargetService.getRegion(accountId, categoryType);
+    }
+
+    /**
+     * 获取人群列表
+     */
+    @PostMapping(value = "/getPopulation")
+    @ApiOperation(value = "获取人群列表")
+    public ResultResponse getPopulation(@ApiParam("账户id") @RequestParam(value = "accountId", required = true) Long accountId) {
+        return kuaishouLaunchGroupTargetService.getPopulation(accountId);
+    }
+    /**
+     * 获取购物意图信息
+     */
+    @PostMapping(value = "/getPurchaseIntention")
+    @ApiOperation(value = "获取购物意图信息")
+    public ResultResponse getPurchaseIntention(@ApiParam("账户id") @RequestParam(value = "accountId", required = true) Long accountId) {
+        return kuaishouLaunchGroupTargetService.getPurchaseIntention(accountId);
+    }
+
+    /**
+     * 获取网红信息-网红查询
+     */
+    @PostMapping(value = "/getCelebrityInfo")
+    @ApiOperation(value = "获取网红信息-网红查询")
+    public ResultResponse getCelebrityInfo(@ApiParam("账户id") @RequestParam(value = "accountId", required = true) Long accountId,
+                                           @ApiParam("查询关键词") @RequestParam(value = "keyword", required = false) String keyword,
+                                           @ApiParam("secondLabel") @RequestParam(value = "secondLabel", required = false) String secondLabel,
+                                           @ApiParam("authorId") @RequestParam(value = "authorId", required = false) Long authorId
+    ) {
+        return kuaishouLaunchGroupTargetService.getCelebrityInfo(accountId, keyword, secondLabel, authorId);
+    }
+
+    /**
+     * 获取网红信息-网红分类
+     */
+    @PostMapping(value = "/getCelebrityType")
+    @ApiOperation(value = "获取网红信息-网红分类")
+    public ResultResponse getCelebrityType(@ApiParam("账户id") @RequestParam(value = "accountId", required = true) Long accountId) {
+        return kuaishouLaunchGroupTargetService.getCelebrityType(accountId);
+    }
+
+   /**
+     * 查询视频库
+     */
+    @PostMapping(value = "/getVideos")
+    @ApiOperation(value = "查询视频库")
+    public ResultResponse getVideos(@ApiParam("账户id") @RequestParam(value = "accountId", required = true) Long accountId) {
+        return kuaishouLaunchGroupTargetService.getVideos(accountId);
+    }
+
+
+}

+ 73 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/controller/KuaishouLaunchTargetTemplateController.java

@@ -0,0 +1,73 @@
+package com.ruixuan.launch.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.controller.BaseController;
+import com.ruixuan.common.core.domain.AjaxResult;
+import com.ruixuan.common.core.domain.ResultResponse;
+import com.ruixuan.common.core.page.TableDataInfo;
+import com.ruixuan.launch.entity.KuaishouLaunchTargetTemplate;
+import com.ruixuan.launch.service.IKuaishouLaunchTargetTemplateService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 账户下所属定向信息Controller
+ *
+ * @author ruoyi
+ * @date 2022-07-05
+ */
+@Api(tags = "账户下所属定向信息")
+@RestController
+@RequestMapping("/launch/template")
+public class KuaishouLaunchTargetTemplateController extends BaseController {
+    @Autowired
+    private IKuaishouLaunchTargetTemplateService kuaishouLaunchTargetTemplateService;
+
+    /**
+     * 查询账户下所属定向信息列表
+     */
+    @ApiOperation(value = "查询账户下所属定向信息列表")
+    @GetMapping("/list")
+    public TableDataInfo list(KuaishouLaunchTargetTemplate kuaishouLaunchTargetTemplate) {
+        startPage();
+        List<KuaishouLaunchTargetTemplate> list = kuaishouLaunchTargetTemplateService.selectKuaishouLaunchTargetTemplateList(kuaishouLaunchTargetTemplate);
+        return getDataTable(list);
+    }
+
+    /**
+     * 获取账户下所属定向信息详细信息
+     */
+    @ApiOperation(value = "获取账户下所属定向信息详细信息")
+    @GetMapping("/getById")
+    public AjaxResult getInfo(@ApiParam("id") @RequestParam(value = "id", required = true) Long id) {
+        return AjaxResult.success(kuaishouLaunchTargetTemplateService.selectKuaishouLaunchTargetTemplateById(id));
+    }
+
+    /**
+     * 新增广告组定向信息
+     */
+    @PostMapping(value = "/add")
+    @ApiOperation(value = "新增广告组定向信息")
+    public ResultResponse add(@RequestBody JSONObject request) {
+        return kuaishouLaunchTargetTemplateService.insertKuaishouLaunchTargetTemplate(request);
+    }
+
+    /**
+     * 修改账户下所属定向信息
+     */
+    @PostMapping(value = "/edit")
+    @ApiOperation(value = "修改账户下所属定向信息")
+    public AjaxResult edit(@RequestBody KuaishouLaunchTargetTemplate kuaishouLaunchTargetTemplate) {
+        return toAjax(kuaishouLaunchTargetTemplateService.updateKuaishouLaunchTargetTemplate(kuaishouLaunchTargetTemplate));
+    }
+}

+ 85 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/entity/KuaishouLaunchCampaign.java

@@ -0,0 +1,85 @@
+package com.ruixuan.launch.entity;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruixuan.common.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 广告计划信息对象 kuaishou_launch_campaign
+ *
+ * @author ruoyi
+ * @date 2022-06-23
+ */
+@Data
+public class KuaishouLaunchCampaign {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     *
+     */
+    private String id;
+
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID")
+    private Long accountId;
+
+    /**
+     * 计划ID
+     */
+    @Excel(name = "计划ID")
+    private Long campaignId;
+
+    /**
+     * 计划名称
+     */
+    @Excel(name = "计划名称")
+    private String campaignName;
+
+    /**
+     * 计划类型	3:获取电商下单 13:小店商品推广 14:直播推广
+     */
+    @Excel(name = "计划类型	3:获取电商下单 13:小店商品推广 14:直播推广")
+    private Integer campaignType;
+
+    /**
+     * 推广方式1:极速推广,2:专业推广(当前支持)
+     */
+    @Excel(name = "推广方式1:极速推广,2:专业推广", readConverterExp = "当=前支持")
+    private Integer promotionType;
+
+    /**
+     * 投放状态 1-投放、2-暂停
+     */
+    @Excel(name = "投放状态 1-投放、2-暂停")
+    private Integer putStatus;
+
+    /**
+     * 单日预算金额 单位:厘,0表示预算不限,默认0
+     */
+    @Excel(name = "单日预算金额 单位:厘,0表示预算不限,默认0")
+    private Long dayBudget;
+
+    /**
+     * 分日预算
+     */
+    @Excel(name = "分日预算")
+    private String budgetSchedule;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+}

+ 272 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/entity/KuaishouLaunchCampaignAutoStrategy.java

@@ -0,0 +1,272 @@
+package com.ruixuan.launch.entity;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruixuan.common.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 投流策略对象 kuaishou_launch_campaign_auto_strategy
+ *
+ * @author ruoyi
+ * @date 2022-07-12
+ */
+@Data
+public class KuaishouLaunchCampaignAutoStrategy {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 客户策略ID
+     */
+    private Long id;
+
+    /**
+     * 策略状态 1-使用 0-停用
+     */
+    @Excel(name = "策略状态 1-使用 0-停用")
+    private Long state;
+
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID")
+    private Long accountId;
+
+    /**
+     * 计划名称
+     */
+    @Excel(name = "计划名称")
+    private String campaignName;
+
+    /**
+     * 计划类型	3:获取电商下单 13:小店商品推广 14:直播推广
+     */
+    @Excel(name = "计划类型	3:获取电商下单 13:小店商品推广 14:直播推广")
+    private Integer campaignType;
+
+    /**
+     * 推广方式1:极速推广,2:专业推广(当前支持)
+     */
+    @Excel(name = "推广方式1:极速推广,2:专业推广", readConverterExp = "当=前支持")
+    private Integer promotionType;
+
+    /**
+     * 投放状态 1-投放、2-暂停
+     */
+    @Excel(name = "投放状态 1-投放、2-暂停")
+    private Integer putStatus;
+
+    /**
+     * 计划单日预算
+     */
+    @Excel(name = "计划单日预算")
+    private Long dayBudget;
+
+    /**
+     * 分日预算
+     */
+    @Excel(name = "分日预算")
+    private String budgetSchedule;
+
+    /**
+     * 广告组名称
+     */
+    @Excel(name = "广告组名称")
+    private String unitName;
+
+    /**
+     * 优化目标出价类型	10:OCPM (当前只支持 OCPM)
+     */
+    @Excel(name = "优化目标出价类型	10:OCPM (当前只支持 OCPM)")
+    private Long bidType;
+
+    /**
+     * 转化目标集,72-粉丝关注,395-商品购买,192-ROI,740-进入直播间
+     */
+    @Excel(name = "转化目标集,72-粉丝关注,395-商品购买,192-ROI,740-进入直播间")
+    private String ocpxActionArr;
+
+    /**
+     * 付费 ROI 系数
+     */
+    @Excel(name = "付费 ROI 系数")
+    private BigDecimal roiRatio;
+
+    /**
+     * 资源位置
+     */
+    @Excel(name = "资源位置")
+    private String sceneId;
+
+    /**
+     * 创意制作方式 4: 自定义
+     */
+    @Excel(name = "创意制作方式 4: 自定义")
+    private Integer unitType;
+
+    /**
+     * 投放开始时间
+     */
+    @Excel(name = "投放开始时间")
+    private String beginTimeStr;
+
+    /**
+     * 投放结束时间
+     */
+    @Excel(name = "投放结束时间")
+    private String endTimeStr;
+
+    /**
+     * 投放时间段
+     */
+    @Excel(name = "投放时间段")
+    private String scheduleTime;
+
+    /**
+     * 组单日预算
+     */
+    @Excel(name = "组单日预算")
+    private Long groupDayBudget;
+
+    /**
+     * 辅助类型0-小店3-金牛
+     */
+    @Excel(name = "辅助类型0-小店3-金牛")
+    private Integer supportType;
+
+    /**
+     * 创意展现方式  0:未知, 1:轮播,
+     */
+    @Excel(name = "创意展现方式  0:未知, 1:轮播,")
+    private Long showMode;
+
+    /**
+     * 投放方式
+     */
+    @Excel(name = "投放方式")
+    private Long speed;
+
+    /**
+     * 电商关联Id (小店通商品推广,计划 type=13)
+     */
+    @Excel(name = "电商关联Id (小店通商品推广,计划 type=13)")
+    private Long itemId;
+
+    /**
+     * 电商广告投放类型 0: 商品,2: 个人主页
+     */
+    @Excel(name = "电商广告投放类型 0: 商品,2: 个人主页")
+    private Long merchantItemPutType;
+
+    /**
+     * 直播挂车 id
+     */
+    @Excel(name = "直播挂车 id")
+    private Long shoppingCarProductId;
+
+    /**
+     * 主播 id
+     */
+    @Excel(name = "主播 id")
+    private Long liveUserId;
+
+    /**
+     * 定向模板集
+     */
+    @Excel(name = "定向模板集")
+    private String targetTemplate;
+
+    /**
+     * 创意名称
+     */
+    @Excel(name = "创意名称")
+    private String creativeName;
+
+    /**
+     * 封面 直播直投传""
+     */
+    @Excel(name = "封面 直播直投传''")
+    private String coverUrl;
+
+    /**
+     * 封面宽 直播直投传 0
+     */
+    @Excel(name = "封面宽 直播直投传 0")
+    private Long coverWidth;
+
+    /**
+     * 封面高 直播直投传 0
+     */
+    @Excel(name = "封面高 直播直投传 0")
+    private Long coverHeight;
+
+    /**
+     * 视频ID	直播直投传 0
+     */
+    @Excel(name = "视频ID	直播直投传 0")
+    private String photoId;
+
+    /**
+     * 素材类型	1:竖版视频 2:横版视频 ,直播直投传 0
+     */
+    @Excel(name = "素材类型	1:竖版视频 2:横版视频 ,直播直投传 0")
+    private Integer creativeMaterialType;
+
+    /**
+     * 行动号召按钮文案
+     */
+    @Excel(name = "行动号召按钮文案")
+    private String actionBar;
+
+    /**
+     * 商品推荐语
+     */
+    @Excel(name = "商品推荐语")
+    private String recommendation;
+
+    /**
+     * 作品标题
+     */
+    @Excel(name = "作品标题")
+    private String description;
+
+    /**
+     * 推荐理由描述
+     */
+    @Excel(name = "推荐理由描述")
+    private String newExposeText;
+
+    /**
+     * 推荐理由url
+     */
+    @Excel(name = "推荐理由url")
+    private String newExposeUrl;
+
+    /**
+     * 作品类型(小店直播推广类型,计划 type=14	1 - 直投直播;2 - 视频引流直播)
+     */
+    @Excel(name = "作品类型", readConverterExp = "小=店直播推广类型,计划,t=ype=14	1,-=,直=投直播;2,-=,视=频引流直播")
+    private Integer liveCreativeType;
+
+    /**
+     * 创建人ID
+     */
+    @Excel(name = "创建人ID")
+    private String createrId;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+}

+ 136 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/entity/KuaishouLaunchCreative.java

@@ -0,0 +1,136 @@
+package com.ruixuan.launch.entity;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruixuan.common.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 广告创意信息对象 kuaishou_launch_creative
+ */
+@Data
+public class KuaishouLaunchCreative {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $column.columnComment
+     */
+    private String id;
+
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID")
+    private Long accountId;
+
+    /**
+     * 计划ID
+     */
+    @Excel(name = "计划ID")
+    private Long campaignId;
+
+    /**
+     * 广告组ID
+     */
+    @Excel(name = "广告组ID")
+    private Long unitId;
+
+    /**
+     * 广告创意ID
+     */
+    @Excel(name = "广告创意ID")
+    private Long creativeId;
+
+    /**
+     * 创意名称
+     */
+    @Excel(name = "创意名称")
+    private String creativeName;
+
+    /**
+     * 封面 直播直投传""
+     */
+    @Excel(name = "封面 直播直投传''")
+    private String coverUrl;
+
+    /**
+     * 封面宽 直播直投传 0
+     */
+    @Excel(name = "封面宽 直播直投传 0")
+    private Long coverWidth;
+
+    /**
+     * 封面高 直播直投传 0
+     */
+    @Excel(name = "封面高 直播直投传 0")
+    private Long coverHeight;
+
+    /**
+     * 视频ID	直播直投传 0
+     */
+    @Excel(name = "视频ID	直播直投传 0")
+    private String photoId;
+
+    /**
+     * 素材类型	1:竖版视频 2:横版视频 ,直播直投传 0
+     */
+    @Excel(name = "素材类型	1:竖版视频 2:横版视频 ,直播直投传 0")
+    private Integer creativeMaterialType;
+
+    /**
+     * 行动号召按钮文案
+     */
+    @Excel(name = "行动号召按钮文案")
+    private String actionBar;
+
+    /**
+     * 商品推荐语
+     */
+    @Excel(name = "商品推荐语")
+    private String recommendation;
+
+    /**
+     * 作品标题
+     */
+    @Excel(name = "作品标题")
+    private String description;
+
+    /**
+     * 推荐理由描述
+     */
+    @Excel(name = "推荐理由描述")
+    private String newExposeText;
+
+    /**
+     * 推荐理由url
+     */
+    @Excel(name = "推荐理由url")
+    private String newExposeUrl;
+
+    /**
+     * 作品类型(小店直播推广类型,计划 type=14	1 - 直投直播;2 - 视频引流直播)
+     */
+    @Excel(name = "作品类型", readConverterExp = "小=店直播推广类型,计划,t=ype=14	1,-=,直=投直播;2,-=,视=频引流直播")
+    private Integer liveCreativeType;
+
+    /**
+     * 投放状态 1-投放、2-暂停
+     */
+    @Excel(name = "投放状态 1-投放、2-暂停")
+    private Integer putStatus;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+}

+ 169 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/entity/KuaishouLaunchGroup.java

@@ -0,0 +1,169 @@
+package com.ruixuan.launch.entity;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruixuan.common.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 广告组信息对象 kuaishou_launch_group
+ *
+ * @author ruoyi
+ * @date 2022-06-23
+ */
+@Data
+public class KuaishouLaunchGroup {
+    private static final long serialVersionUID = 1L;
+    /**
+     *
+     */
+    private String id;
+
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID")
+    private Long accountId;
+
+    /**
+     * 广告活动ID
+     */
+    @Excel(name = "广告活动ID")
+    private Long campaignId;
+
+    /**
+     * 广告组ID
+     */
+    @Excel(name = "广告组ID")
+    private Long unitId;
+
+    /**
+     * 广告组名称
+     */
+    @Excel(name = "广告组名称")
+    private String unitName;
+
+    /**
+     * 投放状态 1:投放中;2:暂停 3:删除
+     */
+    @Excel(name = "投放状态 1:投放中;2:暂停 3:删除")
+    private Integer putStatus;
+
+    /**
+     * 出价
+     */
+    @Excel(name = "出价")
+    private Long cpaBid;
+
+    /**
+     * 优化目标出价类型	10:OCPM (当前只支持 OCPM)
+     */
+    @Excel(name = "优化目标出价类型	10:OCPM (当前只支持 OCPM)")
+    private Long bidType;
+
+    /**
+     * 优化目标
+     */
+    @Excel(name = "优化目标")
+    private Long ocpxActionType;
+
+    /**
+     * 付费 ROI 系数
+     */
+    @Excel(name = "付费 ROI 系数")
+    private BigDecimal roiRatio;
+
+    /**
+     * 资源位置
+     */
+    @Excel(name = "资源位置")
+    private String sceneId;
+
+    /**
+     * 创意制作方式 4: 自定义
+     */
+    @Excel(name = "创意制作方式 4: 自定义")
+    private Integer unitType;
+
+    /**
+     * 投放开始时间
+     */
+    @Excel(name = "投放开始时间")
+    private String beginTimeStr;
+
+    /**
+     * 投放结束时间
+     */
+    @Excel(name = "投放结束时间")
+    private String endTimeStr;
+
+    /**
+     * 投放时间段
+     */
+    @Excel(name = "投放时间段")
+    private String scheduleTime;
+
+    /**
+     * 单日预算
+     */
+    @Excel(name = "单日预算")
+    private Long dayBudget;
+
+    /**
+     * 辅助类型0-小店3-金牛
+     */
+    @Excel(name = "辅助类型0-小店3-金牛")
+    private Integer supportType;
+
+    /**
+     * 创意展现方式  0:未知, 1:轮播,
+     */
+    @Excel(name = "创意展现方式  0:未知, 1:轮播,")
+    private Long showMode;
+
+    /**
+     * 投放方式
+     */
+    @Excel(name = "投放方式")
+    private Long speed;
+
+    /**
+     * 电商关联Id (小店通商品推广,计划 type=13)
+     */
+    @Excel(name = "电商关联Id (小店通商品推广,计划 type=13)")
+    private Long itemId;
+
+    /**
+     * 电商广告投放类型 0: 商品,2: 个人主页
+     */
+    @Excel(name = "电商广告投放类型 0: 商品,2: 个人主页")
+    private Long merchantItemPutType;
+
+    /**
+     * 直播挂车 id
+     */
+    @Excel(name = "直播挂车 id")
+    private Long shoppingCarProductId;
+
+    /**
+     * 主播 id
+     */
+    @Excel(name = "主播 id")
+    private Long liveUserId;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+}

+ 224 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/entity/KuaishouLaunchGroupRecord.java

@@ -0,0 +1,224 @@
+package com.ruixuan.launch.entity;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruixuan.common.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 广告组创建记录对象 kuaishou_launch_group_record
+ *
+ * @author ruoyi
+ * @date 2022-07-08
+ */
+@Data
+public class KuaishouLaunchGroupRecord {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $column.columnComment
+     */
+    private String id;
+
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID")
+    private Long accountId;
+
+    /**
+     * 广告活动ID
+     */
+    @Excel(name = "广告活动ID")
+    private Long campaignId;
+
+    /**
+     * 广告组ID
+     */
+    @Excel(name = "广告组ID")
+    private Long unitId;
+
+    /**
+     * 广告组名称
+     */
+    @Excel(name = "广告组名称")
+    private String unitName;
+
+    /**
+     * 出价
+     */
+    @Excel(name = "出价")
+    private Long cpaBid;
+
+    /**
+     * 优化目标出价类型	10:OCPM (当前只支持 OCPM)
+     */
+    @Excel(name = "优化目标出价类型	10:OCPM (当前只支持 OCPM)")
+    private Long bidType;
+
+    /**
+     * 优化目标
+     */
+    @Excel(name = "优化目标")
+    private Long ocpxActionType;
+
+    /**
+     * 付费 ROI 系数
+     */
+    @Excel(name = "付费 ROI 系数")
+    private BigDecimal roiRatio;
+
+    /**
+     * 资源位置
+     */
+    @Excel(name = "资源位置")
+    private String sceneId;
+
+    /**
+     * 创意制作方式 4: 自定义
+     */
+    @Excel(name = "创意制作方式 4: 自定义")
+    private Integer unitType;
+
+    /**
+     * 投放开始时间
+     */
+    @Excel(name = "投放开始时间")
+    private String beginTimeStr;
+
+    /**
+     * 投放结束时间
+     */
+    @Excel(name = "投放结束时间")
+    private String endTimeStr;
+
+    /**
+     * 投放时间段
+     */
+    @Excel(name = "投放时间段")
+    private String scheduleTime;
+
+    /**
+     * 单日预算
+     */
+    @Excel(name = "单日预算")
+    private Long dayBudget;
+
+    /**
+     * 辅助类型0-小店3-金牛
+     */
+    @Excel(name = "辅助类型0-小店3-金牛")
+    private Integer supportType;
+
+    /**
+     * 创意展现方式  0:未知, 1:轮播,
+     */
+    @Excel(name = "创意展现方式  0:未知, 1:轮播,")
+    private Long showMode;
+
+    /**
+     * 投放方式
+     */
+    @Excel(name = "投放方式")
+    private Long speed;
+
+    /**
+     * 电商关联Id (小店通商品推广,计划 type=13)
+     */
+    @Excel(name = "电商关联Id (小店通商品推广,计划 type=13)")
+    private Long itemId;
+
+    /**
+     * 电商广告投放类型 0: 商品,2: 个人主页
+     */
+    @Excel(name = "电商广告投放类型 0: 商品,2: 个人主页")
+    private Long merchantItemPutType;
+
+    /**
+     * 直播挂车 id
+     */
+    @Excel(name = "直播挂车 id")
+    private Long shoppingCarProductId;
+
+    /**
+     * 主播 id
+     */
+    @Excel(name = "主播 id")
+    private Long liveUserId;
+
+    /**
+     * 地域
+     */
+    @Excel(name = "地域")
+    private String region;
+
+    /**
+     * 自定义年龄段
+     */
+    @Excel(name = "自定义年龄段")
+    private String age;
+
+    /**
+     * 性别 1:女性, 2:男性, 0:不限
+     */
+    @Excel(name = "性别 1:女性, 2:男性, 0:不限")
+    private Long genderType;
+
+    /**
+     * 人群包定向
+     */
+    @Excel(name = "人群包定向")
+    private String population;
+
+    /**
+     * 人群包排除
+     */
+    @Excel(name = "人群包排除")
+    private String excludePopulation;
+
+    /**
+     * 付费人群包 id
+     */
+    @Excel(name = "付费人群包 id")
+    private String paidAudience;
+
+    /**
+     * 行为类型 0:关注 1:视频互动 2:直播互动
+     */
+    @Excel(name = "行为类型 0:关注 1:视频互动 2:直播互动")
+    private String behaviorList;
+
+    /**
+     * 快手网红信息
+     */
+    @Excel(name = "快手网红信息")
+    private String fansStarList;
+
+    /**
+     * 快手网红信息
+     */
+    @Excel(name = "快手网红信息")
+    private String purchaseIntention;
+
+    /**
+     * 结果说明
+     */
+    @Excel(name = "结果说明")
+    private String message;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+}

+ 99 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/entity/KuaishouLaunchGroupTarget.java

@@ -0,0 +1,99 @@
+package com.ruixuan.launch.entity;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruixuan.common.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 广告组定向信息对象 kuaishou_launch_group_target
+ *
+ * @author ruoyi
+ * @date 2022-06-28
+ */
+@Data
+public class KuaishouLaunchGroupTarget {
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID")
+    private Long accountId;
+
+    /**
+     * 广告组ID
+     */
+    @Excel(name = "广告组ID")
+    private Long unitId;
+
+    /**
+     * 地域
+     */
+    @Excel(name = "地域")
+    private String region;
+
+    /**
+     * 自定义年龄段
+     */
+    @Excel(name = "自定义年龄段")
+    private String age;
+
+    /**
+     * 性别 1:女性, 2:男性, 0:不限
+     */
+    @Excel(name = "性别 1:女性, 2:男性, 0:不限")
+    private Long genderType;
+
+    /**
+     * 人群包定向
+     */
+    @Excel(name = "人群包定向")
+    private String population;
+
+    /**
+     * 人群包排除
+     */
+    @Excel(name = "人群包排除")
+    private String excludePopulation;
+
+    /**
+     * 付费人群包 id
+     */
+    @Excel(name = "付费人群包 id")
+    private String paidAudience;
+
+    /**
+     * 行为类型 0:关注 1:视频互动 2:直播互动
+     */
+    @Excel(name = "行为类型 0:关注 1:视频互动 2:直播互动")
+    private String behaviorList;
+
+    /**
+     * 快手网红信息
+     */
+    @Excel(name = "快手网红信息")
+    private String fansStarList;
+
+    /**
+     * 快手网红信息
+     */
+    @Excel(name = "快手网红信息")
+    private String purchaseIntention;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+}

+ 106 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/entity/KuaishouLaunchTargetTemplate.java

@@ -0,0 +1,106 @@
+package com.ruixuan.launch.entity;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruixuan.common.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 账户下所属定向信息对象 kuaishou_launch_target_template
+ *
+ * @author ruoyi
+ * @date 2022-07-05
+ */
+@Data
+public class KuaishouLaunchTargetTemplate {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $column.columnComment
+     */
+    private Long id;
+
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID")
+    private Long accountId;
+
+    /**
+     * 定向包名
+     */
+    @Excel(name = "定向包名")
+    private String targetName;
+    /**
+     * 地域
+     */
+    @Excel(name = "地域")
+    private String region;
+
+    /**
+     * 自定义年龄段
+     */
+    @Excel(name = "自定义年龄段")
+    private String age;
+
+    /**
+     * 性别 1:女性, 2:男性, 0:不限
+     */
+    @Excel(name = "性别 1:女性, 2:男性, 0:不限")
+    private Long genderType;
+
+    /**
+     * 人群包定向
+     */
+    @Excel(name = "人群包定向")
+    private String population;
+
+    private String populationName;
+
+    private String excludePopulationName;
+
+    /**
+     * 人群包排除
+     */
+    @Excel(name = "人群包排除")
+    private String excludePopulation;
+
+    /**
+     * 付费人群包 id
+     */
+    @Excel(name = "付费人群包 id")
+    private String paidAudience;
+
+    /**
+     * 行为类型 0:关注 1:视频互动 2:直播互动
+     */
+    @Excel(name = "行为类型 0:关注 1:视频互动 2:直播互动")
+    private String behaviorList;
+
+    /**
+     * 快手网红信息
+     */
+    @Excel(name = "快手网红信息")
+    private String fansStarList;
+
+    /**
+     * 快手网红信息
+     */
+    @Excel(name = "快手网红信息")
+    private String purchaseIntention;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+}

+ 56 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/mapper/KuaishouLaunchCampaignAutoStrategyMapper.java

@@ -0,0 +1,56 @@
+package com.ruixuan.launch.mapper;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.launch.entity.KuaishouLaunchCampaignAutoStrategy;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 投流策略Mapper接口
+ *
+ * @author ruoyi
+ * @date 2022-07-05
+ */
+public interface KuaishouLaunchCampaignAutoStrategyMapper {
+    /**
+     * 查询投流策略
+     *
+     * @param id 投流策略主键
+     * @return 投流策略
+     */
+    public KuaishouLaunchCampaignAutoStrategy selectKuaishouLaunchCampaignAutoStrategyById(Long id);
+
+    /**
+     * 查询投流策略列表
+     *
+     * @param kuaishouLaunchCampaignAutoStrategy 投流策略
+     * @return 投流策略集合
+     */
+    public List<JSONObject> selectKuaishouLaunchCampaignAutoStrategyList(@Param("campaignName") String campaignName, @Param("accountName") String accountName);
+
+    /**
+     * 新增投流策略
+     *
+     * @param kuaishouLaunchCampaignAutoStrategy 投流策略
+     * @return 结果
+     */
+    public int insertKuaishouLaunchCampaignAutoStrategy(KuaishouLaunchCampaignAutoStrategy kuaishouLaunchCampaignAutoStrategy);
+
+    /**
+     * 修改投流策略
+     *
+     * @param kuaishouLaunchCampaignAutoStrategy 投流策略
+     * @return 结果
+     */
+    public int updateKuaishouLaunchCampaignAutoStrategy(KuaishouLaunchCampaignAutoStrategy kuaishouLaunchCampaignAutoStrategy);
+
+    /**
+     * 删除投流策略
+     *
+     * @param id 投流策略主键
+     * @return 结果
+     */
+    public int deleteKuaishouLaunchCampaignAutoStrategyById(Long id);
+
+}

+ 65 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/mapper/KuaishouLaunchCampaignMapper.java

@@ -0,0 +1,65 @@
+package com.ruixuan.launch.mapper;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.launch.entity.KuaishouLaunchCampaign;
+
+import java.util.List;
+
+/**
+ * 广告计划信息Mapper接口
+ *
+ * @author ruoyi
+ * @date 2022-06-23
+ */
+public interface KuaishouLaunchCampaignMapper
+{
+    /**
+     * 查询广告计划信息
+     *
+     * @param id 广告计划信息主键
+     * @return 广告计划信息
+     */
+    public KuaishouLaunchCampaign selectKuaishouLaunchCampaignById(String id);
+
+    /**
+     * 查询广告计划信息列表
+     *
+     * @param kuaishouLaunchCampaign 广告计划信息
+     * @return 广告计划信息集合
+     */
+    public List<KuaishouLaunchCampaign> selectKuaishouLaunchCampaignList(KuaishouLaunchCampaign kuaishouLaunchCampaign);
+
+    /**
+     * 新增广告计划信息
+     *
+     * @param kuaishouLaunchCampaign 广告计划信息
+     * @return 结果
+     */
+    public int insertKuaishouLaunchCampaign(KuaishouLaunchCampaign kuaishouLaunchCampaign);
+
+    /**
+     * 修改广告计划信息
+     *
+     * @param kuaishouLaunchCampaign 广告计划信息
+     * @return 结果
+     */
+    public int updateKuaishouLaunchCampaign(KuaishouLaunchCampaign kuaishouLaunchCampaign);
+
+    /**
+     * 删除广告计划信息
+     *
+     * @param id 广告计划信息主键
+     * @return 结果
+     */
+    public int deleteKuaishouLaunchCampaignById(String id);
+
+    /**
+     * 批量删除广告计划信息
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteKuaishouLaunchCampaignByIds(String[] ids);
+
+    KuaishouLaunchCampaign getOne(JSONObject parameter);
+}

+ 63 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/mapper/KuaishouLaunchCreativeMapper.java

@@ -0,0 +1,63 @@
+package com.ruixuan.launch.mapper;
+
+import com.ruixuan.launch.entity.KuaishouLaunchCampaign;
+import com.ruixuan.launch.entity.KuaishouLaunchCreative;
+
+import java.util.List;
+
+/**
+ * 广告创意信息Mapper接口
+ *
+ * @author ruoyi
+ * @date 2022-07-05
+ */
+public interface KuaishouLaunchCreativeMapper
+{
+    /**
+     * 查询广告创意信息
+     *
+     * @param id 广告创意信息主键
+     * @return 广告创意信息
+     */
+    public KuaishouLaunchCreative selectKuaishouLaunchCreativeById(String id);
+
+    /**
+     * 查询广告创意信息列表
+     *
+     * @param kuaishouLaunchCreative 广告创意信息
+     * @return 广告创意信息集合
+     */
+    public List<KuaishouLaunchCreative> selectKuaishouLaunchCreativeList(KuaishouLaunchCreative kuaishouLaunchCreative);
+
+    /**
+     * 新增广告创意信息
+     *
+     * @param kuaishouLaunchCreative 广告创意信息
+     * @return 结果
+     */
+    public int insertKuaishouLaunchCreative(KuaishouLaunchCreative kuaishouLaunchCreative);
+
+    /**
+     * 修改广告创意信息
+     *
+     * @param kuaishouLaunchCreative 广告创意信息
+     * @return 结果
+     */
+    public int updateKuaishouLaunchCreative(KuaishouLaunchCreative kuaishouLaunchCreative);
+
+    /**
+     * 删除广告创意信息
+     *
+     * @param id 广告创意信息主键
+     * @return 结果
+     */
+    public int deleteKuaishouLaunchCreativeById(String id);
+
+    /**
+     * 批量删除广告创意信息
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteKuaishouLaunchCreativeByIds(String[] ids);
+}

+ 62 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/mapper/KuaishouLaunchGroupMapper.java

@@ -0,0 +1,62 @@
+package com.ruixuan.launch.mapper;
+
+
+import com.ruixuan.launch.entity.KuaishouLaunchGroup;
+
+import java.util.List;
+
+/**
+ * 广告组信息Mapper接口
+ *
+ * @author ruoyi
+ * @date 2022-06-23
+ */
+public interface KuaishouLaunchGroupMapper {
+    /**
+     * 查询广告组信息
+     *
+     * @param id 广告组信息主键
+     * @return 广告组信息
+     */
+    public KuaishouLaunchGroup selectKuaishouLaunchGroupById(String id);
+
+    /**
+     * 查询广告组信息列表
+     *
+     * @param kuaishouLaunchGroup 广告组信息
+     * @return 广告组信息集合
+     */
+    public List<KuaishouLaunchGroup> selectKuaishouLaunchGroupList(KuaishouLaunchGroup kuaishouLaunchGroup);
+
+    /**
+     * 新增广告组信息
+     *
+     * @param kuaishouLaunchGroup 广告组信息
+     * @return 结果
+     */
+    public int insertKuaishouLaunchGroup(KuaishouLaunchGroup kuaishouLaunchGroup);
+
+    /**
+     * 修改广告组信息
+     *
+     * @param kuaishouLaunchGroup 广告组信息
+     * @return 结果
+     */
+    public int updateKuaishouLaunchGroup(KuaishouLaunchGroup kuaishouLaunchGroup);
+
+    /**
+     * 删除广告组信息
+     *
+     * @param id 广告组信息主键
+     * @return 结果
+     */
+    public int deleteKuaishouLaunchGroupById(String id);
+
+    /**
+     * 批量删除广告组信息
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteKuaishouLaunchGroupByIds(String[] ids);
+}

+ 62 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/mapper/KuaishouLaunchGroupRecordMapper.java

@@ -0,0 +1,62 @@
+package com.ruixuan.launch.mapper;
+
+
+import com.ruixuan.launch.entity.KuaishouLaunchGroupRecord;
+
+import java.util.List;
+
+/**
+ * 广告组创建记录Mapper接口
+ *
+ * @author ruoyi
+ * @date 2022-07-08
+ */
+public interface KuaishouLaunchGroupRecordMapper {
+    /**
+     * 查询广告组创建记录
+     *
+     * @param id 广告组创建记录主键
+     * @return 广告组创建记录
+     */
+    public KuaishouLaunchGroupRecord selectKuaishouLaunchGroupRecordById(String id);
+
+    /**
+     * 查询广告组创建记录列表
+     *
+     * @param kuaishouLaunchGroupRecord 广告组创建记录
+     * @return 广告组创建记录集合
+     */
+    public List<KuaishouLaunchGroupRecord> selectKuaishouLaunchGroupRecordList(KuaishouLaunchGroupRecord kuaishouLaunchGroupRecord);
+
+    /**
+     * 新增广告组创建记录
+     *
+     * @param kuaishouLaunchGroupRecord 广告组创建记录
+     * @return 结果
+     */
+    public int insertKuaishouLaunchGroupRecord(KuaishouLaunchGroupRecord kuaishouLaunchGroupRecord);
+
+    /**
+     * 修改广告组创建记录
+     *
+     * @param kuaishouLaunchGroupRecord 广告组创建记录
+     * @return 结果
+     */
+    public int updateKuaishouLaunchGroupRecord(KuaishouLaunchGroupRecord kuaishouLaunchGroupRecord);
+
+    /**
+     * 删除广告组创建记录
+     *
+     * @param id 广告组创建记录主键
+     * @return 结果
+     */
+    public int deleteKuaishouLaunchGroupRecordById(String id);
+
+    /**
+     * 批量删除广告组创建记录
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteKuaishouLaunchGroupRecordByIds(String[] ids);
+}

+ 47 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/mapper/KuaishouLaunchGroupTargetMapper.java

@@ -0,0 +1,47 @@
+package com.ruixuan.launch.mapper;
+
+import com.ruixuan.launch.entity.KuaishouLaunchCampaign;
+import com.ruixuan.launch.entity.KuaishouLaunchGroupTarget;
+
+import java.util.List;
+
+/**
+ * 广告组定向信息Mapper接口
+ *
+ * @author ruoyi
+ * @date 2022-06-28
+ */
+public interface KuaishouLaunchGroupTargetMapper
+{
+    /**
+     * 查询广告组定向信息
+     *
+     * @param id 广告组定向信息主键
+     * @return 广告组定向信息
+     */
+    public KuaishouLaunchGroupTarget selectKuaishouLaunchGroupTargetById(Long id);
+
+    /**
+     * 查询广告组定向信息列表
+     *
+     * @param kuaishouLaunchGroupTarget 广告组定向信息
+     * @return 广告组定向信息集合
+     */
+    public List<KuaishouLaunchGroupTarget> selectKuaishouLaunchGroupTargetList(KuaishouLaunchGroupTarget kuaishouLaunchGroupTarget);
+
+    /**
+     * 新增广告组定向信息
+     *
+     * @param kuaishouLaunchGroupTarget 广告组定向信息
+     * @return 结果
+     */
+    public int insertKuaishouLaunchGroupTarget(KuaishouLaunchGroupTarget kuaishouLaunchGroupTarget);
+
+    /**
+     * 修改广告组定向信息
+     *
+     * @param kuaishouLaunchGroupTarget 广告组定向信息
+     * @return 结果
+     */
+    public int updateKuaishouLaunchGroupTarget(KuaishouLaunchGroupTarget kuaishouLaunchGroupTarget);
+}

+ 63 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/mapper/KuaishouLaunchTargetTemplateMapper.java

@@ -0,0 +1,63 @@
+package com.ruixuan.launch.mapper;
+
+import com.ruixuan.launch.entity.KuaishouLaunchCampaign;
+import com.ruixuan.launch.entity.KuaishouLaunchTargetTemplate;
+
+import java.util.List;
+
+/**
+ * 账户下所属定向信息Mapper接口
+ *
+ * @author ruoyi
+ * @date 2022-07-05
+ */
+public interface KuaishouLaunchTargetTemplateMapper
+{
+    /**
+     * 查询账户下所属定向信息
+     *
+     * @param id 账户下所属定向信息主键
+     * @return 账户下所属定向信息
+     */
+    public KuaishouLaunchTargetTemplate selectKuaishouLaunchTargetTemplateById(Long id);
+
+    /**
+     * 查询账户下所属定向信息列表
+     *
+     * @param kuaishouLaunchTargetTemplate 账户下所属定向信息
+     * @return 账户下所属定向信息集合
+     */
+    public List<KuaishouLaunchTargetTemplate> selectKuaishouLaunchTargetTemplateList(KuaishouLaunchTargetTemplate kuaishouLaunchTargetTemplate);
+
+    /**
+     * 新增账户下所属定向信息
+     *
+     * @param kuaishouLaunchTargetTemplate 账户下所属定向信息
+     * @return 结果
+     */
+    public int insertKuaishouLaunchTargetTemplate(KuaishouLaunchTargetTemplate kuaishouLaunchTargetTemplate);
+
+    /**
+     * 修改账户下所属定向信息
+     *
+     * @param kuaishouLaunchTargetTemplate 账户下所属定向信息
+     * @return 结果
+     */
+    public int updateKuaishouLaunchTargetTemplate(KuaishouLaunchTargetTemplate kuaishouLaunchTargetTemplate);
+
+    /**
+     * 删除账户下所属定向信息
+     *
+     * @param id 账户下所属定向信息主键
+     * @return 结果
+     */
+    public int deleteKuaishouLaunchTargetTemplateById(Long id);
+
+    /**
+     * 批量删除账户下所属定向信息
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteKuaishouLaunchTargetTemplateByIds(Long[] ids);
+}

+ 50 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/service/IKuaishouLaunchCampaignAutoStrategyService.java

@@ -0,0 +1,50 @@
+package com.ruixuan.launch.service;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.domain.ResultResponse;
+import com.ruixuan.launch.entity.KuaishouLaunchCampaignAutoStrategy;
+
+import java.util.List;
+
+/**
+ * 投流策略Service接口
+ *
+ * @author ruoyi
+ * @date 2022-07-05
+ */
+public interface IKuaishouLaunchCampaignAutoStrategyService {
+    /**
+     * 查询投流策略
+     *
+     * @param id 投流策略主键
+     * @return 投流策略
+     */
+    public KuaishouLaunchCampaignAutoStrategy selectKuaishouLaunchCampaignAutoStrategyById(Long id);
+
+    /**
+     * 查询投流策略列表
+     *
+     * @param kuaishouLaunchCampaignAutoStrategy 投流策略
+     * @return 投流策略集合
+     */
+    public List<JSONObject> selectKuaishouLaunchCampaignAutoStrategyList(String campaignName, String accountName);
+
+    /**
+     * 新增投流策略
+     *
+     * @param kuaishouLaunchCampaignAutoStrategy 投流策略
+     * @return 结果
+     */
+    ResultResponse insertKuaishouLaunchCampaignAutoStrategy(JSONObject requestJson);
+
+    /**
+     * 修改投流策略
+     *
+     * @param kuaishouLaunchCampaignAutoStrategy 投流策略
+     * @return 结果
+     */
+    public int updateKuaishouLaunchCampaignAutoStrategy(JSONObject requestJson);
+
+    ResultResponse createByStrategy(Long id);
+}

+ 69 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/service/IKuaishouLaunchCampaignService.java

@@ -0,0 +1,69 @@
+package com.ruixuan.launch.service;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.domain.ResultResponse;
+import com.ruixuan.launch.entity.KuaishouLaunchCampaign;
+
+import java.util.List;
+
+/**
+ * 广告计划信息Service接口
+ *
+ * @author ruoyi
+ * @date 2022-06-23
+ */
+public interface IKuaishouLaunchCampaignService
+{
+    /**
+     * 查询广告计划信息
+     *
+     * @param id 广告计划信息主键
+     * @return 广告计划信息
+     */
+    public KuaishouLaunchCampaign selectKuaishouLaunchCampaignById(String id);
+
+    /**
+     * 查询广告计划信息列表
+     *
+     * @param kuaishouLaunchCampaign 广告计划信息
+     * @return 广告计划信息集合
+     */
+    public List<KuaishouLaunchCampaign> selectKuaishouLaunchCampaignList(KuaishouLaunchCampaign kuaishouLaunchCampaign);
+
+    /**
+     * 新增广告计划信息
+     *
+     * @param kuaishouLaunchCampaign 广告计划信息
+     * @return 结果
+     */
+    public Long insertKuaishouLaunchCampaign(JSONObject requestJson, String token);
+
+    /**
+     * 修改广告计划信息
+     *
+     * @param kuaishouLaunchCampaign 广告计划信息
+     * @return 结果
+     */
+    public int updateKuaishouLaunchCampaign(KuaishouLaunchCampaign kuaishouLaunchCampaign);
+
+    /**
+     * 批量删除广告计划信息
+     *
+     * @param ids 需要删除的广告计划信息主键集合
+     * @return 结果
+     */
+    public int deleteKuaishouLaunchCampaignByIds(String[] ids);
+
+    /**
+     * 删除广告计划信息信息
+     *
+     * @param id 广告计划信息主键
+     * @return 结果
+     */
+    public int deleteKuaishouLaunchCampaignById(String id);
+
+    ResultResponse getCampaignInfo(Long accountId, Long id, String level,String startTime,String endTime);
+
+    KuaishouLaunchCampaign getOne(JSONObject parameter);
+}

+ 48 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/service/IKuaishouLaunchCreativeService.java

@@ -0,0 +1,48 @@
+package com.ruixuan.launch.service;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.domain.ResultResponse;
+import com.ruixuan.launch.entity.KuaishouLaunchCreative;
+
+import java.util.List;
+
+/**
+ * 广告创意信息Service接口
+ *
+ * @author ruoyi
+ * @date 2022-07-05
+ */
+public interface IKuaishouLaunchCreativeService {
+    /**
+     * 查询广告创意信息
+     *
+     * @param id 广告创意信息主键
+     * @return 广告创意信息
+     */
+    public KuaishouLaunchCreative selectKuaishouLaunchCreativeById(String id);
+
+    /**
+     * 查询广告创意信息列表
+     *
+     * @param kuaishouLaunchCreative 广告创意信息
+     * @return 广告创意信息集合
+     */
+    public List<KuaishouLaunchCreative> selectKuaishouLaunchCreativeList(KuaishouLaunchCreative kuaishouLaunchCreative);
+
+    /**
+     * 新增广告创意信息
+     *
+     * @param kuaishouLaunchCreative 广告创意信息
+     * @return 结果
+     */
+    public ResultResponse insertKuaishouLaunchCreative(JSONObject requestJson, String token);
+
+    /**
+     * 修改广告创意信息
+     *
+     * @param kuaishouLaunchCreative 广告创意信息
+     * @return 结果
+     */
+    public int updateKuaishouLaunchCreative(KuaishouLaunchCreative kuaishouLaunchCreative);
+}

+ 63 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/service/IKuaishouLaunchGroupService.java

@@ -0,0 +1,63 @@
+package com.ruixuan.launch.service;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.launch.entity.KuaishouLaunchGroup;
+
+import java.util.List;
+
+/**
+ * 广告组信息Mapper接口
+ *
+ * @author ruoyi
+ * @date 2022-06-23
+ */
+public interface IKuaishouLaunchGroupService {
+    /**
+     * 查询广告组信息
+     *
+     * @param id 广告组信息主键
+     * @return 广告组信息
+     */
+    public KuaishouLaunchGroup selectKuaishouLaunchGroupById(String id);
+
+    /**
+     * 查询广告组信息列表
+     *
+     * @param kuaishouLaunchGroup 广告组信息
+     * @return 广告组信息集合
+     */
+    public List<KuaishouLaunchGroup> selectKuaishouLaunchGroupList(KuaishouLaunchGroup kuaishouLaunchGroup);
+
+    /**
+     * 新增广告组信息
+     *
+     * @param kuaishouLaunchGroup 广告组信息
+     * @return 结果
+     */
+    public Long insertKuaishouLaunchGroup(JSONObject requestJson,String token);
+
+    /**
+     * 修改广告组信息
+     *
+     * @param kuaishouLaunchGroup 广告组信息
+     * @return 结果
+     */
+    public int updateKuaishouLaunchGroup(KuaishouLaunchGroup kuaishouLaunchGroup);
+
+    /**
+     * 删除广告组信息
+     *
+     * @param id 广告组信息主键
+     * @return 结果
+     */
+    public int deleteKuaishouLaunchGroupById(String id);
+
+    /**
+     * 批量删除广告组信息
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteKuaishouLaunchGroupByIds(String[] ids);
+}

+ 45 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/service/IKuaishouLaunchGroupTargetService.java

@@ -0,0 +1,45 @@
+package com.ruixuan.launch.service;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.domain.ResultResponse;
+import com.ruixuan.launch.entity.KuaishouLaunchGroupTarget;
+
+import java.util.List;
+
+/**
+ * 广告组定向信息Service接口
+ *
+ * @author ruoyi
+ * @date 2022-06-28
+ */
+public interface IKuaishouLaunchGroupTargetService {
+
+    /**
+     * 查询广告组定向信息列表
+     *
+     * @param kuaishouLaunchGroupTarget 广告组定向信息
+     * @return 广告组定向信息集合
+     */
+    public List<KuaishouLaunchGroupTarget> selectKuaishouLaunchGroupTargetList(KuaishouLaunchGroupTarget kuaishouLaunchGroupTarget);
+
+    /**
+     * 新增广告组定向信息
+     *
+     * @param kuaishouLaunchGroupTarget 广告组定向信息
+     * @return 结果
+     */
+    public int insertKuaishouLaunchGroupTarget(JSONObject request);
+
+    ResultResponse getRegion(Long accountId, Integer categoryType);
+
+    ResultResponse getPopulation(Long accountId);
+
+    ResultResponse getCelebrityInfo(Long accountId, String keyword, String secondLabel, Long authorId);
+
+    ResultResponse getCelebrityType(Long accountId);
+
+    ResultResponse getPurchaseIntention(Long accountId);
+
+    ResultResponse getVideos(Long accountId);
+}

+ 66 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/service/IKuaishouLaunchTargetTemplateService.java

@@ -0,0 +1,66 @@
+package com.ruixuan.launch.service;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.domain.ResultResponse;
+import com.ruixuan.launch.entity.KuaishouLaunchTargetTemplate;
+
+import java.util.List;
+
+/**
+ * 账户下所属定向信息Service接口
+ *
+ * @author ruoyi
+ * @date 2022-07-05
+ */
+public interface IKuaishouLaunchTargetTemplateService {
+    /**
+     * 查询账户下所属定向信息
+     *
+     * @param id 账户下所属定向信息主键
+     * @return 账户下所属定向信息
+     */
+    public KuaishouLaunchTargetTemplate selectKuaishouLaunchTargetTemplateById(Long id);
+
+    /**
+     * 查询账户下所属定向信息列表
+     *
+     * @param kuaishouLaunchTargetTemplate 账户下所属定向信息
+     * @return 账户下所属定向信息集合
+     */
+    public List<KuaishouLaunchTargetTemplate> selectKuaishouLaunchTargetTemplateList(KuaishouLaunchTargetTemplate kuaishouLaunchTargetTemplate);
+
+    /**
+     * 新增账户下所属定向信息
+     *
+     * @param kuaishouLaunchTargetTemplate 账户下所属定向信息
+     * @return 结果
+     */
+    public ResultResponse insertKuaishouLaunchTargetTemplate(JSONObject request);
+
+    /**
+     * 修改账户下所属定向信息
+     *
+     * @param kuaishouLaunchTargetTemplate 账户下所属定向信息
+     * @return 结果
+     */
+    public int updateKuaishouLaunchTargetTemplate(KuaishouLaunchTargetTemplate kuaishouLaunchTargetTemplate);
+
+    /**
+     * 批量删除账户下所属定向信息
+     *
+     * @param ids 需要删除的账户下所属定向信息主键集合
+     * @return 结果
+     */
+    public int deleteKuaishouLaunchTargetTemplateByIds(Long[] ids);
+
+    /**
+     * 删除账户下所属定向信息信息
+     *
+     * @param id 账户下所属定向信息主键
+     * @return 结果
+     */
+    public int deleteKuaishouLaunchTargetTemplateById(Long id);
+
+    JSONObject getTargetJson(Long targetId, JSONObject strategyJson);
+}

+ 206 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/service/impl/KuaishouLaunchCampaignAutoStrategyServiceImpl.java

@@ -0,0 +1,206 @@
+package com.ruixuan.launch.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.domain.ResultResponse;
+import com.ruixuan.common.utils.Check;
+import com.ruixuan.common.utils.DateUtils;
+import com.ruixuan.common.utils.RedisUtil;
+import com.ruixuan.launch.entity.KuaishouLaunchCampaign;
+import com.ruixuan.launch.entity.KuaishouLaunchCampaignAutoStrategy;
+import com.ruixuan.launch.entity.KuaishouLaunchTargetTemplate;
+import com.ruixuan.launch.mapper.KuaishouLaunchCampaignAutoStrategyMapper;
+import com.ruixuan.launch.service.IKuaishouLaunchCampaignAutoStrategyService;
+import com.ruixuan.launch.service.IKuaishouLaunchCampaignService;
+import com.ruixuan.launch.service.IKuaishouLaunchCreativeService;
+import com.ruixuan.launch.service.IKuaishouLaunchGroupService;
+import com.ruixuan.launch.service.IKuaishouLaunchTargetTemplateService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * 投流策略Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-07-05
+ */
+@Slf4j
+@Service
+public class KuaishouLaunchCampaignAutoStrategyServiceImpl implements IKuaishouLaunchCampaignAutoStrategyService {
+    @Autowired
+    private KuaishouLaunchCampaignAutoStrategyMapper kuaishouLaunchCampaignAutoStrategyMapper;
+
+    @Autowired
+    private IKuaishouLaunchCampaignService kuaishouLaunchCampaignService;
+
+    @Autowired
+    private IKuaishouLaunchCreativeService kuaishouLaunchCreativeService;
+
+    @Autowired
+    private IKuaishouLaunchGroupService kuaishouLaunchGroupService;
+
+    @Autowired
+    private IKuaishouLaunchTargetTemplateService kuaishouLaunchTargetTemplateService;
+
+    @Autowired
+    private RedisUtil redisUtil;
+
+    /**
+     * 查询投流策略
+     */
+    @Override
+    public KuaishouLaunchCampaignAutoStrategy selectKuaishouLaunchCampaignAutoStrategyById(Long id) {
+        return kuaishouLaunchCampaignAutoStrategyMapper.selectKuaishouLaunchCampaignAutoStrategyById(id);
+    }
+
+    /**
+     * 查询投流策略列表
+     */
+    @Override
+    public List<JSONObject> selectKuaishouLaunchCampaignAutoStrategyList(String campaignName, String accountName) {
+        List<JSONObject> list = kuaishouLaunchCampaignAutoStrategyMapper.selectKuaishouLaunchCampaignAutoStrategyList(campaignName, accountName);
+        for (JSONObject obj : list) {
+            obj.put("groupCount", 0);
+        }
+        return list;
+    }
+
+    /**
+     * 新增投流策略
+     */
+    @Override
+    public ResultResponse insertKuaishouLaunchCampaignAutoStrategy(JSONObject requestJson) {
+        KuaishouLaunchCampaignAutoStrategy kuaishouLaunchCampaignAutoStrategy = JSONObject.parseObject(requestJson.toJSONString(), KuaishouLaunchCampaignAutoStrategy.class);
+        kuaishouLaunchCampaignAutoStrategyMapper.insertKuaishouLaunchCampaignAutoStrategy(kuaishouLaunchCampaignAutoStrategy);
+        return ResultResponse.success();
+    }
+
+    /**
+     * 修改投流策略
+     */
+    @Override
+    public int updateKuaishouLaunchCampaignAutoStrategy(JSONObject requestJson) {
+        KuaishouLaunchCampaignAutoStrategy kuaishouLaunchCampaignAutoStrategy = JSONObject.parseObject(requestJson.toJSONString(), KuaishouLaunchCampaignAutoStrategy.class);
+        return kuaishouLaunchCampaignAutoStrategyMapper.updateKuaishouLaunchCampaignAutoStrategy(kuaishouLaunchCampaignAutoStrategy);
+    }
+
+    @Override
+    public ResultResponse createByStrategy(Long id) {
+        String token = "";
+        KuaishouLaunchCampaignAutoStrategy strategy = kuaishouLaunchCampaignAutoStrategyMapper.selectKuaishouLaunchCampaignAutoStrategyById(id);
+        String statDate = DateUtils.getDate();
+        JSONObject strategyJson = (JSONObject) JSONObject.toJSON(strategy);
+        //1、创建计划&获取计划ID
+        Long campaignId = createCampaign(strategyJson, token);
+        strategyJson.put("campaignId", campaignId);
+        //2、创建广告组
+        try {
+            Long unitId = createGroup(strategyJson, token);
+        } catch (InterruptedException e) {
+            log.error("---创建广告组异常---");
+            e.printStackTrace();
+        }
+        return ResultResponse.success();
+    }
+
+    /*创建广告计划*/
+    private Long createCampaign(JSONObject strategyJson, String token) {
+        JSONObject parameter = new JSONObject();
+        parameter.put("accountId", strategyJson.getLong("accountId"));
+        parameter.put("campaignName", strategyJson.getString("campaignName"));
+        KuaishouLaunchCampaign campaign = kuaishouLaunchCampaignService.getOne(parameter);
+        if (Check.isNotNull(campaign)) {
+            return campaign.getCampaignId();
+        }
+        return kuaishouLaunchCampaignService.insertKuaishouLaunchCampaign(strategyJson, token);
+    }
+
+    /*创建广告组*/
+    private Long createGroup(JSONObject strategyJson, String token) throws InterruptedException {
+        JSONArray ocpxActionArr = strategyJson.getJSONArray("ocpxActionArr");
+        JSONArray targetTemplate = strategyJson.getJSONArray("targetTemplate");
+        for (int i = 0; i < ocpxActionArr.size(); i++) {
+            JSONObject ocpx = ocpxActionArr.getJSONObject(i);
+            for (int j = 0; j < targetTemplate.size(); j++) {
+                Long targetId = targetTemplate.getLong(j);
+                KuaishouLaunchTargetTemplate template = kuaishouLaunchTargetTemplateService.selectKuaishouLaunchTargetTemplateById(targetId);
+                String name = getName(strategyJson, targetId, ocpx.getInteger("type"), ocpx.getBigDecimal("cpaBid"));
+                strategyJson.put("unitName", name);
+                strategyJson = kuaishouLaunchTargetTemplateService.getTargetJson(targetId, strategyJson);
+                Long unitId = kuaishouLaunchGroupService.insertKuaishouLaunchGroup(strategyJson, token);
+                if (unitId > 0) {
+                    strategyJson.put("unitId", unitId);
+                    kuaishouLaunchCreativeService.insertKuaishouLaunchCreative(strategyJson, token);
+                    Thread.sleep(500);
+                }
+            }
+        }
+        return 0L;
+
+    }
+
+
+    /**
+     * 替换通配符({{***}})获取有效的计划名称/组名称
+     */
+    private String getName(JSONObject strategy, Long targetId, Integer ocpxActionType, BigDecimal cpaBid) {
+        String unitName = strategy.getString("unitName");
+        if (unitName.contains("-{{定向包名}}-") || unitName.contains("-{{人群定向名}}-") || unitName.contains("-{{人群排除名}}-")) {
+            KuaishouLaunchTargetTemplate template = kuaishouLaunchTargetTemplateService.selectKuaishouLaunchTargetTemplateById(targetId);
+            if (Check.isNull(template)) {
+                unitName = unitName.replace("-{{定向包名}}-", "");
+                unitName = unitName.replace("-{{人群定向名}}-", "");
+                unitName = unitName.replace("-{{人群排除名}}-", "");
+            } else {
+                unitName = unitName.replace("-{{定向包名}}-", template.getTargetName());
+                unitName = unitName.replace("-{{人群定向名}}-", template.getPopulationName());
+                unitName = unitName.replace("-{{人群排除名}}-", template.getExcludePopulationName());
+            }
+        }
+
+        if (ocpxActionType == 72) {
+            unitName = unitName.replace("-{{转化目标}}-", "粉丝关注");
+        } else if (ocpxActionType == 395) {
+            unitName = unitName.replace("-{{转化目标}}-", "商品购买");
+        } else if (ocpxActionType == 740) {
+            unitName = unitName.replace("-{{转化目标}}-", "进入直播间");
+        } else if (ocpxActionType == 192) {
+            unitName = unitName.replace("-{{转化目标}}-", "推广ROI");
+        }
+
+        unitName = unitName.replace("-{{出价}}-", cpaBid.divide(new BigDecimal("1000")).toString());
+        String date = DateUtils.dateTime();//yyyyMMdd
+        unitName = unitName.replace("-{{日期}}-", date);
+        //组序号,必填
+        Integer cnt = null;
+        String redisKey = strategy.getLong("accountId") + "_" + strategy.getLong("campaignId") + date;
+        Integer redisCnt = (Integer) redisUtil.get(redisKey);
+        if (Check.isNull(redisCnt)) {
+            cnt = 1;
+            redisUtil.set(redisKey, cnt, 100000L);
+        } else {
+            cnt = redisCnt + 1;
+            redisUtil.set(redisKey, cnt, 100000L);
+        }
+        if (unitName.contains("-{{序号}}-")) {
+            unitName = unitName.replace("-{{序号}}-", cnt + "");
+        } else {
+            unitName = unitName + "-" + cnt;
+        }
+        unitName = unitName.replace("--", "-");
+        unitName = unitName.replace("--", "-");
+
+        if (unitName.startsWith("-")) {
+            unitName = unitName.substring(1, unitName.length());
+        }
+
+        if (unitName.endsWith("-")) {
+            unitName = unitName.substring(0, unitName.length() - 1);
+        }
+        return unitName;
+    }
+}

+ 174 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/service/impl/KuaishouLaunchCampaignServiceImpl.java

@@ -0,0 +1,174 @@
+package com.ruixuan.launch.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.domain.ResultResponse;
+import com.ruixuan.common.utils.Check;
+import com.ruixuan.common.utils.DateUtils;
+import com.ruixuan.common.utils.KuaishouAPIConstant;
+import com.ruixuan.common.utils.http.HttpUtil;
+import com.ruixuan.launch.entity.KuaishouLaunchCampaign;
+import com.ruixuan.launch.mapper.KuaishouLaunchCampaignMapper;
+import com.ruixuan.launch.service.IKuaishouLaunchCampaignService;
+import com.ruixuan.launch.unitls.APIUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * 广告计划信息Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-06-23
+ */
+@Slf4j
+@Service
+public class KuaishouLaunchCampaignServiceImpl implements IKuaishouLaunchCampaignService {
+    @Autowired
+    private KuaishouLaunchCampaignMapper kuaishouLaunchCampaignMapper;
+
+    /**
+     * 查询广告计划信息
+     *
+     * @param id 广告计划信息主键
+     * @return 广告计划信息
+     */
+    @Override
+    public KuaishouLaunchCampaign selectKuaishouLaunchCampaignById(String id) {
+        return kuaishouLaunchCampaignMapper.selectKuaishouLaunchCampaignById(id);
+    }
+
+    /**
+     * 查询广告计划信息列表
+     *
+     * @param kuaishouLaunchCampaign 广告计划信息
+     * @return 广告计划信息
+     */
+    @Override
+    public List<KuaishouLaunchCampaign> selectKuaishouLaunchCampaignList(KuaishouLaunchCampaign kuaishouLaunchCampaign) {
+        return kuaishouLaunchCampaignMapper.selectKuaishouLaunchCampaignList(kuaishouLaunchCampaign);
+    }
+
+    /**
+     * 新增广告计划信息
+     */
+    @Override
+    public Long insertKuaishouLaunchCampaign(JSONObject requestJson, String token) {
+        try {
+            Map<String, String> headers = new HashMap<String, String>();
+            headers.put("Content-Type", "application/json");
+            headers.put("Access-Token", token);
+            Map<String, Object> param = new HashMap<String, Object>();
+            param.put("advertiser_id", requestJson.getLong("accountId"));
+            param.put("name", requestJson.getString("campaignName"));
+            param.put("type", requestJson.getInteger("campaignType"));
+            param.put("promotion_type", requestJson.getInteger("promotionType"));
+            if (Check.isNotNull(requestJson.getLong("dayBudget"))) {
+                param.put("day_budget", requestJson.getLong("dayBudget"));
+            }
+            param.put("budget_schedule", requestJson.getJSONArray("budgetSchedule"));
+            JSONObject resultJson = APIUtil.getApiResult(KuaishouAPIConstant.CREATE_CAMPAIGN, "fbe5da761a5a4328cc42ccbb927f3036", param);
+            if (resultJson.getInteger("code") == 0) {
+                JSONObject entity = resultJson.getJSONObject("data").getJSONArray("detail").getJSONObject(0);
+                KuaishouLaunchCampaign campaign = JSONObject.parseObject(requestJson.toJSONString(), KuaishouLaunchCampaign.class);
+                campaign.setCampaignId(entity.getLong("id"));
+                if (Check.isNull(campaign.getDayBudget())) {
+                    campaign.setDayBudget(0L);
+                }
+                campaign.setPutStatus(1);
+                campaign.setId(UUID.randomUUID().toString().replace("-", ""));
+                kuaishouLaunchCampaignMapper.insertKuaishouLaunchCampaign(campaign);
+                return entity.getLong("id");
+            } else {
+                log.error("创建计划失败,账户{},{}", requestJson.getLong("accountId"), resultJson.toJSONString());
+                return -1L;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return -1L;
+    }
+
+
+    public ResultResponse getCampaignInfo(Long accountId, Long id, String level, String startTime, String endTime) {
+        try {
+            String url = "https://ad.e.kuaishou.com" + KuaishouAPIConstant.SEARCH_AD;
+            Map<String, String> headers = new HashMap<String, String>();
+            headers.put("Content-Type", "application/json");
+            headers.put("Access-Token", "fbe5da761a5a4328cc42ccbb927f3036");
+            Map<String, Object> param = new HashMap<String, Object>();
+            param.put("advertiser_id", accountId);
+            JSONObject params = new JSONObject();
+            params.put("start_time", DateUtils.timeToStamp(startTime));
+            params.put("end_time", DateUtils.timeToStamp(endTime));
+//            params.put("start_time", DateUtils.timeToStamp(DateUtils.getDate().concat(" 00:00:01")));
+//            params.put("end_time", DateUtils.timeToStamp(DateUtils.getDate().concat(" 23:59:59")));
+            params.put("search_level", level);//1-计划 2-组 3-创意
+            if (Check.isNotNull(id)) {
+                params.put("name", id);
+            }
+            param.put("param", params);
+            JSONObject pageInfo = new JSONObject();
+            pageInfo.put("page", 1);
+            pageInfo.put("page_size", 20);
+            param.put("page_info", pageInfo);
+            System.out.println(params);
+            String result = HttpUtil.httpPostRequest(url, param, headers);
+            JSONObject resultJson = JSONObject.parseObject(result);
+            System.out.println(resultJson);
+            if (Check.isNotNull(resultJson) && resultJson.getInteger("code") == 0) {
+//                JSONObject data = resultJson.getJSONObject("data").getJSONArray("data").getJSONObject(0);
+//                campaign.setPutStatus(data.getInteger("put_status"));
+//                campaign.setId(UUID.randomUUID().toString().replace("-", ""));
+//                campaign.setCampaignId(id);
+//                kuaishouLaunchCampaignMapper.insertKuaishouLaunchCampaign(campaign);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return ResultResponse.success();
+
+    }
+
+    @Override
+    public KuaishouLaunchCampaign getOne(JSONObject parameter) {
+        return kuaishouLaunchCampaignMapper.getOne(parameter);
+    }
+
+    /**
+     * 修改广告计划信息
+     *
+     * @param kuaishouLaunchCampaign 广告计划信息
+     * @return 结果
+     */
+    @Override
+    public int updateKuaishouLaunchCampaign(KuaishouLaunchCampaign kuaishouLaunchCampaign) {
+        return kuaishouLaunchCampaignMapper.updateKuaishouLaunchCampaign(kuaishouLaunchCampaign);
+    }
+
+    /**
+     * 批量删除广告计划信息
+     *
+     * @param ids 需要删除的广告计划信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteKuaishouLaunchCampaignByIds(String[] ids) {
+        return kuaishouLaunchCampaignMapper.deleteKuaishouLaunchCampaignByIds(ids);
+    }
+
+    /**
+     * 删除广告计划信息信息
+     *
+     * @param id 广告计划信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteKuaishouLaunchCampaignById(String id) {
+        return kuaishouLaunchCampaignMapper.deleteKuaishouLaunchCampaignById(id);
+    }
+}

+ 120 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/service/impl/KuaishouLaunchCreativeServiceImpl.java

@@ -0,0 +1,120 @@
+package com.ruixuan.launch.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.domain.ResultResponse;
+import com.ruixuan.common.utils.Check;
+import com.ruixuan.common.utils.KuaishouAPIConstant;
+import com.ruixuan.launch.entity.KuaishouLaunchCreative;
+import com.ruixuan.launch.mapper.KuaishouLaunchCreativeMapper;
+import com.ruixuan.launch.service.IKuaishouLaunchCreativeService;
+import com.ruixuan.launch.unitls.APIUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * 广告创意信息Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-07-05
+ */
+@Slf4j
+@Service
+public class KuaishouLaunchCreativeServiceImpl implements IKuaishouLaunchCreativeService {
+    @Autowired
+    private KuaishouLaunchCreativeMapper kuaishouLaunchCreativeMapper;
+
+    /**
+     * 查询广告创意信息
+     *
+     * @param id 广告创意信息主键
+     * @return 广告创意信息
+     */
+    @Override
+    public KuaishouLaunchCreative selectKuaishouLaunchCreativeById(String id) {
+        return kuaishouLaunchCreativeMapper.selectKuaishouLaunchCreativeById(id);
+    }
+
+    /**
+     * 查询广告创意信息列表
+     *
+     * @param kuaishouLaunchCreative 广告创意信息
+     * @return 广告创意信息
+     */
+    @Override
+    public List<KuaishouLaunchCreative> selectKuaishouLaunchCreativeList(KuaishouLaunchCreative kuaishouLaunchCreative) {
+        return kuaishouLaunchCreativeMapper.selectKuaishouLaunchCreativeList(kuaishouLaunchCreative);
+    }
+
+    /**
+     * 新增广告创意信息
+     */
+    @Override
+    public ResultResponse insertKuaishouLaunchCreative(JSONObject requestJson, String token) {
+        Map<String, Object> param = new HashMap<String, Object>();
+        param.put("advertiser_id", requestJson.getLong("accountId"));
+        param.put("unit_id", requestJson.getLong("unitId"));
+        param.put("name", requestJson.getString("creativeName"));
+
+        Integer liveCreativeType = requestJson.getInteger("liveCreativeType");
+        if (Check.isNotNull(liveCreativeType) && liveCreativeType == 1) {
+            param.put("cover_url", "");
+            param.put("cover_width", 0);
+            param.put("cover_height", 0);
+            param.put("photo_id", 0);
+            param.put("creative_material_type", 0);
+            param.put("action_bar", "");
+            param.put("description", "");
+        } else {
+            param.put("cover_url", requestJson.getString("coverUrl"));
+            param.put("cover_width", requestJson.getLong("coverWidth"));
+            param.put("cover_height", requestJson.getLong("coverHeight"));
+            param.put("photo_id", requestJson.getLong("photoId"));
+            param.put("creative_material_type", requestJson.getInteger("creativeMaterialType"));
+            param.put("action_bar", requestJson.getString("actionBar"));
+            param.put("description", requestJson.getString("description"));
+        }
+        if (Check.isNotNull(requestJson.getString("recommendation"))) {
+            param.put("recommendation", requestJson.getString("recommendation"));
+        }
+        if (Check.isNotNull(liveCreativeType)) {
+            param.put("live_creative_type", liveCreativeType);
+        }
+        if (Check.isNotNull(requestJson.getString("newExposeText"))) {
+            JSONObject newExposeTag = new JSONObject();
+            newExposeTag.put("text", requestJson.getString("newExposeText"));
+            newExposeTag.put("url", requestJson.getString("newExposeUrl"));
+            param.put("new_expose_tag", newExposeTag);
+        }
+
+        JSONObject result = APIUtil.getApiResult(KuaishouAPIConstant.CREATE_CREATIVE, token, param);
+        if (result.getInteger("code") == 0) {
+            result = result.getJSONObject("data");
+            JSONObject detail = result.getJSONArray("detail").getJSONObject(0);
+            KuaishouLaunchCreative creative = JSONObject.parseObject(requestJson.toJSONString(), KuaishouLaunchCreative.class);
+            creative.setCreativeId(detail.getLong("id"));
+            creative.setId(UUID.randomUUID().toString().replace("-", ""));
+            kuaishouLaunchCreativeMapper.insertKuaishouLaunchCreative(creative);
+            return ResultResponse.success();
+        } else {
+            log.error("广告创意创建失败,账户{},{}", requestJson.getLong("accountId"), result.toJSONString());
+        }
+        return ResultResponse.error("创建失败," + result.getString("message"));
+    }
+
+    /**
+     * 修改广告创意信息
+     *
+     * @param kuaishouLaunchCreative 广告创意信息
+     * @return 结果
+     */
+    @Override
+    public int updateKuaishouLaunchCreative(KuaishouLaunchCreative kuaishouLaunchCreative) {
+        return kuaishouLaunchCreativeMapper.updateKuaishouLaunchCreative(kuaishouLaunchCreative);
+    }
+}

+ 226 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/service/impl/KuaishouLaunchGroupServiceImpl.java

@@ -0,0 +1,226 @@
+package com.ruixuan.launch.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.utils.Check;
+import com.ruixuan.common.utils.KuaishouAPIConstant;
+import com.ruixuan.launch.entity.KuaishouLaunchGroup;
+import com.ruixuan.launch.entity.KuaishouLaunchGroupRecord;
+import com.ruixuan.launch.entity.KuaishouLaunchGroupTarget;
+import com.ruixuan.launch.mapper.KuaishouLaunchGroupMapper;
+import com.ruixuan.launch.mapper.KuaishouLaunchGroupRecordMapper;
+import com.ruixuan.launch.mapper.KuaishouLaunchGroupTargetMapper;
+import com.ruixuan.launch.service.IKuaishouLaunchGroupService;
+import com.ruixuan.launch.unitls.APIUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * 广告组信息Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-06-23
+ */
+@Slf4j
+@Service
+public class KuaishouLaunchGroupServiceImpl implements IKuaishouLaunchGroupService {
+    @Autowired
+    private KuaishouLaunchGroupMapper kuaishouLaunchGroupMapper;
+
+    @Autowired
+    private KuaishouLaunchGroupTargetMapper kuaishouLaunchGroupTargetMapper;
+
+    @Autowired
+    private KuaishouLaunchGroupRecordMapper kuaishouLaunchGroupRecordMapper;
+
+    /**
+     * 查询广告组信息
+     *
+     * @param id 广告组信息主键
+     * @return 广告组信息
+     */
+    @Override
+    public KuaishouLaunchGroup selectKuaishouLaunchGroupById(String id) {
+        return kuaishouLaunchGroupMapper.selectKuaishouLaunchGroupById(id);
+    }
+
+    /**
+     * 查询广告组信息列表
+     *
+     * @param kuaishouLaunchGroup 广告组信息
+     * @return 广告组信息
+     */
+    @Override
+    public List<KuaishouLaunchGroup> selectKuaishouLaunchGroupList(KuaishouLaunchGroup kuaishouLaunchGroup) {
+        return kuaishouLaunchGroupMapper.selectKuaishouLaunchGroupList(kuaishouLaunchGroup);
+    }
+
+    /**
+     * 新增广告组信息
+     *
+     * @param kuaishouLaunchGroup 广告组信息
+     * @return 结果
+     */
+    @Override
+    public Long insertKuaishouLaunchGroup(JSONObject requestJson, String token) {
+        Map<String, Object> param = new HashMap<String, Object>();
+        param.put("advertiser_id", requestJson.getLong("accountId"));
+        param.put("campaign_id", requestJson.getLong("campaignId"));
+        param.put("name", requestJson.getString("unitName"));
+        param.put("bid_type", requestJson.getInteger("bidType"));
+        if (Check.isNotNull(requestJson.getLong("cpaBid"))) {
+            param.put("cpa_bid", requestJson.getLong("cpaBid"));
+        }
+        param.put("ocpx_action_type", requestJson.getInteger("ocpxActionType"));
+        if (Check.isNotNull(requestJson.getDouble("roiRatio"))) {
+            param.put("roi_ratio", requestJson.getDouble("roiRatio"));
+        }
+        param.put("scene_id", requestJson.getJSONArray("sceneId"));
+        param.put("unit_type", requestJson.getInteger("unitType"));
+        param.put("begin_time_str", requestJson.getString("beginTimeStr"));
+        if (Check.isNotNull(requestJson.getString("endTimeStr"))) {
+            param.put("end_time_str", requestJson.getString("endTimeStr"));
+        }
+        if (Check.isNotNull(requestJson.getString("scheduleTime"))) {
+            param.put("schedule_time", requestJson.getString("scheduleTime"));
+        }
+        if (Check.isNotNull(requestJson.getLong("groupDayBudget"))) {
+            param.put("day_budget", requestJson.getLong("groupDayBudget"));
+        }
+        param.put("support_type", requestJson.getInteger("supportType"));
+        param.put("show_mode", requestJson.getInteger("showMode"));
+        param.put("speed", requestJson.getInteger("speed"));
+        if (Check.isNotNull(requestJson.getLong("itemId"))) {
+            param.put("item_id", requestJson.getLong("itemId"));
+        }
+        param.put("merchant_item_put_type", requestJson.getInteger("merchantItemPutType"));
+        if (Check.isNotNull(requestJson.getLong("shoppingCarProductId"))) {
+            param.put("shopping_car_product_id", requestJson.getLong("shoppingCarProductId"));
+        }
+
+        JSONObject target = getTarget(requestJson);
+        param.put("target", target);
+        if (Check.isNotNull(requestJson.getInteger("liveUserId"))) {
+            param.put("live_user_id", requestJson.getInteger("liveUserId"));
+        }
+
+        KuaishouLaunchGroupRecord record = JSONObject.parseObject(requestJson.toJSONString(), KuaishouLaunchGroupRecord.class);
+        JSONObject result = APIUtil.getApiResult(KuaishouAPIConstant.CREATE_UNIT, token, param);
+        if (result.getInteger("code") == 0) {
+            result = result.getJSONObject("data");
+            JSONObject detail = result.getJSONArray("detail").getJSONObject(0);
+            KuaishouLaunchGroup group = JSONObject.parseObject(requestJson.toJSONString(), KuaishouLaunchGroup.class);
+            group.setUnitId(detail.getLong("id"));
+            group.setId(UUID.randomUUID().toString().replace("-", ""));
+            kuaishouLaunchGroupMapper.insertKuaishouLaunchGroup(group);
+            record.setMessage("success");
+            record.setUnitId(detail.getLong("id"));
+            KuaishouLaunchGroupTarget targetEnt = JSONObject.parseObject(target.toJSONString(), KuaishouLaunchGroupTarget.class);
+            targetEnt.setAccountId(requestJson.getLong("accountId"));
+            targetEnt.setUnitId(detail.getLong("id"));
+            kuaishouLaunchGroupTargetMapper.insertKuaishouLaunchGroupTarget(targetEnt);
+            return detail.getLong("id");
+        } else {
+            record.setMessage(result.getString("message"));
+            log.error("广告组创建失败,账户{},{}", record.getAccountId(), result.toJSONString());
+        }
+        record.setId(UUID.randomUUID().toString().replace("-", ""));
+        kuaishouLaunchGroupRecordMapper.insertKuaishouLaunchGroupRecord(record);
+        return -1L;
+    }
+
+
+    /*定向数据*/
+    private JSONObject getTarget(JSONObject requestJson) {
+        JSONObject targetJson = new JSONObject();
+
+        // 地域
+        if (Check.isNotNull(requestJson.getJSONArray("region"))) {
+            targetJson.put("region", requestJson.getJSONArray("region"));
+        } else {
+            targetJson.put("region", new JSONArray());
+        }
+        // 地域类型
+        if (Check.isNotNull(requestJson.getInteger("regionType"))) {
+            targetJson.put("region_type", requestJson.getInteger("regionType"));
+        } else {
+            targetJson.put("region_type", 0);
+        }
+        // 自定义年龄段
+        JSONArray ageArr = requestJson.getJSONArray("age");
+        if (Check.isNotNull(ageArr)) {
+            targetJson.put("age", ageArr);
+        }
+        // 性别
+        if (!Check.isNull(requestJson.getInteger("genderType"))) {
+            targetJson.put("gender_type", requestJson.getInteger("genderType"));
+        }
+        // 人群包定向
+        if (!Check.isNull(requestJson.getJSONArray("population"))) {
+            targetJson.put("population", requestJson.getJSONArray("population"));
+        }
+        // 人群包排除
+        if (!Check.isNull(requestJson.getJSONArray("excludePopulation"))) {
+            targetJson.put("exclude_population", requestJson.getJSONArray("excludePopulation"));
+        }
+        // 付费人群包 id
+        if (!Check.isNull(requestJson.getJSONArray("paidAudience"))) {
+            targetJson.put("paid_audience", requestJson.getJSONArray("paidAudience"));
+        }
+
+        //快手网红信息
+        if (Check.isNotNull(requestJson.getInteger("behaviorList"))) {
+            JSONObject celebrityInfo = new JSONObject();
+            celebrityInfo.put("behavior_list", requestJson.getJSONArray("behaviorList"));
+            if (Check.isNotNull(requestJson.getJSONArray("fansStarList"))) {
+                celebrityInfo.put("fans_star_list", requestJson.getJSONArray("fansStarList"));
+            }
+            targetJson.put("celebrity_info", celebrityInfo);
+        }
+
+        //购物意图
+        if (Check.isNotNull(requestJson.getInteger("purchaseIntention"))) {
+            targetJson.put("purchase_intention", requestJson.getJSONArray("purchaseIntention"));
+        }
+        return targetJson;
+    }
+
+    /**
+     * 修改广告组信息
+     *
+     * @param kuaishouLaunchGroup 广告组信息
+     * @return 结果
+     */
+    @Override
+    public int updateKuaishouLaunchGroup(KuaishouLaunchGroup kuaishouLaunchGroup) {
+        return kuaishouLaunchGroupMapper.updateKuaishouLaunchGroup(kuaishouLaunchGroup);
+    }
+
+    /**
+     * 批量删除广告组信息
+     *
+     * @param ids 需要删除的广告组信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteKuaishouLaunchGroupByIds(String[] ids) {
+        return kuaishouLaunchGroupMapper.deleteKuaishouLaunchGroupByIds(ids);
+    }
+
+    /**
+     * 删除广告组信息信息
+     *
+     * @param id 广告组信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteKuaishouLaunchGroupById(String id) {
+        return kuaishouLaunchGroupMapper.deleteKuaishouLaunchGroupById(id);
+    }
+}

+ 137 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/service/impl/KuaishouLaunchGroupTargetServiceImpl.java

@@ -0,0 +1,137 @@
+package com.ruixuan.launch.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.domain.ResultResponse;
+import com.ruixuan.common.utils.Check;
+import com.ruixuan.common.utils.DateUtils;
+import com.ruixuan.common.utils.KuaishouAPIConstant;
+import com.ruixuan.launch.entity.KuaishouLaunchGroupTarget;
+import com.ruixuan.launch.mapper.KuaishouLaunchGroupTargetMapper;
+import com.ruixuan.launch.service.IKuaishouLaunchGroupTargetService;
+import com.ruixuan.launch.unitls.APIUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 广告组定向信息Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-06-28
+ */
+@Service
+public class KuaishouLaunchGroupTargetServiceImpl implements IKuaishouLaunchGroupTargetService {
+    @Autowired
+    private KuaishouLaunchGroupTargetMapper kuaishouLaunchGroupTargetMapper;
+
+    /**
+     * 查询广告组定向信息列表
+     *
+     * @param kuaishouLaunchGroupTarget 广告组定向信息
+     * @return 广告组定向信息
+     */
+    @Override
+    public List<KuaishouLaunchGroupTarget> selectKuaishouLaunchGroupTargetList(KuaishouLaunchGroupTarget kuaishouLaunchGroupTarget) {
+        return kuaishouLaunchGroupTargetMapper.selectKuaishouLaunchGroupTargetList(kuaishouLaunchGroupTarget);
+    }
+
+    /**
+     * 新增广告组定向信息
+     *
+     * @param kuaishouLaunchGroupTarget 广告组定向信息
+     * @return 结果
+     */
+    @Override
+    public int insertKuaishouLaunchGroupTarget(JSONObject request) {
+        KuaishouLaunchGroupTarget kuaishouLaunchGroupTarget = JSONObject.parseObject(request.toJSONString(), KuaishouLaunchGroupTarget.class);
+        return kuaishouLaunchGroupTargetMapper.insertKuaishouLaunchGroupTarget(kuaishouLaunchGroupTarget);
+    }
+
+    @Override
+    public ResultResponse getRegion(Long accountId, Integer categoryType) {
+        Map<String, Object> param = new HashMap<String, Object>();
+        param.put("advertiser_id", accountId);
+        param.put("category_type", categoryType);
+        JSONObject result = APIUtil.getApiResult(KuaishouAPIConstant.REGION, "eb2c0339a36d7270e4a98fdbf556e42b", param);
+        if (Check.isNotNull(result)) {
+            return ResultResponse.success(result.getJSONArray("details"));
+        }
+        return null;
+    }
+
+    @Override
+    public ResultResponse getPopulation(Long accountId) {
+        Map<String, Object> param = new HashMap<String, Object>();
+        param.put("advertiser_id", accountId);
+//        param.put("status", 1);
+        param.put("page_size", 500);
+        JSONObject result = APIUtil.getApiResult(KuaishouAPIConstant.POPULATION, "eb2c0339a36d7270e4a98fdbf556e42b", param);
+        if (Check.isNotNull(result)) {
+            return ResultResponse.success(result.getJSONArray("details"));
+        }
+        return null;
+    }
+
+    @Override
+    public ResultResponse getCelebrityInfo(Long accountId, String keyword, String secondLabel, Long authorId) {
+        Map<String, Object> param = new HashMap<String, Object>();
+        param.put("advertiser_id", accountId);
+        if (Check.isNotNull(keyword)) {
+            param.put("keyword", keyword);
+        }
+        if (Check.isNotNull(secondLabel)) {
+            param.put("second_label", secondLabel);
+        }
+        if (Check.isNotNull(authorId)) {
+            param.put("author_id", authorId);
+        }
+        JSONObject result = APIUtil.getApiResult(KuaishouAPIConstant.CELEBRITY_QUERY, "eb2c0339a36d7270e4a98fdbf556e42b", param);
+        if (Check.isNotNull(result)) {
+            return ResultResponse.success(result.getJSONArray("details"));
+        }
+        return null;
+    }
+
+    @Override
+    public ResultResponse getCelebrityType(Long accountId) {
+        Map<String, Object> param = new HashMap<String, Object>();
+        param.put("advertiser_id", accountId);
+        JSONObject result = APIUtil.getApiResult(KuaishouAPIConstant.CELEBRITY_TYPE, "eb2c0339a36d7270e4a98fdbf556e42b", param);
+        if (Check.isNotNull(result)) {
+            return ResultResponse.success(result.getJSONArray("details"));
+        }
+        return null;
+    }
+
+    @Override
+    public ResultResponse getPurchaseIntention(Long accountId) {
+        JSONObject param = new JSONObject();
+        param.put("advertiser_id", accountId);
+        JSONObject result = APIUtil.getApiResultByGet(KuaishouAPIConstant.PURCHASE_INTENTION, "eb2c0339a36d7270e4a98fdbf556e42b", param);
+        if (Check.isNotNull(result)) {
+            return ResultResponse.success(result.getJSONArray("list"));
+        }
+        return null;
+    }
+
+    @Override
+    public ResultResponse getVideos(Long accountId) {
+        JSONObject param = new JSONObject();
+        param.put("advertiser_id", accountId);
+        JSONObject params = new JSONObject();
+        params.put("start_time", DateUtils.timeToStamp("2022-07-01 00:00:33"));
+        params.put("end_time", new Date().getTime());
+        param.put("param", params);
+
+        JSONObject result = APIUtil.getApiResult(KuaishouAPIConstant.VIDEO_QUERY, "fbe5da761a5a4328cc42ccbb927f3036", param);
+        if (Check.isNotNull(result)) {
+            return ResultResponse.success(result.getJSONArray("details"));
+        }
+        return null;
+    }
+
+}

+ 100 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/service/impl/KuaishouLaunchTargetTemplateServiceImpl.java

@@ -0,0 +1,100 @@
+package com.ruixuan.launch.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.domain.ResultResponse;
+import com.ruixuan.launch.entity.KuaishouLaunchTargetTemplate;
+import com.ruixuan.launch.mapper.KuaishouLaunchTargetTemplateMapper;
+import com.ruixuan.launch.service.IKuaishouLaunchTargetTemplateService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 账户下所属定向信息Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-07-05
+ */
+@Service
+public class KuaishouLaunchTargetTemplateServiceImpl implements IKuaishouLaunchTargetTemplateService {
+    @Autowired
+    private KuaishouLaunchTargetTemplateMapper kuaishouLaunchTargetTemplateMapper;
+
+    /**
+     * 查询账户下所属定向信息
+     *
+     * @param id 账户下所属定向信息主键
+     * @return 账户下所属定向信息
+     */
+    @Override
+    public KuaishouLaunchTargetTemplate selectKuaishouLaunchTargetTemplateById(Long id) {
+        return kuaishouLaunchTargetTemplateMapper.selectKuaishouLaunchTargetTemplateById(id);
+    }
+
+    /**
+     * 查询账户下所属定向信息列表
+     *
+     * @param kuaishouLaunchTargetTemplate 账户下所属定向信息
+     * @return 账户下所属定向信息
+     */
+    @Override
+    public List<KuaishouLaunchTargetTemplate> selectKuaishouLaunchTargetTemplateList(KuaishouLaunchTargetTemplate kuaishouLaunchTargetTemplate) {
+        return kuaishouLaunchTargetTemplateMapper.selectKuaishouLaunchTargetTemplateList(kuaishouLaunchTargetTemplate);
+    }
+
+    /**
+     * 新增账户下所属定向信息
+     *
+     * @param kuaishouLaunchTargetTemplate 账户下所属定向信息
+     * @return 结果
+     */
+    @Override
+    public ResultResponse insertKuaishouLaunchTargetTemplate(JSONObject request) {
+        KuaishouLaunchTargetTemplate kuaishouLaunchTargetTemplate = JSONObject.parseObject(request.toJSONString(), KuaishouLaunchTargetTemplate.class);
+        kuaishouLaunchTargetTemplateMapper.insertKuaishouLaunchTargetTemplate(kuaishouLaunchTargetTemplate);
+        return ResultResponse.success();
+    }
+
+    /**
+     * 修改账户下所属定向信息
+     *
+     * @param kuaishouLaunchTargetTemplate 账户下所属定向信息
+     * @return 结果
+     */
+    @Override
+    public int updateKuaishouLaunchTargetTemplate(KuaishouLaunchTargetTemplate kuaishouLaunchTargetTemplate) {
+        return kuaishouLaunchTargetTemplateMapper.updateKuaishouLaunchTargetTemplate(kuaishouLaunchTargetTemplate);
+    }
+
+    /**
+     * 批量删除账户下所属定向信息
+     *
+     * @param ids 需要删除的账户下所属定向信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteKuaishouLaunchTargetTemplateByIds(Long[] ids) {
+        return kuaishouLaunchTargetTemplateMapper.deleteKuaishouLaunchTargetTemplateByIds(ids);
+    }
+
+    /**
+     * 删除账户下所属定向信息信息
+     *
+     * @param id 账户下所属定向信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteKuaishouLaunchTargetTemplateById(Long id) {
+        return kuaishouLaunchTargetTemplateMapper.deleteKuaishouLaunchTargetTemplateById(id);
+    }
+
+    @Override
+    public JSONObject getTargetJson(Long targetId, JSONObject strategyJson) {
+        KuaishouLaunchTargetTemplate template = kuaishouLaunchTargetTemplateMapper.selectKuaishouLaunchTargetTemplateById(targetId);
+        JSONObject targetJson = (JSONObject) JSONObject.toJSON(template);
+        strategyJson.putAll(targetJson);
+        return strategyJson;
+    }
+
+}

+ 60 - 0
ruixuan-launch/src/main/java/com/ruixuan/launch/unitls/APIUtil.java

@@ -0,0 +1,60 @@
+package com.ruixuan.launch.unitls;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.utils.Check;
+import com.ruixuan.common.utils.http.HttpUtil;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Slf4j
+public class APIUtil {
+
+    public static final String IP_PATH = "https://ad.e.kuaishou.com";
+
+    public static JSONObject getApiResult(String apiPath, String token, Map<String, Object> param) {
+        try {
+            String url = IP_PATH + apiPath;
+            Map<String, String> headers = new HashMap<String, String>();
+            headers.put("Content-Type", "application/json");
+            headers.put("Access-Token", token);
+            System.out.println(JSONObject.toJSON(param));//TODO
+            String result = HttpUtil.httpPostRequest(url, param, headers);
+            JSONObject resultJson = JSONObject.parseObject(result);
+            System.out.println(JSONObject.toJSON(resultJson)); //TODO
+            return resultJson;
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("调用媒体接口异常,账户:{},接口:{}", param.get("advertiser_id"), apiPath);
+            JSONObject result = new JSONObject();
+            result.put("code", -1);
+            result.put("message", "调用媒体接口异常");
+            return result;
+        }
+    }
+
+
+    public static JSONObject getApiResultByGet(String apiPath, String token, JSONObject param) {
+        try {
+            String url = IP_PATH + apiPath;
+            Map<String, String> headers = new HashMap<String, String>();
+            headers.put("Content-Type", "application/json");
+            headers.put("Access-Token", token);
+            System.out.println(JSONObject.toJSON(param)); //TODO
+            String result = HttpUtil.httpGetRequest(url, headers, param);
+            JSONObject resultJson = JSONObject.parseObject(result);
+            System.out.println(JSONObject.toJSON(resultJson)); //TODO
+            if (Check.isNotNull(resultJson) && resultJson.getInteger("code") == 0) {
+                return resultJson.getJSONObject("data");
+            } else {
+                log.error("调取媒体接口失败,账户:{},接口:{},信息:{}", param.get("advertiser_id"), apiPath, resultJson);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("调用媒体接口异常,账户:{},接口:{}", param.get("advertiser_id"), apiPath);
+        }
+        return null;
+    }
+
+}

+ 259 - 0
ruixuan-launch/src/main/resources/mapper/launch/KuaishouLaunchCampaignAutoStrategyMapper.xml

@@ -0,0 +1,259 @@
+<?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="com.ruixuan.launch.mapper.KuaishouLaunchCampaignAutoStrategyMapper">
+
+    <resultMap type="com.ruixuan.launch.entity.KuaishouLaunchCampaignAutoStrategy"
+               id="KuaishouLaunchCampaignAutoStrategyResult">
+        <result property="id" column="id"/>
+        <result property="state" column="state"/>
+        <result property="accountId" column="account_id"/>
+        <result property="campaignName" column="campaign_name"/>
+        <result property="campaignType" column="campaign_type"/>
+        <result property="promotionType" column="promotion_type"/>
+        <result property="putStatus" column="put_status"/>
+        <result property="budgetSchedule" column="budget_schedule"/>
+        <result property="unitName" column="unit_name"/>
+        <result property="bidType" column="bid_type"/>
+        <result property="ocpxActionArr" column="ocpx_action_arr"/>
+        <result property="roiRatio" column="roi_ratio"/>
+        <result property="sceneId" column="scene_id"/>
+        <result property="unitType" column="unit_type"/>
+        <result property="beginTimeStr" column="begin_time_str"/>
+        <result property="endTimeStr" column="end_time_str"/>
+        <result property="scheduleTime" column="schedule_time"/>
+        <result property="dayBudget" column="day_budget"/>
+        <result property="supportType" column="support_type"/>
+        <result property="showMode" column="show_mode"/>
+        <result property="speed" column="speed"/>
+        <result property="itemId" column="item_id"/>
+        <result property="merchantItemPutType" column="merchant_item_put_type"/>
+        <result property="shoppingCarProductId" column="shopping_car_product_id"/>
+        <result property="liveUserId" column="live_user_id"/>
+        <result property="targetTemplate" column="target_template"/>
+        <result property="creativeName" column="creative_name"/>
+        <result property="coverUrl" column="cover_url"/>
+        <result property="coverWidth" column="cover_width"/>
+        <result property="coverHeight" column="cover_height"/>
+        <result property="photoId" column="photo_id"/>
+        <result property="creativeMaterialType" column="creative_material_type"/>
+        <result property="actionBar" column="action_bar"/>
+        <result property="recommendation" column="recommendation"/>
+        <result property="description" column="description"/>
+        <result property="newExposeText" column="new_expose_text"/>
+        <result property="newExposeUrl" column="new_expose_url"/>
+        <result property="liveCreativeType" column="live_creative_type"/>
+        <result property="createTime" column="create_time"/>
+        <result property="createrId" column="creater_id"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <sql id="selectKuaishouLaunchCampaignAutoStrategyVo">
+        select id,
+               state,
+               account_id,
+               campaign_name,
+               campaign_type,
+               promotion_type,
+               put_status,
+               budget_schedule,
+               unit_name,
+               bid_type,
+               ocpx_action_arr,
+               roi_ratio,
+               scene_id,
+               unit_type,
+               begin_time_str,
+               end_time_str,
+               schedule_time,
+               day_budget,
+               support_type,
+               show_mode,
+               speed,
+               item_id,
+               merchant_item_put_type,
+               shopping_car_product_id,
+               live_user_id,
+               target_template,
+               creative_name,
+               cover_url,
+               cover_width,
+               cover_height,
+               photo_id,
+               creative_material_type,
+               action_bar,
+               recommendation,
+               description,
+               new_expose_text,
+               new_expose_url,
+               live_creative_type
+        from kuaishou_launch_campaign_auto_strategy
+    </sql>
+
+    <select id="selectKuaishouLaunchCampaignAutoStrategyList" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT t1.id,
+        t1.account_id as 'accountId',
+        t2.account_name as 'accountName',
+        t1.campaign_name as 'campaignName',
+        IFNULL(t3.nick_name, '-') as 'nickName',
+        DATE_FORMAT(t1.create_time, '%Y-%m-%d %H:%i:%s') as 'createTime'
+        FROM kuaishou_launch_campaign_auto_strategy t1
+        LEFT JOIN kuaishou_live_user_account t2 ON t1.account_id = t2.account_id
+        LEFT JOIN sys_user t3 ON t1.creater_id = t3.user_id
+        where state = 1
+        <if test="campaignName != null and campaignName != ''">and t1.campaign_name like concat('%', #{campaignName},
+            '%')
+            </if>
+        <if test="accountName != null and accountName != ''"> and t2.account_name like concat('%',#{accountName},
+            '%')
+        </if>
+        order by t1.create_time desc
+
+    </select>
+
+    <select id="selectKuaishouLaunchCampaignAutoStrategyById" parameterType="Long"
+            resultMap="KuaishouLaunchCampaignAutoStrategyResult">
+        <include refid="selectKuaishouLaunchCampaignAutoStrategyVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertKuaishouLaunchCampaignAutoStrategy"
+            parameterType="com.ruixuan.launch.entity.KuaishouLaunchCampaignAutoStrategy" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into kuaishou_launch_campaign_auto_strategy
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="state != null">state,</if>
+            <if test="accountId != null">account_id,</if>
+            <if test="campaignName != null and campaignName != ''">campaign_name,</if>
+            <if test="campaignType != null">campaign_type,</if>
+            <if test="promotionType != null">promotion_type,</if>
+            <if test="putStatus != null">put_status,</if>
+            <if test="budgetSchedule != null">budget_schedule,</if>
+            <if test="unitName != null">unit_name,</if>
+            <if test="bidType != null">bid_type,</if>
+            <if test="ocpxActionArr != null">ocpx_action_arr,</if>
+            <if test="roiRatio != null">roi_ratio,</if>
+            <if test="sceneId != null">scene_id,</if>
+            <if test="unitType != null">unit_type,</if>
+            <if test="beginTimeStr != null">begin_time_str,</if>
+            <if test="endTimeStr != null">end_time_str,</if>
+            <if test="scheduleTime != null">schedule_time,</if>
+            <if test="dayBudget != null">day_budget,</if>
+            <if test="supportType != null">support_type,</if>
+            <if test="showMode != null">show_mode,</if>
+            <if test="speed != null">speed,</if>
+            <if test="itemId != null">item_id,</if>
+            <if test="merchantItemPutType != null">merchant_item_put_type,</if>
+            <if test="shoppingCarProductId != null">shopping_car_product_id,</if>
+            <if test="liveUserId != null">live_user_id,</if>
+            <if test="targetTemplate != null">target_template,</if>
+            <if test="creativeName != null">creative_name,</if>
+            <if test="coverUrl != null">cover_url,</if>
+            <if test="coverWidth != null">cover_width,</if>
+            <if test="coverHeight != null">cover_height,</if>
+            <if test="photoId != null">photo_id,</if>
+            <if test="creativeMaterialType != null">creative_material_type,</if>
+            <if test="actionBar != null">action_bar,</if>
+            <if test="recommendation != null">recommendation,</if>
+            <if test="description != null">description,</if>
+            <if test="newExposeText != null">new_expose_text,</if>
+            <if test="newExposeUrl != null">new_expose_url,</if>
+            <if test="liveCreativeType != null">live_creative_type,</if>
+            <if test="createrId != null">creater_id,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="state != null">#{state},</if>
+            <if test="accountId != null">#{accountId},</if>
+            <if test="campaignName != null and campaignName != ''">#{campaignName},</if>
+            <if test="campaignType != null">#{campaignType},</if>
+            <if test="promotionType != null">#{promotionType},</if>
+            <if test="putStatus != null">#{putStatus},</if>
+            <if test="budgetSchedule != null">#{budgetSchedule},</if>
+            <if test="unitName != null">#{unitName},</if>
+            <if test="bidType != null">#{bidType},</if>
+            <if test="ocpxActionArr != null">#{ocpxActionArr},</if>
+            <if test="roiRatio != null">#{roiRatio},</if>
+            <if test="sceneId != null">#{sceneId},</if>
+            <if test="unitType != null">#{unitType},</if>
+            <if test="beginTimeStr != null">#{beginTimeStr},</if>
+            <if test="endTimeStr != null">#{endTimeStr},</if>
+            <if test="scheduleTime != null">#{scheduleTime},</if>
+            <if test="dayBudget != null">#{dayBudget},</if>
+            <if test="supportType != null">#{supportType},</if>
+            <if test="showMode != null">#{showMode},</if>
+            <if test="speed != null">#{speed},</if>
+            <if test="itemId != null">#{itemId},</if>
+            <if test="merchantItemPutType != null">#{merchantItemPutType},</if>
+            <if test="shoppingCarProductId != null">#{shoppingCarProductId},</if>
+            <if test="liveUserId != null">#{liveUserId},</if>
+            <if test="targetTemplate != null">#{targetTemplate},</if>
+            <if test="creativeName != null">#{creativeName},</if>
+            <if test="coverUrl != null">#{coverUrl},</if>
+            <if test="coverWidth != null">#{coverWidth},</if>
+            <if test="coverHeight != null">#{coverHeight},</if>
+            <if test="photoId != null">#{photoId},</if>
+            <if test="creativeMaterialType != null">#{creativeMaterialType},</if>
+            <if test="actionBar != null">#{actionBar},</if>
+            <if test="recommendation != null">#{recommendation},</if>
+            <if test="description != null">#{description},</if>
+            <if test="newExposeText != null">#{newExposeText},</if>
+            <if test="newExposeUrl != null">#{newExposeUrl},</if>
+            <if test="liveCreativeType != null">#{liveCreativeType},</if>
+            <if test="createrId != null">#{createrId},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updateKuaishouLaunchCampaignAutoStrategy"
+            parameterType="com.ruixuan.launch.entity.KuaishouLaunchCampaignAutoStrategy">
+        update kuaishou_launch_campaign_auto_strategy
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="state != null">state = #{state},</if>
+            <if test="accountId != null">account_id = #{accountId},</if>
+            <if test="campaignName != null and campaignName != ''">campaign_name = #{campaignName},</if>
+            <if test="campaignType != null">campaign_type = #{campaignType},</if>
+            <if test="promotionType != null">promotion_type = #{promotionType},</if>
+            <if test="putStatus != null">put_status = #{putStatus},</if>
+            <if test="budgetSchedule != null">budget_schedule = #{budgetSchedule},</if>
+            <if test="unitName != null">unit_name = #{unitName},</if>
+            <if test="bidType != null">bid_type = #{bidType},</if>
+            <if test="ocpxActionArr != null">ocpx_action_arr = #{ocpxActionArr},</if>
+            <if test="roiRatio != null">roi_ratio = #{roiRatio},</if>
+            <if test="sceneId != null">scene_id = #{sceneId},</if>
+            <if test="unitType != null">unit_type = #{unitType},</if>
+            <if test="beginTimeStr != null">begin_time_str = #{beginTimeStr},</if>
+            <if test="endTimeStr != null">end_time_str = #{endTimeStr},</if>
+            <if test="scheduleTime != null">schedule_time = #{scheduleTime},</if>
+            <if test="dayBudget != null">day_budget = #{dayBudget},</if>
+            <if test="supportType != null">support_type = #{supportType},</if>
+            <if test="showMode != null">show_mode = #{showMode},</if>
+            <if test="speed != null">speed = #{speed},</if>
+            <if test="itemId != null">item_id = #{itemId},</if>
+            <if test="merchantItemPutType != null">merchant_item_put_type = #{merchantItemPutType},</if>
+            <if test="shoppingCarProductId != null">shopping_car_product_id = #{shoppingCarProductId},</if>
+            <if test="liveUserId != null">live_user_id = #{liveUserId},</if>
+            <if test="targetTemplate != null">target_template = #{targetTemplate},</if>
+            <if test="creativeName != null">creative_name = #{creativeName},</if>
+            <if test="coverUrl != null">cover_url = #{coverUrl},</if>
+            <if test="coverWidth != null">cover_width = #{coverWidth},</if>
+            <if test="coverHeight != null">cover_height = #{coverHeight},</if>
+            <if test="photoId != null">photo_id = #{photoId},</if>
+            <if test="creativeMaterialType != null">creative_material_type = #{creativeMaterialType},</if>
+            <if test="actionBar != null">action_bar = #{actionBar},</if>
+            <if test="recommendation != null">recommendation = #{recommendation},</if>
+            <if test="description != null">description = #{description},</if>
+            <if test="newExposeText != null">new_expose_text = #{newExposeText},</if>
+            <if test="newExposeUrl != null">new_expose_url = #{newExposeUrl},</if>
+            <if test="liveCreativeType != null">live_creative_type = #{liveCreativeType},</if>
+            <if test="createrId != null">creater_id = #{createrId},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+</mapper>

+ 123 - 0
ruixuan-launch/src/main/resources/mapper/launch/KuaishouLaunchCampaignMapper.xml

@@ -0,0 +1,123 @@
+<?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="com.ruixuan.launch.mapper.KuaishouLaunchCampaignMapper">
+
+    <resultMap type="com.ruixuan.launch.entity.KuaishouLaunchCampaign" id="KuaishouLaunchCampaignResult">
+        <result property="id" column="id"/>
+        <result property="accountId" column="account_id"/>
+        <result property="campaignId" column="campaign_id"/>
+        <result property="campaignName" column="campaign_name"/>
+        <result property="campaignType" column="campaign_type"/>
+        <result property="promotionType" column="promotion_type"/>
+        <result property="putStatus" column="put_status"/>
+        <result property="dayBudget" column="day_budget"/>
+        <result property="budgetSchedule" column="budget_schedule"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <sql id="selectKuaishouLaunchCampaignVo">
+        select id,
+               account_id,
+               campaign_id,
+               campaign_name,
+               campaign_type,
+               promotion_type,
+               put_status,
+               day_budget,
+               budget_schedule,
+               create_time,
+               update_time
+        from kuaishou_launch_campaign
+    </sql>
+
+    <select id="selectKuaishouLaunchCampaignList" parameterType="com.ruixuan.launch.entity.KuaishouLaunchCampaign"
+            resultMap="KuaishouLaunchCampaignResult">
+        <include refid="selectKuaishouLaunchCampaignVo"/>
+        <where>
+            <if test="accountId != null ">and account_id = #{accountId}</if>
+            <if test="campaignId != null ">and campaign_id = #{campaignId}</if>
+            <if test="campaignName != null  and campaignName != ''">and campaign_name like concat('%', #{campaignName},
+                '%')
+            </if>
+            <if test="campaignType != null ">and campaign_type = #{campaignType}</if>
+            <if test="promotionType != null ">and promotion_type = #{promotionType}</if>
+            <if test="putStatus != null ">and put_status = #{putStatus}</if>
+            <if test="dayBudget != null ">and day_budget = #{dayBudget}</if>
+            <if test="budgetSchedule != null  and budgetSchedule != ''">and budget_schedule = #{budgetSchedule}</if>
+        </where>
+    </select>
+
+    <select id="selectKuaishouLaunchCampaignById" parameterType="String" resultMap="KuaishouLaunchCampaignResult">
+        <include refid="selectKuaishouLaunchCampaignVo"/>
+        where id = #{id}
+    </select>
+
+    <select id="getOne" resultMap="KuaishouLaunchCampaignResult">
+        <include refid="selectKuaishouLaunchCampaignVo"/>
+        where account_id = #{accountId}
+        and campaign_name = #{campaignName}
+    </select>
+
+    <insert id="insertKuaishouLaunchCampaign" parameterType="com.ruixuan.launch.entity.KuaishouLaunchCampaign">
+        insert into kuaishou_launch_campaign
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="accountId != null">account_id,</if>
+            <if test="campaignId != null">campaign_id,</if>
+            <if test="campaignName != null and campaignName != ''">campaign_name,</if>
+            <if test="campaignType != null">campaign_type,</if>
+            <if test="promotionType != null">promotion_type,</if>
+            <if test="putStatus != null">put_status,</if>
+            <if test="dayBudget != null">day_budget,</if>
+            <if test="budgetSchedule != null">budget_schedule,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="accountId != null">#{accountId},</if>
+            <if test="campaignId != null">#{campaignId},</if>
+            <if test="campaignName != null and campaignName != ''">#{campaignName},</if>
+            <if test="campaignType != null">#{campaignType},</if>
+            <if test="promotionType != null">#{promotionType},</if>
+            <if test="putStatus != null">#{putStatus},</if>
+            <if test="dayBudget != null">#{dayBudget},</if>
+            <if test="budgetSchedule != null">#{budgetSchedule},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updateKuaishouLaunchCampaign" parameterType="com.ruixuan.launch.entity.KuaishouLaunchCampaign">
+        update kuaishou_launch_campaign
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="accountId != null">account_id = #{accountId},</if>
+            <if test="campaignId != null">campaign_id = #{campaignId},</if>
+            <if test="campaignName != null and campaignName != ''">campaign_name = #{campaignName},</if>
+            <if test="campaignType != null">campaign_type = #{campaignType},</if>
+            <if test="promotionType != null">promotion_type = #{promotionType},</if>
+            <if test="putStatus != null">put_status = #{putStatus},</if>
+            <if test="dayBudget != null">day_budget = #{dayBudget},</if>
+            <if test="budgetSchedule != null">budget_schedule = #{budgetSchedule},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteKuaishouLaunchCampaignById" parameterType="String">
+        delete
+        from kuaishou_launch_campaign
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteKuaishouLaunchCampaignByIds" parameterType="String">
+        delete from kuaishou_launch_campaign where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 170 - 0
ruixuan-launch/src/main/resources/mapper/launch/KuaishouLaunchCreativeMapper.xml

@@ -0,0 +1,170 @@
+<?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="com.ruixuan.launch.mapper.KuaishouLaunchCreativeMapper">
+
+    <resultMap type="com.ruixuan.launch.entity.KuaishouLaunchCreative" id="KuaishouLaunchCreativeResult">
+        <result property="id" column="id"/>
+        <result property="accountId" column="account_id"/>
+        <result property="campaignId" column="campaign_id"/>
+        <result property="unitId" column="unit_id"/>
+        <result property="creativeId" column="creative_id"/>
+        <result property="creativeName" column="creative_name"/>
+        <result property="coverUrl" column="cover_url"/>
+        <result property="coverWidth" column="cover_width"/>
+        <result property="coverHeight" column="cover_height"/>
+        <result property="photoId" column="photo_id"/>
+        <result property="creativeMaterialType" column="creative_material_type"/>
+        <result property="actionBar" column="action_bar"/>
+        <result property="recommendation" column="recommendation"/>
+        <result property="description" column="description"/>
+        <result property="newExposeText" column="new_expose_text"/>
+        <result property="newExposeUrl" column="new_expose_url"/>
+        <result property="liveCreativeType" column="live_creative_type"/>
+        <result property="putStatus" column="put_status"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <sql id="selectKuaishouLaunchCreativeVo">
+        select id,
+               account_id,
+               campaign_id,
+               unit_id creative_id,
+               creative_name,
+               cover_url,
+               cover_width,
+               cover_height,
+               photo_id,
+               creative_material_type,
+               action_bar,
+               recommendation,
+               description,
+               new_expose_text,
+               new_expose_url,
+               live_creative_type,
+               put_status,
+               create_time,
+               update_time
+        from kuaishou_launch_creative
+    </sql>
+
+    <select id="selectKuaishouLaunchCreativeList" parameterType="com.ruixuan.launch.entity.KuaishouLaunchCreative"
+            resultMap="KuaishouLaunchCreativeResult">
+        <include refid="selectKuaishouLaunchCreativeVo"/>
+        <where>
+            <if test="accountId != null ">and account_id = #{accountId}</if>
+            <if test="campaignId != null ">and campaign_id = #{campaignId}</if>
+            <if test="unitId != null ">and unit_id = #{unitId}</if>
+            <if test="creativeId != null ">and creative_id = #{creativeId}</if>
+            <if test="creativeName != null  and creativeName != ''">and creative_name like concat('%', #{creativeName},
+                '%')
+            </if>
+            <if test="coverUrl != null  and coverUrl != ''">and cover_url = #{coverUrl}</if>
+            <if test="coverWidth != null ">and cover_width = #{coverWidth}</if>
+            <if test="coverHeight != null ">and cover_height = #{coverHeight}</if>
+            <if test="photoId != null  and photoId != ''">and photo_id = #{photoId}</if>
+            <if test="creativeMaterialType != null ">and creative_material_type = #{creativeMaterialType}</if>
+            <if test="actionBar != null  and actionBar != ''">and action_bar = #{actionBar}</if>
+            <if test="recommendation != null  and recommendation != ''">and recommendation = #{recommendation}</if>
+            <if test="description != null  and description != ''">and description = #{description}</if>
+            <if test="newExposeText != null  and newExposeText != ''">and new_expose_text = #{newExposeText}</if>
+            <if test="newExposeUrl != null  and newExposeUrl != ''">and new_expose_url = #{newExposeUrl}</if>
+            <if test="liveCreativeType != null ">and live_creative_type = #{liveCreativeType}</if>
+            <if test="putStatus != null ">and put_status = #{putStatus}</if>
+        </where>
+    </select>
+
+    <select id="selectKuaishouLaunchCreativeById" parameterType="String" resultMap="KuaishouLaunchCreativeResult">
+        <include refid="selectKuaishouLaunchCreativeVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertKuaishouLaunchCreative" parameterType="com.ruixuan.launch.entity.KuaishouLaunchCreative">
+        insert into kuaishou_launch_creative
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="accountId != null">account_id,</if>
+            <if test="campaignId != null">campaign_id,</if>
+            <if test="unitId != null">unit_id,</if>
+            <if test="creativeId != null">creative_id,</if>
+            <if test="creativeName != null">creative_name,</if>
+            <if test="coverUrl != null">cover_url,</if>
+            <if test="coverWidth != null">cover_width,</if>
+            <if test="coverHeight != null">cover_height,</if>
+            <if test="photoId != null">photo_id,</if>
+            <if test="creativeMaterialType != null">creative_material_type,</if>
+            <if test="actionBar != null">action_bar,</if>
+            <if test="recommendation != null">recommendation,</if>
+            <if test="description != null">description,</if>
+            <if test="newExposeText != null">new_expose_text,</if>
+            <if test="newExposeUrl != null">new_expose_url,</if>
+            <if test="liveCreativeType != null">live_creative_type,</if>
+            <if test="putStatus != null">put_status,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="accountId != null">#{accountId},</if>
+            <if test="campaignId != null">#{campaignId},</if>
+            <if test="unitId != null">#{unitId},</if>
+            <if test="creativeId != null">#{creativeId},</if>
+            <if test="creativeName != null">#{creativeName},</if>
+            <if test="coverUrl != null">#{coverUrl},</if>
+            <if test="coverWidth != null">#{coverWidth},</if>
+            <if test="coverHeight != null">#{coverHeight},</if>
+            <if test="photoId != null">#{photoId},</if>
+            <if test="creativeMaterialType != null">#{creativeMaterialType},</if>
+            <if test="actionBar != null">#{actionBar},</if>
+            <if test="recommendation != null">#{recommendation},</if>
+            <if test="description != null">#{description},</if>
+            <if test="newExposeText != null">#{newExposeText},</if>
+            <if test="newExposeUrl != null">#{newExposeUrl},</if>
+            <if test="liveCreativeType != null">#{liveCreativeType},</if>
+            <if test="putStatus != null">#{putStatus},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updateKuaishouLaunchCreative" parameterType="com.ruixuan.launch.entity.KuaishouLaunchCreative">
+        update kuaishou_launch_creative
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="accountId != null">account_id = #{accountId},</if>
+            <if test="campaignId != null">campaign_id = #{campaignId},</if>
+            <if test="unitId != null">unit_id = #{unitId},</if>
+            <if test="creativeId != null">creative_id = #{creativeId},</if>
+            <if test="creativeName != null">creative_name = #{creativeName},</if>
+            <if test="coverUrl != null">cover_url = #{coverUrl},</if>
+            <if test="coverWidth != null">cover_width = #{coverWidth},</if>
+            <if test="coverHeight != null">cover_height = #{coverHeight},</if>
+            <if test="photoId != null">photo_id = #{photoId},</if>
+            <if test="creativeMaterialType != null">creative_material_type = #{creativeMaterialType},</if>
+            <if test="actionBar != null">action_bar = #{actionBar},</if>
+            <if test="recommendation != null">recommendation = #{recommendation},</if>
+            <if test="description != null">description = #{description},</if>
+            <if test="newExposeText != null">new_expose_text = #{newExposeText},</if>
+            <if test="newExposeUrl != null">new_expose_url = #{newExposeUrl},</if>
+            <if test="liveCreativeType != null">live_creative_type = #{liveCreativeType},</if>
+            <if test="putStatus != null">put_status = #{putStatus},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteKuaishouLaunchCreativeById" parameterType="String">
+        delete
+        from kuaishou_launch_creative
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteKuaishouLaunchCreativeByIds" parameterType="String">
+        delete from kuaishou_launch_creative where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 200 - 0
ruixuan-launch/src/main/resources/mapper/launch/KuaishouLaunchGroupMapper.xml

@@ -0,0 +1,200 @@
+<?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="com.ruixuan.launch.mapper.KuaishouLaunchGroupMapper">
+
+    <resultMap type="com.ruixuan.launch.entity.KuaishouLaunchGroup" id="KuaishouLaunchGroupResult">
+        <result property="id" column="id"/>
+        <result property="accountId" column="account_id"/>
+        <result property="campaignId" column="campaign_id"/>
+        <result property="unitId" column="unit_id"/>
+        <result property="unitName" column="unit_name"/>
+        <result property="putStatus" column="put_status"/>
+        <result property="cpaBid" column="cpa_bid"/>
+        <result property="bidType" column="bid_type"/>
+        <result property="ocpxActionType" column="ocpx_action_type"/>
+        <result property="roiRatio" column="roi_ratio"/>
+        <result property="sceneId" column="scene_id"/>
+        <result property="unitType" column="unit_type"/>
+        <result property="beginTimeStr" column="begin_time_str"/>
+        <result property="endTimeStr" column="end_time_str"/>
+        <result property="scheduleTime" column="schedule_time"/>
+        <result property="dayBudget" column="day_budget"/>
+        <result property="supportType" column="support_type"/>
+        <result property="showMode" column="show_mode"/>
+        <result property="speed" column="speed"/>
+        <result property="itemId" column="item_id"/>
+        <result property="merchantItemPutType" column="merchant_item_put_type"/>
+        <result property="shoppingCarProductId" column="shopping_car_product_id"/>
+        <result property="liveUserId" column="live_user_id"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <sql id="selectKuaishouLaunchGroupVo">
+        select id,
+               account_id,
+               campaign_id,
+               unit_id,
+               unit_name,
+               put_status,
+               cpa_bid,
+               bid_type,
+               ocpx_action_type,
+               roi_ratio,
+               scene_id,
+               unit_type,
+               begin_time_str,
+               end_time_str,
+               schedule_time,
+               day_budget,
+               support_type,
+               show_mode,
+               speed,
+               item_id,
+               merchant_item_put_type,
+               shopping_car_product_id,
+               live_user_id,
+               create_time,
+               update_time
+        from kuaishou_launch_group
+    </sql>
+
+    <select id="selectKuaishouLaunchGroupList" parameterType="com.ruixuan.launch.entity.KuaishouLaunchGroup"
+            resultMap="KuaishouLaunchGroupResult">
+        <include refid="selectKuaishouLaunchGroupVo"/>
+        <where>
+            <if test="accountId != null ">and account_id = #{accountId}</if>
+            <if test="campaignId != null ">and campaign_id = #{campaignId}</if>
+            <if test="unitId != null ">and unit_id = #{unitId}</if>
+            <if test="unitName != null  and unitName != ''">and unit_name like concat('%', #{unitName}, '%')</if>
+            <if test="putStatus != null ">and put_status = #{putStatus}</if>
+            <if test="cpaBid != null ">and cpa_bid = #{cpaBid}</if>
+            <if test="bidType != null ">and bid_type = #{bidType}</if>
+            <if test="ocpxActionType != null ">and ocpx_action_type = #{ocpxActionType}</if>
+            <if test="roiRatio != null ">and roi_ratio = #{roiRatio}</if>
+            <if test="sceneId != null  and sceneId != ''">and scene_id = #{sceneId}</if>
+            <if test="unitType != null ">and unit_type = #{unitType}</if>
+            <if test="beginTimeStr != null  and beginTimeStr != ''">and begin_time_str = #{beginTimeStr}
+            </if>
+            <if test="endTimeStr != null  and endTimeStr != ''">and end_time_str = #{endTimeStr}</if>
+            <if test="scheduleTime != null  and scheduleTime != ''">and schedule_time = #{scheduleTime}</if>
+            <if test="dayBudget != null ">and day_budget = #{dayBudget}</if>
+            <if test="supportType != null ">and support_type = #{supportType}</if>
+            <if test="showMode != null ">and show_mode = #{showMode}</if>
+            <if test="speed != null ">and speed = #{speed}</if>
+            <if test="itemId != null ">and item_id = #{itemId}</if>
+            <if test="merchantItemPutType != null ">and merchant_item_put_type = #{merchantItemPutType}</if>
+            <if test="shoppingCarProductId != null ">and shopping_car_product_id = #{shoppingCarProductId}</if>
+            <if test="liveUserId != null ">and live_user_id = #{liveUserId}</if>
+        </where>
+    </select>
+
+    <select id="selectKuaishouLaunchGroupById" parameterType="String" resultMap="KuaishouLaunchGroupResult">
+        <include refid="selectKuaishouLaunchGroupVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertKuaishouLaunchGroup" parameterType="com.ruixuan.launch.entity.KuaishouLaunchGroup">
+        insert into kuaishou_launch_group
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="accountId != null">account_id,</if>
+            <if test="campaignId != null">campaign_id,</if>
+            <if test="unitId != null">unit_id,</if>
+            <if test="unitName != null">unit_name,</if>
+            <if test="putStatus != null">put_status,</if>
+            <if test="cpaBid != null">cpa_bid,</if>
+            <if test="bidType != null">bid_type,</if>
+            <if test="ocpxActionType != null">ocpx_action_type,</if>
+            <if test="roiRatio != null">roi_ratio,</if>
+            <if test="sceneId != null">scene_id,</if>
+            <if test="unitType != null">unit_type,</if>
+            <if test="beginTimeStr != null">begin_time_str,</if>
+            <if test="endTimeStr != null">end_time_str,</if>
+            <if test="scheduleTime != null">schedule_time,</if>
+            <if test="dayBudget != null">day_budget,</if>
+            <if test="supportType != null">support_type,</if>
+            <if test="showMode != null">show_mode,</if>
+            <if test="speed != null">speed,</if>
+            <if test="itemId != null">item_id,</if>
+            <if test="merchantItemPutType != null">merchant_item_put_type,</if>
+            <if test="shoppingCarProductId != null">shopping_car_product_id,</if>
+            <if test="liveUserId != null">live_user_id,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="accountId != null">#{accountId},</if>
+            <if test="campaignId != null">#{campaignId},</if>
+            <if test="unitId != null">#{unitId},</if>
+            <if test="unitName != null">#{unitName},</if>
+            <if test="putStatus != null">#{putStatus},</if>
+            <if test="cpaBid != null">#{cpaBid},</if>
+            <if test="bidType != null">#{bidType},</if>
+            <if test="ocpxActionType != null">#{ocpxActionType},</if>
+            <if test="roiRatio != null">#{roiRatio},</if>
+            <if test="sceneId != null">#{sceneId},</if>
+            <if test="unitType != null">#{unitType},</if>
+            <if test="beginTimeStr != null">#{beginTimeStr},</if>
+            <if test="endTimeStr != null">#{endTimeStr},</if>
+            <if test="scheduleTime != null">#{scheduleTime},</if>
+            <if test="dayBudget != null">#{dayBudget},</if>
+            <if test="supportType != null">#{supportType},</if>
+            <if test="showMode != null">#{showMode},</if>
+            <if test="speed != null">#{speed},</if>
+            <if test="itemId != null">#{itemId},</if>
+            <if test="merchantItemPutType != null">#{merchantItemPutType},</if>
+            <if test="shoppingCarProductId != null">#{shoppingCarProductId},</if>
+            <if test="liveUserId != null">#{liveUserId},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updateKuaishouLaunchGroup" parameterType="com.ruixuan.launch.entity.KuaishouLaunchGroup">
+        update kuaishou_launch_group
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="accountId != null">account_id = #{accountId},</if>
+            <if test="campaignId != null">campaign_id = #{campaignId},</if>
+            <if test="unitId != null">unit_id = #{unitId},</if>
+            <if test="unitName != null">unit_name = #{unitName},</if>
+            <if test="putStatus != null">put_status = #{putStatus},</if>
+            <if test="cpaBid != null">cpa_bid = #{cpaBid},</if>
+            <if test="bidType != null">bid_type = #{bidType},</if>
+            <if test="ocpxActionType != null">ocpx_action_type = #{ocpxActionType},</if>
+            <if test="roiRatio != null">roi_ratio = #{roiRatio},</if>
+            <if test="sceneId != null">scene_id = #{sceneId},</if>
+            <if test="unitType != null">unit_type = #{unitType},</if>
+            <if test="beginTimeStr != null">begin_time_str = #{beginTimeStr},</if>
+            <if test="endTimeStr != null">end_time_str = #{endTimeStr},</if>
+            <if test="scheduleTime != null">schedule_time = #{scheduleTime},</if>
+            <if test="dayBudget != null">day_budget = #{dayBudget},</if>
+            <if test="supportType != null">support_type = #{supportType},</if>
+            <if test="showMode != null">show_mode = #{showMode},</if>
+            <if test="speed != null">speed = #{speed},</if>
+            <if test="itemId != null">item_id = #{itemId},</if>
+            <if test="merchantItemPutType != null">merchant_item_put_type = #{merchantItemPutType},</if>
+            <if test="shoppingCarProductId != null">shopping_car_product_id = #{shoppingCarProductId},</if>
+            <if test="liveUserId != null">live_user_id = #{liveUserId},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteKuaishouLaunchGroupById" parameterType="String">
+        delete
+        from kuaishou_launch_group
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteKuaishouLaunchGroupByIds" parameterType="String">
+        delete from kuaishou_launch_group where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 257 - 0
ruixuan-launch/src/main/resources/mapper/launch/KuaishouLaunchGroupRecordMapper.xml

@@ -0,0 +1,257 @@
+<?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="com.ruixuan.launch.mapper.KuaishouLaunchGroupRecordMapper">
+
+    <resultMap type="com.ruixuan.launch.entity.KuaishouLaunchGroupRecord" id="KuaishouLaunchGroupRecordResult">
+        <result property="id" column="id"/>
+        <result property="accountId" column="account_id"/>
+        <result property="campaignId" column="campaign_id"/>
+        <result property="unitId" column="unit_id"/>
+        <result property="unitName" column="unit_name"/>
+        <result property="cpaBid" column="cpa_bid"/>
+        <result property="bidType" column="bid_type"/>
+        <result property="ocpxActionType" column="ocpx_action_type"/>
+        <result property="roiRatio" column="roi_ratio"/>
+        <result property="sceneId" column="scene_id"/>
+        <result property="unitType" column="unit_type"/>
+        <result property="beginTimeStr" column="begin_time_str"/>
+        <result property="endTimeStr" column="end_time_str"/>
+        <result property="scheduleTime" column="schedule_time"/>
+        <result property="dayBudget" column="day_budget"/>
+        <result property="supportType" column="support_type"/>
+        <result property="showMode" column="show_mode"/>
+        <result property="speed" column="speed"/>
+        <result property="itemId" column="item_id"/>
+        <result property="merchantItemPutType" column="merchant_item_put_type"/>
+        <result property="shoppingCarProductId" column="shopping_car_product_id"/>
+        <result property="liveUserId" column="live_user_id"/>
+        <result property="region" column="region"/>
+        <result property="age" column="age"/>
+        <result property="genderType" column="gender_type"/>
+        <result property="population" column="population"/>
+        <result property="excludePopulation" column="exclude_population"/>
+        <result property="paidAudience" column="paid_audience"/>
+        <result property="behaviorList" column="behavior_list"/>
+        <result property="fansStarList" column="fans_star_list"/>
+        <result property="purchaseIntention" column="purchase_intention"/>
+        <result property="message" column="message"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <sql id="selectKuaishouLaunchGroupRecordVo">
+        select id,
+               account_id,
+               campaign_id,
+               unit_id,
+               unit_name,
+               cpa_bid,
+               bid_type,
+               ocpx_action_type,
+               roi_ratio,
+               scene_id,
+               unit_type,
+               begin_time_str,
+               end_time_str,
+               schedule_time,
+               day_budget,
+               support_type,
+               show_mode,
+               speed,
+               item_id,
+               merchant_item_put_type,
+               shopping_car_product_id,
+               live_user_id,
+               region,
+               age,
+               gender_type,
+               population,
+               exclude_population,
+               paid_audience,
+               behavior_list,
+               fans_star_list,
+               purchase_intention,
+               message,
+               create_time,
+               update_time
+        from kuaishou_launch_group_record
+    </sql>
+
+    <select id="selectKuaishouLaunchGroupRecordList" parameterType="com.ruixuan.launch.entity.KuaishouLaunchGroupRecord"
+            resultMap="KuaishouLaunchGroupRecordResult">
+        <include refid="selectKuaishouLaunchGroupRecordVo"/>
+        <where>
+            <if test="accountId != null ">and account_id = #{accountId}</if>
+            <if test="campaignId != null ">and campaign_id = #{campaignId}</if>
+            <if test="unitId != null ">and unit_id = #{unitId}</if>
+            <if test="unitName != null  and unitName != ''">and unit_name like concat('%', #{unitName}, '%')</if>
+            <if test="cpaBid != null ">and cpa_bid = #{cpaBid}</if>
+            <if test="bidType != null ">and bid_type = #{bidType}</if>
+            <if test="ocpxActionType != null ">and ocpx_action_type = #{ocpxActionType}</if>
+            <if test="roiRatio != null ">and roi_ratio = #{roiRatio}</if>
+            <if test="sceneId != null  and sceneId != ''">and scene_id = #{sceneId}</if>
+            <if test="unitType != null ">and unit_type = #{unitType}</if>
+            <if test="beginTimeStr != null  and beginTimeStr != ''">and begin_time_str = #{beginTimeStr}</if>
+            <if test="endTimeStr != null  and endTimeStr != ''">and end_time_str = #{endTimeStr}</if>
+            <if test="scheduleTime != null  and scheduleTime != ''">and schedule_time = #{scheduleTime}</if>
+            <if test="dayBudget != null ">and day_budget = #{dayBudget}</if>
+            <if test="supportType != null ">and support_type = #{supportType}</if>
+            <if test="showMode != null ">and show_mode = #{showMode}</if>
+            <if test="speed != null ">and speed = #{speed}</if>
+            <if test="itemId != null ">and item_id = #{itemId}</if>
+            <if test="merchantItemPutType != null ">and merchant_item_put_type = #{merchantItemPutType}</if>
+            <if test="shoppingCarProductId != null ">and shopping_car_product_id = #{shoppingCarProductId}</if>
+            <if test="liveUserId != null ">and live_user_id = #{liveUserId}</if>
+            <if test="region != null  and region != ''">and region = #{region}</if>
+            <if test="age != null  and age != ''">and age = #{age}</if>
+            <if test="genderType != null ">and gender_type = #{genderType}</if>
+            <if test="population != null  and population != ''">and population = #{population}</if>
+            <if test="excludePopulation != null  and excludePopulation != ''">and exclude_population =
+                #{excludePopulation}
+            </if>
+            <if test="paidAudience != null  and paidAudience != ''">and paid_audience = #{paidAudience}</if>
+            <if test="behaviorList != null  and behaviorList != ''">and behavior_list = #{behaviorList}</if>
+            <if test="fansStarList != null  and fansStarList != ''">and fans_star_list = #{fansStarList}</if>
+            <if test="purchaseIntention != null  and purchaseIntention != ''">and purchase_intention =
+                #{purchaseIntention}
+            </if>
+            <if test="message != null  and message != ''">and message = #{message}</if>
+        </where>
+    </select>
+
+    <select id="selectKuaishouLaunchGroupRecordById" parameterType="String" resultMap="KuaishouLaunchGroupRecordResult">
+        <include refid="selectKuaishouLaunchGroupRecordVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertKuaishouLaunchGroupRecord" parameterType="com.ruixuan.launch.entity.KuaishouLaunchGroupRecord">
+        insert into kuaishou_launch_group_record
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="accountId != null">account_id,</if>
+            <if test="campaignId != null">campaign_id,</if>
+            <if test="unitId != null">unit_id,</if>
+            <if test="unitName != null">unit_name,</if>
+            <if test="cpaBid != null">cpa_bid,</if>
+            <if test="bidType != null">bid_type,</if>
+            <if test="ocpxActionType != null">ocpx_action_type,</if>
+            <if test="roiRatio != null">roi_ratio,</if>
+            <if test="sceneId != null">scene_id,</if>
+            <if test="unitType != null">unit_type,</if>
+            <if test="beginTimeStr != null">begin_time_str,</if>
+            <if test="endTimeStr != null">end_time_str,</if>
+            <if test="scheduleTime != null">schedule_time,</if>
+            <if test="dayBudget != null">day_budget,</if>
+            <if test="supportType != null">support_type,</if>
+            <if test="showMode != null">show_mode,</if>
+            <if test="speed != null">speed,</if>
+            <if test="itemId != null">item_id,</if>
+            <if test="merchantItemPutType != null">merchant_item_put_type,</if>
+            <if test="shoppingCarProductId != null">shopping_car_product_id,</if>
+            <if test="liveUserId != null">live_user_id,</if>
+            <if test="region != null">region,</if>
+            <if test="age != null">age,</if>
+            <if test="genderType != null">gender_type,</if>
+            <if test="population != null">population,</if>
+            <if test="excludePopulation != null">exclude_population,</if>
+            <if test="paidAudience != null">paid_audience,</if>
+            <if test="behaviorList != null">behavior_list,</if>
+            <if test="fansStarList != null">fans_star_list,</if>
+            <if test="purchaseIntention != null">purchase_intention,</if>
+            <if test="message != null">message,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="accountId != null">#{accountId},</if>
+            <if test="campaignId != null">#{campaignId},</if>
+            <if test="unitId != null">#{unitId},</if>
+            <if test="unitName != null">#{unitName},</if>
+            <if test="cpaBid != null">#{cpaBid},</if>
+            <if test="bidType != null">#{bidType},</if>
+            <if test="ocpxActionType != null">#{ocpxActionType},</if>
+            <if test="roiRatio != null">#{roiRatio},</if>
+            <if test="sceneId != null">#{sceneId},</if>
+            <if test="unitType != null">#{unitType},</if>
+            <if test="beginTimeStr != null">#{beginTimeStr},</if>
+            <if test="endTimeStr != null">#{endTimeStr},</if>
+            <if test="scheduleTime != null">#{scheduleTime},</if>
+            <if test="dayBudget != null">#{dayBudget},</if>
+            <if test="supportType != null">#{supportType},</if>
+            <if test="showMode != null">#{showMode},</if>
+            <if test="speed != null">#{speed},</if>
+            <if test="itemId != null">#{itemId},</if>
+            <if test="merchantItemPutType != null">#{merchantItemPutType},</if>
+            <if test="shoppingCarProductId != null">#{shoppingCarProductId},</if>
+            <if test="liveUserId != null">#{liveUserId},</if>
+            <if test="region != null">#{region},</if>
+            <if test="age != null">#{age},</if>
+            <if test="genderType != null">#{genderType},</if>
+            <if test="population != null">#{population},</if>
+            <if test="excludePopulation != null">#{excludePopulation},</if>
+            <if test="paidAudience != null">#{paidAudience},</if>
+            <if test="behaviorList != null">#{behaviorList},</if>
+            <if test="fansStarList != null">#{fansStarList},</if>
+            <if test="purchaseIntention != null">#{purchaseIntention},</if>
+            <if test="message != null">#{message},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updateKuaishouLaunchGroupRecord" parameterType="com.ruixuan.launch.entity.KuaishouLaunchGroupRecord">
+        update kuaishou_launch_group_record
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="accountId != null">account_id = #{accountId},</if>
+            <if test="campaignId != null">campaign_id = #{campaignId},</if>
+            <if test="unitId != null">unit_id = #{unitId},</if>
+            <if test="unitName != null">unit_name = #{unitName},</if>
+            <if test="cpaBid != null">cpa_bid = #{cpaBid},</if>
+            <if test="bidType != null">bid_type = #{bidType},</if>
+            <if test="ocpxActionType != null">ocpx_action_type = #{ocpxActionType},</if>
+            <if test="roiRatio != null">roi_ratio = #{roiRatio},</if>
+            <if test="sceneId != null">scene_id = #{sceneId},</if>
+            <if test="unitType != null">unit_type = #{unitType},</if>
+            <if test="beginTimeStr != null">begin_time_str = #{beginTimeStr},</if>
+            <if test="endTimeStr != null">end_time_str = #{endTimeStr},</if>
+            <if test="scheduleTime != null">schedule_time = #{scheduleTime},</if>
+            <if test="dayBudget != null">day_budget = #{dayBudget},</if>
+            <if test="supportType != null">support_type = #{supportType},</if>
+            <if test="showMode != null">show_mode = #{showMode},</if>
+            <if test="speed != null">speed = #{speed},</if>
+            <if test="itemId != null">item_id = #{itemId},</if>
+            <if test="merchantItemPutType != null">merchant_item_put_type = #{merchantItemPutType},</if>
+            <if test="shoppingCarProductId != null">shopping_car_product_id = #{shoppingCarProductId},</if>
+            <if test="liveUserId != null">live_user_id = #{liveUserId},</if>
+            <if test="region != null">region = #{region},</if>
+            <if test="age != null">age = #{age},</if>
+            <if test="genderType != null">gender_type = #{genderType},</if>
+            <if test="population != null">population = #{population},</if>
+            <if test="excludePopulation != null">exclude_population = #{excludePopulation},</if>
+            <if test="paidAudience != null">paid_audience = #{paidAudience},</if>
+            <if test="behaviorList != null">behavior_list = #{behaviorList},</if>
+            <if test="fansStarList != null">fans_star_list = #{fansStarList},</if>
+            <if test="purchaseIntention != null">purchase_intention = #{purchaseIntention},</if>
+            <if test="message != null">message = #{message},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteKuaishouLaunchGroupRecordById" parameterType="String">
+        delete
+        from kuaishou_launch_group_record
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteKuaishouLaunchGroupRecordByIds" parameterType="String">
+        delete from kuaishou_launch_group_record where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 124 - 0
ruixuan-launch/src/main/resources/mapper/launch/KuaishouLaunchGroupTargetMapper.xml

@@ -0,0 +1,124 @@
+<?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="com.ruixuan.launch.mapper.KuaishouLaunchGroupTargetMapper">
+
+    <resultMap type="com.ruixuan.launch.entity.KuaishouLaunchGroupTarget" id="KuaishouLaunchGroupTargetResult">
+        <result property="id" column="id"/>
+        <result property="accountId" column="account_id"/>
+        <result property="unitId" column="unit_id"/>
+        <result property="region" column="region"/>
+        <result property="age" column="age"/>
+        <result property="genderType" column="gender_type"/>
+        <result property="population" column="population"/>
+        <result property="excludePopulation" column="exclude_population"/>
+        <result property="paidAudience" column="paid_audience"/>
+        <result property="behaviorList" column="behavior_list"/>
+        <result property="fansStarList" column="fans_star_list"/>
+        <result property="purchaseIntention" column="purchase_intention"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <sql id="selectKuaishouLaunchGroupTargetVo">
+        select id,
+               account_id,
+               unit_id,
+               region,
+               age,
+               gender_type,
+               population,
+               exclude_population,
+               paid_audience,
+               behavior_list,
+               fans_star_list,
+               purchase_intention,
+               create_time,
+               update_time
+        from kuaishou_launch_group_target
+    </sql>
+
+    <select id="selectKuaishouLaunchGroupTargetList" parameterType="com.ruixuan.launch.entity.KuaishouLaunchGroupTarget"
+            resultMap="KuaishouLaunchGroupTargetResult">
+        <include refid="selectKuaishouLaunchGroupTargetVo"/>
+        <where>
+            <if test="accountId != null ">and account_id = #{accountId}</if>
+            <if test="unitId != null ">and unit_id = #{unitId}</if>
+            <if test="region != null  and region != ''">and region = #{region}</if>
+            <if test="age != null  and age != ''">and age = #{age}</if>
+            <if test="genderType != null ">and gender_type = #{genderType}</if>
+            <if test="population != null  and population != ''">and population = #{population}</if>
+            <if test="excludePopulation != null  and excludePopulation != ''">and exclude_population =
+                #{excludePopulation}
+            </if>
+            <if test="paidAudience != null  and paidAudience != ''">and paid_audience = #{paidAudience}</if>
+            <if test="behaviorList != null  and behaviorList != ''">and behavior_list = #{behaviorList}</if>
+            <if test="fansStarList != null  and fansStarList != ''">and fans_star_list = #{fansStarList}</if>
+            <if test="purchaseIntention != null  and purchaseIntention != ''">and purchase_intention =
+                #{purchaseIntention}
+            </if>
+        </where>
+    </select>
+
+    <select id="selectKuaishouLaunchGroupTargetById" parameterType="Long" resultMap="KuaishouLaunchGroupTargetResult">
+        <include refid="selectKuaishouLaunchGroupTargetVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertKuaishouLaunchGroupTarget" parameterType="com.ruixuan.launch.entity.KuaishouLaunchGroupTarget"
+            useGeneratedKeys="true" keyProperty="id">
+        insert into kuaishou_launch_group_target
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="accountId != null">account_id,</if>
+            <if test="unitId != null">unit_id,</if>
+            <if test="region != null">region,</if>
+            <if test="age != null">age,</if>
+            <if test="genderType != null">gender_type,</if>
+            <if test="population != null">population,</if>
+            <if test="excludePopulation != null">exclude_population,</if>
+            <if test="paidAudience != null">paid_audience,</if>
+            <if test="behaviorList != null">behavior_list,</if>
+            <if test="fansStarList != null">fans_star_list,</if>
+            <if test="purchaseIntention != null">purchase_intention,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="accountId != null">#{accountId},</if>
+            <if test="unitId != null">#{unitId},</if>
+            <if test="region != null">#{region},</if>
+            <if test="age != null">#{age},</if>
+            <if test="genderType != null">#{genderType},</if>
+            <if test="population != null">#{population},</if>
+            <if test="excludePopulation != null">#{excludePopulation},</if>
+            <if test="paidAudience != null">#{paidAudience},</if>
+            <if test="behaviorList != null">#{behaviorList},</if>
+            <if test="fansStarList != null">#{fansStarList},</if>
+            <if test="purchaseIntention != null">#{purchaseIntention},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updateKuaishouLaunchGroupTarget" parameterType="com.ruixuan.launch.entity.KuaishouLaunchGroupTarget">
+        update kuaishou_launch_group_target
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="accountId != null">account_id = #{accountId},</if>
+            <if test="unitId != null">unit_id = #{unitId},</if>
+            <if test="region != null">region = #{region},</if>
+            <if test="age != null">age = #{age},</if>
+            <if test="genderType != null">gender_type = #{genderType},</if>
+            <if test="population != null">population = #{population},</if>
+            <if test="excludePopulation != null">exclude_population = #{excludePopulation},</if>
+            <if test="paidAudience != null">paid_audience = #{paidAudience},</if>
+            <if test="behaviorList != null">behavior_list = #{behaviorList},</if>
+            <if test="fansStarList != null">fans_star_list = #{fansStarList},</if>
+            <if test="purchaseIntention != null">purchase_intention = #{purchaseIntention},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+</mapper>

+ 152 - 0
ruixuan-launch/src/main/resources/mapper/launch/KuaishouLaunchTargetTemplateMapper.xml

@@ -0,0 +1,152 @@
+<?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="com.ruixuan.launch.mapper.KuaishouLaunchTargetTemplateMapper">
+
+    <resultMap type="com.ruixuan.launch.entity.KuaishouLaunchTargetTemplate" id="KuaishouLaunchTargetTemplateResult">
+        <result property="id" column="id"/>
+        <result property="accountId" column="account_id"/>
+        <result property="targetName" column="target_name"/>
+        <result property="region" column="region"/>
+        <result property="age" column="age"/>
+        <result property="genderType" column="gender_type"/>
+        <result property="population" column="population"/>
+        <result property="populationName" column="population_name"/>
+        <result property="excludePopulationName" column="exclude_population_name"/>
+        <result property="excludePopulation" column="exclude_population"/>
+        <result property="paidAudience" column="paid_audience"/>
+        <result property="behaviorList" column="behavior_list"/>
+        <result property="fansStarList" column="fans_star_list"/>
+        <result property="purchaseIntention" column="purchase_intention"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <sql id="selectKuaishouLaunchTargetTemplateVo">
+        select id,
+               account_id,
+               target_name,
+               region,
+               age,
+               gender_type,
+               population,
+               population_name,
+               exclude_population,
+               exclude_population_name,
+               paid_audience,
+               behavior_list,
+               fans_star_list,
+               purchase_intention
+        from kuaishou_launch_target_template
+    </sql>
+
+    <select id="selectKuaishouLaunchTargetTemplateList"
+            parameterType="com.ruixuan.launch.entity.KuaishouLaunchTargetTemplate"
+            resultMap="KuaishouLaunchTargetTemplateResult">
+        <include refid="selectKuaishouLaunchTargetTemplateVo"/>
+        <where>
+            <if test="accountId != null ">and account_id = #{accountId}</if>
+            <if test="targetName != null  and targetName != ''">and target_name = #{targetName}</if>
+            <if test="region != null  and region != ''">and region = #{region}</if>
+            <if test="age != null  and age != ''">and age = #{age}</if>
+            <if test="genderType != null ">and gender_type = #{genderType}</if>
+            <if test="population != null  and population != ''">and population = #{population}</if>
+            <if test="populationName != null  and populationName != ''">and population_name = #{populationName}</if>
+            <if test="excludePopulationName != null  and excludePopulationName != ''">and exclude_population_name =
+                #{excludePopulationName}
+            </if>
+            <if test="excludePopulation != null  and excludePopulation != ''">and exclude_population =
+                #{excludePopulation}
+            </if>
+            <if test="paidAudience != null  and paidAudience != ''">and paid_audience = #{paidAudience}</if>
+            <if test="behaviorList != null  and behaviorList != ''">and behavior_list = #{behaviorList}</if>
+            <if test="fansStarList != null  and fansStarList != ''">and fans_star_list = #{fansStarList}</if>
+            <if test="purchaseIntention != null  and purchaseIntention != ''">and purchase_intention =
+                #{purchaseIntention}
+            </if>
+        </where>
+    </select>
+
+    <select id="selectKuaishouLaunchTargetTemplateById" parameterType="Long"
+            resultMap="KuaishouLaunchTargetTemplateResult">
+        <include refid="selectKuaishouLaunchTargetTemplateVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertKuaishouLaunchTargetTemplate"
+            parameterType="com.ruixuan.launch.entity.KuaishouLaunchTargetTemplate" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into kuaishou_launch_target_template
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="accountId != null">account_id,</if>
+            <if test="targetName != null">target_name,</if>
+            <if test="region != null">region,</if>
+            <if test="age != null">age,</if>
+            <if test="genderType != null">gender_type,</if>
+            <if test="population != null">population,</if>
+            <if test="populationName != null">population_name,</if>
+            <if test="excludePopulationName != null">exclude_population_name,</if>
+            <if test="excludePopulation != null">exclude_population,</if>
+            <if test="paidAudience != null">paid_audience,</if>
+            <if test="behaviorList != null">behavior_list,</if>
+            <if test="fansStarList != null">fans_star_list,</if>
+            <if test="purchaseIntention != null">purchase_intention,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="accountId != null">#{accountId},</if>
+            <if test="targetName != null">#{target_name},</if>
+            <if test="region != null">#{region},</if>
+            <if test="age != null">#{age},</if>
+            <if test="genderType != null">#{genderType},</if>
+            <if test="population != null">#{population},</if>
+            <if test="populationName != null">#{populationName},</if>
+            <if test="excludePopulationName != null">#{excludePopulationName},</if>
+            <if test="excludePopulation != null">#{excludePopulation},</if>
+            <if test="paidAudience != null">#{paidAudience},</if>
+            <if test="behaviorList != null">#{behaviorList},</if>
+            <if test="fansStarList != null">#{fansStarList},</if>
+            <if test="purchaseIntention != null">#{purchaseIntention},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updateKuaishouLaunchTargetTemplate"
+            parameterType="com.ruixuan.launch.entity.KuaishouLaunchTargetTemplate">
+        update kuaishou_launch_target_template
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="accountId != null">account_id = #{accountId},</if>
+            <if test="targetName != null">target_name = #{targetName},</if>
+            <if test="region != null">region = #{region},</if>
+            <if test="age != null">age = #{age},</if>
+            <if test="genderType != null">gender_type = #{genderType},</if>
+            <if test="population != null">population = #{population},</if>
+            <if test="populationName != null">population_name = #{populationName},</if>
+            <if test="excludePopulationName != null">exclude_population_name = #{excludePopulationName},</if>
+            <if test="excludePopulation != null">exclude_population = #{excludePopulation},</if>
+            <if test="paidAudience != null">paid_audience = #{paidAudience},</if>
+            <if test="behaviorList != null">behavior_list = #{behaviorList},</if>
+            <if test="fansStarList != null">fans_star_list = #{fansStarList},</if>
+            <if test="purchaseIntention != null">purchase_intention = #{purchaseIntention},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteKuaishouLaunchTargetTemplateById" parameterType="Long">
+        delete
+        from kuaishou_launch_target_template
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteKuaishouLaunchTargetTemplateByIds" parameterType="String">
+        delete from kuaishou_launch_target_template where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>