Commit 164cd99b authored by zhengyi's avatar zhengyi

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

parent 64f063bf
......@@ -2083,7 +2083,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
} else {
// 控货订单发货人设置为控货无收货人,这里需要处理掉订单的收货人信息
if (Objects.nonNull(orderConsigneeBackVO)) {
if (Objects.nonNull(orderConsigneeBackVO) && !hasConsignee) {
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");
applyInfoList.add(infoVO);
......@@ -4392,13 +4392,13 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
/**
* 订单审批更新
*
* @param orderDO 订单信息
* @param auditType 审批类型
* @param auditResult 审批结果
* @param orderDO 订单信息
* @param auditType 审批类型
* @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);
applicationContext.publishEvent(boxCheckOrderApprovalEvent);
if (boxCheckOrderApprovalEvent.getIsExists()) {
......@@ -4413,8 +4413,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
.eq(OrderWarehouseApprovalDO::getStatus, 1)
.orderByDesc(OrderWarehouseApprovalDO::getId)
.last("limit 1"));
if (Objects.nonNull(warehouseApprovalDO)){
switch (warehouseApprovalDO.getType()){
if (Objects.nonNull(warehouseApprovalDO)) {
switch (warehouseApprovalDO.getType()) {
case 1:
// 入仓修改
orderDO.setAuditType(warehouse_update_processing.getType());
......@@ -4438,7 +4438,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
.eq(OrderApprovalDO::getStatus, 1)
.orderByDesc(OrderApprovalDO::getOrderApprovalId)
.last("limit 1"));
if (Objects.nonNull(approvalDO)){
if (Objects.nonNull(approvalDO)) {
OrderApprovalTypeResultEnum resultEnum = OrderApprovalTypeResultEnum.typeAndResultOf(approvalDO.getType(), approvalDO.getStatus());
orderDO.setAuditType(resultEnum.getType());
orderDO.setAuditResult(resultEnum.getDesc());
......@@ -5817,24 +5817,34 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
OrderConsigneeBackVO consigneeVO = orderBackVO.getConsigneeVO();
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 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);
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;
if (orderBackVO.getIsChargeNoConsignee()) {
orderConsigneeService.removeById(consigneeDO.getId());
if (Objects.nonNull(consigneeDO)) {
orderConsigneeService.removeById(consigneeDO.getId());
}
} else {
orderConsigneeService.updateById(consigneeDO);
if (orderBackVO.getIsCargoControl()) {
// 控货订单有收货人则限制修改收货人
isLimitUpdateConsignee = Boolean.TRUE;
if (Objects.nonNull(consigneeDO)) {
orderConsigneeService.updateById(consigneeDO);
if (orderBackVO.getIsCargoControl()) {
// 控货订单有收货人则限制修改收货人
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