Commit 68660333 by zhangkb

对标基础项和指标考核结果添加本期对标年月字段并修改对标运算逻辑代码提交

parent 7ee4b2f4
......@@ -187,13 +187,13 @@
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!--离线文档-->
<dependency>
<!--离线文档-->
<!-- <dependency>
<groupId>io.github.swagger2markup</groupId>
<artifactId>swagger2markup</artifactId>
<version>1.3.1</version>
</dependency>
</dependency> -->
</dependencies>
<dependencyManagement>
<dependencies>
......
......@@ -6,7 +6,6 @@ import com.keymobile.indicators.constant.Constants;
import com.keymobile.indicators.model.entity.indicators.CompareUnitCalLog;
import com.keymobile.indicators.service.hytobacco.CompareUnitCalLogService;
import com.keymobile.indicators.utils.LogManager;
import com.netflix.discovery.converters.jackson.EurekaXmlJacksonCodec;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -60,6 +59,7 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
isTest = beforeCompareUnitCalMsg.getIsTest();
compCalLogId = beforeCompareUnitCalMsg.getCompCalLogId();
path = beforeCompareUnitCalMsg.getPath();
currentDate = beforeCompareUnitCalMsg.getDateMark();//dateMark记录本期对标时间
if("0".equals(isTest)) {
logger.info("进行date:"+sameDate+" 的对标单元试运行计算.....日志id:"+compCalLogId);
}else {
......@@ -68,7 +68,7 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
//计算同期对标单元
StartCompareUnitCalMsg startCompareUnitCalMsg = new StartCompareUnitCalMsg(
compareUnitDefs,beforeCompareUnitCalMsg.getCode(),
beforeCompareUnitCalMsg.getIsTest());
beforeCompareUnitCalMsg.getIsTest(),currentDate);
//加入点击运算的用户
startCompareUnitCalMsg.setUser(beforeCompareUnitCalMsg.getUser());
......@@ -85,21 +85,19 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
if(numberOfConfirm==1) {
//执行本期对标单元计算
for(CompareUnitDef unitDef : sameCompareUnitDef) {
Integer date = unitDef.getDate()+100;//修改对标时间为本期
unitDef.setDate(date);
//修改对标时间为本期
unitDef.setDate(currentDate);
currentCompareUnitDef.add(unitDef);
}
if(!currentCompareUnitDef.isEmpty()) {
currentDate = currentCompareUnitDef.get(0).getDate();
if("0".equals(isTest)) {
logger.info("进行date:"+currentDate+" 的对标单元试运行计算.....");
}else {
logger.info("进行date:"+currentDate+" 的对标单元计算.....");
}
//计算期对标单元
//计算期对标单元
StartCompareUnitCalMsg startCompareUnitCalMsg = new StartCompareUnitCalMsg(
currentCompareUnitDef,code,isTest);
currentCompareUnitDef,code,isTest,currentDate);
startCompareUnitCalMsg.setCompCalLogId(compCalLogId);
//设置对标单元目录
startCompareUnitCalMsg.setPath(path);
......@@ -127,12 +125,13 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
indicatorsReportService.dealReportOne(path,
unitDef.getCompareId(), Arrays.asList(unitDef.getIndIds().split(",")),
Arrays.asList(unitDef.getCompareObjs().split(",")),
unitDef.getDate(), code);
unitDef.getDate(), code, currentDate);
//整合考核指标报表数据2
indicatorsReportService.dealDriveIndReportTwoData(path,
unitDef.getCompareId(), Arrays.asList(unitDef.getIndIds().split(",")),
Arrays.asList(unitDef.getCompareObjs().split(",")), unitDef.getDate(),code);
Arrays.asList(unitDef.getCompareObjs().split(",")),
unitDef.getDate(),code, currentDate);
}
}
......@@ -140,7 +139,8 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
logger.info("进行date:"+currentDate+" 基础项本期同期报表数据整合");
if(!compareObjMap.isEmpty()) {
List<String> compareObjs = new ArrayList<String>(compareObjMap.keySet());
indicatorsReportService.dealBaseIndReportOneData(currentDate, compareObjs, code);
indicatorsReportService.dealBaseIndReportOneData(currentDate, compareObjs,
code, currentDate);
}
//整合考核指标报表数据3,和报表四
......@@ -151,7 +151,7 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
for(CompareUnitDef unitDef : currentCompareUnitDef) {
indicatorsReportService.dealDriveIndReportThreeData(path,
unitDef.getCompareId(), Arrays.asList(unitDef.getIndIds().split(",")),
unitDef.getDate(),code);
unitDef.getDate(), code, currentDate);
}
}
......
......@@ -14,9 +14,7 @@ import com.keymobile.indicators.akka.message.indicators.DriveIndIdCalMsg;
import com.keymobile.indicators.akka.message.indicators.FirstExeConfirmMsg;
import com.keymobile.indicators.model.entity.indicators.CompareUnitCalLog;
import com.keymobile.indicators.model.entity.indicators.CompareUnitDef;
import com.keymobile.indicators.model.entity.objscorerule.ScoreRule;
import com.keymobile.indicators.service.hytobacco.CompareUnitCalLogService;
import com.keymobile.indicators.service.hytobacco.ScoreRuleService;
import com.keymobile.indicators.utils.SpringUtil;
import akka.actor.AbstractActor;
......@@ -26,34 +24,22 @@ import akka.actor.Props;
public class CompareUnitCalActor extends AbstractActor{
private Logger logger = LoggerFactory.getLogger(CompareUnitCalActor.class);
private ScoreRuleService scoreRuleServer = SpringUtil.getBean(ScoreRuleService.class);
private CompareUnitCalLogService compareUnitCalLogService = SpringUtil.getBean(CompareUnitCalLogService.class);
private int numberOfConfirm = 0;//定义返回确认消息的子actor
private int indIdSize = 0;//对标指标个数
private String compareId;//对标单元id
private Integer date;
private String firstExe;//是否先执行 0:否 1:是
private String averageObj;//平均分参考对象
private Integer objScoreRuleId;//单位得分规则id
private List<String> indIdsList = new ArrayList<>();//考核指标id list
private List<String> compareObjsList = new ArrayList<>();//考核对象list
private String code;//机构编码
private Integer compCalLogId;
private String isTest;
private String path;//对标单元目录
private final ActorRef startCompareUnitCalActor;//定义父actor
......@@ -73,24 +59,10 @@ public class CompareUnitCalActor extends AbstractActor{
return receiveBuilder()
.match(CompareUnitCalMsg.class,compareUnitCalMsg -> {
CompareUnitDef compareUnitDef = compareUnitCalMsg.getCompareUnitDef();
compareId = compareUnitDef.getCompareId();
date = compareUnitDef.getDate();
firstExe = compareUnitDef.getFirstExe();
averageObj = compareUnitDef.getAverageObj();
objScoreRuleId = compareUnitDef.getObjScoreRuleId();
code = compareUnitCalMsg.getCode();
isTest = compareUnitCalMsg.getIsTest();
compCalLogId = compareUnitCalMsg.getCompCalLogId();
path = compareUnitCalMsg.getPath();
// //新增运行日志记录
// CompareUnitCalLog compCalLog = new CompareUnitCalLog(compareId,date,
// System.currentTimeMillis()+"","0");
// compCalLog.setCreater(compareUnitCalMsg.getUser());
// //1成功
// compCalLog.setStatus(1);
// compCalLog.setType(isTest);
//保存
// Integer compCalLogId = compareUnitCalLogService.saveOrUndate(compCalLog);
//获取对标对象
String compareObjsString = compareUnitDef.getCompareObjs();
......@@ -107,7 +79,7 @@ public class CompareUnitCalActor extends AbstractActor{
DriveIndIdCalMsg driveIndIdCalMsg = new DriveIndIdCalMsg(
compareUnitDef.getCompareId(),indId,compareObjsList,compareUnitDef.getDate(),
firstExe,averageObj,compCalLogId,compareUnitCalMsg.getCode(),
compareUnitCalMsg.getIsTest());
compareUnitCalMsg.getIsTest(),compareUnitCalMsg.getDateMark());
//设置对标单元目录
driveIndIdCalMsg.setPath(path);
//start akka
......@@ -138,30 +110,10 @@ public class CompareUnitCalActor extends AbstractActor{
}
//如果是先执行且没有平均分参考对象
if("1".equals(firstExe) && StringUtils.isBlank(averageObj)) {
// if(compCalLog!=null) {
// compCalLog.setEndTime(System.currentTimeMillis()+"");
// compCalLog.setRunStatus("1");
// compareUnitCalLogService.saveOrUndate(compCalLog);
// }
//发送确认信息给父actor
FirstExeConfirmMsg confirmMsg = new FirstExeConfirmMsg(1,"");
startCompareUnitCalActor.tell(confirmMsg, ActorRef.noSender());
}else {
//计算单位得分(如果是caltype为0的单位评分规则直接计算单位得分)
//if(objScoreRuleId!=null) {
//ScoreRule scoreRule = scoreRuleServer.getById(objScoreRuleId);
//if(scoreRule!=null && "0".equals(scoreRule.getCalType())) {
//scoreRuleServer.calObjScore(compareId, indIdsList, compareObjsList,
//date, scoreRule.getId());
//}
//}
//记录日志
// if(compCalLog!=null) {
// compCalLog.setEndTime(System.currentTimeMillis()+"");
// compCalLog.setRunStatus("1");
// compareUnitCalLogService.saveOrUndate(compCalLog);
// }
//发送后执行的确认消息给父actor
AfterExeConfirmMsg afterConfirmMsg = new AfterExeConfirmMsg(1,"");
startCompareUnitCalActor.tell(afterConfirmMsg, ActorRef.noSender());
......
......@@ -95,7 +95,7 @@ public class DriveIndIdCalActor extends AbstractActor{
path = driveIndIdCalMsg.getPath();
//日志记录id
compCalLogId = driveIndIdCalMsg.getCompCalLogId();
compCalLogId = driveIndIdCalMsg.getCompCalLogId();
for (String compareObj : compareObjs) {
List<DimValue> dimValueList = new ArrayList<>();
......@@ -106,7 +106,8 @@ public class DriveIndIdCalActor extends AbstractActor{
DriveIndIdObjCalMsg driveIndIdObjCalMsg = new DriveIndIdObjCalMsg(compareId,
indId, compareObj, date, dimValueList, compCalLogId,
driveIndIdCalMsg.getCode(), driveIndIdCalMsg.getIsTest());
driveIndIdCalMsg.getCode(), driveIndIdCalMsg.getIsTest(),
driveIndIdCalMsg.getDateMark());
//设置对标单元目录
driveIndIdObjCalMsg.setPath(path);
ActorRef driveIndIdObjCalActor = this.getContext()
......@@ -121,6 +122,7 @@ public class DriveIndIdCalActor extends AbstractActor{
String indType = calIndAverageAndRankMsg.getIndType();//指标类型:正向 反向
Integer scoreCardId = calIndAverageAndRankMsg.getScoreCardId();//评分卡id
Integer compCalLogId = calIndAverageAndRankMsg.getCompCalLogId();//记录日志id
Integer dateMark = calIndAverageAndRankMsg.getDateMark();
//对标单元目录
String compareCatalog = calIndAverageAndRankMsg.getPath();
if (!"-1".equals(id)) {
......@@ -138,31 +140,21 @@ public class DriveIndIdCalActor extends AbstractActor{
String actualAverage = "0.0";//实际平均分
if (StringUtils.isNotBlank(averageObj)) {
if ("0".equals(isTest)) {
// TestDriveIndCalResultDef provinceDriveIndCalResult =
// testDriveIndCalResultService.findCompareObjInfo(
// calIndAverageAndRankMsg.getDriveIndId(),
// calIndAverageAndRankMsg.getDate(),
// averageObj, code);
TestDriveIndCalResultDef provinceDriveIndCalResult =
testDriveIndCalResultService.findCompareObjInfo(
compareCatalog, calIndAverageAndRankMsg.getDriveIndId(),
calIndAverageAndRankMsg.getDate(),
averageObj, code);
averageObj, code, dateMark);
if (provinceDriveIndCalResult != null) {
//获取实际平均分
actualAverage = provinceDriveIndCalResult.getValue();
}
} else {
// DriveIndCalResultDef provinceDriveIndCalResult =
// driveIndCalResultService.findCompareObjInfo(
// calIndAverageAndRankMsg.getDriveIndId(),
// calIndAverageAndRankMsg.getDate(),
// averageObj, code);
DriveIndCalResultDef provinceDriveIndCalResult =
driveIndCalResultService.findCompareObjInfo(
compareCatalog, calIndAverageAndRankMsg.getDriveIndId(),
calIndAverageAndRankMsg.getDate(),
averageObj, code);
averageObj, code, dateMark);
if (provinceDriveIndCalResult != null) {
//获取实际平均分
actualAverage = provinceDriveIndCalResult.getValue();
......@@ -172,7 +164,7 @@ public class DriveIndIdCalActor extends AbstractActor{
//算组内平均数
String average = driveIndDefService.calGroupAverage(
calIndAverageAndRankMsg.getIndFormula(), compareObjs,
calIndAverageAndRankMsg.getDate(), code);
calIndAverageAndRankMsg.getDate(), code, dateMark);
//算组内排名
Map<String, Integer> rankValue = CalculateUtils.rankValue(valueMap, indType);
List<DriveIndCalResultDef> dataList = new ArrayList<>();
......@@ -201,15 +193,12 @@ public class DriveIndIdCalActor extends AbstractActor{
}
}
}
//批量保存修改
if ("0".equals(isTest)) {
//批量保存修改
testDriveIndCalResultService.batchSaveOrUpdate(testDataList);
//批量保存修改
testDataList.clear();
} else {
//批量保存修改
driveIndCalResultService.batchSaveOrUpdate(dataList);
//批量保存修改//批量保存修改
dataList.clear();
}
//根据评分卡算指标分数
......@@ -222,7 +211,7 @@ public class DriveIndIdCalActor extends AbstractActor{
//计算分数
Map<String, String> scoreMap = indScorecardService.calculateIndiScore(compareCatalog,
driveIndCalResult.getCompareId(),driveIndCalResult.getIndId(), driveIndCalResult.getDate(),
driveIndCalResult.getCompareObj(), scoreCardId, compareObjs, code);
driveIndCalResult.getCompareObj(), scoreCardId, compareObjs, code, dateMark);
//填充指标分数和改善提升分数
driveIndCalResult.setScore(scoreMap.get("score"));
driveIndCalResult.setImproveScore(scoreMap.get("improveScore"));
......@@ -236,7 +225,7 @@ public class DriveIndIdCalActor extends AbstractActor{
//计算分数
Map<String, String> scoreMap = indScorecardService.calculateIndiScore(compareCatalog,
driveIndCalResult.getCompareId(),driveIndCalResult.getIndId(), driveIndCalResult.getDate(),
driveIndCalResult.getCompareObj(), scoreCardId, compareObjs, code);
driveIndCalResult.getCompareObj(), scoreCardId, compareObjs, code, dateMark);
//填充指标分数和改善提升分数
driveIndCalResult.setScore(scoreMap.get("score"));
driveIndCalResult.setImproveScore(scoreMap.get("improveScore"));
......
......@@ -33,7 +33,6 @@ import com.keymobile.indicators.utils.SpringUtil;
import akka.actor.AbstractActor;
import akka.actor.ActorRef;
import akka.actor.Props;
import org.springframework.data.redis.core.script.ReactiveScriptExecutor;
public class DriveIndIdObjCalActor extends AbstractActor{
private Logger logger = LoggerFactory.getLogger(DriveIndIdObjCalActor.class);
......@@ -81,6 +80,8 @@ public class DriveIndIdObjCalActor extends AbstractActor{
private String path = null;//对标单元目录
private Integer currentDate = null;//当前对标时间
private final ActorRef driveIndIdCalActor;//定义父actor
static public Props props(ActorRef driveIndIdCalActor) {
......@@ -106,6 +107,7 @@ public class DriveIndIdObjCalActor extends AbstractActor{
code = driveIndIdObjCalMsg.getCode();
isTest = driveIndIdObjCalMsg.getIsTest();
path = driveIndIdObjCalMsg.getPath();
currentDate = driveIndIdObjCalMsg.getDateMark();
List<String> indIdList = new ArrayList<>();//定义存储从考核指标公式解析出来的基础指标id
......@@ -116,7 +118,8 @@ public class DriveIndIdObjCalActor extends AbstractActor{
CalIndAverageAndRankMsg driveIndAverageAndRankMsg =
new CalIndAverageAndRankMsg(-1,
compareId, driveIndId, compareObj, date, "NaN",
unit, indType, scoreCardId, averageDriveIndFormula, compCalLogId,path);
unit, indType, scoreCardId, averageDriveIndFormula,
compCalLogId,path,currentDate);
driveIndIdCalActor.tell(driveIndAverageAndRankMsg, ActorRef.noSender());
} else {
unit = driveIndDef.getIndUnit();//指标单位
......@@ -138,7 +141,7 @@ public class DriveIndIdObjCalActor extends AbstractActor{
for (String indId : indIdList) {
GetBaseIndValueMsg getBaseIndValueMsg = new GetBaseIndValueMsg(
indId, driveIndIdObjCalMsg.getDimValues(),
driveIndIdObjCalMsg.getCode());
driveIndIdObjCalMsg.getCode(),driveIndIdObjCalMsg.getDateMark());
//传入日志id
getBaseIndValueMsg.setCompCalLogId(compCalLogId);
//取根据基础指标id和维度去基础指标表取对应的指标值actor
......@@ -230,27 +233,29 @@ public class DriveIndIdObjCalActor extends AbstractActor{
//findCalResultDataIsExist(compareId, compareObj, driveIndId, date, code);
try {
TestDriveIndCalResultDef driveIndCalResult = testDriveIndCalResultService.
findCalResultDataIsExistByCatalog(path, compareObj, driveIndId, date, code);
findCalResultDataIsExistByCatalog(path, compareObj, driveIndId, date,
code,currentDate);
if (driveIndCalResult == null) {
driveIndCalResult = new TestDriveIndCalResultDef(compareId,
driveIndId, compareObj, date, driveIndValue, unit,
"1", "1", "admin", code, baseIndValueMsg.getCompareObjDesc());
//设置对标单元目录
driveIndCalResult.setCompareCatalog(path);
} else {
driveIndCalResult.setCode(code);
driveIndCalResult.setUnit(unit);
driveIndCalResult.setValue(driveIndValue);
driveIndCalResult.setLastUpdateTime(DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss"));
driveIndCalResult.setCompareCatalog(path);
}
//设置对标单元目录
driveIndCalResult.setCompareCatalog(path);
driveIndCalResult.setDateMark(currentDate);
//保存进考核指标结果表中
testDriveIndCalResultService.saveOrUpdate(driveIndCalResult);
int testCalResultId = testDriveIndCalResultService.saveOrUpdate(driveIndCalResult);
//返回指标值回去算平均值和排名
CalIndAverageAndRankMsg driveIndAverageAndRankMsg =
new CalIndAverageAndRankMsg(driveIndCalResult.getId(),
new CalIndAverageAndRankMsg(testCalResultId,
compareId, driveIndId, compareObj, date, driveIndValue,
unit, indType, scoreCardId, averageDriveIndFormula, compCalLogId,path);
unit, indType, scoreCardId, averageDriveIndFormula,
compCalLogId,path,currentDate);
driveIndIdCalActor.tell(driveIndAverageAndRankMsg, ActorRef.noSender());
} catch (Exception e) {
logger.error("compareCatalog:"+path+";compareObj:"+compareObj+
......@@ -265,27 +270,29 @@ public class DriveIndIdObjCalActor extends AbstractActor{
try {
//根据对标单元目录进行查找
DriveIndCalResultDef driveIndCalResult = driveIndCalResultService.
findCalResultDataIsExistByCatalog(path, compareObj, driveIndId, date, code);
findCalResultDataIsExistByCatalog(path, compareObj, driveIndId,
date, code, currentDate);
if (driveIndCalResult == null) {
driveIndCalResult = new DriveIndCalResultDef(compareId,
driveIndId, compareObj, date, driveIndValue, unit,
"1", "1", "admin", code, baseIndValueMsg.getCompareObjDesc());
//设置对标单元路径
driveIndCalResult.setCompareCatalog(path);
} else {
driveIndCalResult.setCode(code);
driveIndCalResult.setUnit(unit);
driveIndCalResult.setValue(driveIndValue);
driveIndCalResult.setLastUpdateTime(DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss"));
driveIndCalResult.setCompareCatalog(path);
}
//设置对标单元路径
driveIndCalResult.setCompareCatalog(path);
driveIndCalResult.setDateMark(currentDate);
//保存进考核指标结果表中
driveIndCalResultService.saveOrUpdate(driveIndCalResult);
//返回指标值回去算平均值和排名
CalIndAverageAndRankMsg driveIndAverageAndRankMsg =
new CalIndAverageAndRankMsg(driveIndCalResult.getId(),
compareId, driveIndId, compareObj, date, driveIndValue,
unit, indType, scoreCardId, averageDriveIndFormula, compCalLogId,path);
unit, indType, scoreCardId, averageDriveIndFormula,
compCalLogId,path,currentDate);
driveIndIdCalActor.tell(driveIndAverageAndRankMsg, ActorRef.noSender());
} catch (Exception e) {
logger.error("compareCatalog:"+path+";compareObj:"+compareObj+
......@@ -295,36 +302,9 @@ public class DriveIndIdObjCalActor extends AbstractActor{
}
}
} catch (Exception e) {
//判断结果表中是否已存在该结果数据,存在则覆盖
// DriveIndCalResultDef driveIndCalResult = driveIndCalResultService.
// findCalResultDataIsExist(compareId, compareObj, driveIndId, date);
// if(driveIndCalResult==null) {
// driveIndCalResult = new DriveIndCalResultDef(compareId,
// driveIndId,compareObj,date,"NaN",unit,
// "1","0","admin",code,baseIndValueMsg.getCompareObjDesc());
// }else {
// driveIndCalResult.setCode(code);
// driveIndCalResult.setUnit(unit);
// driveIndCalResult.setValue("NaN");
// driveIndCalResult.setLastUpdateTime(DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss"));
// }
// driveIndCalResultService.saveOrUpdate(driveIndCalResult);
//e.printStackTrace();
logger.error("error:",e);
logger.error("driveIndId:" + driveIndId + ";" +
"paramEnv:" + env + ";formula:" +driveIndFormula);
//日志记录
// String logInfo = compCalLog.getLogInfo();
// if(StringUtils.isNotBlank(logInfo)) {
// logInfo+="计算考核指标出错:driveIndId:"+driveIndId+";"+
// "paramEnv:"+env+";formula:"+driveIndFormula+"</n>";
// compCalLog.setLogInfo(logInfo);
// }else {
// compCalLog.setLogInfo("计算考核指标出错:driveIndId:"+driveIndId+";"+
// "paramEnv:"+env+";formula:"+driveIndFormula+"</n>");
// }
//保存日志
if (compCalLog != null) {
compCalLog.setLogInfo("计算考核指标出错");
......@@ -335,7 +315,8 @@ public class DriveIndIdObjCalActor extends AbstractActor{
CalIndAverageAndRankMsg driveIndAverageAndRankMsg =
new CalIndAverageAndRankMsg(-1,
compareId, driveIndId, compareObj, date, "NaN",
unit, indType, scoreCardId, averageDriveIndFormula, compCalLogId,path);
unit, indType, scoreCardId, averageDriveIndFormula,
compCalLogId,path,currentDate);
driveIndIdCalActor.tell(driveIndAverageAndRankMsg, ActorRef.noSender());
}
} else {
......@@ -347,7 +328,8 @@ public class DriveIndIdObjCalActor extends AbstractActor{
CalIndAverageAndRankMsg driveIndAverageAndRankMsg =
new CalIndAverageAndRankMsg(-1,
compareId, driveIndId, compareObj, date, "NaN",
unit, indType, scoreCardId, averageDriveIndFormula, compCalLogId,path);
unit, indType, scoreCardId, averageDriveIndFormula,
compCalLogId,path,currentDate);
driveIndIdCalActor.tell(driveIndAverageAndRankMsg, ActorRef.noSender());
}
}
......
......@@ -32,14 +32,14 @@ public class GetBaseIndValueActor extends AbstractActor{
Map<String, Object> indValueMap = indicatorsValueService.getIndicatorsValue(
getBaseIndValueMsg.getIndId(), getBaseIndValueMsg.getDimValue(),
getBaseIndValueMsg.getCode());
getBaseIndValueMsg.getCode(),getBaseIndValueMsg.getDateMark());
if (indValueMap != null) {
if (indValueMap.get("value") == null) {//如果指标值为空,返回失败结果
//返回指标值结果
getSender().tell(new BaseIndValueMsg(getBaseIndValueMsg.getIndId()
, null, indValueMap.get("compareObjDesc").toString(), 0,
"获取指标id:" +
getBaseIndValueMsg.getIndId() + ";维度:" +
getBaseIndValueMsg.getIndId() + ";对标时间标识:"+getBaseIndValueMsg.getDateMark()+";维度:" +
getBaseIndValueMsg.getDimValue().get(0).getDimvalue() + "," +
getBaseIndValueMsg.getDimValue().get(1).getDimvalue() + " 的指标值为空;"), getSelf());
} else {
......@@ -51,7 +51,7 @@ public class GetBaseIndValueActor extends AbstractActor{
//返回指标值结果
getSender().tell(new BaseIndValueMsg(getBaseIndValueMsg.getIndId(), null, null,
0, "无法获取指标id:" +
getBaseIndValueMsg.getIndId() + ";维度:" +
getBaseIndValueMsg.getIndId() + ";对标时间标识:"+getBaseIndValueMsg.getDateMark()+";维度:" +
getBaseIndValueMsg.getDimValue().get(0).getDimvalue() + "," +
getBaseIndValueMsg.getDimValue().get(1).getDimvalue() + " 的指标值;"), getSelf());
}
......
......@@ -15,7 +15,6 @@ import com.keymobile.indicators.akka.message.indicators.CurrentCompUnitExeMsg;
import com.keymobile.indicators.akka.message.indicators.FirstExeConfirmMsg;
import com.keymobile.indicators.akka.message.indicators.StartCompareUnitCalMsg;
import com.keymobile.indicators.model.entity.indicators.CompareUnitDef;
import com.keymobile.indicators.model.entity.objscorerule.ScoreRule;
import com.keymobile.indicators.service.hytobacco.ScoreRuleService;
import com.keymobile.indicators.service.testrun.TestScoreRuleService;
import com.keymobile.indicators.utils.SpringUtil;
......@@ -52,6 +51,7 @@ public class StartCompareUnitCalActor extends AbstractActor{
private String isTest = null;//试运行,0:试运行 1:正式运行
private Integer compCalLogId = null;
private String path = null;//对标单元目录
private Integer currentDate = null;//当前对标时间
private final ActorRef beforeCompareUnitActor;//定义父actor
......@@ -75,6 +75,7 @@ public class StartCompareUnitCalActor extends AbstractActor{
compCalLogId = startCompareUnitCalMsg.getCompCalLogId();
List<CompareUnitDef> compareUnitDefs = startCompareUnitCalMsg.getCompareInitDefs();
path = startCompareUnitCalMsg.getPath();
currentDate = startCompareUnitCalMsg.getDateMark();
//将对标单元进行分类,需要先执行的先开始进行对标计算
for (CompareUnitDef unitDef : compareUnitDefs) {
if ("1".equals(unitDef.getFirstExe())) {
......@@ -98,7 +99,7 @@ public class StartCompareUnitCalActor extends AbstractActor{
for (CompareUnitDef unitDef : firstExeList) {
CompareUnitCalMsg compareUnitCalMsg = new CompareUnitCalMsg(unitDef,
startCompareUnitCalMsg.getCode(),
startCompareUnitCalMsg.getIsTest());
startCompareUnitCalMsg.getIsTest(),currentDate);
//运算者
compareUnitCalMsg.setUser(user);
compareUnitCalMsg.setCompCalLogId(compCalLogId);
......@@ -115,7 +116,7 @@ public class StartCompareUnitCalActor extends AbstractActor{
for (CompareUnitDef unitDef : afterExeList) {
CompareUnitCalMsg compareUnitCalMsg = new CompareUnitCalMsg(unitDef,
startCompareUnitCalMsg.getCode(),
startCompareUnitCalMsg.getIsTest());
startCompareUnitCalMsg.getIsTest(),currentDate);
compareUnitCalMsg.setCompCalLogId(compCalLogId);
//设置对标单元目录
compareUnitCalMsg.setPath(path);
......@@ -143,7 +144,7 @@ public class StartCompareUnitCalActor extends AbstractActor{
if (!afterExeList.isEmpty()) {
for (CompareUnitDef unitDef : afterExeList) {
CompareUnitCalMsg compareUnitCalMsg = new CompareUnitCalMsg(unitDef,
code, isTest);
code, isTest,currentDate);
compareUnitCalMsg.setCompCalLogId(compCalLogId);
//设置对标单元目录
compareUnitCalMsg.setPath(path);
......@@ -171,12 +172,14 @@ public class StartCompareUnitCalActor extends AbstractActor{
testScoreRuleServer.testCalObjScore(path,unitDef.getCompareId(),
Arrays.asList(unitDef.getIndIds().split(",")),
Arrays.asList(unitDef.getCompareObjs().split(",")),
unitDef.getDate(), unitDef.getObjScoreRuleId(), code);
unitDef.getDate(), unitDef.getObjScoreRuleId(),
code, currentDate);
} else {
scoreRuleServer.calObjScore(path,unitDef.getCompareId(),
Arrays.asList(unitDef.getIndIds().split(",")),
Arrays.asList(unitDef.getCompareObjs().split(",")),
unitDef.getDate(), unitDef.getObjScoreRuleId(), code);
unitDef.getDate(), unitDef.getObjScoreRuleId(),
code, currentDate);
}
}
}
......@@ -205,12 +208,14 @@ public class StartCompareUnitCalActor extends AbstractActor{
testScoreRuleServer.testCalObjScore(path,unitDef.getCompareId(),
Arrays.asList(unitDef.getIndIds().split(",")),
Arrays.asList(unitDef.getCompareObjs().split(",")),
unitDef.getDate(), unitDef.getObjScoreRuleId(), code);
unitDef.getDate(), unitDef.getObjScoreRuleId(),
code, currentDate);
} else {
scoreRuleServer.calObjScore(path,unitDef.getCompareId(),
Arrays.asList(unitDef.getIndIds().split(",")),
Arrays.asList(unitDef.getCompareObjs().split(",")),
unitDef.getDate(), unitDef.getObjScoreRuleId(), code);
unitDef.getDate(), unitDef.getObjScoreRuleId(),
code, currentDate);
}
}
}
......
......@@ -20,10 +20,11 @@ public class CalIndAverageAndRankMsg implements Serializable{
private String indFormula;
private Integer compCalLogId;
private String path;//对标单元目录
private Integer dateMark;//对标时间标识
public CalIndAverageAndRankMsg(Integer id,String compareId,String driveIndId,String compareObj,
Integer date,String driveIndValue,String unit,String indType,Integer scoreCardId,
String indFormula,Integer compCalLogId,String path) {
String indFormula,Integer compCalLogId,String path,Integer dateMark) {
this.id = id;
this.compareId = compareId;
this.driveIndId = driveIndId;
......@@ -36,6 +37,7 @@ public class CalIndAverageAndRankMsg implements Serializable{
this.indFormula = indFormula;
this.compCalLogId = compCalLogId;
this.path = path;
this.dateMark = dateMark;
}
public Integer getId() {
......@@ -114,4 +116,12 @@ public class CalIndAverageAndRankMsg implements Serializable{
public void setPath(String path) {
this.path = path;
}
public Integer getDateMark() {
return dateMark;
}
public void setDateMark(Integer dateMark) {
this.dateMark = dateMark;
}
}
......@@ -22,10 +22,14 @@ public class CompareUnitCalMsg implements Serializable{
private String path;//对标单元目录
public CompareUnitCalMsg(CompareUnitDef compareUnitDef,String code,String isTest) {
private Integer dateMark;//本期对标时间
public CompareUnitCalMsg(CompareUnitDef compareUnitDef,String code,
String isTest,Integer dateMark) {
this.compareUnitDef = compareUnitDef;
this.code = code;
this.isTest = isTest;
this.dateMark = dateMark;
}
public Integer getCompCalLogId() {
......@@ -75,4 +79,12 @@ public class CompareUnitCalMsg implements Serializable{
public void setPath(String path) {
this.path = path;
}
public Integer getDateMark() {
return dateMark;
}
public void setDateMark(Integer dateMark) {
this.dateMark = dateMark;
}
}
......@@ -20,9 +20,11 @@ public class DriveIndIdCalMsg implements Serializable{
private String code;//机构编码
private String isTest;//试运行 0:试运行 1:正式运行
private String path;//对标单元目录
private Integer dateMark;//本期对标时间
public DriveIndIdCalMsg(String compareId,String indId,List<String> compareObj,Integer date,
String firstExe,String averageObj,Integer compCalLogId,String code,String isTest) {
String firstExe,String averageObj,Integer compCalLogId,String code,String isTest,
Integer dateMark) {
this.compareId = compareId;
this.indId = indId;
this.compareObj.addAll(compareObj);
......@@ -32,6 +34,7 @@ public class DriveIndIdCalMsg implements Serializable{
this.compCalLogId = compCalLogId;
this.code = code;
this.isTest = isTest;
this.dateMark = dateMark;
}
public String getCompareId() {
......@@ -103,4 +106,12 @@ public class DriveIndIdCalMsg implements Serializable{
public void setPath(String path) {
this.path = path;
}
public Integer getDateMark() {
return dateMark;
}
public void setDateMark(Integer dateMark) {
this.dateMark = dateMark;
}
}
......@@ -21,10 +21,11 @@ public class DriveIndIdObjCalMsg implements Serializable{
private String code;//机构编码
private String isTest;//试运行
private String path;//对标单元目录
private Integer dateMark;//当前对标时间
public DriveIndIdObjCalMsg(String compareId,String indId,String compareObj,
Integer date,List<DimValue> dimValues,Integer compCalLogId,
String code,String isTest) {
String code,String isTest,Integer dateMark) {
this.compareId = compareId;
this.indId = indId;
this.compareObj = compareObj;
......@@ -33,6 +34,7 @@ public class DriveIndIdObjCalMsg implements Serializable{
this.compCalLogId = compCalLogId;
this.code = code;
this.isTest = isTest;
this.dateMark = dateMark;
}
public String getCompareId() {
......@@ -97,4 +99,12 @@ public class DriveIndIdObjCalMsg implements Serializable{
public void setPath(String path) {
this.path = path;
}
public Integer getDateMark() {
return dateMark;
}
public void setDateMark(Integer dateMark) {
this.dateMark = dateMark;
}
}
......@@ -19,11 +19,14 @@ public class GetBaseIndValueMsg implements Serializable{
private String code;
private Integer compCalLogId;
private Integer dateMark;
public GetBaseIndValueMsg(String indId,List<DimValue> dimValue,String code) {
public GetBaseIndValueMsg(String indId,List<DimValue> dimValue,String code,Integer dateMark) {
this.indId = indId;
this.dimValue.addAll(dimValue);
this.code = code;
this.dateMark = dateMark;
}
public Integer getCompCalLogId() {
......@@ -57,4 +60,12 @@ public class GetBaseIndValueMsg implements Serializable{
public void setCode(String code) {
this.code = code;
}
public Integer getDateMark() {
return dateMark;
}
public void setDateMark(Integer dateMark) {
this.dateMark = dateMark;
}
}
......@@ -23,12 +23,16 @@ public class StartCompareUnitCalMsg implements Serializable{
private String path;
private Integer compCalLogId;
private Integer dateMark;//本期对标时间
public StartCompareUnitCalMsg(List<CompareUnitDef> compareInitDefs,String code,String isTest) {
public StartCompareUnitCalMsg(List<CompareUnitDef> compareInitDefs,String code,
String isTest,Integer dateMark) {
this.compareInitDefs.addAll(compareInitDefs);
this.code = code;
this.setIsTest(isTest);
this.isTest = isTest;
this.dateMark = dateMark;
}
public Integer getCompCalLogId() {
......@@ -78,4 +82,12 @@ public class StartCompareUnitCalMsg implements Serializable{
public void setIsTest(String isTest) {
this.isTest = isTest;
}
public Integer getDateMark() {
return dateMark;
}
public void setDateMark(Integer dateMark) {
this.dateMark = dateMark;
}
}
......@@ -146,8 +146,9 @@ public class IndScorecardCtrl {
public Map<String,String> calculateIndiScore(@RequestParam String compareCatalog,
@RequestParam String compareId,@RequestParam String indId,@RequestParam int date,
@RequestParam String compareObj,@RequestParam Integer indScorecardId,
@RequestBody List<String> compareObjs,@RequestParam String code) throws Exception{
@RequestBody List<String> compareObjs,@RequestParam String code,
@RequestParam int dateMark) throws Exception{
return indScorecardService.calculateIndiScore(compareCatalog,compareId,indId, date, compareObj,
indScorecardId,compareObjs,code);
indScorecardId,compareObjs,code,dateMark);
}
}
......@@ -146,7 +146,9 @@ public class ObjScoreRuleCtrl {
public void calculateObjectScore(@RequestParam String compareCatalog,
@RequestParam String compareId,@RequestParam List<String> indIds,
@RequestParam List<String> compareObjs,@RequestParam int date,
@RequestParam Integer scoreRuleId,@RequestParam String code){
scoreRuleService.calObjScore(compareCatalog,compareId, indIds, compareObjs, date, scoreRuleId,code);
@RequestParam Integer scoreRuleId,@RequestParam String code,
@RequestParam int dateMark){
scoreRuleService.calObjScore(compareCatalog,compareId, indIds,
compareObjs, date, scoreRuleId,code,dateMark);
}
}
......@@ -30,16 +30,19 @@ public class IndicatorReportCtrl {
@PostMapping(value = "/dealReportOne")
public String dealReportOne(@RequestParam String compareCatalog,
@RequestParam String compareUnitId,@RequestParam List<String> indIds,
@RequestParam List<String> compareObjs,@RequestParam Integer date,@RequestParam String code) {
indicatorsReportService.dealReportOne(compareCatalog,compareUnitId,indIds,compareObjs,date,code);
@RequestParam List<String> compareObjs,@RequestParam Integer date,
@RequestParam String code, @RequestParam Integer dateMark) {
indicatorsReportService.dealReportOne(compareCatalog,compareUnitId,indIds,
compareObjs,date,code,dateMark);
return "考核指标本期同期报表数据开始整合...";
}
@ApiOperation(value = "整合基础项本期同期报表数据", notes = "整合基础项本期同期报表数据")
@PostMapping(value = "/dealBaseReportOne")
public String dealBaseReportOne(@RequestParam Integer date,
@RequestParam List<String> compareObjs,@RequestParam String code) {
indicatorsReportService.dealBaseIndReportOneData(date, compareObjs,code);
@RequestParam List<String> compareObjs,@RequestParam String code,
@RequestParam Integer dateMark) {
indicatorsReportService.dealBaseIndReportOneData(date, compareObjs, code, dateMark);
return "基础项本期同期报表数据开始整合...";
}
......@@ -47,16 +50,18 @@ public class IndicatorReportCtrl {
@PostMapping(value = "/dealDriveReportTwo")
public String dealDriveReportTwo(@RequestParam String compareCatalog,@RequestParam String compareUnitId,
@RequestParam List<String> indIds,@RequestParam List<String> compareObjs,
@RequestParam Integer date,@RequestParam String code) {
@RequestParam Integer date,@RequestParam String code,
@RequestParam Integer dateMark) {
indicatorsReportService.dealDriveIndReportTwoData(compareCatalog,compareUnitId, indIds,
compareObjs, date, code);
compareObjs, date, code, dateMark);
return "整合考核指标报表数据2开始整合...";
}
@ApiOperation(value = "整合考核指标报表数据3", notes = "整合考核指标报表数据3")
@PostMapping(value = "/dealDriveReportThree")
public String dealDriveReportThree(@RequestBody List<CompareUnitDef> compareUnitList,
@RequestParam String code,@RequestParam String compareCatalog) throws Exception{
@RequestParam String code,@RequestParam String compareCatalog,
@RequestParam Integer dateMark) throws Exception{
Map<String,String> compareObjMap = new HashMap<>();
Integer date = null;
for(CompareUnitDef unitDef : compareUnitList) {
......@@ -74,7 +79,7 @@ public class IndicatorReportCtrl {
for(CompareUnitDef unitDef : compareUnitList) {
indicatorsReportService.dealDriveIndReportThreeData(compareCatalog,
unitDef.getCompareId(), Arrays.asList(unitDef.getIndIds().split(",")),
unitDef.getDate(),code);
unitDef.getDate(),code,dateMark);
}
return "完成考核指标报表数据3整合";
}
......
......@@ -41,6 +41,7 @@ public class DriveIndCalResultDef {
private String actualAverage;//实际平均数:用于省对市的操作,如果有全省的基础项数据,直接拿全省的基础项数据算考核指标做为其实际平均值
private String code;//编码标识
private String compareCatalog;//对标单元目录
private Integer dateMark;//当前对标时间
public DriveIndCalResultDef() {
super();
......
......@@ -28,4 +28,6 @@ public class IndicatorsData {
private Integer dim2;
private String value;
private String code;//添加机构编码
//author:zhangkb time:2021-1-3 desc:区分同日期维度录入时间标识
private Integer dateMark;//对标时间标识
}
......@@ -40,13 +40,15 @@ public class TestDriveIndCalResultDef {
private String actualAverage;//实际平均数:用于省对市的操作,如果有全省的基础项数据,直接拿全省的基础项数据算考核指标做为其实际平均值
private String code;//编码标识
private String compareCatalog;//对标单元目录
private Integer dateMark;//对标时间标识
public TestDriveIndCalResultDef() {
super();
}
public TestDriveIndCalResultDef(String compareId,String indId,String compareObj,int date,String value,
String unit,String type,String isRight,String lastUpdater,String code,String compareObjDesc) {
public TestDriveIndCalResultDef(String compareId,String indId,String compareObj,int date,
String value,String unit,String type,String isRight,String lastUpdater,String code,
String compareObjDesc) {
this.compareId = compareId;
this.indId = indId;
this.compareObj = compareObj;
......
......@@ -24,11 +24,12 @@ public interface DriveIndCalResultDefMapper extends BaseMapper<DriveIndCalResult
//根据对标单元目录
public DriveIndCalResultDef findByIndIdAndDateAndCompareObjAndCompareCatalog(@Param("indId") String indId,
@Param("date") int date,@Param("compareObj") String compareObj,@Param("code") String code,
@Param("compareCatalog") String compareCatalog);
@Param("compareCatalog") String compareCatalog,@Param("dateMark") int dateMark);
public DriveIndCalResultDef findByCompareCatalogAndIndIdAndDateAndCompareObj(
@Param("compareCatalog") String compareCatalog,@Param("indId") String indId,
@Param("date") int date,@Param("compareObj") String compareObj,@Param("code") String code);
@Param("date") int date,@Param("compareObj") String compareObj,
@Param("code") String code,@Param("dateMark") int dateMark);
public List<DriveIndCalResultDef> findByIndIdAndDate(@Param("indId") String indId,
@Param("date") int date);
......@@ -43,7 +44,8 @@ public interface DriveIndCalResultDefMapper extends BaseMapper<DriveIndCalResult
@Param("indId") String indId,@Param("date") int date);
public List<DriveIndCalResultDef> findByIndIdAndDateAndCompareIdAndSort(@Param("indId") String indId,
@Param("date") int date,@Param("compareId") String compareId,@Param("code") String code);
@Param("date") int date,@Param("compareId") String compareId,@Param("code") String code,
@Param("dateMark") int dateMark);
public List<DriveIndCalResultDef> findByIndIdAndDateAndCompareCatalogAndSort(@Param("indId") String indId,
@Param("date") int date,@Param("compareCatalog") String compareCatalog,@Param("code") String code);
......@@ -55,19 +57,22 @@ public interface DriveIndCalResultDefMapper extends BaseMapper<DriveIndCalResult
@Param("date") int date,@Param("code") String code);
//使用对标单元目录进行过滤
public List<DriveIndCalResultDef> findByCompareCatalogAndCompareObjAndDate(@Param("compareCatalog") String compareCatalog,
@Param("compareObj") String compareObj,@Param("date") int date,@Param("code") String code);
public List<DriveIndCalResultDef> findByCompareCatalogAndCompareObjAndDate(
@Param("compareCatalog") String compareCatalog,@Param("compareObj") String compareObj,
@Param("date") int date,@Param("code") String code,@Param("dateMark")int dateMark);
public List<DriveIndCalResultDef> findByCompareObjAndDateAndIndIdIn(Map<String,Object> param);
public DriveIndCalResultDef findByCompareIdAndCompareObjAndIndIdAndDate(
@Param("compareId") String compareId,@Param("compareObj") String compareObj,
@Param("indId") String indId,@Param("date") Integer date,@Param("code") String code);
@Param("indId") String indId,@Param("date") Integer date,
@Param("code") String code,@Param("dateMark") Integer dateMark);
//根据目录单元目录查找对标结果
public DriveIndCalResultDef findByCompareCatalogAndCompareObjAndIndIdAndDate(
@Param("compareCatalog") String compareCatalog,@Param("compareObj") String compareObj,
@Param("indId") String indId,@Param("date") Integer date,@Param("code") String code);
@Param("indId") String indId,@Param("date") Integer date,@Param("code") String code,
@Param("dateMark") Integer dateMark);
public List<DriveIndCalResultDef> findByIndIdAndDateAndCompareObjIn(Map<String,Object> param);
......
......@@ -29,5 +29,6 @@ public interface IndicatorsDataMapper extends BaseMapper<IndicatorsData>{
@Param("dim2")Integer dim2, @Param("code")String code);
public IndicatorsData getIndData(@Param("indId")String indId,
@Param("date")Integer date,@Param("compareObj")String compareObj,@Param("code")String code);
@Param("date")Integer date,@Param("compareObj")String compareObj,
@Param("code")String code,@Param("dateMark")Integer dateMark);
}
......@@ -16,8 +16,10 @@ public interface TestDriveIndCalResultDefMapper extends BaseMapper<TestDriveIndC
@Param("date") int date,@Param("code") String code);
//使用对标单元目录过滤
public List<TestDriveIndCalResultDef> findByCompareCatalogAndCompareObjAndDate(@Param("compareCatalog") String compareCatalog,
@Param("compareObj") String compareObj,@Param("date") int date,@Param("code") String code);
public List<TestDriveIndCalResultDef> findByCompareCatalogAndCompareObjAndDate(
@Param("compareCatalog") String compareCatalog,
@Param("compareObj") String compareObj,@Param("date") int date,
@Param("code") String code,@Param("dateMark") int dateMark);
public TestDriveIndCalResultDef findByIndIdAndDateAndCompareObj(@Param("indId") String indId,
@Param("date") int date,@Param("compareObj") String compareObj,@Param("code") String code);
......@@ -25,7 +27,8 @@ public interface TestDriveIndCalResultDefMapper extends BaseMapper<TestDriveIndC
//使用对标单元目录过滤
public TestDriveIndCalResultDef findByCompareCatalogAndIndIdAndDateAndCompareObj(
@Param("compareCatalog") String compareCatalog,@Param("indId") String indId,
@Param("date") int date,@Param("compareObj") String compareObj,@Param("code") String code);
@Param("date") int date,@Param("compareObj") String compareObj,
@Param("code") String code,@Param("dateMark") int dateMark);
public TestDriveIndCalResultDef findByCompareIdAndCompareObjAndIndIdAndDate(
@Param("compareId") String compareId,@Param("compareObj") String compareObj,
......@@ -34,7 +37,8 @@ public interface TestDriveIndCalResultDefMapper extends BaseMapper<TestDriveIndC
//根据对标单元目录查找对标结果表是否存在
public TestDriveIndCalResultDef findByCompareCatalogAndCompareObjAndIndIdAndDate(
@Param("compareCatalog") String compareCatalog,@Param("compareObj") String compareObj,
@Param("indId") String indId,@Param("date") Integer date,@Param("code") String code);
@Param("indId") String indId,@Param("date") Integer date,@Param("code") String code,
@Param("dateMark") Integer dateMark);
//批量保存
public void batchSave(@Param("datas")List<TestDriveIndCalResultDef> datas);
......
......@@ -21,17 +21,20 @@ public class BaseIndDataService {
@Autowired
private IndicatorsDataMapper indicatorsDataMapper;
public IndicatorsData getSingleIndData(String indId,int date,String compareObj,String code) {
return indicatorsDataMapper.getIndData(indId, date, compareObj,code);
public IndicatorsData getSingleIndData(String indId,int date,String compareObj,
String code,int dateMark) {
return indicatorsDataMapper.getIndData(indId, date, compareObj,code,dateMark);
}
public List<String> getIndData(String indId,int date,List<String> compareObjs,String code){
public List<String> getIndData(String indId,int date,List<String> compareObjs,String code,
int dateMark){
List<String> result = new ArrayList<>();
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("indId", indId);
paramMap.put("date", date);
paramMap.put("code", code);
paramMap.put("compareObjs", compareObjs);
paramMap.put("dateMark", dateMark);
List<IndicatorsData> resultData = indicatorsDataMapper.getIndDataByParam(paramMap);
if(!resultData.isEmpty()) {
for(IndicatorsData data : resultData) {
......@@ -41,11 +44,13 @@ public class BaseIndDataService {
return result;
}
public List<IndicatorsData> getIndDataByParam(Integer date,List<String> compareObjs,String code){
public List<IndicatorsData> getIndDataByParam(Integer date,List<String> compareObjs,String code,
Integer dateMark){
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("indId", null);
paramMap.put("date", date);
paramMap.put("code", code);
paramMap.put("date_mark", dateMark);
if(compareObjs.isEmpty()) {
paramMap.put("compareObjs", null);
}else {
......
......@@ -89,22 +89,22 @@ public class DriveIndCalResultService {
//根据对标单元目录
public DriveIndCalResultDef findCompareObjInfo(String compareCatalog,String driveIndId,int date,String compareObj,
String code) {
String code,int dateMark) {
return driveIndCalResultDefMapper.findByCompareCatalogAndIndIdAndDateAndCompareObj(
compareCatalog, driveIndId, date, compareObj, code);
compareCatalog, driveIndId, date, compareObj, code, dateMark);
}
public DriveIndCalResultDef findCalResultDataIsExist(String compareId,String compareObj,
String indId,int date,String code) {
String indId,int date,String code,int dateMark) {
return driveIndCalResultDefMapper.findByCompareIdAndCompareObjAndIndIdAndDate(compareId,
compareObj, indId, date,code);
compareObj, indId, date, code, dateMark);
}
//根据对标单元目录查找对标结果是否存在
public DriveIndCalResultDef findCalResultDataIsExistByCatalog(String compareCatalog,String compareObj,
String indId,int date,String code) {
String indId,int date,String code,int dateMark) {
return driveIndCalResultDefMapper.findByCompareCatalogAndCompareObjAndIndIdAndDate(compareCatalog,
compareObj, indId, date, code);
compareObj, indId, date, code, dateMark);
}
public List<DriveIndCalResultDef> findByCompareIdAndDate(String compareId,Integer date){
......@@ -145,7 +145,7 @@ public class DriveIndCalResultService {
//启动回流actor
final ActorSystem system = ActorSystem.create("CompareUnitCalAkka");//创建akka
StartCompareUnitCalMsg startCompareUnitCalMsg = new StartCompareUnitCalMsg(
sameCompareUnitList,code,isTest);
sameCompareUnitList,code,isTest,currentDate);
startCompareUnitCalMsg.setCompCalLogId(compCalLogId);
//author:zhangkb time:2020-12-12 desc:将path参数传入对标计算中
......
......@@ -170,7 +170,7 @@ public class DriveIndDefService {
}
public String calGroupAverage(String driveIndFormula,List<String> compareObjs,
int date,String code) throws Exception{
int date,String code,int dateMark) throws Exception{
String result = "0.0";
List<String> indIdList = new ArrayList<>();
if(StringUtils.isNotBlank(driveIndFormula)) {
......@@ -184,7 +184,7 @@ public class DriveIndDefService {
if(indIdSize!=0) {
if(indIdSize==1) {
List<String> indDateList = baseIndDataService.getIndData(indIdList.get(0),
date, compareObjs, code);
date, compareObjs, code, dateMark);
//author:zhangkb time:2020-9-15 desc:修改type为1,表示0.000的值也不剔除,跟着做为平均数计算
//result = CalculateUtils.averageValue(indDateList,0);
result = CalculateUtils.averageValue(indDateList,1);
......@@ -192,7 +192,7 @@ public class DriveIndDefService {
Map<String, Object> env = Maps.newHashMap();
for(String indId : indIdList) {
List<String> indDateList = baseIndDataService.getIndData(indId,
date,compareObjs,code);
date,compareObjs,code,dateMark);
String sumValue = CalculateUtils.sumValue(indDateList);
if(sumValue.indexOf(".")<0) {
sumValue += ".00";
......
......@@ -140,7 +140,7 @@ public class IndScorecardService {
}
public Map<String,String> calculateIndiScore(String compareCatalog,String compareId,String indId,int date,String compareObj,
Integer indScorecardId,List<String> compareObjs,String code) throws Exception{
Integer indScorecardId,List<String> compareObjs,String code,int dateMark) throws Exception{
Map<String,String> result = new HashMap<>();
Gson gson = new Gson();
String indScoreValue = "0.0";
......@@ -160,10 +160,8 @@ public class IndScorecardService {
String unit = driveIndDef.getIndUnit();
List<DriveIndCalResultDef> currentDriveResult = driveIndCalResultDefMapper
.findByIndIdAndDateAndCompareIdAndSort(indId, date,compareId,code);
//List<DriveIndCalResultDef> currentDriveResult = driveIndCalResultDefMapper
//.findByIndIdAndDateAndCompareCatalogAndSort(indId,date,compareCatalog,code);
.findByIndIdAndDateAndCompareIdAndSort(indId, date,compareId,
code,dateMark);
if(!currentDriveResult.isEmpty()) {
//过滤考核指标结果集无效值
Iterator<DriveIndCalResultDef> it=currentDriveResult.iterator();
......@@ -176,12 +174,10 @@ public class IndScorecardService {
}
int currentDriveResultSize = currentDriveResult.size();
//根据indId,date,compareObj获取考核结果
// DriveIndCalResultDef currentCompareObjResult = driveIndCalResultDefMapper
// .findByIndIdAndDateAndCompareObj(indId, date, compareObj, code);
//改用添加对标单元目录做为条件过滤
DriveIndCalResultDef currentCompareObjResult = driveIndCalResultDefMapper
.findByIndIdAndDateAndCompareObjAndCompareCatalog(indId, date,
compareObj, code, compareCatalog);
compareObj, code, compareCatalog,dateMark);
if(currentCompareObjResult!=null) {
String average = currentCompareObjResult.getAverage();
......@@ -262,13 +258,10 @@ public class IndScorecardService {
//改善提升
if("1".equals(scoreCard.getIsIncluScore())) {//纳入单位得分计算
//同期
// DriveIndCalResultDef sameCompareObjResult = driveIndCalResultDefMapper
// .findByIndIdAndDateAndCompareObj(indId, (date-100),
// compareObj,code);
//改用添加对标单元目录做为过滤条件
DriveIndCalResultDef sameCompareObjResult = driveIndCalResultDefMapper
.findByIndIdAndDateAndCompareObjAndCompareCatalog(indId, (date-100),
compareObj,code,compareCatalog);
compareObj,code,compareCatalog,dateMark);
if(sameCompareObjResult!=null) {
List<ImproveScoreDef> importScoreDefList = new ArrayList<>();
if(StringUtils.isNotBlank(scoreCard.getImproveScoreItemJson())) {
......
......@@ -740,10 +740,12 @@ public class IndicatorsValueService {
logger.info("填充完成");
}
public Map<String,Object> getIndicatorsValue(String indId,List<DimValue> dimValues,String code) {
public Map<String,Object> getIndicatorsValue(String indId,List<DimValue> dimValues,String code,
Integer dateMark) {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("indId", indId);
paramMap.put("code", code);
paramMap.put("dateMark", dateMark);
for(DimValue dimValue : dimValues) {
if("number".equals(dimValue.getDimvalueType())) {
paramMap.put("dim2", Integer.parseInt(dimValue.getDimvalue().toString()));
......@@ -785,7 +787,7 @@ public class IndicatorsValueService {
List<DriveIndCalResultDef> currentDriveResult = new ArrayList<>();
if(StringUtils.isNotBlank(compareId)) {
currentDriveResult = driveIndCalResultDefMapper
.findByIndIdAndDateAndCompareIdAndSort(indId, date, compareId,null);
.findByIndIdAndDateAndCompareIdAndSort(indId, date, compareId,null,date);
}else {
currentDriveResult = driveIndCalResultDefMapper
.findByIndIdAndDateAndSortAndActualAverageIsNotNull(indId, date);
......@@ -811,7 +813,7 @@ public class IndicatorsValueService {
compareId = "SCC006";
}
sameDriveResult = driveIndCalResultDefMapper
.findByIndIdAndDateAndCompareIdAndSort(indId, (date-100),compareId,null);
.findByIndIdAndDateAndCompareIdAndSort(indId, (date-100),compareId,null,date);
}else {
sameDriveResult = driveIndCalResultDefMapper.findByIndIdAndDateAndSortAndActualAverageIsNotNull(
indId, date);
......
......@@ -123,24 +123,15 @@ public class ScoreRuleService {
//计算组内考核指标平均值或者总和 type:0 计算地区所有纳入考核指标平均数 3指标总得分
private ObjScoreCalResult calGroupIndAverageOrSum(String compareCatalog,ObjScoreCalResult objResult,
ScoreRule scoreRule,String compareObj,int date,String type,String code){
ScoreRule scoreRule,String compareObj,int date,String type,String code,int dateMark){
objResult.setCompareObj(compareObj);
objResult.setScoreValue("0.0");
objResult.setImproveValue("0.0");
objResult.setDate(date);
//objResult.setIndIds(String.join(",", indIds));
//根据日期,对标对象和考核的指标获取考核指标结果详情
//Map<String,Object> paremMap = new HashMap<>();
//paremMap.put("compareObj", compareObj);
//paremMap.put("date", date);
//paremMap.put("indIds", indIds);
//List<DriveIndCalResultDef> calResults = driveIndCalResultDefMapper.
//findByCompareObjAndDateAndIndIdIn(paremMap);
// List<DriveIndCalResultDef> calResults = driveIndCalResultDefMapper.
// findByCompareObjAndDate(compareObj, date, code);
//改用添加对标单元目录过滤
List<DriveIndCalResultDef> calResults = driveIndCalResultDefMapper.
findByCompareCatalogAndCompareObjAndDate(compareCatalog,compareObj, date, code);
findByCompareCatalogAndCompareObjAndDate(compareCatalog,compareObj,
date, code, dateMark);
int indCount = 0;//定义用户记录纳入考核指标个数
List<String> values = new ArrayList<>();
List<String> improveValues = new ArrayList<>();
......@@ -210,7 +201,7 @@ public class ScoreRuleService {
}
private ObjScoreCalResult calSingleIndWeight(String compareCatalog,ObjScoreCalResult objResult,ScoreRule scoreRule,
String compareObj,int date,String code){
String compareObj,int date,String code,int dateMark){
objResult.setCompareObj(compareObj);
objResult.setScoreValue("0.0");
objResult.setImproveValue("0.0");
......@@ -230,7 +221,8 @@ public class ScoreRuleService {
for(String indId : indIdList) {
//根据日期,对标对象和考核的指标获取考核指标结果详情
DriveIndCalResultDef calresultOp = driveIndCalResultDefMapper.
findByIndIdAndDateAndCompareObjAndCompareCatalog(indId, date, compareObj, code, compareCatalog);
findByIndIdAndDateAndCompareObjAndCompareCatalog(indId, date, compareObj,
code, compareCatalog, dateMark);
if(calresultOp!=null) {
//auth:zhangkb time:2020-7-15 desc:填充对标对象描述
objResult.setCompareObjDesc(calresultOp.getCompareObjDesc());
......@@ -308,7 +300,7 @@ public class ScoreRuleService {
//按照指标类别进行分类分别计算平均分后再跟类别权重相乘后相加得到最终分数
private ObjScoreCalResult calIndCatalogTypeAverage(String compareCatalog,ObjScoreCalResult objResult,ScoreRule scoreRule,
String compareObj,int date,String code){
String compareObj,int date,String code,int dateMark){
Gson gson = new Gson();
objResult.setCompareObj(compareObj);
objResult.setScoreValue("0.0");
......@@ -320,7 +312,8 @@ public class ScoreRuleService {
// findByCompareObjAndDate(compareObj, date, code);
//改用添加对标单元目录进行过滤
List<DriveIndCalResultDef> calResults = driveIndCalResultDefMapper.
findByCompareCatalogAndCompareObjAndDate(compareCatalog,compareObj, date, code);
findByCompareCatalogAndCompareObjAndDate(compareCatalog,compareObj,
date, code, dateMark);
double scoreValue = 0.0;
double improveValue = 0.0;
double scoreSumValue = 0.0;
......@@ -403,7 +396,7 @@ public class ScoreRuleService {
//根据单位评分规则计算单位分数
public void calObjScore(String compareCatalog,String compareId,List<String> indIds,
List<String> compareObjs,int date,Integer scoreRuleId,String code) {
List<String> compareObjs,int date,Integer scoreRuleId,String code,int dateMark) {
//根据单位得分评分卡id获取评分卡详情
ScoreRule scoreRule = this.getById(scoreRuleId);
List<ObjScoreCalResult> datas = new ArrayList<>();
......@@ -411,8 +404,6 @@ public class ScoreRuleService {
if(!indIds.isEmpty() && !compareObjs.isEmpty()) {
for(String compareObj : compareObjs) {
//判断库表是否已存在改结果数据
// ObjScoreCalResult objScoreCalResult = objScoreCalResultMapper.
// getObjScoreCalResultByParam(compareId, compareObj, date, code);
//改用添加对标单元目录过滤
ObjScoreCalResult objScoreCalResult = objScoreCalResultMapper.
getObjScoreCalResultByCompareCatalog(compareCatalog,compareId, compareObj, date, code);
......@@ -422,16 +413,16 @@ public class ScoreRuleService {
//计算类型:0 地区所有纳入评价的考核指标平均数
if("0".equals(scoreRule.getCalType())) {
objScoreCalResult = this.calGroupIndAverageOrSum(compareCatalog,objScoreCalResult,
scoreRule, compareObj, date, scoreRule.getCalType(),code);
scoreRule, compareObj, date, scoreRule.getCalType(), code, dateMark);
}else if("1".equals(scoreRule.getCalType())) {//1 根据目录类别分类算平均分后根据权重计算考核指标
objScoreCalResult = this.calIndCatalogTypeAverage(compareCatalog,objScoreCalResult,
scoreRule, compareObj, date, code);
scoreRule, compareObj, date, code, dateMark);
}else if("2".equals(scoreRule.getCalType())){//2单个指标权重计算
objScoreCalResult = this.calSingleIndWeight(compareCatalog,objScoreCalResult ,scoreRule,
compareObj, date, code);
compareObj, date, code, dateMark);
}else {//3:指标总得分
objScoreCalResult = this.calGroupIndAverageOrSum(compareCatalog,objScoreCalResult,
scoreRule, compareObj, date, scoreRule.getCalType(),code);
scoreRule, compareObj, date, scoreRule.getCalType(),code,dateMark);
}
objScoreCalResult.setCompareCatalog(compareCatalog);
objScoreCalResult.setCompareId(compareId);
......
......@@ -30,9 +30,9 @@ public class TestDriveIndCalResultService {
//根据对标单元目录
public TestDriveIndCalResultDef findCompareObjInfo(String compareCatalog,String driveIndId,int date,String compareObj,
String code) {
String code,Integer dateMark) {
return testDriveIndCalResultDefMapper.findByCompareCatalogAndIndIdAndDateAndCompareObj(
compareCatalog, driveIndId, date, compareObj, code);
compareCatalog, driveIndId, date, compareObj, code, dateMark);
}
public TestDriveIndCalResultDef findCalResultDataIsExist(String compareId,String compareObj,
......@@ -42,9 +42,10 @@ public class TestDriveIndCalResultService {
}
public TestDriveIndCalResultDef findCalResultDataIsExistByCatalog(String compareCatalog,String compareObj,
String indId,int date,String code) {
String indId,int date,String code,Integer dateMark) {
return testDriveIndCalResultDefMapper.
findByCompareCatalogAndCompareObjAndIndIdAndDate(compareCatalog, compareObj, indId, date, code);
findByCompareCatalogAndCompareObjAndIndIdAndDate(compareCatalog, compareObj,
indId, date, code, dateMark);
}
public int saveOrUpdate(TestDriveIndCalResultDef driveIndCalResult) {
......
......@@ -45,7 +45,7 @@ public class TestScoreRuleService {
//根据单位评分规则计算单位分数
public void testCalObjScore(String compareCatalog,String compareId,List<String> indIds,
List<String> compareObjs,int date,Integer scoreRuleId,String code) {
List<String> compareObjs,int date,Integer scoreRuleId,String code,Integer dateMark) {
//根据单位得分评分卡id获取评分卡详情
ScoreRule scoreRule = this.getById(scoreRuleId);
List<TestObjScoreCalResult> datas = new ArrayList<>();
......@@ -53,8 +53,6 @@ public class TestScoreRuleService {
if(!indIds.isEmpty() && !compareObjs.isEmpty()) {
for(String compareObj : compareObjs) {
//判断库表是否已存在改结果数据
// TestObjScoreCalResult objScoreCalResult = testObjScoreCalResultMapper.
// getTestObjScoreCalResultByParam(compareId, compareObj, date, code);
//改用对标单元目录过滤
TestObjScoreCalResult objScoreCalResult = testObjScoreCalResultMapper.
getTestObjScoreCalResultByCompareCatalog(compareCatalog, compareObj, date, code);
......@@ -64,16 +62,16 @@ public class TestScoreRuleService {
//计算类型:0 地区所有纳入评价的考核指标平均数
if("0".equals(scoreRule.getCalType())) {
objScoreCalResult = this.calGroupIndAverageOrSum(compareCatalog, objScoreCalResult, scoreRule,
compareObj, date, scoreRule.getCalType(),code);
compareObj, date, scoreRule.getCalType(),code,dateMark);
}else if("1".equals(scoreRule.getCalType())) {//1 根据目录类别分类算平均分后根据权重计算考核指标
objScoreCalResult = this.calIndCatalogTypeAverage(compareCatalog, objScoreCalResult, scoreRule,
compareObj, date, code);
compareObj, date, code, dateMark);
}else if("2".equals(scoreRule.getCalType())){//2单个指标权重计算
objScoreCalResult = this.calSingleIndWeight(compareCatalog, objScoreCalResult ,scoreRule,
compareObj, date, code);
compareObj, date, code, dateMark);
}else {//3:指标总得分
objScoreCalResult = this.calGroupIndAverageOrSum(compareCatalog,objScoreCalResult, scoreRule,
compareObj, date, scoreRule.getCalType(),code);
compareObj, date, scoreRule.getCalType(),code,dateMark);
}
objScoreCalResult.setCode(code);
objScoreCalResult.setCompareCatalog(compareCatalog);
......@@ -90,24 +88,15 @@ public class TestScoreRuleService {
//计算组内考核指标平均值或者总和 type:0 计算地区所有纳入考核指标平均数 3指标总得分
private TestObjScoreCalResult calGroupIndAverageOrSum(String compareCatalog,TestObjScoreCalResult objResult,ScoreRule scoreRule,
String compareObj,int date,String type,String code){
String compareObj,int date,String type,String code,Integer dateMark){
objResult.setCompareObj(compareObj);
objResult.setScoreValue("0.0");
objResult.setImproveValue("0.0");
objResult.setDate(date);
//objResult.setIndIds(String.join(",", indIds));
//根据日期,对标对象和考核的指标获取考核指标结果详情
//Map<String,Object> paremMap = new HashMap<>();
//paremMap.put("compareObj", compareObj);
//paremMap.put("date", date);
//paremMap.put("indIds", indIds);
//List<DriveIndCalResultDef> calResults = driveIndCalResultDefMapper.
//findByCompareObjAndDateAndIndIdIn(paremMap);
// List<TestDriveIndCalResultDef> calResults = testDriveIndCalResultDefMapper.
// findByCompareObjAndDate(compareObj, date, code);
//改用对标单元目录进行过滤
List<TestDriveIndCalResultDef> calResults = testDriveIndCalResultDefMapper.
findByCompareCatalogAndCompareObjAndDate(compareCatalog,compareObj, date, code);
findByCompareCatalogAndCompareObjAndDate(compareCatalog,compareObj,
date, code, dateMark);
int indCount = 0;//定义用户记录纳入考核指标个数
List<String> values = new ArrayList<>();
List<String> improveValues = new ArrayList<>();
......@@ -177,7 +166,7 @@ public class TestScoreRuleService {
}
private TestObjScoreCalResult calSingleIndWeight(String compareCatalog,TestObjScoreCalResult objResult,ScoreRule scoreRule,
String compareObj,int date,String code){
String compareObj,int date,String code,int dateMark){
objResult.setCompareObj(compareObj);
objResult.setScoreValue("0.0");
objResult.setImproveValue("0.0");
......@@ -198,7 +187,8 @@ public class TestScoreRuleService {
// findByIndIdAndDateAndCompareObj(indId, date, compareObj, code);
//改用对标单元目录进行过滤
TestDriveIndCalResultDef calresultOp = testDriveIndCalResultDefMapper.
findByCompareCatalogAndIndIdAndDateAndCompareObj(compareCatalog,indId, date, compareObj, code);
findByCompareCatalogAndIndIdAndDateAndCompareObj(
compareCatalog,indId, date, compareObj, code, dateMark);
if(calresultOp!=null) {
//auth:zhangkb time:2020-7-15 desc:填充对标对象描述
objResult.setCompareObjDesc(calresultOp.getCompareObjDesc());
......@@ -265,7 +255,7 @@ public class TestScoreRuleService {
//按照指标类别进行分类分别计算平均分后再跟类别权重相乘后相加得到最终分数
private TestObjScoreCalResult calIndCatalogTypeAverage(String compareCatalog,TestObjScoreCalResult objResult,ScoreRule scoreRule,
String compareObj,int date,String code){
String compareObj,int date,String code,int dateMark){
Gson gson = new Gson();
objResult.setCompareObj(compareObj);
objResult.setScoreValue("0.0");
......@@ -273,11 +263,10 @@ public class TestScoreRuleService {
objResult.setDate(date);
//根据对标对象,日期查找该对标对象对标的所有指标结果
// List<TestDriveIndCalResultDef> calResults = testDriveIndCalResultDefMapper.
// findByCompareObjAndDate(compareObj, date, code);
//改用对标单元目录进行过滤
List<TestDriveIndCalResultDef> calResults = testDriveIndCalResultDefMapper.
findByCompareCatalogAndCompareObjAndDate(compareCatalog, compareObj, date, code);
findByCompareCatalogAndCompareObjAndDate(compareCatalog, compareObj,
date, code, dateMark);
double scoreValue = 0.0;
double improveValue = 0.0;
if(!calResults.isEmpty()) {
......
......@@ -44,7 +44,8 @@
compare_obj = #{compareObj} and
date = #{date} and
code = #{code} and
compare_catalog = #{compareCatalog}
compare_catalog = #{compareCatalog} and
date_mark = #{dateMark}
</select>
<select id="findByCompareCatalogAndIndIdAndDateAndCompareObj" resultType="com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef" >
......@@ -55,7 +56,8 @@
ind_id = #{indId} and
compare_obj = #{compareObj} and
date = #{date} and
code = #{code}
code = #{code} and
date_mark = #{dateMark}
</select>
<select id="findByIndIdAndDate" resultType="com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef" >
......@@ -99,7 +101,9 @@
ind_id = #{indId} and
date = #{date} and
compare_id = #{compareId} and
code = #{code} order by `rank` asc
code = #{code} and
date_mark = #{dateMark}
order by `rank` asc
</select>
<select id="findByIndIdAndDateAndCompareCatalogAndSort" resultType="com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef" >
......@@ -137,7 +141,8 @@
compare_obj = #{compareObj} and
date = #{date} and
code = #{code} and
compare_catalog = #{compareCatalog}
compare_catalog = #{compareCatalog} and
date_mark = #{dateMark}
</select>
<select id="findByCompareObjAndDateAndIndIdIn" parameterType="map" resultType="com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef" >
......@@ -160,7 +165,8 @@
compare_obj = #{compareObj} and
ind_id = #{indId} and
date = #{date} and
code = #{code}
code = #{code} and
date_mark = #{dateMark}
</select>
<select id="findByCompareCatalogAndCompareObjAndIndIdAndDate" resultType="com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef" >
......@@ -171,7 +177,8 @@
compare_obj = #{compareObj} and
ind_id = #{indId} and
date = #{date} and
code = #{code}
code = #{code} and
date_mark = #{dateMark}
</select>
<select id="findByIndIdAndDateAndCompareObjIn" parameterType="map" resultType="com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef" >
......@@ -182,6 +189,7 @@
date = #{date} and
code = #{code} and
compare_catalog = #{compareCatalog} and
date_mark = #{dateMark} and
compare_obj in
<foreach item="id" collection="compareObjs" open="(" close=")" separator=",">
#{id}
......
......@@ -8,7 +8,8 @@
ind_id=#{indId} and
dim1 = #{dim1} and
dim2= #{dim2} and
code = #{code}
code = #{code} and
date_mark = #{dateMark}
</select>
<select id="getIndDataByParam" parameterType="map" resultType="com.keymobile.indicators.model.entity.indicators.IndicatorsData" >
......@@ -16,7 +17,8 @@
from indi_data_def
where
dim2= #{date} and
code = #{code}
code = #{code} and
date_mark = #{dateMark}
<if test="indId!=null">
and ind_id=#{indId}
</if>
......@@ -76,17 +78,19 @@
dim2 = #{date}
and ind_id = #{indId}
and dim1 = #{compareObj}
and code = #{code}
and code = #{code}
and date_mark = #{dateMark}
</select>
<insert id="batchCreateIndData" parameterType="list">
insert into indi_data_def(
ind_id, ind_desc, type, batch_no, data_type, unit, dim1, dim2, value, dim1_desc, code)
ind_id, ind_desc, type, batch_no, data_type,
unit, dim1, dim2, value, dim1_desc, code, date_mark)
values
<foreach collection="datas" item="val" separator=",">
(
#{val.indId}, #{val.indDesc}, #{val.type}, #{val.batchNo}, #{val.dataType},#{val.unit},
#{val.dim1},#{val.dim2},#{val.value},#{val.dim1Desc},#{val.code}
#{val.dim1},#{val.dim2},#{val.value},#{val.dim1Desc},#{val.code},#{val.dateMark}
)
</foreach>
</insert>
......
......@@ -17,7 +17,8 @@
compare_obj = #{compareObj} and
date = #{date} and
code = #{code} and
compare_catalog = #{compareCatalog}
compare_catalog = #{compareCatalog} and
date_mark = #{dateMark}
</select>
<select id="findByIndIdAndDateAndCompareObj" resultType="com.keymobile.indicators.model.entity.testrun.TestDriveIndCalResultDef" >
......@@ -38,7 +39,8 @@
ind_id = #{indId} and
compare_obj = #{compareObj} and
date = #{date} and
code = #{code}
code = #{code} and
date_mark = #{dateMark}
</select>
<select id="findByCompareIdAndCompareObjAndIndIdAndDate" resultType="com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef" >
......@@ -60,21 +62,22 @@
compare_obj = #{compareObj} and
ind_id = #{indId} and
date = #{date} and
code = #{code}
code = #{code} and
date_mark = #{dateMark}
</select>
<insert id="batchSave" parameterType="java.util.List">
insert into test_drive_ind_cal_result_def(
compare_id, ind_id, compare_obj, compare_obj_desc, date, value, unit, type,
is_right, last_update_time, last_updater, average, `rank`, score, improve_score,
actual_average, code, compare_catalog)
actual_average, code, compare_catalog, date_mark)
values
<foreach collection="datas" item="val" separator=",">
(
#{val.compareId}, #{val.indId}, #{val.compareObj}, #{val.compareObjDesc}, #{val.date},
#{val.value},#{val.unit},#{val.type},#{val.isRight},#{val.lastUpdateTime},#{val.lastUpdater},
#{val.average},#{val.rank},#{val.score},#{val.improveScore},#{val.actualAverage},#{val.code},
#{val.compareCatalog}
#{val.compareCatalog},#{dateMark}
)
</foreach>
</insert>
......@@ -137,10 +140,14 @@
<if test="val.compareCatalog != null">
compare_catalog = #{val.compareCatalog},
</if>
<if test="val.dateMark != null">
date_mark = #{val.dateMark},
</if>
</set>
where id = ${val.id}
</foreach>
</update>
<delete id="deleteByCompareIdInAndDateIn" parameterType="map">
delete
from
......
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