Browse Source

feat: 企业信息导入添加新字段

zhangying 10 months ago
parent
commit
732f16a676

+ 26 - 7
src/main/java/com/hz/employmentsite/services/impl/companyService/CompanyServiceImpl.java

@@ -268,7 +268,14 @@ public class CompanyServiceImpl implements CompanyService {
         List<CompanyVo> resultList = new ArrayList<>();
         //企业规模
         List<SysDictionaryItem> dicCompanyModelList = dictionaryService.getDictionaryItemList("CompanyModel");
+        // 经济类型
         List<SysDictionaryItem> dicCompanyTypeList = dictionaryService.getDictionaryItemList("CompanyType");
+        // 企业状态
+        List<SysDictionaryItem> companyStatusList = dictionaryService.getDictionaryItemList("CompanyStatus");
+        // 企业行业
+        List<PcIndustry> industryList = industryService.getAllList();
+        // 企业产业分类
+        List<SysDictionaryItem> companyEstateCategory = dictionaryService.getDictionaryItemByCodeList("CompanyEstateCategory");
 
         dataList.forEach(item -> {
             String errorInfo = "";
@@ -298,10 +305,10 @@ public class CompanyServiceImpl implements CompanyService {
             if (stringUtils.IsNullOrEmpty(item.recordStatusName))
                 errorInfo += "请填写企业状态!";
             else {
-                if (item.recordStatusName.equals("在营"))
-                    item.recordStatus = 1;
-                else
-                    item.recordStatus = 0;
+                item.recordStatus = companyStatusList.stream().filter(it -> it.getName().equals(item.getRecordStatusName().trim()))
+                        .findFirst().orElse(new SysDictionaryItem()).getValue();
+                if (stringUtils.IsNullOrEmpty(item.regionCode))
+                    errorInfo += "企业状态不存在!";
             }
 
             if (stringUtils.IsNullOrEmpty(item.isShortageName))
@@ -338,16 +345,28 @@ public class CompanyServiceImpl implements CompanyService {
                 item.companyType = dicCompanyTypeList.stream().filter(it -> it.getName().equals(item.companyTypeStr.trim()))
                         .findFirst().orElse(new SysDictionaryItem()).getValue();
                 if (item.companyType == null || item.companyType == 0)
-                    errorInfo += "企业分类不存在!";
+                    errorInfo += "经济类型不存在!";
             }
 
-            if (!stringUtils.IsNullOrEmpty(item.companyModelStr))
-            {
+            if (!stringUtils.IsNullOrEmpty(item.companyModelStr)) {
                 item.companyModel = dicCompanyModelList.stream().filter(it -> it.getName().equals(item.companyModelStr.trim()))
                         .findFirst().orElse(new SysDictionaryItem()).getValue();
                 if (item.companyModel == null || item.companyModel == 0)
                     errorInfo += "企业规模不存在!";
             }
+
+            if (!stringUtils.IsNullOrEmpty(item.getSignInPoliticalAreaName())) {
+                item.signInPoliticalArea = regionList.stream().filter(it -> it.getName().equals(item.signInPoliticalAreaName.trim()))
+                        .findFirst().orElse(new AreaCode()).getCode();
+            }
+            if (!stringUtils.IsNullOrEmpty(item.getIndustryName())) {
+                item.industryID = industryList.stream().filter(it -> it.getIndustryName().equals(item.industryName.trim()))
+                        .findFirst().orElse(new PcIndustry()).getIndustryId();
+            }
+            if (!stringUtils.IsNullOrEmpty(item.getEstateCategoryName())) {
+                item.estateCategoryID = companyEstateCategory.stream().filter(it -> it.getName().equals(item.estateCategoryName.trim()))
+                        .findFirst().orElse(new SysDictionaryItem()).getValue();
+            }
         });
 
         if (dataList.stream().filter(it -> !stringUtils.IsNullOrEmpty(it.errorMessage)).collect(Collectors.toList()).size() > 0)

BIN
src/main/resources/static/doc/template/企业信息导入模板.xlsx


+ 9 - 2
vue/src/views/companyService/company/index.vue

@@ -194,16 +194,23 @@ export default defineComponent({
         {cnName: '企业状态', enName: 'recordStatusName', width: 100},
         {cnName: '是否缺工', enName: 'isShortageName', width: 100},
         {cnName: '法定代表人(负责人)', enName: 'frName', width: 140},
+        {cnName: '企业成立日期', enName: 'establishmentTime', width: 140},
         {cnName: '营业执照有效期', enName: 'validTime', width: 100},
+        {cnName: '企业注册资本(万元)', enName: 'registeredCapital', width: 100},
+        {cnName: '注册地址行政区划', enName: 'signInPoliticalAreaName', width: 100},
+        {cnName: '所属行业', enName: 'industryName', width: 100},
+        {cnName: '所属产业分类', enName: 'estateCategoryName', width: 100},
         {cnName: '企业邮箱', enName: 'companyEmail', width: 100},
-        {cnName: '企业分类', enName: 'companyTypeStr', width: 100},
+        {cnName: '经济类型', enName: 'companyTypeStr', width: 100},
         {cnName: '所属县区', enName: 'regionName', width: 100},
         {cnName: '所属街道', enName: 'streetName', width: 100},
         {cnName: '企业规模', enName: 'companyModelStr', width: 100},
         {cnName: '用工情况(人)', enName: 'workSituation', width: 100},
         {cnName: '参保人数(人)', enName: 'insuredCount', width: 100},
         {cnName: '经营范围', enName: 'businScope', width: 100},
-        {cnName: '企业简介', enName: 'companyDesc', width: 100}
+        {cnName: '企业简介', enName: 'companyDesc', width: 100},
+        {cnName: '企业官网网址', enName: 'website', width: 100},
+        {cnName: '企业福利', enName: 'bonus', width: 100}
       ],
       template: {
         tempFileName: '企业信息导入模板.xlsx',