药剂分析组件接口开发
正在显示
6 个修改的文件
包含
111 行增加
和
29 行删除
... | @@ -363,4 +363,21 @@ public class ReportItemvService { | ... | @@ -363,4 +363,21 @@ public class ReportItemvService { |
363 | sql += " ) bbb "; | 363 | sql += " ) bbb "; |
364 | return sql ; | 364 | return sql ; |
365 | } | 365 | } |
366 | |||
367 | public List<FRportlCommandCenterVO> statisticsByYh(String departIds, String startDate, String endDate) { | ||
368 | String startDateTb = DateUtils.getTbDate(startDate); | ||
369 | String endDateTb = DateUtils.getTbDate(endDate); | ||
370 | String startDateHb = DateUtils.getHbDate(startDate); | ||
371 | String endDateHb = DateUtils.getHbDate(endDate); | ||
372 | //药剂SQL | ||
373 | String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, ReportConstant.fieldYj, departIds, startDate, endDate); | ||
374 | String dataViewName3a24Tb = ReportViewUtil.buildView(ReportConstant.view3a24, ReportConstant.fieldYj, departIds, startDateTb, endDateTb); | ||
375 | String dataViewName3a24Hb = ReportViewUtil.buildView(ReportConstant.view3a24, ReportConstant.fieldYj, departIds, startDateHb, endDateHb); | ||
376 | //处理水量 | ||
377 | String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119, ReportConstant.fieldClsl, departIds, startDate, endDate); | ||
378 | String dataViewName2119Tb = ReportViewUtil.buildView(ReportConstant.view2119, ReportConstant.fieldClsl, departIds, startDateTb, endDateTb); | ||
379 | String dataViewName2119Hb = ReportViewUtil.buildView(ReportConstant.view2119, ReportConstant.fieldClsl, departIds, startDateHb, endDateHb); | ||
380 | |||
381 | return null; | ||
382 | } | ||
366 | } | 383 | } | ... | ... |
sk-module-biz/src/main/java/com/skua/modules/dataAnalysis/controller/SysCommandCentreController.java
... | @@ -57,16 +57,20 @@ public class SysCommandCentreController { | ... | @@ -57,16 +57,20 @@ public class SysCommandCentreController { |
57 | @AutoLog(value = "指挥中心-水量查询") | 57 | @AutoLog(value = "指挥中心-水量查询") |
58 | @ApiOperation(value="指挥中心-水量查询", notes="指挥中心-水量查询") | 58 | @ApiOperation(value="指挥中心-水量查询", notes="指挥中心-水量查询") |
59 | @GetMapping(value = "/statisticsByWaterData") | 59 | @GetMapping(value = "/statisticsByWaterData") |
60 | public Result<List<FRportlCommandCenterVO>> statisticsByWaterData(ReportItemvParam reportItemvParam) throws Exception{ | 60 | public Result<List<FRportlCommandCenterVO>> statisticsByWaterData(ReportItemvParam reportItemvParam) { |
61 | Result<List<FRportlCommandCenterVO> > result = new Result<>(); | 61 | Result<List<FRportlCommandCenterVO> > result = new Result<>(); |
62 | List<FRportlCommandCenterVO> fReportItemvList = new ArrayList<>();//返回集合对象 | 62 | List<FRportlCommandCenterVO> fReportItemvList = new ArrayList<>();//返回集合对象 |
63 | DateVO dateVO = new DateVO(reportItemvParam.getStartDate()); | 63 | DateVO dateVO = new DateVO(reportItemvParam.getStartDate()); |
64 | String departIds = BaseContextHandler.getDeparts(); | ||
65 | if(reportItemvParam.getDepartIds()!=null){ | ||
66 | departIds = reportItemvParam.getDepartIds(); | ||
67 | } | ||
64 | //本月数据 | 68 | //本月数据 |
65 | String monthCSL = reportItemvService.getSumCSL(BaseContextHandler.getDeparts(), dateVO.getNowMonthStartDate(), dateVO.getNowMonthEndDate()); | 69 | String monthCSL = reportItemvService.getSumCSL(departIds, dateVO.getNowMonthStartDate(), dateVO.getNowMonthEndDate()); |
66 | //环比 上月数据 | 70 | //环比 上月数据 |
67 | String lastMonthCSL = reportItemvService.getSumCSL(BaseContextHandler.getDeparts(), dateVO.getNowMonthStartDate(), dateVO.getNowMonthEndDate()); | 71 | String lastMonthCSL = reportItemvService.getSumCSL(departIds, dateVO.getNowMonthStartDate(), dateVO.getNowMonthEndDate()); |
68 | //同比 去年数据 | 72 | //同比 去年数据 |
69 | String lastYearCSL = reportItemvService.getSumCSL(BaseContextHandler.getDeparts(), dateVO.getLastYearMonthStartTime(), dateVO.getLastYearMonthEndTime()); | 73 | String lastYearCSL = reportItemvService.getSumCSL(departIds, dateVO.getLastYearMonthStartTime(), dateVO.getLastYearMonthEndTime()); |
70 | 74 | ||
71 | long nowDifferDay = DateUtils.differenceDay(dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); | 75 | long nowDifferDay = DateUtils.differenceDay(dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); |
72 | long lastMonthDifferDay = DateUtils.differenceDay(dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); | 76 | long lastMonthDifferDay = DateUtils.differenceDay(dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); |
... | @@ -93,9 +97,12 @@ public class SysCommandCentreController { | ... | @@ -93,9 +97,12 @@ public class SysCommandCentreController { |
93 | @ApiOperation(value="指挥中心-运行负荷率分析", notes="指挥中心-运行负荷率分析") | 97 | @ApiOperation(value="指挥中心-运行负荷率分析", notes="指挥中心-运行负荷率分析") |
94 | //指挥中心-运行负荷率分析 | 98 | //指挥中心-运行负荷率分析 |
95 | @GetMapping(value = "/statisticsByLoadRate") | 99 | @GetMapping(value = "/statisticsByLoadRate") |
96 | public Result<DepartLoadRateResultVO > statisticsByLoadRate(ReportItemvParam reportItemvParam) throws Exception { | 100 | public Result<DepartLoadRateResultVO > statisticsByLoadRate(ReportItemvParam reportItemvParam) { |
97 | Result<DepartLoadRateResultVO > result = new Result<>(); | 101 | Result<DepartLoadRateResultVO > result = new Result<>(); |
98 | String departIds = BaseContextHandler.getDeparts();//1818214519948836864,1711662624459804674 | 102 | String departIds = BaseContextHandler.getDeparts();//1818214519948836864,1711662624459804674 |
103 | if(reportItemvParam.getDepartIds()!=null){ | ||
104 | departIds = reportItemvParam.getDepartIds(); | ||
105 | } | ||
99 | Integer loadRateType = reportItemvParam.getLoadRateType(); | 106 | Integer loadRateType = reportItemvParam.getLoadRateType(); |
100 | if(loadRateType == null ) loadRateType = 1; | 107 | if(loadRateType == null ) loadRateType = 1; |
101 | DepartLoadRateResultVO departLoadRateResultVO = reportItemvService.statisticsByLoadRate( departIds,reportItemvParam.getStartDate(),reportItemvParam.getEndDate(), loadRateType); | 108 | DepartLoadRateResultVO departLoadRateResultVO = reportItemvService.statisticsByLoadRate( departIds,reportItemvParam.getStartDate(),reportItemvParam.getEndDate(), loadRateType); |
... | @@ -110,31 +117,25 @@ public class SysCommandCentreController { | ... | @@ -110,31 +117,25 @@ public class SysCommandCentreController { |
110 | @GetMapping("/getCLSLXQ") | 117 | @GetMapping("/getCLSLXQ") |
111 | public Result<List<WaterTreatmentVO>> getCLSLXQ(ReportItemvParam reportItemvParam){ | 118 | public Result<List<WaterTreatmentVO>> getCLSLXQ(ReportItemvParam reportItemvParam){ |
112 | Result<List<WaterTreatmentVO>> result = new Result<>(); | 119 | Result<List<WaterTreatmentVO>> result = new Result<>(); |
113 | List<WaterTreatmentVO> waterTrendVOList = commandCentreService.statisticsCLSLXQ(reportItemvParam.getStartDate(),reportItemvParam.getEndDate(), BaseContextHandler.getDeparts()); | 120 | String departIds = BaseContextHandler.getDeparts();//1818214519948836864,1711662624459804674 |
121 | if(reportItemvParam.getDepartIds()!=null){ | ||
122 | departIds = reportItemvParam.getDepartIds(); | ||
123 | } | ||
124 | List<WaterTreatmentVO> waterTrendVOList = commandCentreService.statisticsCLSLXQ(reportItemvParam.getStartDate(),reportItemvParam.getEndDate(), departIds); | ||
114 | result.setResult(waterTrendVOList ); | 125 | result.setResult(waterTrendVOList ); |
115 | return result; | 126 | return result; |
116 | } | 127 | } |
117 | /* @AutoLog(value = "指挥中心-运行负荷率分析") | ||
118 | @ApiOperation(value="指挥中心-运行负荷率分析---列表详情", notes="指挥中心-运行负荷率分析----列表详情") | ||
119 | //指挥中心-运行负荷率分析 | ||
120 | @GetMapping(value = "/statisticsByLoadRateList") | ||
121 | public Result< List<DepartLoadRateVO> > statisticsByLoadRateList(String startDate , String endDate) throws Exception { | ||
122 | Result< List<DepartLoadRateVO> > result = new Result<>(); | ||
123 | String departIds = BaseContextHandler.getDeparts();//1818214519948836864,1711662624459804674 | ||
124 | List<DepartLoadRateVO> departLoadRateResultVO = reportItemvService.statisticsByLoadRateList( departIds,startDate , endDate,null); | ||
125 | result.setSuccess(true); | ||
126 | result.setResult(departLoadRateResultVO); | ||
127 | return result; | ||
128 | }*/ | ||
129 | |||
130 | 128 | ||
131 | //cement水泥 electricity | 129 | //cement水泥 electricity |
132 | @AutoLog(value = "指挥中心-泥量统计") | 130 | @AutoLog(value = "指挥中心-泥量统计") |
133 | @ApiOperation(value="指挥中心-泥量统计", notes="指挥中心-泥量统计") | 131 | @ApiOperation(value="指挥中心-泥量统计", notes="指挥中心-泥量统计") |
134 | @GetMapping(value = "/statisticsByCement") | 132 | @GetMapping(value = "/statisticsByCement") |
135 | public Result<List<FRportlCommandCenterVO>> statisticsByCement(ReportItemvParam reportItemvParam) throws Exception { | 133 | public Result<List<FRportlCommandCenterVO>> statisticsByCement(ReportItemvParam reportItemvParam) { |
136 | Result<List<FRportlCommandCenterVO>> result = new Result(); | 134 | Result<List<FRportlCommandCenterVO>> result = new Result(); |
137 | String departIds = BaseContextHandler.getDeparts();//1818214519948836864,1711662624459804674 | 135 | String departIds = BaseContextHandler.getDeparts();//1818214519948836864,1711662624459804674 |
136 | if(reportItemvParam.getDepartIds()!=null){ | ||
137 | departIds = reportItemvParam.getDepartIds(); | ||
138 | } | ||
138 | List<FRportlCommandCenterVO> dataList = reportItemvService.statisticsByCement(departIds,reportItemvParam.getStartDate(),reportItemvParam.getEndDate()); | 139 | List<FRportlCommandCenterVO> dataList = reportItemvService.statisticsByCement(departIds,reportItemvParam.getStartDate(),reportItemvParam.getEndDate()); |
139 | result.setResult(dataList ); | 140 | result.setResult(dataList ); |
140 | return result; | 141 | return result; |
... | @@ -143,9 +144,12 @@ public class SysCommandCentreController { | ... | @@ -143,9 +144,12 @@ public class SysCommandCentreController { |
143 | @ApiOperation(value="指挥中心-泥量统计--详情列表", notes="指挥中心-泥量统计--详情列表") | 144 | @ApiOperation(value="指挥中心-泥量统计--详情列表", notes="指挥中心-泥量统计--详情列表") |
144 | //指挥中心-泥量统计--详情列表 | 145 | //指挥中心-泥量统计--详情列表 |
145 | @GetMapping(value = "/statisticsByCementList") | 146 | @GetMapping(value = "/statisticsByCementList") |
146 | public Result<List<ReportItemVO>> statisticsByCementList(ReportItemvParam reportItemvParam) throws Exception { | 147 | public Result<List<ReportItemVO>> statisticsByCementList(ReportItemvParam reportItemvParam) { |
147 | Result<List<ReportItemVO>> result = new Result(); | 148 | Result<List<ReportItemVO>> result = new Result(); |
148 | String departIds = BaseContextHandler.getDeparts();//1818214519948836864,1711662624459804674 | 149 | String departIds = BaseContextHandler.getDeparts();//1818214519948836864,1711662624459804674 |
150 | if(reportItemvParam.getDepartIds()!=null){ | ||
151 | departIds = reportItemvParam.getDepartIds(); | ||
152 | } | ||
149 | List<ReportItemVO> dataList = reportItemvService.statisticsByCementList(departIds,reportItemvParam.getStartDate(),reportItemvParam.getEndDate()); | 153 | List<ReportItemVO> dataList = reportItemvService.statisticsByCementList(departIds,reportItemvParam.getStartDate(),reportItemvParam.getEndDate()); |
150 | result.setResult(dataList ); | 154 | result.setResult(dataList ); |
151 | return result; | 155 | return result; |
... | @@ -156,34 +160,57 @@ public class SysCommandCentreController { | ... | @@ -156,34 +160,57 @@ public class SysCommandCentreController { |
156 | @AutoLog(value = "指挥中心-能耗分析") | 160 | @AutoLog(value = "指挥中心-能耗分析") |
157 | @ApiOperation(value="指挥中心-能耗分析", notes="指挥中心-能耗分析") | 161 | @ApiOperation(value="指挥中心-能耗分析", notes="指挥中心-能耗分析") |
158 | @GetMapping(value = "/statisticsByElectricity") | 162 | @GetMapping(value = "/statisticsByElectricity") |
159 | public Result<List<FRportlCommandCenterVO>> statisticsByElectricity(ReportItemvParam reportItemvParam) throws Exception { | 163 | public Result<List<FRportlCommandCenterVO>> statisticsByElectricity(ReportItemvParam reportItemvParam) { |
160 | Result<List<FRportlCommandCenterVO>> result = new Result(); | 164 | Result<List<FRportlCommandCenterVO>> result = new Result(); |
161 | String departId = BaseContextHandler.getDeparts(); | 165 | String departId = BaseContextHandler.getDeparts(); |
166 | if(reportItemvParam.getDepartIds()!=null){ | ||
167 | departId = reportItemvParam.getDepartIds(); | ||
168 | } | ||
162 | List<FRportlCommandCenterVO> dataList = reportItemvService.statisticsByElectricity(departId,reportItemvParam.getStartDate(),reportItemvParam.getEndDate()); | 169 | List<FRportlCommandCenterVO> dataList = reportItemvService.statisticsByElectricity(departId,reportItemvParam.getStartDate(),reportItemvParam.getEndDate()); |
163 | result.setResult(dataList ); | 170 | result.setResult(dataList ); |
164 | return result; | 171 | return result; |
165 | } | 172 | } |
173 | |||
174 | @AutoLog(value = "指挥中心-药耗分析") | ||
175 | @ApiOperation(value="指挥中心-药耗分析", notes="指挥中心-药耗分析") | ||
176 | @GetMapping(value = "/statisticsByYh") | ||
177 | public Result<List<FRportlCommandCenterVO>> statisticsByYh(ReportItemvParam reportItemvParam) { | ||
178 | Result<List<FRportlCommandCenterVO>> result = new Result(); | ||
179 | String departId = BaseContextHandler.getDeparts(); | ||
180 | if(reportItemvParam.getDepartIds()!=null){ | ||
181 | departId = reportItemvParam.getDepartIds(); | ||
182 | } | ||
183 | List<FRportlCommandCenterVO> dataList = reportItemvService.statisticsByYh(departId,reportItemvParam.getStartDate(),reportItemvParam.getEndDate()); | ||
184 | result.setResult(dataList); | ||
185 | return result; | ||
186 | } | ||
187 | |||
166 | @AutoLog(value = "指挥中心-能耗分析") | 188 | @AutoLog(value = "指挥中心-能耗分析") |
167 | @ApiOperation(value="指挥中心-能耗分析--详情列表", notes="指挥中心-能耗分析--详情列表") | 189 | @ApiOperation(value="指挥中心-能耗分析--详情列表", notes="指挥中心-能耗分析--详情列表") |
168 | @GetMapping(value = "/statisticsByElectricityList") | 190 | @GetMapping(value = "/statisticsByElectricityList") |
169 | public Result<List<ReportItemVO>> statisticsByElectricityList(ReportItemvParam reportItemvParam) throws Exception { | 191 | public Result<List<ReportItemVO>> statisticsByElectricityList(ReportItemvParam reportItemvParam) { |
170 | Result<List<ReportItemVO>> result = new Result(); | 192 | Result<List<ReportItemVO>> result = new Result(); |
171 | String departIds = BaseContextHandler.getDeparts();//1818214519948836864,1711662624459804674 | 193 | String departIds = BaseContextHandler.getDeparts();//1818214519948836864,1711662624459804674 |
194 | if(reportItemvParam.getDepartIds()!=null){ | ||
195 | departIds = reportItemvParam.getDepartIds(); | ||
196 | } | ||
172 | List<ReportItemVO> dataList = reportItemvService.statisticsByElectricityList(departIds,reportItemvParam.getStartDate(),reportItemvParam.getEndDate()); | 197 | List<ReportItemVO> dataList = reportItemvService.statisticsByElectricityList(departIds,reportItemvParam.getStartDate(),reportItemvParam.getEndDate()); |
173 | result.setResult(dataList ); | 198 | result.setResult(dataList ); |
174 | return result; | 199 | return result; |
175 | } | 200 | } |
176 | //cement水泥 electricity | 201 | |
177 | @AutoLog(value = "指挥中心-水量电耗趋势") | 202 | @AutoLog(value = "指挥中心-水量电耗趋势") |
178 | @ApiOperation(value="指挥中心-水量电耗趋势", notes="指挥中心-水量电耗趋势") | 203 | @ApiOperation(value="指挥中心-水量电耗趋势", notes="指挥中心-水量电耗趋势") |
179 | @GetMapping(value = "/statisticsBySewage") | 204 | @GetMapping(value = "/statisticsBySewage") |
180 | public Result<StackedAreaChartDataVO> statisticsBySewage(ReportItemvParam reportItemvParam) throws Exception { | 205 | public Result<StackedAreaChartDataVO> statisticsBySewage(ReportItemvParam reportItemvParam) { |
181 | List<String > dateList = new ArrayList<>();//日期数据 | 206 | List<String > dateList = new ArrayList<>();//日期数据 |
182 | List<String> electricityList = new ArrayList<>();//电能数据数据; | 207 | List<String> electricityList = new ArrayList<>();//电能数据数据; |
183 | List<String> waterList = new ArrayList<>();// 水集合 | 208 | List<String> waterList = new ArrayList<>();// 水集合 |
184 | List<String> consumeList = new ArrayList<>();//电耗集合 | 209 | List<String> consumeList = new ArrayList<>();//电耗集合 |
185 | |||
186 | String departIds = BaseContextHandler.getDeparts(); | 210 | String departIds = BaseContextHandler.getDeparts(); |
211 | if(reportItemvParam.getDepartIds()!=null){ | ||
212 | departIds = reportItemvParam.getDepartIds(); | ||
213 | } | ||
187 | List<ReportDateTrendVO> dlhjDateList = reportItemvService.getDayDateFieldList(ReportConstant.view3a24, "DLHJ", departIds, reportItemvParam.getStartDate(), reportItemvParam.getEndDate()); | 214 | List<ReportDateTrendVO> dlhjDateList = reportItemvService.getDayDateFieldList(ReportConstant.view3a24, "DLHJ", departIds, reportItemvParam.getStartDate(), reportItemvParam.getEndDate()); |
188 | List<ReportDateTrendVO> cslDateList = reportItemvService.getDayDateFieldList(ReportConstant.view2119, "CSL", departIds, reportItemvParam.getStartDate(), reportItemvParam.getEndDate()); | 215 | List<ReportDateTrendVO> cslDateList = reportItemvService.getDayDateFieldList(ReportConstant.view2119, "CSL", departIds, reportItemvParam.getStartDate(), reportItemvParam.getEndDate()); |
189 | 216 | ||
... | @@ -250,6 +277,9 @@ public class SysCommandCentreController { | ... | @@ -250,6 +277,9 @@ public class SysCommandCentreController { |
250 | reportItemvParam.setStartDate( DateUtils.formatDate(startDate ,"YYYY-MM")); | 277 | reportItemvParam.setStartDate( DateUtils.formatDate(startDate ,"YYYY-MM")); |
251 | reportItemvParam.setEndDate( DateUtils.formatDate(endDate ,"YYYY-MM")); | 278 | reportItemvParam.setEndDate( DateUtils.formatDate(endDate ,"YYYY-MM")); |
252 | String departIds = BaseContextHandler.getDeparts(); | 279 | String departIds = BaseContextHandler.getDeparts(); |
280 | if(reportItemvParam.getDepartIds()!=null){ | ||
281 | departIds = reportItemvParam.getDepartIds(); | ||
282 | } | ||
253 | reportItemvParam.setDepartIds( JSUtils.quoteEach(departIds,",")); | 283 | reportItemvParam.setDepartIds( JSUtils.quoteEach(departIds,",")); |
254 | List<ReportDateTrendVO> fyDataList = commandCentreService.getFyData(reportItemvParam); | 284 | List<ReportDateTrendVO> fyDataList = commandCentreService.getFyData(reportItemvParam); |
255 | 285 | ||
... | @@ -259,7 +289,6 @@ public class SysCommandCentreController { | ... | @@ -259,7 +289,6 @@ public class SysCommandCentreController { |
259 | List<String> fyList = new ArrayList<>();//电能数据数据; | 289 | List<String> fyList = new ArrayList<>();//电能数据数据; |
260 | List<String> waterList = new ArrayList<>();// 水集合 | 290 | List<String> waterList = new ArrayList<>();// 水集合 |
261 | 291 | ||
262 | String electricity = null; String water = null; | ||
263 | List<String> dateTimeList = getMonthsBetween(startDate,endDate); | 292 | List<String> dateTimeList = getMonthsBetween(startDate,endDate); |
264 | for(String dateTime : dateTimeList){ | 293 | for(String dateTime : dateTimeList){ |
265 | if(fyDataList != null ){ | 294 | if(fyDataList != null ){ | ... | ... |
... | @@ -89,13 +89,13 @@ spring: | ... | @@ -89,13 +89,13 @@ spring: |
89 | connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 | 89 | connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 |
90 | datasource: | 90 | datasource: |
91 | master: | 91 | master: |
92 | url: jdbc:mysql://47.104.179.187:6003/sk-zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false | 92 | url: jdbc:mysql://113.249.91.27:3306/sk-zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false |
93 | username: root | 93 | username: root |
94 | password: jkauto@123 | 94 | password: jkauto@123 |
95 | driver-class-name: com.mysql.jdbc.Driver | 95 | driver-class-name: com.mysql.jdbc.Driver |
96 | # 恩菲数据同步 | 96 | # 恩菲数据同步 |
97 | nf-db: | 97 | nf-db: |
98 | url: jdbc:mysql://47.104.179.187:6003/sk-zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false | 98 | url: jdbc:mysql://113.249.91.27:3306/zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false |
99 | username: root | 99 | username: root |
100 | password: jkauto@123 | 100 | password: jkauto@123 |
101 | driver-class-name: com.mysql.jdbc.Driver | 101 | driver-class-name: com.mysql.jdbc.Driver | ... | ... |
... | @@ -151,4 +151,6 @@ public interface IFCustomReportDatasetService extends IService<FCustomReportData | ... | @@ -151,4 +151,6 @@ public interface IFCustomReportDatasetService extends IService<FCustomReportData |
151 | 151 | ||
152 | List<Map<String, Object>> queryHjtjReport(String dataViewName9bff,String dataViewName3a24,String dataViewName2119, | 152 | List<Map<String, Object>> queryHjtjReport(String dataViewName9bff,String dataViewName3a24,String dataViewName2119, |
153 | String startTime, String endTime, String departId); | 153 | String startTime, String endTime, String departId); |
154 | |||
155 | List<ResultNumberVO> statisticsByXjl(String departIds, String startDate, String endDate); | ||
154 | } | 156 | } | ... | ... |
... | @@ -500,6 +500,25 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -500,6 +500,25 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
500 | return list; | 500 | return list; |
501 | } | 501 | } |
502 | 502 | ||
503 | @Override | ||
504 | public List<ResultNumberVO> statisticsByXjl(String departIds, String startDate, String endDate) { | ||
505 | List<ResultNumberVO> reduceStatisticsList = new ArrayList<>(4); | ||
506 | String startDateTb = DateUtils.getTbDate(startDate); | ||
507 | String endDateTb = DateUtils.getTbDate(endDate); | ||
508 | String startDateHb = DateUtils.getHbDate(startDate); | ||
509 | String endDateHb = DateUtils.getHbDate(endDate); | ||
510 | //头部统计数据 | ||
511 | JnhbReportData nowMonthData = getJnhbReportSumDataByResultNumber(departIds, startDate, endDate); | ||
512 | JnhbReportData lastMonthData = getJnhbReportSumDataByResultNumber(departIds, startDateHb, endDateHb); | ||
513 | JnhbReportData lastYearMonthData = getJnhbReportSumDataByResultNumber(departIds, startDateTb, endDateTb); | ||
514 | //ResultNumberVO(tring name, String unit, String value, String valueTb, String valueHb) | ||
515 | reduceStatisticsList.add( new ResultNumberVO( "COD", "吨",nowMonthData.getCodxjl(),lastMonthData.getCodxjl(),lastYearMonthData.getCodxjl() ) );//COD消减量(吨) codxjl | ||
516 | reduceStatisticsList.add( new ResultNumberVO( "NH₃-N","吨",nowMonthData.getAdxjl(),lastMonthData.getAdxjl(),lastYearMonthData.getAdxjl() ));//NH3-N消减量(吨)adxjl | ||
517 | reduceStatisticsList.add( new ResultNumberVO( "TP","吨",nowMonthData.getTpxjl(),lastMonthData.getTpxjl(),lastYearMonthData.getTpxjl() ));//TP消减量(吨)tpxjl | ||
518 | reduceStatisticsList.add( new ResultNumberVO( "TN","吨",nowMonthData.getTnxjl(),lastMonthData.getTnxjl(),lastYearMonthData.getTnxjl() ));//TN消减量(吨)tnxjl | ||
519 | return reduceStatisticsList; | ||
520 | } | ||
521 | |||
503 | /**转换为Map<部门编号,JnhbReportData> */ | 522 | /**转换为Map<部门编号,JnhbReportData> */ |
504 | private Map<String,JnhbReportData> convertJnhbReportDataMap(List<JnhbReportData> dataList){// Map<部门编号,JnhbReportData> | 523 | private Map<String,JnhbReportData> convertJnhbReportDataMap(List<JnhbReportData> dataList){// Map<部门编号,JnhbReportData> |
505 | Map<String,JnhbReportData> dataMap = new HashMap<>(); | 524 | Map<String,JnhbReportData> dataMap = new HashMap<>(); | ... | ... |
... | @@ -12,6 +12,7 @@ import com.skua.modules.custom.service.IFCustomReportDatasetService; | ... | @@ -12,6 +12,7 @@ import com.skua.modules.custom.service.IFCustomReportDatasetService; |
12 | import com.skua.modules.report.service.IReportDataService; | 12 | import com.skua.modules.report.service.IReportDataService; |
13 | import com.skua.modules.report.vo.JnhbLargeScreenVO; | 13 | import com.skua.modules.report.vo.JnhbLargeScreenVO; |
14 | import com.skua.modules.report.vo.JnhbReportData; | 14 | import com.skua.modules.report.vo.JnhbReportData; |
15 | import com.skua.modules.report.vo.ReportItemvParam; | ||
15 | import com.skua.modules.report.vo.largeScreen.ResultNumberVO; | 16 | import com.skua.modules.report.vo.largeScreen.ResultNumberVO; |
16 | import io.swagger.annotations.Api; | 17 | import io.swagger.annotations.Api; |
17 | import io.swagger.annotations.ApiOperation; | 18 | import io.swagger.annotations.ApiOperation; |
... | @@ -237,4 +238,18 @@ public class ReportDataController { | ... | @@ -237,4 +238,18 @@ public class ReportDataController { |
237 | result.setResult(dataLIst); | 238 | result.setResult(dataLIst); |
238 | return result; | 239 | return result; |
239 | } | 240 | } |
241 | |||
242 | @AutoLog(value = "节能环保-大屏展示") | ||
243 | @ApiOperation(value = "节能环保-消减量", notes = "节能环保-消减量") | ||
244 | @GetMapping(value = "/statisticsByXjl") | ||
245 | public Result<List<ResultNumberVO>> statisticsByXjl(ReportItemvParam reportItemvParam) { //time | ||
246 | Result<List<ResultNumberVO>> result = new Result<>(); | ||
247 | String departIds = BaseContextHandler.getDeparts(); | ||
248 | if(reportItemvParam.getDepartIds()!=null){ | ||
249 | departIds = reportItemvParam.getDepartIds(); | ||
250 | } | ||
251 | List<ResultNumberVO> dataLIst = fCustomReportDatasetService.statisticsByXjl(departIds,reportItemvParam.getStartDate(),reportItemvParam.getEndDate()); | ||
252 | result.setResult(dataLIst); | ||
253 | return result; | ||
254 | } | ||
240 | } | 255 | } | ... | ... |
-
请 注册 或 登录 后发表评论