|
@ -1,9 +1,11 @@ |
|
|
package com.epmet.service.indexcal.impl; |
|
|
package com.epmet.service.indexcal.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
import com.epmet.constant.IndexCalConstant; |
|
|
import com.epmet.constant.IndexCalConstant; |
|
|
import com.epmet.dao.indexcoll.FactIndexGovrnAblityGridMonthlyDao; |
|
|
import com.epmet.dao.indexcoll.FactIndexGovrnAblityGridMonthlyDao; |
|
|
import com.epmet.dao.indexcoll.FactIndexPartyAblityGridMonthlyDao; |
|
|
import com.epmet.dao.indexcoll.FactIndexPartyAblityGridMonthlyDao; |
|
@ -68,6 +70,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { |
|
|
* @description 网格相关,分值计算 |
|
|
* @description 网格相关,分值计算 |
|
|
* @Date 2020/8/26 10:51 |
|
|
* @Date 2020/8/26 10:51 |
|
|
**/ |
|
|
**/ |
|
|
|
|
|
@DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) |
|
|
@Override |
|
|
@Override |
|
|
public Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO) { |
|
|
public Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO) { |
|
|
boolean resultFlag = false; |
|
|
boolean resultFlag = false; |
|
@ -127,7 +130,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { |
|
|
//查询总记录数
|
|
|
//查询总记录数
|
|
|
int total = factIndexPartyAblityGridMonthlyDao.selectCount(formDTO); |
|
|
int total = factIndexPartyAblityGridMonthlyDao.selectCount(formDTO); |
|
|
if (NumConstant.ZERO == total) { |
|
|
if (NumConstant.ZERO == total) { |
|
|
logger.info(String.format("customerId:%s,monthId:%s,没有上传网格相关-党建能力-五级指标数据"), formDTO.getCustomerId(), formDTO.getMonthId()); |
|
|
logger.warn(String.format("customerId=%s,monthId=%s,没有上传网格相关-党建能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
//总页数,进行批量查询,批量计算
|
|
|
//总页数,进行批量查询,批量计算
|
|
@ -155,6 +158,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { |
|
|
recordList.forEach(recordMap -> { |
|
|
recordList.forEach(recordMap -> { |
|
|
//遍历所有的指标
|
|
|
//遍历所有的指标
|
|
|
indexMap.forEach((key, value) -> { |
|
|
indexMap.forEach((key, value) -> { |
|
|
|
|
|
logger.info("index_code :{}",key); |
|
|
//列名不为空
|
|
|
//列名不为空
|
|
|
if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { |
|
|
if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { |
|
|
//对应的数值
|
|
|
//对应的数值
|
|
@ -371,7 +375,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { |
|
|
logger.error("index_code:{} ",index.getIndexCode(),"not find field_name"); |
|
|
logger.error("index_code:{} ",index.getIndexCode(),"not find field_name"); |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
logger.info("index_code:{} ",index.getIndexCode(),"field_id :{} ",fieldName); |
|
|
// logger.info("index_code:{} ",index.getIndexCode(),"field_id :{} ",fieldName);
|
|
|
String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); |
|
|
String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); |
|
|
String maxValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MAX); |
|
|
String maxValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MAX); |
|
|
minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); |
|
|
minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); |
|
@ -409,7 +413,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { |
|
|
//查询总记录数
|
|
|
//查询总记录数
|
|
|
int total = factIndexGovrnAblityGridMonthlyDao.selectCount(formDTO); |
|
|
int total = factIndexGovrnAblityGridMonthlyDao.selectCount(formDTO); |
|
|
if (NumConstant.ZERO == total) { |
|
|
if (NumConstant.ZERO == total) { |
|
|
logger.info(String.format("customerId:%s,monthId:%s,没有上传网格相关-治理能力-五级指标数据"), formDTO.getCustomerId(), formDTO.getMonthId()); |
|
|
logger.warn(String.format("customerId%s,monthId%s,没有上传网格相关-治理能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
//总页数,进行批量查询,批量计算
|
|
|
//总页数,进行批量查询,批量计算
|
|
@ -473,7 +477,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { |
|
|
//查询总记录数
|
|
|
//查询总记录数
|
|
|
int total = factIndexGovrnAblityGridMonthlyDao.selectCount(formDTO); |
|
|
int total = factIndexGovrnAblityGridMonthlyDao.selectCount(formDTO); |
|
|
if (NumConstant.ZERO == total) { |
|
|
if (NumConstant.ZERO == total) { |
|
|
logger.info(String.format("customerId:%s,monthId:%s,没有上传网格相关-服务能力-五级指标数据"), formDTO.getCustomerId(), formDTO.getMonthId()); |
|
|
logger.warn(String.format("customerId:%s,monthId:%s,没有上传网格相关-服务能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
//总页数,进行批量查询,批量计算
|
|
|
//总页数,进行批量查询,批量计算
|
|
|