diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumptionChild.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumptionChild.java index a7ac9a37f..f10fa9e5d 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumptionChild.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/entity/ActiveConsumptionChild.java @@ -56,6 +56,14 @@ public class ActiveConsumptionChild { * 券数量 */ private Integer giftCardTotal; + //有效期0 + private Integer validityZero; + //有效期1 + private Integer validityOne; + //有效期2 + private Integer validityTwo; + + private String timeType; /** * 创建者 */ @@ -73,6 +81,38 @@ public class ActiveConsumptionChild { */ private Date updateTime; + public String getTimeType() { + return timeType; + } + + public void setTimeType(String timeType) { + this.timeType = timeType; + } + + public Integer getValidityZero() { + return validityZero; + } + + public void setValidityZero(Integer validityZero) { + this.validityZero = validityZero; + } + + public Integer getValidityOne() { + return validityOne; + } + + public void setValidityOne(Integer validityOne) { + this.validityOne = validityOne; + } + + public Integer getValidityTwo() { + return validityTwo; + } + + public void setValidityTwo(Integer validityTwo) { + this.validityTwo = validityTwo; + } + public Integer getId() { return id; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java index 8aee8e65a..86b2c0256 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeConsumption/service/impl/ActiveConsumptionServiceImpl.java @@ -36,7 +36,7 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl queryWrappers = new LambdaQueryWrapper<>(); queryWrappers.eq(ActiveConsumptionChild::getActiveConsumptionId,s.getId()); queryWrappers.orderByDesc(ActiveConsumptionChild::getCreateTime); - List activeConsumptionChildList = consumptionChildService.list(queryWrappers); + List activeConsumptionChildList = activeConsumptionChildService.list(queryWrappers); BeanUtils.copyProperties(s,activeConsumptionVO); activeConsumptionVO.setAdaptOil(s.getAdaptOil().split(",")); @@ -134,11 +134,12 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(ActiveConsumptionChild::getActiveConsumptionId,id); queryWrapper.orderByDesc(ActiveConsumptionChild::getCreateTime); - List activeConsumptionChildList = consumptionChildService.list(queryWrapper); + List activeConsumptionChildList = activeConsumptionChildService.list(queryWrapper); if (CollectionUtils.isNotEmpty(activeConsumptionChildList)){ //封装VO返回 BeanUtils.copyProperties(consumption,activeConsumptionVO); @@ -146,6 +147,7 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ActiveConsumptionChild::getActiveConsumptionId,activeConsumptionDTO.getId()); + activeConsumptionChildService.remove(queryWrapper); + //新增兑换物品 + List activeConsumptionChildList1 = activeConsumptionDTO.getActiveConsumptionChildList(); + if (CollectionUtils.isNotEmpty(activeConsumptionChildList1)){ + activeConsumptionChildList1.stream().map(s ->{ + s.setActiveConsumptionId(activeConsumption.getId()); + return s; + }).collect(Collectors.toList()); + update = activeConsumptionChildService.saveBatch(activeConsumptionChildList1); + } + return update; } /**