From 8e1bd4621c143400baffbb94657fb7118b938fa1 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Mon, 29 May 2023 17:55:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E6=8D=AE=E5=AE=A1=E6=A0=B8UDI?= =?UTF-8?q?=E7=A0=81=E5=90=8E=E9=9D=A2=E5=8A=A0GS1=E7=AC=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/inout/IoOrderController.java | 4 ++++ .../inout/IoOrderReviewController.java | 20 +++++++++++++++---- .../inout/impl/IoOrderServiceImpl.java | 1 + 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java index 668a8925..27826c7f 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderController.java @@ -395,6 +395,10 @@ public class IoOrderController extends BaseController { @PostMapping("udiwms/inout/order/delete") @Log(title = "单据管理", businessType = BusinessType.DELETE) public BaseResponse deletById(@RequestBody DeleteRequest deleteRequest) { + IoOrderEntity orderEntity = orderService.findByBillNo(deleteRequest.getBillNo()); + if (orderEntity.getStatus() != 1 && orderEntity.getStatus() != 3 && orderEntity.getStatus() != 4 && orderEntity.getStatus() != 6) { + return ResultVOUtils.error(500, "单据已提交无法删除!"); + } orderService.deleteByBillNo(deleteRequest.getBillNo()); orderDetailBizService.deleteByOrderId(deleteRequest.getBillNo()); orderDetailCodeService.deleteByOrderId(deleteRequest.getBillNo()); diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderReviewController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderReviewController.java index ecf03798..020e1d1f 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderReviewController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderReviewController.java @@ -327,13 +327,15 @@ public class IoOrderReviewController extends BaseController { if (StrUtil.isNotEmpty(code)) { code = code.replace("\r\n", ""); } - if (code.endsWith("\u001D")) { code = code.replace("\u001D", ""); } - for (IoCodeEntity checkOrderCodesBean : codesList) { - if (checkOrderCodesBean.getCode().toUpperCase(Locale.ROOT).equals(code.toUpperCase(Locale.ROOT))) { + String checkCode = checkOrderCodesBean.getCode(); + if (checkCode.endsWith("\u001D")) { + checkCode = checkCode.replace("\u001D", ""); + } + if (checkCode.toUpperCase(Locale.ROOT).equals(code.toUpperCase(Locale.ROOT))) { if (checkOrderCodesBean.getStatus() == Constant.DB_CHECK_ED && IntUtil.value(checkOrderCodesBean.getReCount()) == checkOrderCodesBean.getScanCount()) { return Constant.CHECK_REPEAT; @@ -351,8 +353,18 @@ public class IoOrderReviewController extends BaseController { public IoCodeEntity isExit(List codeList, String code) { if (CollUtil.isNotEmpty(codeList)) { + if (StrUtil.isNotEmpty(code)) { + code = code.replace("\r\n", ""); + } + if (code.endsWith("\u001D")) { + code = code.replace("\u001D", ""); + } for (IoCodeEntity codeEntity : codeList) { - if (codeEntity.getCode().equals(code)) { + String checkCode = codeEntity.getCode(); + if (checkCode.endsWith("\u001D")) { + checkCode = checkCode.replace("\u001D", ""); + } + if (checkCode.equals(code)) { return codeEntity; } } diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java index b426efe3..b1d62bd0 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java @@ -276,6 +276,7 @@ public class IoOrderServiceImpl implements IoOrderService { } } + return 0; }