Commit 34c64a98 by 吕明尚

计算订单接口增加字段

parent 6753c950
......@@ -2220,6 +2220,11 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
BigDecimal timeLong = DateUtils.differentHour(request.getPreStartDate(), request.getPreEndDate());
// 计算各种价格
ComputedOrderPriceResponse priceResponse = new ComputedOrderPriceResponse();
priceResponse.setBalance(BigDecimal.ZERO);
priceResponse.setRemainingBalance(BigDecimal.ZERO);
priceResponse.setDuration(BigDecimal.ZERO);
priceResponse.setRemainingDuration(BigDecimal.ZERO);
priceResponse.setDiscount(BigDecimal.ZERO);
Activity activity = null;
ConsumerMember consumerMember = null;
ConsumerWallet consumerWallet = null;
......@@ -2240,6 +2245,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
RoomLabel roomLabel = roomLabelService.selectRoomLabelById(request.getRoomLabelId());
if (ObjectUtils.isEmpty(roomLabel.getPackId())) {
payPrice = totalPrice;
priceResponse.setTotalFeeNow(payPrice);
request.setBuyType(BuyTypeEnum.TIME.getCode());
if (ObjectUtil.isNotEmpty(consumerMember)) {
queryWrapper.eq(Activity::getLabelId, roomLabel.getLabelId());
......@@ -2253,6 +2259,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
SPack byId = packService.getById(roomLabel.getPackId());
if (!ObjectUtils.isEmpty(byId) && byId.getIsOpen().equals(YesNoEnum.yes.getIndex())) {
payPrice = computeTotalPrice(roomLabel.getPackId(), totalPrice);
priceResponse.setTotalFeeNow(payPrice);
request.setBuyType(BuyTypeEnum.PACK.getCode());
if (ObjectUtil.isNotEmpty(consumerMember)) {
queryWrapper.eq(Activity::getPackId, roomLabel.getPackId());
......@@ -2265,6 +2272,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
totalFee = getBigDecimal(consumerWallet, activity, timeLong, priceResponse, totalFee, byId, request);
} else {
payPrice = totalPrice;
priceResponse.setTotalFeeNow(payPrice);
request.setBuyType(BuyTypeEnum.TIME.getCode());
if (ObjectUtil.isNotEmpty(consumerMember)) {
queryWrapper.eq(Activity::getLabelId, roomLabel.getLabelId());
......@@ -2280,6 +2288,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
} else if (!ObjectUtils.isEmpty(request.getPackId())) {
SPack byId = packService.getById(request.getPackId());
payPrice = computeTotalPrice(request.getPackId(), totalPrice);
priceResponse.setTotalFeeNow(payPrice);
request.setBuyType(BuyTypeEnum.PACK.getCode());
if (ObjectUtil.isNotEmpty(consumerMember)) {
queryWrapper.eq(Activity::getPackId, request.getPackId());
......
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