Commit 50f4524e by 崔彦峰

fix(recruitment): 修复招聘需求服务中HRBP关系查询的逻辑缺陷

- 在查询条件中增加deletedFlag字段过滤,确保只查询未删除的记录
- 重构业务类型和省份代码查询逻辑,统一添加软删除标记检查
- 优化代码格式,提高可读性和维护性
- 确保数据一致性,避免返回已删除的HRBP关系数据
1 parent d20241f8
......@@ -318,7 +318,10 @@ public class RecruitmentDemandService {
//二手车、轻改、窗膜技师、三膜技师、车衣技师、精品技师、洗车工
Example hrbpRelation = new Example(RecruitmentProvinceHrbpRelation.class);
hrbpRelation.createCriteria().andEqualTo("businessType", businessType).andEqualTo("isAllProvince", 1);
hrbpRelation.createCriteria()
.andEqualTo("businessType", businessType)
.andEqualTo("isAllProvince", 1)
.andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name());
List<RecruitmentProvinceHrbpRelation> hrbpRelations = provinceHrbpRelationMapper.selectByExample(hrbpRelation);
if (CollectionUtils.isNotEmpty(hrbpRelations)) {
dto.setRecruiterName(hrbpRelations.get(0).getHrbpName());
......@@ -328,7 +331,10 @@ public class RecruitmentDemandService {
else {
if (StringUtils.isNotBlank(provinceCode)) {
Example relation = new Example(RecruitmentProvinceHrbpRelation.class);
relation.createCriteria().andEqualTo("businessType", businessType).andEqualTo("provinceCode", provinceCode);
relation.createCriteria()
.andEqualTo("businessType", businessType)
.andEqualTo("provinceCode", provinceCode)
.andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name());
List<RecruitmentProvinceHrbpRelation> relations = provinceHrbpRelationMapper.selectByExample(relation);
if (CollectionUtils.isNotEmpty(relations)) {
dto.setRecruiterName(relations.get(0).getHrbpName());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!