Commit 0c07ddc3 by hzc

修改单位综合得分bug

parent b17fb5e8
...@@ -4,6 +4,7 @@ import java.util.*; ...@@ -4,6 +4,7 @@ import java.util.*;
import com.keymobile.indicators.constant.Constants; 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.SystemAuthService;
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 org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
...@@ -25,6 +26,8 @@ public class BeforeCompareUnitCalActor extends AbstractActor{ ...@@ -25,6 +26,8 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
private IndicatorsReportService indicatorsReportService = SpringUtil.getBean(IndicatorsReportService.class); private IndicatorsReportService indicatorsReportService = SpringUtil.getBean(IndicatorsReportService.class);
private SystemAuthService systemAuthService = SpringUtil.getBean(SystemAuthService.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
...@@ -47,6 +50,8 @@ public class BeforeCompareUnitCalActor extends AbstractActor{ ...@@ -47,6 +50,8 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
private String path = null;//对标单元目录id private String path = null;//对标单元目录id
private Boolean isClearAllPools;
@Override @Override
public Receive createReceive() { public Receive createReceive() {
try { try {
...@@ -60,6 +65,9 @@ public class BeforeCompareUnitCalActor extends AbstractActor{ ...@@ -60,6 +65,9 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
compCalLogId = beforeCompareUnitCalMsg.getCompCalLogId(); compCalLogId = beforeCompareUnitCalMsg.getCompCalLogId();
path = beforeCompareUnitCalMsg.getPath(); path = beforeCompareUnitCalMsg.getPath();
currentDate = beforeCompareUnitCalMsg.getDateMark();//dateMark记录本期对标时间 currentDate = beforeCompareUnitCalMsg.getDateMark();//dateMark记录本期对标时间
isClearAllPools=beforeCompareUnitCalMsg.getClearAllPools();//是否清理smartBi缓存
if("0".equals(isTest)) { if("0".equals(isTest)) {
logger.info("进行date:"+sameDate+" 的对标单元试运行计算.....日志id:"+compCalLogId); logger.info("进行date:"+sameDate+" 的对标单元试运行计算.....日志id:"+compCalLogId);
}else { }else {
...@@ -183,6 +191,11 @@ public class BeforeCompareUnitCalActor extends AbstractActor{ ...@@ -183,6 +191,11 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
compareUnitCalLogService.saveOrUndate(compCalLog); compareUnitCalLogService.saveOrUndate(compCalLog);
} }
LogManager.logInfo(Constants.LOG_INDICATOR_UNIT_CAL_API,"完成对标单元id:{},日期:{} 的正式运行计算",compCalLogId,currentDate ); LogManager.logInfo(Constants.LOG_INDICATOR_UNIT_CAL_API,"完成对标单元id:{},日期:{} 的正式运行计算",compCalLogId,currentDate );
//清缓存
if(isClearAllPools){
logger.info("开始清除smartBi缓存");
systemAuthService.clearAllPools();
}
logger.info("本期同期对标单元计算完成"); logger.info("本期同期对标单元计算完成");
} }
} }
......
...@@ -26,6 +26,7 @@ public class StartCompareUnitCalMsg implements Serializable{ ...@@ -26,6 +26,7 @@ public class StartCompareUnitCalMsg implements Serializable{
private Integer dateMark;//本期对标时间 private Integer dateMark;//本期对标时间
private Boolean clearAllPools;
public StartCompareUnitCalMsg(List<CompareUnitDef> compareInitDefs,String code, public StartCompareUnitCalMsg(List<CompareUnitDef> compareInitDefs,String code,
String isTest,Integer dateMark) { String isTest,Integer dateMark) {
...@@ -35,6 +36,14 @@ public class StartCompareUnitCalMsg implements Serializable{ ...@@ -35,6 +36,14 @@ public class StartCompareUnitCalMsg implements Serializable{
this.dateMark = dateMark; this.dateMark = dateMark;
} }
public Boolean getClearAllPools() {
return clearAllPools;
}
public void setClearAllPools(Boolean clearAllPools) {
this.clearAllPools = clearAllPools;
}
public Integer getCompCalLogId() { public Integer getCompCalLogId() {
return compCalLogId; return compCalLogId;
} }
......
...@@ -67,4 +67,11 @@ public interface SystemAuthService { ...@@ -67,4 +67,11 @@ public interface SystemAuthService {
*/ */
@GetMapping("/standardObj/listByIds") @GetMapping("/standardObj/listByIds")
List<JSONObject> getStandardObjByIds(@RequestParam("ids") List<String> ids); List<JSONObject> getStandardObjByIds(@RequestParam("ids") List<String> ids);
/**
* 清理smartBi缓存
* * @return
*/
@GetMapping("/smartBi/clearAllPools")
void clearAllPools();
} }
...@@ -13,6 +13,7 @@ import org.apache.commons.lang.StringUtils; ...@@ -13,6 +13,7 @@ import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.keymobile.indicators.akka.actor.indicators.BeforeCompareUnitCalActor; import com.keymobile.indicators.akka.actor.indicators.BeforeCompareUnitCalActor;
...@@ -48,7 +49,10 @@ public class DriveIndCalResultService { ...@@ -48,7 +49,10 @@ public class DriveIndCalResultService {
@Autowired @Autowired
private TestObjScoreCalResultMapper testObjScoreCalResultMapper; private TestObjScoreCalResultMapper testObjScoreCalResultMapper;
@Value("${isClearAllPools}")
private Boolean isClearAllPools;
public int saveOrUpdate(DriveIndCalResultDef driveIndCalResult) { public int saveOrUpdate(DriveIndCalResultDef driveIndCalResult) {
if(driveIndCalResult.getId()==null) { if(driveIndCalResult.getId()==null) {
driveIndCalResultDefMapper.insert(driveIndCalResult); driveIndCalResultDefMapper.insert(driveIndCalResult);
...@@ -150,7 +154,7 @@ public class DriveIndCalResultService { ...@@ -150,7 +154,7 @@ public class DriveIndCalResultService {
startCompareUnitCalMsg.setCompCalLogId(compCalLogId); startCompareUnitCalMsg.setCompCalLogId(compCalLogId);
//author:zhangkb time:2020-12-12 desc:将path参数传入对标计算中 //author:zhangkb time:2020-12-12 desc:将path参数传入对标计算中
startCompareUnitCalMsg.setPath(path); startCompareUnitCalMsg.setPath(path);
startCompareUnitCalMsg.setClearAllPools(isClearAllPools);
ActorRef beforeCompareUnitCalActor = system.actorOf(Props.create( ActorRef beforeCompareUnitCalActor = system.actorOf(Props.create(
BeforeCompareUnitCalActor.class,()-> new BeforeCompareUnitCalActor())); BeforeCompareUnitCalActor.class,()-> new BeforeCompareUnitCalActor()));
beforeCompareUnitCalActor.tell(startCompareUnitCalMsg, ActorRef.noSender()); beforeCompareUnitCalActor.tell(startCompareUnitCalMsg, ActorRef.noSender());
......
...@@ -155,7 +155,7 @@ public class ScoreRuleService { ...@@ -155,7 +155,7 @@ public class ScoreRuleService {
if(!"NaN".equals(calResult.getValue()) && !"Infinite".equals(calResult.getValue()) if(!"NaN".equals(calResult.getValue()) && !"Infinite".equals(calResult.getValue())
// && !"0.0000".equals(calResult.getValue()) // && !"0.0000".equals(calResult.getValue())
&& !"0".equals(calResult.getValue())) { && !"0".equals(calResult.getValue())) {
scoreValues.add(calResult.getValue()); scoreValues.add(calResult.getScore());
} }
indCount += 1; indCount += 1;
...@@ -285,7 +285,7 @@ public class ScoreRuleService { ...@@ -285,7 +285,7 @@ public class ScoreRuleService {
if(!"NaN".equals(calresultOp.getValue()) && !"Infinite".equals(calresultOp.getValue()) if(!"NaN".equals(calresultOp.getValue()) && !"Infinite".equals(calresultOp.getValue())
// && !"0.0000".equals(calResult.getValue()) // && !"0.0000".equals(calResult.getValue())
&& !"0".equals(calresultOp.getValue())) { && !"0".equals(calresultOp.getValue())) {
scoreTmpSumValue+=Double.parseDouble(calresultOp.getValue()); scoreTmpSumValue+=Double.parseDouble(calresultOp.getScore());
} }
//得分类型:0 指标值直接参与计算 //得分类型:0 指标值直接参与计算
...@@ -441,7 +441,7 @@ public class ScoreRuleService { ...@@ -441,7 +441,7 @@ public class ScoreRuleService {
if(!"NaN".equals(calResult.getValue()) && !"Infinite".equals(calResult.getValue()) if(!"NaN".equals(calResult.getValue()) && !"Infinite".equals(calResult.getValue())
// && !"0.0000".equals(calResult.getValue()) // && !"0.0000".equals(calResult.getValue())
&& !"0".equals(calResult.getValue())) { && !"0".equals(calResult.getValue())) {
scoreValues.add(calResult.getValue()); scoreValues.add(calResult.getScore());
} }
if("0".equals(scoreRule.getScoreType())) { if("0".equals(scoreRule.getScoreType())) {
if(!"NaN".equals(calResult.getValue()) && !"Infinite".equals(calResult.getValue()) if(!"NaN".equals(calResult.getValue()) && !"Infinite".equals(calResult.getValue())
......
...@@ -119,7 +119,7 @@ public class TestScoreRuleService { ...@@ -119,7 +119,7 @@ public class TestScoreRuleService {
if(!"NaN".equals(calResult.getValue()) && !"Infinite".equals(calResult.getValue()) if(!"NaN".equals(calResult.getValue()) && !"Infinite".equals(calResult.getValue())
// && !"0.0000".equals(calResult.getValue()) // && !"0.0000".equals(calResult.getValue())
&& !"0".equals(calResult.getValue())) { && !"0".equals(calResult.getValue())) {
scoreValues.add(calResult.getValue()); scoreValues.add(calResult.getScore());
} }
indCount += 1; indCount += 1;
//得分类型:0 指标值直接参与计算 //得分类型:0 指标值直接参与计算
...@@ -239,7 +239,7 @@ public class TestScoreRuleService { ...@@ -239,7 +239,7 @@ public class TestScoreRuleService {
if(!"NaN".equals(calresultOp.getValue()) && !"Infinite".equals(calresultOp.getValue()) if(!"NaN".equals(calresultOp.getValue()) && !"Infinite".equals(calresultOp.getValue())
// && !"0.0000".equals(calResult.getValue()) // && !"0.0000".equals(calResult.getValue())
&& !"0".equals(calresultOp.getValue())) { && !"0".equals(calresultOp.getValue())) {
scoreTmpSumValue+=Double.parseDouble(calresultOp.getValue()); scoreTmpSumValue+=Double.parseDouble(calresultOp.getScore());
} }
//得分类型:0 指标值直接参与计算 //得分类型:0 指标值直接参与计算
if("0".equals(scoreRule.getScoreType())) { if("0".equals(scoreRule.getScoreType())) {
...@@ -374,7 +374,7 @@ public class TestScoreRuleService { ...@@ -374,7 +374,7 @@ public class TestScoreRuleService {
if(!"NaN".equals(calResult.getValue()) && !"Infinite".equals(calResult.getValue()) if(!"NaN".equals(calResult.getValue()) && !"Infinite".equals(calResult.getValue())
// && !"0.0000".equals(calResult.getValue()) // && !"0.0000".equals(calResult.getValue())
&& !"0".equals(calResult.getValue())) { && !"0".equals(calResult.getValue())) {
scoreValues.add(calResult.getValue()); scoreValues.add(calResult.getScore());
} }
if("0".equals(scoreRule.getScoreType())) { if("0".equals(scoreRule.getScoreType())) {
if(!"NaN".equals(calResult.getValue()) && !"Infinite".equals(calResult.getValue()) if(!"NaN".equals(calResult.getValue()) && !"Infinite".equals(calResult.getValue())
......
...@@ -9,12 +9,18 @@ spring: ...@@ -9,12 +9,18 @@ spring:
username: test username: test
password: test password: test
hikari: hikari:
maximum-pool-size: 3 connectionTimeout: 60000
idleTimeout: 60000
validationTimeout: 3000
maxLifetime: 60000
loginTimeout: 5
maximumPoolSize: 60
minimumIdle: 10
servlet: servlet:
multipart: multipart:
max-file-size: 20Mb max-file-size: 20Mb
max-request-size: 100Mb max-request-size: 100Mb
location: /home/deploy/data/upload_tmp location: D://afile #/home/deploy/data/upload_tmp
session: session:
store-type: redis store-type: redis
redis: redis:
...@@ -29,7 +35,7 @@ server: ...@@ -29,7 +35,7 @@ server:
eureka: eureka:
client: client:
registerWithEureka: true registerWithEureka: false
region: default region: default
registryFetchIntervalSeconds: 5 registryFetchIntervalSeconds: 5
serviceUrl: serviceUrl:
...@@ -63,8 +69,10 @@ mybatis: ...@@ -63,8 +69,10 @@ mybatis:
logging: logging:
level: level:
com.keymobile.indicators: dubeg com.keymobile.indicators: info
config: classpath:logback-custom.xml config: classpath:logback-custom.xml
uploadfile: uploadfile:
path: /home/deploy/uploadfile path: /home/deploy/uploadfile
\ No newline at end of file
isClearAllPools: true
\ No newline at end of file
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