ad045639 康伟

kangwei :

1 个父辈 0ae25119
...@@ -2,26 +2,21 @@ package com.skua.modules.custom.service.impl; ...@@ -2,26 +2,21 @@ package com.skua.modules.custom.service.impl;
2 2
3 import com.skua.common.report.ReportViewUtil; 3 import com.skua.common.report.ReportViewUtil;
4 import com.skua.core.context.SpringContextUtils; 4 import com.skua.core.context.SpringContextUtils;
5 import com.skua.core.excel.demo.Student;
6 import com.skua.core.util.ConvertUtils;
7 import com.skua.modules.custom.entity.FCustomReportDataset; 5 import com.skua.modules.custom.entity.FCustomReportDataset;
8 import com.skua.modules.custom.mapper.FCustomReportDatasetMapper; 6 import com.skua.modules.custom.mapper.FCustomReportDatasetMapper;
9 import com.skua.modules.custom.service.IFCustomReportDatasetService; 7 import com.skua.modules.custom.service.IFCustomReportDatasetService;
10 import com.skua.modules.custom.vo.DepartWeekReportVO; 8 import com.skua.modules.custom.vo.DepartWeekReportVO;
11 import com.skua.modules.custom.vo.FCustomReportDatasetVO; 9 import com.skua.modules.custom.vo.FCustomReportDatasetVO;
12
13 import java.time.LocalDate; 10 import java.time.LocalDate;
14 import java.time.format.DateTimeFormatter; 11 import java.time.format.DateTimeFormatter;
15 import java.time.temporal.TemporalAdjusters; 12 import java.time.temporal.TemporalAdjusters;
16 import java.time.temporal.WeekFields; 13 import java.time.temporal.WeekFields;
17 import java.util.*; 14 import java.util.*;
18
19 import com.skua.modules.report.vo.*; 15 import com.skua.modules.report.vo.*;
20 import com.skua.modules.report.vo.largeScreen.*; 16 import com.skua.modules.report.vo.largeScreen.*;
21 import org.springframework.beans.factory.annotation.Autowired; 17 import org.springframework.beans.factory.annotation.Autowired;
22 import org.springframework.jdbc.core.JdbcTemplate; 18 import org.springframework.jdbc.core.JdbcTemplate;
23 import org.springframework.stereotype.Service; 19 import org.springframework.stereotype.Service;
24
25 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 20 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
26 21
27 /** 22 /**
...@@ -278,7 +273,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -278,7 +273,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
278 273
279 //节能环保 大屏展示 274 //节能环保 大屏展示
280 public JnhbLargeScreenVO jnhbLargeScreenShow(DataVO dataVO){ 275 public JnhbLargeScreenVO jnhbLargeScreenShow(DataVO dataVO){
281 long startTime = System.nanoTime(); 276 //long startTime = System.nanoTime();
282 JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO(); 277 JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO();
283 //当月数据 278 //当月数据
284 String dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime()); 279 String dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime());
...@@ -295,7 +290,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -295,7 +290,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
295 Map<String,JnhbReportData> lastMonthMapData= convertJnhbReportDataMap(lastMonthReportDataList); 290 Map<String,JnhbReportData> lastMonthMapData= convertJnhbReportDataMap(lastMonthReportDataList);
296 // 去年数据 环比 291 // 去年数据 环比
297 dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime()); 292 dataViewName2 = ReportViewUtil.buildView("2119ecbf53a1d2d0708258ff67cfd9e1","CSL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime());
298 dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime()); 293 dataViewName3 = ReportViewUtil.buildView("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime());
299 List<JnhbReportData> lastYearReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime(), null); 294 List<JnhbReportData> lastYearReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime(), null);
300 Map<String,JnhbReportData> lastYearMapData= convertJnhbReportDataMap(lastYearReportDataList); 295 Map<String,JnhbReportData> lastYearMapData= convertJnhbReportDataMap(lastYearReportDataList);
301 296
...@@ -308,6 +303,11 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -308,6 +303,11 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
308 ResultNumberVO tp_NumberVO = null;//TP 303 ResultNumberVO tp_NumberVO = null;//TP
309 ResultNumberVO tn_NumberVO = null;//TN 304 ResultNumberVO tn_NumberVO = null;//TN
310 305
306 List<PowerConsumeVO> powerConsumeVOList = new ArrayList();//各站点能源消耗排名
307 List<LoadRateVO> loadRateVOList = new ArrayList<>();//负荷率对象
308 List<ResultNumberVO> co2DataList = new ArrayList<>();//CO2排放排名
309 List<WasteMaterialVO> wasteMaterialList = new ArrayList<>();//废物处理对象集合
310
311 JnhbReportData lastMonthReportDataTemp ;//lastMonthMapData 311 JnhbReportData lastMonthReportDataTemp ;//lastMonthMapData
312 JnhbReportData lastYearReportDataTemp ;//lastYearMapData 312 JnhbReportData lastYearReportDataTemp ;//lastYearMapData
313 ResultChartsVO energyConsumeChart = null; 313 ResultChartsVO energyConsumeChart = null;
...@@ -321,8 +321,9 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -321,8 +321,9 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
321 //各站点能源消耗排名: 321 //各站点能源消耗排名:
322 powerConsumeVO = new PowerConsumeVO(reportData.getDepartId(),reportData.getDepartName(),reportData.getDh(), reportData.getGffdl(), reportData.getQy(), reportData.getZhnyxhl() , reportData.getEyhtpfl() , reportData.getDsdh() ); 322 powerConsumeVO = new PowerConsumeVO(reportData.getDepartId(),reportData.getDepartName(),reportData.getDh(), reportData.getGffdl(), reportData.getQy(), reportData.getZhnyxhl() , reportData.getEyhtpfl() , reportData.getDsdh() );
323 323
324
324 c02NumberVO = new ResultNumberVO(); 325 c02NumberVO = new ResultNumberVO();
325 c02NumberVO.setName( reportData.getDepartName() ); 326 c02NumberVO.setName( reportData.getDepartName() );
326 c02NumberVO.setValue( reportData.getCodxjl() ); 327 c02NumberVO.setValue( reportData.getCodxjl() );
327 cod_NumberVO = new ResultNumberVO();cod_NumberVO.setValue(reportData.getCodxjl()); 328 cod_NumberVO = new ResultNumberVO();cod_NumberVO.setValue(reportData.getCodxjl());
328 nh3n_NumberVO = new ResultNumberVO();nh3n_NumberVO.setValue(reportData.getTnxjl()); 329 nh3n_NumberVO = new ResultNumberVO();nh3n_NumberVO.setValue(reportData.getTnxjl());
...@@ -377,8 +378,10 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -377,8 +378,10 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
377 largeScreenVO.getCo2DataList().add( c02NumberVO ) ; 378 largeScreenVO.getCo2DataList().add( c02NumberVO ) ;
378 //排放指标 379 //排放指标
379 // String ybgfcsl, String ybgfczl, String jgwnl, String wfcsl, String wfczl 380 // String ybgfcsl, String ybgfczl, String jgwnl, String wfcsl, String wfczl
380 largeScreenVO.getWasteMaterialList().add( new WasteMaterialVO( reportData.getDepartId(),reportData.getDepartName(),reportData.getYbgfcsl(),reportData.getYbgfczl(),reportData.getJgwnl(),reportData.getWfcsl(),reportData.getWfczl() ) ) ; 381 wasteMaterialList.add( new WasteMaterialVO( reportData.getDepartId(),reportData.getDepartName(),reportData.getYbgfcsl(),reportData.getYbgfczl(),reportData.getJgwnl(),reportData.getWfcsl(),reportData.getWfczl() ) ) ;
381 } 382 }
383 largeScreenVO.getCo2DataList().add( c02NumberVO ) ;
384 largeScreenVO.setWasteMaterialList( wasteMaterialList ) ;
382 //System.out.println("44444444---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds"); 385 //System.out.println("44444444---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds");
383 //主库数据源 386 //主库数据源
384 JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master"); 387 JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
...@@ -414,8 +417,6 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -414,8 +417,6 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
414 loadRateVORank.setRank( rank++); 417 loadRateVORank.setRank( rank++);
415 }*//* 418 }*//*
416 }*/ 419 }*/
417
418
419 return largeScreenVO; 420 return largeScreenVO;
420 } 421 }
421 /**转换为Map<部门编号,JnhbReportData> */ 422 /**转换为Map<部门编号,JnhbReportData> */
...@@ -451,6 +452,4 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -451,6 +452,4 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
451 map.put("qt", "(1)本周暂无其他情况说明");//其他 452 map.put("qt", "(1)本周暂无其他情况说明");//其他
452 return map; 453 return map;
453 } 454 }
454
455
456 } 455 }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!