diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java index 7e10d1c6f4..af8291beaa 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PeerComparisonFormDTO.java @@ -22,7 +22,7 @@ public class PeerComparisonFormDTO implements Serializable { /** * 月份Id(格式:202009) */ - @NotBlank(message = "月份ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) + //@NotBlank(message = "月份ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) private String monthId; /** * 组织或网格Id diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index 872210194d..a133a5dab4 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -218,8 +218,7 @@ public class IndexServiceImpl implements IndexService { } else if (ScreenConstant.MONTH_ID.equals(formDTO.getType())) { // 月(上一个月) 指数排行 if (StringUtils.isBlank(formDTO.getMonthId())) { - String monthId = com.epmet.commons.tools.utils.DateUtils.format(com.epmet.commons.tools.utils.DateUtils.addDateMonths(new Date(), -1), "yyyyMMdd"); - formDTO.setMonthId(monthId); + formDTO.setMonthId(DateUtils.getBeforeNMonth(1)); } subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyOrGridIndexMonthlyRank(formDTO); subAgencyIndexRankResultDTOS.forEach(rank -> { diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java index 678890b7da..e796935094 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java @@ -3,6 +3,7 @@ package com.epmet.datareport.service.fact.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.constant.FactConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; @@ -457,6 +458,9 @@ public class FactIndexServiceImpl implements FactIndexService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) public List peerComparison(PeerComparisonFormDTO formDTO) { //1.根据组织或网格Id的上级组织Id查询同级组织或网格对应类型的得分排名(按月查询) + if (null == formDTO.getMonthId() || "".equals(formDTO.getMonthId())) { + formDTO.setMonthId(DateUtils.getBeforeNMonth(1)); + } List resultList = screenIndexDataMonthlyDao.selectScoreList(formDTO); return resultList; }