Commit 9884aa47 by zhangkb

修改对标计算逻辑

parent 728dc489
...@@ -96,30 +96,34 @@ public class DriveIndIdObjCalActor extends AbstractActor{ ...@@ -96,30 +96,34 @@ public class DriveIndIdObjCalActor extends AbstractActor{
List<String> indIdList = new ArrayList<>();//定义存储从考核指标公式解析出来的基础指标id List<String> indIdList = new ArrayList<>();//定义存储从考核指标公式解析出来的基础指标id
DriveIndDef driveIndDef = driveIndDefService.getById(driveIndId); DriveIndDef driveIndDef = driveIndDefService.getById(driveIndId);
unit = driveIndDef.getIndUnit();//指标单位 if(driveIndDef==null) {
indType = driveIndDef.getIndRule();//指标类型:正向 反向 logger.info("DriveIndDef:"+driveIndId+" is not exist.");
scoreCardId = driveIndDef.getIndCalScoreRule();//指标评分规则 }else {
code = driveIndDef.getCode(); unit = driveIndDef.getIndUnit();//指标单位
indType = driveIndDef.getIndRule();//指标类型:正向 反向
//获取考核指标的公式 scoreCardId = driveIndDef.getIndCalScoreRule();//指标评分规则
driveIndFormula = driveIndDef.getIndFormat(); code = driveIndDef.getCode();
averageDriveIndFormula = driveIndDef.getIndFormat();//定义用于返回父actor算平均分用的公式
//获取考核指标的公式
Pattern p = Pattern.compile("(\\[[^\\]]*\\])"); driveIndFormula = driveIndDef.getIndFormat();
Matcher m = p.matcher(driveIndFormula); averageDriveIndFormula = driveIndDef.getIndFormat();//定义用于返回父actor算平均分用的公式
while(m.find()){
indIdList.add(m.group().substring(1, m.group().length()-1)); Pattern p = Pattern.compile("(\\[[^\\]]*\\])");
} Matcher m = p.matcher(driveIndFormula);
//获取公式中的基础指标id while(m.find()){
indIdSize =indIdList.size(); indIdList.add(m.group().substring(1, m.group().length()-1));
if(!indIdList.isEmpty()) { }
for(String indId : indIdList) { //获取公式中的基础指标id
GetBaseIndValueMsg getBaseIndValueMsg = new GetBaseIndValueMsg( indIdSize =indIdList.size();
indId,driveIndIdObjCalMsg.getDimValues()); if(!indIdList.isEmpty()) {
ActorRef getBaseIndValueActor = this.getContext() for(String indId : indIdList) {
.actorOf(Props.create(GetBaseIndValueActor.class, GetBaseIndValueMsg getBaseIndValueMsg = new GetBaseIndValueMsg(
()->new GetBaseIndValueActor())); indId,driveIndIdObjCalMsg.getDimValues());
getBaseIndValueActor.tell(getBaseIndValueMsg, getSelf()); ActorRef getBaseIndValueActor = this.getContext()
.actorOf(Props.create(GetBaseIndValueActor.class,
()->new GetBaseIndValueActor()));
getBaseIndValueActor.tell(getBaseIndValueMsg, getSelf());
}
} }
} }
}) })
......
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