Commit c7ca2f7c by jianan

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

parent c21fac08
......@@ -12,8 +12,6 @@ import com.yd.rmi.cache.SystemConfigService;
import com.yd.util.CommonUtil;
import com.yd.util.HttpUtil;
import com.yd.util.PDFConfiguration;
import org.apache.commons.beanutils.BeanPropertyValueEqualsPredicate;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -174,14 +172,15 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
AclPractitioner introducer = aclPractitionerMapper.selectByPrimaryKey(memberShip.getIntroducerPractitionerId());
AclPractitioner second = aclPractitionerMapper.selectByMobileNo(basicInfo.getMobileNo());
List<AclPractitionerHiringWorkingExperience> workingExperienceList = workingExperienceMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
//获取体系负责人的的审批记录
List<AclPractitionerHiringApproveRecords> recordsList = recordsMapper.queryListByBasicInfoId(hiringBasicInfoId);
BeanPropertyValueEqualsPredicate predicate = new BeanPropertyValueEqualsPredicate("approveStepId", "2");
List<AclPractitionerHiringApproveRecords> systermOwnerRecords = (List<AclPractitionerHiringApproveRecords>) CollectionUtils.select(recordsList, predicate);
AclPractitionerHiringApproveRecords systermOwnerRecord = systermOwnerRecords.get(0);
List<AclPractitionerSubordinateSystem> subordinateSystems = aclPractitionerSubordinateSystemDALService.findByOwnerPractitionerId(systermOwnerRecord.getApprovingPractitionerId());
AclPractitionerSubordinateSystem systermOwnerRecordSystem = subordinateSystems.get(0);
// 获取审批的体系系负责人的systerm
AclPractitionerSubordinateSystem systemOfApproved = null;
if (memberShip.getApprovedBy() != null) {
List<AclPractitionerSubordinateSystem> subordinateSystems = aclPractitionerSubordinateSystemDALService.findByOwnerPractitionerId(memberShip.getApprovedBy());
systemOfApproved = subordinateSystems.get(0);
}
// 体系名称 报聘为S2, S3的没有所属体系
String subsystemName = (systemOfApproved != null) ? systemOfApproved.getName() : memberShip.getSubsystem();
String mentorName = mentor == null ? "" : mentor.getName();
String mentorIdNo = mentor == null ? "" : mentor.getIdNo();
......@@ -204,7 +203,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
//1页
data.put("contactNo", contractNo);
data.put("practitionerNo", second.getPractitionerCode());
data.put("subsystem", systermOwnerRecordSystem.getName());
data.put("subsystem", subsystemName);
data.put("practitioner", basicInfo.getName());
data.put("idNo", basicInfo.getIdNo());
......@@ -217,7 +216,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
data.put("firstPartyResponser", firstPartyResponser);
data.put("firstPartyAddress", firstPartyAddress);
// 设置一些地址
this.setSomeAddress(data, hiringBasicInfoId, systermOwnerRecordSystem);
this.setSomeAddress(data, hiringBasicInfoId);
Calendar now = Calendar.getInstance();
data.put("contactYear", now.get(Calendar.YEAR) + "");
......@@ -257,7 +256,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
data.put("secondEffectiveDay", applyDate.get(Calendar.DAY_OF_MONTH) + "");
data.put("secondParty802", basicInfo.getName());
data.put("secondMentor801", mentorName);
data.put("secondSubsystem", systermOwnerRecordSystem.getName());
data.put("secondSubsystem", subsystemName);
data.put("secondSubsystemNo", "");
// 签核人员
this.setApprovepeople(data, hiringBasicInfoId);
......@@ -281,13 +280,16 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
return data;
}
private void setSomeAddress(Map<String, String> data, Long hiringBasicInfoId, AclPractitionerSubordinateSystem systermOwnerRecordSystem) {
private void setSomeAddress(Map<String, String> data, Long hiringBasicInfoId) {
AclPractitionerHiringBasicInfo basicInfo = basicInfoMapper.selectByPrimaryKey(hiringBasicInfoId);
AclPractitionerHiringMembership memberShip = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
String mdDropOptionName = memberShip.getMdDropOptionName();
AclPractitioner systemOwner = aclPractitionerMapper.selectByPrimaryKey(systermOwnerRecordSystem.getOwnerPractitionerId());
AclPractitioner mentor = aclPractitionerMapper.selectByPrimaryKey(memberShip.getMentorPractitionerId());
// 报聘职级
String mdDropOptionName = memberShip.getMdDropOptionName();
// 实际审批的体系负责人
AclPractitioner systemOwner = aclPractitionerMapper.selectByPrimaryKey(memberShip.getApprovedBy());
// 体系负责人姓名
String systemOwnerName = (systemOwner != null) ? systemOwner.getName() : memberShip.getSubsystemOwner();
String mentorName = mentor == null ? "" : mentor.getName();
String mentorIdNo = mentor == null ? "" : mentor.getIdNo();
......@@ -301,7 +303,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
data.put("secondMobileNo", basicInfo.getMobileNo());
data.put("secondSubsystemOwner", systemOwner.getName());
data.put("secondSubsystemOwner", systemOwnerName);
data.put("secondSubsystemSignature", memberShip.getSubsystemOwner());
// 查团队长信息
String systemOwnerIdNo = null;
......
......@@ -718,16 +718,6 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
}
}
// 自身所属体系等级
// if (null != mentor.getSubordinateSystemId()) {
// subordinateSystem = subordinateSystemMap.get(mentor.getSubordinateSystemId());
// if (subordinateSystem != null) {
// String systemType = subordinateSystem.getSystemType();
// switch (systemType) {
// case "S1" :hiringMemberShip.getSystemFlag();break;
// }
// }
// }
return hiringMemberShip;
}
......@@ -858,14 +848,6 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
private void sendMsgAfterPDF(Long hiringBasicInfoId) {
AclPractitionerHiringBasicInfo basicInfo = basicInfoMapper.selectByPrimaryKey(hiringBasicInfoId);
AclPractitionerHiringMembership memberShip = membershipMapper.selectByHiringBasicInfoId(hiringBasicInfoId);
//获取体系负责人的的审批记录
List<AclPractitionerHiringApproveRecords> recordsList = recordsMapper.queryListByBasicInfoId(hiringBasicInfoId);
BeanPropertyValueEqualsPredicate predicate = new BeanPropertyValueEqualsPredicate("approveStepId", "2");
List<AclPractitionerHiringApproveRecords> systermOwnerRecords = (List<AclPractitionerHiringApproveRecords>) CollectionUtils.select(recordsList, predicate);
AclPractitionerHiringApproveRecords systermOwnerRecord = systermOwnerRecords.get(0);
List<AclPractitionerSubordinateSystem> subordinateSystems = aclPractitionerSubordinateSystemDALService.findByOwnerPractitionerId(systermOwnerRecord.getApprovingPractitionerId());
AclPractitionerSubordinateSystem systermOwnerRecordSystem = subordinateSystems.get(0);
List<String> mobileNoList = new ArrayList<>(3);
mobileNoList.add(basicInfo.getMobileNo());
......@@ -882,8 +864,8 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
mobileNoList.add(mentor.getMobileNo());
}
if (systermOwnerRecord.getApprovingPractitionerId() != null) {
AclPractitioner system = aclPractitionerMapper.selectByPrimaryKey(systermOwnerRecord.getApprovingPractitionerId());
if (memberShip.getApprovedBy() != null) {
AclPractitioner system = aclPractitionerMapper.selectByPrimaryKey(memberShip.getApprovedBy());
mobileNoList.add(system.getMobileNo());
}
// 若辅导人和团队长为同一人,去重
......@@ -959,7 +941,7 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
// 计算审批流程
basicInfo.setApproveStatus(this.handleApproveStatus(hiringMemberShip));
// 将申请人分配给体系负责人
this.distributeToSubsystemOwner(basicInfoId);
this.distributeToSubsystemOwner(hiringMemberShip);
basicInfoMapper.updateByPrimaryKeySelective(basicInfo);
......@@ -972,7 +954,14 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
return resp;
}
private void distributeToSubsystemOwner(Long hiringBasicInfoId) {
private void distributeToSubsystemOwner(AclPractitionerHiringMembership memberShip) {
Long hiringBasicInfoId = memberShip.getHiringBasicInfoId();
String mdDropOptionName = memberShip.getMdDropOptionName();
// S2,S3报聘不用团队长审批
if (mdDropOptionName.indexOf("S2")>=0 || mdDropOptionName.indexOf("S3")>=0) {
return;
}
// 查询辅导人所在S1,S2,S3
AclPractitionerHiringMembership hiringMemberShip = this.queryHiringMemberShip(hiringBasicInfoId);
Long s1TeamLeaderId = hiringMemberShip.getS1TeamLeaderId();
......@@ -989,7 +978,6 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
approvedBy = s3TeamLeaderId;
}
}
systemConfigService.putIntoListOfSubsystemOwner(approvedBy, hiringBasicInfoId);
// 保存审批的负责人
hiringMemberShip.setApprovedBy(approvedBy);
membershipMapper.updateByPrimaryKeySelective(hiringMemberShip);
......
......@@ -80,7 +80,7 @@ public interface PractitionerHiringMapper {
List<HiringListInfo> queryMentorUnhandledList(Long practitionerId);
List<HiringListInfo> querySystemOwnerUnhandledList(@Param("list") List<Long> list, @Param("practitionerId") Long practitionerId);
List<HiringListInfo> querySystemOwnerUnhandledList(@Param("practitionerId") Long practitionerId);
String getNextContractNo();
......
......@@ -210,26 +210,13 @@ public class PractitionerHiringDALServiceImpl implements PractitionerHiringDALSe
List<HiringListInfo> resultList = new ArrayList<>();
List<HiringListInfo> list1 = practitionerHiringMapper.queryMentorUnhandledList(practitionerId);
List<HiringListInfo> list2 = this.querySystemOwnerUnhandledList(practitionerId);
List<HiringListInfo> list2 = practitionerHiringMapper.querySystemOwnerUnhandledList(practitionerId);
resultList.addAll(list1);
resultList.addAll(list2);
return resultList;
}
private List<HiringListInfo> querySystemOwnerUnhandledList(Long practitionerId) {
List<HiringListInfo> resultList = new ArrayList<>();
List<Long> listOfSubsystemOwner = systemConfigService.getListOfSubsystemOwner(practitionerId);
// 去除已审核的id
if (CollectionUtils.isNotEmpty(listOfSubsystemOwner)) {
listOfSubsystemOwner = this.queryBasicInfoIdList(listOfSubsystemOwner);
}
if (CollectionUtils.isNotEmpty(listOfSubsystemOwner)) {
resultList = practitionerHiringMapper.querySystemOwnerUnhandledList(listOfSubsystemOwner, practitionerId);
}
return resultList;
}
private List<HiringListInfo> queryAGMSHiringinfoList(String practitionerMobileNo) {
// 结果集
List<PractitionerHiringListInfo> dataList = new ArrayList<>();
......
......@@ -9,7 +9,6 @@ import com.yd.rmi.ali.ossinterf.service.AliOssInterfService;
import com.yd.util.CommonUtil;
import net.sf.ehcache.Cache;
import net.sf.ehcache.Element;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Service;
......@@ -352,46 +351,4 @@ public class SystemConfigService implements CommandLineRunner{
return map;
}
public void putIntoListOfSubsystemOwner(Long approvedBy, Long hiringBasicInfoId) {
Map<Long, List<Long>> map = null;
Element element = systemConfigCache.get("listOfSubsystemOwner");
if(element != null && element.getObjectValue() != null){
map = (Map<Long, List<Long>>)element.getObjectValue();
}else{
map = new HashMap<>();
element = new Element("listOfSubsystemOwner",map);
systemConfigCache.put(element);
}
if (map != null) {
List<Long> list = map.get(approvedBy);
if (list == null) {
list = new ArrayList<>();
}
list.add(hiringBasicInfoId);
map.put(approvedBy, list);
}
}
public List<Long> getListOfSubsystemOwner(Long approvedBy) {
Map<Long, List<Long>> map = null;
List<Long> list = null;
Element element = systemConfigCache.get("listOfSubsystemOwner");
if(element != null && element.getObjectValue() != null){
map = (Map<Long, List<Long>>)element.getObjectValue();
}else{
map = new HashMap<>();
element = new Element("listOfSubsystemOwner",map);
systemConfigCache.put(element);
}
if (map != null) {
list = map.get(approvedBy);
if (list == null) {
list = new ArrayList<>();
}
}
return list;
}
}
......@@ -256,7 +256,7 @@
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 <foreach collection="list" item="p_id" open="(" separator="," close=")">#{p_id,jdbcType=BIGINT}</foreach>
and m.approved_by = #{practitionerId,jdbcType=BIGINT}
and b.approve_status = '1'
and m.md_drop_option_id != (select id
from ag_md_drop_options
......
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