Commit cfdf377b by wenyang Committed by akexiu

赢家平台-团队业绩排名排序【1:FYP;2:FYC;3:目标FYC(不传默认2:FYC)】,排名列表增加完成率

parent 12979c11
...@@ -3022,9 +3022,17 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -3022,9 +3022,17 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
memberInfoMap.remove(m); memberInfoMap.remove(m);
} }
} }
//查询出来的结果按照fyp进行排序 //查询出来的结果按照【sortType 排序类型(1:FYP;2:FYC;3:件数;4:目标FYC,不传默认1:FYP)】进行排序
List<SubordinateSystemMemberInfo> memberInfoList = new ArrayList<>(memberInfoMap.values()); List<SubordinateSystemMemberInfo> memberInfoList = new ArrayList<>(memberInfoMap.values());
memberInfoList.sort(Comparator.comparingDouble(SubordinateSystemMemberInfo::getFyp)); if("2".equals(requestVO.getSortType())){
memberInfoList.sort(Comparator.comparingDouble(SubordinateSystemMemberInfo::getFyc));
}else if("3".equals(requestVO.getSortType())){
memberInfoList.sort(Comparator.comparingDouble(SubordinateSystemMemberInfo::getCount));
}else if("4".equals(requestVO.getSortType())){
memberInfoList.sort(Comparator.comparingDouble(SubordinateSystemMemberInfo::getTargetFyc));
}else{
memberInfoList.sort(Comparator.comparingDouble(SubordinateSystemMemberInfo::getFyp));
}
Collections.reverse(memberInfoList); Collections.reverse(memberInfoList);
Double targetFyc = 0D;//目标FYP Double targetFyc = 0D;//目标FYP
...@@ -3411,6 +3419,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -3411,6 +3419,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
memberInfo.setTargetFyc(CommonUtil.doubleFormat(targetFyc, 2)); memberInfo.setTargetFyc(CommonUtil.doubleFormat(targetFyc, 2));
memberInfo.setTargetFyp(CommonUtil.doubleFormat(targetFyp, 2)); memberInfo.setTargetFyp(CommonUtil.doubleFormat(targetFyp, 2));
memberInfo.setTargetCount(targetCount); memberInfo.setTargetCount(targetCount);
if (targetFyc > 0) {
BigDecimal fycBigDecimal = new BigDecimal(fyc), goalsBigDecimal = new BigDecimal(targetFyc);
memberInfo.setCompletionRate(CommonUtil.doubleFormat(fycBigDecimal.divide(goalsBigDecimal, 4, BigDecimal.ROUND_HALF_UP).doubleValue() * 100, 2));
}else{
memberInfo.setCompletionRate(0D);
}
memberInfoMap.put(practitionerIdMobileNoMap.get(practitionerIdForMember), memberInfo); memberInfoMap.put(practitionerIdMobileNoMap.get(practitionerIdForMember), memberInfo);
} }
} }
......
...@@ -8,9 +8,10 @@ public class SubordinateSystemMemberInfo { ...@@ -8,9 +8,10 @@ public class SubordinateSystemMemberInfo {
private Double fyp; private Double fyp;
private Double fyc; private Double fyc;
private Integer count; private Integer count;
private Double targetFyc; //目标FYP private Double targetFyc; //目标FYC
private Double targetFyp; //目标FYC private Double targetFyp; //目标FYP
private Integer targetCount;//目标件数 private Integer targetCount;//目标件数
private Double completionRate;//完成率
public Long getPractitionerId() { public Long getPractitionerId() {
return practitionerId; return practitionerId;
...@@ -91,5 +92,13 @@ public class SubordinateSystemMemberInfo { ...@@ -91,5 +92,13 @@ public class SubordinateSystemMemberInfo {
public void setTargetCount(Integer targetCount) { public void setTargetCount(Integer targetCount) {
this.targetCount = targetCount; this.targetCount = targetCount;
} }
public Double getCompletionRate() {
return completionRate;
}
public void setCompletionRate(Double completionRate) {
this.completionRate = completionRate;
}
} }
...@@ -4,7 +4,7 @@ public class SubordinateSystemMemberQueryRequestVO { ...@@ -4,7 +4,7 @@ public class SubordinateSystemMemberQueryRequestVO {
private Long practitionerId; private Long practitionerId;
private Integer time;//1=month,3=quarter,2=year,4=去年 private Integer time;//1=month,3=quarter,2=year,4=去年
private Integer type;//1=online,2=offLine private Integer type;//1=online,2=offLine
private String sortType;//排序类型(1:FYP;2:FYC;3:件数;4:目标FYC,不传默认1:FYP)
public Long getPractitionerId() { public Long getPractitionerId() {
return practitionerId; return practitionerId;
...@@ -29,4 +29,13 @@ public class SubordinateSystemMemberQueryRequestVO { ...@@ -29,4 +29,13 @@ public class SubordinateSystemMemberQueryRequestVO {
public void setType(Integer type) { public void setType(Integer type) {
this.type = type; this.type = type;
} }
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