|
@@ -349,6 +349,7 @@ public class LiveServiceImpl implements ILiveService
|
|
|
return baseMapper.updateLive( live);
|
|
return baseMapper.updateLive( live);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 修改直播
|
|
* 修改直播
|
|
|
*
|
|
*
|
|
@@ -724,24 +725,9 @@ public class LiveServiceImpl implements ILiveService
|
|
|
// 运营自动化
|
|
// 运营自动化
|
|
|
List<LiveAutoTask> liveAutoTasksList = liveAutoTaskService.selectLiveAutoTaskByLiveId(existLiveId);
|
|
List<LiveAutoTask> liveAutoTasksList = liveAutoTaskService.selectLiveAutoTaskByLiveId(existLiveId);
|
|
|
List<LiveAutoTask> barrageTask = liveAutoTasksList.stream().filter(liveAutoTask -> liveAutoTask.getTaskType() == 3L).collect(Collectors.toList());
|
|
List<LiveAutoTask> barrageTask = liveAutoTasksList.stream().filter(liveAutoTask -> liveAutoTask.getTaskType() == 3L).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 -> {
|
|
|
|
|
- return parseIdFromContent(liveAutoTask.getContent(),"redId");
|
|
|
|
|
- }, liveAutoTask -> liveAutoTask, (existing, replacement) -> replacement
|
|
|
|
|
- ));
|
|
|
|
|
- Map<Long, LiveAutoTask> lotteryMap = liveAutoTasksList.stream()
|
|
|
|
|
- .filter(liveAutoTask -> liveAutoTask.getTaskType() == 4L)
|
|
|
|
|
- .collect(Collectors.toMap(liveAutoTask -> {
|
|
|
|
|
- return parseIdFromContent(liveAutoTask.getContent(),"lotteryId");
|
|
|
|
|
- }, liveAutoTask -> liveAutoTask, (existing, replacement) -> replacement
|
|
|
|
|
- ));
|
|
|
|
|
|
|
+ List<LiveAutoTask> goodsTaskList = liveAutoTasksList.stream().filter(liveAutoTask -> liveAutoTask.getTaskType() == 1L).collect(Collectors.toList());
|
|
|
|
|
+ List<LiveAutoTask> redTaskList = liveAutoTasksList.stream().filter(liveAutoTask -> liveAutoTask.getTaskType() == 2L).collect(Collectors.toList());
|
|
|
|
|
+ List<LiveAutoTask> lotteryTaskList = liveAutoTasksList.stream().filter(liveAutoTask -> liveAutoTask.getTaskType() == 4L).collect(Collectors.toList());
|
|
|
if (!barrageTask.isEmpty()) {
|
|
if (!barrageTask.isEmpty()) {
|
|
|
LiveAutoTask liveAutoTaskEntity = new LiveAutoTask();
|
|
LiveAutoTask liveAutoTaskEntity = new LiveAutoTask();
|
|
|
for (LiveAutoTask liveAutoTask : barrageTask) {
|
|
for (LiveAutoTask liveAutoTask : barrageTask) {
|
|
@@ -751,7 +737,7 @@ public class LiveServiceImpl implements ILiveService
|
|
|
liveAutoTaskEntity.setCreateTime(now);
|
|
liveAutoTaskEntity.setCreateTime(now);
|
|
|
liveAutoTaskEntity.setUpdateTime(now);
|
|
liveAutoTaskEntity.setUpdateTime(now);
|
|
|
liveAutoTaskEntity.setFinishStatus(0L);
|
|
liveAutoTaskEntity.setFinishStatus(0L);
|
|
|
- liveAutoTaskService.copyInsertLiveAutoTask(liveAutoTaskEntity,liveEntity);
|
|
|
|
|
|
|
+ liveAutoTaskService.directInsertLiveAutoTask(liveAutoTaskEntity);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//直播间红包配置
|
|
//直播间红包配置
|
|
@@ -766,18 +752,17 @@ public class LiveServiceImpl implements ILiveService
|
|
|
liveRedConfEntity.setCreateTime(now);
|
|
liveRedConfEntity.setCreateTime(now);
|
|
|
liveRedConfEntity.setTotalSend(0L);
|
|
liveRedConfEntity.setTotalSend(0L);
|
|
|
liveRedConfService.insertLiveRedConf(liveRedConfEntity);
|
|
liveRedConfService.insertLiveRedConf(liveRedConfEntity);
|
|
|
- if (redMap.containsKey(liveRedConf.getRedId())) {
|
|
|
|
|
- LiveAutoTask liveAutoTaskEntity = new LiveAutoTask();
|
|
|
|
|
- LiveAutoTask liveAutoTask = redMap.get(liveRedConf.getRedId());
|
|
|
|
|
- BeanUtils.copyBeanProp(liveAutoTaskEntity, liveAutoTask);
|
|
|
|
|
- liveAutoTaskEntity.setId(null);
|
|
|
|
|
- liveAutoTaskEntity.setLiveId(newLiveId);
|
|
|
|
|
- liveAutoTaskEntity.setCreateTime(now);
|
|
|
|
|
- liveAutoTaskEntity.setUpdateTime(now);
|
|
|
|
|
- liveAutoTaskEntity.setFinishStatus(0L);
|
|
|
|
|
- liveAutoTaskEntity.setContent(JSON.toJSONString(liveRedConfEntity));
|
|
|
|
|
- liveAutoTaskService.copyInsertLiveAutoTask(liveAutoTaskEntity,liveEntity);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ LiveAutoTask liveAutoTask = redTaskList.stream().filter(item -> parseIdFromContent(item.getContent(), "redId").equals(liveRedConf.getRedId())).findFirst().orElse(null);
|
|
|
|
|
+ if(liveAutoTask == null) continue;
|
|
|
|
|
+ LiveAutoTask liveAutoTaskEntity = new LiveAutoTask();
|
|
|
|
|
+ BeanUtils.copyBeanProp(liveAutoTaskEntity, liveAutoTask);
|
|
|
|
|
+ liveAutoTaskEntity.setId(null);
|
|
|
|
|
+ liveAutoTaskEntity.setLiveId(newLiveId);
|
|
|
|
|
+ liveAutoTaskEntity.setCreateTime(now);
|
|
|
|
|
+ liveAutoTaskEntity.setUpdateTime(now);
|
|
|
|
|
+ liveAutoTaskEntity.setFinishStatus(0L);
|
|
|
|
|
+ liveAutoTaskEntity.setContent(JSON.toJSONString(liveRedConfEntity));
|
|
|
|
|
+ liveAutoTaskService.directInsertLiveAutoTask(liveAutoTaskEntity);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// 直播间礼物配置
|
|
// 直播间礼物配置
|
|
@@ -799,18 +784,17 @@ public class LiveServiceImpl implements ILiveService
|
|
|
product.setLotteryId(liveLotteryConfEntity.getLotteryId());
|
|
product.setLotteryId(liveLotteryConfEntity.getLotteryId());
|
|
|
liveLotteryProductConfMapper.insertLiveLotteryProductConf(product);
|
|
liveLotteryProductConfMapper.insertLiveLotteryProductConf(product);
|
|
|
});
|
|
});
|
|
|
- if (lotteryMap.containsKey(liveLotteryConf.getLotteryId())) {
|
|
|
|
|
- LiveAutoTask liveAutoTaskEntity = new LiveAutoTask();
|
|
|
|
|
- LiveAutoTask liveAutoTask = lotteryMap.get(liveLotteryConf.getLotteryId());
|
|
|
|
|
- BeanUtils.copyBeanProp(liveAutoTaskEntity, liveAutoTask);
|
|
|
|
|
- liveAutoTaskEntity.setId(null);
|
|
|
|
|
- liveAutoTaskEntity.setLiveId(newLiveId);
|
|
|
|
|
- liveAutoTaskEntity.setCreateTime(now);
|
|
|
|
|
- liveAutoTaskEntity.setUpdateTime(now);
|
|
|
|
|
- liveAutoTaskEntity.setFinishStatus(0L);
|
|
|
|
|
- liveAutoTaskEntity.setContent(JSON.toJSONString(liveLotteryConfEntity));
|
|
|
|
|
- liveAutoTaskService.copyInsertLiveAutoTask(liveAutoTaskEntity,liveEntity);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ LiveAutoTask liveAutoTask = lotteryTaskList.stream().filter(item -> parseIdFromContent(item.getContent(), "lotteryId").equals(liveLotteryConf.getLotteryId())).findFirst().orElse(null);
|
|
|
|
|
+ if(liveAutoTask == null) continue;
|
|
|
|
|
+ LiveAutoTask liveAutoTaskEntity = new LiveAutoTask();
|
|
|
|
|
+ BeanUtils.copyBeanProp(liveAutoTaskEntity, liveAutoTask);
|
|
|
|
|
+ liveAutoTaskEntity.setId(null);
|
|
|
|
|
+ liveAutoTaskEntity.setLiveId(newLiveId);
|
|
|
|
|
+ liveAutoTaskEntity.setCreateTime(now);
|
|
|
|
|
+ liveAutoTaskEntity.setUpdateTime(now);
|
|
|
|
|
+ liveAutoTaskEntity.setFinishStatus(0L);
|
|
|
|
|
+ liveAutoTaskEntity.setContent(JSON.toJSONString(liveLotteryConfEntity));
|
|
|
|
|
+ liveAutoTaskService.directInsertLiveAutoTask(liveAutoTaskEntity);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// 直播间商品
|
|
// 直播间商品
|
|
@@ -830,19 +814,18 @@ public class LiveServiceImpl implements ILiveService
|
|
|
if (collect.containsKey(liveGoods.getGoodsId())) {
|
|
if (collect.containsKey(liveGoods.getGoodsId())) {
|
|
|
liveCouponIssueRelations.stream().filter(relation -> relation.getGoodsId().equals(liveGoods.getGoodsId())).findFirst().ifPresent(liveCouponIssueRelation -> liveCouponIssueRelation.setGoodsId(liveGoodsEntity.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);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ LiveAutoTask liveAutoTask = goodsTaskList.stream().filter(item -> parseIdFromContent(item.getContent(), "goodsId").equals(liveGoods.getGoodsId())).findFirst().orElse(null);
|
|
|
|
|
+ if(liveAutoTask == null) continue;
|
|
|
|
|
+ LiveAutoTask liveAutoTaskEntity = new LiveAutoTask();
|
|
|
|
|
+ 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.directInsertLiveAutoTask(liveAutoTaskEntity);
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
for (LiveCouponIssueRelation liveCouponIssueRelation : liveCouponIssueRelations) {
|
|
for (LiveCouponIssueRelation liveCouponIssueRelation : liveCouponIssueRelations) {
|