|
|
@@ -153,7 +153,7 @@ public class OrderCloseEventHandler implements AwoaraEventHandler<OrderInfoObjec
|
|
|
* @param stationId 用户归属的站点Id
|
|
|
*/
|
|
|
private void doCrossSplit(WashOrder washOrder, String stationId) {
|
|
|
- var investorAccount = stationAccountService.getStationAccount(washOrder.getStationId());
|
|
|
+ var stationAccount = stationAccountService.getStationAccount(washOrder.getStationId());
|
|
|
var splitAmount = (int) (washOrder.getAmount() * (0.3 - 0.1));
|
|
|
var localAmount = (int) (splitAmount * 0.7);
|
|
|
var crossAmount = splitAmount - localAmount;
|
|
|
@@ -161,33 +161,33 @@ public class OrderCloseEventHandler implements AwoaraEventHandler<OrderInfoObjec
|
|
|
// 当前消费站点收入(跨店消费,原充值站点要分订单的70%)
|
|
|
stationAccountService.lambdaUpdate()
|
|
|
.setSql("balance = balance + {0}", crossAmount)
|
|
|
- .eq(StationAccount::getId, investorAccount.getId())
|
|
|
+ .eq(StationAccount::getId, stationAccount.getId())
|
|
|
.update();
|
|
|
|
|
|
// // 充值站点收入
|
|
|
// stationAccountService.lambdaUpdate()
|
|
|
// .setSql("balance = balance + {0}, frozen_amount = frozen_amount - {1}", localAmount, splitAmount)
|
|
|
-// .eq(InvestorAccount::getId, investorAccount.getId())
|
|
|
+// .eq(InvestorAccount::getId, stationAccount.getId())
|
|
|
// .update();
|
|
|
//
|
|
|
// // 充值站点支出
|
|
|
// stationAccountService.lambdaUpdate()
|
|
|
// .setSql("balance = balance - {0}", crossAmount)
|
|
|
-// .eq(InvestorAccount::getId, investorAccount.getId())
|
|
|
+// .eq(InvestorAccount::getId, stationAccount.getId())
|
|
|
// .update();
|
|
|
|
|
|
// 以上充值站点的两次操作进行合并
|
|
|
// 充值站点收入
|
|
|
stationAccountService.lambdaUpdate()
|
|
|
.setSql("balance = balance + {0}, frozen_amount = frozen_amount - {1}", localAmount - crossAmount, splitAmount)
|
|
|
- .eq(StationAccount::getId, investorAccount.getId())
|
|
|
+ .eq(StationAccount::getId, stationAccount.getId())
|
|
|
.update();
|
|
|
|
|
|
|
|
|
// t_split_record 1.消费站点收入 2.归属站点收入 3.充值站点支出
|
|
|
var splitRecord1 = new SplitRecord()
|
|
|
.setFromStationId(stationId)
|
|
|
- .setToStationId(investorAccount.getStationId())
|
|
|
+ .setToStationId(stationAccount.getStationId())
|
|
|
.setTradeNo(washOrder.getOrderId())
|
|
|
.setAmount(crossAmount)
|
|
|
.setType(SplitRecord.TYPE_CONSUME);
|
|
|
@@ -200,8 +200,8 @@ public class OrderCloseEventHandler implements AwoaraEventHandler<OrderInfoObjec
|
|
|
.setType(SplitRecord.TYPE_CONSUME);
|
|
|
|
|
|
var splitRecord3 = new SplitRecord()
|
|
|
- .setFromStationId(investorAccount.getStationId())
|
|
|
- .setToStationId(investorAccount.getStationId())
|
|
|
+ .setFromStationId(stationAccount.getStationId())
|
|
|
+ .setToStationId(stationAccount.getStationId())
|
|
|
.setTradeNo(washOrder.getOrderId())
|
|
|
.setAmount(splitAmount)
|
|
|
.setType(SplitRecord.TYPE_UNFREEZE);
|