Commit c7a7367f by zhangkb

修改对标计算逻辑以及计算单位得分逻辑

parent 79fd08f9
...@@ -96,6 +96,17 @@ public class CompareUnitCalActor extends AbstractActor{ ...@@ -96,6 +96,17 @@ public class CompareUnitCalActor extends AbstractActor{
()->new DriveIndIdCalActor(getSelf()))); ()->new DriveIndIdCalActor(getSelf())));
driveIndIdCalActor.tell(driveIndIdCalMsg, getSelf()); driveIndIdCalActor.tell(driveIndIdCalMsg, getSelf());
} }
}else {
//如果是先执行且没有平均分参考对象
if("1".equals(firstExe) && StringUtils.isBlank(averageObj)) {
//发送确认信息给父actor
FirstExeConfirmMsg confirmMsg = new FirstExeConfirmMsg(1,"");
startCompareUnitCalActor.tell(confirmMsg, ActorRef.noSender());
}else {
//发送后执行的确认消息给父actor
AfterExeConfirmMsg afterConfirmMsg = new AfterExeConfirmMsg(1,"");
startCompareUnitCalActor.tell(afterConfirmMsg, ActorRef.noSender());
}
} }
}) })
.match(FirstExeConfirmMsg.class, firstExeConfirmMsg -> { .match(FirstExeConfirmMsg.class, firstExeConfirmMsg -> {
......
...@@ -359,30 +359,32 @@ public class ScoreRuleService { ...@@ -359,30 +359,32 @@ public class ScoreRuleService {
ScoreRule scoreRule = this.getById(scoreRuleId); ScoreRule scoreRule = this.getById(scoreRuleId);
List<ObjScoreCalResult> datas = new ArrayList<>(); List<ObjScoreCalResult> datas = new ArrayList<>();
if(scoreRule!=null) { if(scoreRule!=null) {
for(String compareObj : compareObjs) { if(!indIds.isEmpty() && !compareObjs.isEmpty()) {
//判断库表是否已存在改结果数据 for(String compareObj : compareObjs) {
ObjScoreCalResult objScoreCalResult = objScoreCalResultMapper. //判断库表是否已存在改结果数据
getObjScoreCalResultByParam(compareId, compareObj, date); ObjScoreCalResult objScoreCalResult = objScoreCalResultMapper.
if(objScoreCalResult == null) { getObjScoreCalResultByParam(compareId, compareObj, date);
objScoreCalResult = new ObjScoreCalResult(); if(objScoreCalResult == null) {
} objScoreCalResult = new ObjScoreCalResult();
//计算类型:0 计算组内所有考核指标平均数 }
if("0".equals(scoreRule.getCalType())) { //计算类型:0 计算组内所有考核指标平均数
objScoreCalResult = this.calGroupIndAverage(objScoreCalResult, scoreRule, if("0".equals(scoreRule.getCalType())) {
indIds, compareObj, date); objScoreCalResult = this.calGroupIndAverage(objScoreCalResult, scoreRule,
}else if("1".equals(scoreRule.getCalType())) {//1 根据目录类别分类算平均分后根据权重计算考核指标 indIds, compareObj, date);
objScoreCalResult = this.calIndCatalogTypeAverage(objScoreCalResult, scoreRule, }else if("1".equals(scoreRule.getCalType())) {//1 根据目录类别分类算平均分后根据权重计算考核指标
compareObj, date); objScoreCalResult = this.calIndCatalogTypeAverage(objScoreCalResult, scoreRule,
}else {//2单个指标权重计算 compareObj, date);
objScoreCalResult = this.calSingleIndWeight(objScoreCalResult ,scoreRule, }else {//2单个指标权重计算
compareObj, date); objScoreCalResult = this.calSingleIndWeight(objScoreCalResult ,scoreRule,
compareObj, date);
}
objScoreCalResult.setCompareId(compareId);
datas.add(objScoreCalResult);
} }
objScoreCalResult.setCompareId(compareId); //批量新增或修改
this.batchSaveOrUpdateObjScoreCalResult(datas);
datas.add(objScoreCalResult);
} }
//批量新增或修改
this.batchSaveOrUpdateObjScoreCalResult(datas);
}else { }else {
logger.info("单位评分卡id:"+scoreRuleId+" 不存在"); logger.info("单位评分卡id:"+scoreRuleId+" 不存在");
} }
......
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