Commit 47ae92cb authored by zhengyi's avatar zhengyi

控货订单无收货人的逻辑bug修复

parent 169544ea
...@@ -698,8 +698,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -698,8 +698,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeService.save(orderConsigneeDO); orderConsigneeService.save(orderConsigneeDO);
} else { } else {
// 控货订单没有收货人则不限制修改收货人 // 控货订单没有收货人则不限制修改收货人
if (order.getIsCargoControl() && !hasConsignee) {
order.setIsLimitUpdateConsignee(Boolean.TRUE);
} else {
order.setIsLimitUpdateConsignee(Boolean.FALSE); order.setIsLimitUpdateConsignee(Boolean.FALSE);
} }
}
if (!Objects.equals(createReqVO.getStatus(), DRAFT.getValue())) { if (!Objects.equals(createReqVO.getStatus(), DRAFT.getValue())) {
//customerType 发货人-1 收货人 2 //customerType 发货人-1 收货人 2
int customerType = this.checkOrderSalesman(order, createReqVO.getOfferId(), null, null, orderConsignorDO, orderConsigneeDO); int customerType = this.checkOrderSalesman(order, createReqVO.getOfferId(), null, null, orderConsignorDO, orderConsigneeDO);
...@@ -948,8 +952,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -948,8 +952,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
} }
} else { } else {
// 控货订单没有收货人则不限制修改收货人 // 控货订单没有收货人则不限制修改收货人
if (order.getIsCargoControl() && !hasConsignee) {
order.setIsLimitUpdateConsignee(Boolean.TRUE);
} else {
order.setIsLimitUpdateConsignee(Boolean.FALSE); order.setIsLimitUpdateConsignee(Boolean.FALSE);
} }
}
if (!Objects.equals(createReqVO.getStatus(), if (!Objects.equals(createReqVO.getStatus(),
DRAFT.getValue())) { DRAFT.getValue())) {
// 发货人 1 收货人 2 // 发货人 1 收货人 2
...@@ -3307,13 +3315,17 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -3307,13 +3315,17 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeService.saveOrUpdate(orderConsigneeDO); orderConsigneeService.saveOrUpdate(orderConsigneeDO);
} else { } else {
// 如果控货订单发货人设置了控货无收货人,则需要删除订单已有收货人 // 如果控货订单发货人设置了控货无收货人,则需要删除订单已有收货人
if (Objects.nonNull(orderConsigneeDO)) { if (Objects.nonNull(orderConsigneeDO) && !hasConsignee) {
orderConsigneeService.removeById(orderConsigneeDO.getId()); orderConsigneeService.removeById(orderConsigneeDO.getId());
orderConsigneeDO = null; orderConsigneeDO = null;
} }
// 控货订单没有收货人则不限制修改收货人 // 控货订单没有收货人则不限制修改收货人
if (updateObj.getIsCargoControl() && !hasConsignee) {
updateObj.setIsLimitUpdateConsignee(Boolean.TRUE);
} else {
updateObj.setIsLimitUpdateConsignee(Boolean.FALSE); updateObj.setIsLimitUpdateConsignee(Boolean.FALSE);
} }
}
if (!Objects.equals(updateReqVO.getStatus(), if (!Objects.equals(updateReqVO.getStatus(),
DRAFT.getValue())) { DRAFT.getValue())) {
...@@ -3570,14 +3582,18 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -3570,14 +3582,18 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
} }
} else { } else {
// 如果控货订单发货人设置了控货无收货人,则需要删除订单已有收货人 // 如果控货订单发货人设置了控货无收货人,则需要删除订单已有收货人
if (Objects.nonNull(orderConsigneeDO)) { if (Objects.nonNull(orderConsigneeDO) && !hasConsignee) {
orderConsigneeService.removeById(orderConsigneeDO.getId()); orderConsigneeService.removeById(orderConsigneeDO.getId());
orderConsigneeDO = null; orderConsigneeDO = null;
} }
consigneeDO = null; consigneeDO = null;
// 控货订单没有收货人则不限制修改收货人 // 控货订单没有收货人则不限制修改收货人
if (updateObj.getIsCargoControl() && !hasConsignee) {
updateObj.setIsLimitUpdateConsignee(Boolean.TRUE);
} else {
updateObj.setIsLimitUpdateConsignee(Boolean.FALSE); updateObj.setIsLimitUpdateConsignee(Boolean.FALSE);
} }
}
if (!Objects.equals(updateReqVO.getStatus(), if (!Objects.equals(updateReqVO.getStatus(),
DRAFT.getValue())) { DRAFT.getValue())) {
//customerType 发货人 1 收货人 2 //customerType 发货人 1 收货人 2
......
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