|
|
@ -6,7 +6,6 @@ import com.epmet.constant.DataSourceConstant; |
|
|
|
import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao; |
|
|
|
import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataYearlyDao; |
|
|
|
import com.epmet.datareport.service.evaluationindex.screen.IndexService; |
|
|
|
import com.epmet.datareport.utils.DateUtils; |
|
|
|
import com.epmet.evaluationindex.screen.constant.ScreenConstant; |
|
|
|
import com.epmet.evaluationindex.screen.dto.form.*; |
|
|
|
import com.epmet.evaluationindex.screen.dto.result.*; |
|
|
@ -19,6 +18,7 @@ import java.math.BigDecimal; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Comparator; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
@ -39,7 +39,7 @@ public class IndexServiceImpl implements IndexService { |
|
|
|
@Autowired |
|
|
|
private PartyMemberLeadServiceImpl partyMemberLeadServiceImpl; |
|
|
|
@Autowired |
|
|
|
private DateUtils dateUtils; |
|
|
|
private com.epmet.datareport.utils.DateUtils dateUtils; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 1、年度平均指数 |
|
|
@ -204,16 +204,20 @@ public class IndexServiceImpl implements IndexService { |
|
|
|
return subAgencyIndexRankResultDTOS; |
|
|
|
} |
|
|
|
|
|
|
|
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) |
|
|
|
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) |
|
|
|
@Override |
|
|
|
public List<AnNingSubAgencyIndexRankResultDTO> anNingSubAgencyIndexRank(AnNingSubAgencyIndexRankFormDTO formDTO) { |
|
|
|
public List<AnNingSubAgencyIndexRankResultDTO> getSubAgencyIndexRank(SubAgencyIndexRankYMFormDTO formDTO) { |
|
|
|
List<AnNingSubAgencyIndexRankResultDTO> subAgencyIndexRankResultDTOS = new ArrayList<>(); |
|
|
|
if (ScreenConstant.YEAR_ID.equals(formDTO.getType())){ |
|
|
|
if (ScreenConstant.YEAR_ID.equals(formDTO.getType())) { |
|
|
|
// 年 指数排行
|
|
|
|
subAgencyIndexRankResultDTOS = screenIndexDataYearlyDao.selectAnNingSubAgencyIndexYearlyRank(formDTO); |
|
|
|
} else if (ScreenConstant.MONTH_ID.equals(formDTO.getType())){ |
|
|
|
} else if (ScreenConstant.MONTH_ID.equals(formDTO.getType())) { |
|
|
|
// 月(上一个月) 指数排行
|
|
|
|
subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectAnNingSubAgencyIndexMonthlyRank(formDTO); |
|
|
|
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); |
|
|
|
} |
|
|
|
subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyOrGridIndexMonthlyRank(formDTO); |
|
|
|
subAgencyIndexRankResultDTOS.forEach(rank -> { |
|
|
|
rank.setPartyDevAbility(getRound(rank.getPartyDevAbility())); |
|
|
|
rank.setGovernAbility(getRound(rank.getGovernAbility())); |
|
|
|