|
|
@@ -159,9 +159,12 @@ public class AcceptCarriageOrderService {
|
|
|
log.info("承运订单-分包托运 用户id:{}", LoginUserHolder.getUserId());
|
|
|
throw new RuntimeException("企业信息查询异常");
|
|
|
}
|
|
|
-// if (!entCacheResDto.getEntTypes().contains(String.valueOf(NumberConstant.THREE))) {
|
|
|
-// throw new RuntimeException("当前用户企业不具有分包功能权限!");
|
|
|
-// }
|
|
|
+ if (!entCacheResDto.getEntTypes().contains(String.valueOf(NumberConstant.THREE))) {
|
|
|
+ throw new RuntimeException("当前用户企业不具有分包功能权限!");
|
|
|
+ }
|
|
|
+ if (bo.getCarryingCapacity().compareTo(new BigDecimal("0.00")) == 0) {
|
|
|
+ throw new RuntimeException("分配承运量必须填写大于0.00");
|
|
|
+ }
|
|
|
KwtLogisticsOrder order = new KwtLogisticsOrder();
|
|
|
if (!bo.getIsFullDose()) {
|
|
|
BigDecimal amount = bo.getAmount();
|
|
|
@@ -180,6 +183,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) {
|
|
|
+ throw new RuntimeException("剩余可分配量为0,不可进行分包操作!");
|
|
|
+ }
|
|
|
String lOrderNo = getLOrderNo();
|
|
|
Long orderId = new IdWorker(NumberConstant.ONE).nextId();
|
|
|
/**分包托运需要判断处于哪一级分包托运
|
|
|
@@ -234,6 +241,7 @@ public class AcceptCarriageOrderService {
|
|
|
insertLogisticsOrderTrack(bo, orderId, orderStatus);
|
|
|
//修改上级分配量以及可分配量委托量等
|
|
|
logisticsOrder.setSubcontractAmount(logisticsOrder.getSubcontractAmount().add(bo.getCarryingCapacity()));
|
|
|
+ logisticsOrder.setIgnoreAmount(logisticsOrder.getIgnoreAmount().subtract(bo.getCarryingCapacity()));
|
|
|
logisticsOrderMapper.updateById(logisticsOrder);
|
|
|
//修改父级mongodb数据
|
|
|
//更新mongodb
|
|
|
@@ -246,6 +254,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()));
|
|
|
//rabbitMq业务汇总数据发送/消费对象
|
|
|
SckwBusSum busSum = new SckwBusSum();
|
|
|
//业务汇总类型
|
|
|
@@ -567,7 +576,7 @@ public class AcceptCarriageOrderService {
|
|
|
order.setSubcontractAmount(decimal);
|
|
|
order.setLoadAmount(decimal);
|
|
|
order.setUnloadAmount(decimal);
|
|
|
- order.setIgnoreAmount(decimal);
|
|
|
+ order.setIgnoreAmount(bo.getCarryingCapacity());
|
|
|
order.setDeficitPrice(decimal);
|
|
|
order.setDeficitAmount(decimal);
|
|
|
order.setBindStatus(String.valueOf(NumberConstant.ZERO));
|
|
|
@@ -937,7 +946,7 @@ public class AcceptCarriageOrderService {
|
|
|
public HttpResult stopDocumentCommit(StopOrderTakingDTO stopOrderTakingDTO) {
|
|
|
List<String> stringList = StringUtils.splitStrToList(stopOrderTakingDTO.getIds(), ",", String.class);
|
|
|
List<Long> circulateIds = logisticsOrderCirculateMapper.selectEntityBylOrderIdAndOrderIds(stopOrderTakingDTO.getLOrderId(), stringList);
|
|
|
- if (CollectionUtils.isEmpty(circulateIds)){
|
|
|
+ if (CollectionUtils.isEmpty(circulateIds)) {
|
|
|
return HttpResult.error("循环停止接单,单据不存在!");
|
|
|
}
|
|
|
List<JSONObject> list = new ArrayList<>(stringList.size());
|
|
|
@@ -1432,14 +1441,19 @@ public class AcceptCarriageOrderService {
|
|
|
/**
|
|
|
* 承运订单-获取撤销驳回原因
|
|
|
*
|
|
|
- * @param id 物流订单id
|
|
|
+ * @param id 物流订单id
|
|
|
+ * @param status 物流订单状态
|
|
|
* @return
|
|
|
*/
|
|
|
- public HttpResult getCancelReason(String id) {
|
|
|
- KwtLogisticsOrderTrack track = logisticsOrderTrackMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrderTrack>()
|
|
|
- .eq(KwtLogisticsOrderTrack::getLOrderId, Long.parseLong(id))
|
|
|
- .eq(KwtLogisticsOrderTrack::getStatus, LogisticsOrderEnum.SEND_BACK.getCode()));
|
|
|
- return HttpResult.ok(track == null ? null : track.getRemark());
|
|
|
+ public HttpResult getCancelReason(String id, Integer status) {
|
|
|
+ Map<String, String> map = logisticsOrderMapper.getRejectReason(id, status);
|
|
|
+ return HttpResult.ok(map);
|
|
|
+// KwtLogisticsOrderTrack track = logisticsOrderTrackMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrderTrack>()
|
|
|
+// .eq(KwtLogisticsOrderTrack::getLOrderId, Long.parseLong(id))
|
|
|
+// /**.eq(KwtLogisticsOrderTrack::getStatus, LogisticsOrderEnum.SEND_BACK.getCode())*/
|
|
|
+// .eq(KwtLogisticsOrderTrack::getStatus,status)
|
|
|
+// );
|
|
|
+// return HttpResult.ok(track == null ? null : track.getRemark());
|
|
|
}
|
|
|
|
|
|
/**
|