From 841d30fddd6735193d0b44b9c8b880b00fd01cd8 Mon Sep 17 00:00:00 2001 From: jishenghua <752718920@qq.com> Date: Thu, 15 Aug 2024 00:07:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3bug=EF=BC=9A=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E5=87=BA=E5=85=A5=E5=BA=93=E7=AE=A1=E7=90=86=E4=B9=8B?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E5=9C=A8=E7=BB=99=E9=87=87=E8=B4=AD=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E5=8D=95=E5=81=9A=E6=89=B9=E9=87=8F=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E9=9C=80=E8=A6=81=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E4=B8=80=E4=B8=8B=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/jsh/erp/constants/ExceptionConstants.java | 3 +++ .../com/jsh/erp/service/depotHead/DepotHeadService.java | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/jshERP-boot/src/main/java/com/jsh/erp/constants/ExceptionConstants.java b/jshERP-boot/src/main/java/com/jsh/erp/constants/ExceptionConstants.java index 4b5dd94fe..3b18a4f51 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/constants/ExceptionConstants.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/constants/ExceptionConstants.java @@ -436,6 +436,9 @@ public class ExceptionConstants { //单据录入-关联请购单号和关联订单号不能同时录入 public static final int DEPOT_ITEM_EXIST_REPEAT_NO_FAILED_CODE = 8500029; public static final String DEPOT_ITEM_EXIST_REPEAT_NO_FAILED_MSG = "抱歉,关联请购单号和关联订单号不能同时录入"; + //单据录入-单据最新状态不能进行批量操作 + public static final int DEPOT_ITEM_EXIST_NEW_STATUS_FAILED_CODE = 8500030; + public static final String DEPOT_ITEM_EXIST_NEW_STATUS_FAILED_MSG = "抱歉,单据:%s最新状态不能进行批量操作"; /** * 单据明细信息 diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java index 687220184..3377c66eb 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java @@ -1711,6 +1711,12 @@ public void batchAddDepotHeadAndDetail(String ids, HttpServletRequest request) t String prefixNo = BusinessConstants.DEPOTHEAD_TYPE_IN.equals(depotHead.getType())?"QTRK":"QTCK"; //关联单据单号 String oldNumber = depotHead.getNumber(); + //校验单据最新状态不能进行批量操作 + if("0".equals(depotHead.getStatus()) || "2".equals(depotHead.getStatus()) || "9".equals(depotHead.getStatus())) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_ITEM_EXIST_NEW_STATUS_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_ITEM_EXIST_NEW_STATUS_FAILED_MSG, oldNumber, depotHead.getType())); + } + //校验是否是部分入库或者部分出库 if("3".equals(depotHead.getStatus())) { throw new BusinessRunTimeException(ExceptionConstants.DEPOT_ITEM_EXIST_PARTIALLY_STATUS_FAILED_CODE, String.format(ExceptionConstants.DEPOT_ITEM_EXIST_PARTIALLY_STATUS_FAILED_MSG, oldNumber, depotHead.getType()));