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

订单审批类型更新bug修复

parent 5a147911
...@@ -101,7 +101,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl ...@@ -101,7 +101,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
@Resource @Resource
private ApplicationContext applicationContext; private ApplicationContext applicationContext;
@Transactional @Transactional(rollbackFor = Exception.class)
@Override @Override
public Long createFeeApplication(OrderFeeApplicationCreateReqVO createReqVO) throws Exception { public Long createFeeApplication(OrderFeeApplicationCreateReqVO createReqVO) throws Exception {
//该订单是否有待处理异常或待处理审核则抛出异常 //该订单是否有待处理异常或待处理审核则抛出异常
...@@ -150,7 +150,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl ...@@ -150,7 +150,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
} }
@Override @Override
@Transactional @Transactional(rollbackFor = Exception.class)
public void createFeeBatchApplication(OrderFeeBatchApplicationCreateReqVO createReqVO) { public void createFeeBatchApplication(OrderFeeBatchApplicationCreateReqVO createReqVO) {
// OrderDO orderDO = orderService.getById(createReqVO.getOrderId()); // OrderDO orderDO = orderService.getById(createReqVO.getOrderId());
// if (orderDO.getAuditType() != 0) { // if (orderDO.getAuditType() != 0) {
...@@ -202,6 +202,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl ...@@ -202,6 +202,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void updateFeeApplication(OrderFeeApplicationUpdateReqVO updateReqVO) { public void updateFeeApplication(OrderFeeApplicationUpdateReqVO updateReqVO) {
OrderDO orderDO = orderService.getById(updateReqVO.getOrderId()); OrderDO orderDO = orderService.getById(updateReqVO.getOrderId());
......
...@@ -4327,16 +4327,14 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -4327,16 +4327,14 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (Objects.nonNull(auditType)) { if (Objects.nonNull(auditType)) {
// TODO 这里可能出现并行的审批任务,当结束一个审批任务变更为0时,需要同步查询当前正在进行的其他审批任务 // TODO 这里可能出现并行的审批任务,当结束一个审批任务变更为0时,需要同步查询当前正在进行的其他审批任务
currentOrderDO.setAuditType(auditType);
currentOrderDO.setAuditResult(auditResult);
if (StringUtils.isNotBlank(auditResult)) {
// 获取固定中文说明描述
msg = I18nMessage.getZhMessage(auditResult);
}
if (auditType == 0) { if (auditType == 0) {
this.checkOrderProcessingApprovalType(orderId, currentOrderDO, auditType, auditResult); this.checkOrderProcessingApprovalType(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(currentOrderDO.getAuditResult())) { if (currentOrderDO.getAuditType() == 0 && StringUtils.isBlank(currentOrderDO.getAuditResult())) {
...@@ -4391,29 +4389,24 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -4391,29 +4389,24 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
/** /**
* 订单审批更新 * 订单审批更新
* *
* @param orderId 订单id * @param orderDO 订单信息
* @param containerNumber 自编号
* @param auditType 审批类型 * @param auditType 审批类型
* @param auditResult 审批结果 * @param auditResult 审批结果
*/ */
private void checkOrderProcessingApprovalType(Long orderId, 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(orderId, orderDO.getContainerNumber(), auditType, auditResult, false); BoxCheckOrderApprovalEvent boxCheckOrderApprovalEvent = new BoxCheckOrderApprovalEvent(orderDO.getOrderId(), orderDO.getContainerNumber(), auditType, auditResult, false);
applicationContext.publishEvent(boxCheckOrderApprovalEvent); applicationContext.publishEvent(boxCheckOrderApprovalEvent);
if (boxCheckOrderApprovalEvent.getIsExists()) { if (boxCheckOrderApprovalEvent.getIsExists()) {
orderDO.setAuditType(auditType); orderDO.setAuditType(auditType);
orderDO.setAuditResult(auditResult); orderDO.setAuditResult(auditResult);
if (StringUtils.isNotBlank(auditResult)) {
// 获取固定中文说明描述
orderDO.setMsg(I18nMessage.getZhMessage(auditResult));
}
return; return;
} }
} }
// 入仓审批更新 // 入仓审批更新
OrderWarehouseApprovalDO warehouseApprovalDO = orderWarehouseApprovalService.getOne(new LambdaQueryWrapper<OrderWarehouseApprovalDO>() OrderWarehouseApprovalDO warehouseApprovalDO = orderWarehouseApprovalService.getOne(new LambdaQueryWrapper<OrderWarehouseApprovalDO>()
.eq(OrderWarehouseApprovalDO::getOrderIds, orderId) .eq(OrderWarehouseApprovalDO::getOrderIds, orderDO.getOrderId())
.eq(OrderWarehouseApprovalDO::getStatus, 1) .eq(OrderWarehouseApprovalDO::getStatus, 1)
.orderByDesc(OrderWarehouseApprovalDO::getId) .orderByDesc(OrderWarehouseApprovalDO::getId)
.last("limit 1")); .last("limit 1"));
...@@ -4423,28 +4416,22 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -4423,28 +4416,22 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// 入仓修改 // 入仓修改
orderDO.setAuditType(warehouse_update_processing.getType()); orderDO.setAuditType(warehouse_update_processing.getType());
orderDO.setAuditResult(warehouse_update_processing.getDesc()); orderDO.setAuditResult(warehouse_update_processing.getDesc());
// 获取固定中文说明描述
orderDO.setMsg(I18nMessage.getZhMessage(warehouse_update_processing.getDesc()));
return; return;
case 2: case 2:
// 调仓 // 调仓
orderDO.setAuditType(warehouse_adjust_processing.getType()); orderDO.setAuditType(warehouse_adjust_processing.getType());
orderDO.setAuditResult(warehouse_adjust_processing.getDesc()); orderDO.setAuditResult(warehouse_adjust_processing.getDesc());
// 获取固定中文说明描述
orderDO.setMsg(I18nMessage.getZhMessage(warehouse_update_processing.getDesc()));
return; return;
case 3: case 3:
// 退仓 // 退仓
orderDO.setAuditType(warehouse_rollback_processing.getType()); orderDO.setAuditType(warehouse_rollback_processing.getType());
orderDO.setAuditResult(warehouse_rollback_processing.getDesc()); orderDO.setAuditResult(warehouse_rollback_processing.getDesc());
// 获取固定中文说明描述
orderDO.setMsg(I18nMessage.getZhMessage(warehouse_rollback_processing.getDesc()));
return; return;
} }
} }
// 订单审批更新 // 订单审批更新
OrderApprovalDO approvalDO = orderApprovalService.getOne(new LambdaQueryWrapper<OrderApprovalDO>() OrderApprovalDO approvalDO = orderApprovalService.getOne(new LambdaQueryWrapper<OrderApprovalDO>()
.eq(OrderApprovalDO::getOrderId, orderId) .eq(OrderApprovalDO::getOrderId, orderDO.getOrderId())
.eq(OrderApprovalDO::getStatus, 1) .eq(OrderApprovalDO::getStatus, 1)
.orderByDesc(OrderApprovalDO::getOrderApprovalId) .orderByDesc(OrderApprovalDO::getOrderApprovalId)
.last("limit 1")); .last("limit 1"));
...@@ -4452,8 +4439,6 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -4452,8 +4439,6 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
OrderApprovalTypeResultEnum resultEnum = OrderApprovalTypeResultEnum.typeAndResultOf(approvalDO.getType(), approvalDO.getStatus()); OrderApprovalTypeResultEnum resultEnum = OrderApprovalTypeResultEnum.typeAndResultOf(approvalDO.getType(), approvalDO.getStatus());
orderDO.setAuditType(resultEnum.getType()); orderDO.setAuditType(resultEnum.getType());
orderDO.setAuditResult(resultEnum.getDesc()); orderDO.setAuditResult(resultEnum.getDesc());
// 获取固定中文说明描述
orderDO.setMsg(I18nMessage.getZhMessage(resultEnum.getDesc()));
} }
} }
......
...@@ -84,7 +84,7 @@ public class OrderFeeApplicationController { ...@@ -84,7 +84,7 @@ public class OrderFeeApplicationController {
@PostMapping("/create/batch") @PostMapping("/create/batch")
@ApiOperation("批量创建订单费用申请") @ApiOperation("批量创建订单费用申请")
@Idempotent(timeout = 5) @Idempotent(timeout = 10)
public CommonResult<Boolean> createFeeBatchApplication(@Valid @RequestBody OrderFeeBatchApplicationCreateReqVO createReqVO) throws Exception { public CommonResult<Boolean> createFeeBatchApplication(@Valid @RequestBody OrderFeeBatchApplicationCreateReqVO createReqVO) throws Exception {
String redisKey = MessageFormat.format(ORDER_FEE_APPLICATION_KEY, createReqVO.getOrderId().toString()); String redisKey = MessageFormat.format(ORDER_FEE_APPLICATION_KEY, createReqVO.getOrderId().toString());
Long count = redisHelper.incrBy(redisKey, 1); Long count = redisHelper.incrBy(redisKey, 1);
...@@ -118,6 +118,7 @@ public class OrderFeeApplicationController { ...@@ -118,6 +118,7 @@ public class OrderFeeApplicationController {
@PutMapping("/update") @PutMapping("/update")
@ApiOperation("更新订单费用申请") @ApiOperation("更新订单费用申请")
@Idempotent(timeout = 10)
public CommonResult<Boolean> updateFeeApplication(@Valid @RequestBody OrderFeeApplicationUpdateReqVO updateReqVO) { public CommonResult<Boolean> updateFeeApplication(@Valid @RequestBody OrderFeeApplicationUpdateReqVO updateReqVO) {
String redisKey = MessageFormat.format(ORDER_FEE_APPLICATION_KEY, updateReqVO.getOrderId().toString()); String redisKey = MessageFormat.format(ORDER_FEE_APPLICATION_KEY, updateReqVO.getOrderId().toString());
......
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