|
@@ -567,6 +567,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
TenantContextHolder.clearTenantId();
|
|
|
}
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean confirmOrder(StudentPaymentOrder order) {
|
|
|
// 只有大雅延迟分账,其他实时分账
|
|
|
if (order.getTenantId() != 1) {
|
|
@@ -652,28 +653,31 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
BigDecimal splitAmount = new BigDecimal(orderInfo.get("unSplitAmount").toString());
|
|
|
|
|
|
- Map<String, String> divides = new HashMap<String, String>();
|
|
|
-
|
|
|
BigDecimal divideAmount = BigDecimal.ZERO;
|
|
|
BigDecimal dividedAmount = BigDecimal.ZERO;
|
|
|
+ List<Map<String,String>> divides = new ArrayList<Map<String,String>>();
|
|
|
for (int i = 0; i < routeOrders.size(); i++) {
|
|
|
|
|
|
studentPaymentRouteOrder = routeOrders.get(i);
|
|
|
+
|
|
|
+ Map<String, String> divide = new HashMap<String, String>();
|
|
|
|
|
|
- divides.put("ledgerNo", studentPaymentRouteOrder.getMerNo());
|
|
|
+ divide.put("ledgerNo", studentPaymentRouteOrder.getMerNo());
|
|
|
|
|
|
if (i + 1 == routeOrders.size()) {
|
|
|
divideAmount = splitAmount.subtract(dividedAmount);
|
|
|
- divides.put("amount", divideAmount.toPlainString());
|
|
|
+ divide.put("amount", divideAmount.toPlainString());
|
|
|
} else {
|
|
|
divideAmount = studentPaymentRouteOrder.getRouteAmount().multiply(splitAmount).divide(order.getActualAmount(), 2,
|
|
|
BigDecimal.ROUND_HALF_UP);
|
|
|
- divides.put("amount", divideAmount.toPlainString());
|
|
|
+ divide.put("amount", divideAmount.toPlainString());
|
|
|
}
|
|
|
dividedAmount = dividedAmount.add(divideAmount);
|
|
|
|
|
|
studentPaymentRouteOrder.setServiceFee(studentPaymentRouteOrder.getRouteAmount().subtract(divideAmount));
|
|
|
studentPaymentRouteOrder.setUpdateTime(date);
|
|
|
+
|
|
|
+ divides.add(divide);
|
|
|
}
|
|
|
params.put("divideDetail", JSON.toJSONString(divides));
|
|
|
|