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

审批状态更新业务bug修复

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