Commit 1d85d45a by 吕明尚

Merge branch 'refs/heads/dev' into test

parents b55b3015 f466f1ec
......@@ -2370,6 +2370,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
RoomLabel roomLabel = roomLabelService.selectRoomLabelById(request.getRoomLabelId());
if (ObjectUtils.isEmpty(roomLabel.getPackId())) {
payPrice = totalPrice;
priceResponse.setTotalFee(payPrice);
priceResponse.setTotalFeeNow(payPrice);
request.setBuyType(BuyTypeEnum.TIME.getCode());
if (ObjectUtil.isNotEmpty(consumerMember)) {
......@@ -2386,6 +2387,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.setTotalFee(payPrice);
priceResponse.setTotalFeeNow(payPrice);
request.setBuyType(BuyTypeEnum.PACK.getCode());
if (ObjectUtil.isNotEmpty(consumerMember)) {
......@@ -2401,6 +2403,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
} else {
payPrice = totalPrice;
priceResponse.setTotalFee(payPrice);
priceResponse.setTotalFeeNow(payPrice);
request.setBuyType(BuyTypeEnum.TIME.getCode());
if (ObjectUtil.isNotEmpty(consumerMember)) {
......@@ -2419,6 +2422,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.setTotalFee(payPrice);
priceResponse.setTotalFeeNow(payPrice);
request.setBuyType(BuyTypeEnum.PACK.getCode());
if (ObjectUtil.isNotEmpty(consumerMember)) {
......@@ -2494,6 +2498,11 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
priceResponse.setPayFee(totalFee);
}
if (ObjectUtil.isEmpty(consumerWallet) && ObjectUtil.isNotEmpty(consumerMember)) {
priceResponse.setTotalFeeNow(priceResponse.getPayFee());
priceResponse.setMemberDiscount(priceResponse.getTotalFee().subtract(priceResponse.getPayFee()));
}
}
}
priceResponse.setDiscountFee(priceResponse.getTotalFee().subtract(priceResponse.getPayFee()));
......@@ -2536,6 +2545,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
priceResponse.setDuration(timeLong);
priceResponse.setRemainingDuration(consumerWallet.getRemainingDuration().subtract(timeLong));
totalFee = new BigDecimal(0);
priceResponse.setMemberDiscount(new BigDecimal(0.00));
priceResponse.setTotalFeeNow(priceResponse.getTotalFee());
} else if (consumerWallet.getRemainingDuration().compareTo(timeLong) < 0) {
priceResponse.setDuration(consumerWallet.getRemainingDuration());
priceResponse.setRemainingDuration(new BigDecimal(0));
......@@ -2561,6 +2572,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
priceResponse.setDuration(timeLong);
priceResponse.setRemainingDuration(consumerWallet.getRemainingDuration().subtract(timeLong));
totalFee = new BigDecimal(0);
priceResponse.setMemberDiscount(new BigDecimal(0.00));
priceResponse.setTotalFeeNow(priceResponse.getTotalFee());
} else if (consumerWallet.getRemainingDuration().compareTo(timeLong) < 0) {
priceResponse.setDuration(consumerWallet.getRemainingDuration());
priceResponse.setRemainingDuration(new BigDecimal(0));
......@@ -2616,11 +2629,13 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
} else {
if (consumerWallet.getRemainingDuration().compareTo(timeLong) >= 0) {
priceResponse.setMemberDiscount(new BigDecimal(0.00));
priceResponse.setTotalFeeNow(byId.getPrice());
priceResponse.setDuration(timeLong);
priceResponse.setRemainingDuration(consumerWallet.getRemainingDuration().subtract(timeLong));
totalFee = new BigDecimal(0);
} else if (consumerWallet.getRemainingDuration().compareTo(timeLong) < 0) {
priceResponse.setMemberDiscount(priceResponse.getTotalFeeNow().subtract(totalFee));
priceResponse.setMemberDiscount(priceResponse.getTotalFee().subtract(totalFee));
priceResponse.setTotalFeeNow(totalFee);
if (consumerWallet.getBalance().compareTo(priceResponse.getTotalFeeNow()) >= 0) {
priceResponse.setBalance(priceResponse.getTotalFeeNow());
......@@ -2638,8 +2653,10 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
priceResponse.setDuration(timeLong);
priceResponse.setRemainingDuration(consumerWallet.getRemainingDuration().subtract(timeLong));
totalFee = new BigDecimal(0);
priceResponse.setMemberDiscount(new BigDecimal(0.00));
priceResponse.setTotalFeeNow(byId.getPrice());
} else if (consumerWallet.getRemainingDuration().compareTo(timeLong) < 0) {
priceResponse.setMemberDiscount(priceResponse.getTotalFeeNow().subtract(totalFee));
priceResponse.setMemberDiscount(priceResponse.getTotalFee().subtract(totalFee));
priceResponse.setTotalFeeNow(totalFee);
if (consumerWallet.getBalance().compareTo(priceResponse.getTotalFeeNow()) >= 0) {
priceResponse.setBalance(priceResponse.getTotalFeeNow());
......
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