|
@@ -29,16 +29,20 @@ public class OrderCloseEventHandler implements AwoaraEventHandler<OrderInfoObjec
|
|
|
private final StationAccountService stationAccountService;
|
|
private final StationAccountService stationAccountService;
|
|
|
private final SplitRecordService splitRecordService;
|
|
private final SplitRecordService splitRecordService;
|
|
|
|
|
|
|
|
|
|
+ private final MpMsgTemplateService mpMsgTemplateService;
|
|
|
|
|
+
|
|
|
private final StationAccountRecordService stationAccountRecordService;
|
|
private final StationAccountRecordService stationAccountRecordService;
|
|
|
|
|
|
|
|
public OrderCloseEventHandler(WashOrderService washOrderService, WalletDetailService walletDetailService,
|
|
public OrderCloseEventHandler(WashOrderService washOrderService, WalletDetailService walletDetailService,
|
|
|
AccountService accountService, StationAccountService stationAccountService,
|
|
AccountService accountService, StationAccountService stationAccountService,
|
|
|
- SplitRecordService splitRecordService, StationAccountRecordService stationAccountRecordService) {
|
|
|
|
|
|
|
+ SplitRecordService splitRecordService,
|
|
|
|
|
+ StationAccountRecordService stationAccountRecordService, MpMsgTemplateService mpMsgTemplateService) {
|
|
|
this.washOrderService = washOrderService;
|
|
this.washOrderService = washOrderService;
|
|
|
this.walletDetailService = walletDetailService;
|
|
this.walletDetailService = walletDetailService;
|
|
|
this.accountService = accountService;
|
|
this.accountService = accountService;
|
|
|
this.stationAccountService = stationAccountService;
|
|
this.stationAccountService = stationAccountService;
|
|
|
this.splitRecordService = splitRecordService;
|
|
this.splitRecordService = splitRecordService;
|
|
|
|
|
+ this.mpMsgTemplateService = mpMsgTemplateService;
|
|
|
this.stationAccountRecordService = stationAccountRecordService;
|
|
this.stationAccountRecordService = stationAccountRecordService;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -132,7 +136,8 @@ public class OrderCloseEventHandler implements AwoaraEventHandler<OrderInfoObjec
|
|
|
// 扣费等资金操作
|
|
// 扣费等资金操作
|
|
|
deductions(washOrder, account);
|
|
deductions(washOrder, account);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // 发送公众号消息
|
|
|
|
|
+ mpMsgTemplateService.sendOrderCompletedMsg(washOrder, account.getBalance());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -171,9 +176,9 @@ public class OrderCloseEventHandler implements AwoaraEventHandler<OrderInfoObjec
|
|
|
BigDecimal consumeRate = BigDecimal.valueOf(0.3);
|
|
BigDecimal consumeRate = BigDecimal.valueOf(0.3);
|
|
|
|
|
|
|
|
// 平台技术服务费10%
|
|
// 平台技术服务费10%
|
|
|
- var platformAmount = amount * platformRate.intValueExact();
|
|
|
|
|
|
|
+ var platformAmount = platformRate.multiply(BigDecimal.valueOf(amount)).intValue();
|
|
|
// 解冻金额
|
|
// 解冻金额
|
|
|
- var unfreezeAmount = amount * consumeRate.intValueExact();
|
|
|
|
|
|
|
+ var unfreezeAmount = consumeRate.multiply(BigDecimal.valueOf(amount)).intValue();
|
|
|
|
|
|
|
|
int localAmount = unfreezeAmount - platformAmount;
|
|
int localAmount = unfreezeAmount - platformAmount;
|
|
|
|
|
|
|
@@ -261,7 +266,8 @@ public class OrderCloseEventHandler implements AwoaraEventHandler<OrderInfoObjec
|
|
|
BigDecimal crossRate = BigDecimal.valueOf(0.7);
|
|
BigDecimal crossRate = BigDecimal.valueOf(0.7);
|
|
|
|
|
|
|
|
// 平台技术服务费10%
|
|
// 平台技术服务费10%
|
|
|
- var platformAmount = amount * platformRate.intValueExact();;
|
|
|
|
|
|
|
+ var platformAmount = amount * platformRate.intValueExact();
|
|
|
|
|
+ ;
|
|
|
|
|
|
|
|
// 解冻金额 = 订单金额
|
|
// 解冻金额 = 订单金额
|
|
|
var unfreezeAmount = amount;
|
|
var unfreezeAmount = amount;
|