|
@@ -46,7 +46,7 @@ public class SplitAccountService {
|
|
|
List<OrderReceiptRelationPo> onlineRelations = newOrderDao.getOnlineBalance(currentTime);
|
|
|
if (null != onlineRelations && orderRelations.size() > 0) {
|
|
|
// 过滤不足分账金额的单
|
|
|
- onlineRelations.removeIf(o -> o.getAssociateAmount() < 0.01);
|
|
|
+// onlineRelations.removeIf(o -> o.getAssociateAmount() < 0.01);
|
|
|
// 把线上余额抵扣订单加入分账
|
|
|
orderRelations.addAll(onlineRelations);
|
|
|
}
|
|
@@ -94,7 +94,7 @@ public class SplitAccountService {
|
|
|
addMaps(maps, totalAmount2, PayUtil.privateAccountNo);
|
|
|
addMaps(maps, totalAmount3, PayUtil.commonInvoiceNo);
|
|
|
// 网络
|
|
|
- addMaps(maps, totalAmount4, PayUtil.brokerage);
|
|
|
+ addMaps(maps, totalAmount4, PayUtil.brokerage);
|
|
|
// addMaps(maps, totalAmount4, PayUtil.publicAccountNo);
|
|
|
String parameters = JSON.toJSONString(maps);
|
|
|
logger.info("【手动分账】>>>>>>>>>>分账参数: " + parameters);
|
|
@@ -188,18 +188,18 @@ public class SplitAccountService {
|
|
|
}
|
|
|
// 判断是否支付过
|
|
|
Double paidAmount = newOrderDao.getOrderProductPaidAmount(orderProduct.getOrderProductId());
|
|
|
- if (paidAmount != null && MathUtil.compare(paidAmount, 0) > 0) {
|
|
|
+ //有已付
|
|
|
+ if (null != paidAmount && MathUtil.compare(paidAmount, 0) > 0) {
|
|
|
+ //已付>0,成本-已付
|
|
|
costPrice = MathUtil.sub(costPrice, paidAmount).doubleValue();
|
|
|
- splitAmount = MathUtil.sub(splitAmount, costPrice).doubleValue();
|
|
|
}
|
|
|
- if (paidAmount == null || MathUtil.compare(paidAmount, costPrice) < 0) {
|
|
|
- // 待分账金额>=本次待分账金额
|
|
|
- if (MathUtil.compare(splitAmount, costPrice) > 0) {
|
|
|
- splitAmount = MathUtil.sub(splitAmount, costPrice).doubleValue();
|
|
|
- } else {
|
|
|
- costPrice = splitAmount;
|
|
|
- splitAmount = 0.00;
|
|
|
- }
|
|
|
+ // 待分账金额>成本
|
|
|
+ if (MathUtil.compare(splitAmount, costPrice) > 0) {
|
|
|
+ // 待分账金额-成本
|
|
|
+ splitAmount = MathUtil.sub(splitAmount, costPrice).doubleValue();
|
|
|
+ } else {
|
|
|
+ costPrice = splitAmount;
|
|
|
+ splitAmount = 0.00;
|
|
|
}
|
|
|
if (costPrice > 0) {
|
|
|
SplitAccountPo splitAccount = new SplitAccountPo();
|