Commit 47ae92cb authored by zhengyi's avatar zhengyi

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

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