修改bug

This commit is contained in:
齐天大圣 2024-01-12 14:37:40 +08:00
parent 101375930c
commit 95854beff1

View File

@ -209,18 +209,23 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
for (ActiveFullminus activeFullminus : activeFullminusList) {
MaxoutVO maxoutVO = new MaxoutVO();
// 会员等级判断符合油号判断
if (activeFullminus.getDieselUserLevel().contains(String.valueOf(userGradeService.selectUserGradeById(transferDTO.getGradeId()).getId())) &&
activeFullminus.getAdaptOil().contains(String.valueOf(transferDTO.getOilName())) &&
activeFullminus.getActiveStartTime().getTime()<=new Date().getTime() &&
new Date().getTime()<=activeFullminus.getActiveEndTime().getTime()){
BeanUtils.copyProperties(activeFullminus,maxoutVO);
LambdaQueryWrapper<ActiveDiscountChild> queryWrappers = new LambdaQueryWrapper<>();
queryWrappers.eq(ActiveDiscountChild::getActiveFullminusId,activeFullminus.getId());
//判断符合金额
queryWrappers.le(ActiveDiscountChild::getAmount,transferDTO.getOilPrice() * transferDTO.getOilLiters());
queryWrappers.orderByDesc(ActiveDiscountChild::getAmount);
maxoutVO.setActiveDiscountChildList(activeDiscountChildService.list(queryWrappers));
maxoutVOArrayList.add(maxoutVO);
String[] split = activeFullminus.getDieselUserLevel().split(",");
for (String s : split) {
if (transferDTO.getGradeId().equals(Integer.parseInt(s))) {
if (/*activeFullminus.getDieselUserLevel().contains(String.valueOf(userGradeService.selectUserGradeById(transferDTO.getGradeId()).getId())) &&*/
activeFullminus.getAdaptOil().contains(String.valueOf(transferDTO.getOilName())) &&
activeFullminus.getActiveStartTime().getTime() <= new Date().getTime() &&
new Date().getTime() <= activeFullminus.getActiveEndTime().getTime()) {
BeanUtils.copyProperties(activeFullminus, maxoutVO);
LambdaQueryWrapper<ActiveDiscountChild> queryWrappers = new LambdaQueryWrapper<>();
queryWrappers.eq(ActiveDiscountChild::getActiveFullminusId, activeFullminus.getId());
//判断符合金额
queryWrappers.le(ActiveDiscountChild::getAmount, transferDTO.getOilPrice() * transferDTO.getOilLiters());
queryWrappers.orderByDesc(ActiveDiscountChild::getAmount);
maxoutVO.setActiveDiscountChildList(activeDiscountChildService.list(queryWrappers));
maxoutVOArrayList.add(maxoutVO);
}
}
}
}
@ -235,6 +240,10 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
//获取兑换物品信息
for (ActiveDiscount activeDiscount : activeDiscountList) {
MaxoutVO maxoutVO = new MaxoutVO();
String[] split = activeDiscount.getDieselUserLevel().split(",");
for (String s : split) {
if(transferDTO.getGradeId().equals(Integer.parseInt(s))){
// 会员等级判断符合油号判断
if (activeDiscount.getDieselUserLevel().contains(String.valueOf(userGradeService.selectUserGradeById(transferDTO.getGradeId()).getId())) &&
activeDiscount.getAdaptOil().contains(String.valueOf(transferDTO.getOilName()))&&
@ -249,6 +258,8 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
maxoutVO.setActiveDiscountChildList(activeDiscountChildService.list(queryWrappers));
maxoutVOArrayList.add(maxoutVO);
}
}
}
}
return maxoutVOArrayList;
}
@ -262,7 +273,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
}
recordLambdaQueryWrapper.eq(CardFavorableRecord::getStoreId,transferDTO.getStoreId());
recordLambdaQueryWrapper.eq(CardFavorableRecord::getStatus,"0");
List<CardFavorableRecord> list = cardFavorableRecordService.list();
List<CardFavorableRecord> list = cardFavorableRecordService.list(recordLambdaQueryWrapper);
//筛查优惠券
ArrayList<ExchangeFavorableVO> exchangeFavorableVOArrayList = new ArrayList<>();
for (CardFavorableRecord cardFavorableRecord : list) {