Commit 9884aa47 by zhangkb

修改对标计算逻辑

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