Commit bb182e2e by jianan

agms团队寿险数据问题7

parent bd397644
...@@ -134,16 +134,7 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService { ...@@ -134,16 +134,7 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService {
// 1.根据Agent_id当前经纪人的佣金明细 // 1.根据Agent_id当前经纪人的佣金明细
List<Achieve> achieveList = this.queryN22(category, type, time); List<Achieve> achieveList = this.queryN22(category, type, time);
// 2.筛选结果集 // 2.组装返回报文
if ("life".equals(category)) {
if ("t".equals(type)) {
achieveList = achieveList.stream()
.filter((Achieve i) -> "寿险团队".equals(i.getRolegrouptype()))
.collect(Collectors.toList());
}
}
// 3.组装返回报文
List<StatisticsSalesInfo> infoList = new ArrayList<>(); List<StatisticsSalesInfo> infoList = new ArrayList<>();
StatisticsSalesInfo info = null; StatisticsSalesInfo info = null;
for (Achieve achieve : achieveList) { for (Achieve achieve : achieveList) {
...@@ -151,15 +142,15 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService { ...@@ -151,15 +142,15 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService {
info = new StatisticsSalesInfo(); info = new StatisticsSalesInfo();
info.setPieces(achieve.getSucNumber()); info.setPieces(achieve.getSucNumber());
info.setFyp(Double.toString(achieve.getFYP())); info.setFyp(Double.toString(achieve.getFYP()));
info.setFyc(Double.toString(achieve.getFYC())); info.setFyc(achieve.getFYC());
info.setTypeName(achieve.getDescription()); info.setTypeName(achieve.getDescription());
infoList.add(info); infoList.add(info);
} }
// 4.计算件均保费 // 3.计算件均保费
agmsDashboardDALService.getUnitPremium(infoList); agmsDashboardDALService.getUnitPremium(infoList);
// 5.排序 // 4.排序
infoList.sort(Comparator.comparing(StatisticsSalesInfo::getFyc).reversed()); infoList.sort(Comparator.comparing(StatisticsSalesInfo::getFyc).reversed());
return infoList; return infoList;
...@@ -295,7 +286,7 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService { ...@@ -295,7 +286,7 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService {
StatisticsSalesInfo statisticsSalesInfo = new StatisticsSalesInfo(); StatisticsSalesInfo statisticsSalesInfo = new StatisticsSalesInfo();
List<StatisticsSalesInfo> statisticsSalesInfos = new ArrayList<>(); List<StatisticsSalesInfo> statisticsSalesInfos = new ArrayList<>();
String unitPremium = "0"; String unitPremium = "0";
double fyp = 0D,fyc = 0D; Double fyp = 0D,fyc = 0D;
Integer pieces = 0; Integer pieces = 0;
// List<StatisticsSalesInfo> statisticsSalesInfosLife = agmsDashboardDALService.statisticsSalesEG(type,time); // List<StatisticsSalesInfo> statisticsSalesInfosLife = agmsDashboardDALService.statisticsSalesEG(type,time);
...@@ -307,14 +298,14 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService { ...@@ -307,14 +298,14 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService {
if(statisticsSalesInfosLife.size() > 0){ if(statisticsSalesInfosLife.size() > 0){
for(StatisticsSalesInfo item : statisticsSalesInfosLife){ for(StatisticsSalesInfo item : statisticsSalesInfosLife){
fyp += Double.parseDouble(item.getFyp()); fyp += Double.parseDouble(item.getFyp());
fyc += Double.parseDouble(item.getFyc()); fyc += item.getFyc();
pieces += item.getPieces(); pieces += item.getPieces();
} }
if(pieces != 0){ if(pieces != 0){
unitPremium = BigDecimal.valueOf(fyp / pieces).setScale(2,BigDecimal.ROUND_HALF_UP).toString(); unitPremium = BigDecimal.valueOf(fyp / pieces).setScale(2,BigDecimal.ROUND_HALF_UP).toString();
} }
} }
statisticsSalesInfo.setFyc(new DecimalFormat("0.00").format(fyc)); statisticsSalesInfo.setFyc(Double.parseDouble(new DecimalFormat("0.00").format(fyc)));
statisticsSalesInfo.setFyp(new DecimalFormat("0.00").format(fyp)); statisticsSalesInfo.setFyp(new DecimalFormat("0.00").format(fyp));
statisticsSalesInfo.setPieces(pieces); statisticsSalesInfo.setPieces(pieces);
statisticsSalesInfo.setUnitPremium(unitPremium); statisticsSalesInfo.setUnitPremium(unitPremium);
......
...@@ -4,7 +4,7 @@ public class StatisticsSalesInfo { ...@@ -4,7 +4,7 @@ public class StatisticsSalesInfo {
private String typeName; private String typeName;
private Long typeId; private Long typeId;
private String fyp; private String fyp;
private String fyc; private Double fyc;
private Double api; private Double api;
private Integer pieces; private Integer pieces;
private String unitPremium; private String unitPremium;
...@@ -33,11 +33,11 @@ public class StatisticsSalesInfo { ...@@ -33,11 +33,11 @@ public class StatisticsSalesInfo {
this.fyp = fyp; this.fyp = fyp;
} }
public String getFyc() { public Double getFyc() {
return fyc; return fyc;
} }
public void setFyc(String fyc) { public void setFyc(Double fyc) {
this.fyc = fyc; this.fyc = fyc;
} }
......
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