Merge remote-tracking branch 'origin/master' into master
正在显示
19 个修改的文件
包含
124 行增加
和
71 行删除
... | @@ -26,7 +26,7 @@ public interface ReportConstant { | ... | @@ -26,7 +26,7 @@ public interface ReportConstant { |
26 | //药剂字段 | 26 | //药剂字段 |
27 | public static final String fieldYj = "PAMZ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + | 27 | public static final String fieldYj = "PAMZ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + |
28 | "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2"; | 28 | "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2"; |
29 | 29 | public static final String fieldYj_2 = "PACYT,PACGT,NaClO,SCLPAMF,PAMRJ,PFS,FHTY,RYXNJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2"; | |
30 | //水量字段 | 30 | //水量字段 |
31 | public static final String fieldClsl = "CSL,JSL"; | 31 | public static final String fieldClsl = "CSL,JSL"; |
32 | public static final String field_CSL= "CSL"; | 32 | public static final String field_CSL= "CSL"; | ... | ... |
... | @@ -319,8 +319,8 @@ public class ReportViewUtil { | ... | @@ -319,8 +319,8 @@ public class ReportViewUtil { |
319 | public static ReportItemVO getSumValueByTBHB(String reportId, String fields, String departIds , String startTime , String endTime){ | 319 | public static ReportItemVO getSumValueByTBHB(String reportId, String fields, String departIds , String startTime , String endTime){ |
320 | ReportItemVO reportItemVO = null; | 320 | ReportItemVO reportItemVO = null; |
321 | String dataViewName3a24_value = ReportViewUtil.buildViewLike(reportId,fields, departIds, startTime,endTime); | 321 | String dataViewName3a24_value = ReportViewUtil.buildViewLike(reportId,fields, departIds, startTime,endTime); |
322 | String dataViewName3a24_valueHB = ReportViewUtil.buildViewLike(reportId,fields, departIds, DateUtils.getHbDate(startTime),DateUtils.getHbDate(startTime)); | 322 | String dataViewName3a24_valueHB = ReportViewUtil.buildViewLike(reportId,fields, departIds, DateUtils.getHbDate(startTime),DateUtils.getHbDate(endTime)); |
323 | String dataViewName3a24_valueTB = ReportViewUtil.buildViewLike(reportId,fields, departIds, DateUtils.getTbDate(startTime),DateUtils.getTbDate(startTime)); | 323 | String dataViewName3a24_valueTB = ReportViewUtil.buildViewLike(reportId,fields, departIds, DateUtils.getTbDate(startTime),DateUtils.getTbDate(endTime)); |
324 | 324 | ||
325 | String fieldsSql = ""; | 325 | String fieldsSql = ""; |
326 | if(StringUtils.isNotEmpty(fields)) { | 326 | if(StringUtils.isNotEmpty(fields)) { | ... | ... |
... | @@ -50,7 +50,6 @@ public class AlarmParamStandardConfigController { | ... | @@ -50,7 +50,6 @@ public class AlarmParamStandardConfigController { |
50 | public Result<AlarmParamStandardConfig> addAlarmParamStandardInfo(@RequestBody AlarmParamStandardConfig alarmParamStandardConfig){ | 50 | public Result<AlarmParamStandardConfig> addAlarmParamStandardInfo(@RequestBody AlarmParamStandardConfig alarmParamStandardConfig){ |
51 | 51 | ||
52 | Result<AlarmParamStandardConfig> result = new Result<>(); | 52 | Result<AlarmParamStandardConfig> result = new Result<>(); |
53 | |||
54 | try{ | 53 | try{ |
55 | //设置isDelete的字段1,表示为有效数据 | 54 | //设置isDelete的字段1,表示为有效数据 |
56 | alarmParamStandardConfig.setDelFlag(1); | 55 | alarmParamStandardConfig.setDelFlag(1); |
... | @@ -209,4 +208,4 @@ public class AlarmParamStandardConfigController { | ... | @@ -209,4 +208,4 @@ public class AlarmParamStandardConfigController { |
209 | 208 | ||
210 | } | 209 | } |
211 | 210 | ||
212 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
211 | } | ... | ... |
... | @@ -77,7 +77,6 @@ public class CommandCentreServiceImpl implements ICommandCentreService { | ... | @@ -77,7 +77,6 @@ public class CommandCentreServiceImpl implements ICommandCentreService { |
77 | public List<WaterTreatmentVO> statisticsCLSLXQ(String startDate,String endDate, String departIds){ | 77 | public List<WaterTreatmentVO> statisticsCLSLXQ(String startDate,String endDate, String departIds){ |
78 | List<WaterTreatmentVO> dateList = null; | 78 | List<WaterTreatmentVO> dateList = null; |
79 | DateVO dateVO = new DateVO(startDate);//转换后的时间参数 | 79 | DateVO dateVO = new DateVO(startDate);//转换后的时间参数 |
80 | long differenceDay = DateUtils.differenceDay(startDate, endDate); | ||
81 | String departIdssss = BaseUtil.quoteEach(departIds , ","); | 80 | String departIdssss = BaseUtil.quoteEach(departIds , ","); |
82 | //String factorySql = "select fi.depart_id ,d.depart_name, fi.pro_scale*10000 'pro_scale' from sys_factory_info fi , sys_depart d where fi.depart_id = d.id and d.depart_type =1 and d.id in("+departIdssss+")"; | 81 | //String factorySql = "select fi.depart_id ,d.depart_name, fi.pro_scale*10000 'pro_scale' from sys_factory_info fi , sys_depart d where fi.depart_id = d.id and d.depart_type =1 and d.id in("+departIdssss+")"; |
83 | String factorySql = "select group_concat(fi.depart_id) from sys_factory_info fi , sys_depart d where fi.depart_id = d.id and d.depart_type =1 and d.id in("+departIdssss+")"; | 82 | String factorySql = "select group_concat(fi.depart_id) from sys_factory_info fi , sys_depart d where fi.depart_id = d.id and d.depart_type =1 and d.id in("+departIdssss+")"; |
... | @@ -87,11 +86,16 @@ public class CommandCentreServiceImpl implements ICommandCentreService { | ... | @@ -87,11 +86,16 @@ public class CommandCentreServiceImpl implements ICommandCentreService { |
87 | //月产水量 | 86 | //月产水量 |
88 | Map<String,String> cslMap = commonQueryCsl(departIds, startDate, endDate); | 87 | Map<String,String> cslMap = commonQueryCsl(departIds, startDate, endDate); |
89 | 88 | ||
90 | String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); | 89 | String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); |
91 | String sql = "select aaa.CSL 'csl' ,aaa.depart_id , d.depart_name, fi.pro_scale*10000 'pro_scale' from "+ dataViewName2119 +" aaa"; | 90 | /* String sql = "select aaa.CSL 'csl' ,aaa.depart_id , d.depart_name, fi.pro_scale*10000 'pro_scale' from "+ dataViewName2119 +" aaa"; |
92 | sql += " left join sys_factory_info fi on fi.depart_id = aaa.depart_id"; | 91 | sql += " left join sys_factory_info fi on fi.depart_id = aaa.depart_id"; |
93 | sql += " left join sys_depart d on d.id = aaa.depart_id"; | 92 | sql += " left join sys_depart d on d.id = aaa.depart_id"; |
94 | sql += " order by aaa.CSL desc "; | 93 | sql += " order by aaa.CSL desc ";*/ |
94 | String sql = " select d.depart_name , bbb.* , f.pro_scale *10000 'pro_scale', ROUND( 100 * bbb.CSL/( f.pro_scale *10000 ) , 2 ) AS fhl from ( "; | ||
95 | sql += " select sum(aaa.CSL) CSL, avg(aaa.CSL) dayCsl ,aaa.depart_id from "+dataViewName2119+ " aaa group by aaa.depart_id"; | ||
96 | sql += " ) bbb LEFT JOIN sys_factory_info f ON f.depart_id = bbb.depart_id "; | ||
97 | sql += " left join sys_depart d on d.id = bbb.depart_id "; | ||
98 | sql += " order by bbb.CSL desc "; | ||
95 | dateList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<WaterTreatmentVO>(WaterTreatmentVO.class)); | 99 | dateList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<WaterTreatmentVO>(WaterTreatmentVO.class)); |
96 | 100 | ||
97 | 101 | ||
... | @@ -104,9 +108,7 @@ public class CommandCentreServiceImpl implements ICommandCentreService { | ... | @@ -104,9 +108,7 @@ public class CommandCentreServiceImpl implements ICommandCentreService { |
104 | if(dateList != null ){ | 108 | if(dateList != null ){ |
105 | for(WaterTreatmentVO waterTreatmentVO : dateList){ | 109 | for(WaterTreatmentVO waterTreatmentVO : dateList){ |
106 | waterTreatmentVO.setRank(index++);//设置排名 | 110 | waterTreatmentVO.setRank(index++);//设置排名 |
107 | waterTreatmentVO.setMonthDayNum(differenceDay); | ||
108 | if(waterTreatmentVO.getCSL() != null ){ | 111 | if(waterTreatmentVO.getCSL() != null ){ |
109 | waterTreatmentVO.setDayCsl(Double.parseDouble(JSUtils.divide( waterTreatmentVO.getCSL() ,differenceDay )) ); | ||
110 | waterTreatmentVO.setCSL(Double.parseDouble(JSUtils.format(waterTreatmentVO.getCSL()) ));//格式化 | 112 | waterTreatmentVO.setCSL(Double.parseDouble(JSUtils.format(waterTreatmentVO.getCSL()) ));//格式化 |
111 | } | 113 | } |
112 | /* waterTreatmentVO.setRank( index++);//设置排名 | 114 | /* waterTreatmentVO.setRank( index++);//设置排名 | ... | ... |
... | @@ -36,14 +36,8 @@ public class WaterTreatmentVO { | ... | @@ -36,14 +36,8 @@ public class WaterTreatmentVO { |
36 | @ApiModelProperty(value = "排名") | 36 | @ApiModelProperty(value = "排名") |
37 | private Integer rank; | 37 | private Integer rank; |
38 | 38 | ||
39 | private long monthDayNum = 30; | 39 | // private long monthDayNum = 30; |
40 | 40 | ||
41 | public String getFhl() { | ||
42 | if(this.getCSL() != null && this.getProScale() != null && this.getProScale().doubleValue() > 0 ){ | ||
43 | fhl = JSUtils.format( this.getCSL()*100 / (this.getProScale() * this.getMonthDayNum() ) ); | ||
44 | } | ||
45 | return fhl; | ||
46 | } | ||
47 | 41 | ||
48 | public String getHbcslbl() { | 42 | public String getHbcslbl() { |
49 | if(this.getCSL() != null && this.getHbcsl() != null && this.getHbcsl().doubleValue() > 0){ | 43 | if(this.getCSL() != null && this.getHbcsl() != null && this.getHbcsl().doubleValue() > 0){ | ... | ... |
... | @@ -22,6 +22,7 @@ import com.skua.tool.util.JoinSqlUtils; | ... | @@ -22,6 +22,7 @@ import com.skua.tool.util.JoinSqlUtils; |
22 | import io.swagger.annotations.Api; | 22 | import io.swagger.annotations.Api; |
23 | import io.swagger.annotations.ApiOperation; | 23 | import io.swagger.annotations.ApiOperation; |
24 | import lombok.extern.slf4j.Slf4j; | 24 | import lombok.extern.slf4j.Slf4j; |
25 | import org.apache.commons.lang.StringUtils; | ||
25 | import org.apache.poi.xwpf.usermodel.ParagraphAlignment; | 26 | import org.apache.poi.xwpf.usermodel.ParagraphAlignment; |
26 | import org.apache.poi.xwpf.usermodel.XWPFDocument; | 27 | import org.apache.poi.xwpf.usermodel.XWPFDocument; |
27 | import org.apache.poi.xwpf.usermodel.XWPFParagraph; | 28 | import org.apache.poi.xwpf.usermodel.XWPFParagraph; |
... | @@ -179,7 +180,9 @@ public class UserPaperController { | ... | @@ -179,7 +180,9 @@ public class UserPaperController { |
179 | */ | 180 | */ |
180 | 181 | ||
181 | Page<Paper> page = new Page<Paper>(pageNo, pageSize); | 182 | Page<Paper> page = new Page<Paper>(pageNo, pageSize); |
182 | paper.setUserId(BaseContextHandler.getUserId());//获取当前用户编号 | 183 | if(StringUtils.isEmpty(paper.getUserId())){ |
184 | paper.setUserId(BaseContextHandler.getUserId());//获取当前用户编号 | ||
185 | } | ||
183 | IPage<Paper> paperList = paperService.queryMyPaperRecoredByList(page,paper); | 186 | IPage<Paper> paperList = paperService.queryMyPaperRecoredByList(page,paper); |
184 | 187 | ||
185 | result.setResult(paperList); | 188 | result.setResult(paperList); | ... | ... |
... | @@ -31,7 +31,7 @@ public class ErpReportController { | ... | @@ -31,7 +31,7 @@ public class ErpReportController { |
31 | @AutoLog(value = "赋能中心-药剂统购分销") | 31 | @AutoLog(value = "赋能中心-药剂统购分销") |
32 | @ApiOperation(value="赋能中心-药剂统购分销", notes="赋能中心-药剂统购分销") | 32 | @ApiOperation(value="赋能中心-药剂统购分销", notes="赋能中心-药剂统购分销") |
33 | @GetMapping(value = "/agentiaStatistics") | 33 | @GetMapping(value = "/agentiaStatistics") |
34 | public Result<List<AgentiaStatisticsVO>> agentiaStatistics() { | 34 | public Result<List<AgentiaStatisticsVO>> agentiaStatistics(String year) { |
35 | Result<List<AgentiaStatisticsVO>> result = new Result<List<AgentiaStatisticsVO>>(); | 35 | Result<List<AgentiaStatisticsVO>> result = new Result<List<AgentiaStatisticsVO>>(); |
36 | 36 | ||
37 | String sql ="select d.depart_name , mi.material_num ,sm.supp_name 'supplier_name' ,aaa.* from ("; | 37 | String sql ="select d.depart_name , mi.material_num ,sm.supp_name 'supplier_name' ,aaa.* from ("; | ... | ... |
... | @@ -9,6 +9,7 @@ import com.skua.core.aspect.annotation.AutoLog; | ... | @@ -9,6 +9,7 @@ import com.skua.core.aspect.annotation.AutoLog; |
9 | import com.skua.core.context.BaseContextHandler; | 9 | import com.skua.core.context.BaseContextHandler; |
10 | import com.skua.core.context.SpringContextUtils; | 10 | import com.skua.core.context.SpringContextUtils; |
11 | import com.skua.core.query.QueryGenerator; | 11 | import com.skua.core.query.QueryGenerator; |
12 | import com.skua.core.util.ConvertUtils; | ||
12 | import com.skua.core.util.DateUtils; | 13 | import com.skua.core.util.DateUtils; |
13 | import com.skua.modules.erp.entity.ErpSettlement; | 14 | import com.skua.modules.erp.entity.ErpSettlement; |
14 | import com.skua.modules.erp.vo.PurchaseContractVO; | 15 | import com.skua.modules.erp.vo.PurchaseContractVO; |
... | @@ -114,13 +115,13 @@ public class MaterialInfoController { | ... | @@ -114,13 +115,13 @@ public class MaterialInfoController { |
114 | queryWrapper.like("fac_information_name",materialInfo.getFacInformationName()); | 115 | queryWrapper.like("fac_information_name",materialInfo.getFacInformationName()); |
115 | } | 116 | } |
116 | if(StringUtils.isNotEmpty(materialInfo.getRulesType())){ | 117 | if(StringUtils.isNotEmpty(materialInfo.getRulesType())){ |
117 | queryWrapper.eq("rules_type",materialInfo.getRulesType()); | 118 | queryWrapper.like("rules_type",materialInfo.getRulesType()); |
118 | } | 119 | } |
119 | if(StringUtils.isNotEmpty(materialInfo.getLawsType())){ | 120 | if(StringUtils.isNotEmpty(materialInfo.getLawsType())){ |
120 | queryWrapper.eq("laws_type",materialInfo.getLawsType()); | 121 | queryWrapper.like("laws_type",materialInfo.getLawsType()); |
121 | } | 122 | } |
122 | if(StringUtils.isNotEmpty(materialInfo.getStandardsType())){ | 123 | if(StringUtils.isNotEmpty(materialInfo.getStandardsType())){ |
123 | queryWrapper.eq("standards_type",materialInfo.getStandardsType()); | 124 | queryWrapper.like("standards_type",materialInfo.getStandardsType()); |
124 | } | 125 | } |
125 | queryWrapper.eq("status","3"); | 126 | queryWrapper.eq("status","3"); |
126 | IPage<MaterialInfo> pageList = materialInfoService.page(page, queryWrapper); | 127 | IPage<MaterialInfo> pageList = materialInfoService.page(page, queryWrapper); |
... | @@ -138,7 +139,9 @@ public class MaterialInfoController { | ... | @@ -138,7 +139,9 @@ public class MaterialInfoController { |
138 | Result<IPage<MaterialInfo>> result = new Result<IPage<MaterialInfo>>(); | 139 | Result<IPage<MaterialInfo>> result = new Result<IPage<MaterialInfo>>(); |
139 | Page<MaterialInfo> page = new Page<MaterialInfo>(pageNo, pageSize); | 140 | Page<MaterialInfo> page = new Page<MaterialInfo>(pageNo, pageSize); |
140 | QueryWrapper<MaterialInfo> queryWrapper = getMaterialInfoQueryWrapper(materialInfo); | 141 | QueryWrapper<MaterialInfo> queryWrapper = getMaterialInfoQueryWrapper(materialInfo); |
141 | queryWrapper.in("status","'1','2'"); | 142 | //queryWrapper.in("status","'1','2'"); |
143 | queryWrapper.eq("status","1"); | ||
144 | //queryWrapper.le("status","2"); | ||
142 | IPage<MaterialInfo> pageList = materialInfoService.page(page, queryWrapper); | 145 | IPage<MaterialInfo> pageList = materialInfoService.page(page, queryWrapper); |
143 | result.setSuccess(true); | 146 | result.setSuccess(true); |
144 | result.setResult(pageList); | 147 | result.setResult(pageList); |
... | @@ -176,6 +179,10 @@ public class MaterialInfoController { | ... | @@ -176,6 +179,10 @@ public class MaterialInfoController { |
176 | queryWrapper.eq("del_flag","0"); | 179 | queryWrapper.eq("del_flag","0"); |
177 | // queryWrapper.eq("depart_id",materialInfo.getDepartId()); | 180 | // queryWrapper.eq("depart_id",materialInfo.getDepartId()); |
178 | //queryWrapper.in("depart_id", JSUtils.quoteEach(departIds,",")); | 181 | //queryWrapper.in("depart_id", JSUtils.quoteEach(departIds,",")); |
182 | |||
183 | if(StringUtils.isNotEmpty(materialInfo.getStatus())){ | ||
184 | queryWrapper.eq("status",materialInfo.getStatus()); | ||
185 | } | ||
179 | if(StringUtils.isNotEmpty(materialInfo.getFacInformationtype())){ | 186 | if(StringUtils.isNotEmpty(materialInfo.getFacInformationtype())){ |
180 | queryWrapper.eq("fac_informationtype",materialInfo.getFacInformationtype()); | 187 | queryWrapper.eq("fac_informationtype",materialInfo.getFacInformationtype()); |
181 | } | 188 | } |
... | @@ -184,13 +191,13 @@ public class MaterialInfoController { | ... | @@ -184,13 +191,13 @@ public class MaterialInfoController { |
184 | queryWrapper.like("fac_information_name",materialInfo.getFacInformationName()); | 191 | queryWrapper.like("fac_information_name",materialInfo.getFacInformationName()); |
185 | } | 192 | } |
186 | if(StringUtils.isNotEmpty(materialInfo.getRulesType())){ | 193 | if(StringUtils.isNotEmpty(materialInfo.getRulesType())){ |
187 | queryWrapper.eq("rules_type",materialInfo.getRulesType()); | 194 | queryWrapper.like("rules_type",materialInfo.getRulesType()); |
188 | } | 195 | } |
189 | if(StringUtils.isNotEmpty(materialInfo.getLawsType())){ | 196 | if(StringUtils.isNotEmpty(materialInfo.getLawsType())){ |
190 | queryWrapper.eq("laws_type",materialInfo.getLawsType()); | 197 | queryWrapper.like("laws_type",materialInfo.getLawsType()); |
191 | } | 198 | } |
192 | if(StringUtils.isNotEmpty(materialInfo.getStandardsType())){ | 199 | if(StringUtils.isNotEmpty(materialInfo.getStandardsType())){ |
193 | queryWrapper.eq("standards_type",materialInfo.getStandardsType()); | 200 | queryWrapper.like("standards_type",materialInfo.getStandardsType()); |
194 | } | 201 | } |
195 | queryWrapper.orderByDesc("create_time"); | 202 | queryWrapper.orderByDesc("create_time"); |
196 | return queryWrapper; | 203 | return queryWrapper; |
... | @@ -216,6 +223,11 @@ public class MaterialInfoController { | ... | @@ -216,6 +223,11 @@ public class MaterialInfoController { |
216 | //materialInfo.setDepartId(materialInfoService.queryFacByUserId(userCode)); | 223 | //materialInfo.setDepartId(materialInfoService.queryFacByUserId(userCode)); |
217 | materialInfo.setDepartId(BaseContextHandler.getRealDepartId()); | 224 | materialInfo.setDepartId(BaseContextHandler.getRealDepartId()); |
218 | } | 225 | } |
226 | materialInfo.setUserId( BaseContextHandler.getUserId() ); | ||
227 | if(StringUtils.isEmpty(materialInfo.getStatus())){ | ||
228 | materialInfo.setStatus("0"); | ||
229 | } | ||
230 | |||
219 | materialInfoService.save(materialInfo); | 231 | materialInfoService.save(materialInfo); |
220 | result.success("添加成功!"); | 232 | result.success("添加成功!"); |
221 | } catch (Exception e) { | 233 | } catch (Exception e) { |
... | @@ -370,14 +382,14 @@ public class MaterialInfoController { | ... | @@ -370,14 +382,14 @@ public class MaterialInfoController { |
370 | /** | 382 | /** |
371 | * 导出excel | 383 | * 导出excel |
372 | * | 384 | * |
373 | * @param request | ||
374 | * @param response | ||
375 | */ | 385 | */ |
376 | @RequestMapping(value = "/exportXls") | 386 | @RequestMapping(value = "/exportXls") |
377 | public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) { | 387 | public ModelAndView exportXls(MaterialInfo materialInfo) { |
378 | // Step.1 组装查询条件 | 388 | // Step.1 组装查询条件 |
379 | QueryWrapper<MaterialInfo> queryWrapper = null; | 389 | |
380 | try { | 390 | /* |
391 | QueryWrapper<MaterialInfo> queryWrapper = null; | ||
392 | try { | ||
381 | String paramsStr = request.getParameter("paramsStr"); | 393 | String paramsStr = request.getParameter("paramsStr"); |
382 | if (StringUtils.isNotEmpty(paramsStr)) { | 394 | if (StringUtils.isNotEmpty(paramsStr)) { |
383 | String deString = URLDecoder.decode(paramsStr, "UTF-8"); | 395 | String deString = URLDecoder.decode(paramsStr, "UTF-8"); |
... | @@ -386,15 +398,20 @@ public class MaterialInfoController { | ... | @@ -386,15 +398,20 @@ public class MaterialInfoController { |
386 | } | 398 | } |
387 | } catch (UnsupportedEncodingException e) { | 399 | } catch (UnsupportedEncodingException e) { |
388 | e.printStackTrace(); | 400 | e.printStackTrace(); |
389 | } | 401 | }*/ |
390 | 402 | ||
403 | QueryWrapper<MaterialInfo> queryWrapper = getMaterialInfoQueryWrapper(materialInfo); | ||
391 | //Step.2 AutoPoi 导出Excel | 404 | //Step.2 AutoPoi 导出Excel |
392 | ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); | 405 | ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); |
393 | List<MaterialInfo> pageList = materialInfoService.list(queryWrapper); | 406 | List<MaterialInfo> pageList = materialInfoService.list(queryWrapper); |
407 | |||
394 | //导出文件名称 | 408 | //导出文件名称 |
395 | mv.addObject(NormalExcelConstants.FILE_NAME, "厂区资料管理列表"); | 409 | Map<String,String> nameMap = new HashMap<>(); |
396 | mv.addObject(NormalExcelConstants.CLASS, MaterialInformation.class); | 410 | nameMap.put("bzgf","标准规范");nameMap.put("flfg","法律法规");nameMap.put("gzzd","公司制度章程"); |
397 | mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("厂区资料管理列表数据", "导出人:Jeecg", "导出信息")); | 411 | String fileName = ConvertUtils.getString( nameMap.get( materialInfo.getFacInformationtype() ) , "厂区资料管理列表数据"); |
412 | mv.addObject(NormalExcelConstants.FILE_NAME,fileName ); | ||
413 | mv.addObject(NormalExcelConstants.CLASS, MaterialInfo.class); | ||
414 | mv.addObject(NormalExcelConstants.PARAMS, new ExportParams(fileName, "导出人:", "导出信息")); | ||
398 | mv.addObject(NormalExcelConstants.DATA_LIST, pageList); | 415 | mv.addObject(NormalExcelConstants.DATA_LIST, pageList); |
399 | return mv; | 416 | return mv; |
400 | } | 417 | } |
... | @@ -493,14 +510,14 @@ public class MaterialInfoController { | ... | @@ -493,14 +510,14 @@ public class MaterialInfoController { |
493 | @AutoLog(value = "厂区资料管理-流量统计") | 510 | @AutoLog(value = "厂区资料管理-流量统计") |
494 | @ApiOperation(value = "厂区资料管理-流量统计", notes = "厂区资料管理-流量统计") | 511 | @ApiOperation(value = "厂区资料管理-流量统计", notes = "厂区资料管理-流量统计") |
495 | @GetMapping(value = "/flowStatistics") | 512 | @GetMapping(value = "/flowStatistics") |
496 | public Result<List<Map<String, Object>>> flowStatistics(String departId,String startTime,String endTime,String facInformationtype) { | 513 | public Result<List<Map<String, Object>>> flowStatistics(String departId,String startTime,String endTime,String facInformationtype,String status) { |
497 | Result<List<Map<String, Object>>> result = new Result<>(); | 514 | Result<List<Map<String, Object>>> result = new Result<>(); |
498 | if (StringUtils.isBlank(departId)&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) { | 515 | if (StringUtils.isBlank(departId)&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) { |
499 | departId = departService.getChildDepartId(BaseContextHandler.getDeparts()); | 516 | departId = departService.getChildDepartId(BaseContextHandler.getDeparts()); |
500 | }else{ | 517 | }else{ |
501 | departId = departService.getChildDepartId(departId); | 518 | departId = departService.getChildDepartId(departId); |
502 | } | 519 | } |
503 | List<Map<String, Object>> pageList = materialInfoService.flowStatistics(departId,startTime,endTime,facInformationtype); | 520 | List<Map<String, Object>> pageList = materialInfoService.flowStatistics(departId,startTime,endTime,facInformationtype,status); |
504 | result.setSuccess(true); | 521 | result.setSuccess(true); |
505 | result.setResult(pageList); | 522 | result.setResult(pageList); |
506 | return result; | 523 | return result; | ... | ... |
... | @@ -30,12 +30,12 @@ public class MaterialInfo { | ... | @@ -30,12 +30,12 @@ public class MaterialInfo { |
30 | @ApiModelProperty(value = "id") | 30 | @ApiModelProperty(value = "id") |
31 | private String id; | 31 | private String id; |
32 | /**厂区资料文件名*/ | 32 | /**厂区资料文件名*/ |
33 | @Excel(name = "厂区资料文件名", width = 15 , orderNum = "3") | 33 | @Excel(name = "文件标题", width = 15 , orderNum = "1") |
34 | @ApiModelProperty(value = "厂区资料文件名") | 34 | @ApiModelProperty(value = "文件标题") |
35 | private String facInformationName; | 35 | private String facInformationName; |
36 | /**厂区资料文件名类型*/ | 36 | /**厂区资料文件名类型*/ |
37 | @Excel(name = "厂区资料文件名类型", width = 15,dicCode = "fac_information_type",orderNum = "4") | 37 | //@Excel(name = "文件类型", width = 15,dicCode = "fac_information_type",orderNum = "2") |
38 | @ApiModelProperty(value = "厂区资料文件名类型") | 38 | @ApiModelProperty(value = "文件类型") |
39 | @Dict(dicCode = "fac_information_type") | 39 | @Dict(dicCode = "fac_information_type") |
40 | private String facInformationtype; | 40 | private String facInformationtype; |
41 | /**删除状态(0,正常,1已删除)*/ | 41 | /**删除状态(0,正常,1已删除)*/ |
... | @@ -45,12 +45,11 @@ public class MaterialInfo { | ... | @@ -45,12 +45,11 @@ public class MaterialInfo { |
45 | @ApiModelProperty(value = "用户编号") | 45 | @ApiModelProperty(value = "用户编号") |
46 | private String userId; | 46 | private String userId; |
47 | /**创建人*/ | 47 | /**创建人*/ |
48 | @Excel(name = "创建人", width = 15,dictTable = "sys_user",dicCode = "username",dicText = "realname" ,orderNum = "6") | 48 | //@Excel(name = "创建人", width = 15,dictTable = "sys_user",dicCode = "username",dicText = "realname" ,orderNum = "6") |
49 | @ApiModelProperty(value = "创建人" ) | 49 | @ApiModelProperty(value = "创建人" ) |
50 | @Dict(dictTable = "sys_user",dicCode = "username",dicText = "realname") | 50 | @Dict(dictTable = "sys_user",dicCode = "username",dicText = "realname") |
51 | private String createBy; | 51 | private String createBy; |
52 | /**创建时间*/ | 52 | /**创建时间*/ |
53 | @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") | ||
54 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | 53 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
55 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | 54 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
56 | @ApiModelProperty(value = "创建时间") | 55 | @ApiModelProperty(value = "创建时间") |
... | @@ -67,7 +66,7 @@ public class MaterialInfo { | ... | @@ -67,7 +66,7 @@ public class MaterialInfo { |
67 | @ApiModelProperty(value = "附件地址") | 66 | @ApiModelProperty(value = "附件地址") |
68 | private String docuAddr; | 67 | private String docuAddr; |
69 | /**所属厂区*/ | 68 | /**所属厂区*/ |
70 | @Excel(name = "所属厂区", width = 15,dictTable = "sys_depart", dicCode="id", dicText = "depart_name" ,orderNum = "1") | 69 | @Excel(name = "所属厂区", width = 15,dictTable = "sys_depart", dicCode="id", dicText = "depart_name" ,orderNum = "3") |
71 | @ApiModelProperty(value = "所属厂区") | 70 | @ApiModelProperty(value = "所属厂区") |
72 | @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name") | 71 | @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name") |
73 | private String departId; | 72 | private String departId; |
... | @@ -87,12 +86,12 @@ public class MaterialInfo { | ... | @@ -87,12 +86,12 @@ public class MaterialInfo { |
87 | private String rulesType; | 86 | private String rulesType; |
88 | /**法律法规类型*/ | 87 | /**法律法规类型*/ |
89 | @Dict(dicCode = "laws_type") | 88 | @Dict(dicCode = "laws_type") |
90 | @Excel(name = "法律法规类型", width = 15,dicCode = "laws_type" ,orderNum = "2") | 89 | @Excel(name = "文件类型", width = 15,dicCode = "laws_type" ,orderNum = "2") |
91 | @ApiModelProperty(value = "法律法规类型") | 90 | @ApiModelProperty(value = "文件类型") |
92 | private String lawsType; | 91 | private String lawsType; |
93 | /**法律法规归属*/ | 92 | /**法律法规归属*/ |
94 | @Dict(dicCode = "laws_source") | 93 | @Dict(dicCode = "laws_source") |
95 | @ApiModelProperty(value = "法律法规归属") | 94 | @ApiModelProperty(value = "文件归属") |
96 | private String lawsSource; | 95 | private String lawsSource; |
97 | /**标准规范类型*/ | 96 | /**标准规范类型*/ |
98 | @Dict(dicCode = "standards_type") | 97 | @Dict(dicCode = "standards_type") |
... | @@ -103,24 +102,20 @@ public class MaterialInfo { | ... | @@ -103,24 +102,20 @@ public class MaterialInfo { |
103 | @ApiModelProperty(value = "标准规范来源") | 102 | @ApiModelProperty(value = "标准规范来源") |
104 | private String standardsSource; | 103 | private String standardsSource; |
105 | /**发布时间*/ | 104 | /**发布时间*/ |
106 | @Excel(name = "发布时间", width = 15) | 105 | @Excel(name = "发布时间", width = 15 ,orderNum = "4") |
107 | @ApiModelProperty(value = "发布时间") | 106 | @ApiModelProperty(value = "发布时间") |
108 | private String releaseTime; | 107 | private String releaseTime; |
109 | /**有效时间*/ | 108 | /**有效时间*/ |
110 | @Excel(name = "有效时间", width = 15) | 109 | @Excel(name = "有效时间", width = 15 ,orderNum = "6") |
111 | @ApiModelProperty(value = "有效时间") | 110 | @ApiModelProperty(value = "有效时间") |
112 | private String effectiveTime; | 111 | private String effectiveTime; |
113 | /**版本号*/ | 112 | /**版本号*/ |
114 | @Excel(name = "版本号", width = 15) | ||
115 | @ApiModelProperty(value = "版本号") | 113 | @ApiModelProperty(value = "版本号") |
116 | private String fileVersion; | 114 | private String fileVersion; |
117 | /**所属部门*/ | 115 | /**所属部门*/ |
118 | @Excel(name = "所属部门", width = 15) | ||
119 | @ApiModelProperty(value = "所属部门") | 116 | @ApiModelProperty(value = "所属部门") |
120 | private String fileDepart; | 117 | private String fileDepart; |
121 | /**修订过程*/ | 118 | /**修订过程*/ |
122 | @Excel(name = "修订过程", width = 15) | ||
123 | @ApiModelProperty(value = "修订过程") | ||
124 | private String updateHistory; | 119 | private String updateHistory; |
125 | 120 | ||
126 | @ApiModelProperty(value = "文件号") | 121 | @ApiModelProperty(value = "文件号") | ... | ... |
... | @@ -27,7 +27,7 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> { | ... | @@ -27,7 +27,7 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> { |
27 | * @author Li Yuanyuan, 2022年6月22日 下午3:10:31 | 27 | * @author Li Yuanyuan, 2022年6月22日 下午3:10:31 |
28 | * @Description: TODO(这里描述这个方法的需求变更情况) | 28 | * @Description: TODO(这里描述这个方法的需求变更情况) |
29 | */ | 29 | */ |
30 | List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime, String facInformationtype); | 30 | List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime, String facInformationtype,String status); |
31 | 31 | ||
32 | List<MaterialInfo> getList(@Param("materialInfo") MaterialInfo materialInfo, @Param("departIds") String departIds); | 32 | List<MaterialInfo> getList(@Param("materialInfo") MaterialInfo materialInfo, @Param("departIds") String departIds); |
33 | } | 33 | } | ... | ... |
... | @@ -30,7 +30,8 @@ | ... | @@ -30,7 +30,8 @@ |
30 | material_info a | 30 | material_info a |
31 | INNER JOIN material_info_handle_record b ON a.id = b.info_id | 31 | INNER JOIN material_info_handle_record b ON a.id = b.info_id |
32 | WHERE | 32 | WHERE |
33 | b.create_time >= #{startTime} | 33 | del_flag = 0 |
34 | AND b.create_time >= #{startTime} | ||
34 | AND b.create_time <= #{endTime} | 35 | AND b.create_time <= #{endTime} |
35 | <if test="departId!=null and departId!=''"> | 36 | <if test="departId!=null and departId!=''"> |
36 | and a.depart_id in | 37 | and a.depart_id in |
... | @@ -41,6 +42,9 @@ | ... | @@ -41,6 +42,9 @@ |
41 | <if test="facInformationtype!=null and facInformationtype!=''"> | 42 | <if test="facInformationtype!=null and facInformationtype!=''"> |
42 | AND a.fac_informationtype = #{facInformationtype} | 43 | AND a.fac_informationtype = #{facInformationtype} |
43 | </if> | 44 | </if> |
45 | <if test="status!=null and status!=''"> | ||
46 | and a.status = #{status} | ||
47 | </if> | ||
44 | GROUP BY | 48 | GROUP BY |
45 | b.create_time,b.handle_type | 49 | b.create_time,b.handle_type |
46 | </select> | 50 | </select> |
... | @@ -53,6 +57,9 @@ | ... | @@ -53,6 +57,9 @@ |
53 | '${item}' | 57 | '${item}' |
54 | </foreach> | 58 | </foreach> |
55 | </if> | 59 | </if> |
60 | <if test="materialInfo.status!=null and materialInfo.status!=''"> | ||
61 | and status = #{materialInfo.status} | ||
62 | </if> | ||
56 | <if test="materialInfo.facInformationtype!=null and materialInfo.facInformationtype!=''"> | 63 | <if test="materialInfo.facInformationtype!=null and materialInfo.facInformationtype!=''"> |
57 | and fac_informationtype = #{materialInfo.facInformationtype} | 64 | and fac_informationtype = #{materialInfo.facInformationtype} |
58 | </if> | 65 | </if> | ... | ... |
... | @@ -41,7 +41,7 @@ public interface IMaterialInfoService extends IService<MaterialInfo> { | ... | @@ -41,7 +41,7 @@ public interface IMaterialInfoService extends IService<MaterialInfo> { |
41 | * @author Li Yuanyuan, 2022年6月22日 下午3:00:25 | 41 | * @author Li Yuanyuan, 2022年6月22日 下午3:00:25 |
42 | * @Description: TODO(这里描述这个方法的需求变更情况) | 42 | * @Description: TODO(这里描述这个方法的需求变更情况) |
43 | */ | 43 | */ |
44 | List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime,String facInformationtype); | 44 | List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime,String facInformationtype,String status); |
45 | 45 | ||
46 | IPage<MaterialInfo> getList(Page<MaterialInfo> page, MaterialInfo materialInfo, String departIds); | 46 | IPage<MaterialInfo> getList(Page<MaterialInfo> page, MaterialInfo materialInfo, String departIds); |
47 | } | 47 | } | ... | ... |
... | @@ -83,12 +83,12 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat | ... | @@ -83,12 +83,12 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat |
83 | } | 83 | } |
84 | 84 | ||
85 | @Override | 85 | @Override |
86 | public List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime, String facInformationtype) { | 86 | public List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime, String facInformationtype,String status) { |
87 | //日期切片 | 87 | //日期切片 |
88 | List<Map<String,Object>> resultList = new ArrayList<Map<String,Object>>(); | 88 | List<Map<String,Object>> resultList = new ArrayList<Map<String,Object>>(); |
89 | List<String> timeList = DateUtils.sliceUpDateRange(startTime,endTime,"month"); | 89 | List<String> timeList = DateUtils.sliceUpDateRange(startTime,endTime,"month"); |
90 | //获取统计结果 | 90 | //获取统计结果 |
91 | List<Map<String,Object>> dataList = baseMapper.flowStatistics(departId,startTime,endTime,facInformationtype); | 91 | List<Map<String,Object>> dataList = baseMapper.flowStatistics(departId,startTime,endTime,facInformationtype,status); |
92 | Map<String,Map<String,Object>> resultMap = new HashMap<String,Map<String,Object>>(); | 92 | Map<String,Map<String,Object>> resultMap = new HashMap<String,Map<String,Object>>(); |
93 | for(Map<String,Object> map : dataList) { | 93 | for(Map<String,Object> map : dataList) { |
94 | resultMap.put(ConvertUtils.getString(map.get("create_time"))+"_"+ConvertUtils.getString(map.get("handle_type")), map); | 94 | resultMap.put(ConvertUtils.getString(map.get("create_time"))+"_"+ConvertUtils.getString(map.get("handle_type")), map); | ... | ... |
sk-module-datafill/src/main/java/com/skua/modules/dataAnalysis/mapper/xml/WaterAnalysisNewMapper.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
3 | <mapper namespace="com.skua.modules.dataAnalysis.mapper.WaterAnalysisNewMapper"> | 3 | <mapper namespace="com.skua.modules.dataAnalysis.mapper.WaterAnalysisNewMapper"> |
4 | <!-- 根据出水标准查询达标率--> | ||
4 | <select id="queryFacListBySummary" resultType="java.util.Map"> | 5 | <select id="queryFacListBySummary" resultType="java.util.Map"> |
5 | SELECT | 6 | SELECT |
6 | sd.depart_name factoryName, | 7 | sd.depart_name factoryName, |
... | @@ -18,7 +19,7 @@ | ... | @@ -18,7 +19,7 @@ |
18 | LEFT JOIN ( | 19 | LEFT JOIN ( |
19 | SELECT | 20 | SELECT |
20 | t.factory_id, | 21 | t.factory_id, |
21 | 100- round( count( 1 ) / #{dayCount} * 100, 2 ) count | 22 | 100 - round( count( 1 ) / #{dayCount} * 100, 2 ) count |
22 | FROM | 23 | FROM |
23 | ( | 24 | ( |
24 | SELECT | 25 | SELECT | ... | ... |
此文件的差异被折叠,
点击展开。
... | @@ -301,6 +301,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { | ... | @@ -301,6 +301,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { |
301 | } | 301 | } |
302 | return csbzCharData; | 302 | return csbzCharData; |
303 | } | 303 | } |
304 | //根据出水标准查询达标率 | ||
304 | @Override | 305 | @Override |
305 | public List<Map<String, Object>> queryFacListBySummary(String time) { | 306 | public List<Map<String, Object>> queryFacListBySummary(String time) { |
306 | String departIds = BaseContextHandler.getDeparts(); | 307 | String departIds = BaseContextHandler.getDeparts(); | ... | ... |
... | @@ -26,6 +26,17 @@ public class YJMonthDataVO { | ... | @@ -26,6 +26,17 @@ public class YJMonthDataVO { |
26 | @ApiModelProperty(value = "同比") | 26 | @ApiModelProperty(value = "同比") |
27 | private String valueTB;//同比 | 27 | private String valueTB;//同比 |
28 | 28 | ||
29 | |||
30 | @ApiModelProperty(value = "环比-比例") | ||
31 | private String valueHB_bl;//环比 | ||
32 | @ApiModelProperty(value = "同比-比例") | ||
33 | private String valueTB_bl;//同比 | ||
34 | @ApiModelProperty(value = "单位") | ||
35 | private String unit; | ||
36 | |||
37 | |||
38 | |||
39 | |||
29 | public String getMonthTarge() { | 40 | public String getMonthTarge() { |
30 | monthTarge = JSUtils.divide(yearTarge,12); | 41 | monthTarge = JSUtils.divide(yearTarge,12); |
31 | return monthTarge; | 42 | return monthTarge; |
... | @@ -34,12 +45,23 @@ public class YJMonthDataVO { | ... | @@ -34,12 +45,23 @@ public class YJMonthDataVO { |
34 | public YJMonthDataVO(){ | 45 | public YJMonthDataVO(){ |
35 | } | 46 | } |
36 | 47 | ||
37 | public YJMonthDataVO(String yjName, String yjCode, String yearTarge, String value, String valueHB, String valueTB) { | 48 | public YJMonthDataVO(String yjName, String yjCode, String unit, String yearTarge, String value, String valueHB, String valueTB) { |
38 | this.yjName = yjName; | 49 | this.yjName = yjName; |
39 | this.yjCode = yjCode; | 50 | this.yjCode = yjCode; |
51 | this.unit = unit; | ||
40 | this.yearTarge = yearTarge; | 52 | this.yearTarge = yearTarge; |
41 | this.value = value; | 53 | this.value = value; |
42 | this.valueHB = valueHB; | 54 | this.valueHB = valueHB; |
43 | this.valueTB = valueTB; | 55 | this.valueTB = valueTB; |
44 | } | 56 | } |
57 | |||
58 | public String getValueHB_bl() { | ||
59 | String expression = "( "+this.value +"-" +this.valueHB+")*100/"+this.valueHB; | ||
60 | return JSUtils.executeExpression(expression ,"0.0"); | ||
61 | } | ||
62 | |||
63 | public String getValueTB_bl() { | ||
64 | String expression = "( "+this.value +"-" +this.valueTB+")*100/"+this.valueTB; | ||
65 | return JSUtils.executeExpression(expression ,"0.0"); | ||
66 | } | ||
45 | } | 67 | } | ... | ... |
... | @@ -32,7 +32,7 @@ public class PowerConsumptionAnalysisController { | ... | @@ -32,7 +32,7 @@ public class PowerConsumptionAnalysisController { |
32 | @RequestMapping(value = "/data/display", method = RequestMethod.GET) | 32 | @RequestMapping(value = "/data/display", method = RequestMethod.GET) |
33 | public Result<Map<String, Object>> dataDisplay(AnysisParamsVO anysisParamsVO) { | 33 | public Result<Map<String, Object>> dataDisplay(AnysisParamsVO anysisParamsVO) { |
34 | Result<Map<String, Object>> result = new Result<>(); | 34 | Result<Map<String, Object>> result = new Result<>(); |
35 | anysisParamsVO.setFactoryId(BaseContextHandler.getDeparts()); | 35 | //anysisParamsVO.setFactoryId(BaseContextHandler.getDeparts()); |
36 | Map<String, Object> data = powerConsumptionAnalysisService.dataDisplay(anysisParamsVO); | 36 | Map<String, Object> data = powerConsumptionAnalysisService.dataDisplay(anysisParamsVO); |
37 | result.setResult(data); | 37 | result.setResult(data); |
38 | result.setSuccess(true); | 38 | result.setSuccess(true); | ... | ... |
... | @@ -14,6 +14,7 @@ import com.skua.modules.equipment.vo.AnysisParamsVO; | ... | @@ -14,6 +14,7 @@ import com.skua.modules.equipment.vo.AnysisParamsVO; |
14 | import com.skua.modules.equipment.vo.MetricVo; | 14 | import com.skua.modules.equipment.vo.MetricVo; |
15 | import com.skua.tool.util.JSUtils; | 15 | import com.skua.tool.util.JSUtils; |
16 | import lombok.extern.slf4j.Slf4j; | 16 | import lombok.extern.slf4j.Slf4j; |
17 | import org.apache.commons.lang.StringUtils; | ||
17 | import org.apache.shiro.dao.DataAccessException; | 18 | import org.apache.shiro.dao.DataAccessException; |
18 | import org.springframework.jdbc.core.BeanPropertyRowMapper; | 19 | import org.springframework.jdbc.core.BeanPropertyRowMapper; |
19 | import org.springframework.jdbc.core.JdbcTemplate; | 20 | import org.springframework.jdbc.core.JdbcTemplate; |
... | @@ -280,7 +281,7 @@ public class PowerConsumptionAnalusisServiceImpl implements IPowerConsumptionAna | ... | @@ -280,7 +281,7 @@ public class PowerConsumptionAnalusisServiceImpl implements IPowerConsumptionAna |
280 | //吨水电耗数据 | 281 | //吨水电耗数据 |
281 | List<ReportItemVO> dsdhTrendListList =queryDSDHTrendList( factoryId, startTime, endTime,false); | 282 | List<ReportItemVO> dsdhTrendListList =queryDSDHTrendList( factoryId, startTime, endTime,false); |
282 | //查询数据:水质水量报表 | 283 | //查询数据:水质水量报表 |
283 | List<DataViewVO> dataViewVO2119List = queryDataView2119( factoryId, startTime, endTime); | 284 | List<DataViewVO> dataViewVO2119List = queryDataView2119( factoryId, startTime, endTime,"avg"); |
284 | 285 | ||
285 | //吨水电耗 | 286 | //吨水电耗 |
286 | List<TonOfWaterTrendDto> trend_dsdh = new ArrayList<>(); | 287 | List<TonOfWaterTrendDto> trend_dsdh = new ArrayList<>(); |
... | @@ -356,7 +357,8 @@ public class PowerConsumptionAnalusisServiceImpl implements IPowerConsumptionAna | ... | @@ -356,7 +357,8 @@ public class PowerConsumptionAnalusisServiceImpl implements IPowerConsumptionAna |
356 | //吨水电耗数据 | 357 | //吨水电耗数据 |
357 | List<ReportItemVO> dsdhTrendListList =queryDSDHTrendList( factoryId, startTime, endTime,false); | 358 | List<ReportItemVO> dsdhTrendListList =queryDSDHTrendList( factoryId, startTime, endTime,false); |
358 | //查询数据:水质水量报表 | 359 | //查询数据:水质水量报表 |
359 | List<DataViewVO> dataViewVO2119List = queryDataView2119( factoryId, startTime, endTime); | 360 | List<DataViewVO> dataViewVO2119List = queryDataView2119( factoryId, startTime, endTime,"avg"); |
361 | |||
360 | 362 | ||
361 | //吨水电耗 | 363 | //吨水电耗 |
362 | List<TonOfWaterTrendDto> trend_dsdh = new ArrayList<>(); | 364 | List<TonOfWaterTrendDto> trend_dsdh = new ArrayList<>(); |
... | @@ -413,12 +415,13 @@ public class PowerConsumptionAnalusisServiceImpl implements IPowerConsumptionAna | ... | @@ -413,12 +415,13 @@ public class PowerConsumptionAnalusisServiceImpl implements IPowerConsumptionAna |
413 | 415 | ||
414 | /**************************************/ | 416 | /**************************************/ |
415 | // 水质水量报表 | 417 | // 水质水量报表 |
416 | private List<DataViewVO> queryDataView2119(String departIds, String startTime, String endTime) { | 418 | private List<DataViewVO> queryDataView2119(String departIds, String startTime, String endTime,String singOperator) { |
417 | //ReportConstant.fieldSz = JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN,JSPH,JSSS,CSPH,CSSS"; | 419 | //ReportConstant.fieldSz = JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN,JSPH,JSSS,CSPH,CSSS"; |
420 | if(StringUtils.isNotEmpty(singOperator)) singOperator = "sum"; | ||
418 | String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119, ReportConstant.fieldSz, departIds, startTime, endTime); | 421 | String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119, ReportConstant.fieldSz, departIds, startTime, endTime); |
419 | String sql = " select DATE_FORMAT(aaa.time,'%Y-%m') 'time' , ROUND( SUM( IFNULL(aaa.JSCOD,0) ), 2 ) AS JSCOD, ROUND( SUM( IFNULL(aaa.CSCOD,0) ), 2 ) AS CSCOD,"; | 422 | String sql = " select DATE_FORMAT(aaa.time,'%Y-%m') 'time' , ROUND( "+singOperator+"( IFNULL(aaa.JSCOD,0) ), 2 ) AS JSCOD, ROUND( "+singOperator+"( IFNULL(aaa.CSCOD,0) ), 2 ) AS CSCOD,"; |
420 | sql += " ROUND( SUM( IFNULL(aaa.JSZL,0) ), 2 ) AS JSZL, ROUND( SUM( IFNULL(aaa.CSZL,0) ), 2 ) AS CSZL,"; | 423 | sql += " ROUND( "+singOperator+"( IFNULL(aaa.JSZL,0) ), 2 ) AS JSZL, ROUND( "+singOperator+"( IFNULL(aaa.CSZL,0) ), 2 ) AS CSZL,"; |
421 | sql += "ROUND( SUM( IFNULL(aaa.JSAD,0) ), 2 ) AS JSAD, ROUND( SUM( IFNULL(aaa.CSAD,0) ), 2 ) AS CSAD "; | 424 | sql += "ROUND( "+singOperator+"( IFNULL(aaa.JSAD,0) ), 2 ) AS JSAD, ROUND( "+singOperator+"( IFNULL(aaa.CSAD,0) ), 2 ) AS CSAD "; |
422 | sql += "from "+ dataViewName2119 +" aaa "; | 425 | sql += "from "+ dataViewName2119 +" aaa "; |
423 | sql += " group by DATE_FORMAT(aaa.time,'%Y-%m') "; | 426 | sql += " group by DATE_FORMAT(aaa.time,'%Y-%m') "; |
424 | 427 | ||
... | @@ -429,11 +432,20 @@ public class PowerConsumptionAnalusisServiceImpl implements IPowerConsumptionAna | ... | @@ -429,11 +432,20 @@ public class PowerConsumptionAnalusisServiceImpl implements IPowerConsumptionAna |
429 | // 负荷率 | 432 | // 负荷率 |
430 | private List<ReportItemVO> queryFhlTrendList(String departIds, String startTime, String endTime) { | 433 | private List<ReportItemVO> queryFhlTrendList(String departIds, String startTime, String endTime) { |
431 | String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.field_CSL, departIds, startTime, endTime); | 434 | String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.field_CSL, departIds, startTime, endTime); |
432 | String sql = " select bbb.time,ROUND(avg(bbb.wsfhl),2) 'value' from ( "; | 435 | /*String sql = " select bbb.time,ROUND(avg(bbb.wsfhl),2) 'value' from ( "; |
433 | sql += " select DATE_FORMAT(aaa.time,'%Y-%m') 'time' ,aaa.depart_id , sum(aaa.CSL) CSL, ROUND( IFNULL( 100 * ( sum(aaa.CSL)/( f.pro_scale * 31*10000 ) ),0), 2 ) AS wsfhl from "+ dataViewName3a24 +" aaa "; | 436 | sql += " select DATE_FORMAT(aaa.time,'%Y-%m') 'time' ,aaa.depart_id , sum(aaa.CSL) CSL, ROUND( IFNULL( 100 * ( avg(aaa.CSL)/( f.pro_scale *10000 ) ),0), 2 ) AS wsfhl from "+ dataViewName3a24 +" aaa "; |
434 | sql += " LEFT JOIN sys_factory_info f ON f.depart_id = aaa.depart_id " ; | 437 | sql += " LEFT JOIN sys_factory_info f ON f.depart_id = aaa.depart_id " ; |
435 | sql += " group by DATE_FORMAT(aaa.time,'%Y-%m') , aaa.depart_id "; | 438 | sql += " group by DATE_FORMAT(aaa.time,'%Y-%m') , aaa.depart_id "; |
436 | sql += ")bbb group by bbb.time "; | 439 | sql += ")bbb group by bbb.time ";*/ |
440 | |||
441 | String sql = "select bbb.* , f.pro_scale *10000 , ROUND( 100 * bbb.CSL/( f.pro_scale *10000 ) , 2 ) AS 'value' from ("; | ||
442 | sql += " select DATE_FORMAT(aaa.time,'%Y-%m') 'time' ,aaa.depart_id , avg(aaa.CSL) CSL from " +dataViewName3a24+" aaa group by DATE_FORMAT(aaa.time,'%Y-%m') , aaa.depart_id " ; | ||
443 | sql += " )bbb "; | ||
444 | sql += " LEFT JOIN sys_factory_info f ON f.depart_id = bbb.depart_id "; | ||
445 | |||
446 | |||
447 | |||
448 | |||
437 | //查询数据 | 449 | //查询数据 |
438 | List<ReportItemVO> trendVOList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<ReportItemVO>(ReportItemVO.class)); | 450 | List<ReportItemVO> trendVOList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<ReportItemVO>(ReportItemVO.class)); |
439 | 451 | ... | ... |
-
请 注册 或 登录 后发表评论