From c004f8728fab789ed24dd443883cea4d25d5301b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Sun, 22 Aug 2021 18:16:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=B0=83=E6=8B=A8=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E5=8D=95=E6=8D=AE=E7=9A=84=E4=BB=93=E5=BA=93=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/jsh/erp/constants/ExceptionConstants.java | 3 +++ .../com/jsh/erp/service/depotItem/DepotItemService.java | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) 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 d36eab33..c884def5 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 @@ -324,6 +324,9 @@ public class ExceptionConstants { //单据录入-退货单不能欠款 public static final int DEPOT_HEAD_BACK_BILL_DEBT_FAILED_CODE = 8500009; public static final String DEPOT_HEAD_BACK_BILL_DEBT_FAILED_MSG = "退货单不能欠款"; + //单据录入-调入仓库与原仓库不能重复 + public static final int DEPOT_HEAD_ANOTHER_DEPOT_EQUAL_FAILED_CODE = 8500010; + public static final String DEPOT_HEAD_ANOTHER_DEPOT_EQUAL_FAILED_MSG = "调入仓库与原仓库不能重复"; /** * 单据明细信息 * type = 90 diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java index 2640d403..c0c67ceb 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java @@ -368,7 +368,12 @@ public class DepotItemService { } if(BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubType())) { if (StringUtil.isExist(rowObj.get("anotherDepotId"))) { - depotItem.setAnotherDepotId(rowObj.getLong("anotherDepotId")); + if(rowObj.getLong("anotherDepotId").equals(rowObj.getLong("depotId"))) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_ANOTHER_DEPOT_EQUAL_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_ANOTHER_DEPOT_EQUAL_FAILED_MSG)); + } else { + depotItem.setAnotherDepotId(rowObj.getLong("anotherDepotId")); + } } else { throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_ANOTHER_DEPOT_FAILED_CODE, String.format(ExceptionConstants.DEPOT_HEAD_ANOTHER_DEPOT_FAILED_MSG));