This commit is contained in:
齐天大圣 2024-03-07 14:30:57 +08:00
parent 42afda3a8a
commit 27ccbb65f9

View File

@ -91,6 +91,8 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
private ILJStaffService staffService; private ILJStaffService staffService;
@Resource @Resource
private AccountService accountService; private AccountService accountService;
@Resource
private CardFavorableService cardFavorableService;
@ -337,6 +339,19 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
List<ActiveConsumptionChild> activeConsumptionChildList1 = activeConsumptionDTO.getActiveConsumptionChildList(); List<ActiveConsumptionChild> activeConsumptionChildList1 = activeConsumptionDTO.getActiveConsumptionChildList();
if (CollectionUtils.isNotEmpty(activeConsumptionChildList1)){ if (CollectionUtils.isNotEmpty(activeConsumptionChildList1)){
activeConsumptionChildList1.stream().map(s ->{ activeConsumptionChildList1.stream().map(s ->{
//更新优惠券兑换券的有效期
if(s.getActiveGift().equals("1")){
CardFavorable cardFavorable = cardFavorableMapper.selectById(s.getVouchersId());
cardFavorable.setValidityZero(s.getValidityZero());
cardFavorable.setValidityOne(s.getValidityOne());
cardFavorable.setValidityTwo(s.getValidityTwo());
cardFavorableMapper.updateById(cardFavorable);
}
if(s.getActiveGift().equals("2")){
CardExchange cardExchange = cardExchangeMapper.selectById(s.getVouchersId());
cardExchange.setValidity(s.getGiftCardTime());
cardExchangeMapper.updateById(cardExchange);
}
if (ObjectUtil.isNotEmpty(s)) s.setActiveConsumptionId(activeConsumption.getId()); if (ObjectUtil.isNotEmpty(s)) s.setActiveConsumptionId(activeConsumption.getId());
return s; return s;
}).collect(Collectors.toList()); }).collect(Collectors.toList());