【BUG】修改限时折扣更新时没有设置活动开始时间点和活动结束时间点的问题

This commit is contained in:
YunaiV 2024-08-26 22:13:16 +08:00
parent 7384b5c3f6
commit 1e4cc953d3

View File

@ -104,7 +104,10 @@ public class DiscountActivityServiceImpl implements DiscountActivityService {
} }
// 计算新增的记录 // 计算新增的记录
List<DiscountProductDO> newDiscountProducts = convertList(updateReqVO.getProducts(), List<DiscountProductDO> newDiscountProducts = convertList(updateReqVO.getProducts(),
product -> DiscountActivityConvert.INSTANCE.convert(product).setActivityId(updateReqVO.getId())); product -> DiscountActivityConvert.INSTANCE.convert(product)
.setActivityId(updateReqVO.getId())
.setActivityStartTime(updateReqVO.getStartTime())
.setActivityEndTime(updateReqVO.getEndTime()));
newDiscountProducts.removeIf(product -> dbDiscountProducts.stream().anyMatch( newDiscountProducts.removeIf(product -> dbDiscountProducts.stream().anyMatch(
dbProduct -> DiscountActivityConvert.INSTANCE.isEquals(dbProduct, product))); // 如果匹配到说明是更新的 dbProduct -> DiscountActivityConvert.INSTANCE.isEquals(dbProduct, product))); // 如果匹配到说明是更新的
if (CollectionUtil.isNotEmpty(newDiscountProducts)) { if (CollectionUtil.isNotEmpty(newDiscountProducts)) {