序列号校验

pro
anthonywj 2 years ago
parent ae1be7bbf3
commit b9edabf126

@ -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();

Loading…
Cancel
Save