feat: Refactor company and job management to include company nature

- Added companyNature field to Company entity and updated related services and mappers.
- Removed jobNature field from Job and ESJobDocument entities as it is no longer needed.
- Updated CompanyController to handle current company information and synchronization of account codes.
- Enhanced CompanyServiceImpl to manage company nature changes and synchronize related job postings.
- Updated SQL migrations to add company nature field and associated business dictionary entries.
- Refactored job-related services to ensure they reflect the latest company nature information.
This commit is contained in:
2026-07-16 15:05:53 +08:00
parent 3f1624da3a
commit acb0762dcc
17 changed files with 378 additions and 135 deletions

View File

@@ -31,7 +31,7 @@
<result property="jobUrl" column="job_url" />
<result property="rowId" column="row_id" />
<result property="jobCategory" column="job_category" />
<result property="jobNature" column="job_nature" />
<result property="companyNature" column="company_nature" />
<result property="isExplain" column="is_explain" />
<result property="explainUrl" column="explain_url" />
<result property="cover" column="cover" />
@@ -75,7 +75,6 @@
<result property="jobUrl" column="job_url" />
<result property="rowId" column="row_id" />
<result property="jobCategory" column="job_category" />
<result property="jobNature" column="job_nature" />
<result property="isExplain" column="is_explain" />
<result property="explainUrl" column="explain_url" />
<result property="cover" column="cover" />
@@ -114,7 +113,7 @@
</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,job_nature,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, 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 (
@@ -144,7 +143,7 @@
job_title, min_salary, max_salary, education, experience, company_name, job_location,
job_location_area_code, posting_date, vacancies, latitude, longitude, "view", company_id,
is_hot, is_urgent, apply_num, description, is_publish, data_source, job_url, remark, del_flag,
create_by, create_time, row_id, job_category,job_nature,job_type,job_address,job_status,is_key_populations,
create_by, create_time, row_id, job_category,job_type,job_address,job_status,is_key_populations,
key_populations
) VALUES
<foreach collection="list" item="job" separator=",">
@@ -154,7 +153,7 @@
#{job.vacancies}, #{job.latitude}, #{job.longitude}, #{job.view}, #{job.companyId},
#{job.isHot}, #{job.isUrgent}, #{job.applyNum}, #{job.description}, #{job.isPublish}, #{job.dataSource},
#{job.jobUrl}, #{job.remark}, #{job.delFlag}, #{job.createBy}, #{job.createTime},
#{job.rowId}, #{job.jobCategory},#{job.jobNature},#{job.jobType},#{job.jobAddress},#{job.jobStatus},#{job.isKeyPopulations},#{job.keyPopulations}
#{job.rowId}, #{job.jobCategory},#{job.jobType},#{job.jobAddress},#{job.jobStatus},#{job.isKeyPopulations},#{job.keyPopulations}
)
</foreach>
</insert>
@@ -301,7 +300,7 @@
)
</select>
<select id="selectAllJob" resultMap="JobEsResult">
SELECT j.*,c.industry,c.scale,c.nature as company_nature,c.code,c.description as company_description,c.name,c.company_id,t.contact_person,t.contact_person_phone,jc.contact_person as job_contact_person,jc.contact_person_phone as job_contact_person_phone FROM job as j
SELECT j.*,c.industry,c.scale,c.company_nature,c.code,c.description as company_description,c.name,c.company_id,t.contact_person,t.contact_person_phone,jc.contact_person as job_contact_person,jc.contact_person_phone as job_contact_person_phone FROM job as j
left join company as c on c.company_id = j.company_id and j.del_flag='0' and c.del_flag='0' and c.company_status='0'
LEFT JOIN (SELECT t1.*, ROW_NUMBER() OVER (PARTITION BY t1.company_id ORDER BY t1.id) AS rn FROM company_contact AS t1 WHERE t1.del_flag = '0' ) AS t ON t.company_id = j.company_id AND t.rn = 1
LEFT JOIN (SELECT jc1.*, ROW_NUMBER() OVER(PARTITION BY jc1.job_id ORDER BY jc1.id) rn FROM job_contact jc1 WHERE jc1.del_flag='0') jc ON jc.job_id = j.job_id AND jc.rn=1
@@ -348,7 +347,7 @@
inner join bussiness_dict_data as ed on ed.dict_type = 'education' and ed.dict_value = j.education
inner join bussiness_dict_data as ex on ex.dict_type = 'experience' and ex.dict_value = j.experience
left join bussiness_dict_data as ar on ar.dict_type = 'area' and ar.dict_value = j.job_location_area_code
left join bussiness_dict_data as ab on ab.dict_type = 'company_nature' and ab.dict_value = c.nature
left join bussiness_dict_data as ab on ab.dict_type = 'company_nature' and ab.dict_value = c.company_nature
left join bussiness_dict_data as ac on ac.dict_type = 'scale' and ac.dict_value = c.scale
where job_id =#{jobId}
</select>
@@ -363,7 +362,7 @@
</select>
<select id="getJobInfo" resultType="com.ruoyi.cms.domain.Job">
SELECT j.*,c.code,c.name as companyName,c.company_id FROM job as j
SELECT j.*,c.code,c.company_nature,c.name as companyName,c.company_id FROM job as j
left join company as c on c.company_id = j.company_id and c.del_flag='0'
WHERE j.del_flag='0' AND j.job_id=#{jobId}
limit 1