|
@@ -165,19 +165,23 @@ public class TicketBoxServiceImpl extends ServiceImpl<TicketBoxMapper, TicketBox
|
|
awardsPrize.setPicUrl("md.jpeg");
|
|
awardsPrize.setPicUrl("md.jpeg");
|
|
}
|
|
}
|
|
ticketAwardsPrizeList.add(awardsPrize);
|
|
ticketAwardsPrizeList.add(awardsPrize);
|
|
|
|
+ } else {
|
|
|
|
+ // 更新排序权重字段
|
|
|
|
+ ticketAwardsPrizeService.update(new LambdaUpdateWrapper<TicketAwardsPrize>().set(TicketAwardsPrize::getSortWeight, ticketAwardsPrizeParam.getSortWeight()).eq(TicketAwardsPrize::getPrizeId, ticketAwardsPrizeParam.getPrizeId()));
|
|
}
|
|
}
|
|
return ticketAwardsPrizeParam.getPrizeId();
|
|
return ticketAwardsPrizeParam.getPrizeId();
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
// 如果新的奖品id为空,则清除原来的所有奖品
|
|
// 如果新的奖品id为空,则清除原来的所有奖品
|
|
if (CollectionUtils.isEmpty(prizeIdList)) {
|
|
if (CollectionUtils.isEmpty(prizeIdList)) {
|
|
- ticketAwardsPrizeService.remove(new LambdaUpdateWrapper<TicketAwardsPrize>().eq(TicketAwardsPrize::getAwardsId, ticketAwardsParam.getAwardsId()));
|
|
|
|
|
|
+ ticketAwardsPrizeService.update(new LambdaUpdateWrapper<TicketAwardsPrize>().set(TicketAwardsPrize::getIsDeleted, 1).eq(TicketAwardsPrize::getAwardsId, ticketAwardsParam.getAwardsId()));
|
|
} else {
|
|
} else {
|
|
// 去重后,清除原来的奖品
|
|
// 去重后,清除原来的奖品
|
|
// 查询原来的奖品信息
|
|
// 查询原来的奖品信息
|
|
List<TicketAwardsPrize> oldTicketAwardsPrizeList = ticketAwardsPrizeService.list(new LambdaQueryWrapper<TicketAwardsPrize>()
|
|
List<TicketAwardsPrize> oldTicketAwardsPrizeList = ticketAwardsPrizeService.list(new LambdaQueryWrapper<TicketAwardsPrize>()
|
|
.select(TicketAwardsPrize::getPrizeId)
|
|
.select(TicketAwardsPrize::getPrizeId)
|
|
- .eq(TicketAwardsPrize::getAwardsId, ticketAwardsParam.getAwardsId()));
|
|
|
|
|
|
+ .eq(TicketAwardsPrize::getAwardsId, ticketAwardsParam.getAwardsId())
|
|
|
|
+ .eq(TicketAwardsPrize::getIsDeleted, 0));
|
|
if (CollectionUtils.isEmpty(oldTicketAwardsPrizeList)) {
|
|
if (CollectionUtils.isEmpty(oldTicketAwardsPrizeList)) {
|
|
throw new ServiceException("原奖品列表为空");
|
|
throw new ServiceException("原奖品列表为空");
|
|
}
|
|
}
|
|
@@ -187,7 +191,7 @@ public class TicketBoxServiceImpl extends ServiceImpl<TicketBoxMapper, TicketBox
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(oldPrizeIdList)) {
|
|
if (CollectionUtils.isNotEmpty(oldPrizeIdList)) {
|
|
// 删除原来的奖品信息
|
|
// 删除原来的奖品信息
|
|
- ticketAwardsPrizeService.removeByIds(oldPrizeIdList);
|
|
|
|
|
|
+ ticketAwardsPrizeService.update(new LambdaUpdateWrapper<TicketAwardsPrize>().set(TicketAwardsPrize::getIsDeleted, 1).in(TicketAwardsPrize::getPrizeId, oldPrizeIdList));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|