From 0c117fc0dee8ee4353a5f1979fb44f4a263c675c Mon Sep 17 00:00:00 2001 From: "lisai17@sina.com" Date: Wed, 17 Mar 2021 10:40:30 +0800 Subject: [PATCH] . --- .../ordercluster/OrderclusterSyncService.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/order/ordercluster/OrderclusterSyncService.java b/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/order/ordercluster/OrderclusterSyncService.java index 37fc9a2..cba25b3 100644 --- a/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/order/ordercluster/OrderclusterSyncService.java +++ b/ssjygl-xsx-service/src/main/java/com/cowr/service/ssjygl/order/ordercluster/OrderclusterSyncService.java @@ -725,13 +725,27 @@ public class OrderclusterSyncService extends BaseSyncService { BigDecimal undo_price = OrderclusterService.me.undoPrice(oldobj.getCustomerId()); BigDecimal plan_total_price; if (model.getTotalWeight().compareTo(surplus_weight) > 0) { // 修改后,比原来的大 - BigDecimal surplus_weight_1 = model.getTotalWeight().subtract(surplus_weight); // 本次修改增加的重量 - BigDecimal offset_total_price = surplus_weight_1.multiply(oldobj.getUnitPrice()); // 本次修改增加的价格 + BigDecimal ofsset_weight = model.getTotalWeight().subtract(surplus_weight); // 本次修改增加的重量 + BigDecimal offset_total_price = ofsset_weight.multiply(oldobj.getUnitPrice()); // 本次修改增加的价格 plan_total_price = offset_total_price.add(undo_price); // 剩余未完成金额加上本次增加的金额 + + log.debug("已完成:%s", overweight); + log.debug("本单剩余:%s", surplus_weight); + log.debug("本调整:%s", ofsset_weight); + log.debug("本调整总价:%s", offset_total_price); + log.debug("客户未完总价:%s", undo_price); + log.debug("调整后总价:%s", plan_total_price); } else { // 修改后比原来的小 - BigDecimal surplus_weight_1 = surplus_weight.subtract(model.getTotalWeight()); // 本次修改增加的重量 - BigDecimal offset_total_price = surplus_weight_1.multiply(oldobj.getUnitPrice()); // 本次修改增加的价格 + BigDecimal ofsset_weight = surplus_weight.subtract(model.getTotalWeight()); // 本次修改增加的重量 + BigDecimal offset_total_price = ofsset_weight.multiply(oldobj.getUnitPrice()); // 本次修改增加的价格 plan_total_price = undo_price.subtract(offset_total_price); // 剩余未完成金额加上本次增加的金额 + + log.debug("已完成:%s", overweight); + log.debug("本单剩余:%s", surplus_weight); + log.debug("本调整:%s", ofsset_weight); + log.debug("本调整总价:%s", offset_total_price); + log.debug("客户未完总价:%s", undo_price); + log.debug("调整后总价:%s", plan_total_price); } if (plan_total_price.compareTo(prepayCustomer.getSurplus()) > 0) {