Commit 34c64a98 by 吕明尚

计算订单接口增加字段

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