From cb5c6671172fc970832b5b855a9afb6d33a44674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Wed, 20 Sep 2023 00:01:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=95=86=E5=93=81=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E7=9A=84=E6=8F=90=E7=A4=BA=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E6=9D=A1=E7=A0=81=E4=B8=BA=E7=A9=BA=E7=9A=84?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/jsh/erp/constants/ExceptionConstants.java | 3 +++ .../java/com/jsh/erp/service/material/MaterialService.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 03a4a8ad..daf6509c 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 @@ -338,6 +338,9 @@ public class ExceptionConstants { //商品条码不存在,请重新选择 public static final int MATERIAL_BARCODE_IS_NOT_EXIST_CODE = 8000026; public static final String MATERIAL_BARCODE_IS_NOT_EXIST_MSG = "商品条码%s不存在,请重新选择"; + //基本条码为空 + public static final int MATERIAL_BARCODE_EMPTY_CODE = 8000027; + public static final String MATERIAL_BARCODE_EMPTY_MSG = "第%s行基本条码为空"; /** * 单据信息 diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/material/MaterialService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/material/MaterialService.java index 792cec94..6e6f63d8 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/material/MaterialService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/material/MaterialService.java @@ -664,7 +664,12 @@ public class MaterialService { throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_ENABLED_ERROR_CODE, String.format(ExceptionConstants.MATERIAL_ENABLED_ERROR_MSG, i+1)); } - //校验基础条码长度为4到40位 + //校验基本条码长度为空 + if(StringUtil.isEmpty(barCode)) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_EMPTY_CODE, + String.format(ExceptionConstants.MATERIAL_BARCODE_EMPTY_MSG, i+1)); + } + //校验基本条码长度为4到40位 if(!StringUtil.checkBarCodeLength(barCode)) { throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_LENGTH_ERROR_CODE, String.format(ExceptionConstants.MATERIAL_BARCODE_LENGTH_ERROR_MSG, barCode));