Commit ab597f07 authored by fangxinjiang's avatar fangxinjiang

项目配置限制项优化-fxj

parent 0fea4a75
...@@ -2222,7 +2222,7 @@ private R<Boolean> checkItemRepeat(List<SysAutoDictItem> autoDictItems, Map<Stri ...@@ -2222,7 +2222,7 @@ private R<Boolean> checkItemRepeat(List<SysAutoDictItem> autoDictItems, Map<Stri
if (Common.isEmpty(entity)) { if (Common.isEmpty(entity)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), errorMessageList.add(new ErrorMessage(excel.getRowIndex(),
"项目编码不存在: " + excel.getDeptNo(),excel)); "项目编码配置不存在: " + excel.getDeptNo(),excel));
return; return;
} }
//档案默认不限制 //档案默认不限制
...@@ -2237,21 +2237,55 @@ private R<Boolean> checkItemRepeat(List<SysAutoDictItem> autoDictItems, Map<Stri ...@@ -2237,21 +2237,55 @@ private R<Boolean> checkItemRepeat(List<SysAutoDictItem> autoDictItems, Map<Stri
String newRestrictContract = excel.getRestrictContract(); String newRestrictContract = excel.getRestrictContract();
String newRestrictSocialFund = excel.getRestrictSocialFund(); String newRestrictSocialFund = excel.getRestrictSocialFund();
// 校验autoFlag的值必须为0或1
if (!CommonConstants.ZERO_STRING.equals(newAutoFlag) && !CommonConstants.ONE_STRING.equals(newAutoFlag)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),
"是否限制值不合法,必须为限制或不限制",excel));
return;
}
// 校验restrictInsurance的值必须为0或1
if (Common.isNotNull(newRestrictInsurance) &&
!CommonConstants.ZERO_STRING.equals(newRestrictInsurance) &&
!CommonConstants.ONE_STRING.equals(newRestrictInsurance)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),
"商险限制值不合法,必须为限制或不限制",excel));
return;
}
// 校验restrictContract的值必须为0或1
if (Common.isNotNull(newRestrictContract) &&
!CommonConstants.ZERO_STRING.equals(newRestrictContract) &&
!CommonConstants.ONE_STRING.equals(newRestrictContract)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),
"合同限制值不合法,必须为限制或不限制",excel));
return;
}
// 校验restrictSocialFund的值必须为0或1
if (Common.isNotNull(newRestrictSocialFund) &&
!CommonConstants.ZERO_STRING.equals(newRestrictSocialFund) &&
!CommonConstants.ONE_STRING.equals(newRestrictSocialFund)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),
"社保公积金限制值不合法,必须为限制或不限制",excel));
return;
}
// 业务规则:如果是否限制为"是"(0),各限制分项不能为空,且至少有一项为限制(1) // 业务规则:如果是否限制为"是"(0),各限制分项不能为空,且至少有一项为限制(1)
if (CommonConstants.ZERO_STRING.equals(newAutoFlag)) { if (CommonConstants.ZERO_STRING.equals(newAutoFlag)) {
if (Common.isEmpty(newRestrictInsurance)) { if (Common.isEmpty(newRestrictInsurance)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), errorMessageList.add(new ErrorMessage(excel.getRowIndex(),
"是否限制为是时,限制商险不能为空",excel)); "是否限制为是时,商险不能为空",excel));
return; return;
} }
if (Common.isEmpty(newRestrictContract)) { if (Common.isEmpty(newRestrictContract)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), errorMessageList.add(new ErrorMessage(excel.getRowIndex(),
"是否限制为是时,限制合同不能为空",excel)); "是否限制为是时,合同不能为空",excel));
return; return;
} }
if (Common.isEmpty(newRestrictSocialFund)) { if (Common.isEmpty(newRestrictSocialFund)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), errorMessageList.add(new ErrorMessage(excel.getRowIndex(),
"是否限制为是时,限制社保公积金不能为空",excel)); "是否限制为是时,社保公积金不能为空",excel));
return; return;
} }
// 限制项至少有一项为限制(1) // 限制项至少有一项为限制(1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment