浏览代码

web-岗位状态根据招聘结束日期修改

liao-sea 10 月之前
父节点
当前提交
2195a6690b

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

@@ -84,8 +84,11 @@ public class PostServiceImpl implements PostService {
         if(list != null && list.size()>0){
             for(PostVo curPost : list){
                 curPost.listLabel = labelCQuery.getPostLabelList(curPost.getPostID());
-                if(curPost.endTime.before(new Date())){
-                    curPost.setRecordStatus(0);
+
+                if(curPost.endTime.before(new Date())&&curPost.recordStatus.equals(1)){
+                    var curPcPost = pcPostMapper.selectByPrimaryKey(curPost.getPostID());
+                    curPcPost.setRecordStatus(0);
+                    pcPostMapper.updateByPrimaryKey(curPcPost);
                 }
             }
         }

+ 19 - 14
src/main/java/com/hz/employmentsite/services/impl/jobUserManager/RecommendMgtServiceImpl.java

@@ -3,10 +3,7 @@ package com.hz.employmentsite.services.impl.jobUserManager;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.hz.employmentsite.filter.exception.BaseException;
-import com.hz.employmentsite.mapper.PcJobhuntMapper;
-import com.hz.employmentsite.mapper.PcJobuserMapper;
-import com.hz.employmentsite.mapper.PcRecommendMgtMapper;
-import com.hz.employmentsite.mapper.PcSiteUserMapper;
+import com.hz.employmentsite.mapper.*;
 import com.hz.employmentsite.mapper.cquery.RecommendMgtCQuery;
 import com.hz.employmentsite.model.*;
 import com.hz.employmentsite.services.service.WechatService;
@@ -42,6 +39,8 @@ public class RecommendMgtServiceImpl implements RecommendMgtService {
     @Autowired
     private PcJobhuntMapper pcJobhuntMapper;
 
+    @Autowired
+    private PcPostMapper pcPostMapper;
 
     @Override
     public PageInfo<RecommendMgtVo> getList(Integer page, Integer rows, String name,
@@ -97,23 +96,29 @@ public class RecommendMgtServiceImpl implements RecommendMgtService {
     public int addRecommend(List<PcRecommendMgt> list, String userID) {
         try {
             List<PcRecommendMgt> addList = new ArrayList<>();
+            final int[] result = {1};
             list.forEach(item -> {
-                PcRecommendMgt model = new PcRecommendMgt();
-                model.setRecommendMgtID(item.getRecommendMgtID());
-                model.setPostID(item.getPostID());
-                model.setJobHuntID(item.getJobHuntID());
-                model.setRecommendType(item.getRecommendType());
-                model.setEntryState(Integer.parseInt("0"));
-                model.setCreateUserID(userID);
-                model.setCreateTime(new Date());
-                addList.add(model);
+                PcPost curPost = pcPostMapper.selectByPrimaryKey(item.getPostID());
+                if(curPost.getEndTime().before(new Date())||curPost.getRecordStatus().equals(0)){
+                        result[0] = -1;
+                }else{
+                    PcRecommendMgt model = new PcRecommendMgt();
+                    model.setRecommendMgtID(item.getRecommendMgtID());
+                    model.setPostID(item.getPostID());
+                    model.setJobHuntID(item.getJobHuntID());
+                    model.setRecommendType(item.getRecommendType());
+                    model.setEntryState(Integer.parseInt("0"));
+                    model.setCreateUserID(userID);
+                    model.setCreateTime(new Date());
+                    addList.add(model);
+                }
             });
 
             addList.forEach(x -> {
                 pcRecommendMgtMapper.insert(x);
             });
 
-            return 1;
+            return result[0];
         } catch (Exception e) {
             e.printStackTrace();
             return 0;

+ 0 - 1
vue/src/api/jobUserManager/recommendMgt/index.ts

@@ -35,7 +35,6 @@ export function addRecommend(data: any) {
     },
     {
       isNew: true,
-      successMsg: '提交成功!',
       errorMsg: '提交失败!'
     },
   );

+ 13 - 7
vue/src/views/companyService/post/index.vue

@@ -128,6 +128,12 @@
               <a-button type="link" size="small" @click="onChangeStatus(record.postID,record.recordStatus==1?0:1)"   >{{ record.recordStatus==1?"禁用":"启用" }}</a-button>
             </div>
           </template>
+          <template v-if="column.key === 'recordStatus'">
+            <div style="text-align: center;">
+              <label v-if="record.recordStatus==1" style="color:green;" >启用</label>
+              <label v-if="record.recordStatus==0" style="color:red;">停用</label>
+            </div>
+          </template>
         </template>
       </a-table>
     </div>
@@ -139,7 +145,7 @@
 import {computed, createVNode, defineComponent, reactive, ref} from 'vue';
 import {DownOutlined, ExclamationCircleOutlined, UpOutlined} from '@ant-design/icons-vue';
 import type {FormInstance, TableProps} from 'ant-design-vue';
-import {Modal, SelectProps} from 'ant-design-vue';
+import {message, Modal, SelectProps} from 'ant-design-vue';
 import {del, getList} from '@/api/companyService/post';
 import BExportExcel from "@/components/basic/excel/exportExcel/exportExcel.vue";
 import BImportExcel from '@/components/basic/excel/importExcel/importExcel.vue';
@@ -234,11 +240,7 @@ export default defineComponent({
       },
       {title: '招聘企业', dataIndex: 'companyName', key: 'companyName',align: "center"},
       {title: '所属驿站', dataIndex: 'siteName', key: 'siteName', align: "center"},
-      {title: '岗位状态', dataIndex: 'recordStatus', key: 'recordStatus', width: 100, align: "center",
-        customRender: (item) => {
-          return item.record.recordStatus == 1 ? "启用" : "停用";
-        }
-      },
+      {title: '岗位状态', dataIndex: 'recordStatus', key: 'recordStatus', width: 100, align: "center"},
       {title: '学历要求', dataIndex: 'cultureLevelName', key: 'cultureLevelName', width: 150, align: "center", isDefaultClose: true},
       {title: '薪酬', dataIndex: 'postSalary', key: 'postSalary', width: 150, align: "center",
         customRender: (item) => {
@@ -293,7 +295,11 @@ export default defineComponent({
     };
 
     const onRecommendJob = (item) =>{
-      recommendRef.value.show(item.professionID,item.parentProfessionID,item.professionName,item.postID,item.companyName,0,'推荐求职人员');
+      if(item.recordStatus==1){
+        recommendRef.value.show(item.professionID,item.parentProfessionID,item.professionName,item.postID,item.companyName,0,'推荐求职人员');
+      }else{
+        message.error("该岗位已停用,不能推荐!");
+      }
     }
 
     const onChangeStatus = (curPostID: any,statusValue:any) => {

+ 2 - 2
vue/src/views/jobUserManager/jobhunt/index.vue

@@ -162,7 +162,7 @@
                :row-key="(record) => record.jobHuntID" bordered @change="handleTableChange">
         <template #bodyCell="{ column, text, record }">
           <template v-if="column.key === 'recommendNum'">
-            <div class="table-operation">
+            <div>
               <a-button type="link" size="small" @click='onRecommendInfo(record)'>{{ record.recommendNum }}</a-button>
             </div>
           </template>
@@ -254,7 +254,7 @@ export default defineComponent({
       {title: '工作年限', dataIndex: 'workYear', key: 'workYear', align: "center",},
       {title: '求职类型', dataIndex: 'jobHuntTypeStr', key: 'jobHuntTypeStr', align: "center",},
       {title: '求职岗位', dataIndex: 'professionName', key: 'professionName', align: "center",},
-      {title: '推荐数量', key: 'recommendNum', align: "center"},
+      {title: '推荐数量', dataIndex: 'recommendNum', key: 'recommendNum', align: "center"},
       {
         title: '可到职日期', dataIndex: 'inDate', key: 'inDate', width: 100, align: "center",
         customRender: ({record}) => record.inDate == null ? "" : dayjs(record.inDate).format('YYYY-MM-DD'),

+ 16 - 6
vue/src/views/jobUserManager/jobhunt/recommend.vue

@@ -295,9 +295,14 @@ export default defineComponent({
         jobHuntID: searchParams.jobHuntID,
         recommendType: 1
       });
-      addRecommend(addRecommendList.value).then(() => {
-        loadData();
-        addRecommendList.value = [];
+      addRecommend(addRecommendList.value).then((data) => {
+        if(data!=-1){
+          message.info("提交成功!");
+          loadData();
+          addRecommendList.value = [];
+        }else{
+          message.error("该岗位招聘日期已结束,不能推荐!");
+        }
       });
     };
 
@@ -317,9 +322,14 @@ export default defineComponent({
           });
         }
       })
-      addRecommend(addRecommendList.value).then(() => {
-        loadData();
-        addRecommendList.value = [];
+      addRecommend(addRecommendList.value).then((data) => {
+        if(data!=-1){
+          message.info("提交成功!");
+          loadData();
+          addRecommendList.value = [];
+        }else{
+          message.error("存在已停用或招聘日期已结束的岗位,推荐失败!");
+        }
       });
     };
 

+ 16 - 16
vue/src/views/jobUserManager/jobuser/index.vue

@@ -253,22 +253,22 @@ export default defineComponent({
       url: '/jobUserService/jobUser/importJobUser',
       columns: [
         {cnName: '姓名', enName: 'name', width: 100},
-        {cnName: '身份证号码', enName: 'identityNumber', width: 100},
-        {cnName: '性别', enName: 'sexName', width: 100},
-        {cnName: '重点人员类别', enName: 'keyPersonTypeName', width: 100},
+        {cnName: '身份证号码', enName: 'identityNumber', width: 180},
+        {cnName: '性别', enName: 'sexName', width: 80},
+        {cnName: '重点人员类别', enName: 'keyPersonTypeName', width: 150},
         {cnName: '就业状态', enName: 'jobStatusName', width: 100},
         {cnName: '所属驿站', enName: 'siteName', width: 100},
-        {cnName: '地址', enName: 'address', width: 100},
-        {cnName: '联系电话', enName: 'userMobile', width: 100},
+        {cnName: '地址', enName: 'address', width: 150},
+        {cnName: '联系电话', enName: 'userMobile', width: 120},
         {cnName: '联系人', enName: 'userName', width: 100},
         {cnName: '籍贯', enName: 'nativePlace', width: 100},
-        {cnName: '社会保障卡号', enName: 'socialSecurityCard', width: 100},
-        {cnName: '毕业院校', enName: 'finishSchool', width: 100},
-        {cnName: '专业', enName: 'profession', width: 100},
+        {cnName: '社会保障卡号', enName: 'socialSecurityCard', width: 150},
+        {cnName: '毕业院校', enName: 'finishSchool', width: 150},
+        {cnName: '专业', enName: 'profession', width: 150},
         {cnName: '是否全日制', enName: 'isFullTimeName', width: 100},
-        {cnName: '职业资格类别', enName: 'occupationalCategoryName', width: 100},
-        {cnName: '职业资格等级', enName: 'occupationalLevelName', width: 100},
-        {cnName: '民族', enName: 'nationName', width: 100},
+        {cnName: '职业资格类别', enName: 'occupationalCategoryName', width: 150},
+        {cnName: '职业资格等级', enName: 'occupationalLevelName', width: 200},
+        {cnName: '民族', enName: 'nationName', width: 80},
         {cnName: '政治面貌', enName: 'politicsStatusName', width: 100},
         {cnName: '出生地', enName: 'birthPlace', width: 100},
         {cnName: '出生日期', enName: 'birthDayStr', width: 100},
@@ -283,11 +283,11 @@ export default defineComponent({
         {cnName: '省份', enName: 'provinceName', width: 100},
         {cnName: '市/县', enName: 'regionName', width: 100},
         {cnName: '镇街', enName: 'streetName', width: 100},
-        {cnName: '家庭住址', enName: 'familyAddress', width: 100},
-        {cnName: '经度', enName: 'longitude', width: 140},
-        {cnName: '纬度', enName: 'latitude', width: 140},
-        {cnName: '兴趣爱好', enName: 'hobby', width: 100},
-        {cnName: '个人技能', enName: 'personalSkills', width: 100},
+        {cnName: '家庭住址', enName: 'familyAddress', width: 150},
+        {cnName: '经度', enName: 'longitude', width: 120},
+        {cnName: '纬度', enName: 'latitude', width: 120},
+        {cnName: '兴趣爱好', enName: 'hobby', width: 180},
+        {cnName: '个人技能', enName: 'personalSkills', width: 180},
       ],
       template: {
         tempFileName: '求职人员导入模板.xlsx',