kangwei: 修改吨水电耗公式
正在显示
9 个修改的文件
包含
59 行增加
和
25 行删除
... | @@ -43,6 +43,10 @@ public class ReportItemVO { | ... | @@ -43,6 +43,10 @@ public class ReportItemVO { |
43 | @ApiModelProperty(value = "吨水消耗") | 43 | @ApiModelProperty(value = "吨水消耗") |
44 | private String dsValue; | 44 | private String dsValue; |
45 | 45 | ||
46 | |||
47 | @ApiModelProperty(value = "吨水产泥量") | ||
48 | private String dscnl; | ||
49 | |||
46 | /* @ApiModelProperty(value = "环比差值") | 50 | /* @ApiModelProperty(value = "环比差值") |
47 | private String valueHbDifference; | 51 | private String valueHbDifference; |
48 | @ApiModelProperty(value = "单位") | 52 | @ApiModelProperty(value = "单位") | ... | ... |
... | @@ -2,10 +2,10 @@ package com.skua.modules.algorithm.service.impl; | ... | @@ -2,10 +2,10 @@ package com.skua.modules.algorithm.service.impl; |
2 | 2 | ||
3 | import com.skua.common.constant.ReportConstant; | 3 | import com.skua.common.constant.ReportConstant; |
4 | import com.skua.common.report.ReportViewUtil; | 4 | import com.skua.common.report.ReportViewUtil; |
5 | import com.skua.common.report.vo.ReportItemVO; | ||
5 | import com.skua.core.context.SpringContextUtils; | 6 | import com.skua.core.context.SpringContextUtils; |
6 | import com.skua.core.util.ConvertUtils; | 7 | import com.skua.core.util.ConvertUtils; |
7 | import com.skua.modules.algorithm.vo.DepartLoadRateResultVO; | 8 | import com.skua.modules.algorithm.vo.DepartLoadRateResultVO; |
8 | import com.skua.modules.algorithm.vo.ReportItemVO; | ||
9 | import com.skua.modules.algorithm.vo.WaterTreatmentVO; | 9 | import com.skua.modules.algorithm.vo.WaterTreatmentVO; |
10 | import com.skua.modules.common.vo.DateVO; | 10 | import com.skua.modules.common.vo.DateVO; |
11 | import com.skua.modules.quartz.util.BaseUtil; | 11 | import com.skua.modules.quartz.util.BaseUtil; |
... | @@ -83,27 +83,30 @@ public class ReportItemvService { | ... | @@ -83,27 +83,30 @@ public class ReportItemvService { |
83 | public List<FRportlCommandCenterVO> statisticsByElectricity(String departId, String startTime, String endTime) { | 83 | public List<FRportlCommandCenterVO> statisticsByElectricity(String departId, String startTime, String endTime) { |
84 | List<FRportlCommandCenterVO> fRportlCommandCenterVOList = new ArrayList<>(); | 84 | List<FRportlCommandCenterVO> fRportlCommandCenterVOList = new ArrayList<>(); |
85 | DateVO dateVO = new DateVO(startTime); | 85 | DateVO dateVO = new DateVO(startTime); |
86 | String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ", departId, startTime,endTime); | 86 | // String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ", departId, startTime,endTime); |
87 | String sql = "select ROUND( SUM( IFNULL(aaa.DLHJ,0) ), 2 ) AS DLHJ from " + dataViewName3a24+ "aaa"; | 87 | // String sql = "select ROUND( SUM( IFNULL(aaa.DLHJ,0) ), 2 ) AS DLHJ from " + dataViewName3a24+ "aaa"; |
88 | 88 | ||
89 | String nowMonthValue = getSumDLHJ(departId,dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); | 89 | ReportItemVO dlhjData = ReportViewUtil.getSumValueByTBHB(ReportConstant.view3a24, "DLHJ", departId, startTime, endTime); |
90 | String lastMonthValue = getSumDLHJ(departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); | ||
91 | String lastYearValue = getSumDLHJ(departId, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime()); | ||
92 | 90 | ||
93 | String nowMonthCSL = getSumCSL(departId,dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); | ||
94 | String lastMonthCSL = getSumCSL(departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); | ||
95 | String lastYearCSL = getSumCSL(departId, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime()); | ||
96 | 91 | ||
97 | long nowDifferDay = DateUtils.differenceDay(dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); | 92 | String dlhj_avg_value = getAvgDLHJ(departId,dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); |
98 | long lastMonthDifferDay = DateUtils.differenceDay(dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); | 93 | String dlhj_avg_valueHB = getAvgDLHJ(departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); |
99 | long lastYearDifferDay = DateUtils.differenceDay(dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime()); | 94 | String dlhj_avg_valueTB = getAvgDLHJ(departId, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime()); |
95 | |||
96 | String csl_avg_value = getSumCSL(departId,dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); | ||
97 | String csl_avg_valueHB = getSumCSL(departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); | ||
98 | String csl_avg_valueTB = getSumCSL(departId, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime()); | ||
99 | |||
100 | // long nowDifferDay = DateUtils.differenceDay(dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); | ||
101 | // long lastMonthDifferDay = DateUtils.differenceDay(dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); | ||
102 | // long lastYearDifferDay = DateUtils.differenceDay(dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime()); | ||
100 | 103 | ||
101 | //当月数据/环比、同比 | 104 | //当月数据/环比、同比 |
102 | FRportlCommandCenterVO nowMonthVO = new FRportlCommandCenterVO("月总电耗(", JSUtils.divide(nowMonthValue,10000), JSUtils.divide(lastMonthValue,10000), JSUtils.divide(lastYearValue,10000)); | 105 | FRportlCommandCenterVO nowMonthVO = new FRportlCommandCenterVO("月总电耗(", JSUtils.divide(dlhjData.getValue(),10000), JSUtils.divide(dlhjData.getValueHb(),10000), JSUtils.divide(dlhjData.getValueTb(),10000)); |
103 | //日均数据:/环比/同比 | 106 | //日均数据:/环比/同比 |
104 | FRportlCommandCenterVO lastMonthVO = new FRportlCommandCenterVO("日均电耗",JSUtils.divide( nowMonthValue ,nowDifferDay*10000 ) ,JSUtils.divide( lastMonthValue ,lastMonthDifferDay*10000 ),JSUtils.divide( lastYearValue ,lastYearDifferDay*10000 ) ); | 107 | FRportlCommandCenterVO lastMonthVO = new FRportlCommandCenterVO("日均电耗",dlhj_avg_value ,dlhj_avg_valueHB,dlhj_avg_valueTB ); |
105 | //吨水消耗 | 108 | //吨水消耗 |
106 | FRportlCommandCenterVO lastYearVo = new FRportlCommandCenterVO("吨水电耗",JSUtils.divide( nowMonthValue ,nowMonthCSL ) ,JSUtils.divide( lastMonthValue ,lastMonthCSL ),JSUtils.divide( lastYearValue ,lastYearCSL )); | 109 | FRportlCommandCenterVO lastYearVo = new FRportlCommandCenterVO("吨水电耗",JSUtils.divide( dlhj_avg_value ,csl_avg_value ) ,JSUtils.divide( dlhj_avg_valueHB ,csl_avg_valueHB ),JSUtils.divide( dlhj_avg_valueTB ,csl_avg_valueTB )); |
107 | fRportlCommandCenterVOList.add( nowMonthVO) ; | 110 | fRportlCommandCenterVOList.add( nowMonthVO) ; |
108 | fRportlCommandCenterVOList.add( lastMonthVO) ; | 111 | fRportlCommandCenterVOList.add( lastMonthVO) ; |
109 | fRportlCommandCenterVOList.add( lastYearVo) ; | 112 | fRportlCommandCenterVOList.add( lastYearVo) ; |
... | @@ -275,13 +278,28 @@ public class ReportItemvService { | ... | @@ -275,13 +278,28 @@ public class ReportItemvService { |
275 | String csl = getJdbcTemplate().queryForObject(sql,String.class); | 278 | String csl = getJdbcTemplate().queryForObject(sql,String.class); |
276 | return ConvertUtils.getString(csl,"0.00"); | 279 | return ConvertUtils.getString(csl,"0.00"); |
277 | } | 280 | } |
278 | 281 | public String getAvgCSL(String departId ,String startTime ,String endTime){ | |
282 | String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, startTime,endTime); | ||
283 | String sql = "select ROUND( avg( IFNULL( aaa.CSL,0) ),2) from " + dataViewName2119+ " aaa where ifnull(aaa.CSL,0)> 0"; | ||
284 | String csl = getJdbcTemplate().queryForObject(sql,String.class); | ||
285 | return ConvertUtils.getString(csl,"0.00"); | ||
286 | } | ||
279 | public String getSumDLHJ(String departId ,String startTime ,String endTime){ | 287 | public String getSumDLHJ(String departId ,String startTime ,String endTime){ |
280 | String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ", departId, startTime,endTime); | 288 | String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ", departId, startTime,endTime); |
281 | String sql = "select ROUND( sum( IFNULL( aaa.DLHJ,0) ),2) from " + dataViewName3a24+ "aaa"; | 289 | String sql = "select ROUND( sum( IFNULL( aaa.DLHJ,0) ),2) from " + dataViewName3a24+ "aaa"; |
282 | String dlhj = getJdbcTemplate().queryForObject(sql,String.class); | 290 | String dlhj = getJdbcTemplate().queryForObject(sql,String.class); |
283 | return ConvertUtils.getString(dlhj,"0.00"); | 291 | return ConvertUtils.getString(dlhj,"0.00"); |
284 | } | 292 | } |
293 | |||
294 | public String getAvgDLHJ(String departId ,String startTime ,String endTime){ | ||
295 | String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ", departId, startTime,endTime); | ||
296 | String sql = "select ROUND( avg( IFNULL( aaa.DLHJ,0) ),2) from " + dataViewName3a24+ " aaa where ifnull(aaa.DLHJ,0)> 0 "; | ||
297 | String dlhj = getJdbcTemplate().queryForObject(sql,String.class); | ||
298 | return ConvertUtils.getString(dlhj,"0.00"); | ||
299 | } | ||
300 | |||
301 | |||
302 | |||
285 | public String getSumValue(String viewName,String fileds,String departId ,String startTime ,String endTime){ | 303 | public String getSumValue(String viewName,String fileds,String departId ,String startTime ,String endTime){ |
286 | String dataViewName3a24 = ReportViewUtil.buildViewLike(viewName,fileds, departId, startTime,endTime); | 304 | String dataViewName3a24 = ReportViewUtil.buildViewLike(viewName,fileds, departId, startTime,endTime); |
287 | String sql = "select ROUND(sum( IFNULL( aaa."+fileds+",0)),2) from " + dataViewName3a24+ "aaa"; | 305 | String sql = "select ROUND(sum( IFNULL( aaa."+fileds+",0)),2) from " + dataViewName3a24+ "aaa"; | ... | ... |
sk-module-biz/src/main/java/com/skua/modules/dataAnalysis/controller/SysCommandCentreController.java
1 | package com.skua.modules.dataAnalysis.controller; | 1 | package com.skua.modules.dataAnalysis.controller; |
2 | |||
3 | |||
4 | import com.skua.common.constant.ReportConstant; | 2 | import com.skua.common.constant.ReportConstant; |
3 | import com.skua.common.report.vo.ReportItemVO; | ||
5 | import com.skua.core.api.vo.Result; | 4 | import com.skua.core.api.vo.Result; |
6 | import com.skua.core.aspect.annotation.AutoLog; | 5 | import com.skua.core.aspect.annotation.AutoLog; |
7 | import com.skua.core.context.BaseContextHandler; | 6 | import com.skua.core.context.BaseContextHandler; |
... | @@ -9,7 +8,6 @@ import com.skua.core.util.ConvertUtils; | ... | @@ -9,7 +8,6 @@ import com.skua.core.util.ConvertUtils; |
9 | import com.skua.modules.dataAnalysis.service.ICommandCentreService; | 8 | import com.skua.modules.dataAnalysis.service.ICommandCentreService; |
10 | import com.skua.modules.algorithm.service.impl.ReportItemvService; | 9 | import com.skua.modules.algorithm.service.impl.ReportItemvService; |
11 | import com.skua.modules.algorithm.vo.DepartLoadRateResultVO; | 10 | import com.skua.modules.algorithm.vo.DepartLoadRateResultVO; |
12 | import com.skua.modules.algorithm.vo.ReportItemVO; | ||
13 | import com.skua.modules.algorithm.vo.StackedAreaChartDataVO; | 11 | import com.skua.modules.algorithm.vo.StackedAreaChartDataVO; |
14 | import com.skua.modules.algorithm.vo.WaterTreatmentVO; | 12 | import com.skua.modules.algorithm.vo.WaterTreatmentVO; |
15 | import com.skua.modules.common.vo.DateVO; | 13 | import com.skua.modules.common.vo.DateVO; | ... | ... |
... | @@ -137,6 +137,7 @@ public class UserPaperController { | ... | @@ -137,6 +137,7 @@ public class UserPaperController { |
137 | try { | 137 | try { |
138 | userPaperVO.setEndTime(DateUtils.now()); | 138 | userPaperVO.setEndTime(DateUtils.now()); |
139 | userPaperVO.setUserId(BaseContextHandler.getUserId());//考试人编号 | 139 | userPaperVO.setUserId(BaseContextHandler.getUserId());//考试人编号 |
140 | userPaperVO.setDepartId(BaseContextHandler.getRealDepartId()); | ||
140 | paperScore = paperService.submitPaper(userPaperVO); | 141 | paperScore = paperService.submitPaper(userPaperVO); |
141 | userPaperVO.setScore( paperScore ); | 142 | userPaperVO.setScore( paperScore ); |
142 | 143 | ... | ... |
... | @@ -25,7 +25,7 @@ import org.jeecgframework.poi.excel.annotation.Excel; | ... | @@ -25,7 +25,7 @@ import org.jeecgframework.poi.excel.annotation.Excel; |
25 | @Accessors(chain = true) | 25 | @Accessors(chain = true) |
26 | @ApiModel(value="edu_user_paper对象", description="在线考试") | 26 | @ApiModel(value="edu_user_paper对象", description="在线考试") |
27 | public class UserPaper { | 27 | public class UserPaper { |
28 | 28 | ||
29 | /**主键*/ | 29 | /**主键*/ |
30 | @TableId(type = IdType.ID_WORKER_STR) | 30 | @TableId(type = IdType.ID_WORKER_STR) |
31 | @ApiModelProperty(value = "主键") | 31 | @ApiModelProperty(value = "主键") |
... | @@ -75,4 +75,12 @@ public class UserPaper { | ... | @@ -75,4 +75,12 @@ public class UserPaper { |
75 | this.endTime = endTime; | 75 | this.endTime = endTime; |
76 | this.signature = signature; | 76 | this.signature = signature; |
77 | } | 77 | } |
78 | public UserPaper(String paperId, String departId,String userId, String startTime, String endTime,String signature) { | ||
79 | this.paperId = paperId; | ||
80 | this.departId = departId; | ||
81 | this.userId = userId; | ||
82 | this.startTime = startTime; | ||
83 | this.endTime = endTime; | ||
84 | this.signature = signature; | ||
85 | } | ||
78 | } | 86 | } | ... | ... |
... | @@ -202,7 +202,7 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements | ... | @@ -202,7 +202,7 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements |
202 | Paper paper = paperMapper.selectById( paperVO.getPaperId() ) ; | 202 | Paper paper = paperMapper.selectById( paperVO.getPaperId() ) ; |
203 | //创建用户答题记录 | 203 | //创建用户答题记录 |
204 | // public UserPaper(String paperId, String departId, String userId, String startTime, String endTime) { | 204 | // public UserPaper(String paperId, String departId, String userId, String startTime, String endTime) { |
205 | UserPaper userPaper = new UserPaper(paperVO.getPaperId(), paperVO.getUserId(),paperVO.getStartTime(),paperVO.getEndTime(), paperVO.getSignature()); | 205 | UserPaper userPaper = new UserPaper(paperVO.getPaperId(), paperVO.getDepartId(),paperVO.getUserId(),paperVO.getStartTime(),paperVO.getEndTime(), paperVO.getSignature()); |
206 | userPaperMapper.insert( userPaper ); | 206 | userPaperMapper.insert( userPaper ); |
207 | //答题卡详情 | 207 | //答题卡详情 |
208 | String score = "0"; | 208 | String score = "0"; | ... | ... |
... | @@ -19,6 +19,8 @@ public class UserPaperVO { | ... | @@ -19,6 +19,8 @@ public class UserPaperVO { |
19 | private String paperId; | 19 | private String paperId; |
20 | @ApiModelProperty(value = "参加考试人员") | 20 | @ApiModelProperty(value = "参加考试人员") |
21 | private String userId; | 21 | private String userId; |
22 | @ApiModelProperty(value = "所属厂站") | ||
23 | private String departId; | ||
22 | 24 | ||
23 | @ApiModelProperty(value = "考试开始时间") | 25 | @ApiModelProperty(value = "考试开始时间") |
24 | private String startTime; | 26 | private String startTime; | ... | ... |
... | @@ -121,10 +121,10 @@ public class EquipmentController { | ... | @@ -121,10 +121,10 @@ public class EquipmentController { |
121 | if(equipmentInfo.getDepartId()==null){ | 121 | if(equipmentInfo.getDepartId()==null){ |
122 | equipmentInfo.setDepartId(BaseContextHandler.getDeparts()); | 122 | equipmentInfo.setDepartId(BaseContextHandler.getDeparts()); |
123 | } | 123 | } |
124 | /* if(model==1){ | 124 | if(model==1){ |
125 | queryWrapper.isNotNull("is_model"); | 125 | queryWrapper.isNotNull("digital_twins_struct_code"); |
126 | queryWrapper.last(" and is_model != ''"); | 126 | queryWrapper.last(" and digital_twins_struct_code != ''"); |
127 | }*/ | 127 | } |
128 | queryWrapper.orderByDesc("create_time"); | 128 | queryWrapper.orderByDesc("create_time"); |
129 | List<EquipmentInfo> dataList = equipmentInfoService.list(queryWrapper); | 129 | List<EquipmentInfo> dataList = equipmentInfoService.list(queryWrapper); |
130 | result.setSuccess(true); | 130 | result.setSuccess(true); | ... | ... |
-
请 注册 或 登录 后发表评论