虚拟清单,法规清单--导入(下拉数据字典验证)

This commit is contained in:
zhn
2022-05-07 17:54:33 +08:00
parent 60c6298e8b
commit 4f222390b0
2 changed files with 28 additions and 28 deletions
@@ -886,7 +886,7 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
//实施类别(单选不必填)
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, implementType,msgList,"实施类别","implementation category");
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, implementType,msgList,"实施类别","implementation category","implement_type");
if(StringUtils.isNotBlank(value)){
dummyInventoryInfoEO.setImplementType(value);
}
@@ -903,7 +903,7 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
// dummyInventoryInfoEO.setImplementTime(implementTime);
// }
//认证类型(单选不必填)
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, attestationType,msgList,"认证类型","certification type");
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, attestationType,msgList,"认证类型","certification type","attestation_type");
if(StringUtils.isNotBlank(value)){
dummyInventoryInfoEO.setAttestationType(value);
}
@@ -911,7 +911,7 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
//认证级别(单选必填)
flag = must(dummyInventoryInfoEO, errorMsg, msgList, attestationRank,"认证级别","certification level");
if(flag){
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, attestationRank,msgList,"认证级别","certification level");
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, attestationRank,msgList,"认证级别","certification level","attestation_rank");
if(StringUtils.isNotBlank(value)){
dummyInventoryInfoEO.setAttestationRank(value);
}
@@ -920,7 +920,7 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
//责任领域(多选必填)
flag = must(dummyInventoryInfoEO, errorMsg, msgList, dutyTerritory,"责任领域","area of responsibility");
if(flag){
value = pullMore(dictItemList, dummyInventoryInfoEO, errorMsg, dutyTerritory,msgList,"责任领域","area of responsibility");
value = pullMore(dictItemList, dummyInventoryInfoEO, errorMsg, dutyTerritory,msgList,"责任领域","area of responsibility","duty_territory");
if(StringUtils.isNotBlank(value)){
dummyInventoryInfoEO.setDutyTerritory(value);
}
@@ -928,7 +928,7 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
//设计
//交付物类型
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, designDeliverableType,msgList,"交付物类型","type of deliverables");
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, designDeliverableType,msgList,"交付物类型","type of deliverables","deliverable_template");
if(StringUtils.isNotBlank(value)){
dummyInventoryInfoEO.setDesignDeliverableType(value);
}
@@ -940,20 +940,20 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
}
//发起人
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, designInitiator,msgList,"发起人","initiator");
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, designInitiator,msgList,"发起人","initiator","fa1_qi3_ren2");
if(StringUtils.isNotBlank(value)){
dummyInventoryInfoEO.setDesignInitiator(value);
}
//责任人
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, designDuty,msgList,"责任人","person liable");
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, designDuty,msgList,"责任人","person liable","ze2_ren4_ren2");
if(StringUtils.isNotBlank(value)){
dummyInventoryInfoEO.setDesignDuty(value);
}
//pre
//交付物类型
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, prehomoDeliverableType,msgList,"交付物类型","type of deliverables");
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, prehomoDeliverableType,msgList,"交付物类型","type of deliverables","deliverable_template");
if(StringUtils.isNotBlank(value)){
dummyInventoryInfoEO.setPrehomoDeliverableType(value);
}
@@ -965,20 +965,20 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
}
//发起人
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, prehomoInitiator,msgList,"发起人","initiator");
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, prehomoInitiator,msgList,"发起人","initiator","fa1_qi3_ren2");
if(StringUtils.isNotBlank(value)){
dummyInventoryInfoEO.setPrehomoInitiator(value);
}
//责任人
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, prehomoDuty,msgList,"责任人","person liable");
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, prehomoDuty,msgList,"责任人","person liable","ze2_ren4_ren2");
if(StringUtils.isNotBlank(value)){
dummyInventoryInfoEO.setPrehomoDuty(value);
}
//确认
//交付物类型
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, verifyDeliverableType,msgList,"交付物类型","type of deliverables");
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, verifyDeliverableType,msgList,"交付物类型","type of deliverables","deliverable_template");
if(StringUtils.isNotBlank(value)){
dummyInventoryInfoEO.setVerifyDeliverableType(value);
}
@@ -991,13 +991,13 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
//发起人
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, verifyInitiator,msgList,"发起人","initiator");
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, verifyInitiator,msgList,"发起人","initiator","fa1_qi3_ren2");
if(StringUtils.isNotBlank(value)){
dummyInventoryInfoEO.setVerifyInitiator(value);
}
//责任人
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, verifyDuty,msgList,"责任人","person liable");
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, verifyDuty,msgList,"责任人","person liable","ze2_ren4_ren2");
if(StringUtils.isNotBlank(value)){
dummyInventoryInfoEO.setVerifyDuty(value);
}
@@ -1159,7 +1159,7 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
private String pullSingle(List<SysDictItem> dictItemList, DummyInventoryInfoEO dummyInventoryInfoEO,
String errorMsg, String value,List<String> msgList,
String nameCn,String nameEn) {
String nameCn,String nameEn,String dictCode) {
if(StringUtils.isNotBlank(value)){
if(value.contains(",")){
if(CutEnum.CN.getValue().equals(dummyInventoryInfoEO.getCut())){
@@ -1169,7 +1169,7 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
}
msgList.add(errorMsg);
}else{
List<SysDictItem> collect = dictItemList.stream().filter(e -> value.equals(e.getItemText())).collect(Collectors.toList());
List<SysDictItem> collect = dictItemList.stream().filter(e ->dictCode.equals(e.getDictCode()) && value.equals(e.getItemText())).collect(Collectors.toList());
if (collect.size() == 0) {
if(CutEnum.CN.getValue().equals(dummyInventoryInfoEO.getCut())){
errorMsg += nameCn + "中的" + value + "与数据字典不匹配";
@@ -1186,11 +1186,11 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
}
private String pullMore(List<SysDictItem> dictItemList, DummyInventoryInfoEO dummyInventoryInfoEO,
String errorMsg, String value,List<String> msgList,
String nameCn,String nameEn) {
String nameCn,String nameEn,String dictCode) {
List<String> valueList = new ArrayList<>();
if (StringUtils.isNotBlank(value)) {
List<String> list = Arrays.asList(value.split(","));
List<SysDictItem> collect = dictItemList.stream().filter(e -> list.contains(e.getItemText())).collect(Collectors.toList());
List<SysDictItem> collect = dictItemList.stream().filter(e -> dictCode.equals(e.getDictCode()) && list.contains(e.getItemText())).collect(Collectors.toList());
if(list.size() == collect.size()){
valueList = collect.stream().map(SysDictItem::getItemValue).collect(Collectors.toList());
}else{
@@ -1916,7 +1916,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
//实施类别(单选不必填)
value = pullSingle(dictItemList, projectLawsInventoryEO, errorMsg, implementType,msgList,"实施类别","implementation category");
value = pullSingle(dictItemList, projectLawsInventoryEO, errorMsg, implementType,msgList,"实施类别","implementation category","implement_type");
if(StringUtils.isNotBlank(value)){
projectLawsInventoryEO.setImplementType(value);
}
@@ -1933,7 +1933,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
// dummyInventoryInfoEO.setImplementTime(implementTime);
// }
//认证类型(单选不必填)
value = pullSingle(dictItemList, projectLawsInventoryEO, errorMsg, attestationType,msgList,"认证类型","certification type");
value = pullSingle(dictItemList, projectLawsInventoryEO, errorMsg, attestationType,msgList,"认证类型","certification type","attestation_type");
if(StringUtils.isNotBlank(value)){
projectLawsInventoryEO.setAttestationType(value);
}
@@ -1941,7 +1941,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
//认证级别(单选必填)
flag = must(projectLawsInventoryEO, errorMsg, msgList, attestationRank,"认证级别","certification level");
if(flag){
value = pullSingle(dictItemList, projectLawsInventoryEO, errorMsg, attestationRank,msgList,"认证级别","certification level");
value = pullSingle(dictItemList, projectLawsInventoryEO, errorMsg, attestationRank,msgList,"认证级别","certification level","attestation_rank");
if(StringUtils.isNotBlank(value)){
projectLawsInventoryEO.setAttestationRank(value);
}
@@ -1950,7 +1950,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
//责任领域(多选必填)
flag = must(projectLawsInventoryEO, errorMsg, msgList, dutyTerritory,"责任领域","area of responsibility");
if(flag){
value = pullMore(dictItemList, projectLawsInventoryEO, errorMsg, dutyTerritory,msgList,"责任领域","area of responsibility");
value = pullMore(dictItemList, projectLawsInventoryEO, errorMsg, dutyTerritory,msgList,"责任领域","area of responsibility","duty_territory");
if(StringUtils.isNotBlank(value)){
projectLawsInventoryEO.setDutyTerritory(value);
}
@@ -1996,7 +1996,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
//设计
//交付物类型
value = pullSingle(dictItemList, projectLawsInventoryEO, errorMsg, designDeliverableType,msgList,"交付物类型","type of deliverables");
value = pullSingle(dictItemList, projectLawsInventoryEO, errorMsg, designDeliverableType,msgList,"交付物类型","type of deliverables","deliverable_template");
if(StringUtils.isNotBlank(value)){
projectLawsInventoryEO.setDesignDeliverableType(value);
}
@@ -2032,7 +2032,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
//pre
//交付物类型
value = pullSingle(dictItemList, projectLawsInventoryEO, errorMsg, prehomoDeliverableType,msgList,"交付物类型","type of deliverables");
value = pullSingle(dictItemList, projectLawsInventoryEO, errorMsg, prehomoDeliverableType,msgList,"交付物类型","type of deliverables","deliverable_template");
if(StringUtils.isNotBlank(value)){
projectLawsInventoryEO.setPrehomoDeliverableType(value);
}
@@ -2067,7 +2067,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
//确认
//交付物类型
value = pullSingle(dictItemList, projectLawsInventoryEO, errorMsg, verifyDeliverableType,msgList,"交付物类型","type of deliverables");
value = pullSingle(dictItemList, projectLawsInventoryEO, errorMsg, verifyDeliverableType,msgList,"交付物类型","type of deliverables","deliverable_template");
if(StringUtils.isNotBlank(value)){
projectLawsInventoryEO.setVerifyDeliverableType(value);
}
@@ -2246,11 +2246,11 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
private String pullMore(List<SysDictItem> dictItemList, ProjectLawsInventoryEO projectLawsInventoryEO,
String errorMsg, String value,List<String> msgList,
String nameCn,String nameEn) {
String nameCn,String nameEn,String dictCode) {
List<String> valueList = new ArrayList<>();
if (StringUtils.isNotBlank(value)) {
List<String> list = Arrays.asList(value.split(","));
List<SysDictItem> collect = dictItemList.stream().filter(e -> list.contains(e.getItemText())).collect(Collectors.toList());
List<SysDictItem> collect = dictItemList.stream().filter(e ->dictCode.equals(e.getDictCode()) && list.contains(e.getItemText())).collect(Collectors.toList());
if(list.size() == collect.size()){
valueList = collect.stream().map(SysDictItem::getItemValue).collect(Collectors.toList());
}else{
@@ -2270,7 +2270,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
private String pullSingle(List<SysDictItem> dictItemList, ProjectLawsInventoryEO projectLawsInventoryEO,
String errorMsg, String value,List<String> msgList,
String nameCn,String nameEn) {
String nameCn,String nameEn,String dictCode) {
if(StringUtils.isNotBlank(value)){
if(value.contains(",")){
if(CutEnum.CN.getValue().equals(projectLawsInventoryEO.getCut())){
@@ -2280,7 +2280,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
}
msgList.add(errorMsg);
}else{
List<SysDictItem> collect = dictItemList.stream().filter(e -> value.equals(e.getItemText())).collect(Collectors.toList());
List<SysDictItem> collect = dictItemList.stream().filter(e ->dictCode.equals(e.getDictCode()) && value.equals(e.getItemText())).collect(Collectors.toList());
if (collect.size() == 0) {
if(CutEnum.CN.getValue().equals(projectLawsInventoryEO.getCut())){
errorMsg += nameCn + "中的" + value + "与数据字典不匹配";