Kaynağa Gözat

企业、求职人员信息导入数据检索调整

liao-sea 3 ay önce
ebeveyn
işleme
bd1523b17c

+ 37 - 9
src/main/java/com/hz/employmentsite/services/impl/companyService/CompanyServiceImpl.java

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

+ 37 - 7
src/main/java/com/hz/employmentsite/services/impl/jobUserManager/JobUserServiceImpl.java

@@ -697,17 +697,26 @@ public class JobUserServiceImpl implements JobUserService {
         List<JobUserVo> resultList = new ArrayList<>();
         PcSite finalCurLoginUserSiteInfo = curLoginUserSiteInfo;
 
-        HashMap<String,String> idPhoneList = new HashMap<>();
+        List<String> allIdentityList = new ArrayList<>();
+        List<String> allPhoneList = new ArrayList<>();
+        List<String> repeatIdentityList = new ArrayList<>();
+        List<String> repeatUserMobileList = new ArrayList<>();
         dataList.forEach(item->{
-            if(!idPhoneList.containsValue(item.getIdentityNumber())){
-                idPhoneList.put("IdentityNumber",item.getIdentityNumber());
+            var curIdentityNumber = item.getIdentityNumber();
+            var curUserMobile = item.getUserMobile();
+            if(!allIdentityList.contains(curIdentityNumber)){
+                allIdentityList.add(curIdentityNumber);
             }else{
-                throw new BaseException("","求职人员导入数据存在相同的身份证号码!");
+                if(!repeatIdentityList.contains(curIdentityNumber)){
+                    repeatIdentityList.add(curIdentityNumber);
+                }
             }
-            if(!idPhoneList.containsValue(item.getUserMobile())){
-                idPhoneList.put("UserMobile",item.getUserMobile());
+            if(!allPhoneList.contains(curUserMobile)){
+                allPhoneList.add(curUserMobile);
             }else{
-                throw new BaseException("","求职人员导入数据存在相同的联系电话!");
+                if(!repeatUserMobileList.contains(curUserMobile)){
+                    repeatUserMobileList.add(curUserMobile);
+                }
             }
         });
         dataList.forEach(item -> {
@@ -939,6 +948,27 @@ public class JobUserServiceImpl implements JobUserService {
             item.setJobEducation(new ArrayList<>());
             item.setJobExperience(new ArrayList<>());
 
+            if(repeatIdentityList.stream().count()>0){
+                if(repeatIdentityList.contains(item.getIdentityNumber())){
+                    errorInfo = "导入数据存在相同的身份证号码!";
+                    if(repeatUserMobileList.stream().count()>0){
+                        if(repeatUserMobileList.contains(item.getUserMobile())){
+                            errorInfo += "导入数据存在相同的联系电话!";
+                        }
+                    }
+                }
+            }
+            if(repeatUserMobileList.stream().count()>0){
+                if(repeatUserMobileList.contains(item.getUserMobile())){
+                    errorInfo = "导入数据存在相同的联系电话!";
+                    if(repeatIdentityList.stream().count()>0){
+                        if(repeatIdentityList.contains(item.getIdentityNumber())){
+                            errorInfo += "导入数据存在相同的身份证号码!";
+                        }
+                    }
+                }
+            }
+
             if (stringUtils.IsNullOrEmpty(errorInfo)) {
                 resultList.add(item);
             } else {

+ 3 - 3
vue/src/views/companyService/company/index.vue

@@ -228,12 +228,12 @@ export default defineComponent({
       title: '导入',
       url: 'companyService/company/importCompany',
       columns: [
-        {cnName: '企业名称', enName: 'companyName', width: 100},
-        {cnName: '统一信用代码', enName: 'companyCode', width: 140},
+        {cnName: '企业名称', enName: 'companyName', width: 200},
+        {cnName: '统一信用代码', enName: 'companyCode', width: 200},
         {cnName: '所属驿站', enName: 'SiteName', width: 100},
         {cnName: '企业办公地址', enName: 'companyAddress', width: 100},
         {cnName: '企业联系人', enName: 'userName', width: 100},
-        {cnName: '企业联系电话', enName: 'userMobile', width: 100},
+        {cnName: '企业联系电话', enName: 'userMobile', width: 120},
         {cnName: '企业状态', enName: 'recordStatusName', width: 100},
         {cnName: '用工情况(人,含临时人员)', enName: 'workSituation', width: 100},
         {cnName: '所属县区', enName: 'regionName', width: 100},