|
@@ -469,6 +469,11 @@ public class LiveServiceImpl implements ILiveService
|
|
|
return R.ok().put("data", result);
|
|
return R.ok().put("data", result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<Live> listToLiveNoEnd(Live live) {
|
|
|
|
|
+ return baseMapper.listToLiveNoEnd(live);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 修改直播
|
|
* 修改直播
|
|
|
*
|
|
*
|
|
@@ -807,43 +812,43 @@ public class LiveServiceImpl implements ILiveService
|
|
|
if (exist == null) {
|
|
if (exist == null) {
|
|
|
return R.error("直播间不存在");
|
|
return R.error("直播间不存在");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 1. 复制直播间基础信息
|
|
// 1. 复制直播间基础信息
|
|
|
Long newLiveId = copyLiveBasicInfo(exist, live, now);
|
|
Long newLiveId = copyLiveBasicInfo(exist, live, now);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 2. 创建直播数据
|
|
// 2. 创建直播数据
|
|
|
createLiveData(newLiveId);
|
|
createLiveData(newLiveId);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 3. 复制直播视频
|
|
// 3. 复制直播视频
|
|
|
copyLiveVideos(existLiveId, newLiveId, now);
|
|
copyLiveVideos(existLiveId, newLiveId, now);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 4. 获取所有自动化任务并按类型分组
|
|
// 4. 获取所有自动化任务并按类型分组
|
|
|
List<LiveAutoTask> allTasks = liveAutoTaskService.selectLiveAutoTaskByLiveId(existLiveId);
|
|
List<LiveAutoTask> allTasks = liveAutoTaskService.selectLiveAutoTaskByLiveId(existLiveId);
|
|
|
Map<Long, List<LiveAutoTask>> tasksByType = allTasks.stream()
|
|
Map<Long, List<LiveAutoTask>> tasksByType = allTasks.stream()
|
|
|
.collect(Collectors.groupingBy(LiveAutoTask::getTaskType));
|
|
.collect(Collectors.groupingBy(LiveAutoTask::getTaskType));
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 5. 复制弹幕任务(taskType=3)
|
|
// 5. 复制弹幕任务(taskType=3)
|
|
|
copyBarrageTasks(tasksByType.get(3L), newLiveId, now);
|
|
copyBarrageTasks(tasksByType.get(3L), newLiveId, now);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 6. 复制红包配置及任务(taskType=2)
|
|
// 6. 复制红包配置及任务(taskType=2)
|
|
|
Map<Long, Long> redIdMapping = copyRedConfs(existLiveId, newLiveId, tasksByType.get(2L), now);
|
|
Map<Long, Long> redIdMapping = copyRedConfs(existLiveId, newLiveId, tasksByType.get(2L), now);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 7. 复制抽奖配置及任务(taskType=4)
|
|
// 7. 复制抽奖配置及任务(taskType=4)
|
|
|
Map<Long, Long> lotteryIdMapping = copyLotteryConfs(existLiveId, newLiveId, tasksByType.get(4L), now);
|
|
Map<Long, Long> lotteryIdMapping = copyLotteryConfs(existLiveId, newLiveId, tasksByType.get(4L), now);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 8. 复制商品、商品任务、上下架任务及优惠券关系
|
|
// 8. 复制商品、商品任务、上下架任务及优惠券关系
|
|
|
- Map<Long, Long> goodsIdMapping = copyGoodsAndTasks(existLiveId, newLiveId, live,
|
|
|
|
|
|
|
+ Map<Long, Long> goodsIdMapping = copyGoodsAndTasks(existLiveId, newLiveId, live,
|
|
|
tasksByType.get(1L), tasksByType.get(6L), now);
|
|
tasksByType.get(1L), tasksByType.get(6L), now);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 9. 复制优惠券关系
|
|
// 9. 复制优惠券关系
|
|
|
copyCouponRelations(existLiveId, newLiveId, goodsIdMapping);
|
|
copyCouponRelations(existLiveId, newLiveId, goodsIdMapping);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 10. 复制优惠券自动化任务(taskType=5)
|
|
// 10. 复制优惠券自动化任务(taskType=5)
|
|
|
copyCouponTasks(tasksByType.get(5L), newLiveId, goodsIdMapping, now);
|
|
copyCouponTasks(tasksByType.get(5L), newLiveId, goodsIdMapping, now);
|
|
|
|
|
|
|
|
return R.ok("复制成功");
|
|
return R.ok("复制成功");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 复制直播间基础信息
|
|
* 复制直播间基础信息
|
|
|
*/
|
|
*/
|
|
@@ -865,7 +870,7 @@ public class LiveServiceImpl implements ILiveService
|
|
|
}
|
|
}
|
|
|
return liveEntity.getLiveId();
|
|
return liveEntity.getLiveId();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 创建直播数据
|
|
* 创建直播数据
|
|
|
*/
|
|
*/
|
|
@@ -882,7 +887,7 @@ public class LiveServiceImpl implements ILiveService
|
|
|
liveData.setFollowNum(0L);
|
|
liveData.setFollowNum(0L);
|
|
|
liveDataService.insertLiveData(liveData);
|
|
liveDataService.insertLiveData(liveData);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 复制直播视频
|
|
* 复制直播视频
|
|
|
*/
|
|
*/
|
|
@@ -897,7 +902,7 @@ public class LiveServiceImpl implements ILiveService
|
|
|
liveVideoService.insertLiveVideo(videoEntity);
|
|
liveVideoService.insertLiveVideo(videoEntity);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 复制弹幕任务(taskType=3)
|
|
* 复制弹幕任务(taskType=3)
|
|
|
*/
|
|
*/
|
|
@@ -918,20 +923,20 @@ public class LiveServiceImpl implements ILiveService
|
|
|
liveAutoTaskService.batchInsertLiveAutoTask(addList);
|
|
liveAutoTaskService.batchInsertLiveAutoTask(addList);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 复制红包配置及任务
|
|
* 复制红包配置及任务
|
|
|
*/
|
|
*/
|
|
|
- private Map<Long, Long> copyRedConfs(Long existLiveId, Long newLiveId,
|
|
|
|
|
|
|
+ private Map<Long, Long> copyRedConfs(Long existLiveId, Long newLiveId,
|
|
|
List<LiveAutoTask> redTasks, Date now) {
|
|
List<LiveAutoTask> redTasks, Date now) {
|
|
|
Map<Long, Long> redIdMapping = new HashMap<>();
|
|
Map<Long, Long> redIdMapping = new HashMap<>();
|
|
|
if (redTasks == null) {
|
|
if (redTasks == null) {
|
|
|
redTasks = Collections.emptyList();
|
|
redTasks = Collections.emptyList();
|
|
|
}
|
|
}
|
|
|
Map<Long, LiveAutoTask> redTaskMap = redTasks.stream()
|
|
Map<Long, LiveAutoTask> redTaskMap = redTasks.stream()
|
|
|
- .collect(Collectors.toMap(task -> parseIdFromContent(task.getContent(), "redId"),
|
|
|
|
|
|
|
+ .collect(Collectors.toMap(task -> parseIdFromContent(task.getContent(), "redId"),
|
|
|
Function.identity(), (existing, replacement) -> existing));
|
|
Function.identity(), (existing, replacement) -> existing));
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
List<LiveRedConf> liveRedConfs = liveRedConfService.selectByLiveId(existLiveId);
|
|
List<LiveRedConf> liveRedConfs = liveRedConfService.selectByLiveId(existLiveId);
|
|
|
for (LiveRedConf liveRedConf : liveRedConfs) {
|
|
for (LiveRedConf liveRedConf : liveRedConfs) {
|
|
|
LiveRedConf newRedConf = new LiveRedConf();
|
|
LiveRedConf newRedConf = new LiveRedConf();
|
|
@@ -942,32 +947,32 @@ public class LiveServiceImpl implements ILiveService
|
|
|
newRedConf.setCreateTime(now);
|
|
newRedConf.setCreateTime(now);
|
|
|
newRedConf.setTotalSend(0L);
|
|
newRedConf.setTotalSend(0L);
|
|
|
liveRedConfService.insertLiveRedConf(newRedConf);
|
|
liveRedConfService.insertLiveRedConf(newRedConf);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
redIdMapping.put(liveRedConf.getRedId(), newRedConf.getRedId());
|
|
redIdMapping.put(liveRedConf.getRedId(), newRedConf.getRedId());
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
LiveAutoTask task = redTaskMap.get(liveRedConf.getRedId());
|
|
LiveAutoTask task = redTaskMap.get(liveRedConf.getRedId());
|
|
|
if (task != null) {
|
|
if (task != null) {
|
|
|
- LiveAutoTask newTask = createAutoTaskEntity(task, newLiveId, now,
|
|
|
|
|
|
|
+ LiveAutoTask newTask = createAutoTaskEntity(task, newLiveId, now,
|
|
|
JSON.toJSONString(newRedConf));
|
|
JSON.toJSONString(newRedConf));
|
|
|
liveAutoTaskService.directInsertLiveAutoTask(newTask);
|
|
liveAutoTaskService.directInsertLiveAutoTask(newTask);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return redIdMapping;
|
|
return redIdMapping;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 复制抽奖配置及任务
|
|
* 复制抽奖配置及任务
|
|
|
*/
|
|
*/
|
|
|
- private Map<Long, Long> copyLotteryConfs(Long existLiveId, Long newLiveId,
|
|
|
|
|
|
|
+ private Map<Long, Long> copyLotteryConfs(Long existLiveId, Long newLiveId,
|
|
|
List<LiveAutoTask> lotteryTasks, Date now) {
|
|
List<LiveAutoTask> lotteryTasks, Date now) {
|
|
|
Map<Long, Long> lotteryIdMapping = new HashMap<>();
|
|
Map<Long, Long> lotteryIdMapping = new HashMap<>();
|
|
|
if (lotteryTasks == null) {
|
|
if (lotteryTasks == null) {
|
|
|
lotteryTasks = Collections.emptyList();
|
|
lotteryTasks = Collections.emptyList();
|
|
|
}
|
|
}
|
|
|
Map<Long, LiveAutoTask> lotteryTaskMap = lotteryTasks.stream()
|
|
Map<Long, LiveAutoTask> lotteryTaskMap = lotteryTasks.stream()
|
|
|
- .collect(Collectors.toMap(task -> parseIdFromContent(task.getContent(), "lotteryId"),
|
|
|
|
|
|
|
+ .collect(Collectors.toMap(task -> parseIdFromContent(task.getContent(), "lotteryId"),
|
|
|
Function.identity(), (existing, replacement) -> existing));
|
|
Function.identity(), (existing, replacement) -> existing));
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
List<LiveLotteryConf> liveLotteryConfs = liveLotteryConfService.selectByLiveId(existLiveId);
|
|
List<LiveLotteryConf> liveLotteryConfs = liveLotteryConfService.selectByLiveId(existLiveId);
|
|
|
if (!liveLotteryConfs.isEmpty()) {
|
|
if (!liveLotteryConfs.isEmpty()) {
|
|
|
List<Long> lotteryIds = liveLotteryConfs.stream()
|
|
List<Long> lotteryIds = liveLotteryConfs.stream()
|
|
@@ -975,7 +980,7 @@ public class LiveServiceImpl implements ILiveService
|
|
|
List<LiveLotteryProductConf> products = liveLotteryProductConfMapper.selectEntityByIds(lotteryIds);
|
|
List<LiveLotteryProductConf> products = liveLotteryProductConfMapper.selectEntityByIds(lotteryIds);
|
|
|
Map<Long, List<LiveLotteryProductConf>> productsByLotteryId = products.stream()
|
|
Map<Long, List<LiveLotteryProductConf>> productsByLotteryId = products.stream()
|
|
|
.collect(Collectors.groupingBy(LiveLotteryProductConf::getLotteryId));
|
|
.collect(Collectors.groupingBy(LiveLotteryProductConf::getLotteryId));
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
for (LiveLotteryConf liveLotteryConf : liveLotteryConfs) {
|
|
for (LiveLotteryConf liveLotteryConf : liveLotteryConfs) {
|
|
|
LiveLotteryConf newLotteryConf = new LiveLotteryConf();
|
|
LiveLotteryConf newLotteryConf = new LiveLotteryConf();
|
|
|
BeanUtils.copyBeanProp(newLotteryConf, liveLotteryConf);
|
|
BeanUtils.copyBeanProp(newLotteryConf, liveLotteryConf);
|
|
@@ -985,9 +990,9 @@ public class LiveServiceImpl implements ILiveService
|
|
|
newLotteryConf.setCreateTime(now);
|
|
newLotteryConf.setCreateTime(now);
|
|
|
newLotteryConf.setUpdateTime(now);
|
|
newLotteryConf.setUpdateTime(now);
|
|
|
liveLotteryConfService.insertLiveLotteryConf(newLotteryConf);
|
|
liveLotteryConfService.insertLiveLotteryConf(newLotteryConf);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
lotteryIdMapping.put(liveLotteryConf.getLotteryId(), newLotteryConf.getLotteryId());
|
|
lotteryIdMapping.put(liveLotteryConf.getLotteryId(), newLotteryConf.getLotteryId());
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 复制奖品
|
|
// 复制奖品
|
|
|
List<LiveLotteryProductConf> lotteryProducts = productsByLotteryId.get(liveLotteryConf.getLotteryId());
|
|
List<LiveLotteryProductConf> lotteryProducts = productsByLotteryId.get(liveLotteryConf.getLotteryId());
|
|
|
if (lotteryProducts != null) {
|
|
if (lotteryProducts != null) {
|
|
@@ -999,10 +1004,10 @@ public class LiveServiceImpl implements ILiveService
|
|
|
liveLotteryProductConfMapper.insertLiveLotteryProductConf(newProduct);
|
|
liveLotteryProductConfMapper.insertLiveLotteryProductConf(newProduct);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
LiveAutoTask task = lotteryTaskMap.get(liveLotteryConf.getLotteryId());
|
|
LiveAutoTask task = lotteryTaskMap.get(liveLotteryConf.getLotteryId());
|
|
|
if (task != null) {
|
|
if (task != null) {
|
|
|
- LiveAutoTask newTask = createAutoTaskEntity(task, newLiveId, now,
|
|
|
|
|
|
|
+ LiveAutoTask newTask = createAutoTaskEntity(task, newLiveId, now,
|
|
|
JSON.toJSONString(newLotteryConf));
|
|
JSON.toJSONString(newLotteryConf));
|
|
|
liveAutoTaskService.directInsertLiveAutoTask(newTask);
|
|
liveAutoTaskService.directInsertLiveAutoTask(newTask);
|
|
|
}
|
|
}
|
|
@@ -1010,7 +1015,7 @@ public class LiveServiceImpl implements ILiveService
|
|
|
}
|
|
}
|
|
|
return lotteryIdMapping;
|
|
return lotteryIdMapping;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 复制商品、商品任务、上下架任务
|
|
* 复制商品、商品任务、上下架任务
|
|
|
*/
|
|
*/
|
|
@@ -1023,25 +1028,25 @@ public class LiveServiceImpl implements ILiveService
|
|
|
if (shelfTasks == null) {
|
|
if (shelfTasks == null) {
|
|
|
shelfTasks = Collections.emptyList();
|
|
shelfTasks = Collections.emptyList();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Map<Long, LiveAutoTask> goodsTaskMap = goodsTasks.stream()
|
|
Map<Long, LiveAutoTask> goodsTaskMap = goodsTasks.stream()
|
|
|
- .collect(Collectors.toMap(task -> parseIdFromContent(task.getContent(), "goodsId"),
|
|
|
|
|
|
|
+ .collect(Collectors.toMap(task -> parseIdFromContent(task.getContent(), "goodsId"),
|
|
|
Function.identity(), (existing, replacement) -> existing));
|
|
Function.identity(), (existing, replacement) -> existing));
|
|
|
Map<Long, LiveAutoTask> shelfTaskMap = shelfTasks.stream()
|
|
Map<Long, LiveAutoTask> shelfTaskMap = shelfTasks.stream()
|
|
|
- .collect(Collectors.toMap(task -> parseIdFromContent(task.getContent(), "goodsId"),
|
|
|
|
|
|
|
+ .collect(Collectors.toMap(task -> parseIdFromContent(task.getContent(), "goodsId"),
|
|
|
Function.identity(), (existing, replacement) -> existing));
|
|
Function.identity(), (existing, replacement) -> existing));
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
LiveGoods queryParam = new LiveGoods();
|
|
LiveGoods queryParam = new LiveGoods();
|
|
|
queryParam.setLiveId(existLiveId);
|
|
queryParam.setLiveId(existLiveId);
|
|
|
List<LiveGoodsVo> goodsList = liveGoodsService.selectProductListByLiveId(queryParam);
|
|
List<LiveGoodsVo> goodsList = liveGoodsService.selectProductListByLiveId(queryParam);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (!goodsList.isEmpty()) {
|
|
if (!goodsList.isEmpty()) {
|
|
|
List<Long> goodsProductIds = goodsList.stream()
|
|
List<Long> goodsProductIds = goodsList.stream()
|
|
|
.map(LiveGoodsVo::getProductId).collect(Collectors.toList());
|
|
.map(LiveGoodsVo::getProductId).collect(Collectors.toList());
|
|
|
Map<Long, FsStoreProductScrm> goodsMap = fsStoreProductScrmMapper
|
|
Map<Long, FsStoreProductScrm> goodsMap = fsStoreProductScrmMapper
|
|
|
.selectFsStoreProductByProductIds(goodsProductIds).stream()
|
|
.selectFsStoreProductByProductIds(goodsProductIds).stream()
|
|
|
.collect(Collectors.toMap(FsStoreProductScrm::getProductId, Function.identity()));
|
|
.collect(Collectors.toMap(FsStoreProductScrm::getProductId, Function.identity()));
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
for (LiveGoodsVo liveGoods : goodsList) {
|
|
for (LiveGoodsVo liveGoods : goodsList) {
|
|
|
LiveGoods newGoods = new LiveGoods();
|
|
LiveGoods newGoods = new LiveGoods();
|
|
|
BeanUtils.copyBeanProp(newGoods, liveGoods);
|
|
BeanUtils.copyBeanProp(newGoods, liveGoods);
|
|
@@ -1051,12 +1056,12 @@ public class LiveServiceImpl implements ILiveService
|
|
|
newGoods.setIsShow(false);
|
|
newGoods.setIsShow(false);
|
|
|
newGoods.setCompanyId(live.getCompanyId());
|
|
newGoods.setCompanyId(live.getCompanyId());
|
|
|
newGoods.setCompanyUserId(live.getCompanyUserId());
|
|
newGoods.setCompanyUserId(live.getCompanyUserId());
|
|
|
- newGoods.setStock(goodsMap.containsKey(liveGoods.getProductId())
|
|
|
|
|
|
|
+ newGoods.setStock(goodsMap.containsKey(liveGoods.getProductId())
|
|
|
? goodsMap.get(liveGoods.getProductId()).getStock() : 0);
|
|
? goodsMap.get(liveGoods.getProductId()).getStock() : 0);
|
|
|
liveGoodsService.insertLiveGoods(newGoods);
|
|
liveGoodsService.insertLiveGoods(newGoods);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
goodsIdMapping.put(liveGoods.getGoodsId(), newGoods.getGoodsId());
|
|
goodsIdMapping.put(liveGoods.getGoodsId(), newGoods.getGoodsId());
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 复制商品推送任务(taskType=1)
|
|
// 复制商品推送任务(taskType=1)
|
|
|
LiveAutoTask goodsTask = goodsTaskMap.get(liveGoods.getGoodsId());
|
|
LiveAutoTask goodsTask = goodsTaskMap.get(liveGoods.getGoodsId());
|
|
|
if (goodsTask != null) {
|
|
if (goodsTask != null) {
|
|
@@ -1064,17 +1069,17 @@ public class LiveServiceImpl implements ILiveService
|
|
|
LiveGoodsVo newGoodsVo = new LiveGoodsVo();
|
|
LiveGoodsVo newGoodsVo = new LiveGoodsVo();
|
|
|
BeanUtils.copyBeanProp(newGoodsVo, liveGoods);
|
|
BeanUtils.copyBeanProp(newGoodsVo, liveGoods);
|
|
|
newGoodsVo.setGoodsId(newGoods.getGoodsId());
|
|
newGoodsVo.setGoodsId(newGoods.getGoodsId());
|
|
|
- LiveAutoTask newTask = createAutoTaskEntity(goodsTask, newLiveId, now,
|
|
|
|
|
|
|
+ LiveAutoTask newTask = createAutoTaskEntity(goodsTask, newLiveId, now,
|
|
|
JSON.toJSONString(newGoodsVo));
|
|
JSON.toJSONString(newGoodsVo));
|
|
|
liveAutoTaskService.directInsertLiveAutoTask(newTask);
|
|
liveAutoTaskService.directInsertLiveAutoTask(newTask);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 复制上下架任务(taskType=6)
|
|
// 复制上下架任务(taskType=6)
|
|
|
LiveAutoTask shelfTask = shelfTaskMap.get(liveGoods.getGoodsId());
|
|
LiveAutoTask shelfTask = shelfTaskMap.get(liveGoods.getGoodsId());
|
|
|
if (shelfTask != null) {
|
|
if (shelfTask != null) {
|
|
|
JSONObject contentJson = JSON.parseObject(shelfTask.getContent());
|
|
JSONObject contentJson = JSON.parseObject(shelfTask.getContent());
|
|
|
contentJson.put("goodsId", newGoods.getGoodsId());
|
|
contentJson.put("goodsId", newGoods.getGoodsId());
|
|
|
- LiveAutoTask newTask = createAutoTaskEntity(shelfTask, newLiveId, now,
|
|
|
|
|
|
|
+ LiveAutoTask newTask = createAutoTaskEntity(shelfTask, newLiveId, now,
|
|
|
contentJson.toJSONString());
|
|
contentJson.toJSONString());
|
|
|
liveAutoTaskService.directInsertLiveAutoTask(newTask);
|
|
liveAutoTaskService.directInsertLiveAutoTask(newTask);
|
|
|
}
|
|
}
|
|
@@ -1082,7 +1087,7 @@ public class LiveServiceImpl implements ILiveService
|
|
|
}
|
|
}
|
|
|
return goodsIdMapping;
|
|
return goodsIdMapping;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 复制优惠券关系
|
|
* 复制优惠券关系
|
|
|
*/
|
|
*/
|
|
@@ -1100,11 +1105,11 @@ public class LiveServiceImpl implements ILiveService
|
|
|
liveCouponIssueMapper.insertLiveCouponIssueRelation(newRelation);
|
|
liveCouponIssueMapper.insertLiveCouponIssueRelation(newRelation);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 复制优惠券自动化任务(taskType=5)
|
|
* 复制优惠券自动化任务(taskType=5)
|
|
|
*/
|
|
*/
|
|
|
- private void copyCouponTasks(List<LiveAutoTask> couponTasks, Long newLiveId,
|
|
|
|
|
|
|
+ private void copyCouponTasks(List<LiveAutoTask> couponTasks, Long newLiveId,
|
|
|
Map<Long, Long> goodsIdMapping, Date now) {
|
|
Map<Long, Long> goodsIdMapping, Date now) {
|
|
|
if (couponTasks == null || couponTasks.isEmpty()) {
|
|
if (couponTasks == null || couponTasks.isEmpty()) {
|
|
|
return;
|
|
return;
|
|
@@ -1117,7 +1122,7 @@ public class LiveServiceImpl implements ILiveService
|
|
|
Long newGoodsId = goodsIdMapping.get(liveCoupon.getGoodsId());
|
|
Long newGoodsId = goodsIdMapping.get(liveCoupon.getGoodsId());
|
|
|
if (newGoodsId != null) {
|
|
if (newGoodsId != null) {
|
|
|
liveCoupon.setGoodsId(newGoodsId);
|
|
liveCoupon.setGoodsId(newGoodsId);
|
|
|
- LiveAutoTask newTask = createAutoTaskEntity(task, newLiveId, now,
|
|
|
|
|
|
|
+ LiveAutoTask newTask = createAutoTaskEntity(task, newLiveId, now,
|
|
|
JSON.toJSONString(liveCoupon));
|
|
JSON.toJSONString(liveCoupon));
|
|
|
liveAutoTaskService.directInsertLiveAutoTask(newTask);
|
|
liveAutoTaskService.directInsertLiveAutoTask(newTask);
|
|
|
}
|
|
}
|
|
@@ -1127,7 +1132,7 @@ public class LiveServiceImpl implements ILiveService
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 创建自动化任务实体
|
|
* 创建自动化任务实体
|
|
|
*/
|
|
*/
|