Merge remote-tracking branch 'origin/master' into master
正在显示
20 个修改的文件
包含
346 行增加
和
78 行删除
... | @@ -47,11 +47,13 @@ public class DigitalUtils { | ... | @@ -47,11 +47,13 @@ public class DigitalUtils { |
47 | if( dividend != null && dividend.length()>0 && divisor != null && divisor.length()>0){ | 47 | if( dividend != null && dividend.length()>0 && divisor != null && divisor.length()>0){ |
48 | double dividendD = Double.parseDouble(dividend); | 48 | double dividendD = Double.parseDouble(dividend); |
49 | double divisorD = Double.parseDouble(divisor); | 49 | double divisorD = Double.parseDouble(divisor); |
50 | if(divisorD != 0 ){ | ||
50 | double result = dividendD /divisorD; | 51 | double result = dividendD /divisorD; |
51 | BigDecimal bd = new BigDecimal(result); | 52 | BigDecimal bd = new BigDecimal(result); |
52 | BigDecimal roundedResult = bd.setScale(2, BigDecimal.ROUND_HALF_UP);System.out.println(roundedResult); | 53 | BigDecimal roundedResult = bd.setScale(2, BigDecimal.ROUND_HALF_UP);System.out.println(roundedResult); |
53 | resultStr = roundedResult.toString(); | 54 | resultStr = roundedResult.toString(); |
54 | } | 55 | } |
56 | } | ||
55 | //System.out.print("请输入被除数:");double dividend =scanner.nextDouble(); | 57 | //System.out.print("请输入被除数:");double dividend =scanner.nextDouble(); |
56 | // System.out.print("请输入除数:");double divisor =scanner.nextDouble(); | 58 | // System.out.print("请输入除数:");double divisor =scanner.nextDouble(); |
57 | 59 | ... | ... |
... | @@ -4,7 +4,6 @@ import java.io.*; | ... | @@ -4,7 +4,6 @@ import java.io.*; |
4 | import java.net.URLEncoder; | 4 | import java.net.URLEncoder; |
5 | import java.util.*; | 5 | import java.util.*; |
6 | import java.net.URLDecoder; | 6 | import java.net.URLDecoder; |
7 | import javax.servlet.ServletOutputStream; | ||
8 | import javax.servlet.http.HttpServletRequest; | 7 | import javax.servlet.http.HttpServletRequest; |
9 | import javax.servlet.http.HttpServletResponse; | 8 | import javax.servlet.http.HttpServletResponse; |
10 | 9 | ||
... | @@ -325,7 +324,7 @@ public class AjhMeetingMinutesController { | ... | @@ -325,7 +324,7 @@ public class AjhMeetingMinutesController { |
325 | */ | 324 | */ |
326 | @AutoLog(value = "会议纪要管理-通过会议纪要id下载会议纪要") | 325 | @AutoLog(value = "会议纪要管理-通过会议纪要id下载会议纪要") |
327 | @ApiOperation(value="会议纪要管理-通过id下载会议纪要", notes="会议纪要管理-通过id下载会议纪要") | 326 | @ApiOperation(value="会议纪要管理-通过id下载会议纪要", notes="会议纪要管理-通过id下载会议纪要") |
328 | @GetMapping("/exportWordData") | 327 | @GetMapping("/exportWord") |
329 | public void exportWordData(@RequestParam(name="id",required=true) String meetsId,HttpServletResponse response ) { | 328 | public void exportWordData(@RequestParam(name="id",required=true) String meetsId,HttpServletResponse response ) { |
330 | String templatePath = "D:\\test\\会议模板-2.docx";//导出模板文件名称 | 329 | String templatePath = "D:\\test\\会议模板-2.docx";//导出模板文件名称 |
331 | 330 | ||
... | @@ -414,16 +413,16 @@ public class AjhMeetingMinutesController { | ... | @@ -414,16 +413,16 @@ public class AjhMeetingMinutesController { |
414 | 413 | ||
415 | 414 | ||
416 | // 输出文件路径 --测试 | 415 | // 输出文件路径 --测试 |
417 | String outputPath = "D:\\test\\会议纪要导出记录.docx"; | 416 | /* String outputPath = "D:\\test\\会议纪要导出记录.docx"; |
418 | FileOutputStream outputFile = new FileOutputStream(outputPath); | 417 | FileOutputStream outputFile = new FileOutputStream(outputPath); |
419 | document.write( outputFile); | 418 | document.write( outputFile);*/ |
420 | 419 | ||
421 | //document.write(response.getOutputStream()); | 420 | document.write(response.getOutputStream()); |
422 | // 刷新和关闭输出流 | 421 | // 刷新和关闭输出流 |
423 | //response.getOutputStream().flush(); | 422 | response.getOutputStream().flush(); |
424 | //response.getOutputStream().close(); | 423 | response.getOutputStream().close(); |
425 | 424 | ||
426 | outputFile.close(); | 425 | //outputFile.close(); |
427 | } | 426 | } |
428 | catch (Exception e) { | 427 | catch (Exception e) { |
429 | e.printStackTrace(); | 428 | e.printStackTrace(); | ... | ... |
此文件的差异被折叠,
点击展开。
... | @@ -2,8 +2,12 @@ package com.skua.modules.algorithm.service; | ... | @@ -2,8 +2,12 @@ package com.skua.modules.algorithm.service; |
2 | 2 | ||
3 | import com.skua.modules.report.entity.FReportItemv; | 3 | import com.skua.modules.report.entity.FReportItemv; |
4 | import com.skua.modules.report.vo.DepartLoadRateVO; | 4 | import com.skua.modules.report.vo.DepartLoadRateVO; |
5 | import com.skua.modules.report.vo.FRportlCommandCenterVO; | ||
6 | import com.skua.modules.report.vo.ReportDateTrendVO; | ||
7 | import com.skua.modules.report.vo.ReportItemvParam; | ||
5 | 8 | ||
6 | import java.util.List; | 9 | import java.util.List; |
10 | import java.util.Map; | ||
7 | 11 | ||
8 | /** | 12 | /** |
9 | * <pre> | 13 | * <pre> |
... | @@ -17,17 +21,17 @@ public interface ICommandCentreService { | ... | @@ -17,17 +21,17 @@ public interface ICommandCentreService { |
17 | 21 | ||
18 | /** | 22 | /** |
19 | * 指挥中心---运行负荷率分析 | 23 | * 指挥中心---运行负荷率分析 |
20 | * @param loadRateType | 24 | * @param reportItemvParam |
21 | * @return | 25 | * @return |
22 | */ | 26 | */ |
23 | public List<DepartLoadRateVO> statisticsByLoadRate(Integer loadRateType); | 27 | public List<DepartLoadRateVO> statisticsByLoadRate(ReportItemvParam reportItemvParam); |
24 | 28 | ||
25 | /** | 29 | /** |
26 | * 指挥中心---运行负荷率分析 总数查询 | 30 | * 指挥中心---运行负荷率分析 总数查询 |
27 | * @param loadRateType | 31 | * @param loadRateType |
28 | * @return | 32 | * @return |
29 | */ | 33 | */ |
30 | public int statisticsByLoadRateNum(int loadRateType); | 34 | public int statisticsByLoadRateNum(int loadRateType,String startDate, String endDate); |
31 | 35 | ||
32 | 36 | ||
33 | /** | 37 | /** |
... | @@ -40,14 +44,24 @@ public interface ICommandCentreService { | ... | @@ -40,14 +44,24 @@ public interface ICommandCentreService { |
40 | public FReportItemv getReportItemvByReitIdAndDate(String reportId, String reportItemCode, String startDate, String endDate); | 44 | public FReportItemv getReportItemvByReitIdAndDate(String reportId, String reportItemCode, String startDate, String endDate); |
41 | 45 | ||
42 | /** | 46 | /** |
43 | * 根据reitId查询近7天数据 | 47 | * 根据reitId查询近几天数据 |
44 | * @param reportId | 48 | * @param reportItemvParam |
45 | * @param reportItemCode | ||
46 | * @param dateTime | ||
47 | * @return | 49 | * @return |
48 | */ | 50 | */ |
49 | public List<String> getReportItemvByReitIdAndDate7Day(String reportId, String reportItemCode, String dateTime); | 51 | public List<ReportDateTrendVO> getReportItemvByReitIdAndDate7Day(ReportItemvParam reportItemvParam); |
50 | 52 | ||
51 | 53 | ||
54 | /*** | ||
55 | * 查询报表数据,当前月统计、上个月统计、去年当月统计(求和) | ||
56 | * @param reportItemvParam | ||
57 | * @return | ||
58 | */ | ||
59 | public FRportlCommandCenterVO getReportItemvMonthDataByReitId(ReportItemvParam reportItemvParam); | ||
52 | 60 | ||
61 | /*** | ||
62 | * 查询报表数据,当日平均、上月同期、去年同期统计(求均值) | ||
63 | * @param reportItemvParam | ||
64 | * @return | ||
65 | */ | ||
66 | public FRportlCommandCenterVO getReportItemvDayDataByReitId( ReportItemvParam reportItemvParam); | ||
53 | } | 67 | } | ... | ... |
1 | package com.skua.modules.algorithm.service.impl; | 1 | package com.skua.modules.algorithm.service.impl; |
2 | 2 | ||
3 | import com.skua.modules.algorithm.service.ICommandCentreService; | 3 | import com.skua.modules.algorithm.service.ICommandCentreService; |
4 | import com.skua.modules.report.entity.FReportItem; | ||
4 | import com.skua.modules.report.entity.FReportItemv; | 5 | import com.skua.modules.report.entity.FReportItemv; |
5 | import com.skua.modules.report.mapper.FReportItemMapper; | 6 | import com.skua.modules.report.mapper.FReportItemMapper; |
6 | import com.skua.modules.report.vo.DepartLoadRateVO; | 7 | import com.skua.modules.report.vo.DepartLoadRateVO; |
7 | import com.skua.modules.report.mapper.FReportItemvMapper; | 8 | import com.skua.modules.report.mapper.FReportItemvMapper; |
9 | import com.skua.modules.report.vo.FRportlCommandCenterVO; | ||
10 | import com.skua.modules.report.vo.ReportDateTrendVO; | ||
11 | import com.skua.modules.report.vo.ReportItemvParam; | ||
8 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
9 | 13 | ||
10 | import javax.annotation.Resource; | 14 | import javax.annotation.Resource; |
... | @@ -27,11 +31,11 @@ public class CommandCentreServiceImpl implements ICommandCentreService { | ... | @@ -27,11 +31,11 @@ public class CommandCentreServiceImpl implements ICommandCentreService { |
27 | private FReportItemMapper reportItemMapper; | 31 | private FReportItemMapper reportItemMapper; |
28 | /** | 32 | /** |
29 | * 指挥中心---运行负荷率分析 | 33 | * 指挥中心---运行负荷率分析 |
30 | * @param loadRateType | 34 | * @param reportItemvParam |
31 | * @return | 35 | * @return |
32 | */ | 36 | */ |
33 | public List<DepartLoadRateVO> statisticsByLoadRate(Integer loadRateType){ | 37 | public List<DepartLoadRateVO> statisticsByLoadRate(ReportItemvParam reportItemvParam){ |
34 | return fReportItemvMapper.statisticsByLoadRate(loadRateType); | 38 | return fReportItemvMapper.statisticsByLoadRate(reportItemvParam.getLoadRateType(),reportItemvParam.getStartDate(),reportItemvParam.getEndDate()); |
35 | } | 39 | } |
36 | 40 | ||
37 | /** | 41 | /** |
... | @@ -39,8 +43,8 @@ public class CommandCentreServiceImpl implements ICommandCentreService { | ... | @@ -39,8 +43,8 @@ public class CommandCentreServiceImpl implements ICommandCentreService { |
39 | * @param loadRateType | 43 | * @param loadRateType |
40 | * @return | 44 | * @return |
41 | */ | 45 | */ |
42 | public int statisticsByLoadRateNum(int loadRateType){ | 46 | public int statisticsByLoadRateNum(int loadRateType,String startDate, String endDate){ |
43 | return fReportItemvMapper.statisticsByLoadRateNum(loadRateType); | 47 | return fReportItemvMapper.statisticsByLoadRateNum(loadRateType ,startDate, endDate ); |
44 | } | 48 | } |
45 | 49 | ||
46 | /** | 50 | /** |
... | @@ -53,29 +57,120 @@ public class CommandCentreServiceImpl implements ICommandCentreService { | ... | @@ -53,29 +57,120 @@ public class CommandCentreServiceImpl implements ICommandCentreService { |
53 | public FReportItemv getReportItemvByReitIdAndDate(String reportId, String reportItemCode, String startDate, String endDate){ | 57 | public FReportItemv getReportItemvByReitIdAndDate(String reportId, String reportItemCode, String startDate, String endDate){ |
54 | 58 | ||
55 | //根据reportId 与reportItemCode 查询reitId; | 59 | //根据reportId 与reportItemCode 查询reitId; |
56 | List<String> reitIdList = reportItemMapper.getReportItemId(reportId,reportItemCode); | 60 | //String reitId = reportItemMapper.getReportItemId(reportId,reportItemCode); |
57 | FReportItemv reportItemv = null; | 61 | FReportItemv reportItemv = null; |
58 | if(reitIdList != null ){ | 62 | List<FReportItem> reportItemList = reportItemMapper.getItemInfoByItemCode(reportItemCode,reportId); |
59 | reportItemv = fReportItemvMapper.getReportItemvByReitIdAndDate(reitIdList.get(0) , startDate , endDate); | 63 | if(reportItemList != null && !reportItemList.isEmpty() ){ |
64 | reportItemv = fReportItemvMapper.getReportItemvByReitIdAndDate(reportItemList.get(0).getId() , startDate , endDate); | ||
60 | } | 65 | } |
61 | return reportItemv; | 66 | return reportItemv; |
62 | } | 67 | } |
63 | 68 | ||
64 | /** | 69 | /** |
65 | * 根据reitId查询近7天数据 | 70 | * 根据reitId查询近7天数据 |
66 | * @param reportId | 71 | * @param reportItemvParam |
67 | * @param reportItemCode | ||
68 | * @param dateTime | ||
69 | * @return | 72 | * @return |
70 | */ | 73 | */ |
71 | public List<String> getReportItemvByReitIdAndDate7Day(String reportId, String reportItemCode, String dateTime){ | 74 | public List<ReportDateTrendVO> getReportItemvByReitIdAndDate7Day(ReportItemvParam reportItemvParam){ |
72 | //根据reportId 与reportItemCode 查询reitId; | 75 | //根据reportId 与reportItemCode 查询reitId; |
73 | List<String> reitIdList = reportItemMapper.getReportItemId(reportId,reportItemCode); | 76 | String reitId = this.getReitId(reportItemvParam); |
74 | List<String> dataList = null; | 77 | List<ReportDateTrendVO> dataList = null; |
75 | if(reitIdList != null ){ | 78 | if(reitId != null ){ |
76 | dataList = fReportItemvMapper.getReportItemvByReitIdAndDate7Day(reitIdList.get(0) , dateTime); | 79 | reportItemvParam.setReitId( reitId ); |
80 | dataList = fReportItemvMapper.getReportItemvByReitIdAndDate7Day(reportItemvParam); | ||
77 | } | 81 | } |
82 | |||
78 | return dataList; | 83 | return dataList; |
79 | } | 84 | } |
80 | 85 | ||
86 | |||
87 | /*** | ||
88 | * 查询报表数据,当前月统计、上个月统计、去年当月统计(求和) | ||
89 | * @param reportItemvParam | ||
90 | * @return | ||
91 | */ | ||
92 | public FRportlCommandCenterVO getReportItemvMonthDataByReitId(ReportItemvParam reportItemvParam){ | ||
93 | |||
94 | |||
95 | FRportlCommandCenterVO fRportlCommandCenterVO = null; | ||
96 | //根据reportId 与reportItemCode 查询reitId; | ||
97 | String reitId = this.getReitId(reportItemvParam); | ||
98 | if(reitId != null ){ | ||
99 | reportItemvParam.setReitId( reitId ); | ||
100 | fRportlCommandCenterVO = fReportItemvMapper.getReportItemvMonthDataByReitId(reportItemvParam); | ||
101 | }else{ | ||
102 | fRportlCommandCenterVO = new FRportlCommandCenterVO("0","0","0"); | ||
103 | } | ||
104 | |||
105 | |||
106 | /* String reitId = getReitId(reportItemvParam.getReportItemCode(),reportItemvParam.getReportId()); | ||
107 | if(reitId != null ){ | ||
108 | reportItemvParam.setReitId( reitId ); | ||
109 | fRportlCommandCenterVO = fReportItemvMapper.getReportItemvMonthDataByReitId(reportItemvParam); | ||
110 | }else{ | ||
111 | fRportlCommandCenterVO = new FRportlCommandCenterVO("0","0","0"); | ||
112 | }*/ | ||
113 | return fRportlCommandCenterVO; | ||
114 | |||
115 | } | ||
116 | |||
117 | /*** | ||
118 | * 查询报表数据,当日平均、上月同期、去年同期统计(求均值) | ||
119 | * @param reportItemvParam | ||
120 | * @return | ||
121 | */ | ||
122 | public FRportlCommandCenterVO getReportItemvDayDataByReitId( ReportItemvParam reportItemvParam){ | ||
123 | |||
124 | /* //根据reportId 与reportItemCode 查询reitId; | ||
125 | List<FReportItem> reportItemList = reportItemMapper.getItemInfoByItemCode(reportItemvParam.getReportItemCode(),reportItemvParam.getReportId()); | ||
126 | FRportlCommandCenterVO fRportlCommandCenterVO = null; | ||
127 | if(reportItemList != null && !reportItemList.isEmpty()){ | ||
128 | reportItemvParam.setReitId( reportItemList.get(0).getId() ); | ||
129 | fRportlCommandCenterVO = fReportItemvMapper.getReportItemvDayDataByReitId(reportItemvParam); | ||
130 | }*/ | ||
131 | |||
132 | FRportlCommandCenterVO fRportlCommandCenterVO = null; | ||
133 | //根据reportId 与reportItemCode 查询reitId; | ||
134 | String reitId = this.getReitId(reportItemvParam); | ||
135 | if(reitId != null ){ | ||
136 | reportItemvParam.setReitId( reitId ); | ||
137 | fRportlCommandCenterVO = fReportItemvMapper.getReportItemvDayDataByReitId(reportItemvParam); | ||
138 | }else{ | ||
139 | fRportlCommandCenterVO = new FRportlCommandCenterVO("0","0","0"); | ||
140 | } | ||
141 | |||
142 | return fRportlCommandCenterVO; | ||
143 | } | ||
144 | |||
145 | /*** | ||
146 | * 根据String itemCode, String reportId 查询reitId字段 | ||
147 | * @param reportItemvParam | ||
148 | * @return | ||
149 | */ | ||
150 | private String getReitId( ReportItemvParam reportItemvParam){ | ||
151 | List<FReportItem> reitIdList = reportItemMapper.getItemInfoByItemCode(reportItemvParam.getReportItemCode(),reportItemvParam.getReportId()); | ||
152 | String reitId = null; | ||
153 | if(reitIdList != null && !reitIdList.isEmpty()){ | ||
154 | reitId = reitIdList.get(0).getId(); | ||
155 | } | ||
156 | return reitId; | ||
157 | } | ||
158 | /* private String getReitId( String itemCode, String reportId){ | ||
159 | JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtils.getBean("master"); | ||
160 | String sql = "select id from f_report_item where report_id = '"+reportId+"' and required='1' and item_code = '"+itemCode+"'"; | ||
161 | |||
162 | // String sql = "SELECT column_name FROM table_name WHERE condition"; | ||
163 | List<String> reitIdList = jdbcTemplate.query(sql, (rs, rowNum) -> rs.getString("id")); | ||
164 | |||
165 | //该方法会返回查询结果集中的第一条记录对应的指定字段值。 | ||
166 | //String sql = "SELECT column_name FROM table_name WHERE condition"; | ||
167 | //String reitId = jdbcTemplate.queryForObject(sql, String.class); | ||
168 | System.out.println(reitIdList+"----reitIdList"); | ||
169 | String reitId = null; | ||
170 | if(reitIdList != null && !reitIdList.isEmpty()){ | ||
171 | reitId = reitIdList.get(0); | ||
172 | } | ||
173 | return reitId; | ||
174 | }*/ | ||
175 | |||
81 | } | 176 | } | ... | ... |
... | @@ -26,4 +26,11 @@ public class StackedAreaChartDataVO implements Serializable { | ... | @@ -26,4 +26,11 @@ public class StackedAreaChartDataVO implements Serializable { |
26 | 26 | ||
27 | @ApiModelProperty(value = "日历集合") | 27 | @ApiModelProperty(value = "日历集合") |
28 | List<String> dateList; | 28 | List<String> dateList; |
29 | |||
30 | |||
31 | @ApiModelProperty(value = "日历集合") | ||
32 | List<String> xAxis; | ||
33 | |||
34 | @ApiModelProperty(value = "日历集合") | ||
35 | List<String> yAxis; | ||
29 | } | 36 | } | ... | ... |
1 | package com.skua.modules.guest.util; | 1 | package com.skua.modules.guest.util; |
2 | 2 | ||
3 | import java.text.ParseException; | ||
3 | import java.text.SimpleDateFormat; | 4 | import java.text.SimpleDateFormat; |
4 | import java.time.LocalDate; | 5 | import java.time.LocalDate; |
5 | import java.time.LocalDateTime; | 6 | import java.time.LocalDateTime; |
6 | import java.time.ZoneId; | 7 | import java.time.ZoneId; |
7 | import java.time.format.DateTimeFormatter; | 8 | import java.time.format.DateTimeFormatter; |
8 | import java.util.*; | 9 | import java.util.*; |
10 | import java.util.stream.Stream; | ||
9 | 11 | ||
10 | /** | 12 | /** |
11 | * @author sonin | 13 | * @author sonin |
... | @@ -80,6 +82,74 @@ public class DateUtil { | ... | @@ -80,6 +82,74 @@ public class DateUtil { |
80 | return formattedDate; | 82 | return formattedDate; |
81 | } | 83 | } |
82 | 84 | ||
85 | |||
86 | /*** | ||
87 | * 字符串日期格式化 | ||
88 | * @param date | ||
89 | * @param format | ||
90 | * @return | ||
91 | */ | ||
92 | public static String formatDate(String date , String format){ | ||
93 | if(format == null ){ | ||
94 | format = "yyyy-MM-dd"; | ||
95 | } | ||
96 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
97 | |||
98 | SimpleDateFormat formatSDF = new SimpleDateFormat(format); | ||
99 | // 转化成日期类型 | ||
100 | try { | ||
101 | Date startDate = sdf.parse(date); | ||
102 | date = formatSDF.format(startDate); | ||
103 | } catch (ParseException e) { | ||
104 | e.printStackTrace(); | ||
105 | } | ||
106 | return date; | ||
107 | |||
108 | } | ||
109 | /** | ||
110 | * 获取两个日期之间的所有日期 (年月日) | ||
111 | * | ||
112 | * @param startTime | ||
113 | * @param endTime | ||
114 | * @return | ||
115 | */ | ||
116 | public static List<String> getBetweenDate(String startTime, String endTime,String format){ | ||
117 | if(format == null ){ | ||
118 | format = "yyyy-MM-dd"; | ||
119 | } | ||
120 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
121 | |||
122 | SimpleDateFormat formatSDF = new SimpleDateFormat(format); | ||
123 | // 声明保存日期集合 | ||
124 | List<String> list = new ArrayList<String>(); | ||
125 | try { | ||
126 | // 转化成日期类型 | ||
127 | Date startDate = sdf.parse(startTime); | ||
128 | Date endDate = sdf.parse(endTime); | ||
129 | |||
130 | Date currentDate = new Date(); | ||
131 | if(currentDate.getTime() < endDate.getTime() ){ | ||
132 | endDate = currentDate; | ||
133 | } | ||
134 | |||
135 | //用Calendar 进行日期比较判断 | ||
136 | Calendar calendar = Calendar.getInstance(); | ||
137 | while (startDate.getTime() < endDate.getTime()){ | ||
138 | // 把日期添加到集合 | ||
139 | list.add(formatSDF.format(startDate)); | ||
140 | // 设置日期 | ||
141 | calendar.setTime(startDate); | ||
142 | //把日期增加一天 | ||
143 | calendar.add(Calendar.DATE, 1); | ||
144 | // 获取增加后的日期 | ||
145 | startDate=calendar.getTime(); | ||
146 | } | ||
147 | } catch (ParseException e) { | ||
148 | e.printStackTrace(); | ||
149 | } | ||
150 | return list; | ||
151 | } | ||
152 | |||
83 | /** | 153 | /** |
84 | * 获取7天日期数据,并指定显示格式 | 154 | * 获取7天日期数据,并指定显示格式 |
85 | * @param dateFormat | 155 | * @param dateFormat | ... | ... |
... | @@ -85,23 +85,26 @@ public class SafetyOffenceRecordController { | ... | @@ -85,23 +85,26 @@ public class SafetyOffenceRecordController { |
85 | String role_ah_id = sysConfigService.queryValueByKey("ROLE_AH_ADMIN");//安环管理员角色编号 | 85 | String role_ah_id = sysConfigService.queryValueByKey("ROLE_AH_ADMIN");//安环管理员角色编号 |
86 | String role_cz_id = sysConfigService.queryValueByKey("ROLE_CZ");//厂长角色编号 | 86 | String role_cz_id = sysConfigService.queryValueByKey("ROLE_CZ");//厂长角色编号 |
87 | String userRoleIds = BaseContextHandler.getRoles(); | 87 | String userRoleIds = BaseContextHandler.getRoles(); |
88 | |||
89 | safetyOffenceRecord.setDepartId( "0" );//屏蔽数据使用;非安环管理员、与厂长角色看不到数据 | ||
90 | |||
88 | //安装部长角色看集团类型的违法上报 | 91 | //安装部长角色看集团类型的违法上报 |
89 | if( userRoleIds != null && userRoleIds.contains( role_ah_id ) ){//判断安环管理员 | 92 | if( userRoleIds != null && userRoleIds.contains( role_ah_id ) ){//判断安环管理员 |
90 | safetyOffenceRecord.setDepartId( null ); | 93 | safetyOffenceRecord.setDepartId( null ); |
94 | safetyOffenceRecord.setReportType("1");//上报集团--默认 | ||
91 | flag = false; | 95 | flag = false; |
92 | } | 96 | } |
93 | if( userRoleIds != null && userRoleIds.contains( role_cz_id ) ){//判断 厂长 ,查询分管的所有长编号 | 97 | if( userRoleIds != null && userRoleIds.contains( role_cz_id ) ){//判断 厂长 ,查询分管的所有长编号 |
94 | safetyOffenceRecord.setDepartId( BaseContextHandler.getDeparts() );//BaseContextHandler.getRealDepartId() | 98 | safetyOffenceRecord.setDepartId( BaseContextHandler.getDeparts() );//BaseContextHandler.getRealDepartId() |
99 | safetyOffenceRecord.setReportType("2");//上报厂长 | ||
95 | flag = true; | 100 | flag = true; |
96 | } | 101 | } |
97 | //各个厂长角色看到厂长类型的违法上报 departId | 102 | //各个厂长角色看到厂长类型的违法上报 departId |
98 | |||
99 | QueryWrapper<SafetyOffenceRecord> queryWrapper = QueryGenerator.initQueryWrapper(safetyOffenceRecord, req.getParameterMap()); | 103 | QueryWrapper<SafetyOffenceRecord> queryWrapper = QueryGenerator.initQueryWrapper(safetyOffenceRecord, req.getParameterMap()); |
100 | Page<SafetyOffenceRecord> page = new Page<SafetyOffenceRecord>(pageNo, pageSize); | 104 | Page<SafetyOffenceRecord> page = new Page<SafetyOffenceRecord>(pageNo, pageSize); |
101 | if(flag ){ | 105 | if(flag ){ |
102 | queryWrapper.in("depart_id", BaseContextHandler.getDeparts().split(",")); | 106 | queryWrapper.in("depart_id", BaseContextHandler.getDeparts().split(",")); |
103 | } | 107 | } |
104 | |||
105 | IPage<SafetyOffenceRecord> pageList = safetyOffenceRecordService.page(page, queryWrapper); | 108 | IPage<SafetyOffenceRecord> pageList = safetyOffenceRecordService.page(page, queryWrapper); |
106 | result.setSuccess(true); | 109 | result.setSuccess(true); |
107 | result.setResult(pageList); | 110 | result.setResult(pageList); | ... | ... |
... | @@ -58,6 +58,7 @@ public class SafetyOffenceRecord { | ... | @@ -58,6 +58,7 @@ public class SafetyOffenceRecord { |
58 | /**上报类型:1 上报集团 2 上报厂长*/ | 58 | /**上报类型:1 上报集团 2 上报厂长*/ |
59 | @Excel(name = "上报类型:1 上报集团 2 上报厂长", width = 15) | 59 | @Excel(name = "上报类型:1 上报集团 2 上报厂长", width = 15) |
60 | @ApiModelProperty(value = "上报类型:1 上报集团 2 上报厂长") | 60 | @ApiModelProperty(value = "上报类型:1 上报集团 2 上报厂长") |
61 | @Dict(dicCode = "safe_offence_report_type") | ||
61 | private String reportType; | 62 | private String reportType; |
62 | /**违章照片*/ | 63 | /**违章照片*/ |
63 | @Excel(name = "违章照片", width = 15) | 64 | @Excel(name = "违章照片", width = 15) | ... | ... |
... | @@ -42,6 +42,7 @@ public class SafetyOffenceStandard { | ... | @@ -42,6 +42,7 @@ public class SafetyOffenceStandard { |
42 | /**违章标准类型*/ | 42 | /**违章标准类型*/ |
43 | @Excel(name = "违章标准类型", width = 15) | 43 | @Excel(name = "违章标准类型", width = 15) |
44 | @ApiModelProperty(value = "违章标准类型") | 44 | @ApiModelProperty(value = "违章标准类型") |
45 | @Dict(dicCode="safe_offence_type") | ||
45 | private String offenceType; | 46 | private String offenceType; |
46 | /**备注*/ | 47 | /**备注*/ |
47 | @Excel(name = "备注", width = 15) | 48 | @Excel(name = "备注", width = 15) | ... | ... |
... | @@ -127,7 +127,7 @@ mybatis-plus: | ... | @@ -127,7 +127,7 @@ mybatis-plus: |
127 | configuration: | 127 | configuration: |
128 | call-setters-on-nulls: true | 128 | call-setters-on-nulls: true |
129 | # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用 | 129 | # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用 |
130 | #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl | 130 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
131 | #数矿专用配置 | 131 | #数矿专用配置 |
132 | skua: | 132 | skua: |
133 | web-url: http://192.168.100.29:3000 | 133 | web-url: http://192.168.100.29:3000 |
... | @@ -188,3 +188,6 @@ ar-remote-meeting: | ... | @@ -188,3 +188,6 @@ ar-remote-meeting: |
188 | url: https://47.104.179.187:8443/api/ | 188 | url: https://47.104.179.187:8443/api/ |
189 | # mqtt服务地址 | 189 | # mqtt服务地址 |
190 | mqtt-url: tcp://47.104.179.187:1883 | 190 | mqtt-url: tcp://47.104.179.187:1883 |
191 | |||
192 | |||
193 | ... | ... |
... | @@ -18,13 +18,6 @@ public interface FReportItemMapper extends BaseMapper<FReportItem> { | ... | @@ -18,13 +18,6 @@ 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 | ||
29 | void changeStatus(@Param("id") String id, @Param("required") String required); | 22 | void changeStatus(@Param("id") String id, @Param("required") String required); |
30 | 23 | ... | ... |
1 | package com.skua.modules.report.mapper; | 1 | package com.skua.modules.report.mapper; |
2 | 2 | ||
3 | import com.skua.modules.report.vo.DepartLoadRateVO; | 3 | import com.skua.modules.report.vo.DepartLoadRateVO; |
4 | import com.skua.modules.report.vo.FRportlCommandCenterVO; | ||
5 | import com.skua.modules.report.vo.ReportDateTrendVO; | ||
4 | import com.skua.modules.report.vo.ReportItemvParam; | 6 | import com.skua.modules.report.vo.ReportItemvParam; |
5 | import org.apache.ibatis.annotations.Param; | 7 | import org.apache.ibatis.annotations.Param; |
6 | import com.skua.modules.report.entity.FReportItemv; | 8 | import com.skua.modules.report.entity.FReportItemv; |
... | @@ -58,20 +60,34 @@ public interface FReportItemvMapper extends BaseMapper<FReportItemv> { | ... | @@ -58,20 +60,34 @@ public interface FReportItemvMapper extends BaseMapper<FReportItemv> { |
58 | * @param loadRateType | 60 | * @param loadRateType |
59 | * @return | 61 | * @return |
60 | */ | 62 | */ |
61 | public List<DepartLoadRateVO> statisticsByLoadRate(@Param("loadRateType") Integer loadRateType); | 63 | public List<DepartLoadRateVO> statisticsByLoadRate(@Param("loadRateType") Integer loadRateType,@Param("startDate") String startDate,@Param("endDate") String endDate); |
62 | 64 | ||
63 | /** | 65 | /** |
64 | * 指挥中心---运行负荷率分析 总数查询 | 66 | * 指挥中心---运行负荷率分析 总数查询 |
65 | * @param loadRateType | 67 | * @param loadRateType |
66 | * @return | 68 | * @return |
67 | */ | 69 | */ |
68 | public int statisticsByLoadRateNum(@Param("loadRateType") Integer loadRateType); | 70 | public int statisticsByLoadRateNum(@Param("loadRateType") Integer loadRateType,@Param("startDate") String startDate,@Param("endDate") String endDate); |
69 | 71 | ||
70 | /** | 72 | /** |
71 | * 根据reitId查询近7天数据 | 73 | * 根据reitId查询近7天数据 |
72 | * @param reitId | 74 | * @param reportItemvParam |
73 | * @param dateTime | 75 | * @return |
76 | */ | ||
77 | public List<ReportDateTrendVO> getReportItemvByReitIdAndDate7Day(ReportItemvParam reportItemvParam); | ||
78 | |||
79 | |||
80 | /*** | ||
81 | * 查询报表数据,当前月统计、上个月统计、去年当月统计(求和) | ||
82 | * @param reportItemvParam | ||
83 | * @return | ||
84 | */ | ||
85 | public FRportlCommandCenterVO getReportItemvMonthDataByReitId( ReportItemvParam reportItemvParam); | ||
86 | |||
87 | /*** | ||
88 | * 查询报表数据,当日平均、上月同期、去年同期统计(求均值) | ||
89 | * @param reportItemvParam | ||
74 | * @return | 90 | * @return |
75 | */ | 91 | */ |
76 | public List<String> getReportItemvByReitIdAndDate7Day(@Param("reitId") String reitId, @Param("dateTime") String dateTime); | 92 | public FRportlCommandCenterVO getReportItemvDayDataByReitId(ReportItemvParam reportItemvParam); |
77 | } | 93 | } | ... | ... |
... | @@ -19,13 +19,6 @@ | ... | @@ -19,13 +19,6 @@ |
19 | </select> | 19 | </select> |
20 | 20 | ||
21 | 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 | |||
29 | <update id="changeStatus"> | 22 | <update id="changeStatus"> |
30 | update f_report_item set required = #{required} where id = #{id} | 23 | update f_report_item set required = #{required} where id = #{id} |
31 | </update> | 24 | </update> | ... | ... |
... | @@ -101,10 +101,29 @@ | ... | @@ -101,10 +101,29 @@ |
101 | </select> | 101 | </select> |
102 | 102 | ||
103 | <!-- 根据reitId查询近7天数据--> | 103 | <!-- 根据reitId查询近7天数据--> |
104 | <select id="statisticsByLoadRateNum" resultType="java.lang.Integer"> | 104 | <select id="getReportItemvByReitIdAndDate7Day" resultType="com.skua.modules.report.vo.ReportDateTrendVO"> |
105 | SELECT sum(item_value) FROM f_report_itemv where reit_id=#{reitId} and DATE_SUB( CURDATE(), INTERVAL 7 DAY ) <= date(data_time) | 105 | SELECT sum(item_value) as 'value' , data_time as 'date' FROM f_report_itemv where reit_id=#{reitId} and data_time >= #{startDate} and data_time <= #{endDate} |
106 | group by data_time | 106 | group by data_time |
107 | </select> | 107 | </select> |
108 | 108 | ||
109 | 109 | ||
110 | <!--查询报表数据,当前月统计、上个月统计、去年当月统计(求和) --> | ||
111 | <select id="getReportItemvMonthDataByReitId" resultType="com.skua.modules.report.vo.FRportlCommandCenterVO"> | ||
112 | select | ||
113 | IFNULL(( SELECT sum(item_value) FROM f_report_itemv where reit_id=#{reitId} and data_time >= #{startDate} and data_time <= #{endDate}),0) as 'value', | ||
114 | IFNULL(( SELECT sum(item_value) FROM f_report_itemv where reit_id=#{reitId} and data_time >= #{lastMonthStartDate} and data_time <= #{lastMonthEndDate}),0) as 'valueTb', | ||
115 | IFNULL(( SELECT sum(item_value) FROM f_report_itemv where reit_id=#{reitId} and data_time >= #{lastYearStartDate} and data_time <= #{lastYearEndDate} ),0) as 'valueHb' | ||
116 | from dual | ||
117 | </select> | ||
118 | |||
119 | |||
120 | <!--查询报表数据,当日平均、上月同期、去年同期统计(求均值) --> | ||
121 | <select id="getReportItemvDayDataByReitId" resultType="com.skua.modules.report.vo.FRportlCommandCenterVO"> | ||
122 | select | ||
123 | IFNULL(( SELECT avg(item_value) FROM f_report_itemv where reit_id=#{reitId} and data_time >= #{startDate} and data_time <= #{endDate}),0) as 'value', | ||
124 | IFNULL(( SELECT avg(item_value) FROM f_report_itemv where reit_id=#{reitId} and data_time >= #{lastMonthStartDate} and data_time <= #{lastMonthEndDate}),0) as 'valueTb', | ||
125 | IFNULL(( SELECT avg(item_value) FROM f_report_itemv where reit_id=#{reitId} and data_time >= #{lastYearStartDate} and data_time <= #{lastYearEndDate} ),0) as 'valueHb' | ||
126 | from dual | ||
127 | </select> | ||
128 | |||
110 | </mapper> | 129 | </mapper> | ... | ... |
1 | package com.skua.modules.report.vo; | 1 | package com.skua.modules.report.vo; |
2 | import com.skua.tool.util.DigitalUtils; | ||
2 | import io.swagger.annotations.ApiModel; | 3 | import io.swagger.annotations.ApiModel; |
3 | import io.swagger.annotations.ApiModelProperty; | 4 | import io.swagger.annotations.ApiModelProperty; |
4 | import lombok.Data; | 5 | import lombok.Data; |
... | @@ -23,4 +24,20 @@ public class DepartLoadRateVO implements Serializable{ | ... | @@ -23,4 +24,20 @@ public class DepartLoadRateVO implements Serializable{ |
23 | 24 | ||
24 | @ApiModelProperty(value = "处理水量(吨/月)") | 25 | @ApiModelProperty(value = "处理水量(吨/月)") |
25 | private String waterYieldMonth; | 26 | private String waterYieldMonth; |
27 | |||
28 | |||
29 | /*** | ||
30 | * 计算精度 | ||
31 | */ | ||
32 | public void accuracy(){ | ||
33 | String loadRate = getLoadRate(); | ||
34 | setLoadRate(DigitalUtils.division(loadRate , "1.0" )); | ||
35 | String qualifyRate = getQualifyRate(); | ||
36 | |||
37 | setQualifyRate(DigitalUtils.division(qualifyRate , "1.0" )); | ||
38 | |||
39 | String waterYieldMonth = getWaterYieldMonth(); | ||
40 | this.setWaterYieldMonth( DigitalUtils.division(waterYieldMonth , "1.0" ) ); | ||
41 | |||
42 | } | ||
26 | } | 43 | } | ... | ... |
... | @@ -16,31 +16,22 @@ public class FRportlCommandCenterVO implements Serializable { | ... | @@ -16,31 +16,22 @@ public class FRportlCommandCenterVO implements Serializable { |
16 | private String title; | 16 | private String title; |
17 | @ApiModelProperty(value = "结果") | 17 | @ApiModelProperty(value = "结果") |
18 | private String value; | 18 | private String value; |
19 | /* @ApiModelProperty(value = "最大值") | 19 | |
20 | private Object maxValue; | ||
21 | @ApiModelProperty(value = "最小值") | ||
22 | private Object minValue;*/ | ||
23 | @ApiModelProperty(value = "上月同期") | 20 | @ApiModelProperty(value = "上月同期") |
24 | private String valueTb; | 21 | private String valueTb; |
25 | 22 | ||
26 | @ApiModelProperty(value = "去年同期") | 23 | @ApiModelProperty(value = "去年同期") |
27 | private String valueHb; | 24 | private String valueHb; |
28 | 25 | ||
29 | /* @ApiModelProperty(value = "同比比例") | 26 | public FRportlCommandCenterVO() { |
30 | private Object valueTbProportion; | 27 | } |
31 | @ApiModelProperty(value = "同比差值") | 28 | public FRportlCommandCenterVO(String value) { |
32 | private Object valueTbDifference; | 29 | this.value = value; |
30 | } | ||
33 | 31 | ||
34 | @ApiModelProperty(value = "环比比例") | 32 | public FRportlCommandCenterVO(String value, String valueTb, String valueHb) { |
35 | private Object valueHbProportion; | 33 | this.value = value; |
36 | @ApiModelProperty(value = "环比差值") | 34 | this.valueTb = valueTb; |
37 | private Object valueHbDifference; | 35 | this.valueHb = valueHb; |
38 | @ApiModelProperty(value = "上期") | 36 | } |
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 | } | 37 | } | ... | ... |
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 ReportDateTrendVO implements Serializable{ | ||
15 | |||
16 | @ApiModelProperty(value = "当前月数据") | ||
17 | private String date; | ||
18 | @ApiModelProperty(value = "当前月数据") | ||
19 | private String value; | ||
20 | } |
... | @@ -47,6 +47,10 @@ public class ReportItemvParam implements Serializable{ | ... | @@ -47,6 +47,10 @@ public class ReportItemvParam implements Serializable{ |
47 | private java.lang.String lastYearEndDate; | 47 | private java.lang.String lastYearEndDate; |
48 | 48 | ||
49 | 49 | ||
50 | @ApiModelProperty(value = "负载率类型") | ||
51 | private Integer loadRateType; | ||
52 | |||
53 | |||
50 | /** | 54 | /** |
51 | * 初始化数据 | 55 | * 初始化数据 |
52 | * @param startTime | 56 | * @param startTime |
... | @@ -54,7 +58,26 @@ public class ReportItemvParam implements Serializable{ | ... | @@ -54,7 +58,26 @@ public class ReportItemvParam implements Serializable{ |
54 | */ | 58 | */ |
55 | public ReportItemvParam(String reportId ,String reportItemCode ,String startTime , String endTime){ | 59 | public ReportItemvParam(String reportId ,String reportItemCode ,String startTime , String endTime){ |
56 | try { | 60 | try { |
57 | this.reitId = reportId; | 61 | this.reportId = reportId; |
62 | this.reportItemCode = reportItemCode; | ||
63 | if(startTime != null && startTime.length() > 0 ){ | ||
64 | this.startDate = startTime; | ||
65 | this.lastMonthStartDate = DateUtils.formatAddTime(startTime, "yyyy-MM-dd", Calendar.MONTH, -1); | ||
66 | this.lastYearStartDate = DateUtils.formatAddTime(startTime, "yyyy-MM-dd", Calendar.YEAR, -1); | ||
67 | } | ||
68 | if(endTime != null && endTime.length() > 0 ){ | ||
69 | this.endDate = endTime; | ||
70 | this.lastMonthEndDate = DateUtils.formatAddTime(endTime, "yyyy-MM-dd", Calendar.MONTH, -1); | ||
71 | this. lastYearEndDate = DateUtils.formatAddTime(endTime, "yyyy-MM-dd", Calendar.YEAR, -1); | ||
72 | } | ||
73 | } catch (ParseException e) { | ||
74 | e.printStackTrace(); | ||
75 | } | ||
76 | } | ||
77 | |||
78 | public void initData(String reportId ,String reportItemCode ,String startTime , String endTime){ | ||
79 | try { | ||
80 | this.reportId = reportId; | ||
58 | this.reportItemCode = reportItemCode; | 81 | this.reportItemCode = reportItemCode; |
59 | if(startTime != null && startTime.length() > 0 ){ | 82 | if(startTime != null && startTime.length() > 0 ){ |
60 | this.startDate = startTime; | 83 | this.startDate = startTime; |
... | @@ -72,4 +95,5 @@ public class ReportItemvParam implements Serializable{ | ... | @@ -72,4 +95,5 @@ public class ReportItemvParam implements Serializable{ |
72 | } | 95 | } |
73 | 96 | ||
74 | 97 | ||
98 | |||
75 | } | 99 | } | ... | ... |
... | @@ -491,7 +491,7 @@ | ... | @@ -491,7 +491,7 @@ |
491 | </select> | 491 | </select> |
492 | 492 | ||
493 | <!-- 获取总的设计规模--> | 493 | <!-- 获取总的设计规模--> |
494 | <select id="" resultType="java.lang.String"> | 494 | <select id="querySumProScale" resultType="java.lang.String"> |
495 | select sum(pro_scale) from sys_factory_info | 495 | select sum(pro_scale) from sys_factory_info |
496 | </select> | 496 | </select> |
497 | </mapper> | 497 | </mapper> | ... | ... |
-
请 注册 或 登录 后发表评论