Commit 13803228 authored by 332784038@qq.com's avatar 332784038@qq.com

审批状态更新业务bug修复

parent 9186abc2
...@@ -691,4 +691,10 @@ public class OrderDO extends BaseDO { ...@@ -691,4 +691,10 @@ public class OrderDO extends BaseDO {
@TableField(exist = false) @TableField(exist = false)
private Boolean isChargeDraft = Boolean.FALSE; private Boolean isChargeDraft = Boolean.FALSE;
@ApiModelProperty(value = "日志描述信息传值封装字段")
@TableField(exist = false)
private String msg = "";
} }
...@@ -4328,19 +4328,20 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -4328,19 +4328,20 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (Objects.nonNull(auditType)) { if (Objects.nonNull(auditType)) {
// TODO 这里可能出现并行的审批任务,当结束一个审批任务变更为0时,需要同步查询当前正在进行的其他审批任务 // TODO 这里可能出现并行的审批任务,当结束一个审批任务变更为0时,需要同步查询当前正在进行的其他审批任务
if (auditType == 0) { if (auditType == 0) {
this.checkOrderProcessingApprovalType(orderId, currentOrderDO.getContainerNumber(), auditType, auditResult); this.checkOrderProcessingApprovalType(orderId, currentOrderDO, auditType, auditResult);
} msg = currentOrderDO.getMsg();
} else {
currentOrderDO.setAuditType(auditType); currentOrderDO.setAuditType(auditType);
currentOrderDO.setAuditResult(auditResult);
if (StringUtils.isNotBlank(auditResult)) { if (StringUtils.isNotBlank(auditResult)) {
// 获取固定中文说明描述 // 获取固定中文说明描述
msg = I18nMessage.getZhMessage(auditResult); msg = I18nMessage.getZhMessage(auditResult);
} }
} }
if (currentOrderDO.getAuditType() == 0 && StringUtils.isBlank(auditResult)) {
auditResult = "";
} }
currentOrderDO.setAuditResult(auditResult); if (currentOrderDO.getAuditType() == 0 && StringUtils.isBlank(currentOrderDO.getAuditResult())) {
currentOrderDO.setAuditResult("");
}
orderMapper.updateById(currentOrderDO); orderMapper.updateById(currentOrderDO);
// 完成入仓时设置入仓体积和入仓重量 // 完成入仓时设置入仓体积和入仓重量
...@@ -4395,14 +4396,18 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -4395,14 +4396,18 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
* @param auditType 审批类型 * @param auditType 审批类型
* @param auditResult 审批结果 * @param auditResult 审批结果
*/ */
private void checkOrderProcessingApprovalType(Long orderId, String containerNumber, Integer auditType, String auditResult) { private void checkOrderProcessingApprovalType(Long orderId, OrderDO orderDO, Integer auditType, String auditResult) {
// 出货审批更新 // 出货审批更新
if (StringUtils.isNotBlank(containerNumber)){ if (StringUtils.isNotBlank(orderDO.getContainerNumber())){
BoxCheckOrderApprovalEvent boxCheckOrderApprovalEvent = new BoxCheckOrderApprovalEvent(orderId, containerNumber, auditType, auditResult, false); BoxCheckOrderApprovalEvent boxCheckOrderApprovalEvent = new BoxCheckOrderApprovalEvent(orderId, orderDO.getContainerNumber(), auditType, auditResult, false);
applicationContext.publishEvent(boxCheckOrderApprovalEvent); applicationContext.publishEvent(boxCheckOrderApprovalEvent);
if (boxCheckOrderApprovalEvent.getIsExists()) { if (boxCheckOrderApprovalEvent.getIsExists()) {
auditType = boxCheckOrderApprovalEvent.getAuditType(); orderDO.setAuditType(auditType);
auditResult = boxCheckOrderApprovalEvent.getAuditResult(); orderDO.setAuditResult(auditResult);
if (StringUtils.isNotBlank(auditResult)) {
// 获取固定中文说明描述
orderDO.setMsg(I18nMessage.getZhMessage(auditResult));
}
return; return;
} }
} }
...@@ -4416,18 +4421,24 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -4416,18 +4421,24 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
switch (warehouseApprovalDO.getType()){ switch (warehouseApprovalDO.getType()){
case 1: case 1:
// 入仓修改 // 入仓修改
auditType = warehouse_update_processing.getType(); orderDO.setAuditType(warehouse_update_processing.getType());
auditResult = warehouse_update_processing.getDesc(); orderDO.setAuditResult(warehouse_update_processing.getDesc());
// 获取固定中文说明描述
orderDO.setMsg(I18nMessage.getZhMessage(warehouse_update_processing.getDesc()));
return; return;
case 2: case 2:
// 调仓 // 调仓
auditType = warehouse_adjust_processing.getType(); orderDO.setAuditType(warehouse_adjust_processing.getType());
auditResult = warehouse_adjust_processing.getDesc(); orderDO.setAuditResult(warehouse_adjust_processing.getDesc());
// 获取固定中文说明描述
orderDO.setMsg(I18nMessage.getZhMessage(warehouse_update_processing.getDesc()));
return; return;
case 3: case 3:
// 退仓 // 退仓
auditType = warehouse_rollback_processing.getType(); orderDO.setAuditType(warehouse_rollback_processing.getType());
auditResult = warehouse_rollback_processing.getDesc(); orderDO.setAuditResult(warehouse_rollback_processing.getDesc());
// 获取固定中文说明描述
orderDO.setMsg(I18nMessage.getZhMessage(warehouse_rollback_processing.getDesc()));
return; return;
} }
} }
...@@ -4439,9 +4450,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -4439,9 +4450,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
.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());
auditType = resultEnum.getType(); orderDO.setAuditType(resultEnum.getType());
auditResult = resultEnum.getDesc(); orderDO.setAuditResult(resultEnum.getDesc());
return; // 获取固定中文说明描述
orderDO.setMsg(I18nMessage.getZhMessage(resultEnum.getDesc()));
} }
} }
......
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