Commit 8e265172 by huluobin

long 序列化

parent 3ad9aa82
...@@ -20,6 +20,7 @@ import com.gogirl.infrastructure.mapper.order.serve.OrderServeMapper; ...@@ -20,6 +20,7 @@ import com.gogirl.infrastructure.mapper.order.serve.OrderServeMapper;
import com.gogirl.shared.market.command.SetUpOuterCouponCommand; import com.gogirl.shared.market.command.SetUpOuterCouponCommand;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
...@@ -30,6 +31,7 @@ import java.util.stream.Collectors; ...@@ -30,6 +31,7 @@ import java.util.stream.Collectors;
@Service @Service
@Slf4j @Slf4j
@Transactional(rollbackFor = Exception.class)
public class CouponCustomerRelevanceServiceImpl extends ServiceImpl<CouponCustomerRelevanceMapper, CouponCustomerRelevance> implements CouponCustomerRelevanceService { public class CouponCustomerRelevanceServiceImpl extends ServiceImpl<CouponCustomerRelevanceMapper, CouponCustomerRelevance> implements CouponCustomerRelevanceService {
@Resource @Resource
...@@ -65,6 +67,15 @@ public class CouponCustomerRelevanceServiceImpl extends ServiceImpl<CouponCustom ...@@ -65,6 +67,15 @@ public class CouponCustomerRelevanceServiceImpl extends ServiceImpl<CouponCustom
List<Integer> freeCouponIds = discountConfigMapper.selectList(new LambdaQueryWrapper<>()).stream().map(DiscountConfig::getCouponId).filter(Objects::nonNull).collect(Collectors.toList()); List<Integer> freeCouponIds = discountConfigMapper.selectList(new LambdaQueryWrapper<>()).stream().map(DiscountConfig::getCouponId).filter(Objects::nonNull).collect(Collectors.toList());
canUserServeIds.retainAll(orderServeList.stream()
.map(OrderServe::getServeId)
.collect(Collectors.toList()));
return ListUtil.isNotEmpty(canUserServeIds);
})
.peek(couponCustomerRelevance -> {
List<Integer> canUserServeIds = couponCustomerRelevanceMapper.queryCouponCustomerServeRelevance(couponCustomerRelevance.getCouponId());
List<Integer> freeCouponIds = discountConfigMapper.selectList(new LambdaQueryWrapper<>()).stream().map(DiscountConfig::getCouponId).filter(Objects::nonNull).collect(Collectors.toList());
if (freeCouponIds.contains(couponCustomerRelevance.getCouponId())) { if (freeCouponIds.contains(couponCustomerRelevance.getCouponId())) {
canUserServeIds.retainAll(orderServeList.stream() canUserServeIds.retainAll(orderServeList.stream()
.filter(orderServe -> orderServe.getBindCoupon() == 2) .filter(orderServe -> orderServe.getBindCoupon() == 2)
...@@ -73,13 +84,13 @@ public class CouponCustomerRelevanceServiceImpl extends ServiceImpl<CouponCustom ...@@ -73,13 +84,13 @@ public class CouponCustomerRelevanceServiceImpl extends ServiceImpl<CouponCustom
} else { } else {
canUserServeIds.retainAll(orderServeList.stream() canUserServeIds.retainAll(orderServeList.stream()
.filter(orderServe -> orderServe.getBindCoupon() == 2) .filter(orderServe -> orderServe.getBindCoupon() == 2)
.filter(orderServe -> orderServe.getProduceCurrentPrice() == null) .filter(orderServe -> orderServe.getProduceCurrentPrice().compareTo(orderServe.getProduceBargainPrice()) > -1)
.filter(orderServe -> orderServe.getProducePromotionTimeId() == null) .filter(orderServe -> orderServe.getProducePromotionTimeId() == null)
.filter(orderServe -> orderServe.getLeisureDiscountConfigId() == null) .filter(orderServe -> orderServe.getLeisureDiscountConfigId() == null || orderServe.getLeisureDiscountConfigId() == 0)
.map(OrderServe::getServeId) .map(OrderServe::getServeId)
.collect(Collectors.toList())); .collect(Collectors.toList()));
} }
return ListUtil.isNotEmpty(canUserServeIds); couponCustomerRelevance.setCanBeUse(ListUtil.isNotEmpty(canUserServeIds));
}) })
//过滤可用 //过滤可用
.filter(CouponCustomerRelevance::isValid) .filter(CouponCustomerRelevance::isValid)
......
...@@ -223,6 +223,9 @@ public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> impleme ...@@ -223,6 +223,9 @@ public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> impleme
canUserServeIds.retainAll(orderServeList.stream().map(OrderServe::getServeId).collect(Collectors.toList())); canUserServeIds.retainAll(orderServeList.stream().map(OrderServe::getServeId).collect(Collectors.toList()));
return ListUtil.isNotEmpty(canUserServeIds); return ListUtil.isNotEmpty(canUserServeIds);
}) })
.peek(coupon -> {
})
//过滤达到可用金额 //过滤达到可用金额
.filter(coupon -> coupon.getReachingAmount().compareTo(orderManage.getTotalPrice()) < 0) .filter(coupon -> coupon.getReachingAmount().compareTo(orderManage.getTotalPrice()) < 0)
.collect(Collectors.toList()); .collect(Collectors.toList());
......
...@@ -6,6 +6,7 @@ import com.gogirl.application.order.serve.OrderServeService; ...@@ -6,6 +6,7 @@ import com.gogirl.application.order.serve.OrderServeService;
import com.gogirl.domain.market.coupon.Coupon; import com.gogirl.domain.market.coupon.Coupon;
import com.gogirl.domain.market.coupon.CouponCustomerRelevance; import com.gogirl.domain.market.coupon.CouponCustomerRelevance;
import com.gogirl.domain.market.coupon.CouponOrderRelevance; import com.gogirl.domain.market.coupon.CouponOrderRelevance;
import com.gogirl.domain.market.discount.DiscountConfig;
import com.gogirl.domain.market.timescard.TimesCardCustomerRelevance; import com.gogirl.domain.market.timescard.TimesCardCustomerRelevance;
import com.gogirl.domain.market.timescard.TimesCardOrderServeDetail; import com.gogirl.domain.market.timescard.TimesCardOrderServeDetail;
import com.gogirl.domain.market.timescard.TimesCardUsedRecord; import com.gogirl.domain.market.timescard.TimesCardUsedRecord;
...@@ -15,6 +16,7 @@ import com.gogirl.infrastructure.common.exception.RRException; ...@@ -15,6 +16,7 @@ import com.gogirl.infrastructure.common.exception.RRException;
import com.gogirl.infrastructure.common.util.ListUtil; import com.gogirl.infrastructure.common.util.ListUtil;
import com.gogirl.infrastructure.mapper.market.coupon.CouponCustomerRelevanceMapper; import com.gogirl.infrastructure.mapper.market.coupon.CouponCustomerRelevanceMapper;
import com.gogirl.infrastructure.mapper.market.coupon.CouponMapper; import com.gogirl.infrastructure.mapper.market.coupon.CouponMapper;
import com.gogirl.infrastructure.mapper.market.discount.DiscountConfigMapper;
import com.gogirl.infrastructure.mapper.market.timescard.TimesCardCustomerRelevanceMapper; import com.gogirl.infrastructure.mapper.market.timescard.TimesCardCustomerRelevanceMapper;
import com.gogirl.infrastructure.mapper.market.timescard.TimesCardOrderServeDetailMapper; import com.gogirl.infrastructure.mapper.market.timescard.TimesCardOrderServeDetailMapper;
import com.gogirl.infrastructure.mapper.market.timescard.TimesCardUsedRecordMapper; import com.gogirl.infrastructure.mapper.market.timescard.TimesCardUsedRecordMapper;
...@@ -23,15 +25,14 @@ import com.gogirl.infrastructure.mapper.order.serve.OrderServeMapper; ...@@ -23,15 +25,14 @@ import com.gogirl.infrastructure.mapper.order.serve.OrderServeMapper;
import com.gogirl.shared.market.command.SetTimesCardCommand; import com.gogirl.shared.market.command.SetTimesCardCommand;
import com.gogirl.shared.market.command.SetUpInnerCouponCommand; import com.gogirl.shared.market.command.SetUpInnerCouponCommand;
import com.gogirl.shared.market.command.SetUpOuterCouponCommand; import com.gogirl.shared.market.command.SetUpOuterCouponCommand;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Comparator; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
...@@ -64,6 +65,8 @@ public class MarketServiceImpl implements MarketService { ...@@ -64,6 +65,8 @@ public class MarketServiceImpl implements MarketService {
@Resource @Resource
private TimesCardCustomerRelevanceService timesCardCustomerRelevanceService; private TimesCardCustomerRelevanceService timesCardCustomerRelevanceService;
@Resource
private DiscountConfigMapper discountConfigMapper;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
...@@ -96,14 +99,15 @@ public class MarketServiceImpl implements MarketService { ...@@ -96,14 +99,15 @@ public class MarketServiceImpl implements MarketService {
//设置卡券关联 //设置卡券关联
if (ListUtil.isNotEmpty(cmd.getInnerCouponCustomerRelevanceIds())) { if (ListUtil.isNotEmpty(cmd.getInnerCouponCustomerRelevanceIds())) {
List<CouponCustomerRelevance> couponCustomerRelevanceList = (List<CouponCustomerRelevance>) couponCustomerRelevanceService.listByIds(cmd.getInnerCouponCustomerRelevanceIds()); List<CouponCustomerRelevance> couponCustomerRelevanceList = (List<CouponCustomerRelevance>) couponCustomerRelevanceService
.listByIds(cmd.getInnerCouponCustomerRelevanceIds());
if (ListUtil.isNotEmpty(couponCustomerRelevanceList)) { if (ListUtil.isNotEmpty(couponCustomerRelevanceList)) {
couponCustomerRelevanceList.forEach(couponCustomerRelevance -> { couponCustomerRelevanceList.forEach(couponCustomerRelevance -> {
couponCustomerRelevance.setOrderId(cmd.getOrderId()); couponCustomerRelevance.setOrderId(cmd.getOrderId());
//选择使用 //选择使用
couponCustomerRelevance.setState(CouponCustomerRelevance.STATE_CHOSE); couponCustomerRelevance.setState(CouponCustomerRelevance.STATE_CHOSE);
couponCustomerRelevanceMapper.updateById(couponCustomerRelevance);
}); });
couponCustomerRelevanceService.updateBatchById(couponCustomerRelevanceList);
} }
} }
} }
...@@ -265,14 +269,14 @@ public class MarketServiceImpl implements MarketService { ...@@ -265,14 +269,14 @@ public class MarketServiceImpl implements MarketService {
.list(new LambdaQueryWrapper<CouponCustomerRelevance>() .list(new LambdaQueryWrapper<CouponCustomerRelevance>()
.eq(CouponCustomerRelevance::getOrderId, orderId) .eq(CouponCustomerRelevance::getOrderId, orderId)
.eq(CouponCustomerRelevance::getState, 1) .eq(CouponCustomerRelevance::getState, 1)
.eq(CouponCustomerRelevance::getType, 0)); .eq(CouponCustomerRelevance::getSourceType, 0));
//订单使用的外部券 //订单使用的外部券
List<CouponCustomerRelevance> outerCouponCustomerRelevanceServiceList = couponCustomerRelevanceService List<CouponCustomerRelevance> outerCouponCustomerRelevanceServiceList = couponCustomerRelevanceService
.list(new LambdaQueryWrapper<CouponCustomerRelevance>() .list(new LambdaQueryWrapper<CouponCustomerRelevance>()
.eq(CouponCustomerRelevance::getOrderId, orderId) .eq(CouponCustomerRelevance::getOrderId, orderId)
.eq(CouponCustomerRelevance::getState, 1) .eq(CouponCustomerRelevance::getState, 1)
.eq(CouponCustomerRelevance::getType, 1)); .eq(CouponCustomerRelevance::getSourceType, 1));
//订单使用的次卡 //订单使用的次卡
...@@ -336,6 +340,7 @@ public class MarketServiceImpl implements MarketService { ...@@ -336,6 +340,7 @@ public class MarketServiceImpl implements MarketService {
//如果有属于这个服务的辅助服务 就查出来一起折扣 //如果有属于这个服务的辅助服务 就查出来一起折扣
OrderServe supportServe = this.querySupportServe(orderManage, orderServe); OrderServe supportServe = this.querySupportServe(orderManage, orderServe);
BigDecimal actualDiscountAmount = orderServe.getPayPrice().min(timesCardUsedRecord.getDiscountAmount());
//更新次卡记录 已使用 //更新次卡记录 已使用
timesCardUsedRecord.setStatus(TimesCardUsedRecord.STATUS_USED); timesCardUsedRecord.setStatus(TimesCardUsedRecord.STATUS_USED);
//次卡对应订单服务的美甲师 //次卡对应订单服务的美甲师
...@@ -348,12 +353,13 @@ public class MarketServiceImpl implements MarketService { ...@@ -348,12 +353,13 @@ public class MarketServiceImpl implements MarketService {
timesCardUsedRecord.setServeName(orderServe.getServeName()); timesCardUsedRecord.setServeName(orderServe.getServeName());
//次卡作用的服务id //次卡作用的服务id
timesCardUsedRecord.setOrderServeId(orderServe.getServeId()); timesCardUsedRecord.setOrderServeId(orderServe.getServeId());
timesCardUsedRecord.setOrderId(orderId);
timesCardUsedRecord.setActualDiscountAmount(actualDiscountAmount);
timesCardUsedRecordService.updateById(timesCardUsedRecord); timesCardUsedRecordService.updateById(timesCardUsedRecord);
//在主服务上折扣的钱 //在主服务上折扣的钱
TimesCardOrderServeDetail timesCardOrderServeDetail = new TimesCardOrderServeDetail(); TimesCardOrderServeDetail timesCardOrderServeDetail = new TimesCardOrderServeDetail();
BigDecimal serveDiscountAmount = orderServe.getPayPrice().min(timesCardUsedRecord.getDiscountAmount()); timesCardOrderServeDetail.setDiscountAmount(actualDiscountAmount);
timesCardOrderServeDetail.setDiscountAmount(serveDiscountAmount);
timesCardOrderServeDetail.setOrderServeId(orderServe.getId()); timesCardOrderServeDetail.setOrderServeId(orderServe.getId());
timesCardOrderServeDetail.setOrderId(orderId); timesCardOrderServeDetail.setOrderId(orderId);
timesCardOrderServeDetail.setTimesCardUserRecordId(timesCardUsedRecord.getOrderServeId()); timesCardOrderServeDetail.setTimesCardUserRecordId(timesCardUsedRecord.getOrderServeId());
...@@ -363,28 +369,27 @@ public class MarketServiceImpl implements MarketService { ...@@ -363,28 +369,27 @@ public class MarketServiceImpl implements MarketService {
//订单折扣金额更新 //订单折扣金额更新
orderServe.setBindCoupon(1); orderServe.setBindCoupon(1);
orderServe.addDiscountPrice(serveDiscountAmount); orderServe.addDiscountPrice(actualDiscountAmount);
orderManage.addDiscountPrice(serveDiscountAmount); orderManage.addDiscountPrice(actualDiscountAmount);
// 在从服务上折扣的钱
//在从服务上折扣的钱 // BigDecimal leftServeDiscountAmount = timesCardUsedRecord.getDiscountAmount().subtract(serveDiscountAmount);
BigDecimal leftServeDiscountAmount = timesCardUsedRecord.getDiscountAmount().subtract(serveDiscountAmount); // if (supportServe != null && leftServeDiscountAmount.compareTo(BigDecimal.ZERO) > 0) {
if (supportServe != null && leftServeDiscountAmount.compareTo(BigDecimal.ZERO) > 0) { //
// BigDecimal actualSupportServeDiscountAmount = leftServeDiscountAmount.min(supportServe.getPayPrice());
BigDecimal actualSupportServeDiscountAmount = leftServeDiscountAmount.min(supportServe.getPayPrice()); // TimesCardOrderServeDetail supportTimesCardOrderServeDetail = new TimesCardOrderServeDetail();
TimesCardOrderServeDetail supportTimesCardOrderServeDetail = new TimesCardOrderServeDetail(); // supportTimesCardOrderServeDetail.setDiscountAmount(actualSupportServeDiscountAmount);
supportTimesCardOrderServeDetail.setDiscountAmount(actualSupportServeDiscountAmount); // supportTimesCardOrderServeDetail.setOrderServeId(supportServe.getId());
supportTimesCardOrderServeDetail.setOrderServeId(supportServe.getId()); // supportTimesCardOrderServeDetail.setOrderId(orderId);
supportTimesCardOrderServeDetail.setOrderId(orderId); // supportTimesCardOrderServeDetail.setTimesCardUserRecordId(timesCardUsedRecord.getOrderServeId());
supportTimesCardOrderServeDetail.setTimesCardUserRecordId(timesCardUsedRecord.getOrderServeId()); // //业绩
//业绩 // supportTimesCardOrderServeDetail.setAchievement(BigDecimal.ZERO);
supportTimesCardOrderServeDetail.setAchievement(BigDecimal.ZERO); // timesCardOrderServeDetailMapper.insert(supportTimesCardOrderServeDetail);
timesCardOrderServeDetailMapper.insert(supportTimesCardOrderServeDetail); //
// //订单折扣金额更新
//订单折扣金额更新 // supportServe.setBindCoupon(1);
supportServe.setBindCoupon(1); // supportServe.addDiscountPrice(actualSupportServeDiscountAmount);
supportServe.addDiscountPrice(actualSupportServeDiscountAmount); // orderManage.addDiscountPrice(actualSupportServeDiscountAmount);
orderManage.addDiscountPrice(actualSupportServeDiscountAmount); // }
}
//更新使用次数 //更新使用次数
TimesCardCustomerRelevance timesCardCustomerRelevance = timesCardCustomerRelevanceService.getById(timesCardUsedRecord.getCardRelevanceCustomerId()); TimesCardCustomerRelevance timesCardCustomerRelevance = timesCardCustomerRelevanceService.getById(timesCardUsedRecord.getCardRelevanceCustomerId());
...@@ -395,8 +400,9 @@ public class MarketServiceImpl implements MarketService { ...@@ -395,8 +400,9 @@ public class MarketServiceImpl implements MarketService {
} }
timesCardCustomerRelevanceService.updateById(timesCardCustomerRelevance); timesCardCustomerRelevanceService.updateById(timesCardCustomerRelevance);
} else { } else {
timesCardUsedRecord.setOrderId(null); throw new RRException("次卡冲突");
timesCardUsedRecordMapper.updateById(timesCardUsedRecord); // timesCardUsedRecord.setOrderId(null);
// timesCardUsedRecordMapper.updateById(timesCardUsedRecord);
} }
}); });
...@@ -431,7 +437,7 @@ public class MarketServiceImpl implements MarketService { ...@@ -431,7 +437,7 @@ public class MarketServiceImpl implements MarketService {
//如果有属于这个服务的辅助服务 就查出来一起折扣 //如果有属于这个服务的辅助服务 就查出来一起折扣
OrderServe supportServe = this.querySupportServe(orderManage, orderServe); OrderServe supportServe = this.querySupportServe(orderManage, orderServe);
BigDecimal serveDiscountAmount = orderServe.getPayPrice().min(couponCustomerRelevance.getDiscountAmount()); BigDecimal actualDiscountAmount = orderServe.getPayPrice().min(couponCustomerRelevance.getDiscountAmount());
//新增外部券抵扣情况记录 //新增外部券抵扣情况记录
CouponOrderRelevance couponOrderRelevance = CouponOrderRelevance.builder() CouponOrderRelevance couponOrderRelevance = CouponOrderRelevance.builder()
...@@ -444,7 +450,7 @@ public class MarketServiceImpl implements MarketService { ...@@ -444,7 +450,7 @@ public class MarketServiceImpl implements MarketService {
//支付金额 //支付金额
.payForOrderServe(couponCustomerRelevance.getPayAmount()) .payForOrderServe(couponCustomerRelevance.getPayAmount())
//折扣金额 //折扣金额
.discountAmount(serveDiscountAmount) .discountAmount(actualDiscountAmount)
.createTime(new Date()) .createTime(new Date())
.confirmTime(new Date()) .confirmTime(new Date())
.message(orderServe.getServeName()) .message(orderServe.getServeName())
...@@ -457,44 +463,44 @@ public class MarketServiceImpl implements MarketService { ...@@ -457,44 +463,44 @@ public class MarketServiceImpl implements MarketService {
} else { } else {
couponOrderRelevance.setAchievement(couponOrderRelevance.getDiscountAmount()); couponOrderRelevance.setAchievement(couponOrderRelevance.getDiscountAmount());
} }
orderServe.addDiscountPrice(serveDiscountAmount); orderServe.addDiscountPrice(actualDiscountAmount);
orderManage.addDiscountPrice(serveDiscountAmount); orderManage.addDiscountPrice(actualDiscountAmount);
orderServe.setBindCoupon(1); orderServe.setBindCoupon(1);
couponOrderRelevanceService.save(couponOrderRelevance); couponOrderRelevanceService.save(couponOrderRelevance);
//在从服务上折扣的钱 //在从服务上折扣的钱
BigDecimal leftServeDiscountAmount = couponCustomerRelevance.getDiscountAmount().subtract(serveDiscountAmount); // BigDecimal leftServeDiscountAmount = couponCustomerRelevance.getDiscountAmount().subtract(actualDiscountAmount);
if (supportServe != null && leftServeDiscountAmount.compareTo(BigDecimal.ZERO) > 0) { // if (supportServe != null && leftServeDiscountAmount.compareTo(BigDecimal.ZERO) > 0) {
BigDecimal actualSupportServeDiscountAmount = leftServeDiscountAmount.min(supportServe.getPayPrice()); // BigDecimal actualSupportServeDiscountAmount = leftServeDiscountAmount.min(supportServe.getPayPrice());
//新增外部券抵扣情况记录 // //新增外部券抵扣情况记录
CouponOrderRelevance supportCouponOrderRelevance = CouponOrderRelevance.builder() // CouponOrderRelevance supportCouponOrderRelevance = CouponOrderRelevance.builder()
.couponCustomerRelevanceId(couponCustomerRelevance.getId()) // .couponCustomerRelevanceId(couponCustomerRelevance.getId())
.couponId(couponCustomerRelevance.getCouponId()) // .couponId(couponCustomerRelevance.getCouponId())
.couponName(couponCustomerRelevance.getCouponName()) // .couponName(couponCustomerRelevance.getCouponName())
.orderServeId(supportServe.getId()) // .orderServeId(supportServe.getId())
.serveName(supportServe.getServeName()) // .serveName(supportServe.getServeName())
.orderId(orderManage.getId()) // .orderId(orderManage.getId())
//支付金额 // //支付金额
.payForOrderServe(BigDecimal.ZERO) // .payForOrderServe(BigDecimal.ZERO)
//折扣金额 // //折扣金额
.discountAmount(actualSupportServeDiscountAmount) // .discountAmount(actualSupportServeDiscountAmount)
.createTime(new Date()) // .createTime(new Date())
.confirmTime(new Date()) // .confirmTime(new Date())
.message(supportServe.getServeName()) // .message(supportServe.getServeName())
.customerId(orderManage.getOrderUser()) // .customerId(orderManage.getOrderUser())
.achievement(BigDecimal.ZERO) // .achievement(BigDecimal.ZERO)
//确认可用 // //确认可用
.status(2) // .status(2)
.build(); // .build();
couponOrderRelevanceService.save(supportCouponOrderRelevance); // couponOrderRelevanceService.save(supportCouponOrderRelevance);
//
supportServe.addDiscountPrice(actualSupportServeDiscountAmount); // supportServe.addDiscountPrice(actualSupportServeDiscountAmount);
orderManage.addDiscountPrice(actualSupportServeDiscountAmount); // orderManage.addDiscountPrice(actualSupportServeDiscountAmount);
orderServe.setBindCoupon(1); // orderServe.setBindCoupon(1);
} // }
} else { } else {
couponCustomerRelevance.setOrderId(null); throw new RRException("外部券冲突");
couponCustomerRelevanceMapper.updateById(couponCustomerRelevance); // couponCustomerRelevance.setOrderId(null);
// couponCustomerRelevanceMapper.updateById(couponCustomerRelevance);
} }
}); });
...@@ -513,7 +519,7 @@ public class MarketServiceImpl implements MarketService { ...@@ -513,7 +519,7 @@ public class MarketServiceImpl implements MarketService {
List<Integer> serveIds = couponCustomerRelevanceMapper.queryCouponCustomerServeRelevance(couponCustomerRelevance.getCouponId()); List<Integer> serveIds = couponCustomerRelevanceMapper.queryCouponCustomerServeRelevance(couponCustomerRelevance.getCouponId());
//作用的服务id //作用的服务id
List<OrderServe> canUserOrderServeList = orderManage.getListOrderServer().stream().filter(dto -> serveIds.contains(dto.getServeId())).collect(Collectors.toList()); List<OrderServe> canUserOrderServeList = this.queryCanDiscount(orderManage, serveIds, couponCustomerRelevance.getCouponId());
//打折订单项总支付金额 //打折订单项总支付金额
BigDecimal total = canUserOrderServeList.stream().map(OrderServe::getPayPrice).reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal total = canUserOrderServeList.stream().map(OrderServe::getPayPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
...@@ -571,16 +577,17 @@ public class MarketServiceImpl implements MarketService { ...@@ -571,16 +577,17 @@ public class MarketServiceImpl implements MarketService {
orderServe.addDiscountPrice(discountAmount); orderServe.addDiscountPrice(discountAmount);
orderManage.addDiscountPrice(discountAmount); orderManage.addDiscountPrice(discountAmount);
orderServe.setBindCoupon(1);
discountCalc = discountCalc.add(discountAmount); discountCalc = discountCalc.add(discountAmount);
payCalc = payCalc.add(payAmount); payCalc = payCalc.add(payAmount);
} }
} }
//内部券抵扣不了 //内部券抵扣不了
else { else {
couponCustomerRelevance.setState(null); // couponCustomerRelevance.setState(null);
couponCustomerRelevance.setOrderId(null); // couponCustomerRelevance.setOrderId(null);
couponCustomerRelevanceService.updateById(couponCustomerRelevance); // couponCustomerRelevanceService.updateById(couponCustomerRelevance);
throw new RRException("内部券冲突");
} }
}); });
} }
...@@ -590,6 +597,51 @@ public class MarketServiceImpl implements MarketService { ...@@ -590,6 +597,51 @@ public class MarketServiceImpl implements MarketService {
} }
private List<OrderServe> queryCanDiscount(OrderManage orderManage, List<Integer> serveIds, Integer counponId) {
List<Integer> freeCouponIds = discountConfigMapper.selectList(new LambdaQueryWrapper<>()).stream().map(DiscountConfig::getCouponId)
.filter(Objects::nonNull).collect(Collectors.toList());
if (freeCouponIds.contains(counponId)) {
Set<OrderServe> set = new HashSet<>();
List<String> meijia = Lists.newArrayList("全手光疗延长", "单指光疗延长",
"精细日式卸甲(手部)", "精细日式卸甲(脚部)", "单指跳色");
List<String> meijie = Lists.newArrayList("睫毛(卸除)", "加彩色睫毛",
"加种睫毛", "加彩色睫毛", "下睫毛");
OrderServe maxOrderServe = orderManage.getListOrderServer()
.stream()
.filter(orderServe -> orderServe.getBindCoupon() == 2)
.filter(orderServe -> serveIds.contains(orderServe.getServeId()))
.max(Comparator.comparing(OrderServe::getPayPrice))
.orElse(null);
set.add(maxOrderServe);
if (maxOrderServe != null) {
if (maxOrderServe.getServeType().equals("美甲")) {
set.addAll(orderManage.getListOrderServer().stream()
.filter(orderServe -> meijia.contains(orderServe.getServeName()))
.collect(Collectors.toList()));
}
if (maxOrderServe.getServeType().equals("美睫")) {
set.addAll(orderManage.getListOrderServer().stream()
.filter(orderServe -> meijie.contains(orderServe.getServeName()))
.collect(Collectors.toList()));
}
}
return new ArrayList<>(set).stream().filter(Objects::nonNull).collect(Collectors.toList());
} else {
return orderManage.getListOrderServer()
.stream()
.filter(orderServe -> serveIds.contains(orderServe.getServeId()))
.filter(orderServe -> orderServe.getLeisureDiscountConfigId() == null || orderServe.getLeisureDiscountConfigId() == 0)
.filter(orderServe -> orderServe.getProducePromotionTimeId() == null)
.filter(orderServe -> orderServe.getProduceCurrentPrice().compareTo(orderServe.getProduceBargainPrice()) > -1)
.filter(orderServe -> orderServe.getBindCoupon() == 2)
.filter(Objects::nonNull)
.collect(Collectors.toList());
}
}
private OrderServe querySupportServe(OrderManage orderManage, OrderServe orderServe) { private OrderServe querySupportServe(OrderManage orderManage, OrderServe orderServe) {
return null; return null;
} }
...@@ -605,10 +657,10 @@ public class MarketServiceImpl implements MarketService { ...@@ -605,10 +657,10 @@ public class MarketServiceImpl implements MarketService {
return orderManage.getListOrderServer() return orderManage.getListOrderServer()
.stream() .stream()
.filter(orderServe -> serveIds.contains(orderServe.getServeId())) .filter(orderServe -> serveIds.contains(orderServe.getServeId()))
.filter(orderServe -> orderServe.getLeisureDiscountConfigId() == null) .filter(orderServe -> orderServe.getLeisureDiscountConfigId() == null || orderServe.getLeisureDiscountConfigId() == 0)
.filter(orderServe -> orderServe.getProducePromotionTimeId() == null) .filter(orderServe -> orderServe.getProducePromotionTimeId() == null)
.filter(orderServe -> orderServe.getProduceCurrentPrice() == null) .filter(orderServe -> orderServe.getProduceCurrentPrice().compareTo(orderServe.getProduceBargainPrice()) > -1)
.filter(orderServe -> orderServe.getBindCoupon() != 1) .filter(orderServe -> orderServe.getBindCoupon() == 2)
.max(Comparator.comparing(OrderServe::getPayPrice)) .max(Comparator.comparing(OrderServe::getPayPrice))
.orElse(null); .orElse(null);
} }
......
...@@ -2,29 +2,53 @@ package com.gogirl.application.product.mall.impl; ...@@ -2,29 +2,53 @@ package com.gogirl.application.product.mall.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gogirl.application.product.mall.MallShoppingCartQryService; import com.gogirl.application.product.mall.MallShoppingCartQryService;
import com.gogirl.assembler.MallShoppingCartDTOAssembler;
import com.gogirl.domain.order.mall.MallShoppingCart; import com.gogirl.domain.order.mall.MallShoppingCart;
import com.gogirl.domain.product.mall.MallProduct;
import com.gogirl.infrastructure.common.util.ListUtil;
import com.gogirl.infrastructure.mapper.order.mall.MallShoppingCartMapper; import com.gogirl.infrastructure.mapper.order.mall.MallShoppingCartMapper;
import com.gogirl.infrastructure.mapper.product.mall.MallProductMapper;
import com.gogirl.shared.product.query.dto.MallShoppingCartDTO;
import com.gogirl.shared.product.query.dto.MyMallShoppingCartDTO; import com.gogirl.shared.product.query.dto.MyMallShoppingCartDTO;
import com.gogirl.shared.product.query.qry.MyShoppingCartQuery; import com.gogirl.shared.product.query.qry.MyShoppingCartQuery;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service @Service
@AllArgsConstructor @AllArgsConstructor
public class MallShoppingCartQryServiceImpl implements MallShoppingCartQryService { public class MallShoppingCartQryServiceImpl implements MallShoppingCartQryService {
private final MallShoppingCartMapper mallShoppingCartMapper; private final MallShoppingCartMapper mallShoppingCartMapper;
private final MallShoppingCartDTOAssembler mallShoppingCartDTOAssembler;
private final MallProductMapper mallProductMapper;
@Override @Override
public MyMallShoppingCartDTO queryMyShoppingCart(MyShoppingCartQuery qry) { public MyMallShoppingCartDTO queryMyShoppingCart(MyShoppingCartQuery qry) {
List<MallShoppingCart> mallShoppingCartList = mallShoppingCartMapper.selectList( List<MallShoppingCart> mallShoppingCartList = mallShoppingCartMapper.selectList(
new LambdaQueryWrapper<MallShoppingCart>().eq(MallShoppingCart::getCustomerId, qry.getCustomerId()) new LambdaQueryWrapper<MallShoppingCart>().eq(MallShoppingCart::getCustomerId, qry.getCustomerId())
); );
List<Long> productIds = mallShoppingCartList.stream().map(MallShoppingCart::getProductId)
.collect(Collectors.toList());
if (ListUtil.isNotEmpty(productIds)) {
Map<Long, List<MallProduct>> map = mallProductMapper.selectBatchIds(productIds)
.stream()
.collect(Collectors.groupingBy(MallProduct::getId));
mallShoppingCartList.forEach(mallShoppingCart -> {
List<MallProduct> mallProductList = map.get(mallShoppingCart.getProductId());
if (ListUtil.isNotEmpty(mallProductList)) {
mallShoppingCart.setMallProduct(mallProductList.stream().findAny().orElse(null));
}
});
}
List<MallShoppingCartDTO> mallShoppingCartDTOList = mallShoppingCartList.stream().map(mallShoppingCartDTOAssembler).collect(Collectors.toList());
MyMallShoppingCartDTO data = new MyMallShoppingCartDTO(); MyMallShoppingCartDTO data = new MyMallShoppingCartDTO();
data.setMallShoppingCartDTOList(mallShoppingCartList); data.setMallShoppingCartDTOList(mallShoppingCartDTOList);
data.setItemSum(mallShoppingCartList.stream() data.setItemSum(mallShoppingCartList.stream()
.map(MallShoppingCart::getNum) .map(MallShoppingCart::getNum)
......
...@@ -75,7 +75,6 @@ public class BaseQuestionServiceImpl extends ServiceImpl<BaseQuestionMapper, Bas ...@@ -75,7 +75,6 @@ public class BaseQuestionServiceImpl extends ServiceImpl<BaseQuestionMapper, Bas
complaintMainService.saveComplainsByOrderQuestion(list); complaintMainService.saveComplainsByOrderQuestion(list);
Coupon coupon = couponService.getOne(new LambdaQueryWrapper<Coupon>().eq(Coupon::getName, "问卷调查礼券")); Coupon coupon = couponService.getOne(new LambdaQueryWrapper<Coupon>().eq(Coupon::getName, "问卷调查礼券"));
if (coupon != null) { if (coupon != null) {
couponService.sendCoupon(coupon.getId(), currentCustomerId); couponService.sendCoupon(coupon.getId(), currentCustomerId);
......
package com.gogirl.assembler;
import com.gogirl.domain.product.mall.MallProduct;
import com.gogirl.shared.product.query.dto.MallProductDTO;
import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import java.util.function.Function;
@Component
@AllArgsConstructor
public class MallProductDTOAssembler implements Function<MallProduct, MallProductDTO> {
private final MallShoppingCartDTOAssembler.PurchaseSkuDTOAssembler purchaseSkuDTOAssembler;
@Override
public MallProductDTO apply(MallProduct mallProduct) {
MallProductDTO mallProductDTO = new MallProductDTO();
BeanUtils.copyProperties(mallProduct, mallProductDTO);
return mallProductDTO;
}
}
package com.gogirl.assembler;
import com.gogirl.domain.order.mall.MallShoppingCart;
import com.gogirl.domain.product.purchase.PurchaseSku;
import com.gogirl.shared.product.query.dto.MallShoppingCartDTO;
import com.gogirl.shared.product.query.dto.PurchaseSkuDTO;
import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import java.util.function.Function;
@Component
@AllArgsConstructor
public class MallShoppingCartDTOAssembler implements Function<MallShoppingCart, MallShoppingCartDTO> {
private final MallProductDTOAssembler mallProductDTOAssembler;
@Override
public MallShoppingCartDTO apply(MallShoppingCart mallShoppingCart) {
MallShoppingCartDTO mallShoppingCartDTO = new MallShoppingCartDTO();
BeanUtils.copyProperties(mallShoppingCart, mallShoppingCartDTO);
if (mallShoppingCart.getMallProduct() != null) {
mallShoppingCartDTO.setMallProductDTO(mallProductDTOAssembler.apply(mallShoppingCart.getMallProduct()));
}
return mallShoppingCartDTO;
}
@Component
static class PurchaseSkuDTOAssembler implements Function<PurchaseSku, PurchaseSkuDTO> {
@Override
public PurchaseSkuDTO apply(PurchaseSku purchaseSku) {
PurchaseSkuDTO purchaseSkuDTO = new PurchaseSkuDTO();
BeanUtils.copyProperties(purchaseSku, purchaseSkuDTO);
return purchaseSkuDTO;
}
}
}
package com.gogirl.domain.market.coupon; package com.gogirl.domain.market.coupon;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
...@@ -69,4 +70,7 @@ public class Coupon { ...@@ -69,4 +70,7 @@ public class Coupon {
@ApiModelProperty("1-计算 2-不计算") @ApiModelProperty("1-计算 2-不计算")
private Integer isCalcAchievement; private Integer isCalcAchievement;
@TableField(exist = false)
private Integer canBeUse;
} }
...@@ -31,6 +31,7 @@ public class CouponCustomerRelevance implements Serializable { ...@@ -31,6 +31,7 @@ public class CouponCustomerRelevance implements Serializable {
private Integer id; private Integer id;
@ApiModelProperty("顾客Id") @ApiModelProperty("顾客Id")
private Integer customerId; private Integer customerId;
@ApiModelProperty("卡券id") @ApiModelProperty("卡券id")
private Integer couponId; private Integer couponId;
...@@ -39,43 +40,66 @@ public class CouponCustomerRelevance implements Serializable { ...@@ -39,43 +40,66 @@ public class CouponCustomerRelevance implements Serializable {
@ApiModelProperty("领奖码") @ApiModelProperty("领奖码")
private String code; private String code;
@ApiModelProperty("领券时间")
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date receiveTime; private Date receiveTime;
@ApiModelProperty("可用开始日期")
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date validStartTime; private Date validStartTime;
@ApiModelProperty("可用截止日期")
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date validEndTime; private Date validEndTime;
@ApiModelProperty("使用日期")
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date useDate; private Date useDate;
//冗余coupon字段 //冗余coupon字段
@ApiModelProperty("卡券配置备注")
private String remark; private String remark;
@ApiModelProperty("能否使用")
@TableField(exist = false) @TableField(exist = false)
private Boolean canBeUse; private Boolean canBeUse;
@TableField(exist = false) @TableField(exist = false)
private Coupon coupon; private Coupon coupon;
@TableField(exist = false) @TableField(exist = false)
private Customer customer; private Customer customer;
@ApiModelProperty("卡券名称")
private String couponName; private String couponName;
@ApiModelProperty("优惠金额") @ApiModelProperty("优惠金额")
private BigDecimal discountAmount; private BigDecimal discountAmount;
@ApiModelProperty("满这个金额才能减") @ApiModelProperty("满这个金额才能减")
private BigDecimal reachingAmount; private BigDecimal reachingAmount;
@ApiModelProperty("优惠折扣") @ApiModelProperty("优惠折扣")
private BigDecimal discountPercent; private BigDecimal discountPercent;
@ApiModelProperty("优惠券类型:1.现金抵扣券;2.免单券;3满减券;4卸甲券") @ApiModelProperty("优惠券类型:1.现金抵扣券;2.免单券;3满减券;4卸甲券")
private Integer type; private Integer type;
@ApiModelProperty("0 = 内部券 1 = 外部券") @ApiModelProperty("0 = 内部券 1 = 外部券")
private Integer sourceType; private Integer sourceType;
@ApiModelProperty("使用条件:1.重叠使用") @ApiModelProperty("使用条件:1.重叠使用")
private String condition1; private String condition1;
@ApiModelProperty("客户购买该券时,实际支付的金额(用该金额算业绩)") @ApiModelProperty("客户购买该券时,实际支付的金额(用该金额算业绩)")
private BigDecimal payAmount; private BigDecimal payAmount;
@ApiModelProperty("卡券来源") @ApiModelProperty("卡券来源")
private String sourceFrom; private String sourceFrom;
@ApiModelProperty("卡券来源id") @ApiModelProperty("卡券来源id")
......
...@@ -74,6 +74,9 @@ public class TimesCardCustomerRelevance { ...@@ -74,6 +74,9 @@ public class TimesCardCustomerRelevance {
//状态-已过期 //状态-已过期
public static Integer STATUS_OVER_TIME = 3; public static Integer STATUS_OVER_TIME = 3;
@TableField(exist = false)
private Boolean canBeUse;
/** /**
* 次卡是否可用 * 次卡是否可用
* *
...@@ -83,4 +86,5 @@ public class TimesCardCustomerRelevance { ...@@ -83,4 +86,5 @@ public class TimesCardCustomerRelevance {
return validStartTime.getTime() < System.currentTimeMillis() return validStartTime.getTime() < System.currentTimeMillis()
&& validEndTime.getTime() > System.currentTimeMillis(); && validEndTime.getTime() > System.currentTimeMillis();
} }
} }
package com.gogirl.domain.order.mall; package com.gogirl.domain.order.mall;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.gogirl.domain.product.mall.MallProduct;
import com.gogirl.domain.product.purchase.PurchaseSku; import com.gogirl.domain.product.purchase.PurchaseSku;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -37,4 +39,8 @@ public class MallShoppingCart { ...@@ -37,4 +39,8 @@ public class MallShoppingCart {
private Long lastUpdateTime; private Long lastUpdateTime;
@TableField(exist = false)
private MallProduct mallProduct;
} }
...@@ -20,6 +20,7 @@ import com.gogirl.infrastructure.common.exception.RRException; ...@@ -20,6 +20,7 @@ import com.gogirl.infrastructure.common.exception.RRException;
import com.gogirl.infrastructure.common.util.ListUtil; import com.gogirl.infrastructure.common.util.ListUtil;
import com.gogirl.infrastructure.config.GogirlProperties; import com.gogirl.infrastructure.config.GogirlProperties;
import com.gogirl.infrastructure.feign.wx.WxPayControllerFeign; import com.gogirl.infrastructure.feign.wx.WxPayControllerFeign;
import com.gogirl.infrastructure.mapper.market.discount.DiscountConfigMapper;
import com.gogirl.infrastructure.mapper.market.timescard.TimesCardCustomerRelevanceMapper; import com.gogirl.infrastructure.mapper.market.timescard.TimesCardCustomerRelevanceMapper;
import com.gogirl.infrastructure.mapper.market.timescard.TimesCardTypeContentMapper; import com.gogirl.infrastructure.mapper.market.timescard.TimesCardTypeContentMapper;
import com.gogirl.infrastructure.mapper.market.timescard.TimesCardTypeMapper; import com.gogirl.infrastructure.mapper.market.timescard.TimesCardTypeMapper;
...@@ -150,6 +151,8 @@ public class TimesCardController { ...@@ -150,6 +151,8 @@ public class TimesCardController {
return JsonResult.success(timesCardCustomerRelevance); return JsonResult.success(timesCardCustomerRelevance);
} }
private final DiscountConfigMapper discountConfigMapper;
@ApiOperation(value = "根据订单号查询我的可用的次卡") @ApiOperation(value = "根据订单号查询我的可用的次卡")
@GetMapping("/customer/timescard/getMyTimesCardByOrderId") @GetMapping("/customer/timescard/getMyTimesCardByOrderId")
public JsonResult<List<TimesCardCustomerRelevance>> getMyTimesCardByOrderId(@RequestHeader String token, public JsonResult<List<TimesCardCustomerRelevance>> getMyTimesCardByOrderId(@RequestHeader String token,
...@@ -169,10 +172,24 @@ public class TimesCardController { ...@@ -169,10 +172,24 @@ public class TimesCardController {
//次卡可以作用的服务 //次卡可以作用的服务
List<Integer> canUserServeIds = timesCardCustomerRelevanceMapper.queryTimesCardServeIds(timesCardCustomerRelevance.getCardTypeId()); List<Integer> canUserServeIds = timesCardCustomerRelevanceMapper.queryTimesCardServeIds(timesCardCustomerRelevance.getCardTypeId());
//可用服务与当前服务交集 //可用服务与当前服务交集
canUserServeIds.retainAll(orderServeList.stream().map(OrderServe::getServeId).collect(Collectors.toList())); canUserServeIds.retainAll(orderServeList.stream()
.map(OrderServe::getServeId)
.collect(Collectors.toList()));
//不为空 //不为空
return ListUtil.isNotEmpty(canUserServeIds); return ListUtil.isNotEmpty(canUserServeIds);
}) })
.peek(timesCardCustomerRelevance -> {
List<Integer> canUserServeIds = timesCardCustomerRelevanceMapper.queryTimesCardServeIds(timesCardCustomerRelevance.getCardTypeId());
canUserServeIds.retainAll(orderServeList.stream()
.filter(orderServe -> orderServe.getBindCoupon() == 2)
.filter(orderServe -> orderServe.getProduceCurrentPrice().compareTo(orderServe.getProduceBargainPrice()) > -1)
.filter(orderServe -> orderServe.getProducePromotionTimeId() == null)
.filter(orderServe -> orderServe.getLeisureDiscountConfigId() == null || orderServe.getLeisureDiscountConfigId() == 0)
.map(OrderServe::getServeId)
.collect(Collectors.toList()));
timesCardCustomerRelevance.setCanBeUse(ListUtil.isNotEmpty(canUserServeIds));
})
.collect(Collectors.toList()); .collect(Collectors.toList());
return JsonResult.success(timesCardCustomerRelevanceList); return JsonResult.success(timesCardCustomerRelevanceList);
} }
......
...@@ -108,4 +108,6 @@ public class OrderServeDTO { ...@@ -108,4 +108,6 @@ public class OrderServeDTO {
private Integer actualServeDuration; private Integer actualServeDuration;
private Integer bindCoupon;
} }
...@@ -14,5 +14,5 @@ public class MyMallShoppingCartDTO { ...@@ -14,5 +14,5 @@ public class MyMallShoppingCartDTO {
private Integer itemSum; private Integer itemSum;
private List<MallShoppingCart> mallShoppingCartDTOList; private List<MallShoppingCartDTO> mallShoppingCartDTOList;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment