支持按身份证查询推送岗位

This commit is contained in:
2026-07-30 10:21:31 +08:00
parent df6d3a7220
commit 99bb6ca5b2
4 changed files with 106 additions and 2 deletions

View File

@@ -66,4 +66,10 @@ public interface AppNoticeMapper extends BaseMapper<AppNotice>
public int deleteNoticeByIds(Long[] noticeIds);
List<Job> recommend(@Param("jobTitle")String jobTitle,@Param("userId") Long userId);
/**
* 按身份证号查询人才服务系统推送的有效岗位。
*/
List<Job> recommendByIdNumber(@Param("jobTitle") String jobTitle,
@Param("idNumber") String idNumber);
}

View File

@@ -8,6 +8,7 @@ import com.ruoyi.cms.mapper.*;
import com.ruoyi.cms.service.IAppNoticeService;
import com.ruoyi.cms.util.notice.NoticeUtils;
import com.ruoyi.cms.util.StringUtil;
import com.ruoyi.cms.util.RoleUtils;
import com.ruoyi.common.core.domain.entity.AppUser;
import com.ruoyi.common.utils.SiteSecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -164,6 +165,13 @@ public class AppNoticeServiceImpl implements IAppNoticeService
@Override
public List<Job> recommend(String jobTitle) {
String idNumber = RoleUtils.getAppCurrentUseridCard();
if (idNumber != null && !idNumber.trim().isEmpty()) {
List<Job> pushedJobs = appNoticeMapper.recommendByIdNumber(jobTitle, idNumber);
if (!pushedJobs.isEmpty()) {
return pushedJobs;
}
}
return appNoticeMapper.recommend(jobTitle,SiteSecurityUtils.getUserId());
}
@@ -252,4 +260,3 @@ public class AppNoticeServiceImpl implements IAppNoticeService
return t;
}
}

View File

@@ -52,6 +52,57 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
</select>
<select id="recommendByIdNumber" resultType="com.ruoyi.cms.domain.Job">
SELECT
j.job_id AS jobId,
j.job_title AS jobTitle,
j.min_salary AS minSalary,
j.max_salary AS maxSalary,
j.salary_composition AS salaryComposition,
j.welfare_benefits AS welfareBenefits,
j.work_schedule AS workSchedule,
j.education AS education,
j.experience AS experience,
j.company_name AS companyName,
j.job_location AS jobLocation,
j.job_location_area_code AS jobLocationAreaCode,
j.posting_date AS postingDate,
j.vacancies AS vacancies,
j.latitude AS latitude,
j.longitude AS longitude,
j."view" AS view,
j.company_id AS companyId,
j.is_hot AS isHot,
j.is_urgent AS isUrgent,
j.apply_num AS applyNum,
j.description AS description,
j.is_publish AS isPublish,
j.data_source AS dataSource,
j.job_url AS jobUrl,
j.row_id AS rowId,
j.job_category AS jobCategory,
j.is_explain AS isExplain,
j.explain_url AS explainUrl,
j.cover AS cover,
j.job_type AS jobType,
j.type AS type,
j.job_address AS jobAddress,
j.review_status AS reviewStatus,
j.is_key_populations AS isKeyPopulations,
j.key_populations AS keyPopulations,
j.job_feature AS jobFeature
FROM shz.job_push_record AS r
INNER JOIN shz.job AS j ON j.job_id = r.job_id
WHERE r.id_number = #{idNumber}
AND r.is_push = 1
AND j.del_flag = '0'
AND j.is_publish = 1
<if test="jobTitle != null and jobTitle != ''">
AND j.job_category = #{jobTitle}
</if>
ORDER BY r.push_time DESC NULLS LAST, j.posting_date DESC NULLS LAST, j.job_id DESC
</select>
<insert id="insertNotice" parameterType="SysNotice">
insert into app_notice (
<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>

View File

@@ -0,0 +1,40 @@
-- 执行状态:测试环境已执行
-- 测试环境test
-- 测试执行时间2026-07-30 10:06:47 +0800
-- 正式环境:未执行
-- 石河子智慧就业:人才服务岗位推送关联表。
-- 关联岗位 ID 与身份证号is_push=0 表示未推送is_push=1 表示已推送。
-- 可重复执行,不写入业务测试数据。
BEGIN;
SET LOCAL search_path = shz, public;
CREATE SEQUENCE IF NOT EXISTS job_push_record_id_seq
START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
CREATE TABLE IF NOT EXISTS job_push_record (
id BIGINT NOT NULL DEFAULT nextval('job_push_record_id_seq') PRIMARY KEY,
job_id BIGINT NOT NULL,
id_number VARCHAR(32) NOT NULL,
is_push SMALLINT NOT NULL DEFAULT 0,
push_time TIMESTAMP(0),
create_time TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_time TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP,
remark VARCHAR(500)
);
COMMENT ON TABLE job_push_record IS '人才服务岗位推送关联表';
COMMENT ON COLUMN job_push_record.job_id IS '石河子岗位 ID关联 job.job_id';
COMMENT ON COLUMN job_push_record.id_number IS '被推送人的身份证号';
COMMENT ON COLUMN job_push_record.is_push IS '是否已推送0未推送1已推送';
COMMENT ON COLUMN job_push_record.push_time IS '最近一次推送时间';
CREATE UNIQUE INDEX IF NOT EXISTS uk_job_push_record_job_id_number
ON job_push_record (job_id, id_number);
CREATE INDEX IF NOT EXISTS idx_job_push_record_id_number
ON job_push_record (id_number);
CREATE INDEX IF NOT EXISTS idx_job_push_record_is_push
ON job_push_record (is_push);
COMMIT;