dev
parent
0c117fc0de
commit
1b7d64c620
|
|
@ -707,13 +707,7 @@ public class OrderclusterSyncService extends BaseSyncService {
|
||||||
}
|
}
|
||||||
|
|
||||||
BigDecimal overweight = OrderclusterService.me.getOverWeight(model.getId()); // 集团订单已完成量
|
BigDecimal overweight = OrderclusterService.me.getOverWeight(model.getId()); // 集团订单已完成量
|
||||||
BigDecimal surplus_weight = oldobj.getTotalWeight().subtract(overweight); // 剩余量
|
// BigDecimal surplus_weight = oldobj.getTotalWeight().subtract(overweight); // 剩余量
|
||||||
|
|
||||||
if (model.getTotalWeight().compareTo(overweight) < 0) {
|
|
||||||
return Result.failedstr("总量不能低于已运输量(%.2f)", overweight);
|
|
||||||
} else {
|
|
||||||
oldobj.setTotalWeight(model.getTotalWeight());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (oldobj.getCustomerId() != null) {
|
if (oldobj.getCustomerId() != null) {
|
||||||
PrepayCustomer prepayCustomer = PrepayCustomerService.me.getPrepayCustomer(oldobj.getCustomerId());
|
PrepayCustomer prepayCustomer = PrepayCustomerService.me.getPrepayCustomer(oldobj.getCustomerId());
|
||||||
|
|
@ -724,24 +718,24 @@ public class OrderclusterSyncService extends BaseSyncService {
|
||||||
// 客户在所有砂站的未完成的配额中,未执行完成的总金额
|
// 客户在所有砂站的未完成的配额中,未执行完成的总金额
|
||||||
BigDecimal undo_price = OrderclusterService.me.undoPrice(oldobj.getCustomerId());
|
BigDecimal undo_price = OrderclusterService.me.undoPrice(oldobj.getCustomerId());
|
||||||
BigDecimal plan_total_price;
|
BigDecimal plan_total_price;
|
||||||
if (model.getTotalWeight().compareTo(surplus_weight) > 0) { // 修改后,比原来的大
|
if (model.getTotalWeight().compareTo(oldobj.getTotalWeight()) > 0) { // 修改后,比原来的大
|
||||||
BigDecimal ofsset_weight = model.getTotalWeight().subtract(surplus_weight); // 本次修改增加的重量
|
BigDecimal ofsset_weight = model.getTotalWeight().subtract(oldobj.getTotalWeight()); // 本次修改增加的重量
|
||||||
BigDecimal offset_total_price = ofsset_weight.multiply(oldobj.getUnitPrice()); // 本次修改增加的价格
|
BigDecimal offset_total_price = ofsset_weight.multiply(oldobj.getUnitPrice()); // 本次修改增加的价格
|
||||||
plan_total_price = offset_total_price.add(undo_price); // 剩余未完成金额加上本次增加的金额
|
plan_total_price = offset_total_price.add(undo_price); // 剩余未完成金额加上本次增加的金额
|
||||||
|
|
||||||
log.debug("已完成:%s", overweight);
|
log.debug("已完成:%s", overweight);
|
||||||
log.debug("本单剩余:%s", surplus_weight);
|
log.debug("旧配额:%s", oldobj.getTotalWeight());
|
||||||
log.debug("本调整:%s", ofsset_weight);
|
log.debug("本调整:%s", ofsset_weight);
|
||||||
log.debug("本调整总价:%s", offset_total_price);
|
log.debug("本调整总价:%s", offset_total_price);
|
||||||
log.debug("客户未完总价:%s", undo_price);
|
log.debug("客户未完总价:%s", undo_price);
|
||||||
log.debug("调整后总价:%s", plan_total_price);
|
log.debug("调整后总价:%s", plan_total_price);
|
||||||
} else { // 修改后比原来的小
|
} else { // 修改后比原来的小
|
||||||
BigDecimal ofsset_weight = surplus_weight.subtract(model.getTotalWeight()); // 本次修改增加的重量
|
BigDecimal ofsset_weight = oldobj.getTotalWeight().subtract(model.getTotalWeight()); // 本次修改增加的重量
|
||||||
BigDecimal offset_total_price = ofsset_weight.multiply(oldobj.getUnitPrice()); // 本次修改增加的价格
|
BigDecimal offset_total_price = ofsset_weight.multiply(oldobj.getUnitPrice()); // 本次修改增加的价格
|
||||||
plan_total_price = undo_price.subtract(offset_total_price); // 剩余未完成金额加上本次增加的金额
|
plan_total_price = undo_price.subtract(offset_total_price); // 剩余未完成金额加上本次增加的金额
|
||||||
|
|
||||||
log.debug("已完成:%s", overweight);
|
log.debug("已完成:%s", overweight);
|
||||||
log.debug("本单剩余:%s", surplus_weight);
|
log.debug("旧配额:%s", oldobj.getTotalWeight());
|
||||||
log.debug("本调整:%s", ofsset_weight);
|
log.debug("本调整:%s", ofsset_weight);
|
||||||
log.debug("本调整总价:%s", offset_total_price);
|
log.debug("本调整总价:%s", offset_total_price);
|
||||||
log.debug("客户未完总价:%s", undo_price);
|
log.debug("客户未完总价:%s", undo_price);
|
||||||
|
|
@ -753,6 +747,12 @@ public class OrderclusterSyncService extends BaseSyncService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (model.getTotalWeight().compareTo(overweight) < 0) {
|
||||||
|
return Result.failedstr("总量不能低于已运输量(%.2f)", overweight);
|
||||||
|
} else {
|
||||||
|
oldobj.setTotalWeight(model.getTotalWeight());
|
||||||
|
}
|
||||||
|
|
||||||
if (model.getTimeInterval() != null) {
|
if (model.getTimeInterval() != null) {
|
||||||
oldobj.setTimeInterval(model.getTimeInterval());
|
oldobj.setTimeInterval(model.getTimeInterval());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue