|
|
@@ -185,8 +185,10 @@ public class AcceptCarriageOrderService {
|
|
|
order.setSubcontractAmount(new BigDecimal(NumberConstant.ZERO));
|
|
|
order.setUnit(bo.getCarryingCapacityUnit());
|
|
|
}
|
|
|
- BigDecimal ignoreAmount = logisticsOrder.getIgnoreAmount();
|
|
|
- if (ignoreAmount.compareTo(new BigDecimal("0.00")) == 0) {
|
|
|
+ BigDecimal subcontractAmount = logisticsOrder.getSubcontractAmount() == null ? new BigDecimal("0.00") : logisticsOrder.getSubcontractAmount();
|
|
|
+ BigDecimal entrustAmount = logisticsOrder.getEntrustAmount() == null ? new BigDecimal("0.00") : logisticsOrder.getEntrustAmount();
|
|
|
+ BigDecimal waitDistributionAmount = logisticsOrder.getAmount().subtract(subcontractAmount).subtract(entrustAmount);
|
|
|
+ if (waitDistributionAmount.compareTo(new BigDecimal("0.00")) == 0) {
|
|
|
throw new RuntimeException("剩余可分配量为0,不可进行分包操作!");
|
|
|
}
|
|
|
int level = logisticsLevel(logisticsOrder);
|
|
|
@@ -250,7 +252,7 @@ public class AcceptCarriageOrderService {
|
|
|
insertLogisticsOrderTrack(bo, orderId, orderStatus);
|
|
|
//修改上级分配量以及可分配量委托量等
|
|
|
logisticsOrder.setSubcontractAmount(logisticsOrder.getSubcontractAmount().add(bo.getCarryingCapacity()));
|
|
|
- logisticsOrder.setIgnoreAmount(logisticsOrder.getIgnoreAmount().subtract(bo.getCarryingCapacity()));
|
|
|
+// logisticsOrder.setIgnoreAmount(logisticsOrder.getIgnoreAmount().subtract(bo.getCarryingCapacity()));
|
|
|
logisticsOrderMapper.updateById(logisticsOrder);
|
|
|
//修改父级mongodb数据
|
|
|
//更新mongodb
|
|
|
@@ -263,7 +265,7 @@ public class AcceptCarriageOrderService {
|
|
|
lOrder.setUpdateBy(order.getUpdateBy());
|
|
|
lOrder.setUpdateByName(LoginUserHolder.getUserName());
|
|
|
lOrder.setSubcontractAmount(logisticsOrder.getSubcontractAmount().add(bo.getCarryingCapacity()));
|
|
|
- lOrder.setIgnoreAmount(logisticsOrder.getIgnoreAmount().subtract(bo.getCarryingCapacity()));
|
|
|
+// lOrder.setIgnoreAmount(logisticsOrder.getIgnoreAmount().subtract(bo.getCarryingCapacity()));
|
|
|
//rabbitMq业务汇总数据发送/消费对象
|
|
|
SckwBusSum busSum = new SckwBusSum();
|
|
|
//业务汇总类型
|
|
|
@@ -588,9 +590,11 @@ public class AcceptCarriageOrderService {
|
|
|
order.setSubcontractAmount(decimal);
|
|
|
order.setLoadAmount(decimal);
|
|
|
order.setUnloadAmount(decimal);
|
|
|
- order.setIgnoreAmount(bo.getCarryingCapacity());
|
|
|
+ order.setIgnoreAmount(decimal);
|
|
|
order.setDeficitPrice(decimal);
|
|
|
order.setDeficitAmount(decimal);
|
|
|
+ order.setTotalUnloadAmount(decimal);
|
|
|
+ order.setTotalLoadAmount(decimal);
|
|
|
order.setBindStatus(String.valueOf(NumberConstant.ZERO));
|
|
|
logisticsOrderMapper.insert(order);
|
|
|
}
|
|
|
@@ -2062,7 +2066,7 @@ public class AcceptCarriageOrderService {
|
|
|
order.setEntrustAmount(decimal);
|
|
|
order.setUnloadAmount(decimal);
|
|
|
order.setLoadAmount(decimal);
|
|
|
- order.setIgnoreAmount(orderDTO.getAmount());
|
|
|
+ order.setIgnoreAmount(decimal);
|
|
|
order.setDeficitAmount(decimal);
|
|
|
order.setDeficitPrice(decimal);
|
|
|
order.setTaxRate(orderDTO.getTaxRate());
|
|
|
@@ -2073,11 +2077,14 @@ public class AcceptCarriageOrderService {
|
|
|
order.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
order.setUpdateTime(new Date());
|
|
|
order.setBindStatus(String.valueOf(NumberConstant.ZERO));
|
|
|
+ order.setTotalUnloadAmount(decimal);
|
|
|
+ order.setTotalLoadAmount(decimal);
|
|
|
logisticsOrderMapper.insert(order);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 承运订单首页条件查询
|
|
|
+ *
|
|
|
* @param query
|
|
|
* @param type
|
|
|
* @return
|
|
|
@@ -2163,6 +2170,7 @@ public class AcceptCarriageOrderService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ vo.setWaitDistributionAmount(vo.getCarryingCapacity().subtract(vo.getSubcontractAmount()).subtract(vo.getEntrustAmount()));
|
|
|
}
|
|
|
return PageRes.build(pageInfo, list);
|
|
|
}
|