Commit 6b59f98e by yao.xiao

增加-已离职经纪人不显示

parent 501e2b02
......@@ -224,5 +224,5 @@ public interface PractitionerService {
* @param practitionerId
* @return
*/
List<Long> getPractitionerIdList(Long practitionerId);
List<Long> getPractitionerIdList(Long practitionerId,Integer isActive);
}
......@@ -253,7 +253,7 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
Long practitionerId = requestVO.getPractitionerId();
try {
// 获取团队成员或被辅导人的practitionerId
List<Long> practitionerIdList = practitionerService.getPractitionerIdList(practitionerId);
List<Long> practitionerIdList = practitionerService.getPractitionerIdList(practitionerId,1);
List<TeamMemberDetail> dataList = aclPractitionerDALService.queryTeamMemberDetailList(practitionerIdList);
......
......@@ -1807,7 +1807,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
TeamActionsAverageQueryResponseVO responseVO = new TeamActionsAverageQueryResponseVO();
Long practitionerId = requestVO.getPractitionerId();
//该团队长下团队所有经纪人信息
List<Long> practitionerIds = this.getPractitionerIdList(practitionerId);
List<Long> practitionerIds = this.getPractitionerIdList(practitionerId,1);
//团队经纪人个数
BigDecimal practitionerNum = BigDecimal.valueOf(practitionerIds.size());
......@@ -1866,14 +1866,14 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
}
@Override
public List<Long> getPractitionerIdList(Long practitionerId) {
public List<Long> getPractitionerIdList(Long practitionerId,Integer isActive) {
List<Long> practitionerIdList = new ArrayList<>();
practitionerIdList.add(practitionerId);
// 判断当前经纪人是否为团队长
int count = aclPractitionerDALService.isTeamLeader(practitionerId);
if (count > 0) {
List<Long> practitionerIdList1 = aclPractitionerDALService.queryTeamAllPractitionerId(practitionerId);
List<Long> practitionerIdList1 = aclPractitionerDALService.queryTeamAllPractitionerId(practitionerId,isActive);
practitionerIdList.addAll(practitionerIdList1);
} else {
List<Long> practitionerIdList2 = aclPractitionerDALService.queryMentoredByPractitionerId(practitionerId);
......@@ -1980,7 +1980,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
List<SalesPerformanceForecastInfo> infos = new ArrayList<>();
//通过团队长经纪人id,查询此团队所有经纪人id
Long practitionerId = requestVO.getPractitionerId();
List<AclPractitioner> practitioners = aclPractitionerDALService.findByIds(this.getPractitionerIdList(practitionerId));
List<AclPractitioner> practitioners = aclPractitionerDALService.findByIds(this.getPractitionerIdList(practitionerId,1));
if (practitioners.isEmpty()){
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return responseVO;
......@@ -2399,6 +2399,15 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
getMemberInfoForOnLine(memberInfoMap,practitionerId,time);
//eGolden
getMemberInfoForEGolden(memberInfoMap,practitionerId,time);
//20210303增加逻辑,已离职经纪人没有数据不显示
//查询这个团队已离职经纪人电话
List<String> leaveOfficeList = aclPractitionerDALService.findLeaveOfficeByPractitionerId(practitionerId);
for (String m : leaveOfficeList) {
SubordinateSystemMemberInfo subordinateSystemMemberInfo = memberInfoMap.get(m);
if (CommonUtil.isNullOrZero(subordinateSystemMemberInfo.getCount())){
memberInfoMap.remove(m);
}
}
//查询出来的结果按照fyp进行排序
List<SubordinateSystemMemberInfo> memberInfoList = new ArrayList<>(memberInfoMap.values());
memberInfoList.sort(Comparator.comparingDouble(SubordinateSystemMemberInfo::getFyp));
......@@ -2441,7 +2450,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
* @param time
*/
private void getMemberInfoForEGolden(Map<String, SubordinateSystemMemberInfo> memberInfoMap, Long practitionerId, Integer time) {
List<AclPractitioner> practitionerList = aclPractitionerDALService.findByIds(this.getPractitionerIdList(practitionerId));
List<AclPractitioner> practitionerList = aclPractitionerDALService.findByIds(this.getPractitionerIdList(practitionerId,null));
List<String> mobileNoList = new ArrayList<>();
for(AclPractitioner item : practitionerList){
mobileNoList.add(item.getMobileNo());
......@@ -2548,7 +2557,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
*/
private void getMemberInfoForOnLine(Map<String,SubordinateSystemMemberInfo> memberInfoMap, Long practitionerId, Integer time) {
//1、查询该团队长所在体系的所有成员
List<AclPractitioner> practitionerList = aclPractitionerDALService.findByIds(this.getPractitionerIdList(practitionerId));
List<AclPractitioner> practitionerList = aclPractitionerDALService.findByIds(this.getPractitionerIdList(practitionerId,null));
if(!practitionerList.isEmpty() && practitionerList.get(0) != null){
Map<Long,Long> customerMap = new HashMap<>();
Map<Long,String> practitionerIdMobileNoMap = new HashMap<>();
......
......@@ -297,7 +297,7 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
Date weekOne = cal2.getTime();
// 获取团队成员或被辅导人的practitionerId
List<Long> practitionerIdList = practitionerService.getPractitionerIdList(practitionerId);
List<Long> practitionerIdList = practitionerService.getPractitionerIdList(practitionerId,null);
// 根据团队长经纪人id查询团队每个成员本日,本周,本月得分以及---线上本月FYC
List<PersonalPEPScore> saleAndRecuit = scheduleTrackMapper.querySaleRecuitScoreFYC(practitionerIdList);
......
......@@ -67,7 +67,7 @@ public interface AclPractitionerMapper {
int isTeamLeader(Long practitionerId);
List<Long> queryTeamAllPractitionerId(Long practitionerId);
List<Long> queryTeamAllPractitionerId(@Param("practitionerId")Long practitionerId,@Param("isActive")Integer isActive);
List<Long> queryMentoredByPractitionerId(Long practitionerId);
......@@ -76,4 +76,6 @@ public interface AclPractitionerMapper {
AclPractitioner selectByMobileNo(String mobileNo);
List<TeamMemberDetail> queryTeamMemberDetailList(List<Long> practitionerIdList);
List<String> findLeaveOfficeByPractitionerId(Long practitionerId);
}
\ No newline at end of file
......@@ -179,7 +179,7 @@ public interface AclPractitionerDALService {
int isTeamLeader(Long practitionerId);
List<Long> queryTeamAllPractitionerId(Long practitionerId);
List<Long> queryTeamAllPractitionerId(Long practitionerId,Integer isActive);
List<Long> queryMentoredByPractitionerId(Long practitionerId);
......@@ -188,4 +188,6 @@ public interface AclPractitionerDALService {
PractitionerInfo findPractitionerInfoByPractitionerId(Long practitionerId);
List<TeamMemberDetail> queryTeamMemberDetailList(List<Long> practitionerIdList);
List<String> findLeaveOfficeByPractitionerId(Long practitionerId);
}
......@@ -19,6 +19,7 @@ import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Service("aclPractitionerDALService")
public class AclPractitionerDALServiceImpl implements AclPractitionerDALService {
......@@ -173,8 +174,8 @@ public class AclPractitionerDALServiceImpl implements AclPractitionerDALService
}
@Override
public List<Long> queryTeamAllPractitionerId(Long practitionerId) {
return aclPractitionerMapper.queryTeamAllPractitionerId(practitionerId);
public List<Long> queryTeamAllPractitionerId(Long practitionerId,Integer isActive) {
return aclPractitionerMapper.queryTeamAllPractitionerId(practitionerId, isActive);
}
@Override
......@@ -196,4 +197,13 @@ public class AclPractitionerDALServiceImpl implements AclPractitionerDALService
public List<TeamMemberDetail> queryTeamMemberDetailList(List<Long> practitionerIdList) {
return aclPractitionerMapper.queryTeamMemberDetailList(practitionerIdList);
}
@Override
public List<String> findLeaveOfficeByPractitionerId(Long practitionerId) {
DESTypeHandler jpaCryptoConverter = new DESTypeHandler();
List<String> mobileNos = aclPractitionerMapper.findLeaveOfficeByPractitionerId(practitionerId);
List<String> mobileNoList = new ArrayList<>(mobileNos.size());
mobileNos.forEach(m -> mobileNoList.add(jpaCryptoConverter.decode(m)));
return mobileNoList;
}
}
......@@ -1607,6 +1607,10 @@
SELECT id from ag_acl_practitioner
where subordinate_system_id =
(select subordinate_system_id from ag_acl_practitioner where id = #{practitionerId,jdbcType=BIGINT})
<if test="isActive != null">
and is_active = #{isActive,jdbcType=INTEGER}
</if>
</select>
<select id="findPractitionerInfoByPractitionerId" resultMap="practitioner_info_map">
......@@ -1700,4 +1704,7 @@
left join (select * from ag_md_code where code_type = 'EducationLevel') c on p.education_level = c.code_code
</select>
<select id="findLeaveOfficeByPractitionerId" resultType="string">
select mobile_no from ag_acl_practitioner where is_active = 0 and subordinate_system_id = #{practitionerId,jdbcType=BIGINT}
</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