Browse Source

企业服务管理-导入 查询修改

Liudijing 11 months ago
parent
commit
27cd2036d9

+ 18 - 3
src/main/java/com/hz/employmentsite/controller/companyService/CompanyController.java

@@ -1,10 +1,12 @@
 package com.hz.employmentsite.controller.companyService;
 
+import com.fasterxml.jackson.databind.ser.Serializers;
 import com.github.pagehelper.PageInfo;
 import com.hz.employmentsite.filter.exception.BaseErrorEnum;
 import com.hz.employmentsite.filter.exception.BaseException;
 import com.hz.employmentsite.filter.exception.BaseResponse;
 import com.hz.employmentsite.filter.exception.RespGenerstor;
+import com.hz.employmentsite.model.PcSite;
 import com.hz.employmentsite.util.DateUtils;
 import com.hz.employmentsite.util.ExcelHelper;
 import com.hz.employmentsite.vo.taskAndLog.DotaskVo;
@@ -67,9 +69,15 @@ public class CompanyController {
         return RespGenerstor.success(result);
     }
 
+    @GetMapping("/getSiteList")
+    public BaseResponse getSiteList(){
+        List<PcSite> siteList = companyService.getSiteList();
+        return RespGenerstor.success(siteList);
+    }
+
     @GetMapping("/export")
     public BaseResponse export(HttpServletResponse response, @RequestParam(required = false) Boolean isExport,
-                               @RequestParam("pageIndex") int pageIndex, @RequestParam("pageSize") int pageSize,
+                               @RequestParam("pageIndex") int pageIndex, @RequestParam("pageSize") Integer pageSize,
                                @RequestParam(required = false) String primaryKey, @RequestParam(required = false) String companyName,
                                @RequestParam(required = false) String companyCode, @RequestParam(required = false) String recordStatus,
                                @RequestParam(required = false) String regionCode, @RequestParam(required = false) String streetCode
@@ -108,8 +116,15 @@ public class CompanyController {
 
     @PostMapping("/importCompany")
     public BaseResponse<Object> importCompany(@RequestBody List<CompanyVo> dataList) {
-        Object obj = companyService.importTeacher(dataList, accountService.getLoginUserID());
-        return null;
+        List<CompanyVo> result = companyService.importCompany(dataList, accountService.getLoginUserID());
+
+        if (result != null && result.size() > 0) {
+            return RespGenerstor.fail(BaseErrorEnum.IMPORT_DATA_ERROR, result);
+        } else {
+            return RespGenerstor.success(true);
+        }
+
+
     }
 
 

+ 12 - 2
src/main/java/com/hz/employmentsite/controller/companyService/PostController.java

@@ -38,7 +38,7 @@ public class PostController {
                                 @RequestParam(required = false) Integer minCount,
                                 @RequestParam(required = false) Integer maxCount,
                                 @RequestParam(required = false) String companyName,
-                                @RequestParam(required = false) Integer recordStatus,
+                                @RequestParam(required = false) String recordStatus,
                                 @RequestParam(required = false) String workName) {
 
         PageInfo<PostVo> result = postService.getList(pageIndex, pageSize, null, postName, minCount, maxCount, companyName, recordStatus, workName);
@@ -76,7 +76,7 @@ public class PostController {
                                @RequestParam(required = false) Integer minCount,
                                @RequestParam(required = false) Integer maxCount,
                                @RequestParam(required = false) String companyName,
-                               @RequestParam(required = false) Integer recordStatus,
+                               @RequestParam(required = false) String recordStatus,
                                @RequestParam(required = false) String workName) throws Exception {
         PageInfo<PostVo> result = postService.getList(pageIndex, pageSize, null, postName, minCount, maxCount, companyName, recordStatus, workName);
 
@@ -112,5 +112,15 @@ public class PostController {
         }
     }
 
+    @PostMapping("/importPost")
+    public BaseResponse<Object> importPost(@RequestBody List<PostVo> dataList){
+        List<PostVo> result = postService.importPost(dataList, accountService.getLoginUserID());
+        if (result != null && result.size() > 0) {
+            return RespGenerstor.fail(BaseErrorEnum.IMPORT_DATA_ERROR, result);
+        } else {
+            return RespGenerstor.success(true);
+        }
+    }
+
 
 }

+ 1 - 1
src/main/java/com/hz/employmentsite/mapper/cquery/PostCQuery.java

@@ -8,6 +8,6 @@ import java.util.List;
 
 public interface PostCQuery {
     List<PostVo> selectPostList(@Param("postID")String postID,@Param("postName") String postName, @Param("minCount")Integer minCount, @Param("maxCount")Integer maxCount,
-                                @Param("companyName")String companyName, @Param("RecordStatus") Integer RecordStatus, @Param("WorkName")String WorkName);
+                                @Param("companyName")String companyName, @Param("RecordStatus") String RecordStatus, @Param("WorkName")String WorkName);
     int insert(PcPost post);
 }

+ 104 - 5
src/main/java/com/hz/employmentsite/services/impl/companyService/CompanyServiceImpl.java

@@ -3,20 +3,23 @@ package com.hz.employmentsite.services.impl.companyService;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.hz.employmentsite.filter.exception.BaseException;
+import com.hz.employmentsite.mapper.AreaCodeMapper;
 import com.hz.employmentsite.mapper.PcCompanyMapper;
+import com.hz.employmentsite.mapper.PcSiteMapper;
 import com.hz.employmentsite.mapper.cquery.CompanyCQuery;
-import com.hz.employmentsite.model.PcCompany;
-import com.hz.employmentsite.model.PcCompanyExample;
-import com.hz.employmentsite.model.PcCompanyWithBLOBs;
+import com.hz.employmentsite.model.*;
+import com.hz.employmentsite.services.impl.system.DictionaryServiceImpl;
 import com.hz.employmentsite.services.service.companyService.CompanyService;
 import com.hz.employmentsite.util.StringUtils;
 import com.hz.employmentsite.vo.companyService.CompanyVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.UUID;
+import java.util.stream.Collectors;
 
 @Service("CompanyService")
 public class CompanyServiceImpl implements CompanyService {
@@ -30,6 +33,12 @@ public class CompanyServiceImpl implements CompanyService {
     @Autowired
     private PcCompanyMapper pcCompanyMapper;
 
+    @Autowired
+    private AreaCodeMapper areaCodeMapper;
+
+    @Autowired
+    private PcSiteMapper siteMapper;
+
     @Override
     public PageInfo<CompanyVo> getList(Integer pageIndex, Integer pageSize, String primaryKey, String companyName, String companyCode, String recordStatus, String regionCode, String streetCode) {
         PageHelper.startPage(pageIndex, pageSize);
@@ -116,11 +125,101 @@ public class CompanyServiceImpl implements CompanyService {
     }
 
     @Override
-    public List<CompanyVo> importTeacher(List<CompanyVo> dataList, String userID) {
+    public List<CompanyVo> importCompany(List<CompanyVo> dataList, String userID) {
         if (dataList.size() <= 0)
-            throw new BaseException("","请添加导入数据!");
+            throw new BaseException("", "请添加导入数据!");
+        //所属驿站
+        List<PcSite> siteList = siteMapper.selectByExample(null);
+        //所属县区
+        AreaCodeExample reginExp = new AreaCodeExample();
+        reginExp.or().andLvEqualTo("3");
+        List<AreaCode> regionList = areaCodeMapper.selectByExample(reginExp);
+        //所属街道
+        AreaCodeExample streetExp = new AreaCodeExample();
+        reginExp.or().andLvEqualTo("4");
+        List<AreaCode> streetList = areaCodeMapper.selectByExample(streetExp);
+        List<CompanyVo> resultList = new ArrayList<>();
+
+        dataList.forEach(item -> {
+            String errorInfo = "";
+            if (stringUtils.IsNullOrEmpty(item.companyName))
+                errorInfo += "请填写企业名称!";
+            if (stringUtils.IsNullOrEmpty(item.companyCode))
+                errorInfo += "请填写统一信用代码!";
+            if (stringUtils.IsNullOrEmpty(item.SiteName))
+                errorInfo += "请填写所属驿站!";
+            else {
+                item.siteID = siteList.stream().filter(it -> it.getSiteName().equals(item.getSiteName().trim()))
+                        .findFirst().orElse(new PcSite()).getSiteID();
+                if (stringUtils.IsNullOrEmpty(item.siteID)) {
+                    errorInfo += "驿站名称不存在!";
+                }
+            }
+            if (stringUtils.IsNullOrEmpty(item.regionName))
+                errorInfo += "请填写所属县区!";
+            else {
+                item.regionCode = regionList.stream().filter(it -> it.getName().equals(item.regionName.trim()))
+                        .findFirst().orElse(new AreaCode()).getCode();
+                if (stringUtils.IsNullOrEmpty(item.regionCode))
+                    errorInfo += "县区名称不存在!";
+            }
+            if (stringUtils.IsNullOrEmpty(item.streetName))
+                errorInfo += "请填写所属街道!";
+            else {
+                item.streetCode = streetList.stream().filter(it -> it.getName().equals(item.streetName.trim()))
+                        .findFirst().orElse(new AreaCode()).getCode();
+                if (stringUtils.IsNullOrEmpty(item.streetCode))
+                    errorInfo += "县区名称不存在!";
+            }
+            if (stringUtils.IsNullOrEmpty(item.address))
+                errorInfo += "请填写企业办公地址!";
+            if (stringUtils.IsNullOrEmpty(item.workSituation))
+                errorInfo += "请填写用工情况!";
+            if (stringUtils.IsNullOrEmpty(item.companyModel))
+                errorInfo += "请填写企业规模!";
+            if (stringUtils.IsNullOrEmpty(item.userName))
+                errorInfo += "请填写企业联系人!";
+            if (stringUtils.IsNullOrEmpty(item.userMobile))
+                errorInfo += "请填写!";
+            if (stringUtils.IsNullOrEmpty(item.companyEmail))
+                errorInfo += "请填写企业邮箱!";
+            if (stringUtils.IsNullOrEmpty(item.frName))
+                errorInfo += "请填写法定代表人!";
+            if (stringUtils.IsNullOrEmpty(String.valueOf(item.validTime)))
+                errorInfo += "请填写营业执照有效期!";
+            if (stringUtils.IsNullOrEmpty(String.valueOf(item.businScope)))
+                errorInfo += "请填写经营范围!";
+            if (stringUtils.IsNullOrEmpty(String.valueOf(item.companyDesc)))
+                errorInfo += "请填写企业简介!";
+            if (stringUtils.IsNullOrEmpty(item.recordStatusName))
+                errorInfo += "请填写企业状态!";
+            else {
+                if (item.recordStatusName.equals("在营"))
+                    item.recordStatus = 1;
+                else
+                    item.recordStatus = 0;
+            }
+            if (stringUtils.IsNullOrEmpty(errorInfo)) {
+                resultList.add(item);
+            } else {
+                item.setErrorMessage(errorInfo);
+            }
+        });
+
+        if (dataList.stream().filter(it -> !stringUtils.IsNullOrEmpty(it.errorMessage)).collect(Collectors.toList()).size() > 0)
+            return dataList;
+        resultList.forEach(item -> {
+            save(item, userID);
+        });
         return null;
     }
 
+    @Override
+    public List<PcSite> getSiteList() {
+        //所属驿站
+        List<PcSite> siteList = siteMapper.selectByExample(null);
+        return siteList;
+    }
+
 
 }

+ 109 - 5
src/main/java/com/hz/employmentsite/services/impl/companyService/PostServiceImpl.java

@@ -1,19 +1,25 @@
 package com.hz.employmentsite.services.impl.companyService;
 
 import com.github.pagehelper.PageInfo;
+import com.hz.employmentsite.filter.exception.BaseException;
+import com.hz.employmentsite.mapper.PcCompanyMapper;
 import com.hz.employmentsite.mapper.PcPostMapper;
 import com.hz.employmentsite.mapper.cquery.PostCQuery;
-import com.hz.employmentsite.model.PcPost;
-import com.hz.employmentsite.model.PcPostExample;
+import com.hz.employmentsite.model.*;
 import com.hz.employmentsite.services.service.companyService.PostService;
+import com.hz.employmentsite.services.service.system.DictionaryService;
 import com.hz.employmentsite.util.StringUtils;
+import com.hz.employmentsite.vo.companyService.CompanyVo;
 import com.hz.employmentsite.vo.companyService.PostVo;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.SpringApplicationRunListener;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.UUID;
+import java.util.stream.Collectors;
 
 @Service("PostService")
 public class PostServiceImpl implements PostService {
@@ -25,8 +31,14 @@ public class PostServiceImpl implements PostService {
     @Autowired
     private PcPostMapper pcPostMapper;
 
+    @Autowired
+    private PcCompanyMapper companyMapper;
+
+    @Autowired
+    private DictionaryService dictionaryService;
+
     @Override
-    public PageInfo<PostVo> getList(Integer page, Integer rows, String postID, String postName, Integer minCount, Integer maxCount, String companyName, int recordStatus, String WorkName) {
+    public PageInfo<PostVo> getList(Integer page, Integer rows, String postID, String postName, Integer minCount, Integer maxCount, String companyName, String recordStatus, String WorkName) {
         List<PostVo> list = postCQuery.selectPostList(postID, postName, minCount, maxCount, companyName, recordStatus, WorkName);
         PageInfo<PostVo> result = new PageInfo(list);
         return result;
@@ -37,10 +49,10 @@ public class PostServiceImpl implements PostService {
     public Integer save(PostVo data, String userId) {
         int result = 0;
         PcPost dbData = null;
-        Boolean isExist=data.getPostID()!=null;
+        Boolean isExist = data.getPostID() != null;
         PcPostExample exp = new PcPostExample();
         PcPostExample.Criteria cro = exp.createCriteria();
-        if(isExist){
+        if (isExist) {
             cro.andPostIDEqualTo(data.getPostID());
             dbData = pcPostMapper.selectByExample(exp).stream().findFirst().orElse(null);
         }
@@ -125,4 +137,96 @@ public class PostServiceImpl implements PostService {
         }
         return postCQuery.selectPostList(id, null, null, null, null, null, null).stream().findFirst().orElse(null);
     }
+
+    @Override
+    public List<PostVo> importPost(List<PostVo> dataList, String userID) {
+        if (dataList.size() <= 0)
+            throw new BaseException("", "请添加导入数据!");
+        //所属企业
+        PcCompanyExample companyExp = new PcCompanyExample();
+        companyExp.or().andRecordStatusEqualTo(1);
+        List<PcCompany> companyList = companyMapper.selectByExample(companyExp);
+        //文化程度
+        List<SysDictionaryItem> dicDataList = dictionaryService.getDictionaryItemList("CultureLevel");
+        List<PostVo> resultList = new ArrayList<>();
+
+        dataList.forEach(item -> {
+            String errorInfo = "";
+            if (stringUtils.IsNullOrEmpty(item.postName))
+                errorInfo += "请填写岗位名称!";
+            if (stringUtils.IsNullOrEmpty(String.valueOf(item.validTime)) || item.validTime == null)
+                errorInfo += "请填写有效开始时间!";
+            if (stringUtils.IsNullOrEmpty(String.valueOf(item.validDay)) || item.validDay == 0)
+                errorInfo += "请填写有效期(天)!";
+            if (stringUtils.IsNullOrEmpty(item.recordStatusName))
+                errorInfo += "请填写岗位状态!";
+            else {
+                if (item.recordStatusName.equals("启用")) item.recordStatus = 1;
+                else item.recordStatus = 0;
+            }
+            if (stringUtils.IsNullOrEmpty(item.companyName))
+                errorInfo += "请填写所属企业!";
+            else {
+                item.companyID = companyList.stream().filter(it -> it.getCompanyName().equals(item.getCompanyName().trim()))
+                        .findFirst().orElse(new PcCompany()).getCompanyID();
+                if (item.companyID == null)
+                    errorInfo += "企业不存在!";
+            }
+            if (stringUtils.IsNullOrEmpty(item.workNature))
+                errorInfo += "请填写工作性质!";
+            if (item.workYear == null)
+                errorInfo += "请填写工作年限!";
+            if (stringUtils.IsNullOrEmpty(String.valueOf(item.recruitCount)) || item.recruitCount == null)
+                errorInfo += "请填写招聘人数!";
+            if (stringUtils.IsNullOrEmpty(item.cultureLevelName))
+                errorInfo += "请填写文化程度!";
+            else {
+                item.cultureRank = dicDataList.stream().filter(it -> it.getName().equals(item.cultureLevelName.trim()))
+                        .findFirst().orElse(new SysDictionaryItem()).getValue();
+                if (item.cultureRank == null || item.cultureRank == 0)
+                    errorInfo += "输入文化程度不存在!";
+            }
+            if (stringUtils.IsNullOrEmpty(String.valueOf(item.maxSalary)) || item.maxSalary == null)
+                errorInfo += "请填写最高薪酬!";
+            if (stringUtils.IsNullOrEmpty(String.valueOf(item.minSalary)) || item.minSalary == null)
+                errorInfo += "请填写最低薪酬!";
+            if (stringUtils.IsNullOrEmpty(item.welfare))
+                errorInfo += "请填写福利待遇!";
+            if (stringUtils.IsNullOrEmpty(item.userName))
+                errorInfo += "请填写联系人!";
+            if (stringUtils.IsNullOrEmpty(item.userMobile))
+                errorInfo += "请填写联系电话!";
+            if (stringUtils.IsNullOrEmpty(item.postEmail))
+                errorInfo += "请填写邮箱!";
+            if (stringUtils.IsNullOrEmpty(String.valueOf(item.workTime)) || item.workTime == 0 || item.workTime == null)
+                errorInfo += "请填写工作时长!";
+            if (stringUtils.IsNullOrEmpty(item.isTrailName))
+                errorInfo += "请填写是否试用期!";
+            else {
+                if (item.isTrailName.trim().equals("是")) item.isTrail = true;
+                else item.isTrail = false;
+            }
+            if (stringUtils.IsNullOrEmpty(String.valueOf(item.trailtime)) || item.trailtime == 0 || item.trailtime == null)
+                errorInfo += "请填写试用期时长(月)!";
+            if (stringUtils.IsNullOrEmpty(String.valueOf(item.trailMaxSalary)) || item.trailMaxSalary == null)
+                errorInfo += "请填写试用期最高薪酬!";
+            if (stringUtils.IsNullOrEmpty(String.valueOf(item.trailMinSalary)) || item.trailMinSalary == null)
+                errorInfo += "请填写试用期最低薪酬!";
+            if (stringUtils.IsNullOrEmpty(item.postDesc))
+                errorInfo += "请填写岗位描述!";
+
+            if (stringUtils.IsNullOrEmpty(errorInfo)) {
+                resultList.add(item);
+            } else {
+                item.setErrorMessage(errorInfo);
+            }
+        });
+
+        if (dataList.stream().filter(it -> !stringUtils.IsNullOrEmpty(it.errorMessage)).collect(Collectors.toList()).size() > 0)
+            return dataList;
+        resultList.forEach(item -> {
+            save(item, userID);
+        });
+        return null;
+    }
 }

+ 3 - 1
src/main/java/com/hz/employmentsite/services/service/companyService/CompanyService.java

@@ -1,6 +1,7 @@
 package com.hz.employmentsite.services.service.companyService;
 
 import com.github.pagehelper.PageInfo;
+import com.hz.employmentsite.model.PcSite;
 import com.hz.employmentsite.vo.companyService.CompanyVo;
 
 import java.util.List;
@@ -15,6 +16,7 @@ public interface CompanyService {
 
     CompanyVo getDataById(String id);
 
-    List<CompanyVo> importTeacher(List<CompanyVo> dataList, String userID);
+    List<CompanyVo> importCompany(List<CompanyVo> dataList, String userID);
 
+    List<PcSite> getSiteList();
 }

+ 3 - 2
src/main/java/com/hz/employmentsite/services/service/companyService/PostService.java

@@ -1,14 +1,15 @@
 package com.hz.employmentsite.services.service.companyService;
 
 import com.github.pagehelper.PageInfo;
+import com.hz.employmentsite.vo.companyService.CompanyVo;
 import com.hz.employmentsite.vo.companyService.PostVo;
 
 import java.util.List;
 
 public interface PostService {
-    PageInfo<PostVo> getList(Integer page, Integer rows, String postID,String postName, Integer minCount, Integer maxCount, String companyName,int RecordStatus,String WorkNmae);
+    PageInfo<PostVo> getList(Integer page, Integer rows, String postID,String postName, Integer minCount, Integer maxCount, String companyName,String RecordStatus,String WorkNmae);
     Integer save(PostVo data, String userId);
     int delete(String id);
     PostVo getDataById(String id);
-
+    List<PostVo> importPost(List<PostVo> dataList, String userID);
 }

+ 6 - 2
src/main/java/com/hz/employmentsite/vo/companyService/CompanyVo.java

@@ -52,12 +52,16 @@ public class CompanyVo {
 
     public String streetName;
 
-    public  String businScope;
+    public String businScope;
 
     public String companyDesc;
 
-    public  String createUserName;
+    public String createUserName;
 
     public int postCount;
 
+    public String recordStatusName;
+
+    public String errorMessage;
+
 }

+ 7 - 0
src/main/java/com/hz/employmentsite/vo/companyService/PostVo.java

@@ -66,4 +66,11 @@ public class PostVo {
 
     public String cultureLevelName;
 
+    public  String isTrailName;
+
+    public  String recordStatusName;
+
+    public  String errorMessage;
+
+
 }

+ 1 - 1
src/main/resources/mapping/cquery/CompanyCQuery.xml

@@ -23,7 +23,7 @@
             and companyCode like Concat('%',#{companyCode},'%')
         </if>
         <if test="recordStatus!='' and recordStatus!=null">
-            and recordStatus = #{recordStatus}
+            and company.RecordStatus = #{recordStatus}
         </if>
         <if test="regionCode!='' and regionCode!=null">
             and regionCode like Concat('%',#{regionCode},'%')

+ 1 - 1
vue/src/components/basic/excel/importExcel/importExcel.vue

@@ -107,7 +107,7 @@ export default defineComponent({
 
     const addData = (result: any) => {
       okButtonProps.value.disabled = false;
-
+      console.log(result);
       if (result) {
         result.forEach(sheet => {
           sheet.results.forEach(item => {

+ 12 - 14
vue/src/views/companyService/company/edit.vue

@@ -29,20 +29,18 @@
             label="所属驿站"
             :label-col="{ span: 6 }"
             name="siteID"
-            :rules="[{ required: false, message: '请选择所属驿站!' }]"
+            :rules="[{ required: true, message: '请选择所属驿站!' }]"
           >
             <a-select
               ref="select"
               v-model:value="dataModel.siteID"
-              :options="studentTypelist"
-              :field-names="{ label: 'name', value: 'value' }"
+              :options="siteList"
+              :field-names="{ label: 'siteName', value: 'siteID' }"
             >
             </a-select>
           </a-form-item>
         </a-col>
       </a-row>
-
-
       <a-row :gutter="24">
         <a-col :span="8">
           <a-form-item
@@ -245,13 +243,12 @@ export default defineComponent(
     setup() {
       const formState = reactive<FormState>({dataModel: {}});
       const router = useRouter();
-      const postStatuslist = ref<SelectProps['options']>();
-      // const fullpath = router.currentRoute.value.fullPath;
+      const siteList = ref<SelectProps['options']>();
       const tabsViewStore = useTabsViewStore();
 
-      const companyStatuslist= ref<SelectProps['options']>([
-        { value: 1, name: '在营' },
-        { value: 0, name: '关闭' },
+      const companyStatuslist = ref<SelectProps['options']>([
+        {value: 1, name: '在营'},
+        {value: 0, name: '关闭'},
       ]);
       const regionList = ref<SelectProps['options']>();
       const streetList = ref<SelectProps['options']>();
@@ -263,13 +260,14 @@ export default defineComponent(
         router.push({name: '/companyService/enterprise/index'});
       };
 
-
       get('system/area/getCityList', {}).then(data => {
-        console.log(data);
         regionList.value = data;
-        console.log(regionList.value);
       });
 
+      get('/companyService/company/getSiteList', {}).then(data => {
+        siteList.value = data;
+      })
+
       const changeCity = () => {
         get('system/area/getAreaList', {code: formState.dataModel.regionCode}).then(data => {
           console.log(data);
@@ -298,11 +296,11 @@ export default defineComponent(
         loadData,
         onClose,
         onFinish,
+        siteList,
         regionList,
         streetList,
         companyStatuslist,
         changeCity,
-        postStatuslist
       }
     },
     created() {

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

@@ -14,7 +14,15 @@
         </a-col>
         <a-col :span="6">
           <a-form-item label="企业状态" :label-col="{span:6}" name="RecordStatus">
-            <a-input v-model:value="searchParams.recordStatus" placeholder=""/>
+            <a-select
+              ref="select"
+              v-model:value="searchParams.recordStatus"
+              :options="recordStatusList"
+              :field-names="{ label: 'name', value: 'value' }"
+              :allow-clear="true"
+              @change="loadData"
+            >
+            </a-select>
           </a-form-item>
         </a-col>
         <a-col :span="6" style="text-align: right">
@@ -93,15 +101,16 @@ import type {FormInstance} from 'ant-design-vue';
 import type {TableColumnsType, TableProps} from 'ant-design-vue';
 import {getList, del} from '@/api/companyService/company';
 import BExportExcel from "@/components/basic/excel/exportExcel/exportExcel.vue";
+  import BImportExcel from '@/components/basic/excel/importExcel/importExcel.vue';
 import {getPaginationTotalTitle} from "@/utils/common";
 import {Modal, SelectProps} from "ant-design-vue";
 import dayjs from "dayjs";
 import {useTabsViewStore} from '@/store/modules/tabsView';
 import {get} from "@/api/common";
-import type { ImportProps } from '@/components/basic/excel/importExcel/ImportProps';
+import type {ImportProps} from '@/components/basic/excel/importExcel/ImportProps';
 
 export default defineComponent({
-  components: {DownOutlined, UpOutlined, BExportExcel},
+  components: {DownOutlined, UpOutlined, BExportExcel, BImportExcel},
   setup() {
     const formRef = ref<FormInstance>();
     const searchParams = reactive({
@@ -136,7 +145,8 @@ export default defineComponent({
         {cnName: '企业联系电话', enName: 'userMobile', width: 100},
         {cnName: '企业邮箱', enName: 'companyEmail', width: 100},
         {cnName: '法定代表人', enName: 'frName', width: 100},
-        {cnName: '企业状态', enName: 'recordStatus', width: 100},
+        {cnName: '企业状态', enName: 'recordStatusName', width: 100},
+        {cnName: '营业执照有效期', enName: 'validTime', width: 100},
         {cnName: '经营范围', enName: 'businScope', width: 100},
         {cnName: '企业简介', enName: 'companyDesc', width: 100}
       ],
@@ -181,6 +191,10 @@ export default defineComponent({
       showTotal: total => getPaginationTotalTitle(total)
     }));
 
+    const recordStatusList =ref<SelectProps['options']>([
+      { value: 1, name: '在营' },
+      { value: 0, name: '关闭' },
+    ]);
     const regionList = ref<SelectProps['options']>();
     const streetList = ref<SelectProps['options']>();
     const dataList = ref([]);
@@ -268,6 +282,7 @@ export default defineComponent({
       onEdit,
       loadData,
       importOptions,
+      recordStatusList,
       regionList,
       streetList
     };

+ 1 - 1
vue/src/views/companyService/post/edit.vue

@@ -218,7 +218,7 @@
         </a-col>
         <a-col :span="8">
           <a-form-item
-            label="试用期时长"
+            label="试用期时长(月)"
             :label-col="{ span: 6 }"
             name="trailtime"
             :rules="[{ required: true, message: '请选择试用期时长!' }]"

+ 51 - 10
vue/src/views/companyService/post/index.vue

@@ -12,7 +12,8 @@
             <label style="margin-left:26px;">招聘人数:</label>
             <a-input type="number" v-model:value="searchParams.minCount" style="width: 30%;margin-right: 10px;"
                      placeholder=""/>
-            <a-input type="number" v-model:value="searchParams.maxCount" style="width: 30%;" placeholder=""/>
+            <a-input type="number" v-model:value="searchParams.maxCount" style="width: 30%;" placeholder=""
+            />
           </a-form-item>
         </a-col>
         <a-col :span="6">
@@ -26,11 +27,11 @@
       </a-row>
       <a-row>
         <a-col :span="6">
-          <a-form-item label="岗位状态" :label-col="{span:6}" name="RecordStatus">
+          <a-form-item label="岗位状态" :label-col="{span:6}" name="recordStatus">
             <a-select
               ref="select"
-              v-model:value="searchParams.RecordStatus"
-              :options="postRecordlist"
+              v-model:value="searchParams.recordStatus"
+              :options="postStatusList"
               :field-names="{ label: 'name', value: 'value' }"
               :allow-clear="true"
               @change="loadData"
@@ -47,7 +48,10 @@
       <a-row class="edit-operation">
         <a-col :span="24" style="text-align: right">
           <a-button type="primary" html-type="submit" @click='onAdd'>新增</a-button>
-          <a-button type="primary" html-type="submit" @click='importPost()'>导入</a-button>
+          <BImportExcel
+            :options="importOptions"
+            @success="loadData"
+          ></BImportExcel>
           <BExportExcel :title="'导出'" :filename="'岗位信息'"
                         :url="'companyService/post/export'"
                         :params="{...searchParams, isExport: true, rows:10000}"></BExportExcel>
@@ -82,23 +86,58 @@ import {Modal} from 'ant-design-vue';
 import type {TableColumnsType, TableProps} from 'ant-design-vue';
 import {getList, del} from '@/api/companyService/post';
 import BExportExcel from "@/components/basic/excel/exportExcel/exportExcel.vue";
+import BImportExcel from '@/components/basic/excel/importExcel/importExcel.vue';
 import {getPaginationTotalTitle} from "@/utils/common";
 import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
 import dayjs from 'dayjs';
 import {useRoute} from 'vue-router';
 import {useTabsViewStore} from "@/store/modules/tabsView";
+import type {ImportProps} from "@/components/basic/excel/importExcel/ImportProps";
 
 export default defineComponent({
-  components: {DownOutlined, UpOutlined, BExportExcel},
+  components: {DownOutlined, UpOutlined, BExportExcel, BImportExcel},
   setup: function () {
     const formRef = ref<FormInstance>();
     const searchParams = reactive({
       pageIndex: 1,
       pageSize: 20,
       primaryKey: '',
-      minCount: 0,
-      maxCount: 0,
-      recordStatus: 1
+      minCount: null,
+      maxCount: null,
+      recordStatus: null
+    });
+    const postStatusList = [{name: '启用', value: 1}, {name: '停用', value: 0}];
+    const importOptions = ref<ImportProps>({
+      title: '导入',
+      url: 'companyService/post/importPost  ',
+      columns: [
+        {cnName: '岗位名称', enName: 'postName', width: 100},
+        {cnName: '有效开始时间', enName: 'validTime', width: 100},
+        {cnName: '有效期(天)', enName: 'validDay', width: 100},
+        {cnName: '岗位状态', enName: 'recordStatusName', width: 100},
+        {cnName: '所属企业', enName: 'companyName', width: 100},
+        {cnName: '工作性质', enName: 'workNature', width: 100},
+        {cnName: '工作年限', enName: 'workYear', width: 100},
+        {cnName: '招聘人数', enName: 'recruitCount', width: 100},
+        {cnName: '文化程度', enName: 'cultureLevelName', width: 100},
+        {cnName: '最高薪酬', enName: 'maxSalary', width: 100},
+        {cnName: '最低薪酬', enName: 'minSalary', width: 100},
+        {cnName: '福利待遇', enName: 'welfare', width: 100},
+        {cnName: '联系人', enName: 'userName', width: 100},
+        {cnName: '联系电话', enName: 'userMobile', width: 100},
+        {cnName: '邮箱', enName: 'postEmail', width: 100},
+        {cnName: '工作时长', enName: 'workTime', width: 100},
+        {cnName: '是否试用期', enName: 'isTrailName', width: 100},
+        {cnName: '试用期时长(月)', enName: 'trailtime', width: 100},
+        {cnName: '试用期最高薪酬', enName: 'trailMaxSalary', width: 100},
+        {cnName: '试用期最低薪酬', enName: 'trailMinSalary', width: 100},
+        {cnName: '岗位描述', enName: 'postDesc', width: 100},
+      ],
+      template: {
+        tempFileName: '岗位信息导入模板.xlsx',
+        url: '',
+        params: null,
+      },
     });
     const formState = reactive({
       total: 0,
@@ -214,6 +253,7 @@ export default defineComponent({
       columns,
       pagination,
       dataList,
+      importOptions,
       handleTableChange,
       onSelectChange,
       onSearch,
@@ -222,7 +262,8 @@ export default defineComponent({
       onDel,
       loadData,
       onAdd,
-      onEdit
+      onEdit,
+      postStatusList
     };
   },
   created() {