Commit 3a20a94e by zhouhaibao

feat(recruitment): 新增根据手机号查询员工最新业务类型功能

- 在 RecruitmentDemandController 中添加 getLatestBusinessTypeByPhone 接口
- 在 RecruitmentDemandMapper 中新增 selectLatestBusinessTypeByPhone 查询方法
- 在 Mapper XML 中实现根据手机号查询最新业务类型的 SQL 语句
- 在 RecruitmentDemandRemote 中定义远程调用接口
- 在 RecruitmentDemandRemoteImpl 中实现远程调用逻辑
- 在 RecruitmentDemandService 中添加业务处理方法
- 添加异常处理和日志记录机制
1 parent e627138e
...@@ -126,4 +126,9 @@ public interface RecruitmentDemandRemote { ...@@ -126,4 +126,9 @@ public interface RecruitmentDemandRemote {
@ApiParam(name = "dto", notes = "查询条件,merchantId/businessType", dataType = ApiParam.DataTypeEnum.OBJECT, required = true) @ApiParam(name = "dto", notes = "查询条件,merchantId/businessType", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("小场景列表") @ApiResponse("小场景列表")
RpcResponse<List<RecruitmentSubSceneDTO>> listSubScenes(@NotNull RecruitmentSubSceneDTO dto); RpcResponse<List<RecruitmentSubSceneDTO>> listSubScenes(@NotNull RecruitmentSubSceneDTO dto);
@ApiMethod("根据手机号查询员工最新业务类型")
@ApiParam(name = "dto", notes = "查询参数,phoneNumber必填", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("业务类型")
RpcResponse<String> getLatestBusinessTypeByPhone(@NotNull RecruitmentDemandBusinessTypeQueryDTO dto);
} }
...@@ -4,6 +4,7 @@ import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentDemandDTO; ...@@ -4,6 +4,7 @@ import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentDemandDTO;
import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentDemandPageRecordDTO; import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentDemandPageRecordDTO;
import cn.com.glsx.dj.staff.model.RecruitmentDemand; import cn.com.glsx.dj.staff.model.RecruitmentDemand;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper; import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List; import java.util.List;
...@@ -70,4 +71,11 @@ public interface RecruitmentDemandMapper extends OreMapper<RecruitmentDemand> { ...@@ -70,4 +71,11 @@ public interface RecruitmentDemandMapper extends OreMapper<RecruitmentDemand> {
* @return 区域运营统计列表 Map<String, Object> {regionOperationId, regionOperationName, unprocessedCount} * @return 区域运营统计列表 Map<String, Object> {regionOperationId, regionOperationName, unprocessedCount}
*/ */
List<Map<String, Object>> statRegionOperationUnprocessedResumes(); List<Map<String, Object>> statRegionOperationUnprocessedResumes();
/**
* 根据手机号查询员工最新业务类型
* @param phoneNumber 手机号
* @return 业务类型,无记录返回null
*/
String selectLatestBusinessTypeByPhone(@org.apache.ibatis.annotations.Param("phoneNumber") String phoneNumber);
} }
\ No newline at end of file \ No newline at end of file
...@@ -478,4 +478,15 @@ public class RecruitmentDemandRemoteImpl implements RecruitmentDemandRemote{ ...@@ -478,4 +478,15 @@ public class RecruitmentDemandRemoteImpl implements RecruitmentDemandRemote{
return RpcResponse.error(e); return RpcResponse.error(e);
} }
} }
@Override
public RpcResponse<String> getLatestBusinessTypeByPhone(RecruitmentDemandBusinessTypeQueryDTO dto) {
try {
String businessType = recruitmentDemandService.getLatestBusinessTypeByPhone(dto.getPhoneNumber());
return RpcResponse.success(businessType);
} catch (Exception e) {
log.error("根据手机号查询员工最新业务类型异常", e);
return RpcResponse.error(e);
}
}
} }
...@@ -3208,4 +3208,13 @@ public class RecruitmentDemandService { ...@@ -3208,4 +3208,13 @@ public class RecruitmentDemandService {
log.error("新增试岗通知线上运营异常,trialId:{}", trialOnboardingId, e); log.error("新增试岗通知线上运营异常,trialId:{}", trialOnboardingId, e);
} }
} }
/**
* 根据手机号查询员工最新业务类型
* @param phoneNumber 手机号
* @return 业务类型,无记录返回null
*/
public String getLatestBusinessTypeByPhone(String phoneNumber) {
return recruitmentDemandMapper.selectLatestBusinessTypeByPhone(phoneNumber);
}
} }
...@@ -474,4 +474,15 @@ ...@@ -474,4 +474,15 @@
HAVING COUNT(DISTINCT r.id) > 0 HAVING COUNT(DISTINCT r.id) > 0
ORDER BY unprocessedCount DESC, d.region_operation_name ORDER BY unprocessedCount DESC, d.region_operation_name
</select> </select>
<!-- 根据手机号查询员工最新业务类型 -->
<select id="selectLatestBusinessTypeByPhone" resultType="java.lang.String">
SELECT t1.business_type
FROM dj_car_life_recruitment_demand t1
LEFT JOIN dj_car_life_recruitment_onboarding_plan t2 ON t2.demand_id = t1.id
WHERE t2.phone_number = #{phoneNumber}
AND t1.deleted_flag = 'N'
ORDER BY t1.created_date DESC
LIMIT 1
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!