Commit 5b266453 by 谢海旭

驻店管理:审批

招聘管理:试岗审批
1 parent f3b39b6c
...@@ -2,7 +2,7 @@ package cn.com.glsx.dj.staff.enums.recruitment; ...@@ -2,7 +2,7 @@ package cn.com.glsx.dj.staff.enums.recruitment;
/** /**
* 招聘需求 操作记录-操作类型 枚举 * 招聘需求 操作记录-操作类型 枚举
* 操作类型,1-创建 2-人事确认 3-驳回 4-新增简历 5-编辑简历 6-新增入职 7-完成 8-处理 9-督导确认 * 操作类型,1-创建 2-人事确认 3-驳回 4-新增简历 5-编辑简历 6-新增入职 7-完成 8-处理 9-督导确认 10-试岗通过 11-试岗驳回
*/ */
public enum RecruitmentDemandLogOperationTypeEnum { public enum RecruitmentDemandLogOperationTypeEnum {
/** /**
...@@ -41,6 +41,14 @@ public enum RecruitmentDemandLogOperationTypeEnum { ...@@ -41,6 +41,14 @@ public enum RecruitmentDemandLogOperationTypeEnum {
* 9-督导确认 * 9-督导确认
*/ */
SUPERVISOR_CONFIRM((byte)9,"督导确认"), SUPERVISOR_CONFIRM((byte)9,"督导确认"),
/**
* 10-试岗通过
*/
TRIAL_APPROVE((byte)10,"试岗通过"),
/**
* 11-试岗驳回
*/
TRIAL_REJECT((byte)11,"试岗驳回"),
; ;
private byte value; private byte value;
......
...@@ -72,4 +72,11 @@ public class RecruitmentDemandOperationLog implements Serializable { ...@@ -72,4 +72,11 @@ public class RecruitmentDemandOperationLog implements Serializable {
@Column(name = "deleted_flag") @Column(name = "deleted_flag")
private String deletedFlag; private String deletedFlag;
/**
* 操作备注
*/
@ApiModelProperty(notes = "操作备注")
@Column(name = "operation_remark")
private String operationRemark;
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.staff.remote; package cn.com.glsx.dj.staff.remote;
import cn.com.glsx.dj.staff.dto.recruitment.*; import cn.com.glsx.dj.staff.dto.recruitment.*;
import cn.com.glsx.dj.staff.model.RecruitmentProvinceHrbpRelation;
import cn.com.glsx.dj.staff.model.RecruitmentTrialOnboarding;
import cn.com.glsx.framework.core.annotation.ApiMethod; import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam; import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse; import cn.com.glsx.framework.core.annotation.ApiResponse;
...@@ -104,4 +106,14 @@ public interface RecruitmentDemandRemote { ...@@ -104,4 +106,14 @@ public interface RecruitmentDemandRemote {
@ApiParam(name = "dto", notes = "试岗人员信息,id/demandId/processResult/updatedBy必填", dataType = ApiParam.DataTypeEnum.OBJECT, required = true) @ApiParam(name = "dto", notes = "试岗人员信息,id/demandId/processResult/updatedBy必填", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("处理结果") @ApiResponse("处理结果")
RpcResponse<String> trialOnboardingProcess(@NotNull RecruitmentTrialOnboardingDTO dto); RpcResponse<String> trialOnboardingProcess(@NotNull RecruitmentTrialOnboardingDTO dto);
@ApiMethod("审批试岗计划(通过/驳回)")
@ApiParam(name = "dto", notes = "试岗人员信息,id/demandId/approvalResult/updatedBy必填", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("审批后的试岗记录最新数据")
RpcResponse<RecruitmentTrialOnboarding> trialOnboardingApproval(@NotNull RecruitmentTrialOnboardingDTO dto);
@ApiMethod("查询省份HRBP关系列表(不分页)")
@ApiParam(name = "condition", notes = "查询条件,provinceName/provinceCode/hrbpName/hrbpPhone", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("省份HRBP关系列表")
RpcResponse<List<RecruitmentProvinceHrbpRelation>> listProvinceHrbpRelation(@NotNull RecruitmentProvinceHrbpRelation condition);
} }
...@@ -4,6 +4,10 @@ import cn.com.glsx.dj.staff.model.RecruitmentProvinceHrbpRelation; ...@@ -4,6 +4,10 @@ import cn.com.glsx.dj.staff.model.RecruitmentProvinceHrbpRelation;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper; import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper @Mapper
public interface RecruitmentProvinceHrbpRelationMapper extends OreMapper<RecruitmentProvinceHrbpRelation> { public interface RecruitmentProvinceHrbpRelationMapper extends OreMapper<RecruitmentProvinceHrbpRelation> {
List<RecruitmentProvinceHrbpRelation> listProvinceHrbpRelation(RecruitmentProvinceHrbpRelation condition);
} }
...@@ -5,7 +5,9 @@ import cn.com.glsx.dj.staff.enums.RecruitmentDemandStatusEnum; ...@@ -5,7 +5,9 @@ import cn.com.glsx.dj.staff.enums.RecruitmentDemandStatusEnum;
import cn.com.glsx.dj.staff.enums.recruitment.RecruitmentDemandBusinessTypeEnum; import cn.com.glsx.dj.staff.enums.recruitment.RecruitmentDemandBusinessTypeEnum;
import cn.com.glsx.dj.staff.enums.recruitment.RecruitmentDemandLogOperationTypeEnum; import cn.com.glsx.dj.staff.enums.recruitment.RecruitmentDemandLogOperationTypeEnum;
import cn.com.glsx.dj.staff.model.RecruitmentDemand; import cn.com.glsx.dj.staff.model.RecruitmentDemand;
import cn.com.glsx.dj.staff.model.RecruitmentProvinceHrbpRelation;
import cn.com.glsx.dj.staff.model.RecruitmentResume; import cn.com.glsx.dj.staff.model.RecruitmentResume;
import cn.com.glsx.dj.staff.model.RecruitmentTrialOnboarding;
import cn.com.glsx.dj.staff.service.recruitment.RecruitmentDemandService; import cn.com.glsx.dj.staff.service.recruitment.RecruitmentDemandService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse; import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
...@@ -336,4 +338,32 @@ public class RecruitmentDemandRemoteImpl implements RecruitmentDemandRemote{ ...@@ -336,4 +338,32 @@ public class RecruitmentDemandRemoteImpl implements RecruitmentDemandRemote{
return RpcResponse.error(e); return RpcResponse.error(e);
} }
} }
@Override
public RpcResponse<RecruitmentTrialOnboarding> trialOnboardingApproval(RecruitmentTrialOnboardingDTO dto) {
try {
RecruitmentTrialOnboarding result = recruitmentDemandService.trialOnboardingApproval(dto);
return RpcResponse.success(result);
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
} catch (Exception e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<RecruitmentProvinceHrbpRelation>> listProvinceHrbpRelation(RecruitmentProvinceHrbpRelation condition) {
try {
List<RecruitmentProvinceHrbpRelation> list = recruitmentDemandService.listProvinceHrbpRelation(condition);
return RpcResponse.success(list);
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
} catch (Exception e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
} }
...@@ -115,6 +115,9 @@ public class RecruitmentDemandService { ...@@ -115,6 +115,9 @@ public class RecruitmentDemandService {
private RecruitmentTrialOnboardingMapper recruitmentTrialOnboardingMapper; private RecruitmentTrialOnboardingMapper recruitmentTrialOnboardingMapper;
@Autowired @Autowired
private RecruitmentProvinceHrbpRelationMapper provinceHrbpRelationMapper;
@Autowired
private TechnicalSupervisorMappingMapper technicalSupervisorMappingMapper; private TechnicalSupervisorMappingMapper technicalSupervisorMappingMapper;
@Autowired @Autowired
...@@ -2040,4 +2043,83 @@ public class RecruitmentDemandService { ...@@ -2040,4 +2043,83 @@ public class RecruitmentDemandService {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR); throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
} }
} }
/**
* 审批试岗计划(通过/驳回)
* 与 dj.staff.api.recruitment.demand.process 使用同一把分布式锁(以 demandId 为 key)
* 仅允许对审批中(approval_result IS NULL)的试岗记录执行审批
*
* @param dto 试岗记录信息,id / demandId / approvalResult / updatedBy 必填
* @return 审批后的试岗记录最新数据
*/
@GlsxDistributeLockable(name = "'RecruitmentDemandService_recruitmentDemandProcess_' + #dto.demandId", timeoutException = RpcServiceException.class)
@Transactional
public RecruitmentTrialOnboarding trialOnboardingApproval(RecruitmentTrialOnboardingDTO dto) {
RpcAssert.assertNotNull(dto, DefaultErrorEnum.DATA_NULL, "dto not be null");
RpcAssert.assertNotNull(dto.getId(), DefaultErrorEnum.DATA_NULL, "id not be null");
RpcAssert.assertNotNull(dto.getDemandId(), DefaultErrorEnum.DATA_NULL, "demandId not be null");
RpcAssert.assertNotNull(dto.getApprovalResult(), DefaultErrorEnum.DATA_NULL, "approvalResult not be null");
RpcAssert.assertNotEmpty(dto.getUpdatedBy(), DefaultErrorEnum.DATA_NULL, "updatedBy not be empty");
// 驳回时审批备注必填
if (Objects.equals(dto.getApprovalResult(), 0)) {
RpcAssert.assertNotEmpty(dto.getApprovalRemark(), DefaultErrorEnum.DATA_NULL, "驳回时审批备注不能为空");
if (dto.getApprovalRemark().length() > 200) {
throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "审批备注最多200字");
}
}
try {
RecruitmentTrialOnboarding existing = recruitmentTrialOnboardingMapper.selectByPrimaryKey(dto.getId());
if (existing == null || BaseModel.DeletedFlagEnum.D.name().equals(existing.getDeletedFlag())) {
throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "试岗记录不存在");
}
if (Objects.nonNull(existing.getApprovalResult())) {
throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "试岗记录已审批,不可重复操作");
}
RecruitmentTrialOnboarding update = new RecruitmentTrialOnboarding();
update.setId(dto.getId());
update.setApprovalResult(dto.getApprovalResult());
update.setApprovalRemark(dto.getApprovalRemark());
update.setUpdatedBy(dto.getUpdatedBy());
update.setUpdatedDate(new Date());
recruitmentTrialOnboardingMapper.updateByPrimaryKeySelective(update);
// 添加招聘需求操作记录
RecruitmentDemandOperationLog operationLog = new RecruitmentDemandOperationLog();
operationLog.setDemandId(dto.getDemandId());
if (Objects.equals(dto.getApprovalResult(), 1)) {
operationLog.setOperationType(RecruitmentDemandLogOperationTypeEnum.TRIAL_APPROVE.getValue());
} else {
operationLog.setOperationType(RecruitmentDemandLogOperationTypeEnum.TRIAL_REJECT.getValue());
operationLog.setOperationRemark("驳回原因:" + dto.getApprovalRemark());
}
operationLog.setCreatedBy(dto.getUpdatedBy());
operationLog.setCreatedDate(new Date());
operationLog.setUpdatedBy(dto.getUpdatedBy());
operationLog.setUpdatedDate(new Date());
logMapper.insertSelective(operationLog);
// 返回最新数据
return recruitmentTrialOnboardingMapper.selectByPrimaryKey(dto.getId());
} catch (RpcServiceException e) {
throw e;
} catch (Exception e) {
log.error("审批试岗计划异常,id:{}", dto.getId(), e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
/**
* 查询省份HRBP关系列表(不分页)
*/
public List<RecruitmentProvinceHrbpRelation> listProvinceHrbpRelation(RecruitmentProvinceHrbpRelation condition) {
try {
return provinceHrbpRelationMapper.listProvinceHrbpRelation(condition);
} catch (Exception e) {
log.error("查询省份HRBP关系异常", e);
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR);
}
}
} }
...@@ -13,12 +13,13 @@ ...@@ -13,12 +13,13 @@
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" /> <result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" /> <result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" /> <result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
<result column="operation_remark" property="operationRemark" jdbcType="VARCHAR" />
</resultMap> </resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
--> -->
id, demand_id, operation_type, created_by, created_date, id, demand_id, operation_type, created_by, created_date,
updated_by, updated_date, deleted_flag updated_by, updated_date, deleted_flag, operation_remark
</sql> </sql>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -23,4 +23,23 @@ ...@@ -23,4 +23,23 @@
id, province_name, province_code, hrbp_name, hrbp_phone, created_by, id, province_name, province_code, hrbp_name, hrbp_phone, created_by,
created_date, updated_by, updated_date, deleted_flag created_date, updated_by, updated_date, deleted_flag
</sql> </sql>
<select id="listProvinceHrbpRelation" resultMap="BaseResultMap" parameterType="cn.com.glsx.dj.staff.model.RecruitmentProvinceHrbpRelation">
SELECT <include refid="Base_Column_List"/>
FROM dj_car_life_recruitment_province_hrbp_relation
WHERE deleted_flag = 'N'
<if test="provinceName != null and provinceName != ''">
AND province_name LIKE CONCAT('%', #{provinceName}, '%')
</if>
<if test="provinceCode != null and provinceCode != ''">
AND province_code = #{provinceCode}
</if>
<if test="hrbpName != null and hrbpName != ''">
AND hrbp_name LIKE CONCAT('%', #{hrbpName}, '%')
</if>
<if test="hrbpPhone != null and hrbpPhone != ''">
AND hrbp_phone LIKE CONCAT('%', #{hrbpPhone}, '%')
</if>
ORDER BY id DESC
</select>
</mapper> </mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!