|
@@ -94,6 +94,9 @@ public class TicketBoxServiceImpl extends ServiceImpl<TicketBoxMapper, TicketBox
|
|
|
@Autowired
|
|
|
private IAsyncTaskService asyncTaskService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ITicketBoxGoodsService ticketBoxGoodsService;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public List<TicketBox> listBySaleChannel(QueryWrapper<TicketBox> queryWrapper) {
|
|
@@ -125,8 +128,20 @@ public class TicketBoxServiceImpl extends ServiceImpl<TicketBoxMapper, TicketBox
|
|
|
ticketBox.setSaleChannelType(param.getSaleChannelType());
|
|
|
this.updateById(ticketBox);
|
|
|
|
|
|
+
|
|
|
+ // 清除盲票关联商品
|
|
|
+ Assert.isTrue(ticketBoxGoodsService.remove(
|
|
|
+ new LambdaUpdateWrapper<TicketBoxGoods>().eq(TicketBoxGoods::getBoxId, ticketBox.getBoxId())), "清除盲票关联商品失败");
|
|
|
+
|
|
|
+ // 关联商品
|
|
|
+ if (CollectionUtils.isNotEmpty(param.getGoodsList())) {
|
|
|
+ ticketBoxGoodsService.saveBatch(param.getGoodsList());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
// 清除指定渠道内容
|
|
|
- ticketBoxChannelService.remove(new LambdaUpdateWrapper<TicketBoxChannel>().eq(TicketBoxChannel::getBoxId, ticketBox.getBoxId()));
|
|
|
+ Assert.isTrue(ticketBoxChannelService.remove(
|
|
|
+ new LambdaUpdateWrapper<TicketBoxChannel>().eq(TicketBoxChannel::getBoxId, ticketBox.getBoxId())), "清除清除指定渠道内容失败");
|
|
|
|
|
|
// 指定渠道
|
|
|
if (TicketBoxSaleChannelTypeEnum.PART.getValue().equals(param.getSaleChannelType())) {
|
|
@@ -322,6 +337,12 @@ public class TicketBoxServiceImpl extends ServiceImpl<TicketBoxMapper, TicketBox
|
|
|
ticketBox.setSaleChannelType(param.getSaleChannelType());
|
|
|
save(ticketBox);
|
|
|
|
|
|
+
|
|
|
+ // 关联商品
|
|
|
+ if (CollectionUtils.isNotEmpty(param.getGoodsList())) {
|
|
|
+ ticketBoxGoodsService.saveBatch(param.getGoodsList());
|
|
|
+ }
|
|
|
+
|
|
|
// 指定渠道
|
|
|
if (TicketBoxSaleChannelTypeEnum.PART.getValue().equals(param.getSaleChannelType())) {
|
|
|
List<Long> channelIdList = param.getChannelIdList();
|