Commit 416fb518 by jianan

1.加审批经纪人头像和职级

2.ydLife审批记录查询
parent 27ee39b9
......@@ -48,10 +48,6 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
private AclPractitionerHiringPersonalStatementsMapper personalStatementsMapper;
@Autowired
private AclPractitionerHiringContractTermsConfirmsMapper contractTermsConfirmsMapper;
@Autowired
private AclPractitionerDALService aclPractitionerDALService;
@Autowired
private AclFileUploadDALService aclFileUploadDALService;
private PractitionerHiringDALService practitionerHiringDalService;
private SystemConfigService systemConfigService;
......@@ -386,9 +382,21 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
@Override
public HiringListQueryResponseVO listQuery(HiringListQueryRequestVO requestVO) {
HiringListQueryResponseVO responseVO = new HiringListQueryResponseVO();
Long practitionerId = requestVO.getPractitionerId();
Long approvingStatus = requestVO.getApprovingStatus();
List<HiringListInfo> hiringListInfoList = practitionerHiringDalService.findHiringList(practitionerId, approvingStatus);
List<HiringListInfo> hiringListInfoList;
if (Long.valueOf("0").equals(approvingStatus)) {
// 当前经纪人的待审批记录
hiringListInfoList = practitionerHiringDalService.queryUnhandledList(practitionerId);
} else {
// 当前经纪人通过或拒绝的记录
int status = Long.valueOf("1").equals(approvingStatus) ? 1 : 0;
hiringListInfoList = practitionerHiringDalService.queryHandledList(practitionerId, status);
}
responseVO.setHiringListInfoList(hiringListInfoList);
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return responseVO;
......@@ -428,12 +436,8 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
//查询是否可进行审批操作 0.不可审批(未到) 1.可审批 2.已审批 4.已驳回
HiringApproveSteps hiringApproveSteps = getHiringApproveStatus(practitionerId, approvalIdentity, hiringApproveRecordsList);
PractitionerInfo practitionerInfo = aclPractitionerDALService.findPractitionerInfoByPractitionerId(practitionerId);
//获取头像
CustomerFileUpload fileUpload = aclFileUploadDALService.findFilePathInfo(1,1,practitionerId);
String imagePath = (fileUpload != null) ? fileUpload.getFilePath() : null;
responseVO.setLevelName(practitionerInfo.getLevelName());
responseVO.setHeadImagePath(imagePath);
responseVO.setHiringBasicInfoId(hiringBasicInfoId);
responseVO.setHiringApproveSteps(hiringApproveSteps);
......
......@@ -14,14 +14,6 @@ public class HiringDetailQueryResponseVO {
*/
private Long hiringBasicInfoId;
/**
* 头像
*/
private String headImagePath;
/**
* 级别
*/
private String levelName;
/**
* 经纪人审批步骤/状态
*/
private HiringApproveSteps hiringApproveSteps;
......@@ -230,19 +222,4 @@ public class HiringDetailQueryResponseVO {
'}';
}
public void setHeadImagePath(String headImagePath) {
this.headImagePath = headImagePath;
}
public String getHeadImagePath() {
return headImagePath;
}
public String getLevelName() {
return levelName;
}
public void setLevelName(String levelName) {
this.levelName = levelName;
}
}
......@@ -23,6 +23,14 @@ public class HiringApproveRecords {
*/
private String approvingPractitionerName;
/**
* 审批经纪人头像
*/
private String headImagePath;
/**
* 审批经纪人职级
*/
private String levelName;
/**
* 1:通过,0:驳回
*/
private Long approvingStatusId;
......@@ -198,4 +206,20 @@ public class HiringApproveRecords {
", hiringAt='" + hiringAt + '\'' +
'}';
}
public String getHeadImagePath() {
return headImagePath;
}
public void setHeadImagePath(String headImagePath) {
this.headImagePath = headImagePath;
}
public String getLevelName() {
return levelName;
}
public void setLevelName(String levelName) {
this.levelName = levelName;
}
}
......@@ -27,4 +27,8 @@ public interface AclPractitionerHiringMembershipMapper {
AclPractitionerHiringMembership queryByhiringBasicInfoId(HiringBasicInfoIdRequestVO requestVO);
AclPractitionerHiringMembership selectByHiringBasicInfoId(Long basicInfoId);
int isMentor(Long practitionerId);
int isSystemOwner(Long practitionerId);
}
\ No newline at end of file
......@@ -55,4 +55,15 @@ public interface PractitionerHiringMapper {
List<PractitionerHiringContractTerms> queryContractTerms();
/**
* ydLife查询当前经纪人已通过或拒绝的报聘记录
* @param practitionerId
* @param approvingStatus
* @return
*/
List<HiringListInfo> queryHandledList(@Param("practitionerId")Long practitionerId, @Param("approvingStatus")int approvingStatus);
List<HiringListInfo> queryMentorUnhandledList(Long practitionerId);
List<HiringListInfo> querySystemOwnerUnhandledList(Long practitionerId);
}
......@@ -73,4 +73,18 @@ public interface PractitionerHiringDALService {
*/
List<PractitionerHiringContractTerms> queryContractTerms();
/**
* ydLife查询经纪人通过或拒绝的报聘记录
* @param practitionerId
* @param approvingStatus
* @return
*/
List<HiringListInfo> queryHandledList(Long practitionerId, int approvingStatus);
/**
* ydLife查询经纪人待审批记录
* @param practitionerId
* @return
*/
List<HiringListInfo> queryUnhandledList(Long practitionerId);
}
package com.yd.dal.service.practitioner.impl;
import com.yd.api.practitioner.vo.hiring.PractitionerHiringContractTerms;
import com.yd.dal.entity.customer.CustomerFileUpload;
import com.yd.dal.entity.customer.practitioner.PractitionerInfo;
import com.yd.dal.entity.practitioner.hiring.*;
import com.yd.dal.mapper.customer.AclPractitionerHiringMembershipMapper;
import com.yd.dal.mapper.practitioner.PractitionerHiringMapper;
import com.yd.dal.service.customer.AclFileUploadDALService;
import com.yd.dal.service.customer.AclPractitionerDALService;
import com.yd.dal.service.practitioner.PractitionerHiringDALService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
......@@ -17,6 +23,12 @@ public class PractitionerHiringDALServiceImpl implements PractitionerHiringDALSe
@Resource
private PractitionerHiringMapper practitionerHiringMapper;
@Autowired
private AclPractitionerDALService aclPractitionerDALService;
@Autowired
private AclFileUploadDALService aclFileUploadDALService;
@Autowired
private AclPractitionerHiringMembershipMapper membershipMapper;
@Override
public List<HiringListInfo> findHiringList(Long practitionerId, Long approvingStatus) {
......@@ -50,11 +62,68 @@ public class PractitionerHiringDALServiceImpl implements PractitionerHiringDALSe
@Override
public List<HiringApproveRecords> findHiringApproveRecordsList(Long hiringBasicInfoId) {
return practitionerHiringMapper.findHiringApproveRecordsList(hiringBasicInfoId);
List<HiringApproveRecords> records = practitionerHiringMapper.findHiringApproveRecordsList(hiringBasicInfoId);
PractitionerInfo practitionerInfo;
CustomerFileUpload fileUpload;
String imagePath;
String levelName;
for (HiringApproveRecords item : records) {
// 获取职级
practitionerInfo = aclPractitionerDALService.findPractitionerInfoByPractitionerId(item.getApprovingPractitionerId());
levelName = (practitionerInfo != null) ? practitionerInfo.getLevelName() : null;
// 获取头像
fileUpload = aclFileUploadDALService.findFilePathInfo(1, 1, item.getApprovingPractitionerId());
imagePath = (fileUpload != null) ? fileUpload.getFilePath() : null;
item.setHeadImagePath(imagePath);
item.setLevelName(levelName);
}
return records;
}
@Override
public List<PractitionerHiringContractTerms> queryContractTerms() {
return practitionerHiringMapper.queryContractTerms();
}
@Override
public List<HiringListInfo> queryHandledList(Long practitionerId, int approvingStatus) {
return practitionerHiringMapper.queryHandledList(practitionerId, approvingStatus);
}
@Override
public List<HiringListInfo> queryUnhandledList(Long practitionerId) {
// 查询审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长
int approvalIdentity = this.queryApprovalIdentity(practitionerId);
List<HiringListInfo> resultList = null;
if (approvalIdentity == 1) {
resultList = practitionerHiringMapper.queryMentorUnhandledList(practitionerId);
} else if (approvalIdentity == 2) {
resultList = practitionerHiringMapper.querySystemOwnerUnhandledList(practitionerId);
} else {
List<HiringListInfo> list1 = practitionerHiringMapper.queryMentorUnhandledList(practitionerId);
List<HiringListInfo> list2 = practitionerHiringMapper.querySystemOwnerUnhandledList(practitionerId);
resultList.addAll(list1);
resultList.addAll(list2);
}
return resultList;
}
private int queryApprovalIdentity(Long practitionerId) {
// 审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长
int isMentor = membershipMapper.isMentor(practitionerId);
int isSystemOwner = membershipMapper.isSystemOwner(practitionerId);
if (isMentor > 0 && isSystemOwner == 0 ) {
return 1;
}
if (isMentor == 0 && isSystemOwner > 0 ) {
return 2;
}
if (isMentor > 0 && isSystemOwner > 0 ) {
return 0;
}
return 1;
}
}
......@@ -139,31 +139,31 @@
#{mdDropOptionName,jdbcType=VARCHAR},
</if>
<if test="mentorPractitionerId != null">
#{mentorPractitionerId,jdbcType=VARCHAR},
#{mentorPractitionerId,jdbcType=BIGINT},
</if>
<if test="mentor != null">
#{mentor,jdbcType=VARCHAR},
</if>
<if test="introducerPractitionerId != null">
#{introducerPractitionerId,jdbcType=VARCHAR},
#{introducerPractitionerId,jdbcType=BIGINT},
</if>
<if test="introducer != null">
#{introducer,jdbcType=VARCHAR},
</if>
<if test="subsystemId != null">
#{subsystemId,jdbcType=VARCHAR},
#{subsystemId,jdbcType=BIGINT},
</if>
<if test="subsystem != null">
#{subsystem,jdbcType=VARCHAR},
</if>
<if test="subsystemOwnerId != null">
#{subsystemOwnerId,jdbcType=VARCHAR},
#{subsystemOwnerId,jdbcType=BIGINT},
</if>
<if test="subsystemOwner != null">
#{subsystemOwner,jdbcType=VARCHAR},
</if>
<if test="branchId != null">
#{branchId,jdbcType=VARCHAR},
#{branchId,jdbcType=BIGINT},
</if>
<if test="branch != null">
#{branch,jdbcType=VARCHAR},
......@@ -531,4 +531,17 @@
from ag_acl_practitioner_hiring_membership
where hiring_basic_info_id = #{basicInfoId,jdbcType=BIGINT}
</select>
<select id="isMentor" resultType="java.lang.Integer">
select count(1)
from ag_acl_practitioner_hiring_membership m
where m.mentor_practitioner_id = #{practitionerId,jdbcType=BIGINT}
</select>
<select id="isSystemOwner" resultType="java.lang.Integer">
select count(1)
from ag_acl_practitioner_hiring_membership m
where m.subsystem_owner_id = #{practitionerId,jdbcType=BIGINT}
</select>
</mapper>
\ No newline at end of file
......@@ -189,4 +189,114 @@
from ag_md_practitioner_hiring_contract_terms c
where c.is_active = 1
</select>
<select id="queryHandledList" resultMap="HiringListInfo">
select b.id hiringBasicInfoId,
b.name name,
b.mobile_no mobileNo,
m.md_drop_option_name practitionerLevel,
m.mentor mentor,
date_format(b.created_at, '%Y-%m-%d %H:%i:%s') applicationTime,
if(m.mentor_practitioner_id = #{practitionerId,jdbcType=BIGINT} and
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
where 1=1
and b.id in (select DISTINCT t.hiring_basic_info_id
from
ag_acl_practitioner_hiring_approve_records t
where t.approving_practitioner_id = #{practitionerId,jdbcType=BIGINT}
and t.approving_status = #{approvingStatus,jdbcType=BIGINT}
)
and (m.mentor_practitioner_id = #{practitionerId,jdbcType=BIGINT} or
m.subsystem_owner_id = #{practitionerId,jdbcType=BIGINT})
and m.md_drop_option_id != (select id
from ag_md_drop_options
where drop_option_code = 'S2'
and drop_master_id = (select id
from ag_md_drop_master
where scenario_code = 'practitioner_level'))
</select>
<select id="queryMentorUnhandledList" resultMap="HiringListInfo">
select b.id hiringBasicInfoId,
b.name name,
b.mobile_no mobileNo,
m.md_drop_option_name practitionerLevel,
m.mentor mentor,
date_format(b.created_at, '%Y-%m-%d %H:%i:%s') applicationTime,
if(m.mentor_practitioner_id = #{practitionerId,jdbcType=BIGINT} and
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
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
and m.md_drop_option_id != (select id
from ag_md_drop_options
where drop_option_code = 'S2'
and drop_master_id = (select id
from ag_md_drop_master
where scenario_code = 'practitioner_level'))
</select>
<select id="querySystemOwnerUnhandledList" resultMap="HiringListInfo">
select b.id hiringBasicInfoId,
b.name name,
b.mobile_no mobileNo,
m.md_drop_option_name practitionerLevel,
m.mentor mentor,
date_format(b.created_at, '%Y-%m-%d %H:%i:%s') applicationTime,
if(m.mentor_practitioner_id = #{practitionerId,jdbcType=BIGINT} and
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
and m.md_drop_option_id != (select id
from ag_md_drop_options
where drop_option_code = 'S2'
and drop_master_id = (select id
from ag_md_drop_master
where scenario_code = 'practitioner_level'))
</select>
</mapper>
\ No newline at end of file
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