Browse Source

Merge remote-tracking branch 'remotes/origin/dev_screen_data_2.0' into dev_temp

dev_shibei_match
jianjun 5 years ago
parent
commit
09a13ba3a7
  1. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/backdoor/BackDoorController.java
  2. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/backdoor/impl/BackDoorServiceImpl.java
  3. 40
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java
  4. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java
  5. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  6. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
  7. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/backdoor/BackDoorController.java

@ -17,8 +17,8 @@ public class BackDoorController {
private BackDoorService backDoorService; private BackDoorService backDoorService;
@PostMapping("backdoor") @PostMapping("backdoor")
public Result backDoor(@RequestHeader("Data-Type")String dataType, @RequestHeader("AppId")String appId, @RequestHeader("target")String target, @RequestBody Object o){ public Object backDoor(@RequestHeader("Data-Type")String dataType, @RequestHeader("AppId")String appId, @RequestHeader("target")String target, @RequestBody(required = false) Object o){
return new Result().ok(backDoorService.backDoor(dataType,appId,target,o)); return backDoorService.backDoor(dataType,appId,target,o);
} }
} }

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/backdoor/impl/BackDoorServiceImpl.java

@ -41,7 +41,7 @@ public class BackDoorServiceImpl implements BackDoorService {
headerMap.put("AuthType","jwt"); headerMap.put("AuthType","jwt");
headerMap.put("Data-Type",dataType); headerMap.put("Data-Type",dataType);
Result<String> stringResult = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(o),headerMap); Result<String> stringResult = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(o),headerMap);
log.info(JSON.toJSONString(stringResult),stringResult.error()); log.info(JSON.toJSONString(stringResult));
if (!stringResult.success()){ if (!stringResult.success()){
throw new RenException("请求【"+url+"】失败......"+stringResult.error()); throw new RenException("请求【"+url+"】失败......"+stringResult.error());
} }

40
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java

@ -5,6 +5,8 @@ import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.ProjectDTO; import com.epmet.dto.ProjectDTO;
import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
@ -32,10 +34,10 @@ import com.epmet.service.project.ProjectService;
import com.epmet.service.topic.TopicService; import com.epmet.service.topic.TopicService;
import com.epmet.util.DimIdGenerator; import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.apache.commons.collections4.CollectionUtils;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
@ -86,9 +88,9 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
if (!CollectionUtils.isEmpty(closedList)) { if (!CollectionUtils.isEmpty(closedList)) {
List<FactOriginProjectMainDailyEntity> closeProjects = List<FactOriginProjectMainDailyEntity> closeProjects =
pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> { pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> {
FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity();
entity.setId(process.getProjectId()); entity.setId(process.getProjectId());
entity.setProjectStatus("closed"); entity.setProjectStatus(ProjectConstant.CLOSED);
entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD)); entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD));
entity.setUpdatedTime(process.getUpdatedTime()); entity.setUpdatedTime(process.getUpdatedTime());
entity.setIsResolved(process.getIsResolved()); entity.setIsResolved(process.getIsResolved());
@ -214,11 +216,11 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
entity.setIsActive(NumConstant.ONE); entity.setIsActive(NumConstant.ONE);
entity.setPids(process.getPids()); entity.setPids(process.getPids());
if (StringUtils.isNotBlank(process.getDepartmentId())) { if (StringUtils.isNotBlank(process.getDepartmentId())) {
entity.setOrgType("department"); entity.setOrgType(OrgTypeConstant.DEPARTMENT);
entity.setOrgId(process.getDepartmentId()); entity.setOrgId(process.getDepartmentId());
entity.setPid(process.getAgencyId()); entity.setPid(process.getAgencyId());
}else if (StringUtils.isNotBlank(process.getGridId())) { }else if (StringUtils.isNotBlank(process.getGridId())) {
entity.setOrgType("grid"); entity.setOrgType(OrgTypeConstant.GRID);
entity.setOrgId(process.getGridId()); entity.setOrgId(process.getGridId());
entity.setPid(process.getAgencyId()); entity.setPid(process.getAgencyId());
}else{ }else{
@ -264,11 +266,11 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
entity.setIsActive(NumConstant.ONE); entity.setIsActive(NumConstant.ONE);
entity.setPids(process.getPids()); entity.setPids(process.getPids());
if (StringUtils.isNotBlank(process.getDepartmentId())) { if (StringUtils.isNotBlank(process.getDepartmentId())) {
entity.setOrgType("department"); entity.setOrgType(OrgTypeConstant.DEPARTMENT);
entity.setOrgId(process.getDepartmentId()); entity.setOrgId(process.getDepartmentId());
entity.setPid(process.getAgencyId()); entity.setPid(process.getAgencyId());
} else if (StringUtils.isNotBlank(process.getGridId())) { } else if (StringUtils.isNotBlank(process.getGridId())) {
entity.setOrgType("grid"); entity.setOrgType(OrgTypeConstant.GRID);
entity.setOrgId(process.getGridId()); entity.setOrgId(process.getGridId());
entity.setPid(process.getAgencyId()); entity.setPid(process.getAgencyId());
} else { } else {
@ -319,7 +321,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
entity.setActionCode(process.getOperation()); entity.setActionCode(process.getOperation());
entity.setIsActive(NumConstant.ONE); entity.setIsActive(NumConstant.ONE);
entity.setOrgId(process.getGridId()); entity.setOrgId(process.getGridId());
entity.setOrgType("grid"); entity.setOrgType(OrgTypeConstant.GRID);
entity.setPids(process.getPids()); entity.setPids(process.getPids());
entity.setPid(process.getPid()); entity.setPid(process.getPid());
return entity; return entity;
@ -344,11 +346,11 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
entity.setIsActive(NumConstant.ZERO); entity.setIsActive(NumConstant.ZERO);
entity.setPids(process.getPids()); entity.setPids(process.getPids());
if (StringUtils.isNotBlank(process.getDepartmentId())) { if (StringUtils.isNotBlank(process.getDepartmentId())) {
entity.setOrgType("department"); entity.setOrgType(OrgTypeConstant.DEPARTMENT);
entity.setOrgId(process.getDepartmentId()); entity.setOrgId(process.getDepartmentId());
entity.setPid(process.getAgencyId()); entity.setPid(process.getAgencyId());
}else if (StringUtils.isNotBlank(process.getGridId())) { }else if (StringUtils.isNotBlank(process.getGridId())) {
entity.setOrgType("grid"); entity.setOrgType(OrgTypeConstant.GRID);
entity.setOrgId(process.getGridId()); entity.setOrgId(process.getGridId());
entity.setPid(process.getAgencyId()); entity.setPid(process.getAgencyId());
}else{ }else{
@ -405,21 +407,21 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
dest.setOrgType("dept"); dest.setOrgType("dept");
dest.setPid(original.getOrgId()); dest.setPid(original.getOrgId());
dest.setPids(original.getOrgIdPath()); dest.setPids(original.getOrgIdPath());
}else if(StringUtils.isNotBlank(original.getGridId())){ }else if(StringUtils.isNotBlank(original.getGridId())) {
dest.setOrgType("grid"); dest.setOrgType(OrgTypeConstant.GRID);
dest.setPid(original.getOrgId()); dest.setPid(original.getOrgId());
dest.setPids(original.getOrgIdPath()); dest.setPids(original.getOrgIdPath());
}else{ }else {
dest.setOrgType("agency"); dest.setOrgType(OrgTypeConstant.AGENCY);
dest.setPids(""); dest.setPids("");
String[] array = original.getOrgIdPath().split(StrConstant.COLON); String[] array = original.getOrgIdPath().split(StrConstant.COLON);
if(array.length <= NumConstant.ZERO){ if (array.length <= NumConstant.ZERO) {
dest.setPid(NumConstant.ZERO_STR); dest.setPid(NumConstant.ZERO_STR);
} }
if(array[NumConstant.ZERO].equals(original.getOrgId()) && array.length == NumConstant.ONE){ if (array[NumConstant.ZERO].equals(original.getOrgId()) && array.length == NumConstant.ONE) {
dest.setPid(NumConstant.ZERO_STR); dest.setPid(NumConstant.ZERO_STR);
} }
if(array.length > NumConstant.ONE && original.getOrgId().equals(array[array.length - NumConstant.ONE])){ if (array.length > NumConstant.ONE && original.getOrgId().equals(array[array.length - NumConstant.ONE])) {
dest.setPid(array[array.length - NumConstant.TWO]); dest.setPid(array[array.length - NumConstant.TWO]);
dest.setPids(original.getOrgIdPath().replace(original.getOrgId(),"")); dest.setPids(original.getOrgIdPath().replace(original.getOrgId(),""));
} }
@ -457,7 +459,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
*/ */
private Integer getDetentionDays(String id, Date startDate, Date endDate) { private Integer getDetentionDays(String id, Date startDate, Date endDate) {
int result; int result;
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
List<WorkDayFormDTO> list = new ArrayList<>(); List<WorkDayFormDTO> list = new ArrayList<>();
WorkDayFormDTO workDayFormDTO = new WorkDayFormDTO(); WorkDayFormDTO workDayFormDTO = new WorkDayFormDTO();

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java

@ -197,7 +197,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
if (CollectionUtils.isEmpty(detailListByParentCode)) { if (CollectionUtils.isEmpty(detailListByParentCode)) {
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return false; return true;
} }
List<IndexInputVO> indexInputVOS = new ArrayList<>(); List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>(); Map<String, String> pid = new HashMap<>();
@ -272,7 +272,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
if (CollectionUtils.isEmpty(detailListByParentCode)) { if (CollectionUtils.isEmpty(detailListByParentCode)) {
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return false; return true;
} }
List<IndexInputVO> indexInputVOS = new ArrayList<>(); List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>(); Map<String, String> pid = new HashMap<>();
@ -344,7 +344,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode());
if (CollectionUtils.isEmpty(detailListByParentCode)) { if (CollectionUtils.isEmpty(detailListByParentCode)) {
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return false; return true;
} }
List<IndexInputVO> indexInputVOS = new ArrayList<>(); List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>(); Map<String, String> pid = new HashMap<>();

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java

@ -194,7 +194,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<IndexGroupDetailEntity> indexDetailList = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); List<IndexGroupDetailEntity> indexDetailList = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
if (CollectionUtils.isEmpty(indexDetailList)) { if (CollectionUtils.isEmpty(indexDetailList)) {
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return false; return true;
} }
List<IndexInputVO> indexInputVOS = new ArrayList<>(); List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>(); Map<String, String> pid = new HashMap<>();
@ -271,7 +271,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
if (CollectionUtils.isEmpty(detailListByParentCode)) { if (CollectionUtils.isEmpty(detailListByParentCode)) {
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return false; return true;
} }
List<IndexInputVO> indexInputVOS = new ArrayList<>(); List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>(); Map<String, String> pid = new HashMap<>();
@ -350,7 +350,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode());
if (CollectionUtils.isEmpty(detailListByParentCode)) { if (CollectionUtils.isEmpty(detailListByParentCode)) {
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return false; return true;
} }
List<IndexInputVO> indexInputVOS = new ArrayList<>(); List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>(); Map<String, String> pid = new HashMap<>();

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java

@ -198,7 +198,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
if (CollectionUtils.isEmpty(detailListByParentCode)) { if (CollectionUtils.isEmpty(detailListByParentCode)) {
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return false; return true;
} }
List<IndexInputVO> indexInputVOS = new ArrayList<>(); List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>(); Map<String, String> pid = new HashMap<>();
@ -273,7 +273,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
if (CollectionUtils.isEmpty(detailListByParentCode)) { if (CollectionUtils.isEmpty(detailListByParentCode)) {
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return false; return true;
} }
List<IndexInputVO> indexInputVOS = new ArrayList<>(); List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>(); Map<String, String> pid = new HashMap<>();
@ -345,7 +345,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode());
if (CollectionUtils.isEmpty(detailListByParentCode)) { if (CollectionUtils.isEmpty(detailListByParentCode)) {
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return false; return true;
} }
List<IndexInputVO> indexInputVOS = new ArrayList<>(); List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>(); Map<String, String> pid = new HashMap<>();

34
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java

@ -66,22 +66,24 @@ public class BatchScoreCalculator {
BigDecimal minScoreValue = idx.getScoreCalculator().getMinScore(); BigDecimal minScoreValue = idx.getScoreCalculator().getMinScore();
BigDecimal maxScoreValue = idx.getScoreCalculator().getMaxScore(); BigDecimal maxScoreValue = idx.getScoreCalculator().getMaxScore();
if (idx.getScoreCalculator().getMaxValue().compareTo(idx.getScoreCalculator().getMinValue()) == 0) {
//*((max-min)/ (Math.PI/2))+min //1.如果是分数值(平均值)不需要归一 则 直接value*权重
//Math.atan(new Double(vo.getSampleValue().toString()))* //2.否则 先判断 样本值是否相等 是:反正切函数 否:归一算法
normalizeValue = new BigDecimal(Math.atan(new Double(getFinalSampleValue(vo.getSampleValue(), threshold).toString()))) if (idx.isScore()) {
.multiply( vo.setSampleValue(new BigDecimal(vo.getSampleValue().toString()).compareTo(NumConstant.ZERO_DECIMAL) == NumConstant.ZERO ? ScoreConstants.MIN_SCORE : new BigDecimal(vo.getSampleValue().toString()));
(maxScoreValue.subtract(minScoreValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP))) normalizeValue = getFinalSampleValue(vo.getSampleValue(), threshold);
.add(minScoreValue).setScale(6, RoundingMode.HALF_UP); } else {
// if (idx.getScoreCalculator().getMaxValue().compareTo(idx.getScoreCalculator().getMinValue()) == 0) {
if (scoreCalculator.getCorrelation().getCode().equals(Correlation.NEGATIVE)) { //*((max-min)/ (Math.PI/2))+min
normalizeValue = maxScoreValue.subtract(normalizeValue); //Math.atan(new Double(vo.getSampleValue().toString()))*
} normalizeValue = new BigDecimal(Math.atan(new Double(getFinalSampleValue(vo.getSampleValue(), threshold).toString())))
}else { .multiply(
//如果不需要归一 则 直接value*权重 (maxScoreValue.subtract(minScoreValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP)))
if (idx.isScore()) { .add(minScoreValue).setScale(6, RoundingMode.HALF_UP);
vo.setSampleValue(new BigDecimal(vo.getSampleValue().toString()).compareTo(NumConstant.ZERO_DECIMAL) == NumConstant.ZERO ? ScoreConstants.MIN_SCORE : new BigDecimal(vo.getSampleValue().toString())); //
normalizeValue = getFinalSampleValue(vo.getSampleValue(), threshold); if (scoreCalculator.getCorrelation().getCode().equals(Correlation.NEGATIVE)) {
normalizeValue = maxScoreValue.subtract(normalizeValue);
}
} else { } else {
normalizeValue = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold)); normalizeValue = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold));
} }

Loading…
Cancel
Save