Browse Source

fix: 入职人员与求职意向Bug修改

zhangying 10 months ago
parent
commit
cba5fa3502

+ 3 - 1
src/main/java/com/hz/employmentsite/controller/jobUserManager/JobHuntController.java

@@ -11,6 +11,7 @@ import com.hz.employmentsite.util.ExcelHelper;
 import com.hz.employmentsite.vo.jobUserManager.JobHuntVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+
 import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
 import java.util.*;
@@ -93,7 +94,7 @@ public class JobHuntController {
 
         PageInfo<JobHuntVo> result = jobhuntService.getList(pageIndex, pageSize,jobHuntIDList,jobUserID,jobUserName,workName,minWorkYear, maxWorkYear, jobHuntTypeID, jobUserTypeID, minSalary, maxSalary, isAccomplish);
         ExcelHelper.ExcelData data = excelHelper.new ExcelData();
-        data.setTitles(Arrays.asList(new String[]{"序号","姓名", "希望工作地区", "可到职日期","工作年限", "求职类型", "人才类型", "月薪要求"}));
+        data.setTitles(Arrays.asList(new String[]{"序号", "姓名", "希望工作地区", "可到职日期", "工作年限", "求职类型", "求职岗位", "人才类型", "月薪要求"}));
         int i = 0;
         List<List<Object>> rowDatas = new ArrayList();
         for (JobHuntVo item : result.getList()) {
@@ -105,6 +106,7 @@ public class JobHuntController {
             row.add(dataUtils.dateToStrFormat(item.inDate,"yyyy-MM-dd"));
             row.add(item.workYear);
             row.add(item.jobHuntTypeStr);
+            row.add(item.professionName);
             row.add(item.jobUserTypeStr);
             row.add(item.minSalary+"-"+item.maxSalary);
             rowDatas.add(row);

+ 3 - 2
src/main/java/com/hz/employmentsite/controller/jobUserManager/JobUserController.java

@@ -16,6 +16,7 @@ import com.hz.employmentsite.util.ExcelHelper;
 import com.hz.employmentsite.vo.jobUserManager.JobUserVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+
 import javax.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -134,7 +135,7 @@ public class JobUserController {
         }else{
             ExcelHelper excelHelper = new ExcelHelper();
             ExcelHelper.ExcelData data = excelHelper.new ExcelData();
-            data.setTitles(Arrays.asList(new String[]{"序号", "姓名", "公民身份号码","性别", "民族", "联系电话", "所属驿站", "出生日期", "文化程度", "地址", "就业状态", "重点人员类别"}));
+            data.setTitles(Arrays.asList(new String[]{"序号", "姓名", "公民身份号码", "性别", "民族", "联系电话", "所属驿站", "年龄", "文化程度", "地址", "就业状态", "重点人员类别"}));
             int i = 0;
             List<List<Object>> rowDatas = new ArrayList();
             for (JobUserVo item : result.getList()) {
@@ -147,7 +148,7 @@ public class JobUserController {
                 row.add(item.getNation());
                 row.add(item.getUserMobile());
                 row.add(item.siteName);
-                row.add(dateUtils.dateToStr(item.getBirthDay()));
+                row.add(dateUtils.calculateAge(dateUtils.dateToStr(item.getBirthDay())));
                 row.add(item.cultureName);
                 row.add(item.getAddress());
                 row.add(item.jobStatusName);

+ 25 - 0
src/main/java/com/hz/employmentsite/util/DateUtils.java

@@ -396,7 +396,32 @@ public class DateUtils {
                         && rightStartDate.getTime() <= leftEndDate.getTime());
 
     }
+
     public Date formatDateToYYYYMMDD(Date date) {
         return this.StrToDate(this.dateToStrFormat(date, "yyyy-MM-dd") + " 00:00:00");
     }
+
+    /**
+     * 计算年龄
+     *
+     * @param birthdayString 生日日期
+     * @return 年龄
+     */
+    public Integer calculateAge(String birthdayString) {
+        if (birthdayString.isEmpty() || birthdayString.isBlank()) {
+            return null;
+        }
+
+        // 将生日字符串解析为LocalDate对象
+        LocalDate birthday = LocalDate.parse(birthdayString);
+
+        // 获取当前日期
+        LocalDate today = LocalDate.now();
+
+        // 使用Period.between()计算生日和今天之间的时期差异
+        Period period = Period.between(birthday, today);
+
+        // 返回年份差异,即年龄
+        return period.getYears();
+    }
 }

+ 4 - 1
src/main/java/com/hz/employmentsite/vo/jobUserManager/JobUserVo.java

@@ -1,7 +1,8 @@
 package com.hz.employmentsite.vo.jobUserManager;
 
-import lombok.Data;
 import com.hz.employmentsite.util.datarange.annotations.JobUserID;
+import lombok.Data;
+
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -32,6 +33,8 @@ public class JobUserVo {
 
     private Date birthDay;
 
+    private Integer age;
+
     private Integer familyNatureID;
 
     private Integer cultureRank;

+ 20 - 12
src/main/resources/mapping/cquery/JobHuntCQuery.xml

@@ -2,7 +2,10 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 <mapper namespace="com.hz.employmentsite.mapper.cquery.JobHuntCQuery">
     <select id="getJobHuntList" resultType="com.hz.employmentsite.vo.jobUserManager.JobHuntVo">
-        select jobHunt.JobHuntID, jobHunt.JobUserID, jobHunt.ProfessionID, jobHunt.WorkCode, jobHunt.WorkName, jobHunt.AreaWork, jobHunt.InDate, jobHunt.WorkYear, jobHunt.JobHuntType, jobHunt.JobUserType, jobHunt.MinSalary, jobHunt.MaxSalary, jobHunt.CreateUserID, jobHunt.CreateTime, jobHunt.ModifyUserID, jobHunt.ModifyTime, jobHunt.OtherDemand
+        select jobHunt.JobHuntID, jobHunt.JobUserID, jobHunt.ProfessionID, jobHunt.WorkCode, jobHunt.WorkName,
+        jobHunt.AreaWork, jobHunt.InDate, jobHunt.WorkYear, jobHunt.JobHuntType, jobHunt.JobUserType, jobHunt.MinSalary,
+        jobHunt.MaxSalary, jobHunt.CreateUserID, jobHunt.CreateTime, jobHunt.ModifyUserID, jobHunt.ModifyTime,
+        jobHunt.OtherDemand
         ,jobUser.name as JobUserName,dic_jobUserType.Name as jobUserTypeStr,dic_huntJobType.Name as jobHuntTypeStr
         ,profession.ProfessionName, profession.ParentProfessionID, IFNULL(count(rmgt.RecommendMgtID),0) as recommendNum
         ,jobUser.cultureRank
@@ -10,8 +13,10 @@
         left join pc_jobuser jobUser on jobHunt.JobUserID = jobUser.JobUserID
         left join pc_profession profession on jobHunt.professionID = profession.professionID
         left join pc_recommend_mgt rmgt on jobHunt.JobHuntID = rmgt.JobHuntID
-        left join (select * from sys_dictionary_item where DictionaryCode ='JobUserType') dic_jobUserType on jobHunt.JobUserType = dic_jobUserType.value
-        left join (select * from sys_dictionary_item where DictionaryCode ='JobHuntType') dic_huntJobType on jobHunt.JobHuntType = dic_huntJobType.value
+        left join (select * from sys_dictionary_item where DictionaryCode ='JobUserType') dic_jobUserType on
+        jobHunt.JobUserType = dic_jobUserType.value
+        left join (select * from sys_dictionary_item where DictionaryCode ='JobHuntType') dic_huntJobType on
+        jobHunt.JobHuntType = dic_huntJobType.value
         where 1=1
         <if test="jobHuntIDList != '' and jobHuntIDList != null">
             and jobHunt.JobHuntID in (${jobHuntIDList})
@@ -37,20 +42,23 @@
         <if test="jobUserTypeID != '' and jobUserTypeID != null">
             and jobUserType = #{jobUserTypeID}
         </if>
-        <if test="minSalary != '' and minSalary != null and (maxSalary == '' or maxSalary == null)" >
-            and jobHunt.minSalary <![CDATA[ >= ]]> #{minSalary} and jobHunt.maxSalary <![CDATA[ >= ]]> #{minSalary}
+        <if test="minSalary != '' and minSalary != null and (maxSalary == '' or maxSalary == null)">
+            and jobHunt.minSalary <![CDATA[ >= ]]> #{minSalary}
         </if>
         <if test="maxSalary != '' and maxSalary != null and (minSalary == '' or minSalary == null)">
-            and jobHunt.minSalary <![CDATA[ <= ]]> #{maxSalary} and jobHunt.maxSalary <![CDATA[ >= ]]> #{maxSalary}
+            and jobHunt.maxSalary <![CDATA[ <= ]]> #{maxSalary}
         </if>
         <if test="minSalary != '' and minSalary != null and maxSalary != '' and maxSalary != null">
-            and (jobHunt.minSalary <![CDATA[ <= ]]> #{maxSalary})
-            or  (jobHunt.minSalary <![CDATA[ <= ]]> #{minSalary} and jobHunt.maxSalary <![CDATA[ >= ]]> #{minSalary})
+            and
+            (jobHunt.minSalary <![CDATA[ >= ]]> #{minSalary} and jobHunt.maxSalary <![CDATA[ <= ]]> #{maxSalary})
         </if>
-       <!-- <if test="isAccomplish != '' and isAccomplish != null">
-            and isAccomplish = #{isAccomplish}
-        </if>-->
-        group by jobHunt.JobHuntID, jobHunt.JobUserID, jobHunt.ProfessionID, jobHunt.WorkCode, jobHunt.WorkName, jobHunt.AreaWork, jobHunt.InDate, jobHunt.WorkYear, jobHunt.JobHuntType, jobHunt.JobUserType, jobHunt.MinSalary, jobHunt.MaxSalary, jobHunt.CreateUserID, jobHunt.CreateTime, jobHunt.ModifyUserID, jobHunt.ModifyTime, jobHunt.OtherDemand
+        <if test="isAccomplish != '' and isAccomplish != null">
+            and rmgt.EntryState = #{isAccomplish}
+        </if>
+        group by jobHunt.JobHuntID, jobHunt.JobUserID, jobHunt.ProfessionID, jobHunt.WorkCode, jobHunt.WorkName,
+        jobHunt.AreaWork, jobHunt.InDate, jobHunt.WorkYear, jobHunt.JobHuntType, jobHunt.JobUserType, jobHunt.MinSalary,
+        jobHunt.MaxSalary, jobHunt.CreateUserID, jobHunt.CreateTime, jobHunt.ModifyUserID, jobHunt.ModifyTime,
+        jobHunt.OtherDemand
         ,jobUser.`Name`,dic_jobUserType.`Name`,dic_huntJobType.`Name`, profession.ProfessionName, profession.ParentProfessionID,jobUser.cultureRank
         order by jobHunt.CreateTime desc
     </select>

+ 19 - 4
vue/src/views/jobUserManager/jobuser/edit.vue

@@ -103,7 +103,14 @@
       <a-row :gutter="24">
         <a-col :span="8">
           <a-form-item label="民族" :label-col="{ span: 6 }"  name="nation">
-            <a-input v-model:value="dataModel.nation" placeholder=""/>
+            <!--            <a-input v-model:value="dataModel.nation" placeholder=""/>-->
+            <a-select
+              ref="select"
+              v-model:value="dataModel.nation"
+              :options="nationList"
+              :field-names="{ label: 'name', value: 'value' }"
+              :allow-clear="true"
+            ></a-select>
           </a-form-item>
         </a-col>
         <a-col :span="8">
@@ -440,12 +447,12 @@
 <script lang="ts">
 import {defineComponent, reactive, ref, toRefs} from 'vue';
 import type {SelectProps, TableColumnsType} from 'ant-design-vue';
+import {message} from "ant-design-vue";
 import {useTabsViewStore} from '@/store/modules/tabsView';
 import BUploadFile from '@/components/file/uploadFile.vue';
 import {get} from "@/api/common";
-import { getSysDictionaryList } from '@/api/system/dictionary';
-import {save, getEducationList, getDataById, getExperienceList} from '@/api/jobUserManager/jobuser';
-import {message} from "ant-design-vue";
+import {getSysDictionaryList} from '@/api/system/dictionary';
+import {getDataById, getEducationList, getExperienceList, save} from '@/api/jobUserManager/jobuser';
 import {getSiteList} from "@/api/baseSettings/siteInfo";
 
 interface FormState {
@@ -477,6 +484,7 @@ export default defineComponent(
       const regionList = ref<SelectProps['options']>();
       const streetList = ref<SelectProps['options']>();
       const familyNatureList = ref<SelectProps['options']>();
+      const nationList = ref<SelectProps['options']>();
 
       const educationData = ref([]);
       const educationColumns: TableColumnsType = [
@@ -581,6 +589,11 @@ export default defineComponent(
           jobStatusList.value = data;
         });
       };
+      const getNationList = () => {
+        getSysDictionaryList('NationType').then((data) => {
+          nationList.value = data;
+        });
+      };
       const getBloodTypeList = () => {
         getSysDictionaryList('BloodType').then((data) => {
           bloodTypeList.value = data;
@@ -729,6 +742,7 @@ export default defineComponent(
         getGenderList();
         getCultureList();
         getJobStatusList();
+        getNationList();
         getBloodTypeList();
         getFamilyNatureList();
         getKeyPersonTypeList();
@@ -777,6 +791,7 @@ export default defineComponent(
         addExperience,
         experienceColumns,
         educationColumns,
+        nationList
       }
     },
     created() {