Commit 5cd3cff9 by 吕明尚

Merge branch 'refs/heads/dev' into test

parents f0c09e84 241901b0
......@@ -2342,7 +2342,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
activity = activityService.getOne(queryWrapper);
totalFee = getBigDecimal(request, activity, payPrice, user, consumerMember);
// priceResponse.setTotalFeeNow(totalFee);
priceResponse.setDiscount(totalFee.divide(payPrice).multiply(new BigDecimal(100)));
priceResponse.setDiscount(totalFee.divide(payPrice, 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)));
totalFee = getBigDecimal(consumerWallet, activity, timeLong, priceResponse, totalFee, room, request, consumerMember);
}
} else {
......@@ -2357,7 +2357,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
totalFee = getBigDecimal(request, activity, payPrice, user, consumerMember);
priceResponse.setTotalFeeNow(totalFee);
priceResponse.setMemberDiscount(payPrice.subtract(totalFee));
priceResponse.setDiscount(totalFee.divide(payPrice).multiply(new BigDecimal(100)));
priceResponse.setDiscount(totalFee.divide(payPrice, 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)));
totalFee = getBigDecimal(consumerWallet, activity, timeLong, priceResponse, totalFee, byId, request);
}
// totalFee = getBigDecimal(consumerWallet, timeLong, priceResponse, totalFee, byId);
......@@ -2371,7 +2371,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
activity = activityService.getOne(queryWrapper);
totalFee = getBigDecimal(request, activity, payPrice, user, consumerMember);
// priceResponse.setTotalFeeNow(totalFee);
priceResponse.setDiscount(totalFee.divide(payPrice).multiply(new BigDecimal(100)));
priceResponse.setDiscount(totalFee.divide(payPrice, 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)));
totalFee = getBigDecimal(consumerWallet, activity, timeLong, priceResponse, totalFee, room, request, consumerMember);
}
// totalFee = getBigDecimal(consumerWallet, timeLong, priceResponse, totalFee, room);
......@@ -2389,7 +2389,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
totalFee = getBigDecimal(request, activity, payPrice, user, consumerMember);
priceResponse.setTotalFeeNow(totalFee);
priceResponse.setMemberDiscount(payPrice.subtract(totalFee));
priceResponse.setDiscount(totalFee.divide(payPrice).multiply(new BigDecimal(100)));
priceResponse.setDiscount(totalFee.divide(payPrice, 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)));
totalFee = getBigDecimal(consumerWallet, activity, timeLong, priceResponse, totalFee, byId, request);
}
......@@ -2500,7 +2500,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
priceResponse.setDuration(consumerWallet.getRemainingDuration());
priceResponse.setRemainingDuration(new BigDecimal(0));
BigDecimal remainingBalance = consumerWallet.getRemainingDuration().multiply(room.getPrice());
totalFee = totalFee.divide(memberConfig.getDiscountRatio()).multiply(new BigDecimal(100));
totalFee = totalFee.divide(memberConfig.getDiscountRatio(), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
remainingBalance = totalFee.subtract(remainingBalance);
BigDecimal divide = remainingBalance;
divide = divide.multiply(memberConfig.getDiscountRatio()).divide(new BigDecimal(100));
......@@ -2527,7 +2527,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
//时长的金额
BigDecimal remainingBalance = consumerWallet.getRemainingDuration().multiply(room.getPrice());
//恢复原价
totalFee = totalFee.divide(memberConfig.getDiscountRatio()).multiply(new BigDecimal(100));
totalFee = totalFee.divide(memberConfig.getDiscountRatio(), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
//原价减时长
remainingBalance = totalFee.subtract(remainingBalance);
BigDecimal divide = remainingBalance;
......@@ -2629,10 +2629,10 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
boolean match = executionTime.isMatch(ZonedDateTime.ofInstant(request.getPreStartDate().toInstant(), ZoneId.systemDefault()));
boolean match1 = executionTime.isMatch(ZonedDateTime.ofInstant(request.getPreEndDate().toInstant(), ZoneId.systemDefault()));
if (match && match1) {
payPrice = payPrice.multiply(activity.getDiscountRatio()).divide(new BigDecimal(100));
payPrice = payPrice.multiply(activity.getDiscountRatio()).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
} else {
payPrice = payPrice.multiply(memberConfig.getDiscountRatio()).divide(new BigDecimal(100));
payPrice = payPrice.multiply(memberConfig.getDiscountRatio()).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
}
} else {
AtomicInteger i = new AtomicInteger();
......@@ -2641,7 +2641,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
boolean match1 = executionTime.isMatch(ZonedDateTime.ofInstant(item.getPreEndDate().toInstant(), ZoneId.systemDefault()));
if (match && match1
&& item.getDuration().compareTo(BigDecimal.ZERO) == 0
&& (item.getPayPrice().add(item.getBalance())).divide(item.getTotalPrice()).multiply(new BigDecimal(100)).compareTo(activity.getDiscountRatio()) == 0
&& (item.getPayPrice().add(item.getBalance())).divide(item.getTotalPrice(), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)).compareTo(activity.getDiscountRatio()) == 0
) {
i.getAndIncrement();
}
......@@ -2650,17 +2650,17 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
boolean match = executionTime.isMatch(ZonedDateTime.ofInstant(request.getPreStartDate().toInstant(), ZoneId.systemDefault()));
boolean match1 = executionTime.isMatch(ZonedDateTime.ofInstant(request.getPreEndDate().toInstant(), ZoneId.systemDefault()));
if (match && match1) {
payPrice = payPrice.multiply(activity.getDiscountRatio()).divide(new BigDecimal(100));
payPrice = payPrice.multiply(activity.getDiscountRatio()).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
} else {
payPrice = payPrice.multiply(memberConfig.getDiscountRatio()).divide(new BigDecimal(100));
payPrice = payPrice.multiply(memberConfig.getDiscountRatio()).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
}
// payPrice = payPrice.multiply(activity.getDiscountRatio()).divide(new BigDecimal(100));
} else {
payPrice = payPrice.multiply(memberConfig.getDiscountRatio()).divide(new BigDecimal(100));
payPrice = payPrice.multiply(memberConfig.getDiscountRatio()).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
}
}
} else {
payPrice = payPrice.multiply(memberConfig.getDiscountRatio()).divide(new BigDecimal(100));
payPrice = payPrice.multiply(memberConfig.getDiscountRatio()).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
}
}
return payPrice;
......
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