Commit 164cd99b authored by zhengyi's avatar zhengyi

订单修改审批对无收货人控货订单的判断逻辑bug修复

parent 64f063bf
...@@ -2083,7 +2083,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -2083,7 +2083,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
} }
} else { } else {
// 控货订单发货人设置为控货无收货人,这里需要处理掉订单的收货人信息 // 控货订单发货人设置为控货无收货人,这里需要处理掉订单的收货人信息
if (Objects.nonNull(orderConsigneeBackVO)) { if (Objects.nonNull(orderConsigneeBackVO) && !hasConsignee) {
ApplyInfoVO infoVO = new ApplyInfoVO(); ApplyInfoVO infoVO = new ApplyInfoVO();
infoVO.setName("控货订单发货人设置为控货无收货人,清除订单收货人信息/Set the shipper of the controlled goods order to no consignee, and clear the consignee information of the order"); infoVO.setName("控货订单发货人设置为控货无收货人,清除订单收货人信息/Set the shipper of the controlled goods order to no consignee, and clear the consignee information of the order");
applyInfoList.add(infoVO); applyInfoList.add(infoVO);
...@@ -4392,13 +4392,13 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -4392,13 +4392,13 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
/** /**
* 订单审批更新 * 订单审批更新
* *
* @param orderDO 订单信息 * @param orderDO 订单信息
* @param auditType 审批类型 * @param auditType 审批类型
* @param auditResult 审批结果 * @param auditResult 审批结果
*/ */
private void checkOrderProcessingApprovalType( OrderDO orderDO, Integer auditType, String auditResult) { private void checkOrderProcessingApprovalType(OrderDO orderDO, Integer auditType, String auditResult) {
// 出货审批更新 // 出货审批更新
if (StringUtils.isNotBlank(orderDO.getContainerNumber())){ if (StringUtils.isNotBlank(orderDO.getContainerNumber())) {
BoxCheckOrderApprovalEvent boxCheckOrderApprovalEvent = new BoxCheckOrderApprovalEvent(orderDO.getOrderId(), orderDO.getContainerNumber(), auditType, auditResult, false); BoxCheckOrderApprovalEvent boxCheckOrderApprovalEvent = new BoxCheckOrderApprovalEvent(orderDO.getOrderId(), orderDO.getContainerNumber(), auditType, auditResult, false);
applicationContext.publishEvent(boxCheckOrderApprovalEvent); applicationContext.publishEvent(boxCheckOrderApprovalEvent);
if (boxCheckOrderApprovalEvent.getIsExists()) { if (boxCheckOrderApprovalEvent.getIsExists()) {
...@@ -4413,8 +4413,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -4413,8 +4413,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
.eq(OrderWarehouseApprovalDO::getStatus, 1) .eq(OrderWarehouseApprovalDO::getStatus, 1)
.orderByDesc(OrderWarehouseApprovalDO::getId) .orderByDesc(OrderWarehouseApprovalDO::getId)
.last("limit 1")); .last("limit 1"));
if (Objects.nonNull(warehouseApprovalDO)){ if (Objects.nonNull(warehouseApprovalDO)) {
switch (warehouseApprovalDO.getType()){ switch (warehouseApprovalDO.getType()) {
case 1: case 1:
// 入仓修改 // 入仓修改
orderDO.setAuditType(warehouse_update_processing.getType()); orderDO.setAuditType(warehouse_update_processing.getType());
...@@ -4438,7 +4438,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -4438,7 +4438,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
.eq(OrderApprovalDO::getStatus, 1) .eq(OrderApprovalDO::getStatus, 1)
.orderByDesc(OrderApprovalDO::getOrderApprovalId) .orderByDesc(OrderApprovalDO::getOrderApprovalId)
.last("limit 1")); .last("limit 1"));
if (Objects.nonNull(approvalDO)){ if (Objects.nonNull(approvalDO)) {
OrderApprovalTypeResultEnum resultEnum = OrderApprovalTypeResultEnum.typeAndResultOf(approvalDO.getType(), approvalDO.getStatus()); OrderApprovalTypeResultEnum resultEnum = OrderApprovalTypeResultEnum.typeAndResultOf(approvalDO.getType(), approvalDO.getStatus());
orderDO.setAuditType(resultEnum.getType()); orderDO.setAuditType(resultEnum.getType());
orderDO.setAuditResult(resultEnum.getDesc()); orderDO.setAuditResult(resultEnum.getDesc());
...@@ -5817,24 +5817,34 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -5817,24 +5817,34 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
OrderConsigneeBackVO consigneeVO = orderBackVO.getConsigneeVO(); OrderConsigneeBackVO consigneeVO = orderBackVO.getConsigneeVO();
OrderConsignorDO orderConsignorDO = orderConsignorService.getById(consignorVO.getId()); OrderConsignorDO orderConsignorDO = orderConsignorService.getById(consignorVO.getId());
OrderConsigneeDO orderConsigneeDO = orderConsigneeService.getById(consigneeVO.getId()); OrderConsigneeDO orderConsigneeDO = null;
if (Objects.nonNull(consigneeVO)) {
orderConsigneeService.getById(consigneeVO.getId());
}
// //
boolean isConsignorChange = orderConsignorDO != null && !Objects.equals(consignorVO.getCustomerId(), orderConsignorDO.getCustomerId()); boolean isConsignorChange = orderConsignorDO != null && !Objects.equals(consignorVO.getCustomerId(), orderConsignorDO.getCustomerId());
boolean isConsigneeChange = orderConsigneeDO != null && !Objects.equals(consigneeVO.getCustomerId(), orderConsigneeDO.getCustomerId()); boolean isConsigneeChange = orderConsigneeDO != null && Objects.nonNull(consigneeVO) && !Objects.equals(consigneeVO.getCustomerId(), orderConsigneeDO.getCustomerId());
// 收发货人信息变更 // 收发货人信息变更
OrderConsignorDO consignorDO = OrderConsignorConvert.INSTANCE.convert(consignorVO); OrderConsignorDO consignorDO = OrderConsignorConvert.INSTANCE.convert(consignorVO);
orderConsignorService.updateById(consignorDO); orderConsignorService.updateById(consignorDO);
OrderConsigneeDO consigneeDO = OrderConsigneeConvert.INSTANCE.convert(consigneeVO); OrderConsigneeDO consigneeDO = null;
if (Objects.nonNull(consigneeVO)) {
consigneeDO = OrderConsigneeConvert.INSTANCE.convert(consigneeVO);
}
// 控货订单发货人无收货人属性变动,需要清空订单收货人信息 // 控货订单发货人无收货人属性变动,需要清空订单收货人信息
Boolean isLimitUpdateConsignee = Boolean.FALSE; Boolean isLimitUpdateConsignee = Boolean.FALSE;
if (orderBackVO.getIsChargeNoConsignee()) { if (orderBackVO.getIsChargeNoConsignee()) {
orderConsigneeService.removeById(consigneeDO.getId()); if (Objects.nonNull(consigneeDO)) {
orderConsigneeService.removeById(consigneeDO.getId());
}
} else { } else {
orderConsigneeService.updateById(consigneeDO); if (Objects.nonNull(consigneeDO)) {
if (orderBackVO.getIsCargoControl()) { orderConsigneeService.updateById(consigneeDO);
// 控货订单有收货人则限制修改收货人 if (orderBackVO.getIsCargoControl()) {
isLimitUpdateConsignee = Boolean.TRUE; // 控货订单有收货人则限制修改收货人
isLimitUpdateConsignee = Boolean.TRUE;
}
} }
} }
// 始发地目的地更新 // 始发地目的地更新
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment