220781bd 康伟

kangwei:库存查询,节能环保ESG趋势,

1 个父辈 416f8f1c
...@@ -73,7 +73,7 @@ public class DateVO { ...@@ -73,7 +73,7 @@ public class DateVO {
73 73
74 //环比时间 74 //环比时间
75 this.lastMonth = DateUtils.getHbMonth(this.nowMonth);// 75 this.lastMonth = DateUtils.getHbMonth(this.nowMonth);//
76 System.out.println(" lastMonth "+lastMonth); 76 //System.out.println(" lastMonth "+lastMonth);
77 this.lastMonthStartTime = lastMonth+"-01"; 77 this.lastMonthStartTime = lastMonth+"-01";
78 this.lastMonthEndTime = lastMonth+"-31"; 78 this.lastMonthEndTime = lastMonth+"-31";
79 79
......
...@@ -72,6 +72,6 @@ public class ParamFrequencyUtil { ...@@ -72,6 +72,6 @@ public class ParamFrequencyUtil {
72 data.put(paramName,paramValue); 72 data.put(paramName,paramValue);
73 }); 73 });
74 }); 74 });
75 System.out.println(data); 75 //System.out.println(data);
76 } 76 }
77 } 77 }
......
...@@ -88,7 +88,7 @@ public class DateUtil { ...@@ -88,7 +88,7 @@ public class DateUtil {
88 // 再将 Date 对象格式化为字符串 88 // 再将 Date 对象格式化为字符串
89 formattedDate = formatter.format(date); 89 formattedDate = formatter.format(date);
90 // 输出结果 90 // 输出结果
91 System.out.println(formattedDate); // 输出: 2024-08-19 91 //System.out.println(formattedDate); // 输出: 2024-08-19
92 92
93 } catch (Exception e) { 93 } catch (Exception e) {
94 e.printStackTrace(); 94 e.printStackTrace();
......
...@@ -112,4 +112,10 @@ public interface IFCustomReportDatasetService extends IService<FCustomReportData ...@@ -112,4 +112,10 @@ public interface IFCustomReportDatasetService extends IService<FCustomReportData
112 * @return 112 * @return
113 */ 113 */
114 JnhbLargeScreenVO jnhbLargeScreenShow(String departIds,String time); 114 JnhbLargeScreenVO jnhbLargeScreenShow(String departIds,String time);
115
116 /**
117 * 节能环保:大屏展示:头部数据
118 * @return
119 */
120 JnhbLargeScreenVO jnhbLargeScreenShowHeader(String departIds,String time);
115 } 121 }
......
...@@ -38,7 +38,7 @@ import javax.annotation.Resource; ...@@ -38,7 +38,7 @@ import javax.annotation.Resource;
38 @Service 38 @Service
39 public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDatasetMapper, FCustomReportDataset> implements IFCustomReportDatasetService { 39 public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDatasetMapper, FCustomReportDataset> implements IFCustomReportDatasetService {
40 40
41 @Autowired 41 @Resource
42 private FCustomReportDatasetMapper mapper; 42 private FCustomReportDatasetMapper mapper;
43 @Resource 43 @Resource
44 private CommonSqlMapper commonSqlMapper; 44 private CommonSqlMapper commonSqlMapper;
...@@ -334,6 +334,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -334,6 +334,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
334 c02NumberVO.setName( reportData.getDepartName() ); 334 c02NumberVO.setName( reportData.getDepartName() );
335 c02NumberVO.setValue( reportData.getCodxjl() ); 335 c02NumberVO.setValue( reportData.getCodxjl() );
336 336
337 //消减量 当月
337 largeScreenExpressionVO.setReduceStatistics(reportData); 338 largeScreenExpressionVO.setReduceStatistics(reportData);
338 /*************同比环比数据设置****************/ 339 /*************同比环比数据设置****************/
339 if ( lastMonthReportDataTemp != null ){ 340 if ( lastMonthReportDataTemp != null ){
...@@ -342,15 +343,16 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -342,15 +343,16 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
342 c02NumberVO.setValueHb(lastMonthReportDataTemp.getCodxjl() ); 343 c02NumberVO.setValueHb(lastMonthReportDataTemp.getCodxjl() );
343 344
344 //消减量统计 环比 345 //消减量统计 环比
345 largeScreenExpressionVO.setReduceStatisticsHB(reportData); 346 largeScreenExpressionVO.setReduceStatisticsHB(lastMonthReportDataTemp);
346 } 347 }
348 /*************同比环比数据设置****************/
347 if ( lastYearReportDataTemp != null ){ 349 if ( lastYearReportDataTemp != null ){
348 loadRateVO.setValueHb(lastYearReportDataTemp.getWsfhl() ); 350 loadRateVO.setValueHb(lastYearReportDataTemp.getWsfhl() );
349 powerConsumeVO.setValueHb(lastYearReportDataTemp.getDsdh() ); 351 powerConsumeVO.setValueHb(lastYearReportDataTemp.getDsdh() );
350 c02NumberVO.setValueHb(lastYearReportDataTemp.getCodxjl() ); 352 c02NumberVO.setValueHb(lastYearReportDataTemp.getCodxjl() );
351 353
352 //消减量统计 同比 354 //消减量统计 同比
353 largeScreenExpressionVO.setReduceStatisticsTB(reportData); 355 largeScreenExpressionVO.setReduceStatisticsTB(lastYearReportDataTemp);
354 } 356 }
355 //loadRateVO.setValue(reportData.getWsfhl(),valueHb,valueTb ); 357 //loadRateVO.setValue(reportData.getWsfhl(),valueHb,valueTb );
356 loadRateVOList.add(loadRateVO ); 358 loadRateVOList.add(loadRateVO );
...@@ -365,15 +367,13 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -365,15 +367,13 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
365 energyConsumeChart.setDataByZhnyxhl(reportData); 367 energyConsumeChart.setDataByZhnyxhl(reportData);
366 largeScreenVO.getEnergyConsumeChartsList().add( energyConsumeChart ) ; 368 largeScreenVO.getEnergyConsumeChartsList().add( energyConsumeChart ) ;
367 369
368 largeScreenExpressionVO.setReduceStatistics(reportData);
369 //CO2排放排名 370 //CO2排放排名
370 co2DataList.add( c02NumberVO ); 371 co2DataList.add( c02NumberVO );
371 //排放指标 372 //排放指标
372 // String ybgfcsl, String ybgfczl, String jgwnl, String wfcsl, String wfczl 373 // String ybgfcsl, String ybgfczl, String jgwnl, String wfcsl, String wfczl
373 wasteMaterialList.add( new WasteMaterialVO( reportData.getDepartId(),reportData.getDepartName(),reportData.getYbgfcsl(),reportData.getYbgfczl(),reportData.getJgwnl(),reportData.getWfcsl(),reportData.getWfczl() ) ) ; 374 wasteMaterialList.add( new WasteMaterialVO( reportData.getDepartId(),reportData.getDepartName(),reportData.getYbgfcsl(),reportData.getYbgfczl(),reportData.getJgwnl(),reportData.getWfcsl(),reportData.getWfczl() ) ) ;
374 } 375 }
375 //设置计算表达式 376 //设置计算表达式:消减量
376 largeScreenVO.setLargeScreenExpressionVO( largeScreenExpressionVO );
377 //头部-数据统计:污水处理量、系统负荷率、电耗、汽油、薪水、综合能耗、C02,吨水 377 //头部-数据统计:污水处理量、系统负荷率、电耗、汽油、薪水、综合能耗、C02,吨水
378 //largeScreenVO.setHeadStatisticsValue( ); 378 //largeScreenVO.setHeadStatisticsValue( );
379 largeScreenVO.setHeadStatisticsList( jnhbLargeScreenShowHead(departIds,time) ); 379 largeScreenVO.setHeadStatisticsList( jnhbLargeScreenShowHead(departIds,time) );
...@@ -381,8 +381,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -381,8 +381,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
381 largeScreenVO.setPowerConsumeVOList( powerConsumeVOList ); 381 largeScreenVO.setPowerConsumeVOList( powerConsumeVOList );
382 //负荷率对象 382 //负荷率对象
383 largeScreenVO.setLoadRateVOList( loadRateVOList ); 383 largeScreenVO.setLoadRateVOList( loadRateVOList );
384 //消减量统计 384 //消减量统计--公式计算
385 largeScreenVO.setReduceStatistics(); 385 largeScreenVO.setReduceStatistics(largeScreenExpressionVO);
386 //CO2排放排名 386 //CO2排放排名
387 largeScreenVO.setCo2DataList( co2DataList ) ; 387 largeScreenVO.setCo2DataList( co2DataList ) ;
388 388
...@@ -400,6 +400,27 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -400,6 +400,27 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
400 //System.out.println("666666---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds"); 400 //System.out.println("666666---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds");
401 return largeScreenVO; 401 return largeScreenVO;
402 } 402 }
403
404 /**
405 * 节能环保:大屏展示:头部数据
406 * @return
407 */
408 public JnhbLargeScreenVO jnhbLargeScreenShowHeader(String departIds, String time){
409 JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO();
410 //头部-数据统计:污水处理量、系统负荷率、电耗、汽油、薪水、综合能耗、C02,吨水
411 //largeScreenVO.setHeadStatisticsValue( );
412 largeScreenVO.setHeadStatisticsList( jnhbLargeScreenShowHead(departIds,time) );
413 //主库数据源
414 JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
415 int count1 = masterDB.queryForObject("select count(1) from equipment_info where energy_level = 1",Integer.class);
416 largeScreenVO.setEquipmentL1( count1 );
417 //System.out.println("55555---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds");
418 int count2 = masterDB.queryForObject("select count(1) from equipment_info where energy_level = 2",Integer.class);
419 largeScreenVO.setEquipmentL2( count2 );
420 //System.out.println("666666---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds");
421 return largeScreenVO;
422 }
423
403 /**转换为Map<部门编号,JnhbReportData> */ 424 /**转换为Map<部门编号,JnhbReportData> */
404 private Map<String,JnhbReportData> convertJnhbReportDataMap(List<JnhbReportData> dataList){// Map<部门编号,JnhbReportData> 425 private Map<String,JnhbReportData> convertJnhbReportDataMap(List<JnhbReportData> dataList){// Map<部门编号,JnhbReportData>
405 Map<String,JnhbReportData> dataMap = new HashMap<>(); 426 Map<String,JnhbReportData> dataMap = new HashMap<>();
......
...@@ -200,4 +200,15 @@ public class ReportDataController { ...@@ -200,4 +200,15 @@ public class ReportDataController {
200 result.setResult(jnhbLargeScreenVO); 200 result.setResult(jnhbLargeScreenVO);
201 return result; 201 return result;
202 } 202 }
203
204 @AutoLog(value = "节能环保:大屏展示")
205 @ApiOperation(value = "节能环保:大屏展示:头部数据", notes = "节能环保:大屏展示(time:yyyy-MM)")
206 @GetMapping(value = "/jnhbLargeScreenShow_header")
207 public Result<JnhbLargeScreenVO> jnhbLargeScreenShowHeader( @RequestParam(name="time") String time) { //time
208 Result<JnhbLargeScreenVO> result = new Result<>();
209 String departIds = BaseContextHandler.getDeparts();
210 JnhbLargeScreenVO jnhbLargeScreenVO = fCustomReportDatasetService.jnhbLargeScreenShow(departIds,time);
211 result.setResult(jnhbLargeScreenVO);
212 return result;
213 }
203 } 214 }
......
...@@ -45,60 +45,14 @@ public class JnhbLargeScreenVO { ...@@ -45,60 +45,14 @@ public class JnhbLargeScreenVO {
45 @ApiModelProperty(value = "二级能耗设备") 45 @ApiModelProperty(value = "二级能耗设备")
46 private Integer equipmentL2; 46 private Integer equipmentL2;
47 47
48 private JnhbLargeScreenExpressionVO largeScreenExpressionVO;
49
50 /*** 48 /***
51 * 设置:消减统计记录 49 * 设置:消减统计记录
52 */ 50 */
53 public void setReduceStatistics(){ 51 public void setReduceStatistics(JnhbLargeScreenExpressionVO largeScreenExpressionVO){
54 this.getReduceStatisticsList().add( getResultNumberVO( "cod","cod","",this.getLargeScreenExpressionVO().getReduce_statistics_cod() , this.getLargeScreenExpressionVO().getReduce_statistics_cod_hb() , this.getLargeScreenExpressionVO().getReduce_statistics_cod_tb()) );//吨水电耗 52 this.getReduceStatisticsList().add( new ResultNumberVO( "cod","",JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_cod(),"0") , JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_cod_hb() ,"0") , JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_cod_tb(),"0")) );//吨水电耗
55 this.getReduceStatisticsList().add( getResultNumberVO( "NH3-N","NH3-N","",this.getLargeScreenExpressionVO().getReduce_statistics_nh3n() , this.getLargeScreenExpressionVO().getReduce_statistics_nh3n_hb() , this.getLargeScreenExpressionVO().getReduce_statistics_nh3n_tb()) );//吨水电耗 53 this.getReduceStatisticsList().add( new ResultNumberVO( "NH3-N","",JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_nh3n() ,"0") , JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_nh3n_hb() ,"0") , JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_nh3n_tb(),"0")) );//吨水电耗
56 this.getReduceStatisticsList().add( getResultNumberVO( "TP","TP","",this.getLargeScreenExpressionVO().getReduce_statistics_tp() , this.getLargeScreenExpressionVO().getReduce_statistics_tp_hb() , this.getLargeScreenExpressionVO().getReduce_statistics_tp_tb()) );//吨水电耗 54 this.getReduceStatisticsList().add( new ResultNumberVO( "TP","",JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_tp() ,"0") , JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_tp_hb() ,"0") , JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_tp_tb(),"0")) );//吨水电耗
57 this.getReduceStatisticsList().add( getResultNumberVO( "TN","TN","",this.getLargeScreenExpressionVO().getReduce_statistics_tn() , this.getLargeScreenExpressionVO().getReduce_statistics_tn_hb() , this.getLargeScreenExpressionVO().getReduce_statistics_tn_tb()) );//吨水电耗 55 this.getReduceStatisticsList().add( new ResultNumberVO( "TN","",JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_tn() ,"0") , JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_tn_hb() ,"0") , JSUtils.executeExpression(largeScreenExpressionVO.getReduce_statistics_tn_tb(),"0")) );//吨水电耗
58 }
59
60
61
62 private ResultNumberVO getResultNumberVO(String name ,String code ,String unit ,String valueExpression ,String valueHbExpression,String valueTbExpression){
63 ResultNumberVO head_wssjcll = new ResultNumberVO();//污水处理量
64 head_wssjcll.setName( name);
65 head_wssjcll.setUnit( unit );
66 head_wssjcll.setValue( JSUtils.executeExpression(valueExpression , "0") );
67 head_wssjcll.setValueHb( JSUtils.executeExpression( valueHbExpression , "0") );
68 head_wssjcll.setValueTb(JSUtils.executeExpression( valueTbExpression , "0") );
69 return head_wssjcll;
70 }
71
72
73 public void setReduceStatistics(int index , ResultNumberVO resultNumberVO){
74 ResultNumberVO resultNumberVOTemp = reduceStatisticsList.get( index - 1);
75 resultNumberVOTemp.setValue(DigitalUtils.add(resultNumberVOTemp.getValue() , resultNumberVO.getValue() ) );
76 resultNumberVOTemp.setValueHb( DigitalUtils.add(resultNumberVOTemp.getValueHb() , resultNumberVO.getValueHb() ) );
77 resultNumberVOTemp.setValueTb( DigitalUtils.add(resultNumberVOTemp.getValueTb() , resultNumberVO.getValueTb() ) );
78 }
79
80
81 public JnhbLargeScreenVO(){
82 /*//头部数值统计
83 String names = "污水处理量,系统负荷率,电耗,汽油,新水,综合能耗,C02,吨水";
84 String unit = "万吨,%,万千瓦时,吨,吨,吨标准煤,吨CO2当量,千瓦时/吨";
85 String[] nameList = names.split(",");
86 String[] unitList = unit.split(",");
87 ResultNumberVO numberVO = null;
88 for(int i = 0 ; i< nameList.length ; i++){
89 numberVO = new ResultNumberVO();
90 numberVO.setName( nameList[i]);
91 numberVO.setUnit(unitList[i] );
92 this.getHeadStatisticsList().add(numberVO) ;
93 }
94 //消减量统计
95 names= "COD,NH3-N,TP,TN";
96 nameList = names.split(",");
97 for(String name : nameList){
98 numberVO = new ResultNumberVO();
99 numberVO.setName( name);
100 this.getReduceStatisticsList().add(numberVO) ;
101 }*/
102 } 56 }
103 57
104 } 58 }
......
...@@ -94,4 +94,16 @@ public class ResultNumberVO { ...@@ -94,4 +94,16 @@ public class ResultNumberVO {
94 if(result == null ) result = true; 94 if(result == null ) result = true;
95 return result; 95 return result;
96 } 96 }
97
98
99 public ResultNumberVO(){
100 }
101
102 public ResultNumberVO(String name, String unit, String value, String valueTb, String valueHb) {
103 this.name = name;
104 this.unit = unit;
105 this.value = value;
106 this.valueTb = valueTb;
107 this.valueHb = valueHb;
108 }
97 } 109 }
......
...@@ -10,13 +10,16 @@ ...@@ -10,13 +10,16 @@
10 select d.depart_name as 'departIdName', sw.depart_id,sw.warehouse_code ,sw.warehouse_name ,sw.warehouse_address ,sw.principal ,es.* 10 select d.depart_name as 'departIdName', sw.depart_id,sw.warehouse_code ,sw.warehouse_name ,sw.warehouse_address ,sw.principal ,es.*
11 from equipment_sparepart es , supplies_Warehouse sw 11 from equipment_sparepart es , supplies_Warehouse sw
12 left join sys_depart d on sw.depart_id = d.id 12 left join sys_depart d on sw.depart_id = d.id
13 where es.supplies_warehouse_id = sw.id and sw.depart_id in (${param.+departIds}) 13 where es.supplies_warehouse_id = sw.id and sw.depart_id in (${param.departIds})
14 <if test="param.suppliesWarehouseId != null and param.suppliesWarehouseId !=''"> and sw.id =#{param.suppliesWarehouseId}</if>
15 <if test="param.sparepartCode != null and param.sparepartCode !=''">and es.sparepart_code like '%' #{param.sparepartCode}'%'</if>
16 <if test="param.sparepartType != null and param.sparepartType !=''">and es.sparepart_type in (${param.sparepartType}) </if>
17 <if test="param.sparepartName != null and param.sparepartName !=''">and es.sparepart_name like '%' #{param.sparepartName}'%'</if>
18 <if test="param.specification != null and param.specification !=''">and es.specification like '%' #{param.specification}'%'</if>
14 19
15 order by inventory_update_time desc 20 order by es.inventory_update_time desc
16 </select> 21 </select>
17 <!-- <if test="param.sparepartCode != null and param.sparepartCode !=''">and es.sparepart_code =#{param.sparepartCode}</if> 22 <!-- </if>
18 <if test="param.sparepartType != null and param.sparepartType !=''">and es.sparepart_type in (${param.sparepartType}) </if>
19 <if test="param.sparepartName != null and param.sparepartName !=''">and pm.sparepart_name like '%' #{param.sparepartName}'%'</if>
20 suppliesWarehouseId--> 23 suppliesWarehouseId-->
21 24
22 </mapper> 25 </mapper>
......
...@@ -36,16 +36,4 @@ public class EquipmentSparepartSearchVO { ...@@ -36,16 +36,4 @@ public class EquipmentSparepartSearchVO {
36 @ApiModelProperty(value = "规格") 36 @ApiModelProperty(value = "规格")
37 private String specification ; 37 private String specification ;
38 38
39 @ApiModelProperty(value = "用途")
40 private String purpose;
41
42
43 @ApiModelProperty(value = "开始时间")
44 private String startTime;
45
46 @ApiModelProperty(value = "结束时间")
47 private String endTime;
48
49
50
51 } 39 }
......
...@@ -286,7 +286,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl ...@@ -286,7 +286,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
286 items.add(item); 286 items.add(item);
287 } 287 }
288 long end = System.currentTimeMillis(); 288 long end = System.currentTimeMillis();
289 System.out.println(end - startTime); 289 //System.out.println(end - startTime);
290 return items; 290 return items;
291 } 291 }
292 292
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!