Commit fd8c3139 by wenyang Committed by akexiu

1.团队成员活动量得分排序【 1:天;2:周;3:月(不传默认2:周)】

2.团队业绩完成率统计根据该团队下经纪人设置的目标fyc计算
parent d96d648b
......@@ -3019,20 +3019,36 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
List<SubordinateSystemMemberInfo> memberInfoList = new ArrayList<>(memberInfoMap.values());
memberInfoList.sort(Comparator.comparingDouble(SubordinateSystemMemberInfo::getFyp));
Collections.reverse(memberInfoList);
Double targetFyc = 0D;//目标FYP
Double targetFyp = 0D;//目标FYC,目标件数
Integer targetCount = 0;//目标件数
for (SubordinateSystemMemberInfo item : memberInfoList) {
fypSum += item.getFyp();
fycSum += item.getFyc();
countSum += item.getCount();
targetFyc += item.getTargetFyc();
targetFyp += item.getTargetFyp();
targetCount += item.getTargetCount();
}
statisticInfo.setCount(countSum);
statisticInfo.setFyc(CommonUtil.doubleFormat(fycSum, 2));
statisticInfo.setFyp(CommonUtil.doubleFormat(fypSum, 2));
statisticInfo.setTargetFyc(CommonUtil.doubleFormat(targetFyc, 2));
statisticInfo.setTargetFyp(CommonUtil.doubleFormat(targetFyp, 2));
statisticInfo.setTargetCount(targetCount);
if (targetFyc != null && targetFyc > 0) {
BigDecimal fycBigDecimal = new BigDecimal(fycSum), goalsBigDecimal = new BigDecimal(targetFyc);
statisticInfo.setCompletionRate(CommonUtil.doubleFormat(fycBigDecimal.divide(goalsBigDecimal, 4, BigDecimal.ROUND_HALF_UP).doubleValue() * 100, 2));
}else{
statisticInfo.setCompletionRate(0D);
}
// 查看经纪人所在的体系
AclPractitionerSubordinateSystem subordinateSystem = aclPractitionerSubordinateSystemDALService.findByPractitionerId(practitionerId);
if (subordinateSystem != null) {
Long subordinateSystemId = subordinateSystem.getId();
getCompletionRate(statisticInfo,null, subordinateSystemId, fycSum, time);
// getCompletionRate(statisticInfo,null, subordinateSystemId, fycSum, time);
responseVO.setId(subordinateSystemId);
responseVO.setSubordinateSystemName(subordinateSystem.getName());
responseVO.setContactName(subordinateSystem.getContactName());
......
......@@ -348,6 +348,32 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
// 计算团队平均分
Map<String, Object> average = this.computeTeamAverageScore(saleAndRecuit, practitionerIdList.size());
//根据sortType排序显示【1:天;2:周;3:月(默认为2:周)】
Collections.sort(saleAndRecuit, new Comparator<PersonalPEPScore>() {
@Override
public int compare(PersonalPEPScore o1, PersonalPEPScore o2) {
if("1".equals(requestVO.getSortType())){
if (o1 != null && o2 != null) {
return o1.getDayScore().compareTo(o2.getDayScore());
} else {
return o1 == null ? 1 : -1;
}
}else if("3".equals(requestVO.getSortType())){
if (o1 != null && o2 != null) {
return o1.getMonthScore().compareTo(o2.getMonthScore());
} else {
return o1 == null ? 1 : -1;
}
}else{
if (o1 != null && o2 != null) {
return o1.getWeekScore().compareTo(o2.getWeekScore());
} else {
return o1 == null ? 1 : -1;
}
}
}
});
resp.setPersonalList(saleAndRecuit);
resp.setAverage(average);
for (PersonalPEPScore s: saleAndRecuit) {
......
......@@ -2,6 +2,7 @@ package com.yd.api.practitioner.vo.sechedule;
public class QueryPEPScoreRequestVO {
private Long practitionerId;
private String sortType;//1:天;2:周;3:月(默认为2:周)
public Long getPractitionerId() {
return practitionerId;
......@@ -10,4 +11,13 @@ public class QueryPEPScoreRequestVO {
public void setPractitionerId(Long practitionerId) {
this.practitionerId = practitionerId;
}
public String getSortType() {
return sortType;
}
public void setSortType(String sortType) {
this.sortType = sortType;
}
}
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