Commit 5582a7e9 by 吕明尚

修改订单计算

parent 3b651c63
......@@ -1007,7 +1007,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if (sOrder.getOrderType().equals(OrderTypeEnum.RESERVER.getCode())) {
new Thread(() -> {
try {
// 这里设置你的延迟时间,例如5秒
Thread.sleep(1000);
redisUtil.set(ReceiptRdeisEnum.ORDER_NO.getValue() + sOrder.getOrderNo(), jsonObject.toString());
} catch (InterruptedException e) {
......@@ -1900,7 +1899,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
JSONObject jsonObject = new JSONObject(map);
new Thread(() -> {
try {
// 这里设置你的延迟时间,例如5秒
Thread.sleep(1000);
redisUtil.set(ReceiptRdeisEnum.ORDER_NO_KEY.getValue() + sOrder.getOrderNo(), jsonObject.toString());
} catch (InterruptedException e) {
......@@ -1914,7 +1912,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
JSONObject jsonObject = new JSONObject(map);
new Thread(() -> {
try {
// 这里设置你的延迟时间,例如5秒
Thread.sleep(1000);
redisUtil.set(ReceiptRdeisEnum.ORDER_NO.getValue() + sOrder.getOrderNo(), jsonObject.toString());
} catch (InterruptedException e) {
......@@ -2270,7 +2267,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
JSONObject jsonObject = new JSONObject(map);
new Thread(() -> {
try {
// 这里设置你的延迟时间,例如5秒
Thread.sleep(1000);
redisUtil.set(ReceiptRdeisEnum.ORDER_NO_KEY.getValue() + sOrder.getOrderNo(), jsonObject.toString());
} catch (InterruptedException e) {
......@@ -2380,6 +2376,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
queryWrapper.eq(Activity::getLabelId, roomLabel.getLabelId());
activity = activityService.getOne(queryWrapper);
totalFee = getBigDecimal(request, activity, payPrice, user, consumerMember);
priceResponse.setTotalFeeNow(totalFee);
priceResponse.setMemberDiscount(payPrice.subtract(totalFee));
// priceResponse.setTotalFeeNow(totalFee);
priceResponse.setDiscount(totalFee.divide(payPrice, 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)));
totalFee = getBigDecimal(consumerWallet, activity, timeLong, priceResponse, totalFee, room, request, consumerMember);
......@@ -2394,8 +2392,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
queryWrapper.eq(Activity::getPackId, roomLabel.getPackId());
activity = activityService.getOne(queryWrapper);
totalFee = getBigDecimal(request, activity, payPrice, user, consumerMember);
// priceResponse.setTotalFeeNow(totalFee);
// priceResponse.setMemberDiscount(payPrice.subtract(totalFee));
priceResponse.setTotalFeeNow(totalFee);
priceResponse.setMemberDiscount(payPrice.subtract(totalFee));
priceResponse.setDiscount(totalFee.divide(payPrice, 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)));
totalFee = getBigDecimal(consumerWallet, activity, timeLong, priceResponse, totalFee, byId, request);
}
......@@ -2409,7 +2407,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
queryWrapper.eq(Activity::getLabelId, roomLabel.getLabelId());
activity = activityService.getOne(queryWrapper);
totalFee = getBigDecimal(request, activity, payPrice, user, consumerMember);
// priceResponse.setTotalFeeNow(totalFee);
priceResponse.setTotalFeeNow(totalFee);
priceResponse.setMemberDiscount(payPrice.subtract(totalFee));
priceResponse.setDiscount(totalFee.divide(payPrice, 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)));
totalFee = getBigDecimal(consumerWallet, activity, timeLong, priceResponse, totalFee, room, request, consumerMember);
}
......@@ -2426,8 +2425,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
queryWrapper.eq(Activity::getPackId, request.getPackId());
activity = activityService.getOne(queryWrapper);
totalFee = getBigDecimal(request, activity, payPrice, user, consumerMember);
// priceResponse.setTotalFeeNow(totalFee);
// priceResponse.setMemberDiscount(payPrice.subtract(totalFee));
priceResponse.setTotalFeeNow(totalFee);
priceResponse.setMemberDiscount(payPrice.subtract(totalFee));
priceResponse.setDiscount(totalFee.divide(payPrice, 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)));
totalFee = getBigDecimal(consumerWallet, activity, timeLong, priceResponse, totalFee, byId, request);
}
......
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