lisai17@sina.com 2021-03-17 10:40:30 +08:00
parent 00b77bf063
commit 0c117fc0de
1 changed files with 18 additions and 4 deletions

View File

@ -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) {