Commit 109f3da8 by Simon Cheng

'电子印章功能'

parents 59ae5c0b 7bff697e
...@@ -8,9 +8,11 @@ import com.yd.dal.entity.agms.hiring.*; ...@@ -8,9 +8,11 @@ import com.yd.dal.entity.agms.hiring.*;
import com.yd.dal.entity.customer.*; import com.yd.dal.entity.customer.*;
import com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps; import com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps;
import com.yd.dal.entity.user.AclUser; import com.yd.dal.entity.user.AclUser;
import com.yd.dal.mapper.customer.AclPractitionerHiringBasicInfoMapper;
import com.yd.dal.service.agms.AgmsHiringDALService; import com.yd.dal.service.agms.AgmsHiringDALService;
import com.yd.dal.service.customer.*; import com.yd.dal.service.customer.*;
import com.yd.dal.service.meta.MdPractitionerHiringApproveStepsDALService; import com.yd.dal.service.meta.MdPractitionerHiringApproveStepsDALService;
import com.yd.dal.service.practitioner.PractitionerHiringDALService;
import com.yd.dal.service.user.AclUserDALService; import com.yd.dal.service.user.AclUserDALService;
import com.yd.rmi.cache.SystemConfigService; import com.yd.rmi.cache.SystemConfigService;
import com.yd.util.CommonUtil; import com.yd.util.CommonUtil;
...@@ -44,6 +46,11 @@ public class AgmsHiringServiceImpl implements AgmsHiringService { ...@@ -44,6 +46,11 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
private AclPractitionerSubordinateSystemDALService aclPractitionerSubordinateSystemDalService; private AclPractitionerSubordinateSystemDALService aclPractitionerSubordinateSystemDalService;
private AclCustomerDALService aclCustomerDalService; private AclCustomerDALService aclCustomerDalService;
@Autowired @Autowired
private AclPractitionerHiringBasicInfoMapper basicInfoMapper;
@Autowired
private PractitionerHiringDALService practitionerHiringDalService;
@Autowired
public void setAgmsHiringDalService(AgmsHiringDALService agmsHiringDalService){ public void setAgmsHiringDalService(AgmsHiringDALService agmsHiringDalService){
this.agmsHiringDalService = agmsHiringDalService; this.agmsHiringDalService = agmsHiringDalService;
} }
...@@ -142,7 +149,7 @@ public class AgmsHiringServiceImpl implements AgmsHiringService { ...@@ -142,7 +149,7 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
PractitionerHiringApproveResponseVO responseVO = new PractitionerHiringApproveResponseVO(); PractitionerHiringApproveResponseVO responseVO = new PractitionerHiringApproveResponseVO();
Long loginId = requestVO.getLoginId(); Long loginId = requestVO.getLoginId();
Long hiringBasicInfoId = requestVO.getHiringBasicInfoId(); Long hiringBasicInfoId = requestVO.getHiringBasicInfoId();
Integer hiringApproveStepsSeq = requestVO.getHiringApproveStepsSeq();
//通过loginId查询此登入者的经纪人id //通过loginId查询此登入者的经纪人id
Long loginPractitionerId = agmsHiringDalService.findPractitionerIdByLoginId(loginId); Long loginPractitionerId = agmsHiringDalService.findPractitionerIdByLoginId(loginId);
AclUser user = aclUserDalService.selectByPrimaryKey(loginId); AclUser user = aclUserDalService.selectByPrimaryKey(loginId);
...@@ -155,14 +162,22 @@ public class AgmsHiringServiceImpl implements AgmsHiringService { ...@@ -155,14 +162,22 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
return responseVO; return responseVO;
} }
//保存完毕,判断是否为最后一步 //保存完毕,判断是否为最后一步
MdPractitionerHiringApproveSteps listStep = hiringApproveStepsList.get(hiringApproveStepsList.size() - 1); AclPractitionerHiringBasicInfo basicInfo = basicInfoMapper.selectByPrimaryKey(hiringBasicInfoId);
Integer stepSeq = listStep.getStepSeq(); if ("5".equals(basicInfo.getApproveStatus())) {
if (stepSeq.equals(hiringApproveStepsSeq)) {
Long approvingStatus = requestVO.getApprovingStatus(); Long approvingStatus = requestVO.getApprovingStatus();
String basicInfoStatus = null;
if (approvingStatus == 1) { if (approvingStatus == 1) {
//最后一步 并同意 更新经纪人系类表 //最后一步 并同意 更新经纪人系类表
updatePractitionerInfo(hiringBasicInfoId,loginId); updatePractitionerInfo(hiringBasicInfoId,loginId);
basicInfoStatus = "0";
} else {
basicInfoStatus = "-1";
} }
// 更新basicInfo表审批状态
AclPractitionerHiringBasicInfo updateObj = new AclPractitionerHiringBasicInfo();
updateObj.setId(hiringBasicInfoId);
updateObj.setApproveStatus(basicInfoStatus);
basicInfoMapper.updateByPrimaryKeySelective(updateObj);
} }
responseVO.setHiringBasicInfoId(hiringBasicInfoId); responseVO.setHiringBasicInfoId(hiringBasicInfoId);
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"))); responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
...@@ -206,20 +221,32 @@ public class AgmsHiringServiceImpl implements AgmsHiringService { ...@@ -206,20 +221,32 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
String mobileNo, List<MdPractitionerHiringApproveSteps> hiringApproveStepsList, String mobileNo, List<MdPractitionerHiringApproveSteps> hiringApproveStepsList,
PractitionerHiringApproveRequestVO requestVO, PractitionerHiringApproveRequestVO requestVO,
PractitionerHiringApproveResponseVO responseVO) { PractitionerHiringApproveResponseVO responseVO) {
BeanPropertyValueEqualsPredicate predicate = new BeanPropertyValueEqualsPredicate("stepSeq",requestVO.getHiringApproveStepsSeq());
List<MdPractitionerHiringApproveSteps> steps = (List<MdPractitionerHiringApproveSteps>) CollectionUtils.select(hiringApproveStepsList,predicate);
System.out.println("看看审批操作中处理后的步骤是不是每次都只有一个"); Long basicInfoId = requestVO.getHiringBasicInfoId();
System.out.println(steps); // 先查出当前审批流程
AclPractitionerHiringBasicInfo basicInfo = basicInfoMapper.selectByPrimaryKey(basicInfoId);
Integer hiringApproveStepsSeq;
if (basicInfo == null) {
responseVO.setHiringBasicInfoId(requestVO.getHiringBasicInfoId());
responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("830025")));
return;
} else {
// 获取下一步的序号
hiringApproveStepsSeq = this.getNextStepSeq(basicInfo.getApproveStatus());
}
BeanPropertyValueEqualsPredicate predicate = new BeanPropertyValueEqualsPredicate("stepSeq", hiringApproveStepsSeq);
List<MdPractitionerHiringApproveSteps> steps = (List<MdPractitionerHiringApproveSteps>) CollectionUtils.select(hiringApproveStepsList, predicate);
if (steps.size() != 1){ if (steps.size() != 1) {
responseVO.setHiringBasicInfoId(requestVO.getHiringBasicInfoId()); responseVO.setHiringBasicInfoId(requestVO.getHiringBasicInfoId());
responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("830025"))); responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("830025")));
return; return;
} }
AclPractitionerHiringApproveRecords records = new AclPractitionerHiringApproveRecords(); AclPractitionerHiringApproveRecords records = new AclPractitionerHiringApproveRecords();
MdPractitionerHiringApproveSteps step = steps.get(0); MdPractitionerHiringApproveSteps step = steps.get(0);
records.setHiringBasicInfoId(requestVO.getHiringBasicInfoId()); records.setHiringBasicInfoId(basicInfoId);
records.setApproveStepId(step.getId().toString()); records.setApproveStepId(step.getId().toString());
records.setApproveStepName(step.getStepName()); records.setApproveStepName(step.getStepName());
records.setApprovingPractitionerId(loginPractitionerId); records.setApprovingPractitionerId(loginPractitionerId);
...@@ -231,7 +258,13 @@ public class AgmsHiringServiceImpl implements AgmsHiringService { ...@@ -231,7 +258,13 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
records.setUpdatedAt(new Date()); records.setUpdatedAt(new Date());
records.setUpdatedBy(loginPractitionerId); records.setUpdatedBy(loginPractitionerId);
aclPractitionerHiringApproveRecordsDalService.save(records); aclPractitionerHiringApproveRecordsDalService.save(records);
if (CommonUtil.isNullOrZero(requestVO.getApprovingStatus())){ // 更新basicInfo表审批状态
AclPractitionerHiringBasicInfo updateObj = new AclPractitionerHiringBasicInfo();
updateObj.setId(basicInfoId);
updateObj.setApproveStatus(step.getStepSeq().toString());
basicInfoMapper.updateByPrimaryKeySelective(updateObj);
if (CommonUtil.isNullOrZero(requestVO.getApprovingStatus())) {
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"))); responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return; return;
} }
...@@ -240,32 +273,63 @@ public class AgmsHiringServiceImpl implements AgmsHiringService { ...@@ -240,32 +273,63 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
MdPractitionerHiringApproveSteps lastStep = hiringApproveStepsList.get(hiringApproveStepsList.size() - 1); MdPractitionerHiringApproveSteps lastStep = hiringApproveStepsList.get(hiringApproveStepsList.size() - 1);
Long lastStepId = lastStep.getId(); Long lastStepId = lastStep.getId();
//这是最后一个步骤 //这是最后一个步骤
if (id.equals(lastStepId)){ if (id.equals(lastStepId)) {
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"))); responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return; return;
} }
//下一个步骤 //下一个步骤
MdPractitionerHiringApproveSteps nextStop = new MdPractitionerHiringApproveSteps(); MdPractitionerHiringApproveSteps nextStep = new MdPractitionerHiringApproveSteps();
for (int i = 0;i< hiringApproveStepsList.size();i++){ for (int i = 0; i < hiringApproveStepsList.size(); i++) {
MdPractitionerHiringApproveSteps stop = hiringApproveStepsList.get(i); MdPractitionerHiringApproveSteps stop = hiringApproveStepsList.get(i);
Long stopId = stop.getId(); Long stopId = stop.getId();
if (id.equals(stopId)){ if (id.equals(stopId)) {
nextStop = hiringApproveStepsList.get(i+1); nextStep = hiringApproveStepsList.get(i + 1);
break; break;
} }
} }
String appointedApprovePractitioners = nextStop.getAppointedApprovePractitioners();
List<String> hiringApproveMobileNos = new ArrayList<>(Arrays.asList(appointedApprovePractitioners.split(",")));
//不是他 //不是他
if (!hiringApproveMobileNos.contains(mobileNo)) { boolean flag = this.isHasNextStep(loginPractitionerId, mobileNo, nextStep);
if (!flag) {
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"))); responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return; return;
} }
requestVO.setHiringApproveStepsSeq(nextStop.getStepSeq()); requestVO.setHiringApproveStepsSeq(nextStep.getStepSeq());
saveRecords(loginPractitionerId,mobileNo,hiringApproveStepsList,requestVO,responseVO); saveRecords(loginPractitionerId, mobileNo, hiringApproveStepsList, requestVO, responseVO);
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"))); responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
} }
private Integer getNextStepSeq(String approveStatus) {
switch (approveStatus) {
case "-2" :
return Integer.valueOf("1");
case "1" :
return Integer.valueOf("2");
case "2" :
return Integer.valueOf("3");
case "3" :
return Integer.valueOf("4");
case "4" :
return Integer.valueOf("5");
}
return null;
}
private boolean isHasNextStep(Long loginPractitionerId, String mobileNo, MdPractitionerHiringApproveSteps nextStep) {
// 先判断是否是AGMS中审批的人员
String appointedApprovePractitioners = nextStep.getAppointedApprovePractitioners();
List<String> hiringApproveMobileNos = new ArrayList<>(Arrays.asList(appointedApprovePractitioners.split(",")));
if (hiringApproveMobileNos.contains(mobileNo)) {
return true;
}
// 不是AGMS审批人;只有既是辅导人又是团队长才有下一步
int approvalIdentity = practitionerHiringDalService.queryApprovalIdentity(loginPractitionerId);
if (approvalIdentity == 0) {
return true;
}
return false;
}
private void updatePractitionerInfo(Long hiringBasicInfoId,Long loginId) { private void updatePractitionerInfo(Long hiringBasicInfoId,Long loginId) {
//更新经纪人系类表 //更新经纪人系类表
//ag_acl_practitioner //ag_acl_practitioner
......
...@@ -67,24 +67,6 @@ public class PractitionerHiringApproveRequestVO { ...@@ -67,24 +67,6 @@ public class PractitionerHiringApproveRequestVO {
} }
/** /**
* 获取 审批步骤经行到哪一步了
*
* @return hiringApproveStepsSeq 审批步骤经行到哪一步了
*/
public Integer getHiringApproveStepsSeq() {
return this.hiringApproveStepsSeq;
}
/**
* 设置 审批步骤经行到哪一步了
*
* @param hiringApproveStepsSeq 审批步骤经行到哪一步了
*/
public void setHiringApproveStepsSeq(Integer hiringApproveStepsSeq) {
this.hiringApproveStepsSeq = hiringApproveStepsSeq;
}
/**
* 获取 1:通过,0:驳回 * 获取 1:通过,0:驳回
* *
* @return approvingStatus 1:通过,0:驳回 * @return approvingStatus 1:通过,0:驳回
...@@ -125,7 +107,6 @@ public class PractitionerHiringApproveRequestVO { ...@@ -125,7 +107,6 @@ public class PractitionerHiringApproveRequestVO {
return "PractitionerHiringApproveRequestVO{" + return "PractitionerHiringApproveRequestVO{" +
"loginId='" + loginId + '\'' + "loginId='" + loginId + '\'' +
", hiringBasicInfoId=" + hiringBasicInfoId + ", hiringBasicInfoId=" + hiringBasicInfoId +
", hiringApproveStepsSeq=" + hiringApproveStepsSeq +
", approvingStatus=" + approvingStatus + ", approvingStatus=" + approvingStatus +
", rejectNote='" + rejectNote + '\'' + ", rejectNote='" + rejectNote + '\'' +
'}'; '}';
...@@ -138,4 +119,12 @@ public class PractitionerHiringApproveRequestVO { ...@@ -138,4 +119,12 @@ public class PractitionerHiringApproveRequestVO {
public void setInterviewAssessment(String interviewAssessment) { public void setInterviewAssessment(String interviewAssessment) {
this.interviewAssessment = interviewAssessment; this.interviewAssessment = interviewAssessment;
} }
public Integer getHiringApproveStepsSeq() {
return hiringApproveStepsSeq;
}
public void setHiringApproveStepsSeq(Integer hiringApproveStepsSeq) {
this.hiringApproveStepsSeq = hiringApproveStepsSeq;
}
} }
...@@ -9,6 +9,7 @@ import com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps; ...@@ -9,6 +9,7 @@ import com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps;
import com.yd.dal.entity.practitioner.hiring.*; import com.yd.dal.entity.practitioner.hiring.*;
import com.yd.dal.mapper.customer.*; import com.yd.dal.mapper.customer.*;
import com.yd.dal.service.customer.AclPractitionerHiringApproveRecordsDALService; import com.yd.dal.service.customer.AclPractitionerHiringApproveRecordsDALService;
import com.yd.dal.service.meta.MdPractitionerHiringApproveStepsDALService;
import com.yd.dal.service.practitioner.PractitionerHiringDALService; import com.yd.dal.service.practitioner.PractitionerHiringDALService;
import com.yd.rmi.ali.oss.service.OssService; import com.yd.rmi.ali.oss.service.OssService;
import com.yd.rmi.cache.SystemConfigService; import com.yd.rmi.cache.SystemConfigService;
......
...@@ -53,42 +53,6 @@ public class HiringApproveRequestVO { ...@@ -53,42 +53,6 @@ public class HiringApproveRequestVO {
} }
/** /**
* 获取 审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长
*
* @return approvalIdentity 审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长
*/
public Long getApprovalIdentity() {
return this.approvalIdentity;
}
/**
* 设置 审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长
*
* @param approvalIdentity 审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长
*/
public void setApprovalIdentity(Long approvalIdentity) {
this.approvalIdentity = approvalIdentity;
}
/**
* 获取 审批步骤经行到哪一步了
*
* @return hiringApproveStepsSeq 审批步骤经行到哪一步了
*/
public Long getHiringApproveStepsSeq() {
return this.hiringApproveStepsSeq;
}
/**
* 设置 审批步骤经行到哪一步了
*
* @param hiringApproveStepsSeq 审批步骤经行到哪一步了
*/
public void setHiringApproveStepsSeq(Long hiringApproveStepsSeq) {
this.hiringApproveStepsSeq = hiringApproveStepsSeq;
}
/**
* 获取 审批经纪人基本资料id * 获取 审批经纪人基本资料id
* *
* @return hiringBasicInfoId 审批经纪人基本资料id * @return hiringBasicInfoId 审批经纪人基本资料id
...@@ -146,8 +110,6 @@ public class HiringApproveRequestVO { ...@@ -146,8 +110,6 @@ public class HiringApproveRequestVO {
public String toString() { public String toString() {
return "HiringApproveRequestVO{" + return "HiringApproveRequestVO{" +
"practitionerId=" + practitionerId + "practitionerId=" + practitionerId +
", approvalIdentity=" + approvalIdentity +
", hiringApproveStepsSeq=" + hiringApproveStepsSeq +
", hiringBasicInfoId=" + hiringBasicInfoId + ", hiringBasicInfoId=" + hiringBasicInfoId +
", approvingStatus=" + approvingStatus + ", approvingStatus=" + approvingStatus +
", rejectNote='" + rejectNote + '\'' + ", rejectNote='" + rejectNote + '\'' +
...@@ -161,4 +123,20 @@ public class HiringApproveRequestVO { ...@@ -161,4 +123,20 @@ public class HiringApproveRequestVO {
public void setInterviewAssessment(String interviewAssessment) { public void setInterviewAssessment(String interviewAssessment) {
this.interviewAssessment = interviewAssessment; this.interviewAssessment = interviewAssessment;
} }
public Long getApprovalIdentity() {
return approvalIdentity;
}
public void setApprovalIdentity(Long approvalIdentity) {
this.approvalIdentity = approvalIdentity;
}
public Long getHiringApproveStepsSeq() {
return hiringApproveStepsSeq;
}
public void setHiringApproveStepsSeq(Long hiringApproveStepsSeq) {
this.hiringApproveStepsSeq = hiringApproveStepsSeq;
}
} }
...@@ -34,6 +34,11 @@ public class PractitionerHiringApproveRecords { ...@@ -34,6 +34,11 @@ public class PractitionerHiringApproveRecords {
private String approvingStatus; private String approvingStatus;
/** /**
* 面试评价
*/
private String interviewAssessment;
/**
* 备注,驳回原因 * 备注,驳回原因
*/ */
private String rejectNote; private String rejectNote;
...@@ -200,4 +205,12 @@ public class PractitionerHiringApproveRecords { ...@@ -200,4 +205,12 @@ public class PractitionerHiringApproveRecords {
", hiringAt='" + hiringAt + '\'' + ", hiringAt='" + hiringAt + '\'' +
'}'; '}';
} }
public String getInterviewAssessment() {
return interviewAssessment;
}
public void setInterviewAssessment(String interviewAssessment) {
this.interviewAssessment = interviewAssessment;
}
} }
...@@ -45,6 +45,11 @@ public class HiringApproveRecords { ...@@ -45,6 +45,11 @@ public class HiringApproveRecords {
private String rejectNote; private String rejectNote;
/** /**
* 面试评价
*/
private String interviewAssessment;
/**
* 审批时间 * 审批时间
*/ */
private String hiringAt; private String hiringAt;
...@@ -222,4 +227,12 @@ public class HiringApproveRecords { ...@@ -222,4 +227,12 @@ public class HiringApproveRecords {
public void setLevelName(String levelName) { public void setLevelName(String levelName) {
this.levelName = levelName; this.levelName = levelName;
} }
public String getInterviewAssessment() {
return interviewAssessment;
}
public void setInterviewAssessment(String interviewAssessment) {
this.interviewAssessment = interviewAssessment;
}
} }
...@@ -36,11 +36,6 @@ public class HiringListInfo { ...@@ -36,11 +36,6 @@ public class HiringListInfo {
private String applicationTime; private String applicationTime;
/** /**
* 审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长
*/
private Long approvalIdentity;
/**
* 获取 经纪人基本信息id * 获取 经纪人基本信息id
* *
* @return hiringBasicInfoId 经纪人基本信息id * @return hiringBasicInfoId 经纪人基本信息id
...@@ -148,25 +143,6 @@ public class HiringListInfo { ...@@ -148,25 +143,6 @@ public class HiringListInfo {
this.applicationTime = applicationTime; this.applicationTime = applicationTime;
} }
/**
* 获取 审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长
*
* @return approvalIdentity 审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长
*/
public Long getApprovalIdentity() {
return this.approvalIdentity;
}
/**
* 设置 审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长
*
* @param approvalIdentity 审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长
*/
public void setApprovalIdentity(Long approvalIdentity) {
this.approvalIdentity = approvalIdentity;
}
@Override @Override
public String toString() { public String toString() {
return "HiringListInfo{" + return "HiringListInfo{" +
...@@ -176,7 +152,16 @@ public class HiringListInfo { ...@@ -176,7 +152,16 @@ public class HiringListInfo {
", practitionerLevel='" + practitionerLevel + '\'' + ", practitionerLevel='" + practitionerLevel + '\'' +
", mentor='" + mentor + '\'' + ", mentor='" + mentor + '\'' +
", applicationTime='" + applicationTime + '\'' + ", applicationTime='" + applicationTime + '\'' +
", approvalIdentity=" + approvalIdentity +
'}'; '}';
} }
public boolean equals(Object obj) {
HiringListInfo u = (HiringListInfo) obj;
return this.hiringBasicInfoId.equals(u.getHiringBasicInfoId());
}
public int hashCode() {
Long in = this.hiringBasicInfoId;
return in.hashCode();
}
} }
...@@ -70,7 +70,7 @@ public interface AgmsHiringMapper { ...@@ -70,7 +70,7 @@ public interface AgmsHiringMapper {
@Param("name")Long name @Param("name")Long name
); );
Page<PractitionerHiringListInfo> queryUnhandledList(@Param("approveStatus")Integer approveStatus, Page<PractitionerHiringListInfo> queryUnhandledList(@Param("approveStatus")String approveStatus,
@Param("list")List<String> canAprroveGrades, @Param("list")List<String> canAprroveGrades,
@Param("branchId")Long branchId, @Param("branchId")Long branchId,
@Param("deptId")Long deptId, @Param("deptId")Long deptId,
......
...@@ -122,8 +122,9 @@ public class AgmsHiringDALServiceImpl implements AgmsHiringDALService { ...@@ -122,8 +122,9 @@ public class AgmsHiringDALServiceImpl implements AgmsHiringDALService {
List<String> canAprroveGrades = new ArrayList<>(); List<String> canAprroveGrades = new ArrayList<>();
canAprroveGrades.addAll(Arrays.asList(canAprroveGrade.split(","))); canAprroveGrades.addAll(Arrays.asList(canAprroveGrade.split(",")));
String approveStatus = CommonUtil.getApproveStatusByStepSeq(stepSeq);
List<PractitionerHiringListInfo> resultList = List<PractitionerHiringListInfo> resultList =
agmsHiringMapper.queryUnhandledList(stepSeq - 1, canAprroveGrades, agmsHiringMapper.queryUnhandledList(approveStatus, canAprroveGrades,
requestVO.getBranchId(), requestVO.getBranchId(),
requestVO.getDeptId(), requestVO.getDeptId(),
requestVO.getSubsystemId(), requestVO.getSubsystemId(),
......
...@@ -87,4 +87,11 @@ public interface PractitionerHiringDALService { ...@@ -87,4 +87,11 @@ public interface PractitionerHiringDALService {
* @return * @return
*/ */
List<HiringListInfo> queryUnhandledList(Long practitionerId); List<HiringListInfo> queryUnhandledList(Long practitionerId);
/**
* 查询审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长
* @param practitionerId
* @return
*/
int queryApprovalIdentity(Long practitionerId);
} }
package com.yd.dal.service.practitioner.impl; package com.yd.dal.service.practitioner.impl;
import com.yd.api.practitioner.vo.hiring.PractitionerHiringContractTerms; import com.yd.api.practitioner.vo.hiring.PractitionerHiringContractTerms;
import com.yd.dal.entity.agms.hiring.PractitionerHiringListInfo;
import com.yd.dal.entity.customer.AclPractitioner;
import com.yd.dal.entity.customer.CustomerFileUpload; import com.yd.dal.entity.customer.CustomerFileUpload;
import com.yd.dal.entity.customer.practitioner.PractitionerInfo; 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.entity.practitioner.hiring.*;
import com.yd.dal.mapper.agms.AgmsHiringMapper;
import com.yd.dal.mapper.customer.AclPractitionerHiringMembershipMapper; import com.yd.dal.mapper.customer.AclPractitionerHiringMembershipMapper;
import com.yd.dal.mapper.customer.AclPractitionerMapper;
import com.yd.dal.mapper.practitioner.PractitionerHiringMapper; import com.yd.dal.mapper.practitioner.PractitionerHiringMapper;
import com.yd.dal.service.customer.AclFileUploadDALService; import com.yd.dal.service.customer.AclFileUploadDALService;
import com.yd.dal.service.customer.AclPractitionerDALService; import com.yd.dal.service.customer.AclPractitionerDALService;
import com.yd.dal.service.meta.MdPractitionerHiringApproveStepsDALService;
import com.yd.dal.service.practitioner.PractitionerHiringDALService; import com.yd.dal.service.practitioner.PractitionerHiringDALService;
import com.yd.util.CommonUtil;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @author xxy * @author xxy
...@@ -29,6 +39,12 @@ public class PractitionerHiringDALServiceImpl implements PractitionerHiringDALSe ...@@ -29,6 +39,12 @@ public class PractitionerHiringDALServiceImpl implements PractitionerHiringDALSe
private AclFileUploadDALService aclFileUploadDALService; private AclFileUploadDALService aclFileUploadDALService;
@Autowired @Autowired
private AclPractitionerHiringMembershipMapper membershipMapper; private AclPractitionerHiringMembershipMapper membershipMapper;
@Autowired
private MdPractitionerHiringApproveStepsDALService mdPractitionerHiringApproveStepsDalService;
@Autowired
private AclPractitionerMapper aclPractitionerMapper;
@Autowired
private AgmsHiringMapper agmsHiringMapper;
@Override @Override
public List<HiringListInfo> findHiringList(Long practitionerId, Long approvingStatus) { public List<HiringListInfo> findHiringList(Long practitionerId, Long approvingStatus) {
...@@ -91,8 +107,49 @@ public class PractitionerHiringDALServiceImpl implements PractitionerHiringDALSe ...@@ -91,8 +107,49 @@ public class PractitionerHiringDALServiceImpl implements PractitionerHiringDALSe
return practitionerHiringMapper.queryHandledList(practitionerId, approvingStatus); return practitionerHiringMapper.queryHandledList(practitionerId, approvingStatus);
} }
/**
* 需求需要AGMS用户也能在ydLife中审批,
* 所以在响应报文一致的情况下,需要合并两个查询接口的结果集
*/
@Override @Override
public List<HiringListInfo> queryUnhandledList(Long practitionerId) { public List<HiringListInfo> queryUnhandledList(Long practitionerId) {
List<HiringListInfo> resultList = new ArrayList<>();
AclPractitioner practitioner = aclPractitionerMapper.selectByPrimaryKey(practitionerId);
// AGMS接口查询逻辑的数据
List<HiringListInfo> agmsDataList = this.queryAGMSHiringinfoList(practitioner.getMobileNo());
System.out.println("------------------------------AGMS接口查询逻辑的数据--------------------------");
System.out.println(agmsDataList);
List<HiringListInfo> ydLifeDataList = this.queryYdLifeHiringinfoList(practitionerId);
System.out.println("-----------------------------ydLife接口查询逻辑的数据-------------------------");
System.out.println(ydLifeDataList);
resultList.addAll(agmsDataList);
resultList.addAll(ydLifeDataList);
System.out.println("-----------------------------去重前的数据-----------------------------");
System.out.println(resultList);
resultList = this.unrepeatedObjList(resultList);
System.out.println("-----------------------------去重后的数据-----------------------------");
System.out.println(resultList);
return resultList;
}
private List<HiringListInfo> unrepeatedObjList(List<HiringListInfo> list) {
List<HiringListInfo> uniqueList = list.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(
// 利用 TreeSet 的排序去重构造函数来达到去重元素的目的
// 根据firstName去重
() -> new TreeSet<>(Comparator.comparingLong(HiringListInfo::getHiringBasicInfoId))), ArrayList::new));
return uniqueList;
}
private List<HiringListInfo> queryYdLifeHiringinfoList(Long practitionerId) {
// 查询审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长 // 查询审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长
int approvalIdentity = this.queryApprovalIdentity(practitionerId); int approvalIdentity = this.queryApprovalIdentity(practitionerId);
...@@ -110,7 +167,51 @@ public class PractitionerHiringDALServiceImpl implements PractitionerHiringDALSe ...@@ -110,7 +167,51 @@ public class PractitionerHiringDALServiceImpl implements PractitionerHiringDALSe
return resultList; return resultList;
} }
private int queryApprovalIdentity(Long practitionerId) { private List<HiringListInfo> queryAGMSHiringinfoList(String practitionerMobileNo) {
// 结果集
List<PractitionerHiringListInfo> dataList = new ArrayList<>();
List<MdPractitionerHiringApproveSteps> ownSteps = mdPractitionerHiringApproveStepsDalService.findByAppointedApprovePractitioners(practitionerMobileNo);
// 根据当前用户拥有的审批步骤查询每一步能够审批的数据
String stepName;
Integer stepSeq;
String canAprroveGrade;
for (MdPractitionerHiringApproveSteps step : ownSteps) {
stepName = step.getStepName();
stepSeq = step.getStepSeq();
canAprroveGrade = step.getCanAprroveGrade();
List<String> canAprroveGrades = new ArrayList<>();
canAprroveGrades.addAll(Arrays.asList(canAprroveGrade.split(",")));
String approveStatus = CommonUtil.getApproveStatusByStepSeq(stepSeq);
List<PractitionerHiringListInfo> resultList =
agmsHiringMapper.queryUnhandledList(approveStatus, canAprroveGrades,
null,
null,
null,
null
);
if (CollectionUtils.isNotEmpty(resultList)) {
dataList.addAll(resultList);
}
if ("公司老板".equals(stepName)) {
List<PractitionerHiringListInfo> s2List = agmsHiringMapper.queryS2List();
dataList.addAll(s2List);
}
}
List<HiringListInfo> list = new ArrayList<>();
for (PractitionerHiringListInfo item : dataList) {
HiringListInfo hiringInfo = new HiringListInfo();
BeanUtils.copyProperties(item, hiringInfo);
list.add(hiringInfo);
}
return list;
}
@Override
public int queryApprovalIdentity(Long practitionerId) {
// 审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长 // 审批身份 0.既是辅导人又是团队长 1.辅导人 2.团队长
int isMentor = membershipMapper.isMentor(practitionerId); int isMentor = membershipMapper.isMentor(practitionerId);
int isSystemOwner = membershipMapper.isSystemOwner(practitionerId); int isSystemOwner = membershipMapper.isSystemOwner(practitionerId);
......
...@@ -1502,21 +1502,7 @@ public class CommonUtil { ...@@ -1502,21 +1502,7 @@ public class CommonUtil {
} }
return sumDay; return sumDay;
} }
public static String getApproveStatusByStepSeq(Integer stepSeq){
switch (stepSeq) {
case 1 :
return "-2";
case 2 :
return "1";
case 3 :
return "2";
case 4 :
return "3";
case 5 :
return "4";
}
return null;
}
public static String readFileTxt(String filePath) { public static String readFileTxt(String filePath) {
String line = null; String line = null;
try try
...@@ -1537,4 +1523,21 @@ public class CommonUtil { ...@@ -1537,4 +1523,21 @@ public class CommonUtil {
return line; return line;
} }
public static String getApproveStatusByStepSeq(Integer stepSeq){
switch (stepSeq) {
case 1 :
return "-2";
case 2 :
return "1";
case 3 :
return "2";
case 4 :
return "3";
case 5 :
return "4";
}
return null;
}
} }
...@@ -108,6 +108,7 @@ ...@@ -108,6 +108,7 @@
r.approve_step_name approveStepName, r.approve_step_name approveStepName,
r.approving_status approvingStatusId, r.approving_status approvingStatusId,
if(r.approving_status is null, null, if(r.approving_status = 1, '通过', '驳回')) approvingStatus, if(r.approving_status is null, null, if(r.approving_status = 1, '通过', '驳回')) approvingStatus,
interview_assessment interviewAssessment,
r.reject_note rejectNote, r.reject_note rejectNote,
date_format(r.created_at, '%Y-%m-%d %H:%i:%s') hiringAt date_format(r.created_at, '%Y-%m-%d %H:%i:%s') hiringAt
from ag_acl_practitioner_hiring_approve_records r from ag_acl_practitioner_hiring_approve_records r
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
<result column="practitionerLevel" jdbcType="VARCHAR" property="practitionerLevel"/> <result column="practitionerLevel" jdbcType="VARCHAR" property="practitionerLevel"/>
<result column="mentor" jdbcType="VARCHAR" property="mentor"/> <result column="mentor" jdbcType="VARCHAR" property="mentor"/>
<result column="applicationTime" jdbcType="VARCHAR" property="applicationTime"/> <result column="applicationTime" jdbcType="VARCHAR" property="applicationTime"/>
<result column="approvalIdentity" jdbcType="BIGINT" property="approvalIdentity"/>
</resultMap> </resultMap>
<select id="findHiringList" resultMap="HiringListInfo"> <select id="findHiringList" resultMap="HiringListInfo">
select b.id hiringBasicInfoId, select b.id hiringBasicInfoId,
...@@ -169,6 +168,7 @@ ...@@ -169,6 +168,7 @@
r.approve_step_name approveStepName, r.approve_step_name approveStepName,
r.approving_status approvingStatusId, r.approving_status approvingStatusId,
if(r.approving_status is null, null, if(r.approving_status = 1, '通过', '驳回')) approvingStatus, if(r.approving_status is null, null, if(r.approving_status = 1, '通过', '驳回')) approvingStatus,
interview_assessment interviewAssessment,
r.reject_note rejectNote, r.reject_note rejectNote,
date_format(r.created_at, '%Y-%m-%d %H:%i:%s') hiringAt date_format(r.created_at, '%Y-%m-%d %H:%i:%s') hiringAt
from ag_acl_practitioner_hiring_approve_records r from ag_acl_practitioner_hiring_approve_records r
...@@ -211,15 +211,6 @@ ...@@ -211,15 +211,6 @@
where t.approving_practitioner_id = #{practitionerId,jdbcType=BIGINT} where t.approving_practitioner_id = #{practitionerId,jdbcType=BIGINT}
and t.approving_status = #{approvingStatus,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>
<select id="queryMentorUnhandledList" resultMap="HiringListInfo"> <select id="queryMentorUnhandledList" resultMap="HiringListInfo">
......
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