From b9edabf12608dd7e58f616e51df855dd6cc8520e Mon Sep 17 00:00:00 2001 From: anthonywj Date: Sat, 3 Jun 2023 22:41:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=8F=E5=88=97=E5=8F=B7=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inout/IoCodeTempController.java | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java index a577f7f6..741c099a 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java @@ -822,7 +822,9 @@ public class IoCodeTempController extends BaseController { if (StrUtil.isEmpty(udiEntity.getExpireDate()) && !udiRelevanceResponse.getAllowNoExpire()) { errMsg = errMsg + ",失效日期"; } - + if (StrUtil.isEmpty(udiEntity.getSerialNo()) && !udiRelevanceResponse.getAllowNoSerial()) { + errMsg = errMsg + ",序列号"; + } if (StrUtil.isNotEmpty(errMsg)) { BaseResponse baseResponse = ResultVOUtils.error(507, "产品三期缺失请补齐" + errMsg.substring(1) + ""); baseResponse.setData(udiEntity); @@ -831,6 +833,38 @@ public class IoCodeTempController extends BaseController { return null; } + //校验条码完整性 + public BaseResponse checkCodeIntegrity(UdiRelevanceResponse checkUdi, UdiEntity udiEntity) { + String lostMsg = ""; + //校验条码完整性 + if ("是".equals(checkUdi.getScbssfbhph()) && StrUtil.isEmpty(udiEntity.getBatchNo())) { + lostMsg = lostMsg + ",批次号"; + } + if ("是".equals(checkUdi.getScbssfbhscrq()) && StrUtil.isEmpty(udiEntity.getProduceDate())) { + lostMsg = lostMsg + ",生产日期"; + } + + if ("是".equals(checkUdi.getScbssfbhsxrq()) && StrUtil.isEmpty(udiEntity.getExpireDate())) { + lostMsg = lostMsg + ",失效日期"; + } + if (("是".equals(checkUdi.getScbssfbhxlh()) && StrUtil.isEmpty(udiEntity.getSerialNo())) + ) { + lostMsg = lostMsg + ",序列号"; + } + if (StrUtil.isNotEmpty(udiEntity.getSerialNo()) && udiEntity.getSerialNo().length() > 20) { + return ResultVOUtils.error(504, "序列号超出20位!"); + } + if (StrUtil.isNotEmpty(udiEntity.getBatchNo()) && udiEntity.getBatchNo().length() > 20) { + return ResultVOUtils.error(504, "批次号超出20位!"); + } + if (StrUtil.isEmpty(udiEntity.getSerialNo()) && StrUtil.isEmpty(udiEntity.getBatchNo())) { + lostMsg = "批次号与序列号不能同时为空!"; + } + if (StrUtil.isNotEmpty(lostMsg)) + return ResultVOUtils.error(500, lostMsg); + else return null; + } + //校验供应商是否配送此产品 public BaseResponse checkCorp(IoCodeTempEntity codeEnttity, BasicBussinessTypeEntity bussinessTypeEntity, String unitFk) { CompanyProductRelevanceRequest companyProductRelevanceRequest = new CompanyProductRelevanceRequest();