Commit a818b320 by 崔彦峰

refactor(recruitment): 简化招聘需求服务中的HRBP查询逻辑

- 移除特定业务类型的条件判断,统一处理所有业务类型的HRBP查询
- 重构代码结构,消除重复的数据库查询逻辑
- 将特定业务类型分支合并为通用查询处理
- 优化变量命名,提高代码可读性
- 统一HRBP联系信息设置流程
1 parent 75f5ea88
......@@ -301,30 +301,21 @@ public class RecruitmentDemandService {
}
//二手车、轻改、窗膜技师、三膜技师、车衣技师、精品技师、洗车工
if (RecruitmentDemandBusinessTypeEnum.USED_CAR_INSPECTOR.getValue().equals(businessType)
|| RecruitmentDemandBusinessTypeEnum.LIGHT_MODIFICATION.getValue().equals(businessType)
|| RecruitmentDemandBusinessTypeEnum.ACCESSORIES_TECHNICIAN.getValue().equals(businessType)
|| RecruitmentDemandBusinessTypeEnum.THREE_FILM_TECHNICIAN.getValue().equals(businessType)
|| RecruitmentDemandBusinessTypeEnum.CAR_WRAP_TECHNICIAN.getValue().equals(businessType)
|| RecruitmentDemandBusinessTypeEnum.CAR_WASH_WORKER.getValue().equals(businessType)) {
Example hrbpRelation = new Example(RecruitmentProvinceHrbpRelation.class);
hrbpRelation.createCriteria().andEqualTo("businessType", businessType).andEqualTo("isAllProvince", 1);
List<RecruitmentProvinceHrbpRelation> hrbpRelations = provinceHrbpRelationMapper.selectByExample(hrbpRelation);
if (CollectionUtils.isNotEmpty(hrbpRelations)) {
dto.setRecruiterName(hrbpRelations.get(0).getHrbpName());
dto.setRecruiterPhone(hrbpRelations.get(0).getHrbpPhone());
}
Example hrbpRelation = new Example(RecruitmentProvinceHrbpRelation.class);
hrbpRelation.createCriteria().andEqualTo("businessType", businessType).andEqualTo("isAllProvince", 1);
List<RecruitmentProvinceHrbpRelation> hrbpRelations = provinceHrbpRelationMapper.selectByExample(hrbpRelation);
if (CollectionUtils.isNotEmpty(hrbpRelations)) {
dto.setRecruiterName(hrbpRelations.get(0).getHrbpName());
dto.setRecruiterPhone(hrbpRelations.get(0).getHrbpPhone());
}
//根据业务、省份查询HRBP
else if (RecruitmentDemandBusinessTypeEnum.EXTENDED_WARRANTY.getValue().equals(businessType)
|| RecruitmentDemandBusinessTypeEnum.RIGHTS.getValue().equals(businessType)
|| RecruitmentDemandBusinessTypeEnum.RIGHTS_EXTENDED_WARRANTY.getValue().equals(businessType)) {
else {
if (StringUtils.isNotBlank(provinceCode)) {
Example hrbpRelation = new Example(RecruitmentProvinceHrbpRelation.class);
Example relation = new Example(RecruitmentProvinceHrbpRelation.class);
hrbpRelation.createCriteria().andEqualTo("businessType", businessType).andEqualTo("provinceCode", provinceCode);
List<RecruitmentProvinceHrbpRelation> hrbpRelations = provinceHrbpRelationMapper.selectByExample(hrbpRelation);
if (CollectionUtils.isNotEmpty(hrbpRelations)) {
dto.setRecruiterName(hrbpRelations.get(0).getHrbpName());
List<RecruitmentProvinceHrbpRelation> relations = provinceHrbpRelationMapper.selectByExample(relation);
if (CollectionUtils.isNotEmpty(relations)) {
dto.setRecruiterName(relations.get(0).getHrbpName());
dto.setRecruiterPhone(hrbpRelations.get(0).getHrbpPhone());
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!