|
|
@@ -723,7 +723,12 @@ public class LiveServiceImpl implements ILiveService
|
|
|
// 运营自动化
|
|
|
List<LiveAutoTask> liveAutoTasksList = liveAutoTaskService.selectLiveAutoTaskByLiveId(existLiveId);
|
|
|
List<LiveAutoTask> barrageTask = liveAutoTasksList.stream().filter(liveAutoTask -> liveAutoTask.getTaskType() == 3L).collect(Collectors.toList());
|
|
|
- List<LiveAutoTask> goodsTask = liveAutoTasksList.stream().filter(liveAutoTask -> liveAutoTask.getTaskType() == 1L).collect(Collectors.toList());
|
|
|
+ Map<Long, LiveAutoTask> goodsMap = liveAutoTasksList.stream()
|
|
|
+ .filter(liveAutoTask -> liveAutoTask.getTaskType() == 1L)
|
|
|
+ .collect(Collectors.toMap(liveAutoTask -> {
|
|
|
+ return parseIdFromContent(liveAutoTask.getContent(),"goodsId");
|
|
|
+ }, liveAutoTask -> liveAutoTask, (existing, replacement) -> replacement
|
|
|
+ ));
|
|
|
Map<Long, LiveAutoTask> redMap = liveAutoTasksList.stream()
|
|
|
.filter(liveAutoTask -> liveAutoTask.getTaskType() == 2L)
|
|
|
.collect(Collectors.toMap(liveAutoTask -> {
|
|
|
@@ -736,18 +741,6 @@ public class LiveServiceImpl implements ILiveService
|
|
|
return parseIdFromContent(liveAutoTask.getContent(),"lotteryId");
|
|
|
}, liveAutoTask -> liveAutoTask, (existing, replacement) -> replacement
|
|
|
));
|
|
|
- if (!goodsTask.isEmpty()) {
|
|
|
- LiveAutoTask liveAutoTaskEntity = new LiveAutoTask();
|
|
|
- for (LiveAutoTask liveAutoTask : goodsTask) {
|
|
|
- BeanUtils.copyBeanProp(liveAutoTaskEntity, liveAutoTask);
|
|
|
- liveAutoTaskEntity.setId(null);
|
|
|
- liveAutoTaskEntity.setLiveId(newLiveId);
|
|
|
- liveAutoTaskEntity.setCreateTime(now);
|
|
|
- liveAutoTaskEntity.setUpdateTime(now);
|
|
|
- liveAutoTaskEntity.setFinishStatus(0L);
|
|
|
- liveAutoTaskService.copyInsertLiveAutoTask(liveAutoTaskEntity,liveEntity);
|
|
|
- }
|
|
|
- }
|
|
|
if (!barrageTask.isEmpty()) {
|
|
|
LiveAutoTask liveAutoTaskEntity = new LiveAutoTask();
|
|
|
for (LiveAutoTask liveAutoTask : barrageTask) {
|
|
|
@@ -831,9 +824,23 @@ public class LiveServiceImpl implements ILiveService
|
|
|
liveGoodsEntity.setCompanyId(live.getCompanyId());
|
|
|
liveGoodsEntity.setCompanyUserId(live.getCompanyUserId());
|
|
|
liveGoodsService.insertLiveGoods(liveGoodsEntity);
|
|
|
+ // 优惠券
|
|
|
if (collect.containsKey(liveGoods.getGoodsId())) {
|
|
|
liveCouponIssueRelations.stream().filter(relation -> relation.getGoodsId().equals(liveGoods.getGoodsId())).findFirst().ifPresent(liveCouponIssueRelation -> liveCouponIssueRelation.setGoodsId(liveGoodsEntity.getGoodsId()));
|
|
|
}
|
|
|
+ // 直播商品task
|
|
|
+ if (goodsMap.containsKey(liveGoods.getGoodsId())) {
|
|
|
+ LiveAutoTask liveAutoTaskEntity = new LiveAutoTask();
|
|
|
+ LiveAutoTask liveAutoTask = goodsMap.get(liveGoods.getGoodsId());
|
|
|
+ BeanUtils.copyBeanProp(liveAutoTaskEntity, liveAutoTask);
|
|
|
+ liveAutoTaskEntity.setId(null);
|
|
|
+ liveAutoTaskEntity.setLiveId(newLiveId);
|
|
|
+ liveAutoTaskEntity.setCreateTime(now);
|
|
|
+ liveAutoTaskEntity.setUpdateTime(now);
|
|
|
+ liveAutoTaskEntity.setFinishStatus(0L);
|
|
|
+ liveAutoTaskEntity.setContent(JSON.toJSONString(liveGoodsEntity));
|
|
|
+ liveAutoTaskService.copyInsertLiveAutoTask(liveAutoTaskEntity,liveEntity);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
for (LiveCouponIssueRelation liveCouponIssueRelation : liveCouponIssueRelations) {
|