|
@@ -426,17 +426,26 @@ public class CompanyServiceImpl implements CompanyService {
|
|
|
|
|
|
List<CompanyVo> resultList = new ArrayList<>();
|
|
|
PcSite finalCurLoginUserSiteInfo = curLoginUserSiteInfo;
|
|
|
- HashMap<String,String> nameCodeList = new HashMap<>();
|
|
|
+ List<String> allCodeList = new ArrayList<>();
|
|
|
+ List<String> allNameList = new ArrayList<>();
|
|
|
+ List<String> repeatCodeList = new ArrayList<>();
|
|
|
+ List<String> repeatNameList = new ArrayList<>();
|
|
|
dataList.forEach(item->{
|
|
|
- if(!nameCodeList.containsValue(item.getCompanyCode())){
|
|
|
- nameCodeList.put("CompanyCode",item.getCompanyCode());
|
|
|
+ var curCompanyCode = item.getCompanyCode();
|
|
|
+ var curCompanyName = item.getCompanyName();
|
|
|
+ if(!allCodeList.contains(curCompanyCode)){
|
|
|
+ allCodeList.add(curCompanyCode);
|
|
|
}else{
|
|
|
- throw new BaseException("","企业信息导入数据存在相同的信用代码!");
|
|
|
+ if(!repeatCodeList.contains(curCompanyCode)){
|
|
|
+ repeatCodeList.add(curCompanyCode);
|
|
|
+ }
|
|
|
}
|
|
|
- if(!nameCodeList.containsValue(item.getCompanyName())){
|
|
|
- nameCodeList.put("CompanyName",item.getCompanyName());
|
|
|
+ if(!allNameList.contains(curCompanyName)){
|
|
|
+ allNameList.add(curCompanyName);
|
|
|
}else{
|
|
|
- throw new BaseException("","企业信息导入数据存在相同的企业名称!");
|
|
|
+ if(!repeatNameList.contains(curCompanyName)){
|
|
|
+ repeatNameList.add(curCompanyName);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
dataList.forEach(item -> {
|
|
@@ -449,7 +458,7 @@ public class CompanyServiceImpl implements CompanyService {
|
|
|
errorInfo += "请填写统一信用代码!";
|
|
|
else{
|
|
|
if(!regexUtils.theCodeIsValid(item.companyCode)){
|
|
|
- errorInfo +="输入的统一信用代码无效";
|
|
|
+ errorInfo +="输入的统一信用代码无效!";
|
|
|
}else{
|
|
|
var result = ifHadRepeatData(item,false,userID);
|
|
|
errorInfo += !result.equals("0")? result:"";
|
|
@@ -625,7 +634,26 @@ public class CompanyServiceImpl implements CompanyService {
|
|
|
errorInfo += "企业规模不存在!";
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ if(repeatCodeList.stream().count()>0){
|
|
|
+ if(repeatCodeList.contains(item.getCompanyCode())){
|
|
|
+ errorInfo = "导入数据存在相同的信用代码!";
|
|
|
+ if(repeatNameList.stream().count()>0){
|
|
|
+ if(repeatNameList.contains(item.getCompanyName())){
|
|
|
+ errorInfo += "导入数据存在相同的企业名称!";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(repeatNameList.stream().count()>0){
|
|
|
+ if(repeatNameList.contains(item.getCompanyName())){
|
|
|
+ errorInfo = "导入数据存在相同的企业名称!";
|
|
|
+ if(repeatCodeList.stream().count()>0){
|
|
|
+ if(repeatCodeList.contains(item.getCompanyCode())){
|
|
|
+ errorInfo += "导入数据存在相同的信用代码!";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if (stringUtils.IsNullOrEmpty(errorInfo)) {
|
|
|
resultList.add(item);
|