|
@@ -91,6 +91,14 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
|
|
|
String month = "";
|
|
|
//获取单位配置规则
|
|
|
List<String> evaluationRuleIds = Arrays.asList(evaluationRuleId.split(","));
|
|
|
+
|
|
|
+ //获取所有当前考评配置所有权重单位
|
|
|
+ List<OrganizationEvaluationRule> ruleListall = organizationEvaluationRuleService.getOrganizationEvaluationRuleByIds(evaluationRuleIds, "");
|
|
|
+
|
|
|
+ //按照组织id 分组
|
|
|
+ Map<String, OrganizationEvaluationRule> ruleMap = ruleListall.stream()
|
|
|
+ .collect(Collectors.toMap(OrganizationEvaluationRule::getOrganizationId, rule -> rule));
|
|
|
+
|
|
|
for (BinSection bi : sections) {
|
|
|
|
|
|
|
|
@@ -108,9 +116,10 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
|
|
|
reportName.append("季度-");
|
|
|
evaluateReport.setMonth(evaluation.getMonth());
|
|
|
if("XNYFG".equals(bi.getSectionCode()) || "ZHZC".equals(bi.getSectionCode())||
|
|
|
- "GCGS".equals(bi.getSectionCode()) || "TJGS".equals(bi.getSectionCode())||
|
|
|
- "QQ".equals(bi.getSectionCode()) || "JJ".equals(bi.getSectionCode())||
|
|
|
+ "GCGS".equals(bi.getSectionCode()) || "TJGS".equals(bi.getSectionCode())|
|
|
|
"GD".equals(bi.getSectionCode())){
|
|
|
+
|
|
|
+// "QQ".equals(bi.getSectionCode()) || "JJ".equals(bi.getSectionCode())||
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@@ -186,13 +195,28 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
|
|
|
|
|
|
|
|
|
//获取当前模块得公司
|
|
|
- List<OrganizationEvaluationRule> ruleList = organizationEvaluationRuleService.getOrganizationEvaluationRuleByIds(evaluationRuleIds, bi.getId());
|
|
|
+// List<OrganizationEvaluationRule> ruleList = organizationEvaluationRuleService.getOrganizationEvaluationRuleByIds(evaluationRuleIds, bi.getId());
|
|
|
+ List<OrganizationEvaluationRule> ruleList = ruleListall.stream()
|
|
|
+ .filter(rule -> rule.getBinSection().equals(bi.getId())).collect(Collectors.toList());
|
|
|
+
|
|
|
//各板块明细存储
|
|
|
List<EvaluateReportInfo> evaluateRuleInfoList = new ArrayList<>();
|
|
|
- for (OrganizationEvaluationRule rule : ruleList) {
|
|
|
|
|
|
|
|
|
|
|
|
+ for (OrganizationEvaluationRule rule : ruleList) {
|
|
|
+
|
|
|
+// if(!("JJ".equals(bi.getSectionCode()) && "QQ".equals(bi.getSectionCode())) && rule.getScjyWeight()<= 0){
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+// if("JJ".equals(bi.getSectionCode()) && rule.getJjWeight()<= 0){
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+//
|
|
|
+// if("QQ".equals(bi.getSectionCode()) && rule.getQqWeight()<= 0){
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+
|
|
|
StringBuilder remark = new StringBuilder();
|
|
|
//生产95%基建5%前期0%
|
|
|
if (rule.getScjyWeight() > 0) {
|
|
@@ -207,6 +231,17 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
|
|
|
|
|
|
|
|
|
|
|
|
+ //判断多块牌子 是否在该序列加权平均
|
|
|
+ List<MultipleBrand> dkpz = multipleBrandService.getMultipleBranList2(rule.getOrganizationId(), "", bi.getId(), evaluation.getCheckCycle(), evaluation.getYear(), month);
|
|
|
+ List<MultipleBrand> filteredList = dkpz.stream()
|
|
|
+ .filter(multipleBrand -> !"0".equals(multipleBrand.getParentId()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if(null != filteredList && filteredList.size()>0){
|
|
|
+ //该单位在其它序列中 参与加权平均计算;跳过
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
//存储多块牌子数据
|
|
|
List<MultipleBrand> brands = multipleBrandService.getMultipleBranList2(rule.getOrganizationId(), "0", bi.getId(), evaluation.getCheckCycle(), evaluation.getYear(), month);
|
|
@@ -215,20 +250,25 @@ public class EvaluateReportServiceImpl extends ServiceImpl<EvaluateReportMapper,
|
|
|
Double spMultiply = 0.00;//收入
|
|
|
Double scjyScore = 0.0;//分数
|
|
|
if (null != brands && brands.size() > 0) {
|
|
|
- for (MultipleBrand mb : brands) {
|
|
|
+ MultipleBrand mb = brands.get(0);
|
|
|
+ //累加收入
|
|
|
+ totalProfit = totalProfit + mb.getProfit();
|
|
|
+ //累加收入和分数的积
|
|
|
+
|
|
|
+ List<EvaluationScoreCount> scoreCount1 = evaluationScoreCountService.getEvaluationScoreCountList(organizationEvaluationId, rule.getId(), null, Arrays.asList("SCJY".split(",")));
|
|
|
+ double score1 = scoreCount1.stream().mapToDouble(EvaluationScoreCount::getScore).sum();
|
|
|
+ spMultiply = spMultiply + mb.getProfit() * score1;
|
|
|
+
|
|
|
+ List<MultipleBrand> parentBrands = multipleBrandService.getMultipleBranList2("", mb.getOrganizationId(), bi.getId(), evaluation.getCheckCycle(), evaluation.getYear(), month);
|
|
|
+ for (MultipleBrand pb : parentBrands) {
|
|
|
//累加收入
|
|
|
- totalProfit = totalProfit + mb.getProfit();
|
|
|
- //累加收入和分数的积
|
|
|
- spMultiply = spMultiply + mb.getProfit() * mb.getScore();
|
|
|
-
|
|
|
- List<MultipleBrand> parentBrands = multipleBrandService.getMultipleBranList2("", mb.getOrganizationId(), bi.getId(), evaluation.getCheckCycle(), evaluation.getYear(), month);
|
|
|
- for (MultipleBrand pb : parentBrands) {
|
|
|
- //累加收入
|
|
|
- totalProfit = totalProfit + pb.getProfit();
|
|
|
- spMultiply = spMultiply + mb.getProfit() * mb.getScore();
|
|
|
- }
|
|
|
+ totalProfit = totalProfit + pb.getProfit();
|
|
|
|
|
|
+ List<EvaluationScoreCount> scoreCount2 = evaluationScoreCountService.getEvaluationScoreCountList(organizationEvaluationId, ruleMap.get(pb.getOrganizationId()).getId(), null, Arrays.asList("SCJY".split(",")));
|
|
|
+ double score2 = scoreCount2.stream().mapToDouble(EvaluationScoreCount::getScore).sum();
|
|
|
+ spMultiply = spMultiply + mb.getProfit() * score2;
|
|
|
}
|
|
|
+
|
|
|
scjyScore = spMultiply / totalProfit;
|
|
|
}
|
|
|
|