diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index f502b0f471..abb857fb14 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java @@ -39,7 +39,7 @@ public interface ScreenIndexDataMonthlyDao{ * @author zxc * @date 2020/8/19 3:43 下午 */ - MonthPieChartResultDTO selectMonthPieChart(@Param("agencyId")String agencyId,@Param("monthId")String monthId); + MonthPieChartResultDTO selectMonthPieChart(@Param("agencyId")String agencyId,@Param("monthId")String monthId,@Param("customerId")String customerId); /** * @Description 查询近一年的指数值【不包括本月】 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 831aa3ae36..7b873568f9 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 @@ -73,15 +73,15 @@ public class IndexServiceImpl implements IndexService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public MonthPieChartResultDTO monthPieChart(MonthPieChartFormDTO monthPieChartFormDTO) { - - MonthPieChartResultDTO pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(), null); + String customerId = monthPieChartFormDTO.getCustomerId(); + MonthPieChartResultDTO pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(), null,customerId); 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); + pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(), monthId,customerId); } if (null == pieChartDTO) { return new MonthPieChartResultDTO(); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 75850f0749..7e114d857c 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -16,7 +16,8 @@ del_flag = '0' AND org_type = 'agency' AND org_id = #{agencyId} - + AND CUSTOMER_ID = #{customerId} + AND month_id = DATE_FORMAT(NOW(),'%Y%m')