Commit e7c78738 by jianan

电子报聘basicInfo表加审批状态字段approve_status,/queryWholeInfo 添加是否被拒绝的字段

parent 416fb518
......@@ -5,12 +5,9 @@ import com.yd.api.practitioner.vo.hiring.*;
import com.yd.api.result.CommonResult;
import com.yd.dal.entity.agms.hiring.PractitionerHiringWorkingExperience;
import com.yd.dal.entity.customer.*;
import com.yd.dal.entity.customer.practitioner.PractitionerInfo;
import com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps;
import com.yd.dal.entity.practitioner.hiring.*;
import com.yd.dal.mapper.customer.*;
import com.yd.dal.service.customer.AclFileUploadDALService;
import com.yd.dal.service.customer.AclPractitionerDALService;
import com.yd.dal.service.customer.AclPractitionerHiringApproveRecordsDALService;
import com.yd.dal.service.practitioner.PractitionerHiringDALService;
import com.yd.rmi.ali.oss.service.OssService;
......@@ -48,6 +45,8 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
private AclPractitionerHiringPersonalStatementsMapper personalStatementsMapper;
@Autowired
private AclPractitionerHiringContractTermsConfirmsMapper contractTermsConfirmsMapper;
@Autowired
private AclPractitionerHiringApproveRecordsMapper recordsMapper;
private PractitionerHiringDALService practitionerHiringDalService;
private SystemConfigService systemConfigService;
......@@ -518,7 +517,34 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
return responseVO;
}
}
// 保存审批记录
aclPractitionerHiringApproveRecordsDalService.save(hiringApproveRecordsList);
// 更新basicInfo表审批状态
// 查询审批记录
Long basicInfoId = requestVO.getHiringBasicInfoId();
AclPractitionerHiringApproveRecords record = recordsMapper.queryLastOneByBasicInfoId(basicInfoId);
String approveStatus = null;
if (Long.valueOf("0").equals(record.getApprovingStatus())) {
approveStatus = "-1";
} else {
String stepSeq = record.getStepSeq();
if (StringUtils.isEmpty(stepSeq)) {
responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("830025")));
return responseVO;
} else {
if (stepSeq.equals(hiringApproveStepsList.size())) {
approveStatus = "0";
} else {
approveStatus = "-1";
}
}
}
AclPractitionerHiringBasicInfo basicInfo = new AclPractitionerHiringBasicInfo();
basicInfo.setId(requestVO.getHiringBasicInfoId());
basicInfo.setApproveStatus(approveStatus);
basicInfoMapper.updateByPrimaryKeySelective(basicInfo);
responseVO.setPractitionerId(requestVO.getPractitionerId());
responseVO.setHiringBasicInfoId(requestVO.getHiringBasicInfoId());
responseVO.setApprovalIdentity(requestVO.getApprovalIdentity());
......
......@@ -29,6 +29,11 @@ public class AclPractitionerHiringApproveRecords {
private String approveStepName;
/**
* 审批顺序
*/
private String stepSeq;
/**
* 执行动作的审批经纪人id FK ag_acl_practitioner.id
*/
private Long approvingPractitionerId;
......
......@@ -14,6 +14,11 @@ public class AclPractitionerHiringBasicInfo {
private Long id;
/**
* 审批状态,包括待审批null及审批步骤seq,通过0,拒绝-1
*/
private String approveStatus;
/**
* FK ag_acl_practitioner_potential,潜在经纪人增员表
*/
private Long practitionerPotentialId;
......
......@@ -22,4 +22,6 @@ public interface AclPractitionerHiringApproveRecordsMapper {
int updateBatchSelective(List<AclPractitionerHiringApproveRecords> list);
int batchInsert(@Param("list") List<AclPractitionerHiringApproveRecords> list);
AclPractitionerHiringApproveRecords queryLastOneByBasicInfoId(Long basicInfoId);
}
\ No newline at end of file
......@@ -346,4 +346,29 @@
#{item.updatedBy,jdbcType=BIGINT})
</foreach>
</insert>
<resultMap id="LastOneRecord" type="com.yd.dal.entity.customer.AclPractitionerHiringApproveRecords">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="hiring_basic_info_id" jdbcType="BIGINT" property="hiringBasicInfoId" />
<result column="approve_step_id" jdbcType="VARCHAR" property="approveStepId" />
<result column="approve_step_name" jdbcType="VARCHAR" property="approveStepName" />
<result column="step_seq" jdbcType="VARCHAR" property="stepSeq" />
<result column="approving_practitioner_id" jdbcType="BIGINT" property="approvingPractitionerId" />
<result column="approving_status" jdbcType="BIGINT" property="approvingStatus" />
<result column="reject_note" jdbcType="VARCHAR" property="rejectNote" />
<result column="interview_assessment" jdbcType="VARCHAR" property="interviewAssessment" />
<result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
</resultMap>
<select id="queryLastOneByBasicInfoId" resultMap="LastOneRecord">
select r.*, s.step_seq
from ag_acl_practitioner_hiring_approve_records r
left join ag_md_practitioner_hiring_approve_steps s on r.approve_step_id = s.id
where r.hiring_basic_info_id = #{hiringBasicInfoId,jdbcType=BIGINT}
order by s.step_seq desc
limit 1
</select>
</mapper>
\ No newline at end of file
......@@ -5,6 +5,7 @@
<!--@mbg.generated-->
<!--@Table ag_acl_practitioner_hiring_basic_info-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="approve_status" jdbcType="VARCHAR" property="approveStatus" />
<result column="practitioner_potential_id" jdbcType="BIGINT" property="practitionerPotentialId" />
<result column="invitee_practitioner_id" jdbcType="BIGINT" property="inviteePractitionerId" />
<result column="name" jdbcType="VARCHAR" property="name" />
......@@ -44,7 +45,7 @@
city_name, resident_address, wechat_id, email, personer_picture_oss_path, id_front_page_oss_path,
id_back_page_oss_path, last_graduate_code, last_graduate_grade, last_graduate_school, last_graduate_certification_oss_path,
bank_account_opening, bank_account_id, personal_sign_oss_path, is_active, created_at,
created_by, updated_at, updated_by
created_by, updated_at, updated_by, approve_status
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
......
......@@ -234,25 +234,9 @@
if(m.mentor_practitioner_id = #{practitionerId,jdbcType=BIGINT}, 1, 2)) approvalIdentity
from ag_acl_practitioner_hiring_basic_info b
left join ag_acl_practitioner_hiring_membership m on b.id = m.hiring_basic_info_id
left join
(
select
a.hiring_basic_info_id, a.approving_status, a.created_at
from
ag_acl_practitioner_hiring_approve_records a
left join
(
select
hiring_basic_info_id, max(created_at) created_at
from
ag_acl_practitioner_hiring_approve_records
group by hiring_basic_info_id
) b
on a.hiring_basic_info_id=b.hiring_basic_info_id and a.created_at=b.created_at
) r
on b.id = r.hiring_basic_info_id
where m.mentor_practitioner_id = #{practitionerId,jdbcType=BIGINT}
and r.approving_status is null
where 1=1
and m.mentor_practitioner_id = #{practitionerId,jdbcType=BIGINT}
and b.approve_status is null
and m.md_drop_option_id != (select id
from ag_md_drop_options
where drop_option_code = 'S2'
......@@ -260,6 +244,7 @@
from ag_md_drop_master
where scenario_code = 'practitioner_level'))
</select>
<select id="querySystemOwnerUnhandledList" resultMap="HiringListInfo">
select b.id hiringBasicInfoId,
b.name name,
......@@ -271,27 +256,10 @@
m.subsystem_owner_id = #{practitionerId,jdbcType=BIGINT}, 0,
if(m.mentor_practitioner_id = #{practitionerId,jdbcType=BIGINT}, 1, 2)) approvalIdentity
from ag_acl_practitioner_hiring_basic_info b
left join ag_acl_practitioner_hiring_membership m on b.id = m.hiring_basic_info_id
left join
(
select
a.hiring_basic_info_id, a.approving_status, a.created_at, s.step_seq
from
ag_acl_practitioner_hiring_approve_records a
left join ag_md_practitioner_hiring_approve_steps s on a.approve_step_id = s.id
left join
(
select
hiring_basic_info_id, max(created_at) created_at
from
ag_acl_practitioner_hiring_approve_records
group by hiring_basic_info_id
) b
on a.hiring_basic_info_id=b.hiring_basic_info_id and a.created_at=b.created_at
) r
on b.id = r.hiring_basic_info_id
where m.subsystem_owner_id = #{practitionerId,jdbcType=BIGINT}
and s.step_seq = 1
left join ag_acl_practitioner_hiring_membership m on b.id = m.hiring_basic_info_idd
where 1=1
and m.subsystem_owner_id = #{practitionerId,jdbcType=BIGINT}
and b.approve_status = '1'
and m.md_drop_option_id != (select id
from ag_md_drop_options
where drop_option_code = 'S2'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment