Commit 9066da56 by jianan

【电子报聘】报聘经纪人所属体系规则优化12

parent f135a848
......@@ -451,7 +451,7 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
//ag_acl_practitioner_setting
//ag_acl_practitioner_subordinate_system(如果是团队长)operator
AclPractitionerHiringBasicInfo basicInfo = aclPractitionerHiringBasicInfoDalService.findById(hiringBasicInfoId);
AclPractitionerHiringMembership membership = aclPractitionerHiringMembershipDalService.findByBasicInfoId(hiringBasicInfoId);
AclPractitionerHiringMembership membership = agmsHiringDalService.queryHiringMemberShip(hiringBasicInfoId);
AclPractitionerSubordinateSystem subordinateSystem = aclPractitionerSubordinateSystemDalService.findById(membership.getSubsystemId());
AclCustomer customer = aclCustomerDalService.findByMobileNo(basicInfo.getMobileNo());
AclPractitioner practitioner = new AclPractitioner();
......@@ -466,6 +466,10 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
practitioner.setIdType(basicInfo.getIdType());
practitioner.setIdNo(basicInfo.getIdNo());
practitioner.setS1Id(membership.getS1Id());
practitioner.setS2Id(membership.getS2Id());
practitioner.setS3Id(membership.getS3Id());
Date practitionerBirthdate = CommonUtil.stringParseDate(basicInfo.getPractitionerBirthdate(), "yyyy-MM-dd");
practitioner.setPractitionerBirthdate(practitionerBirthdate);
practitioner.setPractitionerRegNo(" ");
......
......@@ -40,6 +40,20 @@ public class PractitionerHiringMemberShip {
*/
private String branch;
/**
* 辅导人的组织架构信息
*/
private String systemFlag;//系统标志,区分公司营业部和体系,1,分公司,2营业部,3,S1分部,4,S2体系,5,S3纵队
private String s3SubordinateSystemName;//s3所属体系名称
private String s2SubordinateSystemName;//s2所属体系名称
private String s1SubordinateSystemName;//s1所属体系名称
private String s3TeamLeaderName;//S3团队长名称
private String s2TeamLeaderName;//S2团队长名称
private String s1TeamLeaderName;//S1团队长名称
private Long s3TeamLeaderId;//S3团队长Id
private Long s2TeamLeaderId;//S2团队长Id
private Long s1TeamLeaderId;//S1团队长Id
/**
* 获取 報聘经纪人职级类型 FK ag_md_drop_options.id: ag_md_drop_master.scenario_code = "practitioner_level"
......@@ -167,6 +181,86 @@ public class PractitionerHiringMemberShip {
this.branch = branch;
}
public String getSystemFlag() {
return systemFlag;
}
public void setSystemFlag(String systemFlag) {
this.systemFlag = systemFlag;
}
public String getS3SubordinateSystemName() {
return s3SubordinateSystemName;
}
public void setS3SubordinateSystemName(String s3SubordinateSystemName) {
this.s3SubordinateSystemName = s3SubordinateSystemName;
}
public String getS2SubordinateSystemName() {
return s2SubordinateSystemName;
}
public void setS2SubordinateSystemName(String s2SubordinateSystemName) {
this.s2SubordinateSystemName = s2SubordinateSystemName;
}
public String getS1SubordinateSystemName() {
return s1SubordinateSystemName;
}
public void setS1SubordinateSystemName(String s1SubordinateSystemName) {
this.s1SubordinateSystemName = s1SubordinateSystemName;
}
public String getS3TeamLeaderName() {
return s3TeamLeaderName;
}
public void setS3TeamLeaderName(String s3TeamLeaderName) {
this.s3TeamLeaderName = s3TeamLeaderName;
}
public String getS2TeamLeaderName() {
return s2TeamLeaderName;
}
public void setS2TeamLeaderName(String s2TeamLeaderName) {
this.s2TeamLeaderName = s2TeamLeaderName;
}
public String getS1TeamLeaderName() {
return s1TeamLeaderName;
}
public void setS1TeamLeaderName(String s1TeamLeaderName) {
this.s1TeamLeaderName = s1TeamLeaderName;
}
public Long getS3TeamLeaderId() {
return s3TeamLeaderId;
}
public void setS3TeamLeaderId(Long s3TeamLeaderId) {
this.s3TeamLeaderId = s3TeamLeaderId;
}
public Long getS2TeamLeaderId() {
return s2TeamLeaderId;
}
public void setS2TeamLeaderId(Long s2TeamLeaderId) {
this.s2TeamLeaderId = s2TeamLeaderId;
}
public Long getS1TeamLeaderId() {
return s1TeamLeaderId;
}
public void setS1TeamLeaderId(Long s1TeamLeaderId) {
this.s1TeamLeaderId = s1TeamLeaderId;
}
@Override
public String toString() {
return "PractitionerHiringMemberShip{" +
......@@ -177,6 +271,16 @@ public class PractitionerHiringMemberShip {
", subsystem='" + subsystem + '\'' +
", subsystemOwner='" + subsystemOwner + '\'' +
", branch='" + branch + '\'' +
", systemFlag='" + systemFlag + '\'' +
", s3SubordinateSystemName='" + s3SubordinateSystemName + '\'' +
", s2SubordinateSystemName='" + s2SubordinateSystemName + '\'' +
", s1SubordinateSystemName='" + s1SubordinateSystemName + '\'' +
", s3TeamLeaderName='" + s3TeamLeaderName + '\'' +
", s2TeamLeaderName='" + s2TeamLeaderName + '\'' +
", s1TeamLeaderName='" + s1TeamLeaderName + '\'' +
", s3TeamLeaderId=" + s3TeamLeaderId +
", s2TeamLeaderId=" + s2TeamLeaderId +
", s1TeamLeaderId=" + s1TeamLeaderId +
'}';
}
}
......@@ -110,6 +110,9 @@ public class AclPractitionerHiringMembership {
private String s3SubordinateSystemName;//s3所属体系名称
private String s2SubordinateSystemName;//s2所属体系名称
private String s1SubordinateSystemName;//s1所属体系名称
private Long s1Id;
private Long s2Id;
private Long s3Id;
private String s3TeamLeaderName;//S3团队长名称
private String s2TeamLeaderName;//S2团队长名称
private String s1TeamLeaderName;//S1团队长名称
......
......@@ -3,6 +3,7 @@ package com.yd.dal.service.agms;
import com.github.pagehelper.PageInfo;
import com.yd.api.agms.vo.hiring.PractitionerHiringListRequestVO;
import com.yd.dal.entity.agms.hiring.*;
import com.yd.dal.entity.customer.AclPractitionerHiringMembership;
import java.util.List;
......@@ -65,4 +66,6 @@ public interface AgmsHiringDALService {
PractitionerHiringListRequestVO requestVO);
List<PractitionerHiringListInfo> queryUnhandledList(PractitionerHiringListRequestVO requestVO);
AclPractitionerHiringMembership queryHiringMemberShip(Long hiringBasicInfoId);
}
......@@ -5,21 +5,22 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yd.api.agms.vo.hiring.PractitionerHiringListRequestVO;
import com.yd.dal.entity.agms.hiring.*;
import com.yd.dal.entity.customer.AclPractitioner;
import com.yd.dal.entity.customer.AclPractitionerHiringMembership;
import com.yd.dal.entity.customer.AclPractitionerSubordinateSystem;
import com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo;
import com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps;
import com.yd.dal.entity.practitioner.hiring.HiringListInfo;
import com.yd.dal.entity.user.AclUser;
import com.yd.dal.mapper.agms.AgmsHiringMapper;
import com.yd.dal.mapper.customer.AclPractitionerHiringMembershipMapper;
import com.yd.dal.service.agms.AgmsHiringDALService;
import com.yd.dal.service.customer.AclPractitionerDALService;
import com.yd.dal.service.customer.AclPractitionerSubordinateSystemDALService;
import com.yd.dal.service.meta.MdPractitionerHiringApproveStepsDALService;
import com.yd.dal.service.practitioner.PractitionerHiringDALService;
import com.yd.dal.service.user.AclUserDALService;
import com.yd.util.CommonUtil;
import com.yd.util.page.PageInfoUtils;
import net.sf.ehcache.Element;
import org.apache.commons.collections.CollectionUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -42,7 +43,10 @@ public class AgmsHiringDALServiceImpl implements AgmsHiringDALService {
private PractitionerHiringDALService practitionerHiringDalService;
@Autowired
private AclPractitionerSubordinateSystemDALService aclPractitionerSubordinateSystemDalService;
@Autowired
private AclPractitionerHiringMembershipMapper membershipMapper;
@Autowired
private AclPractitionerDALService aclPractitionerDALService;
@Autowired
public void setAgmsHiringMapper(AgmsHiringMapper agmsHiringMapper){
......@@ -56,7 +60,76 @@ public class AgmsHiringDALServiceImpl implements AgmsHiringDALService {
@Override
public PractitionerHiringMemberShip findPractitionerHiringMemberShip(Long hiringBasicInfoId) {
return agmsHiringMapper.findPractitionerHiringMemberShip(hiringBasicInfoId);
PractitionerHiringMemberShip practitionerHiringMemberShip = agmsHiringMapper.findPractitionerHiringMemberShip(hiringBasicInfoId);
AclPractitionerHiringMembership hiringMemberShip = this.queryHiringMemberShip(hiringBasicInfoId);
practitionerHiringMemberShip.setS1TeamLeaderId(hiringMemberShip.getS1TeamLeaderId());
practitionerHiringMemberShip.setS2TeamLeaderId(hiringMemberShip.getS2TeamLeaderId());
practitionerHiringMemberShip.setS3TeamLeaderId(hiringMemberShip.getS3TeamLeaderId());
practitionerHiringMemberShip.setS1TeamLeaderName(hiringMemberShip.getS1TeamLeaderName());
practitionerHiringMemberShip.setS2TeamLeaderName(hiringMemberShip.getS2TeamLeaderName());
practitionerHiringMemberShip.setS3TeamLeaderName(hiringMemberShip.getS3TeamLeaderName());
practitionerHiringMemberShip.setS1SubordinateSystemName(hiringMemberShip.getS1SubordinateSystemName());
practitionerHiringMemberShip.setS2SubordinateSystemName(hiringMemberShip.getS2SubordinateSystemName());
practitionerHiringMemberShip.setS3SubordinateSystemName(hiringMemberShip.getS3SubordinateSystemName());
return practitionerHiringMemberShip;
}
@Override
public AclPractitionerHiringMembership queryHiringMemberShip(Long hiringBasicInfoId) {
AclPractitionerHiringMembership hiringMemberShip = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
if (hiringMemberShip.getMentorPractitionerId() == null) {
return hiringMemberShip;
}
AclPractitioner mentor = aclPractitionerDALService.findPractitionerById(hiringMemberShip.getMentorPractitionerId());
// 查询并显示“辅导人”所属的S1分部,分部负责人,S2体系,体系负责人,S3纵队,纵队负责人,没有的显示空
List<AclPractitionerSubordinateSystem> subordinateSystemList = aclPractitionerSubordinateSystemDalService.findAll();
Map<Long, AclPractitionerSubordinateSystem> subordinateSystemMap = new HashMap<>();
subordinateSystemList.forEach(i -> subordinateSystemMap.put(i.getId(), i));
Map<Long, AclPractitioner> aclPractitionerMap = aclPractitionerDALService.findAllMap();
//所属体系
AclPractitionerSubordinateSystem subordinateSystem = null;
//体系团队长
AclPractitioner systemOwner = null;
if (mentor.getS1Id() != null) {
subordinateSystem = subordinateSystemMap.get(mentor.getS1Id());
if (subordinateSystem != null) {
hiringMemberShip.setS1SubordinateSystemName(subordinateSystem.getName());
systemOwner = aclPractitionerMap.get(subordinateSystem.getOwnerPractitionerId());
hiringMemberShip.setS1TeamLeaderName(systemOwner != null ? systemOwner.getName() : null);
hiringMemberShip.setS1TeamLeaderId(systemOwner != null ? systemOwner.getId() : null);
}
}
if (null != mentor.getS2Id()) {
subordinateSystem = subordinateSystemMap.get(mentor.getS2Id());
if (subordinateSystem != null) {
hiringMemberShip.setS2SubordinateSystemName(subordinateSystem != null ? subordinateSystem.getName() : null);
systemOwner = aclPractitionerMap.get(subordinateSystem.getOwnerPractitionerId());
hiringMemberShip.setS2TeamLeaderName(systemOwner != null ? systemOwner.getName() : null);
hiringMemberShip.setS2TeamLeaderId(systemOwner != null ? systemOwner.getId() : null);
}
}
if (null != mentor.getS3Id()) {
subordinateSystem = subordinateSystemMap.get(mentor.getS3Id());
if (subordinateSystem != null) {
hiringMemberShip.setS3SubordinateSystemName(subordinateSystem != null ? subordinateSystem.getName() : null);
systemOwner = aclPractitionerMap.get(subordinateSystem.getOwnerPractitionerId());
hiringMemberShip.setS3TeamLeaderName(systemOwner != null ? systemOwner.getName() : null);
hiringMemberShip.setS3TeamLeaderId(systemOwner != null ? systemOwner.getId() : null);
}
}
return hiringMemberShip;
}
@Override
......
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