Browse Source

feat: 求职人员认领

zhangying 9 months ago
parent
commit
6f80e3d171

+ 5 - 1
doc/待更新脚本.txt

@@ -9,4 +9,8 @@ INSERT INTO `sys_dictionary_item` VALUES ('1ecc5294-51f6-4a10-add2-e63f7ac78006'
 
 -- 2024-7-8 就业活动增加字段
 ALTER TABLE `pc_jobfairs` ADD COLUMN `ActivityType` int NULL COMMENT '招聘活动类型' AFTER `JobFariDesc`;
-ALTER TABLE `pc_jobfairs` ADD COLUMN `SiteID` varchar(50) NULL COMMENT '所属驿站' AFTER `RegionCode`;
+ALTER TABLE `pc_jobfairs` ADD COLUMN `SiteID` varchar(50) NULL COMMENT '所属驿站' AFTER `RegionCode`;
+
+-- 2024-7-9 求职人员认领按钮权限
+INSERT INTO sys_function_code VALUES ('T01030109', '求职人员认领', 'T010301', 9);
+insert into sys_role_sys_function_code (`RoleID`, `FunctionCode`) values('10a12f77-0958-4220-b9ce-07b9215046f2','T01030109');

+ 15 - 0
src/main/java/com/hz/employmentsite/controller/jobUserManager/JobUserController.java

@@ -16,6 +16,7 @@ import com.hz.employmentsite.util.DateUtils;
 import com.hz.employmentsite.util.ExcelHelper;
 import com.hz.employmentsite.util.StringUtils;
 import com.hz.employmentsite.vo.dataMap.JobUserMapVo;
+import com.hz.employmentsite.vo.jobUserManager.ClaimJobUserVo;
 import com.hz.employmentsite.vo.jobUserManager.JobUserVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -238,4 +239,18 @@ public class JobUserController {
         return RespGenerstor.success(result);
     }
 
+    @GetMapping("/getClaimJobUserList")
+    public BaseResponse getClaimJobUserList(@RequestParam("pageIndex") int pageIndex, @RequestParam("pageSize") int pageSize,
+                                       @RequestParam(required = false) String name, @RequestParam(required = false) String address,
+                                       @RequestParam(required = false) Integer keyPersonTypeID) {
+        PageInfo<ClaimJobUserVo> result = jobuserService.selectClaimJobUserList(pageIndex, pageSize, name, address, keyPersonTypeID);
+        return RespGenerstor.success(result);
+    }
+
+    @ResponseBody
+    @PostMapping("/claimJobUser")
+    public BaseResponse claimJobUser(@RequestBody List<String> ids, @RequestParam("siteID") String siteID) {
+        int result = jobuserService.claimJobUser(ids, siteID);
+        return RespGenerstor.success(result);
+    }
 }

+ 6 - 0
src/main/java/com/hz/employmentsite/mapper/cquery/JobUserCQuery.java

@@ -2,6 +2,7 @@ package com.hz.employmentsite.mapper.cquery;
 
 import com.hz.employmentsite.model.PcJobuser;
 import com.hz.employmentsite.vo.dataMap.JobUserMapVo;
+import com.hz.employmentsite.vo.jobUserManager.ClaimJobUserVo;
 import com.hz.employmentsite.vo.jobUserManager.JobUserVo;
 import org.apache.ibatis.annotations.Param;
 
@@ -37,4 +38,9 @@ public interface JobUserCQuery {
 
 
     List<JobUserVo> getJobUserDataList(@Param("jobUserName") String jobUserName);
+
+    List<ClaimJobUserVo> selectClaimJobUserList(@Param("name") String name, @Param("address") String address, @Param("keyPersonTypeID") Integer KeyPersonTypeID,
+                                                @Param("siteID") String siteID);
+
+    int ClaimJobUserList(@Param("jobUserIDList") String jobUserIDList, @Param("siteId") String siteId);
 }

+ 20 - 0
src/main/java/com/hz/employmentsite/services/impl/jobUserManager/JobUserServiceImpl.java

@@ -16,6 +16,7 @@ import com.hz.employmentsite.services.service.system.DictionaryService;
 import com.hz.employmentsite.util.*;
 import com.hz.employmentsite.util.ip.IpUtils;
 import com.hz.employmentsite.vo.dataMap.JobUserMapVo;
+import com.hz.employmentsite.vo.jobUserManager.ClaimJobUserVo;
 import com.hz.employmentsite.vo.jobUserManager.JobHuntVo;
 import com.hz.employmentsite.vo.jobUserManager.JobUserServiceVo;
 import com.hz.employmentsite.vo.jobUserManager.JobUserVo;
@@ -936,4 +937,23 @@ public class JobUserServiceImpl implements JobUserService {
         }
         return 0;
     }
+
+    @Override
+    public PageInfo<ClaimJobUserVo> selectClaimJobUserList(Integer pageIndex, Integer pageSize, String name, String address, Integer KeyPersonTypeID) {
+        PageHelper.startPage(pageIndex, pageSize);
+        List<ClaimJobUserVo> list = jobUserCQuery.selectClaimJobUserList(name, address, KeyPersonTypeID, "66fc1176-b8a1-4b9a-b2fc-9f590ceed342");
+        // 信息脱敏
+        list.forEach(item -> {
+            item.setUserMobile(calculateUtils.maskMobile(desUtils.decoderText(item.getUserMobile())));
+            String idNumber = desUtils.decoderText(item.getIdentityNumber());
+            item.setAge(calculateUtils.calculateAge(idNumber));
+        });
+        PageInfo<ClaimJobUserVo> result = new PageInfo(list);
+        return result;
+    }
+
+    @Override
+    public int claimJobUser(List<String> ids, String siteID) {
+        return jobUserCQuery.ClaimJobUserList(stringUtils.ListToInSql(ids), siteID);
+    }
 }

+ 6 - 0
src/main/java/com/hz/employmentsite/services/service/jobUserManager/JobUserService.java

@@ -5,6 +5,7 @@ import com.hz.employmentsite.model.PcEducation;
 import com.hz.employmentsite.model.PcExperience;
 import com.hz.employmentsite.model.PcPost;
 import com.hz.employmentsite.vo.dataMap.JobUserMapVo;
+import com.hz.employmentsite.vo.jobUserManager.ClaimJobUserVo;
 import com.hz.employmentsite.vo.jobUserManager.JobUserVo;
 
 import javax.servlet.http.HttpServletRequest;
@@ -46,4 +47,9 @@ public interface JobUserService {
                                           Integer maxAge, String jobUserName);
 
     int editOpenID(JobUserVo data);
+
+    PageInfo<ClaimJobUserVo> selectClaimJobUserList(Integer pageIndex, Integer pageSize, String name,
+                                                    String address, Integer KeyPersonTypeID);
+
+    int claimJobUser(List<String> ids, String siteID);
 }

+ 30 - 0
src/main/java/com/hz/employmentsite/vo/jobUserManager/ClaimJobUserVo.java

@@ -0,0 +1,30 @@
+package com.hz.employmentsite.vo.jobUserManager;
+
+import lombok.Data;
+
+/**
+ * 求职人员认领数据VO
+ */
+@Data
+public class ClaimJobUserVo {
+    private String jobUserID;
+
+    private String siteID;
+    private String siteName;
+
+    private String name;
+
+    private String identityNumber;
+
+    private Integer age;
+
+    private String sexName;
+
+    private String userMobile;
+
+    private String address;
+
+    public String jobStatusName;
+
+    public String keyTypeName;
+}

+ 38 - 0
src/main/resources/mapping/cquery/JobUserCQuery.xml

@@ -230,4 +230,42 @@
         </where>
         order by jobuser.name,jobuser.userMobile
     </select>
+
+    <select id="selectClaimJobUserList" resultType="com.hz.employmentsite.vo.jobUserManager.ClaimJobUserVo">
+        SELECT
+            jobUser.JobuserID,
+            jobUser.`Name`,
+            jobUser.IdentityNumber,
+            gender.`Name` AS sexName,
+            jobUser.UserMobile,
+            jobUser.Address,
+            jobStatus.`Name` AS jobStatusName,
+            keytype.`name` AS KeyTypeName,
+            site.SiteName
+        FROM
+            `pc_jobuser` jobUser
+                LEFT JOIN sys_dictionary_item keytype ON jobUser.KeyPersonTypeID = keytype.`value` AND keytype.DictionaryCode = 'KeyPersonType'
+                LEFT JOIN sys_dictionary_item gender ON jobUser.Sex = gender.`value` AND gender.DictionaryCode = 'Gender'
+                LEFT JOIN sys_dictionary_item jobStatus ON jobUser.jobStatusID = jobStatus.`value` AND jobStatus.DictionaryCode = 'JobStatus'
+                LEFT JOIN pc_site site ON jobUser.SiteID = site.SiteID
+        where
+            jobUser.siteID = #{siteID}
+            <if test="name != '' and name != null">
+                and jobUser.name like Concat('%',#{name},'%')
+            </if>
+            <if test="address != '' and address != null">
+                and jobUser.address like Concat('%',#{address},'%')
+            </if>
+            <if test="keyPersonTypeID != null and keyPersonTypeID != ''">
+                and jobUser.KeyPersonTypeID = #{keyPersonTypeID}
+            </if>
+        order by jobuser.CreateTime desc
+    </select>
+
+    <update id="ClaimJobUserList">
+        UPDATE pc_jobuser
+        SET SiteID = #{siteId}
+        WHERE
+            JobuserID in (${jobUserIDList})
+    </update>
 </mapper>

+ 26 - 0
vue/src/api/jobUserManager/jobuser/index.ts

@@ -114,3 +114,29 @@ export function getDataMapList(params: any) {
     },
   );
 }
+
+export function getClaimJobUserList(query: any) {
+  return request(
+    {
+      url: 'jobUserService/jobUser/getClaimJobUserList',
+      method: 'get',
+      params: query,
+    },
+    {isNew: true},
+  );
+}
+
+export function claimJobUser(ids: any, siteID: any) {
+  return request({
+      url: 'jobUserService/jobUser/claimJobUser',
+      method: 'post',
+      data: ids,
+      params: {siteID}
+    },
+    {
+      isNew: true,
+      successMsg: '调整成功!',
+      errorMsg: '调整失败!'
+    }
+  )
+}

+ 232 - 0
vue/src/views/jobUserManager/jobuser/ClaimJobUserTableCom.vue

@@ -0,0 +1,232 @@
+<!-- 认领求职人员对话框 -->
+<template>
+  <div>
+    <a-modal
+      width="1300px"
+      v-model:visible="visible"
+      title="认领求职人员"
+      @ok="handleOk"
+      :keyboard="false"
+      :mask-closable="false"
+    >
+      <template #footer>
+        <a-button key="submit" type="primary" @click="handleOk">关闭</a-button>
+      </template>
+      <a-form ref="formRef" class="ant-advanced-search-form" :model="searchParamsState">
+        <a-row :gutter="24">
+          <a-col :span="6">
+            <a-form-item label="姓名" :label-col="{ span: 6 }" name="name">
+              <a-input v-model:value="searchParamsState.name" placeholder="" :allow-clear="true"/>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="地址" :label-col="{ span: 6 }" name="address">
+              <a-input v-model:value="searchParamsState.address" placeholder="" :allow-clear="true"/>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="重点人员类别" :label-col="{ span: 8 }" name="keyPersonTypeID">
+              <a-select
+                ref="select"
+                v-model:value="searchParamsState.keyPersonTypeID"
+                :options="keyPersonTypeList"
+                :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: left">
+            <a-button type="primary" html-type="submit" @click="loadData">查询</a-button>
+            <a-button
+              style="margin: 0 8px"
+              @click="
+              () => {
+                formRef.resetFields();
+                loadData();
+              }
+            ">重置
+            </a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+      <a-row class="edit-operation" style="margin-bottom: 10px">
+        <a-col :span="24" class="flex-space-between">
+          <div>
+          </div>
+          <div>
+            <a-button type="primary" html-type="submit" @click='onClaimJobUser(formState.selectedRowKeys)'
+                      :disabled="formState.selectedRowKeys.length == 0"
+                      :loading="claimJobUserLoading">
+              批量调整
+            </a-button>
+          </div>
+        </a-col>
+      </a-row>
+      <a-table :dataSource="jobUserList"
+               :columns="originalColumns"
+               bordered
+               :scroll="{ x: '100%', y: 500 }"
+               :pagination="tablePagination"
+               :loading="formState.loading"
+               :row-selection="{ selectedRowKeys: formState.selectedRowKeys, onChange: onSelectChange }"
+               :row-key="(record) => record.jobUserID"
+               @change="handleTableChange">
+        <template #bodyCell="{ column, text, record }">
+          <template v-if="column.key === 'serviceTime'">
+            <div>
+              {{ dayjs(record.serviceTime).format('YYYY-MM-DD') }}
+            </div>
+          </template>
+          <template v-if="column.key === 'operation'">
+            <div class="table-operation">
+              <a-button type="link" size="small" :loading="claimJobUserLoading"
+                        @click="onClaimJobUser([record.jobUserID])">调整到本驿站
+              </a-button>
+            </div>
+          </template>
+        </template>
+      </a-table>
+    </a-modal>
+  </div>
+</template>
+
+<script setup lang="ts">
+import {claimJobUser, getClaimJobUserList} from "@/api/jobUserManager/jobuser";
+import {computed, reactive, ref} from "vue";
+import dayjs from "dayjs";
+import {getPaginationTotalTitle} from "@/utils/common";
+import {type FormInstance, Modal, type SelectProps, type TableProps} from "ant-design-vue";
+import {getSysDictionaryList} from "@/api/system/dictionary";
+import {useUserStore} from "@/store/modules/user";
+
+const userStore = useUserStore();
+const userInfo = ref(userStore.getUserInfo);
+const emit = defineEmits(["modalOk"]);
+
+const formRef = ref<FormInstance>();
+// 查询参数
+const searchParamsState = reactive({
+  pageIndex: 1,
+  pageSize: 20,
+  name: null,
+  address: null,
+  keyPersonTypeID: null
+});
+// 对话框显示关闭开关
+const visible = ref(false);
+// 求职人员数据
+const jobUserList = ref()
+// 数据表格定义
+const originalColumns = [
+  {
+    title: '序号',
+    align: 'center',
+    width: 80,
+    key: 'jobUserID',
+    customRender: (item) =>
+      `${searchParamsState.pageSize * (searchParamsState.pageIndex - 1) + item.index + 1}`,
+    isDisabled: true
+  },
+  {title: '姓名', dataIndex: 'name', key: 'name', width: 100, align: "center"},
+  {title: '性别', dataIndex: 'sexName', key: 'sexName', width: 80, align: "center"},
+  {title: '联系电话', dataIndex: 'userMobile', key: 'userMobile', align: "center"},
+  {title: '所属驿站', dataIndex: 'siteName', key: 'siteName', align: "center"},
+  {title: '年龄', dataIndex: 'age', key: 'age', align: "center"},
+  {title: '就业状态', dataIndex: 'jobStatusName', key: 'jobStatusName', align: "center"},
+  {title: '重点人员类别', dataIndex: 'keyTypeName', key: 'keyTypeName', align: "center"},
+  {title: '地址', dataIndex: 'address', key: 'address', align: "center", isDefaultClose: true},
+  {title: '操作', key: 'operation', width: 110, align: 'center', isDisabled: true},
+];
+const formState = reactive({
+  total: 0,
+  selectedRowKeys: [],
+  loading: false,
+});
+// 表格分页数据
+const tablePagination = computed(() => ({
+  total: formState.total,
+  current: searchParamsState.pageIndex,
+  pageSize: searchParamsState.pageSize,
+  showSizeChanger: true,
+  showTotal: (total) => getPaginationTotalTitle(total),
+}));
+const keyPersonTypeList = ref<SelectProps['options']>();
+// 调整按钮加载
+const claimJobUserLoading = ref(false);
+
+// 数据加载
+async function loadData() {
+  formState.loading = true;
+  await getClaimJobUserList(searchParamsState).then((result: any) => {
+    jobUserList.value = result.list;
+    formState.total = result.total;
+  }).finally(() => {
+    formState.loading = false;
+  });
+}
+
+// 表格分页触发事件
+const handleTableChange: TableProps['onChange'] = (pag: {
+  pageSize: number;
+  current: number;
+}) => {
+  searchParamsState.pageIndex = pag.current;
+  searchParamsState.pageSize = pag.pageSize;
+  loadData();
+};
+
+// 对话框确定事件
+function handleOk() {
+  visible.value = false;
+  emit("modalOk");
+}
+
+// 表格数据选择
+const onSelectChange = (selectedRowKeys: any) => {
+  formState.selectedRowKeys = selectedRowKeys;
+};
+
+const getKeyPersonTypeList = () => {
+  getSysDictionaryList('KeyPersonType').then((data) => {
+    keyPersonTypeList.value = data;
+  });
+};
+
+// 显示
+function show() {
+  visible.value = true;
+  loadData();
+  getKeyPersonTypeList();
+}
+
+function onClaimJobUser(ids) {
+  if (!userInfo.value.siteID) {
+    Modal.error({
+      title: '提示',
+      content: `当前账号未绑定驿站,请切换账号重试!`,
+    });
+    return;
+  }
+  if (ids.length == 0) {
+    return;
+  }
+  claimJobUserLoading.value = true;
+  claimJobUser(ids, userInfo.value.siteID).then((result: any) => {
+    if (result > 0) {
+      loadData();
+    }
+  }).finally(() => {
+    claimJobUserLoading.value = false;
+  })
+}
+
+defineExpose({
+  show
+})
+</script>
+
+<style scoped>
+
+</style>

+ 18 - 2
vue/src/views/jobUserManager/jobuser/index.vue

@@ -129,6 +129,8 @@
                             @on-check="columnsCheckSub"></ColumnsSetting>
           </div>
           <div>
+            <a-button type="primary" html-type="submit" @click='openClaimModal' functioncode="T01030109">认领求职人员
+            </a-button>
             <a-button type="primary" html-type="submit" @click='onAdd' functioncode="T01030102">新增</a-button>
             <BImportExcel functioncode="T01030105"
                           :options="importOptions"
@@ -168,6 +170,8 @@
 
     <!-- 跟进服务记录 -->
     <ServiceTableCom ref="serviceTableComRef"></ServiceTableCom>
+    <!-- 认领求职人员 -->
+    <ClaimJobUserTableCom ref="claimJobUserTableComRef" @modal-ok="loadData"></ClaimJobUserTableCom>
   </div>
 </template>
 
@@ -187,16 +191,21 @@ import {get} from "@/api/common";
 import ColumnsSetting from "@/components/common/ColumnsSetting.vue";
 import type {ImportProps} from "@/components/basic/excel/importExcel/ImportProps";
 import ServiceTableCom from "@/views/jobUserManager/jobuser/ServiceTableCom.vue";
+import ClaimJobUserTableCom from "@/views/jobUserManager/jobuser/ClaimJobUserTableCom.vue";
 
 export default defineComponent({
   name: 'JobUserList',
-  components: {ServiceTableCom, ColumnsSetting, DownOutlined, UpOutlined, BExportExcel, BImportExcel},
+  components: {
+    ClaimJobUserTableCom,
+    ServiceTableCom, ColumnsSetting, DownOutlined, UpOutlined, BExportExcel, BImportExcel
+  },
   setup() {
     const modalRoleUserRef = ref();
     const expand = ref(false);
     const modalRoleEditRef = ref();
     const formRef = ref<FormInstance>();
     const serviceTableComRef = ref();
+    const claimJobUserTableComRef = ref();
     const searchParamsState = reactive({
       pageIndex: 1,
       pageSize: 20,
@@ -434,12 +443,18 @@ export default defineComponent({
       serviceTableComRef.value.show(JSON.parse(JSON.stringify(jobUser)));
     }
 
+    // 开启认领求职人员对话框
+    function openClaimModal() {
+      claimJobUserTableComRef.value.show();
+    }
+
     return {
       modalRoleUserRef,
       modalRoleEditRef,
       formRef,
       loadData,
       onAdd,
+      openClaimModal,
       onDel,
       onEdit,
       searchParamsState,
@@ -469,7 +484,8 @@ export default defineComponent({
       createDate,
       onCreateTimeChange,
       serviceTableComRef,
-      openServiceModal
+      claimJobUserTableComRef,
+      openServiceModal,
     };
   },
   created() {