Commit 5582a7e9 by 吕明尚

修改订单计算

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