feat: Add salary composition, welfare benefits, and work schedule fields to Job model and database

This commit is contained in:
2026-07-20 11:30:22 +08:00
parent f07b5f77cd
commit 9334290fd6
4 changed files with 161 additions and 1 deletions

View File

@@ -48,6 +48,18 @@ public class Job extends BaseEntity
@ApiModelProperty("最大薪资(元)")
private Long maxSalary;
@Excel(name = "薪资范围与构成")
@ApiModelProperty("薪资范围与构成(薪资数值范围使用 minSalary/maxSalary对应业务字典 salary_composition多项及手动输入值以英文逗号分隔")
private String salaryComposition;
@Excel(name = "福利待遇")
@ApiModelProperty("福利待遇,对应业务字典 welfare_benefits多项及手动输入值以英文逗号分隔")
private String welfareBenefits;
@Excel(name = "工作时间安排")
@ApiModelProperty("工作时间安排,对应业务字典 work_schedule多项及手动输入值以英文逗号分隔")
private String workSchedule;
@TableField(exist = false)
private Long salaryMin;

View File

@@ -9,6 +9,9 @@
<result property="jobTitle" column="job_title" />
<result property="minSalary" column="min_salary" />
<result property="maxSalary" column="max_salary" />
<result property="salaryComposition" column="salary_composition" />
<result property="welfareBenefits" column="welfare_benefits" />
<result property="workSchedule" column="work_schedule" />
<result property="education" column="education" />
<result property="experience" column="experience" />
<result property="companyName" column="company_name" />
@@ -113,7 +116,13 @@
</resultMap>
<sql id="selectJobVo">
select job_id, job_title, min_salary, max_salary, education, experience, company_name, job_location, posting_date, vacancies, del_flag, create_by, create_time, update_by, update_time, remark, latitude, longitude, "view", company_id , is_hot ,is_urgent,apply_num,is_publish, description,job_location_area_code,data_source,job_url,job_category,is_explain,explain_url,cover,job_type,job_address, review_status,is_key_populations,key_populations from job
select job_id, job_title, min_salary, max_salary, salary_composition, welfare_benefits,
work_schedule, education, experience, company_name, job_location, posting_date, vacancies,
del_flag, create_by, create_time, update_by, update_time, remark, latitude, longitude, "view",
company_id, is_hot, is_urgent, apply_num, is_publish, description, job_location_area_code,
data_source, job_url, job_category, is_explain, explain_url, cover, job_type, job_address,
review_status, is_key_populations, key_populations
from job
</sql>
<insert id="insertBatchRowWork">
INSERT INTO row_work (

View File

@@ -0,0 +1,33 @@
package com.ruoyi.cms.domain;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
class JobDetailTagsTest
{
private final ObjectMapper objectMapper = new ObjectMapper();
@Test
void detailTagsRoundTripAsCommaSeparatedStrings() throws Exception
{
String requestJson = "{"
+ "\"salaryComposition\":\"基本工资,绩效工资,项目提成\","
+ "\"welfareBenefits\":\"五险一金,带薪年假,生日福利\","
+ "\"workSchedule\":\"早10点-下午7点,午休2小时,周末双休\""
+ "}";
Job job = objectMapper.readValue(requestJson, Job.class);
assertEquals("基本工资,绩效工资,项目提成", job.getSalaryComposition());
assertEquals("五险一金,带薪年假,生日福利", job.getWelfareBenefits());
assertEquals("早10点-下午7点,午休2小时,周末双休", job.getWorkSchedule());
JsonNode responseJson = objectMapper.readTree(objectMapper.writeValueAsString(job));
assertEquals("基本工资,绩效工资,项目提成", responseJson.get("salaryComposition").asText());
assertEquals("五险一金,带薪年假,生日福利", responseJson.get("welfareBenefits").asText());
assertEquals("早10点-下午7点,午休2小时,周末双休", responseJson.get("workSchedule").asText());
}
}