给单据附件的数量进行限制,不能超出条数

This commit is contained in:
季圣华
2023-06-08 00:54:58 +08:00
parent f35b2fa3b3
commit d59ace2149
2 changed files with 19 additions and 0 deletions

View File

@@ -936,6 +936,14 @@ public class DepotHeadService {
}
}
}
//校验附件的数量
if(StringUtil.isNotEmpty(depotHead.getFileName())) {
String[] fileArr = depotHead.getFileName().split(",");
if(fileArr.length>4) {
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_FILE_NUM_LIMIT_CODE,
String.format(ExceptionConstants.DEPOT_HEAD_FILE_NUM_LIMIT_MSG, 4));
}
}
try{
depotHeadMapper.insertSelective(depotHead);
}catch(Exception e){
@@ -1025,6 +1033,14 @@ public class DepotHeadService {
}
}
}
//校验附件的数量
if(StringUtil.isNotEmpty(depotHead.getFileName())) {
String[] fileArr = depotHead.getFileName().split(",");
if(fileArr.length>4) {
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_FILE_NUM_LIMIT_CODE,
String.format(ExceptionConstants.DEPOT_HEAD_FILE_NUM_LIMIT_MSG, 4));
}
}
try{
depotHeadMapper.updateByPrimaryKeySelective(depotHead);
}catch(Exception e){