86b6e998 康伟

kangwei: 提交“指标中心”后端接口

1 个父辈 beb320ec
正在显示 27 个修改的文件 包含 930 行增加3 行删除
...@@ -86,8 +86,8 @@ public class ReportViewUtil { ...@@ -86,8 +86,8 @@ public class ReportViewUtil {
86 * @param reportId 报表id 86 * @param reportId 报表id
87 * @param fields 查询字段 87 * @param fields 查询字段
88 * @param departIds 厂站集合 88 * @param departIds 厂站集合
89 * @param startTime 开始时间 89 * @param dataTime 开始时间
90 * @param endTime 结束时间 90 * @param dataTime 结束时间
91 * @return 91 * @return
92 * @author Li Yuanyuan, 2021年2月26日 上午10:23:06 92 * @author Li Yuanyuan, 2021年2月26日 上午10:23:06
93 */ 93 */
......
...@@ -2,6 +2,7 @@ package com.skua.tool.util; ...@@ -2,6 +2,7 @@ package com.skua.tool.util;
2 2
3 import org.apache.commons.lang3.StringUtils; 3 import org.apache.commons.lang3.StringUtils;
4 4
5 import java.math.BigDecimal;
5 import java.util.regex.Matcher; 6 import java.util.regex.Matcher;
6 import java.util.regex.Pattern; 7 import java.util.regex.Pattern;
7 8
...@@ -36,6 +37,28 @@ public class DigitalUtils { ...@@ -36,6 +37,28 @@ public class DigitalUtils {
36 } 37 }
37 38
38 /** 39 /**
40 * 除法 保留两位小数
41 * @param dividend 请输入被除数
42 * @param divisor 请输入除数
43 * @return
44 */
45 public static String division(String dividend , String divisor ){
46 String resultStr = "0";
47 if( dividend != null && dividend.length()>0 && divisor != null && divisor.length()>0){
48 double dividendD = Double.parseDouble(dividend);
49 double divisorD = Double.parseDouble(divisor);
50 double result = dividendD /divisorD;
51 BigDecimal bd = new BigDecimal(result);
52 BigDecimal roundedResult = bd.setScale(2, BigDecimal.ROUND_HALF_UP);System.out.println(roundedResult);
53 resultStr = roundedResult.toString();
54 }
55 //System.out.print("请输入被除数:");double dividend =scanner.nextDouble();
56 // System.out.print("请输入除数:");double divisor =scanner.nextDouble();
57
58 return resultStr;
59 }
60
61 /**
39 * 判断字符串是否是数字类型 62 * 判断字符串是否是数字类型
40 * 63 *
41 * @param str 64 * @param str
......
...@@ -99,6 +99,30 @@ public class SysAlgorithmStatisticsLibraryController { ...@@ -99,6 +99,30 @@ public class SysAlgorithmStatisticsLibraryController {
99 return result; 99 return result;
100 } 100 }
101 101
102 @AutoLog(value = "统计功能配置表-统计计算")
103 @ApiOperation(value="统计功能配置表-统计计算", notes="统计功能配置表-统计计算")
104 @PostMapping(value = "/statistics/waterData")
105 public Result<SysAlgorithmStatisticsResultVO> statisticsByWaterData(@RequestBody JSONObject jsonObject,
106 HttpServletRequest req) throws Exception {
107 Result<SysAlgorithmStatisticsResultVO> result = new Result<>();
108 //将jsonObject转sysAlgorithmStatisticsLibraryVO对象
109 SysAlgorithmStatisticsLibraryVO sysAlgorithmStatisticsLibraryVO = JSONObject.toJavaObject(jsonObject, SysAlgorithmStatisticsLibraryVO.class);
110 //将jsonObject转Map对象
111 Map<String,Object> paramMap = JSONObject.toJavaObject(jsonObject,Map.class);
112 //将paramMap集合去掉SysAlgorithmStatisticsLibraryVO对象内容
113 Map<String,Object> sysAlgorithmStatisticsLibraryVOMap = JSON.parseObject(JSON.toJSONString(sysAlgorithmStatisticsLibraryVO), new TypeReference<Map<String, Object>>() {});
114 //Maps.difference(Map, Map)用来比较两个Map以获取所有不同点
115 MapDifference<String, Object> difference = Maps.difference(paramMap, sysAlgorithmStatisticsLibraryVOMap);
116 // 键只存在于左边Map的映射项
117 paramMap = difference.entriesOnlyOnLeft();
118 SysAlgorithmStatisticsResultVO vo = sysAlgorithmStatisticsLibraryService.statistics(sysAlgorithmStatisticsLibraryVO,paramMap);
119 //todo 演示暂时注释
120 result.setSuccess(true);
121 result.setResult(vo);
122 return result;
123 }
124
125
102 /** 126 /**
103 * 添加 127 * 添加
104 * @param sysAlgorithmStatisticsLibrary 128 * @param sysAlgorithmStatisticsLibrary
......
1 package com.skua.modules.algorithm.controller;
2
3 import com.alibaba.fastjson.JSONObject;
4 import com.skua.core.api.vo.Result;
5 import com.skua.core.aspect.annotation.AutoLog;
6 import com.skua.modules.algorithm.service.ICommandCentreService;
7 import com.skua.modules.algorithm.vo.*;
8 import com.skua.modules.guest.util.DateUtil;
9 import com.skua.modules.report.entity.FReportItemv;
10 import com.skua.modules.report.vo.DepartLoadRateVO;
11 import com.skua.modules.report.vo.FRportlCommandCenterVO;
12 import com.skua.modules.report.vo.ReportItemvParam;
13 import com.skua.modules.system.service.ISysFactoryInfoService;
14 import com.skua.tool.util.DigitalUtils;
15 import io.swagger.annotations.Api;
16 import io.swagger.annotations.ApiOperation;
17 import lombok.extern.slf4j.Slf4j;
18 import org.springframework.beans.factory.annotation.Autowired;
19 import org.springframework.web.bind.annotation.GetMapping;
20 import org.springframework.web.bind.annotation.RequestBody;
21 import org.springframework.web.bind.annotation.RequestMapping;
22 import org.springframework.web.bind.annotation.RestController;
23
24 import javax.servlet.http.HttpServletRequest;
25 import java.util.*;
26
27 /**
28 * 统计功能配置表
29 */
30 @Slf4j
31 @Api(tags="指挥中心")
32 @RestController
33 @RequestMapping("/v1/algorithm/commandCentre")
34 public class SysCommandCentreController {
35 @Autowired
36 private ISysFactoryInfoService factoryInfoService;
37
38 @Autowired
39 private ICommandCentreService commandCentreService;
40
41 /**
42 * 分页列表查询
43 * @return
44 */
45 @AutoLog(value = "指挥中心-水量查询")
46 @ApiOperation(value="指挥中心-水量查询", notes="指挥中心-水量查询")
47 @GetMapping(value = "/statisticsByWaterData")
48 public Result<SysCommandCentreResultVO> statisticsByWaterData(@RequestBody JSONObject jsonObject,
49 HttpServletRequest req) throws Exception{
50 Result<SysCommandCentreResultVO> result = new Result<>();
51 //将jsonObject转sysAlgorithmStatisticsLibraryVO对象
52 SysAlgorithmStatisticsLibraryVO sysAlgorithmLibraryVO = JSONObject.toJavaObject(jsonObject, SysAlgorithmStatisticsLibraryVO.class);
53
54 String reportId = " 2119ecbf53a1d2d0708258ff67cfd9e1";//报表编号
55 String reportItemCode = "CSL";//查询字段
56 //将jsonObject转Map对象
57 //Map<String,Object> paramMap = JSONObject.toJavaObject(jsonObject,Map.class);
58 //将paramMap集合去掉SysAlgorithmStatisticsLibraryVO对象内容
59 //Map<String,Object> sysAlgorithmStatisticsLibraryVOMap = JSON.parseObject(JSON.toJSONString(sysAlgorithmLibraryVO), new TypeReference<Map<String, Object>>() {});
60 //Maps.difference(Map, Map)用来比较两个Map以获取所有不同点
61 //MapDifference<String, Object> difference = Maps.difference(paramMap, sysAlgorithmStatisticsLibraryVOMap);
62 // 键只存在于左边Map的映射项
63 //paramMap = difference.entriesOnlyOnLeft();
64 // SysAlgorithmStatisticsResultVO vo = sysAlgorithmStatisticsLibraryService.statistics(sysAlgorithmStatisticsLibraryVO,paramMap);
65 ReportItemvParam reportItemvParam = new ReportItemvParam(reportId,reportItemCode ,sysAlgorithmLibraryVO.getStartDate() ,sysAlgorithmLibraryVO.getEndDate());
66 //List<FReportItemv> reportItemvList = ifReportItemvService.getReportItemvByReitId(reportItemvParam);
67
68 String startDate = sysAlgorithmLibraryVO.getStartDate();
69 String endDate = sysAlgorithmLibraryVO.getEndDate();
70
71 FReportItemv currenteportItemv = commandCentreService.getReportItemvByReitIdAndDate(reportId, reportItemCode,startDate , endDate );
72 //上月数据
73 FReportItemv lastMonthReportItemv = commandCentreService.getReportItemvByReitIdAndDate(reportId, reportItemCode,reportItemvParam.getLastMonthStartDate() , reportItemvParam.getLastMonthEndDate() );
74 //去年数据
75 FReportItemv lastYearReportItemv = commandCentreService.getReportItemvByReitIdAndDate(reportId, reportItemCode, reportItemvParam.getLastYearStartDate() , reportItemvParam.getLastYearEndDate() );
76
77 //整理数据
78 SysCommandCentreResultVO commandCentreResultVO = convertSysAlgorithmStatisticsResultNumberVO(currenteportItemv , lastMonthReportItemv,lastYearReportItemv);
79
80 commandCentreResultVO.setTotalData( factoryInfoService.querySumProScale() );
81 //todo 演示暂时注释
82 result.setSuccess(true);
83 result.setResult(commandCentreResultVO);
84 return result;
85 }
86
87
88 @AutoLog(value = "指挥中心-运行负荷率分析")
89 @ApiOperation(value="指挥中心-运行负荷率分析", notes="指挥中心-运行负荷率分析")
90 @GetMapping(value = "/statisticsByLoadRate")
91 public Result<DepartLoadRateResultVO> statisticsByLoadRate(@RequestBody JSONObject jsonObject,
92 HttpServletRequest req) throws Exception {
93 DepartLoadRateResultVO loadRateResultVO = new DepartLoadRateResultVO();
94 SysAlgorithmStatisticsLibraryVO sysAlgorithmLibraryVO = JSONObject.toJavaObject(jsonObject, SysAlgorithmStatisticsLibraryVO.class);
95
96 Integer loadRateType = 1;//默认查询
97 if(sysAlgorithmLibraryVO.getLoadRateType() != null){
98 loadRateType = sysAlgorithmLibraryVO.getLoadRateType();
99 }
100 List<DepartLoadRateVO> departLoadRateVOList = commandCentreService.statisticsByLoadRate(loadRateType);
101 loadRateResultVO.setDepartLoadRateVOList(departLoadRateVOList );
102 //统计总数
103 int normalNum = commandCentreService.statisticsByLoadRateNum(1);//正常
104 int lowLoadNum = commandCentreService.statisticsByLoadRateNum(2);//低负荷
105 int overloadNum = commandCentreService.statisticsByLoadRateNum(3);//超负荷
106 loadRateResultVO.setNormalNum( normalNum );
107 loadRateResultVO.setLowLoadNum( lowLoadNum );
108 loadRateResultVO.setOverloadNum( overloadNum );
109
110 Result<DepartLoadRateResultVO> result = new Result<>();
111 result.setSuccess(true);
112 result.setResult(loadRateResultVO);
113 return result;
114 }
115
116 //cement水泥 electricity
117 @AutoLog(value = "指挥中心-泥量统计")
118 @ApiOperation(value="指挥中心-泥量统计", notes="指挥中心-泥量统计")
119 @GetMapping(value = "/statisticsByCement")
120 public Result<SysCommandCentreResultVO> statisticsByCement(@RequestBody JSONObject jsonObject,
121 HttpServletRequest req) throws Exception {
122 Result<SysCommandCentreResultVO> result = new Result<>();
123 //将jsonObject转sysAlgorithmStatisticsLibraryVO对象
124 SysAlgorithmStatisticsLibraryVO sysAlgorithmLibraryVO = JSONObject.toJavaObject(jsonObject, SysAlgorithmStatisticsLibraryVO.class);
125
126
127 String reportId = " 3a243d5715b9e1a3753c180872ca0df9";//报表编号
128 String reportItemCode = "WNL";//查询字段
129
130
131 ReportItemvParam reportItemvParam = new ReportItemvParam(reportId,reportItemCode ,sysAlgorithmLibraryVO.getStartDate() ,sysAlgorithmLibraryVO.getEndDate());
132
133 String startDate = sysAlgorithmLibraryVO.getStartDate();
134 String endDate = sysAlgorithmLibraryVO.getEndDate();
135
136 FReportItemv currenteportItemv = commandCentreService.getReportItemvByReitIdAndDate(reportId, reportItemCode,startDate , endDate );
137 //上月数据
138 FReportItemv lastMonthReportItemv = commandCentreService.getReportItemvByReitIdAndDate(reportId, reportItemCode,reportItemvParam.getLastMonthStartDate() , reportItemvParam.getLastMonthEndDate() );
139 //去年数据
140 FReportItemv lastYearReportItemv = commandCentreService.getReportItemvByReitIdAndDate(reportId, reportItemCode, reportItemvParam.getLastYearStartDate() , reportItemvParam.getLastYearEndDate() );
141
142 //整理数据
143 SysCommandCentreResultVO commandCentreResultVO = convertSysAlgorithmStatisticsResultNumberVO(currenteportItemv , lastMonthReportItemv,lastYearReportItemv);
144 //
145 // FReportItemv waterCurrenteportItemv = ifReportItemvService.getReportItemvByReitIdAndDate(reportId, reportItemCode,startDate , endDate );
146 //commandCentreResultVO.setTotalData( factoryInfoService.querySumProScale() );
147 FRportlCommandCenterVO statisticsData = new FRportlCommandCenterVO();
148 //需要查询统计数据
149 commandCentreResultVO.setStatisticsData(statisticsData);
150
151 //todo 演示暂时注释
152 result.setSuccess(true);
153 result.setResult(commandCentreResultVO);
154 return result;
155 }
156
157 //cement水泥 electricity
158 @AutoLog(value = "指挥中心-能耗分析")
159 @ApiOperation(value="指挥中心-能耗分析", notes="指挥中心-能耗分析")
160 @GetMapping(value = "/statisticsByElectricity")
161 public Result<SysCommandCentreResultVO> statisticsByElectricity(@RequestBody JSONObject jsonObject,
162 HttpServletRequest req) throws Exception {
163 Result<SysCommandCentreResultVO> result = new Result<>();
164 //将jsonObject转sysAlgorithmStatisticsLibraryVO对象
165 SysAlgorithmStatisticsLibraryVO sysAlgorithmLibraryVO = JSONObject.toJavaObject(jsonObject, SysAlgorithmStatisticsLibraryVO.class);
166
167 String reportId = " 3a243d5715b9e1a3753c180872ca0df9";//报表编号
168 String reportItemCode = "DLHJ";//查询字段
169
170 ReportItemvParam reportItemvParam = new ReportItemvParam(reportId,reportItemCode ,sysAlgorithmLibraryVO.getStartDate() ,sysAlgorithmLibraryVO.getEndDate());
171
172 String startDate = sysAlgorithmLibraryVO.getStartDate();
173 String endDate = sysAlgorithmLibraryVO.getEndDate();
174
175 FReportItemv currenteportItemv = commandCentreService.getReportItemvByReitIdAndDate(reportId, reportItemCode,startDate , endDate );
176 //上月数据
177 FReportItemv lastMonthReportItemv = commandCentreService.getReportItemvByReitIdAndDate(reportId, reportItemCode,reportItemvParam.getLastMonthStartDate() , reportItemvParam.getLastMonthEndDate() );
178 //去年数据
179 FReportItemv lastYearReportItemv = commandCentreService.getReportItemvByReitIdAndDate(reportId, reportItemCode, reportItemvParam.getLastYearStartDate() , reportItemvParam.getLastYearEndDate() );
180
181 //整理数据
182 SysCommandCentreResultVO commandCentreResultVO = convertSysAlgorithmStatisticsResultNumberVO(currenteportItemv , lastMonthReportItemv,lastYearReportItemv);
183 //
184 // FReportItemv waterCurrenteportItemv = ifReportItemvService.getReportItemvByReitIdAndDate(reportId, reportItemCode,startDate , endDate );
185 //commandCentreResultVO.setTotalData( factoryInfoService.querySumProScale() );
186
187 FRportlCommandCenterVO statisticsData = new FRportlCommandCenterVO();
188 //需要查询统计数据
189 commandCentreResultVO.setStatisticsData(statisticsData);
190 //todo 演示暂时注释
191 result.setSuccess(true);
192 result.setResult(commandCentreResultVO);
193 return result;
194 }
195
196
197 //cement水泥 electricity
198 @AutoLog(value = "指挥中心-污水处理趋势")
199 @ApiOperation(value="指挥中心-污水处理趋势", notes="指挥中心-污水处理趋势")
200 @GetMapping(value = "/statisticsBySewage")
201 public Result<StackedAreaChartDataVO> statisticsBySewage(@RequestBody JSONObject jsonObject,
202 HttpServletRequest req) throws Exception {
203
204 SysAlgorithmStatisticsLibraryVO sysAlgorithmLibraryVO = JSONObject.toJavaObject(jsonObject, SysAlgorithmStatisticsLibraryVO.class);
205
206
207 String reportId = " 3a243d5715b9e1a3753c180872ca0df9";//报表编号
208 String reportItemCode = "DLHJ";//查询字段
209
210
211 String dateTime = null;//默认今天
212 //电
213 List<String> electricityList = commandCentreService.getReportItemvByReitIdAndDate7Day(reportId, reportItemCode,dateTime );
214
215
216 reportId = " 2119ecbf53a1d2d0708258ff67cfd9e1";//报表编号
217 reportItemCode = "CSL";//查询字段
218 //水集合
219 List<String> waterList = commandCentreService.getReportItemvByReitIdAndDate7Day(reportId, reportItemCode,dateTime );
220
221 //电耗集合
222 List<String> consumeList = new ArrayList<>();
223
224 String dividend =null; //被除数
225 String divisor = null;//除数
226 String division = null;//除法结果
227 if(electricityList != null && waterList != null && electricityList.size() == waterList.size()){
228 for(int i =0 ;i<electricityList.size() ; i++){
229 division = "0";
230 dividend = electricityList.get(i);
231 divisor = waterList.get(i);
232 if(dividend != null && divisor!= null && divisor.equals("0")){
233 DigitalUtils.division( dividend ,divisor );
234 }
235 consumeList.add( division );
236 }
237 }
238 List<String > dateList = DateUtil.getInstance().get7Day("MM-dd");
239
240 StackedAreaChartDataVO stackedAreaChartDataVO = new StackedAreaChartDataVO();
241 stackedAreaChartDataVO.setElectricityList(electricityList);
242 stackedAreaChartDataVO.setWaterList(waterList);
243 stackedAreaChartDataVO.setConsumeList( consumeList);
244 stackedAreaChartDataVO.setDateList(dateList );
245
246 Result<StackedAreaChartDataVO> result = new Result<>();
247 result.setSuccess(true);
248 result.setResult(stackedAreaChartDataVO);
249 return result;
250 }
251
252
253 private SysCommandCentreResultVO convertSysAlgorithmStatisticsResultNumberVO(FReportItemv currenteportItemv, FReportItemv lastMonthReportItemv ,FReportItemv lastYearReportItemv ){
254 SysCommandCentreResultVO commandCentreResultVO = new SysCommandCentreResultVO();
255 FRportlCommandCenterVO monthData = new FRportlCommandCenterVO();//当月数据
256 FRportlCommandCenterVO dayData = new FRportlCommandCenterVO();//日数据
257 //FRportlCommandCenterVO yearData = new FRportlCommandCenterVO();//年数据
258
259
260 monthData.setValue( DigitalUtils.division(currenteportItemv.getSumValue() ,"10000") );
261 monthData.setValueHb( DigitalUtils.division( lastMonthReportItemv.getSumValue(),"10000"));//上月同期;
262 monthData.setValueTb( DigitalUtils.division( lastYearReportItemv.getSumValue(),"10000") );//去年同期
263
264 dayData.setValue( DigitalUtils.division( currenteportItemv.getAvgValue(),"10000"));
265 dayData.setValueHb( DigitalUtils.division( lastMonthReportItemv.getAvgValue(),"10000"));//上月同期;
266 dayData.setValueTb( DigitalUtils.division( lastYearReportItemv.getAvgValue(),"10000") );//去年同期
267 //dayData.setValue(currenteportItemv.getAvgValue());lastMonthReportItemv.getAvgValue(); lastYearReportItemv.getAvgValue();
268 // yearData.setValue();yearData.setValueHb(); yearData.setValueTb();
269 commandCentreResultVO.setMonthData( monthData ) ;
270 commandCentreResultVO.setDayData( dayData );
271 return commandCentreResultVO;
272 }
273 }
1 package com.skua.modules.algorithm.service;
2
3 import com.skua.modules.report.entity.FReportItemv;
4 import com.skua.modules.report.vo.DepartLoadRateVO;
5
6 import java.util.List;
7
8 /**
9 * <pre>
10 * 指挥中心实现逻辑
11 * </pre>
12 * @author 康伟
13 * @version V0.1, 2024年9月3日
14 */
15 public interface ICommandCentreService {
16
17
18 /**
19 * 指挥中心---运行负荷率分析
20 * @param loadRateType
21 * @return
22 */
23 public List<DepartLoadRateVO> statisticsByLoadRate(Integer loadRateType);
24
25 /**
26 * 指挥中心---运行负荷率分析 总数查询
27 * @param loadRateType
28 * @return
29 */
30 public int statisticsByLoadRateNum(int loadRateType);
31
32
33 /**
34 * 根据reitId与时间查询
35 * @param reportId
36 * @param startDate
37 * @param endDate
38 * @return
39 */
40 public FReportItemv getReportItemvByReitIdAndDate(String reportId, String reportItemCode, String startDate, String endDate);
41
42 /**
43 * 根据reitId查询近7天数据
44 * @param reportId
45 * @param reportItemCode
46 * @param dateTime
47 * @return
48 */
49 public List<String> getReportItemvByReitIdAndDate7Day(String reportId, String reportItemCode, String dateTime);
50
51
52
53 }
...@@ -23,6 +23,8 @@ public interface ISysAlgorithmStatisticsLibraryService extends IService<SysAlgor ...@@ -23,6 +23,8 @@ public interface ISysAlgorithmStatisticsLibraryService extends IService<SysAlgor
23 */ 23 */
24 SysAlgorithmStatisticsResultVO statistics(SysAlgorithmStatisticsLibraryVO sysAlgorithmStatisticsLibraryVO, Map<String,Object> paramMap) throws Exception; 24 SysAlgorithmStatisticsResultVO statistics(SysAlgorithmStatisticsLibraryVO sysAlgorithmStatisticsLibraryVO, Map<String,Object> paramMap) throws Exception;
25 25
26
27
26 SysAlgorithmStatisticsResultVO statisticsDayAndFill(SysAlgorithmStatisticsLibraryVO sysAlgorithmStatisticsLibraryVO, Map<String,Object> paramMap, SysAlgorithmStatisticsLibrary sysAlgorithmStatisticsLibrary) throws Exception; 28 SysAlgorithmStatisticsResultVO statisticsDayAndFill(SysAlgorithmStatisticsLibraryVO sysAlgorithmStatisticsLibraryVO, Map<String,Object> paramMap, SysAlgorithmStatisticsLibrary sysAlgorithmStatisticsLibrary) throws Exception;
27 29
28 SysAlgorithmStatisticsResultVO statisticsHour(SysAlgorithmStatisticsLibraryVO sysAlgorithmStatisticsLibraryVO, Map<String,Object> paramMap,SysAlgorithmStatisticsLibrary sysAlgorithmStatisticsLibrary) throws Exception; 30 SysAlgorithmStatisticsResultVO statisticsHour(SysAlgorithmStatisticsLibraryVO sysAlgorithmStatisticsLibraryVO, Map<String,Object> paramMap,SysAlgorithmStatisticsLibrary sysAlgorithmStatisticsLibrary) throws Exception;
......
1 package com.skua.modules.algorithm.service.impl;
2
3 import com.skua.modules.algorithm.service.ICommandCentreService;
4 import com.skua.modules.report.entity.FReportItemv;
5 import com.skua.modules.report.mapper.FReportItemMapper;
6 import com.skua.modules.report.vo.DepartLoadRateVO;
7 import com.skua.modules.report.mapper.FReportItemvMapper;
8 import org.springframework.stereotype.Service;
9
10 import javax.annotation.Resource;
11 import java.util.List;
12
13 /**
14 * <pre>
15 * 指挥中心实现逻辑
16 * </pre>
17 * @author 康伟
18 * @version V0.1, 2024年9月3日
19 */
20 @Service
21 public class CommandCentreServiceImpl implements ICommandCentreService {
22
23 @Resource
24 private FReportItemvMapper fReportItemvMapper;
25
26 @Resource
27 private FReportItemMapper reportItemMapper;
28 /**
29 * 指挥中心---运行负荷率分析
30 * @param loadRateType
31 * @return
32 */
33 public List<DepartLoadRateVO> statisticsByLoadRate(Integer loadRateType){
34 return fReportItemvMapper.statisticsByLoadRate(loadRateType);
35 }
36
37 /**
38 * 指挥中心---运行负荷率分析 总数查询
39 * @param loadRateType
40 * @return
41 */
42 public int statisticsByLoadRateNum(int loadRateType){
43 return fReportItemvMapper.statisticsByLoadRateNum(loadRateType);
44 }
45
46 /**
47 * 根据reitId与时间查询
48 * @param reportId
49 * @param startDate
50 * @param endDate
51 * @return
52 */
53 public FReportItemv getReportItemvByReitIdAndDate(String reportId, String reportItemCode, String startDate, String endDate){
54
55 //根据reportId 与reportItemCode 查询reitId;
56 List<String> reitIdList = reportItemMapper.getReportItemId(reportId,reportItemCode);
57 FReportItemv reportItemv = null;
58 if(reitIdList != null ){
59 reportItemv = fReportItemvMapper.getReportItemvByReitIdAndDate(reitIdList.get(0) , startDate , endDate);
60 }
61 return reportItemv;
62 }
63
64 /**
65 * 根据reitId查询近7天数据
66 * @param reportId
67 * @param reportItemCode
68 * @param dateTime
69 * @return
70 */
71 public List<String> getReportItemvByReitIdAndDate7Day(String reportId, String reportItemCode, String dateTime){
72 //根据reportId 与reportItemCode 查询reitId;
73 List<String> reitIdList = reportItemMapper.getReportItemId(reportId,reportItemCode);
74 List<String> dataList = null;
75 if(reitIdList != null ){
76 dataList = fReportItemvMapper.getReportItemvByReitIdAndDate7Day(reitIdList.get(0) , dateTime);
77 }
78 return dataList;
79 }
80
81 }
...@@ -16,6 +16,8 @@ import com.skua.modules.algorithm.service.ISysAlgorithmLibraryService; ...@@ -16,6 +16,8 @@ import com.skua.modules.algorithm.service.ISysAlgorithmLibraryService;
16 import com.skua.modules.algorithm.service.ISysAlgorithmStatisticsLibraryService; 16 import com.skua.modules.algorithm.service.ISysAlgorithmStatisticsLibraryService;
17 import com.skua.modules.algorithm.vo.*; 17 import com.skua.modules.algorithm.vo.*;
18 import com.skua.modules.flow.utils.StringUtil; 18 import com.skua.modules.flow.utils.StringUtil;
19 import com.skua.modules.report.mapper.FReportItemMapper;
20 import com.skua.modules.report.mapper.FReportItemvMapper;
19 import com.skua.modules.system.entity.SysDepart; 21 import com.skua.modules.system.entity.SysDepart;
20 import com.skua.modules.system.service.ISysDepartService; 22 import com.skua.modules.system.service.ISysDepartService;
21 import org.apache.commons.lang3.StringUtils; 23 import org.apache.commons.lang3.StringUtils;
...@@ -24,6 +26,7 @@ import org.springframework.beans.factory.annotation.Qualifier; ...@@ -24,6 +26,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
24 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; 26 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
25 import org.springframework.stereotype.Service; 27 import org.springframework.stereotype.Service;
26 28
29 import javax.annotation.Resource;
27 import java.text.NumberFormat; 30 import java.text.NumberFormat;
28 import java.util.*; 31 import java.util.*;
29 import java.util.concurrent.Callable; 32 import java.util.concurrent.Callable;
...@@ -45,6 +48,7 @@ public class SysAlgorithmStatisticsLibraryServiceImpl extends ServiceImpl<SysAlg ...@@ -45,6 +48,7 @@ public class SysAlgorithmStatisticsLibraryServiceImpl extends ServiceImpl<SysAlg
45 private ThreadPoolTaskExecutor taskExecutor; 48 private ThreadPoolTaskExecutor taskExecutor;
46 private static NumberFormat numberFormat; 49 private static NumberFormat numberFormat;
47 50
51
48 static { 52 static {
49 numberFormat = NumberFormat.getInstance(); 53 numberFormat = NumberFormat.getInstance();
50 numberFormat.setGroupingUsed(false); 54 numberFormat.setGroupingUsed(false);
......
1 package com.skua.modules.algorithm.vo;
2
3
4 import com.skua.modules.report.vo.DepartLoadRateVO;
5 import io.swagger.annotations.ApiModel;
6 import io.swagger.annotations.ApiModelProperty;
7 import lombok.Data;
8
9 import java.io.Serializable;
10 import java.util.List;
11
12 /**
13 * 指挥中心--部门运行负荷率接受对象
14 */
15 @Data
16 @ApiModel(value="指挥中心--部门运行负荷率接受对象", description="指挥中心--部门运行负荷率接受对象")
17 public class DepartLoadRateResultVO implements Serializable{
18
19 @ApiModelProperty(value = "正常负荷数")
20 private Integer normalNum;
21
22 @ApiModelProperty(value = "低负荷数")
23 private Integer lowLoadNum;
24
25 @ApiModelProperty(value = "超负荷数")
26 private Integer overloadNum;
27
28 @ApiModelProperty(value = "部门运行负荷率列表")
29 private List<DepartLoadRateVO> departLoadRateVOList;
30 }
1 package com.skua.modules.algorithm.vo;
2 import com.skua.modules.report.vo.DepartLoadRateVO;
3 import io.swagger.annotations.ApiModel;
4 import io.swagger.annotations.ApiModelProperty;
5 import lombok.Data;
6
7 import java.io.Serializable;
8 import java.util.List;
9
10 /**
11 * 指挥中心--部门运行负荷率接受对象
12 */
13 @Data
14 @ApiModel(value="指挥中心--污水处理趋势", description="指挥中心--污水处理趋势")
15 public class StackedAreaChartDataVO implements Serializable {
16
17 //电集合
18 @ApiModelProperty(value = "电集合")
19 List<String> electricityList;
20 //水集合
21 @ApiModelProperty(value = "水集合")
22 List<String> waterList ;
23 //电耗集合
24 @ApiModelProperty(value = "电耗集合")
25 List<String> consumeList = null;
26
27 @ApiModelProperty(value = "日历集合")
28 List<String> dateList;
29 }
...@@ -65,4 +65,15 @@ public class SysAlgorithmStatisticsLibraryVO { ...@@ -65,4 +65,15 @@ public class SysAlgorithmStatisticsLibraryVO {
65 @Excel(name = "是否查询子机构(0:不是,1:是)", width = 15) 65 @Excel(name = "是否查询子机构(0:不是,1:是)", width = 15)
66 @ApiModelProperty(value = "是否查询子机构(0:不是,1:是)") 66 @ApiModelProperty(value = "是否查询子机构(0:不是,1:是)")
67 private java.lang.String isChildDepart; 67 private java.lang.String isChildDepart;
68
69 /**报表选项code*/
70 @ApiModelProperty(value = "报表Itme选项code")
71 private java.lang.String reportItemCode;
72
73 @ApiModelProperty(value = "报表编号")
74 private java.lang.String reportId;
75
76 @ApiModelProperty(value = "负载率类型")
77 private Integer loadRateType;
78
68 } 79 }
......
1 package com.skua.modules.algorithm.vo;
2
3
4 import com.skua.modules.report.vo.FRportlCommandCenterVO;
5 import io.swagger.annotations.ApiModel;
6 import io.swagger.annotations.ApiModelProperty;
7 import lombok.Data;
8
9 import java.io.Serializable;
10
11 /**
12 * 统计功能配置表
13 */
14 @Data
15 @ApiModel(value="控制中心报表结果接收对象", description="控制中心报表结果接收对象")
16 public class SysCommandCentreResultVO implements Serializable {
17
18 @ApiModelProperty(value = "当前月数据")
19 private FRportlCommandCenterVO monthData;
20
21 @ApiModelProperty(value = "上月数据")
22 private FRportlCommandCenterVO dayData;
23
24 @ApiModelProperty(value = "去年数据")
25 private FRportlCommandCenterVO yearData;
26
27 @ApiModelProperty(value = "统计数据")
28 private FRportlCommandCenterVO statisticsData;
29
30 @ApiModelProperty(value = "总设计规模")
31 private String totalData;
32
33
34 }
1 package com.skua.modules.guest.util; 1 package com.skua.modules.guest.util;
2 2
3 import java.text.SimpleDateFormat; 3 import java.text.SimpleDateFormat;
4 import java.time.LocalDate;
4 import java.time.LocalDateTime; 5 import java.time.LocalDateTime;
5 import java.time.ZoneId; 6 import java.time.ZoneId;
7 import java.time.format.DateTimeFormatter;
6 import java.util.*; 8 import java.util.*;
7 9
8 /** 10 /**
...@@ -25,6 +27,28 @@ public class DateUtil { ...@@ -25,6 +27,28 @@ public class DateUtil {
25 } 27 }
26 28
27 /** 29 /**
30 * 获取7天日期数据,并指定显示格式
31 * @param dateFormat
32 * @return
33 */
34 public List<String> get7Day(String dateFormat) {
35 if(dateFormat == null ){
36 dateFormat = "yyyy-MM-dd";
37 }
38 LocalDate today = LocalDate.now();
39 List<String> dates = new ArrayList<>();
40 DateTimeFormatter formatter = DateTimeFormatter.ofPattern(dateFormat);
41
42 for (int i = 0; i < 7; i++) {
43 LocalDate date = today.minusDays(i);
44 dates.add(date.format(formatter));
45 }
46
47 //dates.forEach(System.out::println);
48 return dates;
49 }
50
51 /**
28 * 获取今天日期 52 * 获取今天日期
29 * 53 *
30 * @return 54 * @return
...@@ -125,5 +149,4 @@ public class DateUtil { ...@@ -125,5 +149,4 @@ public class DateUtil {
125 public static LocalDateTime dateToLocalDateTime(Date date){ 149 public static LocalDateTime dateToLocalDateTime(Date date){
126 return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); 150 return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
127 } 151 }
128
129 } 152 }
......
1 package com.skua.modules.report.entity; 1 package com.skua.modules.report.entity;
2 2
3 import com.baomidou.mybatisplus.annotation.IdType; 3 import com.baomidou.mybatisplus.annotation.IdType;
4 import com.baomidou.mybatisplus.annotation.TableField;
4 import com.baomidou.mybatisplus.annotation.TableId; 5 import com.baomidou.mybatisplus.annotation.TableId;
5 import com.baomidou.mybatisplus.annotation.TableName; 6 import com.baomidou.mybatisplus.annotation.TableName;
6 import com.skua.core.aspect.annotation.Dict; 7 import com.skua.core.aspect.annotation.Dict;
...@@ -85,4 +86,15 @@ public class FReportItemv { ...@@ -85,4 +86,15 @@ public class FReportItemv {
85 @ApiModelProperty(value = "标识") 86 @ApiModelProperty(value = "标识")
86 private java.lang.Integer delFlag; 87 private java.lang.Integer delFlag;
87 88
89
90
91 @ApiModelProperty(value = "统计总数")
92 @TableField(exist = false)
93 private String sumValue;
94
95 @ApiModelProperty(value = "平均总数")
96 @TableField(exist = false)
97 private String avgValue;
98
99
88 } 100 }
......
...@@ -18,6 +18,14 @@ public interface FReportItemMapper extends BaseMapper<FReportItem> { ...@@ -18,6 +18,14 @@ public interface FReportItemMapper extends BaseMapper<FReportItem> {
18 18
19 List<FReportItem> getListByReportId(@Param("reportId") String reportId); 19 List<FReportItem> getListByReportId(@Param("reportId") String reportId);
20 20
21 /**
22 * 根据 itemCode 与reportId 查询id
23 * @param reportId
24 * @param reportItemCode
25 * @return
26 */
27 public List<String> getReportItemId(@Param("reportId") String reportId,@Param("itemCode") String reportItemCode);
28
21 void changeStatus(@Param("id") String id, @Param("required") String required); 29 void changeStatus(@Param("id") String id, @Param("required") String required);
22 30
23 List<FReportItem> getItemInfo(@Param("itemAlias") String itemAlias, @Param("reportId") String reportId); 31 List<FReportItem> getItemInfo(@Param("itemAlias") String itemAlias, @Param("reportId") String reportId);
......
1 package com.skua.modules.report.mapper; 1 package com.skua.modules.report.mapper;
2 2
3 import com.skua.modules.report.vo.DepartLoadRateVO;
4 import com.skua.modules.report.vo.ReportItemvParam;
3 import org.apache.ibatis.annotations.Param; 5 import org.apache.ibatis.annotations.Param;
4 import com.skua.modules.report.entity.FReportItemv; 6 import com.skua.modules.report.entity.FReportItemv;
5 import com.baomidou.mybatisplus.core.mapper.BaseMapper; 7 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...@@ -32,4 +34,44 @@ public interface FReportItemvMapper extends BaseMapper<FReportItemv> { ...@@ -32,4 +34,44 @@ public interface FReportItemvMapper extends BaseMapper<FReportItemv> {
32 * @author Li Yuanyuan, 2021年5月25日 上午10:34:37 34 * @author Li Yuanyuan, 2021年5月25日 上午10:34:37
33 */ 35 */
34 List<FReportItemv> getReportItemvByDataId(String dataId); 36 List<FReportItemv> getReportItemvByDataId(String dataId);
37
38
39 /**
40 * 据reit_id 查询视图表数据 返回总数,平均数
41 * @param reportItemvParam
42 * @return
43 */
44 List<FReportItemv> getReportItemvByReitId(ReportItemvParam reportItemvParam);
45
46 /**
47 * 根据reitId与时间查询
48 * @param reitId
49 * @param startDate
50 * @param endDate
51 * @return
52 */
53 public FReportItemv getReportItemvByReitIdAndDate(@Param("reitId") String reitId, @Param("startDate") String startDate,@Param("endDate") String endDate);
54
55
56 /**
57 * 根据类型查询:指挥中心---运行负荷率分析
58 * @param loadRateType
59 * @return
60 */
61 public List<DepartLoadRateVO> statisticsByLoadRate(@Param("loadRateType") Integer loadRateType);
62
63 /**
64 * 指挥中心---运行负荷率分析 总数查询
65 * @param loadRateType
66 * @return
67 */
68 public int statisticsByLoadRateNum(@Param("loadRateType") Integer loadRateType);
69
70 /**
71 * 根据reitId查询近7天数据
72 * @param reitId
73 * @param dateTime
74 * @return
75 */
76 public List<String> getReportItemvByReitIdAndDate7Day(@Param("reitId") String reitId, @Param("dateTime") String dateTime);
35 } 77 }
......
...@@ -18,6 +18,14 @@ ...@@ -18,6 +18,14 @@
18 order by sort_num 18 order by sort_num
19 </select> 19 </select>
20 20
21
22 <!-- 根据 itemCode 与reportId 查询id -->
23 <select id="getReportItemId" resultType="java.lang.String">
24 select id from f_report_item
25 where report_id = #{reportId} and required='1' and item_code = #{itemCode}
26
27 </select>
28
21 <update id="changeStatus"> 29 <update id="changeStatus">
22 update f_report_item set required = #{required} where id = #{id} 30 update f_report_item set required = #{required} where id = #{id}
23 </update> 31 </update>
......
...@@ -38,6 +38,73 @@ ...@@ -38,6 +38,73 @@
38 <select id="getReportItemvByDataId" resultType="com.skua.modules.report.entity.FReportItemv"> 38 <select id="getReportItemvByDataId" resultType="com.skua.modules.report.entity.FReportItemv">
39 select * from f_report_itemv where data_id=#{dataId} 39 select * from f_report_itemv where data_id=#{dataId}
40 </select> 40 </select>
41
42
43
44 <!-- 根据reit_id 查询视图表数据 返回总数,平均数 -->
45 <select id="getReportItemvByReitId" resultType="com.skua.modules.report.entity.FReportItemv">
46 SELECT sum(item_value) 'sum_value' , avg(item_value) 'avg_value', 'DD' as 'itemValue' FROM f_report_itemv where reit_id=#{reitId} and data_time &gt;= #{startDate} and data_time &lt;= #{endDate}
47 union all
48 SELECT sum(item_value),avg(item_value) ,'HB' FROM f_report_itemv where reit_id=#{reitId} and data_time &gt;= #{lastMonthStartDate} and data_time &lt;= #{lastMonthEndDate}
49 union all
50 SELECT sum(item_value) ,avg(item_value),'TB' FROM f_report_itemv where reit_id=#{reitId} and data_time &gt;= #{lastYearStartDate} and data_time &lt;= #{lastYearEndDate}
51
52 </select>
53
54 <!-- 根据reit_id 查询视图表数据 返回总数,平均数 -->
55 <select id="getReportItemvByReitIdAndDate" resultType="com.skua.modules.report.entity.FReportItemv">
56 SELECT sum(item_value) 'sum_value' , avg(item_value) 'avg_value' FROM f_report_itemv where reit_id=#{reitId} and data_time &gt;= #{startDate} and data_time &lt;= #{endDate}
57 </select>
58
59
60
61 <!-- 根据类型查询:指挥中心-运行负荷率分析 -->
62 <select id="statisticsByLoadRate" resultType="com.skua.modules.report.vo.DepartLoadRateVO">
63 select aaa.avg_data ,aaa.sum_data 'waterYieldMonth', fi.pro_scale , d.depart_name 'departName' , ROUND(aaa.avg_data / (fi.pro_scale * 100000) , 2) 'loadRate'
64 from (
65 select avg(ri.item_value) 'avg_data' ,sum(ri.item_value) 'sum_data' ,ri.depart_id from f_report_itemv ri where ri.data_time &gt;= #{startDate} and ri.data_time &lt;= #{endDate} group by ri.depart_id
66 ) aaa
67 left join sys_factory_info fi on aaa.depart_id = fi.depart_id
68 left join sys_depart d on d.id = aaa.depart_id
69 where 1=1
70 <if test="loadRateType != null and loadRateType == '1'">
71 and aaa.avg_data / (fi.pro_scale * 100000) &gt;= 60 and aaa.avg_data / (fi.pro_scale * 100000) &lt;= 120
72 </if>
73 <if test="loadRateType != null and loadRateType == '2'">
74 aaa.avg_data / (fi.pro_scale * 100000) &lt; 60
75 </if>
76 <if test="loadRateType != null and loadRateType == '3'">
77 and aaa.avg_data / (fi.pro_scale * 100000) &gt; 120
78 </if>
79 order by aaa.avg_data / fi.pro_scale desc limit 10
80 </select>
81
82
83 <!-- 根据类型查询:指挥中心-运行负荷率分析 -->
84 <select id="statisticsByLoadRateNum" resultType="java.lang.Integer">
85 select count(1)
86 from (
87 select avg(ri.item_value) 'avg_data' ,sum(ri.item_value) 'sum_data' ,ri.depart_id from f_report_itemv ri where ri.data_time &gt;= #{startDate} and ri.data_time &lt;= #{endDate} group by ri.depart_id
88 ) aaa
89 left join sys_factory_info fi on aaa.depart_id = fi.depart_id
90 left join sys_depart d on d.id = aaa.depart_id
91 where 1=1
92 <if test="loadRateType != null and loadRateType == '1'">
93 and aaa.avg_data / (fi.pro_scale * 100000) &gt;= 60 and aaa.avg_data / (fi.pro_scale * 100000) &lt;= 120
94 </if>
95 <if test="loadRateType != null and loadRateType == '2'">
96 aaa.avg_data / (fi.pro_scale * 100000) &lt; 60
97 </if>
98 <if test="loadRateType != null and loadRateType == '3'">
99 and aaa.avg_data / (fi.pro_scale * 100000) &gt; 120
100 </if>
101 </select>
102
103 <!-- 根据reitId查询近7天数据-->
104 <select id="statisticsByLoadRateNum" resultType="java.lang.Integer">
105 SELECT sum(item_value) FROM f_report_itemv where reit_id=#{reitId} and DATE_SUB( CURDATE(), INTERVAL 7 DAY ) &lt;= date(data_time)
106 group by data_time
107 </select>
41 108
42 109
43 </mapper> 110 </mapper>
......
...@@ -2,6 +2,7 @@ package com.skua.modules.report.service; ...@@ -2,6 +2,7 @@ package com.skua.modules.report.service;
2 2
3 import com.skua.modules.report.entity.FReportItemv; 3 import com.skua.modules.report.entity.FReportItemv;
4 import com.baomidou.mybatisplus.extension.service.IService; 4 import com.baomidou.mybatisplus.extension.service.IService;
5 import com.skua.modules.report.vo.ReportItemvParam;
5 6
6 import java.util.Date; 7 import java.util.Date;
7 import java.util.List; 8 import java.util.List;
...@@ -23,4 +24,13 @@ public interface IFReportItemvService extends IService<FReportItemv> { ...@@ -23,4 +24,13 @@ public interface IFReportItemvService extends IService<FReportItemv> {
23 boolean isExitDataByTime(String reitId, String dataTime, String departId); 24 boolean isExitDataByTime(String reitId, String dataTime, String departId);
24 //通过dataId获取填报数据 25 //通过dataId获取填报数据
25 List<FReportItemv> getReportItemvByDataId(String dataId); 26 List<FReportItemv> getReportItemvByDataId(String dataId);
27
28 /**
29 * 据reit_id 查询视图表数据 返回总数,平均数
30 * @param reportItemvParam
31 * @return
32 */
33 List<FReportItemv> getReportItemvByReitId(ReportItemvParam reportItemvParam);
34
35
26 } 36 }
......
...@@ -2,8 +2,11 @@ package com.skua.modules.report.service.impl; ...@@ -2,8 +2,11 @@ package com.skua.modules.report.service.impl;
2 2
3 import com.skua.common.report.ReportViewUtil; 3 import com.skua.common.report.ReportViewUtil;
4 import com.skua.modules.report.entity.FReportItemv; 4 import com.skua.modules.report.entity.FReportItemv;
5 import com.skua.modules.report.mapper.FReportItemMapper;
5 import com.skua.modules.report.mapper.FReportItemvMapper; 6 import com.skua.modules.report.mapper.FReportItemvMapper;
6 import com.skua.modules.report.service.IFReportItemvService; 7 import com.skua.modules.report.service.IFReportItemvService;
8 import com.skua.modules.report.vo.FRportlCommandCenterVO;
9 import com.skua.modules.report.vo.ReportItemvParam;
7 import org.apache.ibatis.annotations.Param; 10 import org.apache.ibatis.annotations.Param;
8 import org.springframework.stereotype.Service; 11 import org.springframework.stereotype.Service;
9 12
...@@ -24,6 +27,9 @@ public class FReportItemvServiceImpl extends ServiceImpl<FReportItemvMapper, FRe ...@@ -24,6 +27,9 @@ public class FReportItemvServiceImpl extends ServiceImpl<FReportItemvMapper, FRe
24 @Resource 27 @Resource
25 private FReportItemvMapper fReportItemvMapper; 28 private FReportItemvMapper fReportItemvMapper;
26 29
30
31
32
27 @Override 33 @Override
28 public void deleteByDataId(String dataId) { 34 public void deleteByDataId(String dataId) {
29 fReportItemvMapper.deleteByDataId(dataId); 35 fReportItemvMapper.deleteByDataId(dataId);
...@@ -71,4 +77,17 @@ public class FReportItemvServiceImpl extends ServiceImpl<FReportItemvMapper, FRe ...@@ -71,4 +77,17 @@ public class FReportItemvServiceImpl extends ServiceImpl<FReportItemvMapper, FRe
71 return fReportItemvMapper.getReportItemvByDataId(dataId); 77 return fReportItemvMapper.getReportItemvByDataId(dataId);
72 } 78 }
73 79
80
81 /**
82 * 据reit_id 查询视图表数据 返回总数,平均数
83 * @param reportItemvParam
84 * @return
85 */
86 public List<FReportItemv> getReportItemvByReitId(ReportItemvParam reportItemvParam){
87 return fReportItemvMapper.getReportItemvByReitId(reportItemvParam);
88 }
89
90
91
92
74 } 93 }
......
1 package com.skua.modules.report.vo;
2 import io.swagger.annotations.ApiModel;
3 import io.swagger.annotations.ApiModelProperty;
4 import lombok.Data;
5
6 import java.io.Serializable;
7
8 /**
9 * 统计功能配置表
10 */
11 @Data
12 @ApiModel(value="指挥中心--部门运行负荷率接受对象", description="指挥中心--部门运行负荷率接受对象")
13 public class DepartLoadRateVO implements Serializable{
14
15 @ApiModelProperty(value = "项目公司")
16 private String departName;
17
18 @ApiModelProperty(value = "运行负荷率")
19 private String loadRate;
20
21 @ApiModelProperty(value = "达标率")
22 private String qualifyRate;
23
24 @ApiModelProperty(value = "处理水量(吨/月)")
25 private String waterYieldMonth;
26 }
1 package com.skua.modules.report.vo;
2
3 import io.swagger.annotations.ApiModel;
4 import io.swagger.annotations.ApiModelProperty;
5 import lombok.Data;
6
7 import java.io.Serializable;
8
9 /**
10 * 统计功能配置表
11 */
12 @Data
13 @ApiModel(value="控制中心报表结果接收对象", description="控制中心报表结果接收对象")
14 public class FRportlCommandCenterVO implements Serializable {
15 @ApiModelProperty(value = "标题")
16 private String title;
17 @ApiModelProperty(value = "结果")
18 private String value;
19 /* @ApiModelProperty(value = "最大值")
20 private Object maxValue;
21 @ApiModelProperty(value = "最小值")
22 private Object minValue;*/
23 @ApiModelProperty(value = "上月同期")
24 private String valueTb;
25
26 @ApiModelProperty(value = "去年同期")
27 private String valueHb;
28
29 /* @ApiModelProperty(value = "同比比例")
30 private Object valueTbProportion;
31 @ApiModelProperty(value = "同比差值")
32 private Object valueTbDifference;
33
34 @ApiModelProperty(value = "环比比例")
35 private Object valueHbProportion;
36 @ApiModelProperty(value = "环比差值")
37 private Object valueHbDifference;
38 @ApiModelProperty(value = "上期")
39 private Object valuePre;
40 @ApiModelProperty(value = "上期比例")
41 private Object valuePreProportion;
42 @ApiModelProperty(value = "上期差值")
43 private Object valuePreDifference;
44 @ApiModelProperty(value = "单位")
45 private String unit;*/
46 }
1 package com.skua.modules.report.vo;
2
3 import com.skua.core.util.DateUtils;
4 import io.swagger.annotations.ApiModel;
5 import io.swagger.annotations.ApiModelProperty;
6 import lombok.Data;
7
8 import java.io.Serializable;
9 import java.text.ParseException;
10 import java.util.Calendar;
11
12 /**
13 * ReportItemvParam 查询参数
14 */
15 @Data
16 @ApiModel(value="统计结果查询对象", description="统计结果查询对象")
17 public class ReportItemvParam implements Serializable{
18
19 @ApiModelProperty(value = "报表数据项id")
20 public String reitId;
21
22 @ApiModelProperty(value = "报表编号")
23 private java.lang.String reportId;
24
25 @ApiModelProperty(value = "报表Itme选项code")
26 private java.lang.String reportItemCode;
27
28 /**开始时间*/
29 @ApiModelProperty(value = "开始时间")
30 private java.lang.String startDate;
31
32 @ApiModelProperty(value = "结束时间")
33 private java.lang.String endDate;
34
35
36 @ApiModelProperty(value = "上月开始时间")
37 private java.lang.String lastMonthStartDate;
38
39 @ApiModelProperty(value = "上月结束时间")
40 private java.lang.String lastMonthEndDate;
41
42
43 @ApiModelProperty(value = "去年开始时间")
44 private java.lang.String lastYearStartDate;
45
46 @ApiModelProperty(value = "去年结束时间")
47 private java.lang.String lastYearEndDate;
48
49
50 /**
51 * 初始化数据
52 * @param startTime
53 * @param endTime
54 */
55 public ReportItemvParam(String reportId ,String reportItemCode ,String startTime , String endTime){
56 try {
57 this.reitId = reportId;
58 this.reportItemCode = reportItemCode;
59 if(startTime != null && startTime.length() > 0 ){
60 this.startDate = startTime;
61 this.lastMonthStartDate = DateUtils.formatAddTime(startTime, "yyyy-MM-dd", Calendar.MONTH, -1);
62 this.lastYearStartDate = DateUtils.formatAddTime(startTime, "yyyy-MM-dd", Calendar.YEAR, -1);
63 }
64 if(endTime != null && endTime.length() > 0 ){
65 this.endDate = endTime;
66 this.lastMonthEndDate = DateUtils.formatAddTime(endTime, "yyyy-MM-dd", Calendar.MONTH, -1);
67 this. lastYearEndDate = DateUtils.formatAddTime(endTime, "yyyy-MM-dd", Calendar.YEAR, -1);
68 }
69 } catch (ParseException e) {
70 e.printStackTrace();
71 }
72 }
73
74
75 }
...@@ -90,4 +90,10 @@ public interface SysFactoryInfoMapper extends BaseMapper<SysFactoryInfo> { ...@@ -90,4 +90,10 @@ public interface SysFactoryInfoMapper extends BaseMapper<SysFactoryInfo> {
90 90
91 @Select("SELECT d.id as depart_id, d.depart_name AS NAME,d.depart_name AS depart_name,d.depart_type,(select depart_name from sys_depart sd where d.parent_id = sd.id )areaName,f.* FROM sys_depart d LEFT JOIN sys_factory_info f ON f.depart_id = d.id ${customSqlSegment}") 91 @Select("SELECT d.id as depart_id, d.depart_name AS NAME,d.depart_name AS depart_name,d.depart_type,(select depart_name from sys_depart sd where d.parent_id = sd.id )areaName,f.* FROM sys_depart d LEFT JOIN sys_factory_info f ON f.depart_id = d.id ${customSqlSegment}")
92 List<SysFactoryInfoVO> getFactoryListByWrapper(QueryWrapper queryWrapper); 92 List<SysFactoryInfoVO> getFactoryListByWrapper(QueryWrapper queryWrapper);
93
94 /**
95 * 获取总的设计规模
96 * @return
97 */
98 public String querySumProScale();
93 } 99 }
......
...@@ -489,4 +489,9 @@ ...@@ -489,4 +489,9 @@
489 WHERE 489 WHERE
490 alarm_program_code = #{id} 490 alarm_program_code = #{id}
491 </select> 491 </select>
492
493 <!-- 获取总的设计规模-->
494 <select id="" resultType="java.lang.String">
495 select sum(pro_scale) from sys_factory_info
496 </select>
492 </mapper> 497 </mapper>
......
...@@ -101,4 +101,12 @@ public interface ISysFactoryInfoService extends IService<SysFactoryInfo> { ...@@ -101,4 +101,12 @@ public interface ISysFactoryInfoService extends IService<SysFactoryInfo> {
101 void exitNew(SysFactoryInfoNewVO sysFactoryInfoNewVO); 101 void exitNew(SysFactoryInfoNewVO sysFactoryInfoNewVO);
102 102
103 List<SysFactoryInfoVO> getFactoryListByWrapper(QueryWrapper<SysFactoryInfoVO> queryWrapper); 103 List<SysFactoryInfoVO> getFactoryListByWrapper(QueryWrapper<SysFactoryInfoVO> queryWrapper);
104
105 /**
106 * 获取总的设计规模
107 * @return
108 */
109 public String querySumProScale();
110
111
104 } 112 }
......
...@@ -665,4 +665,12 @@ public class SysFactoryInfoServiceImpl extends ServiceImpl<SysFactoryInfoMapper, ...@@ -665,4 +665,12 @@ public class SysFactoryInfoServiceImpl extends ServiceImpl<SysFactoryInfoMapper,
665 return sysFactoryInfo; 665 return sysFactoryInfo;
666 } 666 }
667 667
668
669 /**
670 * 获取总的设计规模
671 * @return
672 */
673 public String querySumProScale(){
674 return sysFactoryInfoMapper.querySumProScale();
675 }
668 } 676 }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!