Browse Source

fix: 企业导入模板调整

zhangying 9 months ago
parent
commit
1417a84589

+ 40 - 6
src/main/java/com/hz/employmentsite/services/impl/companyService/CompanyServiceImpl.java

@@ -465,11 +465,45 @@ public class CompanyServiceImpl implements CompanyService {
                     errorInfo += "企业状态不存在!";
             }
 
-            if (stringUtils.IsNullOrEmpty(item.isShortageName))
-                errorInfo += "请选择是否缺工!";
-            else {
-                if (item.isShortageName.equals("是")) item.isShortage = 1;
-                else item.isShortage = 0;
+            if (stringUtils.IsNullOrEmpty(item.getWorkSituation())) {
+                errorInfo += "请填写用工情况!";
+            } else {
+                // 判断item.getWebsite()是否为正整数类型
+                if (item.getWorkSituation().matches("^[1-9]\\d*$")) {
+                    // 如果是正整数,则转换
+                    int workSituation = Integer.parseInt(item.getWorkSituation());
+                    // 未选择企业规模时按用工情况转换
+                    if (stringUtils.IsNullOrEmpty(item.companyModelStr)) {
+                        int[][] workSituationRanges = {
+                                {0, 19, 1},
+                                {20, 99, 2},
+                                {100, 299, 3},
+                                {300, 499, 4},
+                                {500, 999, 5},
+                                {1000, 9999, 6},
+                                {10000, Integer.MAX_VALUE, 7}
+                        };
+                        int companyModel = 1; // 默认值,如果所有范围都不匹配
+                        for (int[] range : workSituationRanges) {
+                            if (workSituation >= range[0] && workSituation <= range[1]) {
+                                companyModel = range[2];
+                                break;
+                            }
+                        }
+                        item.setCompanyModel(companyModel);
+                    }
+                } else {
+                    // 不是正整数,返回errorInfo
+                    errorInfo += "用工情况必须为正整数!";
+                }
+            }
+
+            if (!stringUtils.IsNullOrEmpty(item.isShortageName)){
+                if (item.isShortageName.equals("是")) {
+                    item.isShortage = 1;
+                } else {
+                    item.isShortage = 0;
+                }
             }
 
             if (!stringUtils.IsNullOrEmpty(item.getRegisteredCapitalTypeStr())) {
@@ -523,7 +557,7 @@ public class CompanyServiceImpl implements CompanyService {
                     errorInfo += "经济类型不存在!";
             }
 
-            if (stringUtils.IsNullOrEmpty(item.isShortageName))
+            if (stringUtils.IsNullOrEmpty(item.getRegionName()))
                 errorInfo += "请选择所属县区!";
             else {
                 item.setRegionCode(regionDataList.stream().filter(it -> it.getName().equals(item.getRegionName().trim()))

+ 3 - 0
src/main/java/com/hz/employmentsite/vo/jobUserManager/JobHuntVo.java

@@ -37,6 +37,9 @@ public class JobHuntVo {
     public String recommendNum; // 推荐数量
     public String cultureRank;
 
+    private String createUserID;
+    private String createUserName;
+    private Date createTime;
     private String modifyUserID;
     private String modifyUserName;
     private Date modifyTime;

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


+ 2 - 2
vue/src/views/companyService/company/detail.vue

@@ -9,7 +9,7 @@
       <a-descriptions-item label="企业联系人">{{ companyInfo.userName }}</a-descriptions-item>
       <a-descriptions-item label="企业联系电话">{{ companyInfo.userMobile }}</a-descriptions-item>
       <a-descriptions-item label="企业状态">{{ companyInfo.recordStatusName }}</a-descriptions-item>
-      <a-descriptions-item label="是否缺工">{{ companyInfo.isShortage == 0 ? '否' : '是' }}</a-descriptions-item>
+      <a-descriptions-item label="用工情况(人)">{{ companyInfo.workSituation }}</a-descriptions-item>
       <a-descriptions-item label="企业成立日期">
         {{ companyInfo.establishmentTime ? dayjs(companyInfo.establishmentTime).format('YYYY-MM-DD') : '' }}
       </a-descriptions-item>
@@ -42,7 +42,7 @@
       <a-descriptions-item label="所属县区">{{ companyInfo.regionName }}</a-descriptions-item>
       <a-descriptions-item label="所属街道">{{ companyInfo.streetName }}</a-descriptions-item>
       <a-descriptions-item label="企业规模">{{ companyInfo.companyModel }}</a-descriptions-item>
-      <a-descriptions-item label="用工情况(人)">{{ companyInfo.workSituation }}</a-descriptions-item>
+      <a-descriptions-item label="是否缺工">{{ companyInfo.isShortage == 0 ? '否' : '是' }}</a-descriptions-item>
       <a-descriptions-item label="参保人数(人)">{{ companyInfo.insuredCount }}</a-descriptions-item>
       <a-descriptions-item :span="3" label="标签">
         <a-button style="margin: 0px 5px 5px 0px;color: black;border: 1px solid rgb(217, 217, 217);" v-for="item in companyInfo.listLabel">

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

@@ -235,7 +235,9 @@ export default defineComponent({
         {cnName: '企业联系人', enName: 'userName', width: 100},
         {cnName: '企业联系电话', enName: 'userMobile', width: 100},
         {cnName: '企业状态', enName: 'recordStatusName', width: 100},
-        {cnName: '是否缺工', enName: 'isShortageName', width: 100},
+        {cnName: '用工情况(人)', enName: 'workSituation', width: 100},
+        {cnName: '所属县区', enName: 'regionName', width: 100},
+        {cnName: '所属街道', enName: 'streetName', width: 100},
         {cnName: '法定代表人(负责人)', enName: 'frName', width: 140},
         {cnName: '企业所在经度', enName: 'longitude', width: 100},
         {cnName: '企业所在纬度', enName: 'latitude', width: 100},
@@ -248,10 +250,8 @@ export default defineComponent({
         {cnName: '所属产业分类', enName: 'estateCategoryName', width: 100},
         {cnName: '企业邮箱', enName: 'companyEmail', 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: 'isShortageName', width: 100},
         {cnName: '参保人数(人)', enName: 'insuredCount', width: 100},
         {cnName: '经营范围', enName: 'businScope', width: 100},
         {cnName: '企业简介', enName: 'companyDesc', width: 100},