Browse Source

Merge remote-tracking branch 'remotes/origin/dev'

dev_shibei_match
jianjun 5 years ago
parent
commit
6a771ce584
  1. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthPieChartResultDTO.java
  2. 28
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java
  3. 5
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
  4. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java
  5. 6
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthPieChartResultDTO.java

@ -27,4 +27,9 @@ public class MonthPieChartResultDTO implements Serializable {
* 治理能力
*/
private Double governAbility = 0.0;
/**
* 月份Id
*/
private String monthId;
}

28
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java

@ -57,7 +57,7 @@ public class IndexServiceImpl implements IndexService {
yearAverageIndexResultDTO.setPartyDevAbility(getRound(yearAverageIndexResultDTO.getPartyDevAbility()));
yearAverageIndexResultDTO.setGovernAbility(getRound(yearAverageIndexResultDTO.getGovernAbility()));
yearAverageIndexResultDTO.setServiceAbility(getRound(yearAverageIndexResultDTO.getServiceAbility()));
yearAverageIndexResultDTO.setYearAverageIndex(yearAverageIndexResultDTO.getPartyDevAbility() + yearAverageIndexResultDTO.getGovernAbility() + yearAverageIndexResultDTO.getServiceAbility());
yearAverageIndexResultDTO.setYearAverageIndex(getRound(yearAverageIndexResultDTO.getPartyDevAbility() + yearAverageIndexResultDTO.getGovernAbility() + yearAverageIndexResultDTO.getServiceAbility()));
return yearAverageIndexResultDTO;
}
@ -71,22 +71,22 @@ public class IndexServiceImpl implements IndexService {
@Override
public MonthPieChartResultDTO monthPieChart(MonthPieChartFormDTO monthPieChartFormDTO) {
MonthPieChartResultDTO pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(),null);
if (null == pieChartDTO){
MonthPieChartResultDTO pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(), null);
String monthId = dateUtils.getCurrentMonthId();
int time = NumConstant.TWELVE;
//保证获取月度指数数据的最大可能性
while ((null == pieChartDTO || StringUtils.isBlank(pieChartDTO.getMonthId())) && time > NumConstant.ONE) {
time--;
monthId = dateUtils.getPreviousMonthIdByDest(null, monthId);
pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(), monthId);
}
if (null == pieChartDTO) {
return new MonthPieChartResultDTO();
}
// 处理小数四舍五入
pieChartDTO.setPartyDevAbility(getRound(pieChartDTO.getPartyDevAbility()));
pieChartDTO.setGovernAbility(getRound(pieChartDTO.getGovernAbility()));
pieChartDTO.setServiceAbility(getRound(pieChartDTO.getServiceAbility()));
String monthId = dateUtils.getCurrentMonthId();
int time = NumConstant.TWELVE;
//保证获取月度指数数据的最大可能性
while(null == pieChartDTO && time > NumConstant.ONE){
time--;
monthId = dateUtils.getPreviousMonthIdByDest(null,monthId);
pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(),monthId);
}
return pieChartDTO;
}
@ -126,7 +126,7 @@ public class IndexServiceImpl implements IndexService {
barchart.setPartyDevAbility(getRound(barchart.getPartyDevAbility()));
barchart.setGovernAbility(getRound(barchart.getGovernAbility()));
barchart.setServiceAbility(getRound(barchart.getServiceAbility()));
barchart.setIndexTotal(barchart.getPartyDevAbility() + barchart.getGovernAbility() + barchart.getServiceAbility());
barchart.setIndexTotal(getRound(barchart.getPartyDevAbility() + barchart.getGovernAbility() + barchart.getServiceAbility()));
});
List<MonthBarchartResult> collect = monthBarchartResults.stream().sorted(Comparator.comparing(MonthBarchartResult::getMonthId)).collect(Collectors.toList());
//升序 当前月份在队尾
@ -199,7 +199,7 @@ public class IndexServiceImpl implements IndexService {
indexRank.setPartyDevAbility(getRound(indexRank.getPartyDevAbility()));
indexRank.setGovernAbility(getRound(indexRank.getGovernAbility()));
indexRank.setServiceAbility(getRound(indexRank.getServiceAbility()));
indexRank.setTotalIndex(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility());
indexRank.setTotalIndex(getRound(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility()));
});
return subAgencyIndexRankResultDTOS;
}
@ -218,7 +218,7 @@ public class IndexServiceImpl implements IndexService {
rank.setPartyDevAbility(getRound(rank.getPartyDevAbility()));
rank.setGovernAbility(getRound(rank.getGovernAbility()));
rank.setServiceAbility(getRound(rank.getServiceAbility()));
rank.setTotalIndex(rank.getPartyDevAbility() + rank.getGovernAbility() + rank.getServiceAbility());
rank.setTotalIndex(getRound(rank.getPartyDevAbility() + rank.getGovernAbility() + rank.getServiceAbility()));
});
}
return subAgencyIndexRankResultDTOS;

5
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

@ -8,7 +8,8 @@
SELECT
service_ablity * SERVICE_ABLITY_WEIGHT AS serviceAbility,
party_dev_ablity * PARTY_DEV_WEIGHT AS partyDevAbility,
govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility
govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility,
MONTH_ID
FROM
screen_index_data_monthly
WHERE
@ -67,7 +68,7 @@
org_name AS `NAME`,
service_ablity * SERVICE_ABLITY_WEIGHT AS serviceAbility,
party_dev_ablity * PARTY_DEV_WEIGHT AS partyDevAbility,
govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility
govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility,
ORG_ID orgId
FROM
screen_index_data_monthly

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

@ -86,7 +86,10 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
Map<String, CpcScoreEntity> cpcScoreTotalMap = new HashMap<>();
Map<String, AtomicInteger> userTotalCount = new HashMap<>();
//删除总分 然后插入
cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCalConstant.DELETE_SIZE, NumConstant.ONE_STR);
int effectRow;
do {
effectRow = cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCalConstant.DELETE_SIZE, NumConstant.ONE_STR);
} while (effectRow > NumConstant.ZERO);
do {
List<CpcScoreEntity> result = new ArrayList<>();
//获取数据

6
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java

@ -75,13 +75,13 @@ public class ExtAppJwtTokenUtils {
public static void genToken() {
HashMap<String, Object> claim = new HashMap<>();
claim.put("appId", "2c448b7da527055fbeebb628f8d3dcb0");
claim.put("customerId", "c1");
claim.put("appId", "acc4ad66c82a7b46e741364b4c62dce2");
claim.put("customerId", "b09527201c4409e19d1dbc5e3c3429a1");
long ts = System.currentTimeMillis() - 1000 * 60 * 4;
System.out.println("时间戳:" + ts);
claim.put("ts", ts);
String abc = new ExtAppJwtTokenUtils().createToken(claim, "d4b73db4cf8e46ef99fa1f95149c2791ef2396fded114dd09e406cbce83fc88a");
String abc = new ExtAppJwtTokenUtils().createToken(claim, "612d304095c50369c3ef06e490f05779eeb8f19ff16566c73aeafafc5fa01970");
System.out.println(abc);
}

Loading…
Cancel
Save