kangwei :
正在显示
1 个修改的文件
包含
15 行增加
和
11 行删除
... | @@ -278,17 +278,20 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -278,17 +278,20 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
278 | 278 | ||
279 | //节能环保 大屏展示 | 279 | //节能环保 大屏展示 |
280 | public JnhbLargeScreenVO jnhbLargeScreenShow(DataVO dataVO){ | 280 | public JnhbLargeScreenVO jnhbLargeScreenShow(DataVO dataVO){ |
281 | long startTime = System.nanoTime(); | ||
281 | JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO(); | 282 | JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO(); |
282 | //当月数据 | 283 | //当月数据 |
283 | String dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime()); | 284 | String dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime()); |
284 | String dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime()); | 285 | String dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime()); |
285 | List<JnhbReportData> jnhbReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getNowStartTime(), dataVO.getNowEndTime(), null); | 286 | List<JnhbReportData> jnhbReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getNowStartTime(), dataVO.getNowEndTime(), null); |
287 | //System.out.println("1111---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds"); | ||
286 | 288 | ||
287 | // 上月数据 同比 | 289 | // 上月数据 同比 |
288 | dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime()); | 290 | dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime()); |
289 | dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime()); | 291 | dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime()); |
290 | List<JnhbReportData> lastMonthReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime(), null); | 292 | List<JnhbReportData> lastMonthReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime(), null); |
291 | 293 | ||
294 | //System.out.println("2222---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds"); | ||
292 | Map<String,JnhbReportData> lastMonthMapData= convertJnhbReportDataMap(lastMonthReportDataList); | 295 | Map<String,JnhbReportData> lastMonthMapData= convertJnhbReportDataMap(lastMonthReportDataList); |
293 | // 去年数据 环比 | 296 | // 去年数据 环比 |
294 | dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime()); | 297 | dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime()); |
... | @@ -296,6 +299,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -296,6 +299,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
296 | List<JnhbReportData> lastYearReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime(), null); | 299 | List<JnhbReportData> lastYearReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime(), null); |
297 | Map<String,JnhbReportData> lastYearMapData= convertJnhbReportDataMap(lastYearReportDataList); | 300 | Map<String,JnhbReportData> lastYearMapData= convertJnhbReportDataMap(lastYearReportDataList); |
298 | 301 | ||
302 | //System.out.println("333333---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds"); | ||
299 | LoadRateVO loadRateVO = null; | 303 | LoadRateVO loadRateVO = null; |
300 | PowerConsumeVO powerConsumeVO = null; | 304 | PowerConsumeVO powerConsumeVO = null; |
301 | ResultNumberVO c02NumberVO = null;//CO2排放对象 | 305 | ResultNumberVO c02NumberVO = null;//CO2排放对象 |
... | @@ -375,41 +379,41 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -375,41 +379,41 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
375 | // String ybgfcsl, String ybgfczl, String jgwnl, String wfcsl, String wfczl | 379 | // String ybgfcsl, String ybgfczl, String jgwnl, String wfcsl, String wfczl |
376 | largeScreenVO.getWasteMaterialList().add( new WasteMaterialVO( reportData.getDepartId(),reportData.getDepartName(),reportData.getYbgfcsl(),reportData.getYbgfczl(),reportData.getJgwnl(),reportData.getWfcsl(),reportData.getWfczl() ) ) ; | 380 | largeScreenVO.getWasteMaterialList().add( new WasteMaterialVO( reportData.getDepartId(),reportData.getDepartName(),reportData.getYbgfcsl(),reportData.getYbgfczl(),reportData.getJgwnl(),reportData.getWfcsl(),reportData.getWfczl() ) ) ; |
377 | } | 381 | } |
378 | 382 | //System.out.println("44444444---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds"); | |
379 | //主库数据源 | 383 | //主库数据源 |
380 | JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master"); | 384 | JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master"); |
381 | int count1 = masterDB.queryForObject("select count(1) from equipment_info where energy_level = 1",Integer.class); | 385 | int count1 = masterDB.queryForObject("select count(1) from equipment_info where energy_level = 1",Integer.class); |
382 | largeScreenVO.setEquipmentL1( count1 ); | 386 | largeScreenVO.setEquipmentL1( count1 ); |
383 | 387 | //System.out.println("55555---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds"); | |
384 | int count2 = masterDB.queryForObject("select count(1) from equipment_info where energy_level = 2",Integer.class); | 388 | int count2 = masterDB.queryForObject("select count(1) from equipment_info where energy_level = 2",Integer.class); |
385 | largeScreenVO.setEquipmentL2( count2 ); | 389 | largeScreenVO.setEquipmentL2( count2 ); |
386 | 390 | //System.out.println("666666---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds"); | |
387 | // 各站点系统负荷率排名:负荷率排序、设置排名 | 391 | // 各站点系统负荷率排名:负荷率排序、设置排名 |
388 | if(largeScreenVO.getLoadRateVOList() != null && !largeScreenVO.getLoadRateVOList().isEmpty()){ | 392 | /* if(largeScreenVO.getLoadRateVOList() != null && !largeScreenVO.getLoadRateVOList().isEmpty()){ |
389 | // 根据分数排序 | 393 | // 根据分数排序 |
390 | Collections.sort(largeScreenVO.getLoadRateVOList(), new Comparator<LoadRateVO>() { | 394 | Collections.sort(largeScreenVO.getLoadRateVOList(), new Comparator<LoadRateVO>() { |
391 | public int compare(LoadRateVO s1, LoadRateVO s2) { | 395 | public int compare(LoadRateVO s1, LoadRateVO s2) { |
392 | return Double.compare(ConvertUtils.getDouble(s1.getWsfhl(),0d), ConvertUtils.getDouble(s1.getWsfhl(),0d)); // 降序排序 | 396 | return Double.compare(ConvertUtils.getDouble(s1.getWsfhl(),0d), ConvertUtils.getDouble(s1.getWsfhl(),0d)); // 降序排序 |
393 | } | 397 | } |
394 | }); | 398 | }); |
395 | /*int rank = 1; // 设置排名 | 399 | *//*int rank = 1; // 设置排名 |
396 | for( LoadRateVO loadRateVORank: largeScreenVO.getLoadRateVOList()){ | 400 | for( LoadRateVO loadRateVORank: largeScreenVO.getLoadRateVOList()){ |
397 | loadRateVORank.setRank( rank++); | 401 | loadRateVORank.setRank( rank++); |
398 | }*/ | 402 | }*//* |
399 | } | 403 | }*/ |
400 | //各站点能源消耗排名 吨水电耗 | 404 | //各站点能源消耗排名 吨水电耗 |
401 | if(largeScreenVO.getPowerConsumeVOList() != null && !largeScreenVO.getPowerConsumeVOList().isEmpty()) { | 405 | /*if(largeScreenVO.getPowerConsumeVOList() != null && !largeScreenVO.getPowerConsumeVOList().isEmpty()) { |
402 | // 根据分数排序 | 406 | // 根据分数排序 |
403 | Collections.sort(largeScreenVO.getPowerConsumeVOList(), new Comparator<PowerConsumeVO>() { | 407 | Collections.sort(largeScreenVO.getPowerConsumeVOList(), new Comparator<PowerConsumeVO>() { |
404 | public int compare(PowerConsumeVO s1, PowerConsumeVO s2) { | 408 | public int compare(PowerConsumeVO s1, PowerConsumeVO s2) { |
405 | return Double.compare(ConvertUtils.getDouble(s1.getDh(), 0d), ConvertUtils.getDouble(s1.getDh(), 0d)); // 降序排序 | 409 | return Double.compare(ConvertUtils.getDouble(s1.getDh(), 0d), ConvertUtils.getDouble(s1.getDh(), 0d)); // 降序排序 |
406 | } | 410 | } |
407 | }); | 411 | }); |
408 | /*int rank = 1; // 设置排名 | 412 | *//*int rank = 1; // 设置排名 |
409 | for( LoadRateVO loadRateVORank: largeScreenVO.getLoadRateVOList()){ | 413 | for( LoadRateVO loadRateVORank: largeScreenVO.getLoadRateVOList()){ |
410 | loadRateVORank.setRank( rank++); | 414 | loadRateVORank.setRank( rank++); |
411 | }*/ | 415 | }*//* |
412 | } | 416 | }*/ |
413 | 417 | ||
414 | 418 | ||
415 | return largeScreenVO; | 419 | return largeScreenVO; | ... | ... |
-
请 注册 或 登录 后发表评论