Commit 47ae92cb authored by zhengyi's avatar zhengyi

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

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