Commit 68660333 by zhangkb

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

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