Commit e11bf662 by Water Wang

optimize

parent f88efa8c
...@@ -1000,18 +1000,23 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1000,18 +1000,23 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
List<AclPractitionerPotentialAssigneds> assignedsList = aclPractitionerPotentialAssignedsDALService.findByPractitionerId(practitionerId); List<AclPractitionerPotentialAssigneds> assignedsList = aclPractitionerPotentialAssignedsDALService.findByPractitionerId(practitionerId);
Map<Long,String> remarkMap = new HashMap<>(); Map<Long,String> remarkMap = new HashMap<>();
assignedsList.forEach(i->remarkMap.put(i.getPractitionerPotentialId(),i.getRemark())); assignedsList.forEach(i->remarkMap.put(i.getPractitionerPotentialId(),i.getRemark()));
List<Long> potentialIdList = new ArrayList<>(remarkMap.keySet());
List<AclPractitionerPotentialAssigneds> assigneds = aclPractitionerPotentialAssignedsDALService.findByPractitionerIdAndPotentialIdList(practitionerId,potentialIdList);
Map<Long,Date> timeToOnBoardingMap = new HashMap<>();
assigneds.forEach(i->timeToOnBoardingMap.put(i.getPractitionerPotentialId(),i.getTimeToOnboarding()));
//待开发 --查询预计报聘时间
for(PractitionerPotentialInfo item : practitionerPotentialInfoList){ for(PractitionerPotentialInfo item : practitionerPotentialInfoList){
trackStatusId = item.getTrackStatusId(); trackStatusId = item.getTrackStatusId();
if(status != null){ if(status != null){
if(status == 1 && trackStatusId.longValue() == firstTrackStatusId){ if(status == 1 && trackStatusId.longValue() == firstTrackStatusId){
getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item,remarkMap); getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item,remarkMap,timeToOnBoardingMap);
}else if(status == 3 && trackStatusId.longValue() == LastStatusId){ }else if(status == 3 && trackStatusId.longValue() == LastStatusId){
getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item,remarkMap); getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item,remarkMap,timeToOnBoardingMap);
}else if(status == 2 && trackStatusId.longValue() != LastStatusId && trackStatusId.longValue() != firstTrackStatusId){ }else if(status == 2 && trackStatusId.longValue() != LastStatusId && trackStatusId.longValue() != firstTrackStatusId){
getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item,remarkMap); getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item,remarkMap,timeToOnBoardingMap);
} }
}else{ }else{
getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item,remarkMap); getResponseMessage(potentialInfoList,trackStatusMap,recruitSourceMap,item,remarkMap,timeToOnBoardingMap);
} }
} }
responseVO.setPractitionerPotentialInfoList(potentialInfoList); responseVO.setPractitionerPotentialInfoList(potentialInfoList);
...@@ -1027,12 +1032,13 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1027,12 +1032,13 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
} }
private void getResponseMessage(List<PractitionerPotentialInfo> potentialInfoList, Map<Long, String> trackStatusMap,Map<Long,String> recruitSourceMap, PractitionerPotentialInfo item,Map<Long,String> remarkMap) { private void getResponseMessage(List<PractitionerPotentialInfo> potentialInfoList, Map<Long, String> trackStatusMap,Map<Long,String> recruitSourceMap, PractitionerPotentialInfo item,Map<Long,String> remarkMap,Map<Long,Date> timeToOnBoardingMap) {
PractitionerPotentialInfo potentialInfo = new PractitionerPotentialInfo(); PractitionerPotentialInfo potentialInfo = new PractitionerPotentialInfo();
BeanUtils.copyProperties(item,potentialInfo); BeanUtils.copyProperties(item,potentialInfo);
potentialInfo.setRemark(remarkMap.get(item.getPotentialId())); potentialInfo.setRemark(remarkMap.get(item.getPotentialId()));
potentialInfo.setTrackStatus(trackStatusMap.get(item.getTrackStatusId())); potentialInfo.setTrackStatus(trackStatusMap.get(item.getTrackStatusId()));
potentialInfo.setResourceDropMasterName(recruitSourceMap.get(item.getResourceDropMasterId())); potentialInfo.setResourceDropMasterName(recruitSourceMap.get(item.getResourceDropMasterId()));
potentialInfo.setTimeToOnboarding(CommonUtil.dateParseString(timeToOnBoardingMap.get(item.getPotentialId()),"yyyy-MM-dd"));
potentialInfoList.add(potentialInfo); potentialInfoList.add(potentialInfo);
} }
......
...@@ -20,6 +20,7 @@ public class PractitionerPotentialInfo { ...@@ -20,6 +20,7 @@ public class PractitionerPotentialInfo {
private String trackStatus; private String trackStatus;
private Long trackId; private Long trackId;
private String createdAt; private String createdAt;
private String timeToOnboarding;
public Long getPotentialId() { public Long getPotentialId() {
return potentialId; return potentialId;
...@@ -172,4 +173,12 @@ public class PractitionerPotentialInfo { ...@@ -172,4 +173,12 @@ public class PractitionerPotentialInfo {
public void setCreatedAt(String createdAt) { public void setCreatedAt(String createdAt) {
this.createdAt = createdAt; this.createdAt = createdAt;
} }
public String getTimeToOnboarding() {
return timeToOnboarding;
}
public void setTimeToOnboarding(String timeToOnboarding) {
this.timeToOnboarding = timeToOnboarding;
}
} }
...@@ -117,4 +117,5 @@ public class AclPractitionerPotential implements Serializable { ...@@ -117,4 +117,5 @@ public class AclPractitionerPotential implements Serializable {
private Integer updaterType; private Integer updaterType;
private Long customerId; private Long customerId;
} }
\ No newline at end of file
...@@ -23,4 +23,6 @@ public interface AclPractitionerPotentialAssignedsMapper { ...@@ -23,4 +23,6 @@ public interface AclPractitionerPotentialAssignedsMapper {
List<AclPractitionerPotentialAssigneds> findByPotentialIdAndPractitionerId(@Param("potentialId")Long potentialId, @Param("practitionerId")Long practitionerId); List<AclPractitionerPotentialAssigneds> findByPotentialIdAndPractitionerId(@Param("potentialId")Long potentialId, @Param("practitionerId")Long practitionerId);
List<AclPractitionerPotentialAssigneds> findByPractitionerId(@Param("practitionerId")Long practitionerId); List<AclPractitionerPotentialAssigneds> findByPractitionerId(@Param("practitionerId")Long practitionerId);
List<AclPractitionerPotentialAssigneds> findByPractitionerIdAndPotentialIdList(@Param("practitionerId")Long practitionerId, @Param("potentialIdList")List<Long> potentialIdList);
} }
\ No newline at end of file
...@@ -15,4 +15,6 @@ public interface AclPractitionerPotentialAssignedsDALService { ...@@ -15,4 +15,6 @@ public interface AclPractitionerPotentialAssignedsDALService {
void update(AclPractitionerPotentialAssigneds assigneds); void update(AclPractitionerPotentialAssigneds assigneds);
List<AclPractitionerPotentialAssigneds> findByPractitionerId(Long practitionerId); List<AclPractitionerPotentialAssigneds> findByPractitionerId(Long practitionerId);
List<AclPractitionerPotentialAssigneds> findByPractitionerIdAndPotentialIdList(Long practitionerId, List<Long> potentialIdList);
} }
...@@ -32,4 +32,9 @@ public class AclPractitionerPotentialAssignedsDALServiceImpl implements AclPract ...@@ -32,4 +32,9 @@ public class AclPractitionerPotentialAssignedsDALServiceImpl implements AclPract
public List<AclPractitionerPotentialAssigneds> findByPractitionerId(Long practitionerId) { public List<AclPractitionerPotentialAssigneds> findByPractitionerId(Long practitionerId) {
return aclPractitionerPotentialAssignedsMapper.findByPractitionerId(practitionerId); return aclPractitionerPotentialAssignedsMapper.findByPractitionerId(practitionerId);
} }
@Override
public List<AclPractitionerPotentialAssigneds> findByPractitionerIdAndPotentialIdList(Long practitionerId, List<Long> potentialIdList) {
return aclPractitionerPotentialAssignedsMapper.findByPractitionerIdAndPotentialIdList(practitionerId,potentialIdList);
}
} }
...@@ -37,7 +37,17 @@ ...@@ -37,7 +37,17 @@
from ag_acl_practitioner_potential_assigneds from ag_acl_practitioner_potential_assigneds
where assigned_practitioner_id = #{practitionerId,jdbcType=BIGINT} where assigned_practitioner_id = #{practitionerId,jdbcType=BIGINT}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> <select id="findByPractitionerIdAndPotentialIdList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ag_acl_practitioner_potential_assigneds
where assigned_practitioner_id = #{practitionerId,jdbcType=BIGINT}
and practitioner_potential_id in
<foreach collection="potentialIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ag_acl_practitioner_potential_assigneds delete from ag_acl_practitioner_potential_assigneds
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</delete> </delete>
......
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