|
|
@@ -555,7 +555,8 @@ public class DeliveryItemsServiceImpl extends ServiceImpl<DeliveryItemsMapper, D
|
|
|
List<DeliveryItems> deliveryItems = baseMapper.selectItem(SecureUtil.getTenantId(),DeliveryStatusEnum.DELIVER.getType(),srcOrderNo,tradeType);
|
|
|
newDelivery = itemsList.stream().reduce(BigDecimal.ZERO,(x,y) ->{ return x.add(y.getContractAmount().multiply(y.getExRate())); },BigDecimal::add);//本次发货金额
|
|
|
oldDelivery = deliveryItems.stream().reduce(BigDecimal.ZERO,(x,y) ->{ return x.add(y.getContractAmount().multiply(y.getExRate())); },BigDecimal::add);//历史发货金额
|
|
|
- if (gathering.subtract(newDelivery.add(oldDelivery)).compareTo(BigDecimal.ZERO) <= 0){
|
|
|
+ //原来的判断 条件 : if (gathering.subtract(newDelivery.add(oldDelivery)).compareTo(BigDecimal.ZERO) <= 0){
|
|
|
+ if (gathering.subtract(newDelivery.add(oldDelivery)).compareTo(BigDecimal.ZERO) == -1){
|
|
|
throw new RuntimeException("订单"+srcOrderNo+"发货金额超出 ,可发货金额为(CNY):"+(gathering.subtract(oldDelivery)).setScale(2,BigDecimal.ROUND_UP));
|
|
|
}
|
|
|
/*if (gathering.compareTo((newDelivery.add(oldDelivery))) < 0){
|