|
@@ -125,7 +125,6 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 订单支付,余额抵扣
|
|
* 订单支付,余额抵扣
|
|
*
|
|
*
|
|
@@ -852,16 +851,16 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
// 可用余额=之前的可用+充值
|
|
// 可用余额=之前的可用+充值
|
|
double availableMoney = MathUtil.add(oldAvailableMoney, amount).doubleValue();
|
|
double availableMoney = MathUtil.add(oldAvailableMoney, amount).doubleValue();
|
|
//充值线上余额
|
|
//充值线上余额
|
|
- payOrderMapper.updateUserMoney(userMoney, availableMoney, order.getUserId());
|
|
|
|
|
|
+ payOrderMapper.updateOnlineMoneyByUserId(userMoney, availableMoney, order.getUserId());
|
|
log.info("【支付异步回调】>>>>>>>>>>>更新用户余额(update[user])userId:" + order.getUserId() + ",orderId:" + orderId);
|
|
log.info("【支付异步回调】>>>>>>>>>>>更新用户余额(update[user])userId:" + order.getUserId() + ",orderId:" + orderId);
|
|
//保存余额到余额收支记录
|
|
//保存余额到余额收支记录
|
|
BalanceRecordPo balanceRecord = new BalanceRecordPo();
|
|
BalanceRecordPo balanceRecord = new BalanceRecordPo();
|
|
balanceRecord.setUserId(order.getUserId());
|
|
balanceRecord.setUserId(order.getUserId());
|
|
balanceRecord.setType(1);
|
|
balanceRecord.setType(1);
|
|
if (rechargeFlag == 1) {
|
|
if (rechargeFlag == 1) {
|
|
- balanceRecord.setBalanceType(6);
|
|
|
|
|
|
+ balanceRecord.setBalanceType(16);
|
|
} else {
|
|
} else {
|
|
- balanceRecord.setBalanceType(7);
|
|
|
|
|
|
+ balanceRecord.setBalanceType(17);
|
|
}
|
|
}
|
|
balanceRecord.setAddDate(new Date());
|
|
balanceRecord.setAddDate(new Date());
|
|
balanceRecord.setAmount(amount);
|
|
balanceRecord.setAmount(amount);
|
|
@@ -1015,11 +1014,13 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
List<OrderReceiptRelationPo> orderRelations = payOrderMapper.getUndividedPaidReceipt(currentTime);
|
|
List<OrderReceiptRelationPo> orderRelations = payOrderMapper.getUndividedPaidReceipt(currentTime);
|
|
// 上面过滤了余额抵扣, 把线上余额抵扣单补充到list里面,线上余额抵扣的金额视为正常收款金额进行分账
|
|
// 上面过滤了余额抵扣, 把线上余额抵扣单补充到list里面,线上余额抵扣的金额视为正常收款金额进行分账
|
|
List<OrderReceiptRelationPo> onlineRelations = payOrderMapper.getOnlineBalance(currentTime);
|
|
List<OrderReceiptRelationPo> onlineRelations = payOrderMapper.getOnlineBalance(currentTime);
|
|
- // 过滤不足分账金额的单
|
|
|
|
- onlineRelations.removeIf(o -> o.getAssociateAmount() < 0.01);
|
|
|
|
- // 把线上余额抵扣订单加入分账
|
|
|
|
- orderRelations.addAll(onlineRelations);
|
|
|
|
- if (orderRelations != null && orderRelations.size() > 0) {
|
|
|
|
|
|
+ if (null != onlineRelations && orderRelations.size() > 0) {
|
|
|
|
+ // 过滤不足分账金额的单
|
|
|
|
+ onlineRelations.removeIf(o -> o.getAssociateAmount() < 0.01);
|
|
|
|
+ // 把线上余额抵扣订单加入分账
|
|
|
|
+ orderRelations.addAll(onlineRelations);
|
|
|
|
+ }
|
|
|
|
+ if (null != orderRelations && orderRelations.size() > 0) {
|
|
for (OrderReceiptRelationPo orderRelation : orderRelations) {
|
|
for (OrderReceiptRelationPo orderRelation : orderRelations) {
|
|
log.info("【延时分账】>>>>>>>>>>订单id:" + orderRelation.getOrderId() + ",进入延时分账");
|
|
log.info("【延时分账】>>>>>>>>>>订单id:" + orderRelation.getOrderId() + ",进入延时分账");
|
|
// 收款对应的订单信息
|
|
// 收款对应的订单信息
|
|
@@ -1046,6 +1047,7 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
addMaps(maps, shopTotalAmount, subUserNo);
|
|
addMaps(maps, shopTotalAmount, subUserNo);
|
|
}
|
|
}
|
|
//公账-专票总金额,私账-无票总金额,公账-普票总金额
|
|
//公账-专票总金额,私账-无票总金额,公账-普票总金额
|
|
|
|
+ //todo 佣金进网络
|
|
double totalAmount1 = 0.00;
|
|
double totalAmount1 = 0.00;
|
|
double totalAmount2 = 0.00;
|
|
double totalAmount2 = 0.00;
|
|
double totalAmount3 = 0.00;
|
|
double totalAmount3 = 0.00;
|
|
@@ -1056,9 +1058,6 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
totalAmount2 = MathUtil.add(totalAmount2, account.getSplitAccount()).doubleValue();
|
|
totalAmount2 = MathUtil.add(totalAmount2, account.getSplitAccount()).doubleValue();
|
|
} else if (3 == account.getType()) {
|
|
} else if (3 == account.getType()) {
|
|
totalAmount3 = MathUtil.add(totalAmount3, account.getSplitAccount()).doubleValue();
|
|
totalAmount3 = MathUtil.add(totalAmount3, account.getSplitAccount()).doubleValue();
|
|
- } else if (5 == account.getType()) {
|
|
|
|
- totalAmount = MathUtil.add(totalAmount, account.getSplitAccount());
|
|
|
|
- sp = account.getSubUserNo();
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
addMaps(maps, totalAmount1, PayUtil.publicAccountNo);
|
|
addMaps(maps, totalAmount1, PayUtil.publicAccountNo);
|
|
@@ -1121,7 +1120,7 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
|
|
+ /**todo 佣金要改进入采美网络
|
|
* 分账详情
|
|
* 分账详情
|
|
*/
|
|
*/
|
|
private List<SplitAccountPo> setSplitAccountDetail(OrderVo order, PayParamBo payParam) {
|
|
private List<SplitAccountPo> setSplitAccountDetail(OrderVo order, PayParamBo payParam) {
|