Commit 3c999a77 authored by zhengyi's avatar zhengyi

订单海外仓修改申请业务完善

parent 63389435
...@@ -518,8 +518,17 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont ...@@ -518,8 +518,17 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
} else if (orderApprovalDO.getType() == 62) { } else if (orderApprovalDO.getType() == 62) {
msg = result == 4 ? "海外仓修改申请取消" : "海外仓修改申请拒绝"; msg = result == 4 ? "海外仓修改申请取消" : "海外仓修改申请拒绝";
ApplyInfoVO applyInfoVO = new ApplyInfoVO(); ApplyInfoVO applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改为海外仓模式"); applyInfoVO.setName("订单修改海外仓模式");
// 这里不用判断订单中的值了,只需要看申请结果就能得出原值和新值相反的文案结果
applyInfoVO.setOrgValue(applyVO.getIsOverseasWarehouse() ? "订单修改为非海外仓" : "订单修改为海外仓");
applyInfoVO.setNewValue(applyVO.getIsOverseasWarehouse() ? "订单修改为海外仓" : "订单修改为非海外仓");
list.add(applyInfoVO); list.add(applyInfoVO);
if (StringUtils.isNotBlank(applyVO.getReasonZh())) {
applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改海外仓模式理由");
applyInfoVO.setNewValue(applyVO.getReasonZh());
list.add(applyInfoVO);
}
} }
} }
if (result == 2) { if (result == 2) {
...@@ -553,10 +562,27 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont ...@@ -553,10 +562,27 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
} }
} else if (orderApprovalDO.getType() == 62) { } else if (orderApprovalDO.getType() == 62) {
// TODO 海外仓修改申请 // TODO 海外仓修改申请
String type = orderDO.getType();
if (StringUtils.isNotBlank(type)) {
type = applyVO.getIsOverseasWarehouse() ? type.concat(",2") : Arrays.stream(type.split(",")).filter(s -> !StringUtils.equals("2", s)).collect(Collectors.joining(","));
}else {
type = "2";
}
// TODO 修改订单海外仓模式, 不确定对订单其他方面是否有影响,订单编号生成规则与海外仓无关联
orderService.update(new LambdaUpdateWrapper<OrderDO>().set(OrderDO::getType, type).eq(OrderDO::getOrderId, orderApprovalDO.getOrderId()));
msg = "海外仓修改申请审批通过"; msg = "海外仓修改申请审批通过";
ApplyInfoVO applyInfoVO = new ApplyInfoVO(); ApplyInfoVO applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改为海外仓模式"); applyInfoVO.setName("订单修改海外仓模式");
// 这里不用判断订单中的值了,只需要看申请结果就能得出原值和新值相反的文案结果
applyInfoVO.setOrgValue(applyVO.getIsOverseasWarehouse() ? "订单修改为非海外仓" : "订单修改为海外仓");
applyInfoVO.setNewValue(applyVO.getIsOverseasWarehouse() ? "订单修改为海外仓" : "订单修改为非海外仓");
list.add(applyInfoVO); list.add(applyInfoVO);
if (StringUtils.isNotBlank(applyVO.getReasonZh())) {
applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改海外仓模式理由");
applyInfoVO.setNewValue(applyVO.getReasonZh());
list.add(applyInfoVO);
}
} }
} }
orderApprovalMapper.updateById(orderApprovalDO); orderApprovalMapper.updateById(orderApprovalDO);
...@@ -612,7 +638,7 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont ...@@ -612,7 +638,7 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
OrderDO orderDO = orderService.getById(orderCargoControlApplyVO.getOrderId()); OrderDO orderDO = orderService.getById(orderCargoControlApplyVO.getOrderId());
// TODO 待确认具体拦截哪些审批任务 // TODO 待确认具体拦截哪些审批任务
int count = orderApprovalMapper.processingItemApproval(null, orderCargoControlApplyVO.getOrderId(), Arrays.asList(orderCargoControlApplyVO.getApplyType(), 14)); int count = orderApprovalMapper.processingItemApproval(null, orderCargoControlApplyVO.getOrderId(), Arrays.asList(orderCargoControlApplyVO.getApplyType(), 14));
if (count > 0){ if (count > 0) {
throw exception(ORDER_IS_APPROVAL_IN_PROCESS); throw exception(ORDER_IS_APPROVAL_IN_PROCESS);
} }
OrderCargoControlReleaseInfoDto releaseInfoDto = this.getOrderCargoControlReleaseInfo(orderCargoControlApplyVO.getOrderId()); OrderCargoControlReleaseInfoDto releaseInfoDto = this.getOrderCargoControlReleaseInfo(orderCargoControlApplyVO.getOrderId());
...@@ -672,6 +698,15 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont ...@@ -672,6 +698,15 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
list.add(applyInfoVO); list.add(applyInfoVO);
} }
} else if (orderCargoControlApplyVO.getApplyType() == 62) { } else if (orderCargoControlApplyVO.getApplyType() == 62) {
if (Objects.isNull(orderCargoControlApplyVO.getIsOverseasWarehouse())) {
throw exception(10000000, "请选择订单海外仓修改是或否");
}
if (StringUtils.isNotBlank(orderDO.getType()) && orderDO.getType().contains("2") && orderCargoControlApplyVO.getIsOverseasWarehouse()) {
throw exception(10000000, "该订单已经是海外仓订单");
}
if ((StringUtils.isBlank(orderDO.getType()) || !orderDO.getType().contains("2")) && !orderCargoControlApplyVO.getIsOverseasWarehouse()) {
throw exception(10000000, "该订单已经是非海外仓订单");
}
orderApprovalDO.setOrderId(orderCargoControlApplyVO.getOrderId()); orderApprovalDO.setOrderId(orderCargoControlApplyVO.getOrderId());
orderApprovalDO.setType(62); orderApprovalDO.setType(62);
orderApprovalDO.setDetails(JSONObject.toJSONString(orderCargoControlApplyVO)); orderApprovalDO.setDetails(JSONObject.toJSONString(orderCargoControlApplyVO));
...@@ -681,8 +716,17 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont ...@@ -681,8 +716,17 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
orderApprovalDO.setFormId(formId); orderApprovalDO.setFormId(formId);
msg = "海外仓修改申请"; msg = "海外仓修改申请";
ApplyInfoVO applyInfoVO = new ApplyInfoVO(); ApplyInfoVO applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改为海外仓模式"); applyInfoVO.setName("订单修改海外仓模式");
// 这里不用判断订单中的值了,只需要看申请结果就能得出原值和新值相反的文案结果
applyInfoVO.setOrgValue(orderCargoControlApplyVO.getIsOverseasWarehouse() ? "订单修改为非海外仓" : "订单修改为海外仓");
applyInfoVO.setNewValue(orderCargoControlApplyVO.getIsOverseasWarehouse() ? "订单修改为海外仓" : "订单修改为非海外仓");
list.add(applyInfoVO); list.add(applyInfoVO);
if (StringUtils.isNotBlank(orderCargoControlApplyVO.getReasonZh())) {
applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改海外仓模式理由");
applyInfoVO.setNewValue(orderCargoControlApplyVO.getReasonZh());
list.add(applyInfoVO);
}
} }
orderApprovalMapper.updateById(orderApprovalDO); orderApprovalMapper.updateById(orderApprovalDO);
orderService.updateStatus(orderApprovalDO.getOrderId(), "", null, null, null, null, orderApprovalDO.getType(), OrderApprovalTypeResultEnum.typeAndResultOf(orderApprovalDO.getType(), 1).getDesc(), false); orderService.updateStatus(orderApprovalDO.getOrderId(), "", null, null, null, null, orderApprovalDO.getType(), OrderApprovalTypeResultEnum.typeAndResultOf(orderApprovalDO.getType(), 1).getDesc(), false);
......
...@@ -87,6 +87,10 @@ public class OrderCargoControlApplyVO { ...@@ -87,6 +87,10 @@ public class OrderCargoControlApplyVO {
private Integer newLockConsigneeDay; private Integer newLockConsigneeDay;
@ApiModelProperty(value = "是否海外仓")
private Boolean isOverseasWarehouse;
@ApiModelProperty(value = "附件") @ApiModelProperty(value = "附件")
private String annex; private String annex;
......
...@@ -160,6 +160,14 @@ public class OrderCargoControlController { ...@@ -160,6 +160,14 @@ public class OrderCargoControlController {
return success(applyVO); return success(applyVO);
} }
@GetMapping("overseas-warehouse-update/info/{orderId}")
@ApiOperation("根据订单ID查询订单海外仓修改审核详情")
@ApiImplicitParam(name = "orderId", value = "订单ID", required = true, example = "1024", dataType = "Long")
public CommonResult<OrderCargoControlApplyVO> approvalOrderCargoControlOverseasWarehouseUpdateByOrderId(@PathVariable(value = "orderId") Long orderId) {
OrderCargoControlApplyVO applyVO = orderCargoControlService.approvalOrderCargoControlOverseasWarehouseUpdateByOrderId(orderId);
return success(applyVO);
}
@GetMapping("cancel/approval/{orderApprovalId}") @GetMapping("cancel/approval/{orderApprovalId}")
@ApiOperation("根据审批id取消审批") @ApiOperation("根据审批id取消审批")
@ApiImplicitParams({ @ApiImplicitParams({
......
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