477750b3 张雷

报表常量修改

1 个父辈 ea8f9ea7
正在显示 18 个修改的文件 包含 120 行增加178 行删除
...@@ -17,4 +17,23 @@ public interface ReportConstant { ...@@ -17,4 +17,23 @@ public interface ReportConstant {
17 //化验日报 17 //化验日报
18 public static final String view9bff = "9bffaf9187093d6e6a4390e8c56acca8"; 18 public static final String view9bff = "9bffaf9187093d6e6a4390e8c56acca8";
19 19
20 //供水日报
21 public static final String view6643 = "6643ef559d863f57de5fd33220c773c4";
22
23 //药剂字段
24 public static final String fieldYj = "PAMZ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," +
25 "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2";
26
27 //水量字段
28 public static final String fieldClsl = "CSL,JSL";
29
30 //电字段
31 public static final String fieldDl = "DLHJ";
32
33 //污泥字段
34 public static final String fieldWnl = "WNL";
35
36 //水质字段
37 public static final String fieldSz = "JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN,JSPH,JSSS,CSPH,CSSS";
38
20 } 39 }
......
...@@ -16,9 +16,6 @@ import com.skua.core.context.SpringContextUtils; ...@@ -16,9 +16,6 @@ import com.skua.core.context.SpringContextUtils;
16 */ 16 */
17 public class ReportViewUtil { 17 public class ReportViewUtil {
18 18
19 public static String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";// 水 COD TP TN NH3H
20 public static String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";//能耗报表
21 public static String view4411 = "4411ed3d78634bcdcd700f6e33724025";//生产运营周报
22 /** 19 /**
23 * <pre> 20 * <pre>
24 * 构造填报报表视图 21 * 构造填报报表视图
......
...@@ -175,18 +175,12 @@ public class SysCommandCentreController { ...@@ -175,18 +175,12 @@ public class SysCommandCentreController {
175 @ApiOperation(value="指挥中心-水量电耗趋势", notes="指挥中心-水量电耗趋势") 175 @ApiOperation(value="指挥中心-水量电耗趋势", notes="指挥中心-水量电耗趋势")
176 @GetMapping(value = "/statisticsBySewage") 176 @GetMapping(value = "/statisticsBySewage")
177 public Result<StackedAreaChartDataVO> statisticsBySewage(ReportItemvParam reportItemvParam) throws Exception { 177 public Result<StackedAreaChartDataVO> statisticsBySewage(ReportItemvParam reportItemvParam) throws Exception {
178 // SysAlgorithmStatisticsLibraryVO sysAlgorithmLibraryVO = JSONObject.toJavaObject(jsonObject, SysAlgorithmStatisticsLibraryVO.class);
179
180 // String reportId = "3a243d5715b9e1a3753c180872ca0df9";//报表编号
181 // String reportItemCode = "DLHJ";//查询字段
182
183 //报表数据项值 178 //报表数据项值
184 String reitId = sysConfigService.queryValueByKey("REIT_ID_DLHJ"); 179 String reitId = sysConfigService.queryValueByKey("REIT_ID_DLHJ");
185 //reportItemvParam.setReportId(reportId); 180 //reportItemvParam.setReportId(reportId);
186 reportItemvParam.setReitId( reitId ); 181 reportItemvParam.setReitId( reitId );
187 //电 182 //电
188 List<ReportDateTrendVO> electricityMapList = commandCentreService.getReportItemvByReitIdAndDate7Day(reportItemvParam ); 183 List<ReportDateTrendVO> electricityMapList = commandCentreService.getReportItemvByReitIdAndDate7Day(reportItemvParam );
189 //reportId = "2119ecbf53a1d2d0708258ff67cfd9e1";//报表编号
190 //reportItemCode = "CSL";//查询字段 184 //reportItemCode = "CSL";//查询字段
191 reitId = sysConfigService.queryValueByKey("REIT_ID_CSL"); 185 reitId = sysConfigService.queryValueByKey("REIT_ID_CSL");
192 //水集合 186 //水集合
......
...@@ -132,14 +132,12 @@ public class CommandCentreServiceImpl implements ICommandCentreService { ...@@ -132,14 +132,12 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
132 public DepartDrugResult getYhTotal(String month) { 132 public DepartDrugResult getYhTotal(String month) {
133 String monthTb = DateUtils.getTbMonth(month);//同比时间 133 String monthTb = DateUtils.getTbMonth(month);//同比时间
134 String monthHb = DateUtils.getHbMonth(month);//环比时间 134 String monthHb = DateUtils.getHbMonth(month);//环比时间
135 String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", "", month); 135 String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119, ReportConstant.fieldClsl, "", month);
136 String dataViewName2119tb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", "", monthTb); 136 String dataViewName2119tb = ReportViewUtil.buildViewLike(ReportConstant.view2119, ReportConstant.fieldClsl, "", monthTb);
137 String dataViewName2119hb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", "", monthHb); 137 String dataViewName2119hb = ReportViewUtil.buildViewLike(ReportConstant.view2119, ReportConstant.fieldClsl, "", monthHb);
138 String field3a24 = "PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + 138 String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24, ReportConstant.fieldYj, "", month);
139 "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2"; 139 String dataViewName3a24tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24, ReportConstant.fieldYj, "", monthTb);
140 String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, "", month); 140 String dataViewName3a24hb = ReportViewUtil.buildViewLike(ReportConstant.view3a24, ReportConstant.fieldYj, "", monthHb);
141 String dataViewName3a24tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, "", monthTb);
142 String dataViewName3a24hb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, "", monthHb);
143 DepartDrugResult departDrugResult = fReportItemvMapper.getYhData(month,monthTb,monthHb, 141 DepartDrugResult departDrugResult = fReportItemvMapper.getYhData(month,monthTb,monthHb,
144 dataViewName3a24,dataViewName3a24tb,dataViewName3a24hb); 142 dataViewName3a24,dataViewName3a24tb,dataViewName3a24hb);
145 if(departDrugResult == null){ 143 if(departDrugResult == null){
......
1 package com.skua.modules.algorithm.service.impl; 1 package com.skua.modules.algorithm.service.impl;
2 2
3 import com.skua.common.constant.ReportConstant;
3 import com.skua.common.report.ReportViewUtil; 4 import com.skua.common.report.ReportViewUtil;
4 import com.skua.core.context.SpringContextUtils; 5 import com.skua.core.context.SpringContextUtils;
5 import com.skua.core.util.ConvertUtils; 6 import com.skua.core.util.ConvertUtils;
...@@ -29,8 +30,6 @@ import java.util.Map; ...@@ -29,8 +30,6 @@ import java.util.Map;
29 */ 30 */
30 @Service("reportItemvService") 31 @Service("reportItemvService")
31 public class ReportItemvService { 32 public class ReportItemvService {
32 String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";// 水 COD TP TN NH3H
33 String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";//能耗报表
34 33
35 private JdbcTemplate getJdbcTemplate(){ 34 private JdbcTemplate getJdbcTemplate(){
36 //主库数据源 35 //主库数据源
...@@ -42,12 +41,12 @@ public class ReportItemvService { ...@@ -42,12 +41,12 @@ public class ReportItemvService {
42 41
43 List<FRportlCommandCenterVO> fRportlCommandCenterVOList = new ArrayList<>(); 42 List<FRportlCommandCenterVO> fRportlCommandCenterVOList = new ArrayList<>();
44 DateVO dateVO = new DateVO(startTime); 43 DateVO dateVO = new DateVO(startTime);
45 String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,"WNL", departIds, startTime,endTime); 44 String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"WNL", departIds, startTime,endTime);
46 String sql = "select sum(aaa.WNL) from " + dataViewName3a24+ "aaa"; 45 String sql = "select sum(aaa.WNL) from " + dataViewName3a24+ "aaa";
47 46
48 String nowMonthValue = getSumValue(view3a24,"WNL",departIds,dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); 47 String nowMonthValue = getSumValue(ReportConstant.view3a24,"WNL",departIds,dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
49 String lastMonthValue = getSumValue(view3a24,"WNL",departIds, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); 48 String lastMonthValue = getSumValue(ReportConstant.view3a24,"WNL",departIds, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
50 String lastYearValue = getSumValue(view3a24,"WNL",departIds, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime()); 49 String lastYearValue = getSumValue(ReportConstant.view3a24,"WNL",departIds, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime());
51 50
52 String nowMonthCSL = getSumCSL(departIds,dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); 51 String nowMonthCSL = getSumCSL(departIds,dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
53 String lastMonthCSL = getSumCSL(departIds, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); 52 String lastMonthCSL = getSumCSL(departIds, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
...@@ -72,7 +71,7 @@ public class ReportItemvService { ...@@ -72,7 +71,7 @@ public class ReportItemvService {
72 } 71 }
73 //指挥中心-泥量统计 72 //指挥中心-泥量统计
74 public List<ReportItemVO> statisticsByCementList(String departIds, String startTime, String endTime) { 73 public List<ReportItemVO> statisticsByCementList(String departIds, String startTime, String endTime) {
75 List<ReportItemVO> dateList = statisticsByField(departIds,startTime,endTime,view3a24,"WNL"); 74 List<ReportItemVO> dateList = statisticsByField(departIds,startTime,endTime,ReportConstant.view3a24,"WNL");
76 return dateList; 75 return dateList;
77 } 76 }
78 77
...@@ -83,7 +82,7 @@ public class ReportItemvService { ...@@ -83,7 +82,7 @@ public class ReportItemvService {
83 public List<FRportlCommandCenterVO> statisticsByElectricity(String departId, String startTime, String endTime) { 82 public List<FRportlCommandCenterVO> statisticsByElectricity(String departId, String startTime, String endTime) {
84 List<FRportlCommandCenterVO> fRportlCommandCenterVOList = new ArrayList<>(); 83 List<FRportlCommandCenterVO> fRportlCommandCenterVOList = new ArrayList<>();
85 DateVO dateVO = new DateVO(startTime); 84 DateVO dateVO = new DateVO(startTime);
86 String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,"DLHJ", departId, startTime,endTime); 85 String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ", departId, startTime,endTime);
87 String sql = "select sum(aaa.DLHJ) from " + dataViewName3a24+ "aaa"; 86 String sql = "select sum(aaa.DLHJ) from " + dataViewName3a24+ "aaa";
88 87
89 String nowMonthValue = getSumDLHJ(departId,dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); 88 String nowMonthValue = getSumDLHJ(departId,dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
...@@ -115,7 +114,7 @@ public class ReportItemvService { ...@@ -115,7 +114,7 @@ public class ReportItemvService {
115 * @param endTime 114 * @param endTime
116 */ 115 */
117 public List<ReportItemVO> statisticsByElectricityList(String departIds, String startTime, String endTime) { 116 public List<ReportItemVO> statisticsByElectricityList(String departIds, String startTime, String endTime) {
118 List<ReportItemVO> dateList = statisticsByField(departIds,startTime,endTime,view3a24,"DLHJ"); 117 List<ReportItemVO> dateList = statisticsByField(departIds,startTime,endTime,ReportConstant.view3a24,"DLHJ");
119 return dateList; 118 return dateList;
120 } 119 }
121 /*** 120 /***
...@@ -137,7 +136,7 @@ public class ReportItemvService { ...@@ -137,7 +136,7 @@ public class ReportItemvService {
137 departIds =getJdbcTemplate().queryForObject(factorySql,String.class); 136 departIds =getJdbcTemplate().queryForObject(factorySql,String.class);
138 //月产水量 137 //月产水量
139 Map<String,String> cslMap = commonQueryCsl(departIds, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); 138 Map<String,String> cslMap = commonQueryCsl(departIds, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
140 String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departIds, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); 139 String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
141 String sql = "select aaa.CSL 'csl' ,aaa.depart_id , d.depart_name, fi.pro_scale*10000 'pro_scale' from "+ dataViewName2119 +" aaa"; 140 String sql = "select aaa.CSL 'csl' ,aaa.depart_id , d.depart_name, fi.pro_scale*10000 'pro_scale' from "+ dataViewName2119 +" aaa";
142 sql += " left join sys_factory_info fi on fi.depart_id = aaa.depart_id"; 141 sql += " left join sys_factory_info fi on fi.depart_id = aaa.depart_id";
143 sql += " left join sys_depart d on d.id = aaa.depart_id"; 142 sql += " left join sys_depart d on d.id = aaa.depart_id";
...@@ -225,7 +224,7 @@ public class ReportItemvService { ...@@ -225,7 +224,7 @@ public class ReportItemvService {
225 //通用csl查询,返回Map<部门编号,CSL出水量> 224 //通用csl查询,返回Map<部门编号,CSL出水量>
226 private Map<String,String> commonQueryCsl(String departIds ,String startTime ,String endTime){ 225 private Map<String,String> commonQueryCsl(String departIds ,String startTime ,String endTime){
227 Map<String,String> cslMap = new HashMap<>(); 226 Map<String,String> cslMap = new HashMap<>();
228 String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departIds, startTime,endTime); 227 String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, startTime,endTime);
229 // System.out.println("dataViewName2119 ="+dataViewName2119 ); 228 // System.out.println("dataViewName2119 ="+dataViewName2119 );
230 List<Map<String, Object>> dataMapList = getJdbcTemplate().queryForList(dataViewName2119); 229 List<Map<String, Object>> dataMapList = getJdbcTemplate().queryForList(dataViewName2119);
231 if(dataMapList != null){ 230 if(dataMapList != null){
...@@ -256,14 +255,14 @@ public class ReportItemvService { ...@@ -256,14 +255,14 @@ public class ReportItemvService {
256 * @return 255 * @return
257 */ 256 */
258 public String getSumCSL(String departId ,String startTime ,String endTime){ 257 public String getSumCSL(String departId ,String startTime ,String endTime){
259 String dataViewName2119 = ReportViewUtil.buildViewLike(ReportViewUtil.view2119,"CSL", departId, startTime,endTime); 258 String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, startTime,endTime);
260 String sql = "select sum(aaa.CSL) from " + dataViewName2119+ "aaa"; 259 String sql = "select sum(aaa.CSL) from " + dataViewName2119+ "aaa";
261 String csl = getJdbcTemplate().queryForObject(sql,String.class); 260 String csl = getJdbcTemplate().queryForObject(sql,String.class);
262 return ConvertUtils.getString(csl,"0.00"); 261 return ConvertUtils.getString(csl,"0.00");
263 } 262 }
264 263
265 public String getSumDLHJ(String departId ,String startTime ,String endTime){ 264 public String getSumDLHJ(String departId ,String startTime ,String endTime){
266 String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportViewUtil.view3a24,"DLHJ", departId, startTime,endTime); 265 String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ", departId, startTime,endTime);
267 String sql = "select sum(aaa.DLHJ) from " + dataViewName3a24+ "aaa"; 266 String sql = "select sum(aaa.DLHJ) from " + dataViewName3a24+ "aaa";
268 String dlhj = getJdbcTemplate().queryForObject(sql,String.class); 267 String dlhj = getJdbcTemplate().queryForObject(sql,String.class);
269 return ConvertUtils.getString(dlhj,"0.00"); 268 return ConvertUtils.getString(dlhj,"0.00");
...@@ -278,7 +277,7 @@ public class ReportItemvService { ...@@ -278,7 +277,7 @@ public class ReportItemvService {
278 public DepartLoadRateResultVO statisticsByLoadRate(String departIds,String startTime, String endTime, Integer loadRateType) { 277 public DepartLoadRateResultVO statisticsByLoadRate(String departIds,String startTime, String endTime, Integer loadRateType) {
279 DepartLoadRateResultVO departLoadRateResultVO = new DepartLoadRateResultVO(); 278 DepartLoadRateResultVO departLoadRateResultVO = new DepartLoadRateResultVO();
280 //int loadRateType = 1; 279 //int loadRateType = 1;
281 String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL", departIds, startTime,endTime);// 部门、时间 280 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, startTime,endTime);// 部门、时间
282 //列表数据 281 //列表数据
283 List<DepartLoadRateVO> dataList = statisticsByLoadRateList(departIds, startTime,endTime,loadRateType); 282 List<DepartLoadRateVO> dataList = statisticsByLoadRateList(departIds, startTime,endTime,loadRateType);
284 long differenceDay = DateUtils.differenceDay(startTime, endTime); 283 long differenceDay = DateUtils.differenceDay(startTime, endTime);
...@@ -295,7 +294,7 @@ public class ReportItemvService { ...@@ -295,7 +294,7 @@ public class ReportItemvService {
295 } 294 }
296 //指挥中心-运行负荷率分析---列表详情 295 //指挥中心-运行负荷率分析---列表详情
297 public List<DepartLoadRateVO> statisticsByLoadRateList(String departIds, String startTime, String endTime ,Integer loadRateType) { 296 public List<DepartLoadRateVO> statisticsByLoadRateList(String departIds, String startTime, String endTime ,Integer loadRateType) {
298 String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL", departIds, startTime,endTime);// 部门、时间 297 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, startTime,endTime);// 部门、时间
299 298
300 long differenceDay = DateUtils.differenceDay(startTime, endTime); 299 long differenceDay = DateUtils.differenceDay(startTime, endTime);
301 // 运行负荷率分析 = CSL/规模 300 // 运行负荷率分析 = CSL/规模
...@@ -326,11 +325,6 @@ public class ReportItemvService { ...@@ -326,11 +325,6 @@ public class ReportItemvService {
326 } 325 }
327 326
328 sql += " ) bbb "; 327 sql += " ) bbb ";
329 //System.out.println("sql = "+sql);
330 return sql ; 328 return sql ;
331 } 329 }
332
333 /* public List<Map<String,Object>> getDeptDLHJ(String departId , String startTime , String endTime){
334
335 }*/
336 } 330 }
......
...@@ -39,8 +39,6 @@ public class TestReportSqlController { ...@@ -39,8 +39,6 @@ public class TestReportSqlController {
39 HttpServletRequest req) { 39 HttpServletRequest req) {
40 Result<String> result = new Result(); 40 Result<String> result = new Result();
41 String dataViewName2 = ReportViewUtil.buildViewLike(reportId,fields,departIds, startTime, endTime); 41 String dataViewName2 = ReportViewUtil.buildViewLike(reportId,fields,departIds, startTime, endTime);
42 //String dataViewName3 = ReportViewUtil.buildViewByStatistics("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,WNL,WNHSL,GFCZL,WFCSL,WFCZL", startTime, endTime);
43
44 result.setSuccess(true); 42 result.setSuccess(true);
45 result.setResult(dataViewName2); 43 result.setResult(dataViewName2);
46 return result; 44 return result;
......
1 package com.skua.modules.threedimensional.service.impl; 1 package com.skua.modules.threedimensional.service.impl;
2 2
3 import com.skua.common.constant.ReportConstant;
3 import com.skua.common.report.ReportViewUtil; 4 import com.skua.common.report.ReportViewUtil;
4 import com.skua.core.context.SpringContextUtils; 5 import com.skua.core.context.SpringContextUtils;
5 6
...@@ -10,7 +11,6 @@ import com.skua.modules.guest.util.DateUtil; ...@@ -10,7 +11,6 @@ import com.skua.modules.guest.util.DateUtil;
10 import com.skua.modules.quartz.util.BaseUtil; 11 import com.skua.modules.quartz.util.BaseUtil;
11 import com.skua.modules.threedimensional.service.IJTDisplayScreenService; 12 import com.skua.modules.threedimensional.service.IJTDisplayScreenService;
12 import com.skua.modules.threedimensional.vo.*; 13 import com.skua.modules.threedimensional.vo.*;
13 import com.skua.tool.util.DigitalUtils;
14 import org.apache.commons.lang.StringUtils; 14 import org.apache.commons.lang.StringUtils;
15 import org.springframework.jdbc.core.BeanPropertyRowMapper; 15 import org.springframework.jdbc.core.BeanPropertyRowMapper;
16 import org.springframework.jdbc.core.JdbcTemplate; 16 import org.springframework.jdbc.core.JdbcTemplate;
...@@ -25,11 +25,6 @@ import java.util.*; ...@@ -25,11 +25,6 @@ import java.util.*;
25 @Service 25 @Service
26 public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService { 26 public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
27 27
28
29 String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";// 水 COD TP TN NH3H
30 String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";//能耗报表
31
32
33 private JdbcTemplate getJdbcTemplate(){ 28 private JdbcTemplate getJdbcTemplate(){
34 JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master"); 29 JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
35 return masterDB; 30 return masterDB;
...@@ -63,7 +58,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService { ...@@ -63,7 +58,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
63 String departIds = masterDB.queryForObject( departIdSql,String.class); 58 String departIds = masterDB.queryForObject( departIdSql,String.class);
64 59
65 //昨天处理水量(m³) 60 //昨天处理水量(m³)
66 String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departIds, lastDay, lastDay);//depart_id CSL 61 String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, lastDay, lastDay);//depart_id CSL
67 dataList = masterDB.queryForList(dataViewName2119); 62 dataList = masterDB.queryForList(dataViewName2119);
68 for(Map<String, Object> dataMap : dataList) { 63 for(Map<String, Object> dataMap : dataList) {
69 factoryInfoVO = factoryInfoMap.get(dataMap.get("depart_id").toString()); 64 factoryInfoVO = factoryInfoMap.get(dataMap.get("depart_id").toString());
...@@ -71,7 +66,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService { ...@@ -71,7 +66,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
71 // resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("create_by"))+""+ConvertUtils.getString(dataMap.get("title"))); 66 // resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("create_by"))+""+ConvertUtils.getString(dataMap.get("title")));
72 } 67 }
73 //本月处理水量(m³) 68 //本月处理水量(m³)
74 dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departIds, dateVO.getNowMonthStartDate(), dateVO.getNowMonthEndDate()); 69 dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, dateVO.getNowMonthStartDate(), dateVO.getNowMonthEndDate());
75 dataList = masterDB.queryForList(dataViewName2119); 70 dataList = masterDB.queryForList(dataViewName2119);
76 for(Map<String, Object> dataMap : dataList) { 71 for(Map<String, Object> dataMap : dataList) {
77 factoryInfoVO = factoryInfoMap.get(dataMap.get("depart_id").toString()); 72 factoryInfoVO = factoryInfoMap.get(dataMap.get("depart_id").toString());
...@@ -79,7 +74,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService { ...@@ -79,7 +74,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
79 // resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("create_by"))+""+ConvertUtils.getString(dataMap.get("title"))); 74 // resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("create_by"))+""+ConvertUtils.getString(dataMap.get("title")));
80 } 75 }
81 //本年处理水量(万m³) 76 //本年处理水量(万m³)
82 dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departIds, dateVO.getNowYearStartDate(), currentDate); 77 dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, dateVO.getNowYearStartDate(), currentDate);
83 dataList = masterDB.queryForList(dataViewName2119); 78 dataList = masterDB.queryForList(dataViewName2119);
84 for(Map<String, Object> dataMap : dataList) { 79 for(Map<String, Object> dataMap : dataList) {
85 factoryInfoVO = factoryInfoMap.get(dataMap.get("depart_id").toString()); 80 factoryInfoVO = factoryInfoMap.get(dataMap.get("depart_id").toString());
...@@ -115,7 +110,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService { ...@@ -115,7 +110,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
115 ProjectOperationInfoVO projectOperationInfoVO = projectOperationInfoVOList.get(0); 110 ProjectOperationInfoVO projectOperationInfoVO = projectOperationInfoVOList.get(0);
116 //DateVO dateVO = new DateVO(DateUtil.dateformat("2024-07-01","yyyy-MM-dd")); 111 //DateVO dateVO = new DateVO(DateUtil.dateformat("2024-07-01","yyyy-MM-dd"));
117 //月产水量 112 //月产水量
118 String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", null, startTime,endTime,"sum"); 113 String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", null, startTime,endTime,"sum");
119 //System.out.println("dataViewName2119 = "+dataViewName2119); 114 //System.out.println("dataViewName2119 = "+dataViewName2119);
120 String ycslSql = "select round(sum(aaa.CSL),2) 'CSL' from "+ dataViewName2119+" aaa"; 115 String ycslSql = "select round(sum(aaa.CSL),2) 'CSL' from "+ dataViewName2119+" aaa";
121 String ycsl = getJdbcTemplate().queryForObject(ycslSql, String.class); 116 String ycsl = getJdbcTemplate().queryForObject(ycslSql, String.class);
...@@ -141,7 +136,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService { ...@@ -141,7 +136,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
141 overproofDay = getJdbcTemplate().queryForObject(overProofSql,Long.class); 136 overproofDay = getJdbcTemplate().queryForObject(overProofSql,Long.class);
142 projectOperationInfoVO.setSzzhdbl( (dayNum - overproofDay) * 100/dayNum +"");//格式化两位小数 137 projectOperationInfoVO.setSzzhdbl( (dayNum - overproofDay) * 100/dayNum +"");//格式化两位小数
143 138
144 String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,"WNHSL", null, startTime,endTime,"sum"); 139 String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"WNHSL", null, startTime,endTime,"sum");
145 //System.out.println("dataViewName3a24 = "+dataViewName3a24); 140 //System.out.println("dataViewName3a24 = "+dataViewName3a24);
146 String WNHSLSql = "select round(sum(aaa.WNHSL),2) 'WNHSL' from "+ dataViewName3a24+" aaa"; 141 String WNHSLSql = "select round(sum(aaa.WNHSL),2) 'WNHSL' from "+ dataViewName3a24+" aaa";
147 // System.out.println(" WNHSLSql = "+WNHSLSql); 142 // System.out.println(" WNHSLSql = "+WNHSLSql);
...@@ -165,7 +160,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService { ...@@ -165,7 +160,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
165 String startTime= BaseUtil.getMonthBytime(-6,time)+"-01"; 160 String startTime= BaseUtil.getMonthBytime(-6,time)+"-01";
166 String endTime=BaseUtil.getMonthBytime(-1,time)+"-31"; 161 String endTime=BaseUtil.getMonthBytime(-1,time)+"-31";
167 //月产水量 162 //月产水量
168 String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL,JSL", null, startTime,endTime); 163 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL,JSL", null, startTime,endTime);
169 //System.out.println("dataViewName2119 ="+dataViewName2119); 164 //System.out.println("dataViewName2119 ="+dataViewName2119);
170 StringBuffer sql = new StringBuffer("select date_format(bbb.time,'%Y-%m') 'time' ,round(sum(bbb.JSL),2) 'jsl',round(sum(bbb.CSL),2) 'csl' from "); 165 StringBuffer sql = new StringBuffer("select date_format(bbb.time,'%Y-%m') 'time' ,round(sum(bbb.JSL),2) 'jsl',round(sum(bbb.CSL),2) 'csl' from ");
171 sql.append( dataViewName2119 ); 166 sql.append( dataViewName2119 );
...@@ -186,7 +181,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService { ...@@ -186,7 +181,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
186 */ 181 */
187 public EcologyBenefitVO ecologyBenefit(String departId, String startTime, String endTime){ 182 public EcologyBenefitVO ecologyBenefit(String departId, String startTime, String endTime){
188 //CSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN,JSAD,CSAD 183 //CSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN,JSAD,CSAD
189 String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"JSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN", departId, startTime,endTime); 184 String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"JSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN", departId, startTime,endTime);
190 String sql = "select round(sum( aaa.JSCOD -aaa.CSCOD ),2) 'cod', round(sum( aaa.JSZL -aaa.CSZL ),2) 'tp', round(sum( aaa.JSZD -aaa.CSTN ),2) 'tn' from "+dataViewName2119 +" aaa"; 185 String sql = "select round(sum( aaa.JSCOD -aaa.CSCOD ),2) 'cod', round(sum( aaa.JSZL -aaa.CSZL ),2) 'tp', round(sum( aaa.JSZD -aaa.CSTN ),2) 'tn' from "+dataViewName2119 +" aaa";
191 List<Map<String, Object>> mapList = getJdbcTemplate().queryForList(sql); 186 List<Map<String, Object>> mapList = getJdbcTemplate().queryForList(sql);
192 EcologyBenefitVO ecologyBenefitVO = new EcologyBenefitVO(0d,0d,0d); 187 EcologyBenefitVO ecologyBenefitVO = new EcologyBenefitVO(0d,0d,0d);
...@@ -213,7 +208,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService { ...@@ -213,7 +208,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
213 String startTime= BaseUtil.getMonthBytime(-12,time)+"-01"; 208 String startTime= BaseUtil.getMonthBytime(-12,time)+"-01";
214 String endTime=BaseUtil.getMonthBytime(-1,time)+"-31"; 209 String endTime=BaseUtil.getMonthBytime(-1,time)+"-31";
215 //CSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN,JSAD,CSAD 210 //CSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN,JSAD,CSAD
216 String dataViewName2119 = ReportViewUtil.buildView(view2119,"JSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN,JSAD,CSAD", departId, startTime,endTime); 211 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"JSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN,JSAD,CSAD", departId, startTime,endTime);
217 System.out.println("dataViewName2119 ="+dataViewName2119); 212 System.out.println("dataViewName2119 ="+dataViewName2119);
218 StringBuffer sql = new StringBuffer("select date_format(aaa.time, '%Y-%m') 'time' , round(sum(aaa.JSL),2) 'jsl',round(sum( aaa.JSCOD -aaa.CSCOD ),2) 'cod', "); 213 StringBuffer sql = new StringBuffer("select date_format(aaa.time, '%Y-%m') 'time' , round(sum(aaa.JSL),2) 'jsl',round(sum( aaa.JSCOD -aaa.CSCOD ),2) 'cod', ");
219 sql.append(" round(sum( aaa.JSZL -aaa.CSZL ),2) 'tp', round(sum( aaa.JSZD -aaa.CSTN ),2) 'tn',round(sum( aaa.JSAD -aaa.CSAD ),2) 'nh3n' from "); 214 sql.append(" round(sum( aaa.JSZL -aaa.CSZL ),2) 'tp', round(sum( aaa.JSZD -aaa.CSTN ),2) 'tn',round(sum( aaa.JSAD -aaa.CSAD ),2) 'nh3n' from ");
...@@ -233,7 +228,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService { ...@@ -233,7 +228,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
233 public WaterQualityVO queryWaterQuality(String departId, String startTime, String endTime){ 228 public WaterQualityVO queryWaterQuality(String departId, String startTime, String endTime){
234 WaterQualityVO waterQualityVO = null; 229 WaterQualityVO waterQualityVO = null;
235 //出水 cod, 230 //出水 cod,
236 String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL,JSCOD,CSCOD,JSAD,CSAD", departId, startTime,endTime); 231 String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL,JSCOD,CSCOD,JSAD,CSAD", departId, startTime,endTime);
237 StringBuffer sql = new StringBuffer("select round(aaa.CSL,2) 'csl',round(( aaa.JSCOD - aaa.CSCOD ),2) 'codxjl', round(( aaa.JSAD -aaa.CSAD ),2) 'adxjl' from "); 232 StringBuffer sql = new StringBuffer("select round(aaa.CSL,2) 'csl',round(( aaa.JSCOD - aaa.CSCOD ),2) 'codxjl', round(( aaa.JSAD -aaa.CSAD ),2) 'adxjl' from ");
238 sql.append(" "+dataViewName2119 +" aaa "); 233 sql.append(" "+dataViewName2119 +" aaa ");
239 System.out.println(sql.toString()); 234 System.out.println(sql.toString());
...@@ -251,7 +246,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService { ...@@ -251,7 +246,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
251 waterQualityVO.setYxfhl( yxfhl ); 246 waterQualityVO.setYxfhl( yxfhl );
252 247
253 //吨水电耗,吨水药耗 248 //吨水电耗,吨水药耗
254 String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,"DLHJ,WNL,PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, startTime,endTime,"sum"); 249 String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24, ReportConstant.fieldDl+","+ ReportConstant.fieldWnl+","+ ReportConstant.fieldYj, departId, startTime,endTime,"sum");
255 System.out.println("dataViewName3a24 = "+dataViewName3a24); 250 System.out.println("dataViewName3a24 = "+dataViewName3a24);
256 StringBuffer sql2 = new StringBuffer("select aaa.WNL as 'tnl' ,round((aaa.DLHJ /"+waterQualityVO.getCsl()+"),2) 'dsdh' , "); 251 StringBuffer sql2 = new StringBuffer("select aaa.WNL as 'tnl' ,round((aaa.DLHJ /"+waterQualityVO.getCsl()+"),2) 'dsdh' , ");
257 sql2.append(" round(((aaa.PAMZ + aaa.PAMF+ aaa.PAMRJ+ aaa.SCLPAMZ+ aaa.SCLPAMF+ aaa.NACLO+ aaa.PACGT+ aaa.PACYT+ aaa.FESO4G+ aaa.FESO4Y+ aaa.H2O2+ aaa.CH3COOH+ aaa.SH+ aaa.FECL3+ aaa.HXT+ aaa.PFS+ aaa.CH3COONA+ aaa.GXCLJ+ aaa.YWL+ aaa.RYXNJ+ aaa.FHTY)/ "+waterQualityVO.getCsl()+"),2) 'dsyh' from "); 252 sql2.append(" round(((aaa.PAMZ + aaa.PAMF+ aaa.PAMRJ+ aaa.SCLPAMZ+ aaa.SCLPAMF+ aaa.NACLO+ aaa.PACGT+ aaa.PACYT+ aaa.FESO4G+ aaa.FESO4Y+ aaa.H2O2+ aaa.CH3COOH+ aaa.SH+ aaa.FECL3+ aaa.HXT+ aaa.PFS+ aaa.CH3COONA+ aaa.GXCLJ+ aaa.YWL+ aaa.RYXNJ+ aaa.FHTY)/ "+waterQualityVO.getCsl()+"),2) 'dsyh' from ");
......
...@@ -218,8 +218,8 @@ public class ScreenDataServiceImpl implements IScreenDataService { ...@@ -218,8 +218,8 @@ public class ScreenDataServiceImpl implements IScreenDataService {
218 String departIds = statisticsParams.getDepartIds(); 218 String departIds = statisticsParams.getDepartIds();
219 Map<String, Object> valueMap = new HashMap<>(); 219 Map<String, Object> valueMap = new HashMap<>();
220 List<String> monthList = getMonthsBetween(startDate,endDate); 220 List<String> monthList = getMonthsBetween(startDate,endDate);
221 String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, "DLHJ", departIds, startDate, endDate); 221 String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, ReportConstant.fieldDl, departIds, startDate, endDate);
222 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, startDate, endDate); 222 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119, ReportConstant.fieldClsl, departIds, startDate, endDate);
223 List<Map<String, Object>> dataList = screenMapper.getYhdlqs(startDate,endDate,departIds,dataViewName3a24,dataViewName2119); 223 List<Map<String, Object>> dataList = screenMapper.getYhdlqs(startDate,endDate,departIds,dataViewName3a24,dataViewName2119);
224 if(dataList.size()>0){ 224 if(dataList.size()>0){
225 for (Map<String, Object> vMap : dataList) { 225 for (Map<String, Object> vMap : dataList) {
...@@ -261,10 +261,8 @@ public class ScreenDataServiceImpl implements IScreenDataService { ...@@ -261,10 +261,8 @@ public class ScreenDataServiceImpl implements IScreenDataService {
261 String departIds = statisticsParams.getDepartIds(); 261 String departIds = statisticsParams.getDepartIds();
262 Map<String, Object> valueMap = new HashMap<>(); 262 Map<String, Object> valueMap = new HashMap<>();
263 List<String> monthList = getMonthsBetween(startDate,endDate); 263 List<String> monthList = getMonthsBetween(startDate,endDate);
264 String field3a24 = "PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + 264 String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, ReportConstant.fieldYj, departIds, startDate, endDate);
265 "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2"; 265 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl, departIds, startDate, endDate);
266 String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, departIds, startDate, endDate);
267 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, startDate, endDate);
268 List<Map<String, Object>> dataList = screenMapper.getYhylqs(startDate,endDate,departIds,dataViewName3a24,dataViewName2119); 266 List<Map<String, Object>> dataList = screenMapper.getYhylqs(startDate,endDate,departIds,dataViewName3a24,dataViewName2119);
269 if(dataList.size()>0){ 267 if(dataList.size()>0){
270 for (Map<String, Object> vMap : dataList) { 268 for (Map<String, Object> vMap : dataList) {
......
...@@ -84,11 +84,10 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -84,11 +84,10 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
84 public List<Map<String, Object>> getDataFromHY(String dataTime, String departId) { 84 public List<Map<String, Object>> getDataFromHY(String dataTime, String departId) {
85 List<Map<String, Object>> valueMapList = new ArrayList<>(); 85 List<Map<String, Object>> valueMapList = new ArrayList<>();
86 String tbYear = String.valueOf(Integer.parseInt(dataTime) - 1); 86 String tbYear = String.valueOf(Integer.parseInt(dataTime) - 1);
87 String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, dataTime); 87 String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119, ReportConstant.fieldClsl, departId, dataTime);
88 String dataViewName2119tb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, tbYear); 88 String dataViewName2119tb = ReportViewUtil.buildViewLike(ReportConstant.view2119, ReportConstant.fieldClsl, departId, tbYear);
89 89
90 String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + 90 String field3a24 = ReportConstant.fieldDl + "," + ReportConstant.fieldYj;
91 "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2";
92 String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, dataTime); 91 String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, dataTime);
93 String dataViewName3a24tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, tbYear); 92 String dataViewName3a24tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, tbYear);
94 93
...@@ -179,10 +178,9 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -179,10 +178,9 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
179 Map<String,String> weekMap = getWeekDate(dataTime,week); 178 Map<String,String> weekMap = getWeekDate(dataTime,week);
180 String startDate = weekMap.get("start"); 179 String startDate = weekMap.get("start");
181 String endDate = weekMap.get("end"); 180 String endDate = weekMap.get("end");
182 String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + 181 String field3a24 = ReportConstant.fieldDl + "," + ReportConstant.fieldYj+ "," + ReportConstant.fieldWnl;
183 "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2,WNL";
184 String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, "", startDate, endDate); 182 String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, "", startDate, endDate);
185 String field2119 = "CSL,JSCOD,JSAD,JSPH,JSZD,JSZL,JSSS,CSCOD,CSAD,CSPH,CSTN,CSZL,CSSS"; 183 String field2119 = ReportConstant.fieldClsl + "," + ReportConstant.fieldSz;
186 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,field2119, "", startDate, endDate); 184 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,field2119, "", startDate, endDate);
187 valueMap = mapper.getWeekReport(dataTime, departId, week, startDate, endDate, dataViewName3a24, dataViewName2119); 185 valueMap = mapper.getWeekReport(dataTime, departId, week, startDate, endDate, dataViewName3a24, dataViewName2119);
188 if(valueMap==null){ 186 if(valueMap==null){
...@@ -230,8 +228,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -230,8 +228,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
230 String end = month + "-31"; 228 String end = month + "-31";
231 int dayCount = (int)DateUtils.differenceDay(start,end); 229 int dayCount = (int)DateUtils.differenceDay(start,end);
232 String departIds = commonSqlMapper.getChildDepartId(departId); 230 String departIds = commonSqlMapper.getChildDepartId(departId);
233 String dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,"JSL,CSL,JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN", departIds, start, end); 231 String dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl + "," + ReportConstant.fieldSz, departIds, start, end);
234 String dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, start, end); 232 String dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,ReportConstant.fieldDl+",GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, start, end);
235 List<JnhbReportData> list = mapper.getJnhbReport(dataViewName2, dataViewName3, start, end, departIds, dayCount); 233 List<JnhbReportData> list = mapper.getJnhbReport(dataViewName2, dataViewName3, start, end, departIds, dayCount);
236 return list; 234 return list;
237 } 235 }
...@@ -244,7 +242,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -244,7 +242,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
244 List<JnhbReportDetailsJs> jsList = new ArrayList<>(); 242 List<JnhbReportDetailsJs> jsList = new ArrayList<>();
245 List<JnhbReportDetailsHj> hjList = new ArrayList<>(); 243 List<JnhbReportDetailsHj> hjList = new ArrayList<>();
246 String year = month.substring(0,4); 244 String year = month.substring(0,4);
247 String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL,JSL,JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN", departId, year); 245 String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl+","+ReportConstant.fieldSz, departId, year);
248 String dataViewName3 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"", departId, year); 246 String dataViewName3 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"", departId, year);
249 dyList = mapper.getDyList(dataViewName2, dataViewName3, departId, year); 247 dyList = mapper.getDyList(dataViewName2, dataViewName3, departId, year);
250 jsList = mapper.getJsList(dataViewName2, dataViewName3, departId, year); 248 jsList = mapper.getJsList(dataViewName2, dataViewName3, departId, year);
...@@ -287,8 +285,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -287,8 +285,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
287 //节能环保报表数据-部门+月数据 285 //节能环保报表数据-部门+月数据
288 private List<JnhbReportData> jnhbReportShowDepaetMonthDate(String departIds, String startTime, String endTime){ 286 private List<JnhbReportData> jnhbReportShowDepaetMonthDate(String departIds, String startTime, String endTime){
289 int dayCount = (int)DateUtils.differenceDay(startTime,endTime); 287 int dayCount = (int)DateUtils.differenceDay(startTime,endTime);
290 String dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,"JSL,CSL,JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN", departIds, startTime, endTime); 288 String dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl + "," + ReportConstant.fieldSz, departIds, startTime, endTime);
291 String dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, startTime, endTime); 289 String dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,ReportConstant.fieldDl+",GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, startTime, endTime);
292 List<JnhbReportData> list = mapper.getJnhbReport(dataViewName2, dataViewName3, startTime, endTime, departIds, dayCount); 290 List<JnhbReportData> list = mapper.getJnhbReport(dataViewName2, dataViewName3, startTime, endTime, departIds, dayCount);
293 return list; 291 return list;
294 } 292 }
...@@ -439,8 +437,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -439,8 +437,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
439 437
440 private JnhbReportData getJnhbReportSumData(String departIds, String startTime ,String endTime){ 438 private JnhbReportData getJnhbReportSumData(String departIds, String startTime ,String endTime){
441 //头部统计数据 439 //头部统计数据
442 String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"JSL,CSL,JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN", departIds, startTime, endTime); 440 String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl + "," + ReportConstant.fieldSz, departIds, startTime, endTime);
443 String dataViewName3 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, startTime, endTime); 441 String dataViewName3 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,ReportConstant.fieldDl+",QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, startTime, endTime);
444 //System.out.println("dataViewName3 = "+dataViewName3); 442 //System.out.println("dataViewName3 = "+dataViewName3);
445 if(StringUtils.isNotEmpty(departIds)){ 443 if(StringUtils.isNotEmpty(departIds)){
446 departIds = JSUtils.quoteEach(departIds,","); 444 departIds = JSUtils.quoteEach(departIds,",");
...@@ -467,7 +465,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -467,7 +465,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
467 } 465 }
468 private JnhbReportData getJnhbReportSumDataByResultNumber(String departIds, String startTime ,String endTime){ 466 private JnhbReportData getJnhbReportSumDataByResultNumber(String departIds, String startTime ,String endTime){
469 //头部统计数据 467 //头部统计数据
470 String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"JSL,CSL,JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN", departIds, startTime, endTime); 468 String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl + "," + ReportConstant.fieldSz, departIds, startTime, endTime);
471 String sql = "select "; 469 String sql = "select ";
472 sql += " ROUND(SUM( IFNULL(aaa.JSCOD*aaa.JSL,0)/1000000 ) - SUM( IFNULL(aaa.CSCOD*aaa.CSL,0)/1000000 ),2) AS codxjl,"; 470 sql += " ROUND(SUM( IFNULL(aaa.JSCOD*aaa.JSL,0)/1000000 ) - SUM( IFNULL(aaa.CSCOD*aaa.CSL,0)/1000000 ),2) AS codxjl,";
473 sql += " ROUND(SUM( IFNULL(aaa.JSAD*aaa.JSL,0)/1000000 ) - SUM( IFNULL(aaa.CSAD*aaa.CSL,0)/1000000 ),2) AS adxjl,"; 471 sql += " ROUND(SUM( IFNULL(aaa.JSAD*aaa.JSL,0)/1000000 ) - SUM( IFNULL(aaa.CSAD*aaa.CSL,0)/1000000 ),2) AS adxjl,";
...@@ -533,10 +531,9 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -533,10 +531,9 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
533 Map<String,String> weekMap = getWeekDate(dataTime,week); 531 Map<String,String> weekMap = getWeekDate(dataTime,week);
534 String startDate = weekMap.get("start"); 532 String startDate = weekMap.get("start");
535 String endDate = weekMap.get("end"); 533 String endDate = weekMap.get("end");
536 String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + 534 String field3a24 = ReportConstant.fieldDl + "," + ReportConstant.fieldYj + "," + ReportConstant.fieldWnl;
537 "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2,WNL";
538 String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, "", startDate, endDate); 535 String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, "", startDate, endDate);
539 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", "", startDate, endDate); 536 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl, "", startDate, endDate);
540 list = mapper.getWeekReportData(startDate, endDate, dataViewName3a24, dataViewName2119); 537 list = mapper.getWeekReportData(startDate, endDate, dataViewName3a24, dataViewName2119);
541 map.put("start", startDate);//开始时间 538 map.put("start", startDate);//开始时间
542 map.put("end", endDate);//结束时间 539 map.put("end", endDate);//结束时间
......
...@@ -76,13 +76,12 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer ...@@ -76,13 +76,12 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
76 yearTbYjhjMb = Double.parseDouble(target.getTargetDrug()); 76 yearTbYjhjMb = Double.parseDouble(target.getTargetDrug());
77 } 77 }
78 } 78 }
79 String dataViewName2119Year = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, year); 79 String dataViewName2119Year = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl, departId, year);
80 String dataViewName2119YearTb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, tbYear); 80 String dataViewName2119YearTb = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl, departId, tbYear);
81 String dataViewName2119Month = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, month); 81 String dataViewName2119Month = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl, departId, month);
82 String dataViewName2119MonthTb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, tbMonth); 82 String dataViewName2119MonthTb = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl, departId, tbMonth);
83 String dataViewName2119MonthHb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, hbMonth); 83 String dataViewName2119MonthHb = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl, departId, hbMonth);
84 String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + 84 String field3a24 = ReportConstant.fieldDl+","+ ReportConstant.fieldYj;
85 "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2";
86 String dataViewName3a24Year = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, year); 85 String dataViewName3a24Year = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, year);
87 String dataViewName3a24YearTb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, tbYear); 86 String dataViewName3a24YearTb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, tbYear);
88 String dataViewName3a24Month = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, month); 87 String dataViewName3a24Month = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, month);
...@@ -236,20 +235,19 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer ...@@ -236,20 +235,19 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
236 } 235 }
237 if(target == null ) target = new ReportTargetConfig(); 236 if(target == null ) target = new ReportTargetConfig();
238 237
239 String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ,YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2"; 238 String field3a24 = ReportConstant.fieldDl+","+ ReportConstant.fieldYj;
240 String dataViewName3a24Month = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, month); 239 String dataViewName3a24Month = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, month);
241 String dataViewName3a24MonthTb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, tbMonth); 240 String dataViewName3a24MonthTb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, tbMonth);
242 String dataViewName3a24MonthHb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, hbMonth); 241 String dataViewName3a24MonthHb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, hbMonth);
243 242
244 List<YJMonthDataVO> monthDataVOList = new ArrayList<>(); 243 List<YJMonthDataVO> monthDataVOList = new ArrayList<>();
245 String dataViewName2119Month = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, month); 244 String dataViewName2119Month = ReportViewUtil.buildViewLike(ReportConstant.view2119, ReportConstant.fieldClsl, departId, month);
246 String dataViewName2119MonthTb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, tbMonth); 245 String dataViewName2119MonthTb = ReportViewUtil.buildViewLike(ReportConstant.view2119, ReportConstant.fieldClsl, departId, tbMonth);
247 String dataViewName2119MonthHb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, hbMonth); 246 String dataViewName2119MonthHb = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl, departId, hbMonth);
248 Map<String,Object> monthMap = factoryOperateCenterMapper.getSdyData(dataViewName2119Month, dataViewName3a24Month, departId, month); 247 Map<String,Object> monthMap = factoryOperateCenterMapper.getSdyData(dataViewName2119Month, dataViewName3a24Month, departId, month);
249 Map<String,Object> monthHbMap = factoryOperateCenterMapper.getSdyData(dataViewName2119MonthHb, dataViewName3a24MonthHb, departId, hbMonth); 248 Map<String,Object> monthHbMap = factoryOperateCenterMapper.getSdyData(dataViewName2119MonthHb, dataViewName3a24MonthHb, departId, hbMonth);
250 Map<String,Object> monthTbMap = factoryOperateCenterMapper.getSdyData(dataViewName2119MonthTb, dataViewName3a24MonthTb, departId, tbMonth); 249 Map<String,Object> monthTbMap = factoryOperateCenterMapper.getSdyData(dataViewName2119MonthTb, dataViewName3a24MonthTb, departId, tbMonth);
251 250
252 //String yjName, String yjCode, String yearTarge, String monthTarge, String value, String valueHB, String valueTB
253 monthDataVOList.add( new YJMonthDataVO("PAC(液)","PACYT" ,ConvertUtils.getString(target.getTargetPacyt(),"0"),ConvertUtils.getString(monthMap.get("PACYT"),"0"), 251 monthDataVOList.add( new YJMonthDataVO("PAC(液)","PACYT" ,ConvertUtils.getString(target.getTargetPacyt(),"0"),ConvertUtils.getString(monthMap.get("PACYT"),"0"),
254 ConvertUtils.getString(monthHbMap.get("PACYT"),"0") ,ConvertUtils.getString(monthTbMap.get("PACYT") ,"0") ) ); 252 ConvertUtils.getString(monthHbMap.get("PACYT"),"0") ,ConvertUtils.getString(monthTbMap.get("PACYT") ,"0") ) );
255 monthDataVOList.add( new YJMonthDataVO("PAC(固)","PACGT" ,ConvertUtils.getString(target.getTargetPacgt(),"0"),ConvertUtils.getString(monthMap.get("PACGT"),"0"), 253 monthDataVOList.add( new YJMonthDataVO("PAC(固)","PACGT" ,ConvertUtils.getString(target.getTargetPacgt(),"0"),ConvertUtils.getString(monthMap.get("PACGT"),"0"),
......
...@@ -2,6 +2,7 @@ package com.skua.modules.dataAnalysis.service.impl; ...@@ -2,6 +2,7 @@ package com.skua.modules.dataAnalysis.service.impl;
2 2
3 import com.google.common.collect.Lists; 3 import com.google.common.collect.Lists;
4 import com.google.common.collect.Maps; 4 import com.google.common.collect.Maps;
5 import com.skua.common.constant.ReportConstant;
5 import com.skua.common.report.ReportViewUtil; 6 import com.skua.common.report.ReportViewUtil;
6 import com.skua.core.api.vo.DictModel; 7 import com.skua.core.api.vo.DictModel;
7 import com.skua.core.context.BaseContextHandler; 8 import com.skua.core.context.BaseContextHandler;
...@@ -16,7 +17,6 @@ import java.util.concurrent.atomic.AtomicReference; ...@@ -16,7 +17,6 @@ import java.util.concurrent.atomic.AtomicReference;
16 17
17 @Service 18 @Service
18 public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { 19 public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
19 private static String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";
20 @Autowired 20 @Autowired
21 private WaterAnalysisNewMapper waterAnalysisNewMapper; 21 private WaterAnalysisNewMapper waterAnalysisNewMapper;
22 @Override 22 @Override
...@@ -65,8 +65,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { ...@@ -65,8 +65,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
65 public List<Map<String, Object>> queryFacListWaterQCL(String time) { 65 public List<Map<String, Object>> queryFacListWaterQCL(String time) {
66 String departIds = BaseContextHandler.getDeparts(); 66 String departIds = BaseContextHandler.getDeparts();
67 List<Map<String, Object>> result = Lists.newArrayList(); 67 List<Map<String, Object>> result = Lists.newArrayList();
68 String fields = "CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD"; 68 String dataViewName = ReportViewUtil.buildViewLike(ReportConstant.view2119, ReportConstant.fieldSz, departIds, time);
69 String dataViewName = ReportViewUtil.buildViewLike(view2119,fields, departIds, time);
70 List<Map<String, Object>> list = waterAnalysisNewMapper.queryAllFactoryList(time,departIds,dataViewName); 69 List<Map<String, Object>> list = waterAnalysisNewMapper.queryAllFactoryList(time,departIds,dataViewName);
71 if (list != null) { 70 if (list != null) {
72 for (Map<String, Object> map : list) { 71 for (Map<String, Object> map : list) {
...@@ -108,8 +107,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { ...@@ -108,8 +107,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
108 public Map<String, Object> queryWaterQCL(String time) { 107 public Map<String, Object> queryWaterQCL(String time) {
109 Map<String, Object> result = Maps.newHashMap(); 108 Map<String, Object> result = Maps.newHashMap();
110 String departIds = BaseContextHandler.getDeparts(); 109 String departIds = BaseContextHandler.getDeparts();
111 String fields = "CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD"; 110 String dataViewName = ReportViewUtil.buildViewLike(ReportConstant.view2119, ReportConstant.fieldSz, departIds, time);
112 String dataViewName = ReportViewUtil.buildViewLike(view2119,fields, departIds, time);
113 result = waterAnalysisNewMapper.queryAvgQcl(dataViewName, time, departIds); 111 result = waterAnalysisNewMapper.queryAvgQcl(dataViewName, time, departIds);
114 if(result==null){ 112 if(result==null){
115 result = new HashMap<>(); 113 result = new HashMap<>();
...@@ -122,7 +120,6 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { ...@@ -122,7 +120,6 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
122 } 120 }
123 @Override 121 @Override
124 public List<Map<String, Object>> queryCSAnalysis(String time) { 122 public List<Map<String, Object>> queryCSAnalysis(String time) {
125 String reportId = "2119ecbf53a1d2d0708258ff67cfd9e1";
126 String departIds = BaseContextHandler.getDeparts(); 123 String departIds = BaseContextHandler.getDeparts();
127 //获取负荷比例 124 //获取负荷比例
128 List<DictModel> fhData = waterAnalysisNewMapper.queryDictItemsByCode("water_analysis_proportion"); 125 List<DictModel> fhData = waterAnalysisNewMapper.queryDictItemsByCode("water_analysis_proportion");
...@@ -142,7 +139,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService { ...@@ -142,7 +139,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
142 Double finalUp = up; 139 Double finalUp = up;
143 data.forEach(v -> { 140 data.forEach(v -> {
144 String code = (String) v.get("id"); 141 String code = (String) v.get("id");
145 List<Double> datan = waterAnalysisNewMapper.queryAvgByCode(code, time, departIds, reportId); 142 List<Double> datan = waterAnalysisNewMapper.queryAvgByCode(code, time, departIds, ReportConstant.view2119);
146 if (datan != null && datan.size() > 0) { 143 if (datan != null && datan.size() > 0) {
147 DoubleSummaryStatistics statistics = datan.stream().mapToDouble(Number::doubleValue).summaryStatistics(); 144 DoubleSummaryStatistics statistics = datan.stream().mapToDouble(Number::doubleValue).summaryStatistics();
148 //取最大值 145 //取最大值
......
...@@ -2,6 +2,7 @@ package com.skua.modules.dataAnalysis.service.impl; ...@@ -2,6 +2,7 @@ package com.skua.modules.dataAnalysis.service.impl;
2 2
3 import com.google.common.collect.Lists; 3 import com.google.common.collect.Lists;
4 import com.google.common.collect.Maps; 4 import com.google.common.collect.Maps;
5 import com.skua.common.constant.ReportConstant;
5 import com.skua.common.report.ReportViewUtil; 6 import com.skua.common.report.ReportViewUtil;
6 import com.skua.core.api.vo.DictModel; 7 import com.skua.core.api.vo.DictModel;
7 import com.skua.core.context.BaseContextHandler; 8 import com.skua.core.context.BaseContextHandler;
...@@ -19,11 +20,8 @@ import java.util.Map; ...@@ -19,11 +20,8 @@ import java.util.Map;
19 20
20 @Service 21 @Service
21 public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewService { 22 public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewService {
22 private static String REPOART_ID_SL = "2119ecbf53a1d2d0708258ff67cfd9e1";
23 @Autowired 23 @Autowired
24 private WaterCountAnalysisNewMapper waterCountAnalysisNewMapper; 24 private WaterCountAnalysisNewMapper waterCountAnalysisNewMapper;
25 @Autowired
26 private ISysMonitorMetricInfoService sysMonitorMetricInfoService;
27 @Override 25 @Override
28 public Map<String, Object> querySLDeatailList(String startTime, String endTime) { 26 public Map<String, Object> querySLDeatailList(String startTime, String endTime) {
29 String departIds = BaseContextHandler.getDeparts(); 27 String departIds = BaseContextHandler.getDeparts();
...@@ -31,7 +29,7 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe ...@@ -31,7 +29,7 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
31 Map<String, Object> result = Maps.newHashMap(); 29 Map<String, Object> result = Maps.newHashMap();
32 Map<String, List<Map<String, Object>>> tmp = Maps.newTreeMap(); 30 Map<String, List<Map<String, Object>>> tmp = Maps.newTreeMap();
33 List<String> list = DateUtils.sliceUpDateRange(startTime, endTime, "year"); 31 List<String> list = DateUtils.sliceUpDateRange(startTime, endTime, "year");
34 String dataViewName = ReportViewUtil.buildView(REPOART_ID_SL,"CSL", departIds, startTime, endTime); 32 String dataViewName = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, startTime, endTime);
35 //查询年度水量数据 33 //查询年度水量数据
36 List<Map<String, Object>> facLists = waterCountAnalysisNewMapper.queryFacLists("",departIds); 34 List<Map<String, Object>> facLists = waterCountAnalysisNewMapper.queryFacLists("",departIds);
37 List<Map<String, Object>> data = waterCountAnalysisNewMapper.queryTimesSLDataByFac(dataViewName, startTime, endTime, departIds); 35 List<Map<String, Object>> data = waterCountAnalysisNewMapper.queryTimesSLDataByFac(dataViewName, startTime, endTime, departIds);
...@@ -84,7 +82,7 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe ...@@ -84,7 +82,7 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
84 @Override 82 @Override
85 public List<Map<String, Object>> queryZLSAnalysis(String time) { 83 public List<Map<String, Object>> queryZLSAnalysis(String time) {
86 String departIds = BaseContextHandler.getDeparts(); 84 String departIds = BaseContextHandler.getDeparts();
87 String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"JSL,CSL", departIds, time); 85 String dataViewName = ReportViewUtil.buildViewLike(ReportConstant.view2119,"JSL,CSL", departIds, time);
88 List<Map<String, Object>> list = new ArrayList<>(); 86 List<Map<String, Object>> list = new ArrayList<>();
89 list = waterCountAnalysisNewMapper.queryZLSAnalysis(dataViewName, time, departIds); 87 list = waterCountAnalysisNewMapper.queryZLSAnalysis(dataViewName, time, departIds);
90 return list; 88 return list;
...@@ -93,7 +91,7 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe ...@@ -93,7 +91,7 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
93 @Override 91 @Override
94 public Map<String, Object> querySLFHLAnalysis(String time) { 92 public Map<String, Object> querySLFHLAnalysis(String time) {
95 String departIds = BaseContextHandler.getDeparts(); 93 String departIds = BaseContextHandler.getDeparts();
96 String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time); 94 String dataViewName = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, time);
97 Map<String, Object> result = Maps.newHashMap(); 95 Map<String, Object> result = Maps.newHashMap();
98 List<Map<String, Object>> mets = waterCountAnalysisNewMapper.queryWaterListAllByMonth(dataViewName, time, departIds); 96 List<Map<String, Object>> mets = waterCountAnalysisNewMapper.queryWaterListAllByMonth(dataViewName, time, departIds);
99 List<Map<String, Object>> upList = Lists.newArrayList(); 97 List<Map<String, Object>> upList = Lists.newArrayList();
...@@ -154,8 +152,8 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe ...@@ -154,8 +152,8 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
154 @Override 152 @Override
155 public Map<String, Object> querySLAnalysis(String time) { 153 public Map<String, Object> querySLAnalysis(String time) {
156 String departIds = BaseContextHandler.getDeparts(); 154 String departIds = BaseContextHandler.getDeparts();
157 String thisDataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time); 155 String thisDataViewName = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, time);
158 String lastDataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, DateUtils.getLastMonthOfMonth(time)); 156 String lastDataViewName = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, DateUtils.getLastMonthOfMonth(time));
159 Map<String, Object> result = Maps.newHashMap(); 157 Map<String, Object> result = Maps.newHashMap();
160 //增长率 158 //增长率
161 List<Map<String, Object>> upData = waterCountAnalysisNewMapper.queryUpFacList(thisDataViewName, lastDataViewName, time, DateUtils.getLastMonthOfMonth(time), departIds); 159 List<Map<String, Object>> upData = waterCountAnalysisNewMapper.queryUpFacList(thisDataViewName, lastDataViewName, time, DateUtils.getLastMonthOfMonth(time), departIds);
...@@ -168,7 +166,7 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe ...@@ -168,7 +166,7 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
168 @Override 166 @Override
169 public Map<String, Object> queryTotalSLList(String time) { 167 public Map<String, Object> queryTotalSLList(String time) {
170 String departIds = BaseContextHandler.getDeparts(); 168 String departIds = BaseContextHandler.getDeparts();
171 String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time); 169 String dataViewName = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, time);
172 Map<String, Object> result = Maps.newHashMap(); 170 Map<String, Object> result = Maps.newHashMap();
173 Map<String, List<Map<String, Object>>> tmp = Maps.newTreeMap(); 171 Map<String, List<Map<String, Object>>> tmp = Maps.newTreeMap();
174 String nowYear = DateUtils.getDate("yyyy"); 172 String nowYear = DateUtils.getDate("yyyy");
...@@ -216,14 +214,14 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe ...@@ -216,14 +214,14 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
216 @Override 214 @Override
217 public Map<String, Object> queryTotalSLData(String time) { 215 public Map<String, Object> queryTotalSLData(String time) {
218 String departIds = BaseContextHandler.getDeparts(); 216 String departIds = BaseContextHandler.getDeparts();
219 String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time); 217 String dataViewName = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, time);
220 Map<String, Object> result = Maps.newHashMap(); 218 Map<String, Object> result = Maps.newHashMap();
221 StringBuilder stringBuilder = new StringBuilder(); 219 StringBuilder stringBuilder = new StringBuilder();
222 List<Map<String, Object>> data = waterCountAnalysisNewMapper.queryTotalSLData(dataViewName, time, departIds); 220 List<Map<String, Object>> data = waterCountAnalysisNewMapper.queryTotalSLData(dataViewName, time, departIds);
223 221
224 String time2 = String.valueOf(Integer.parseInt(time) - 1); 222 String time2 = String.valueOf(Integer.parseInt(time) - 1);
225 223
226 String dataViewName2 = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time2); 224 String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, time2);
227 List<Map<String, Object>> lastData = waterCountAnalysisNewMapper.queryTotalSLData(dataViewName2, time2, departIds); 225 List<Map<String, Object>> lastData = waterCountAnalysisNewMapper.queryTotalSLData(dataViewName2, time2, departIds);
228 226
229 for (int i =0 ;i<data.size();i++){ 227 for (int i =0 ;i<data.size();i++){
......
1 package com.skua.modules.job; 1 package com.skua.modules.job;
2 import com.skua.common.constant.ReportConstant;
2 import com.skua.core.util.DateUtils; 3 import com.skua.core.util.DateUtils;
3 import com.skua.modules.alarmtmp.entity.SysFactoryDevice; 4 import com.skua.modules.alarmtmp.entity.SysFactoryDevice;
4 import com.skua.modules.alarmtmp.service.ISysFactoryDeviceService; 5 import com.skua.modules.alarmtmp.service.ISysFactoryDeviceService;
...@@ -33,8 +34,6 @@ public class DayDataSyncJob implements Job { ...@@ -33,8 +34,6 @@ public class DayDataSyncJob implements Job {
33 private ISysFactoryDeviceService sysFactoryDeviceService; 34 private ISysFactoryDeviceService sysFactoryDeviceService;
34 @Autowired 35 @Autowired
35 private IReportDataService reportDataService; 36 private IReportDataService reportDataService;
36 //水质水量报表ID
37 private static final String REPORT_ID = "2119ecbf53a1d2d0708258ff67cfd9e1";
38 37
39 @Override 38 @Override
40 public void execute(JobExecutionContext jobExecutionContext) { 39 public void execute(JobExecutionContext jobExecutionContext) {
...@@ -189,9 +188,9 @@ public class DayDataSyncJob implements Job { ...@@ -189,9 +188,9 @@ public class DayDataSyncJob implements Job {
189 data.put("JSZL", ""); 188 data.put("JSZL", "");
190 } 189 }
191 data.put("departId", departId); 190 data.put("departId", departId);
192 data.put("reportId", REPORT_ID); 191 data.put("reportId", ReportConstant.view2119);
193 data.put("time",yesterday); 192 data.put("time",yesterday);
194 reportDataService.insertOrUpdateReportData(departId, yesterday, data, REPORT_ID); 193 reportDataService.insertOrUpdateReportData(departId, yesterday, data, ReportConstant.view2119);
195 } 194 }
196 } 195 }
197 } 196 }
......
1 package com.skua.modules.report.controller; 1 package com.skua.modules.report.controller;
2 2
3 import com.google.common.collect.Maps; 3 import com.google.common.collect.Maps;
4 import com.skua.common.constant.ReportConstant;
4 import com.skua.common.report.ReportViewUtil; 5 import com.skua.common.report.ReportViewUtil;
5 import com.skua.core.api.vo.Result; 6 import com.skua.core.api.vo.Result;
6 import com.skua.core.aspect.annotation.AutoLog; 7 import com.skua.core.aspect.annotation.AutoLog;
...@@ -75,7 +76,7 @@ public class ReportDataController { ...@@ -75,7 +76,7 @@ public class ReportDataController {
75 String dataViewName = ReportViewUtil.buildViewLike(reportId, "", departId, dataTime); 76 String dataViewName = ReportViewUtil.buildViewLike(reportId, "", departId, dataTime);
76 List<Map<String, Object>> valueMapList = new ArrayList<>(); 77 List<Map<String, Object>> valueMapList = new ArrayList<>();
77 if("year".equals(timeType)){ 78 if("year".equals(timeType)){
78 if("4411ed3d78634bcdcd700f6e33724025".equals(reportId)){ 79 if(ReportConstant.view4411.equals(reportId)){
79 valueMapList = fCustomReportDatasetService.getDataFromHY(dataTime, departId); 80 valueMapList = fCustomReportDatasetService.getDataFromHY(dataTime, departId);
80 }else{ 81 }else{
81 String start = dataTime + "-01-01"; 82 String start = dataTime + "-01-01";
......
1 package com.skua.modules.report.service.impl; 1 package com.skua.modules.report.service.impl;
2 2
3 import com.skua.common.constant.ReportConstant;
3 import com.skua.common.report.ReportViewUtil; 4 import com.skua.common.report.ReportViewUtil;
4 import com.skua.core.context.SpringContextUtils; 5 import com.skua.core.context.SpringContextUtils;
5 import com.skua.core.util.ConvertUtils; 6 import com.skua.core.util.ConvertUtils;
...@@ -32,10 +33,6 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -32,10 +33,6 @@ public class OperationReportServiceImpl implements IOperationReportService {
32 @Resource 33 @Resource
33 private OperationReportMapper operationReportMapper; 34 private OperationReportMapper operationReportMapper;
34 35
35 String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";// 水 COD TP TN NH3H
36 String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";//能耗报表
37 String view4411 = "4411ed3d78634bcdcd700f6e33724025";//生产运营周报
38
39 private JdbcTemplate getJdbcTemplate(){ 36 private JdbcTemplate getJdbcTemplate(){
40 JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master"); 37 JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
41 return masterDB; 38 return masterDB;
...@@ -62,7 +59,7 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -62,7 +59,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
62 59
63 String departId = null; 60 String departId = null;
64 // ysfsl:月收费水量 ; yyf:月药费 ; ysjsl:月实际水量 61 // ysfsl:月收费水量 ; yyf:月药费 ; ysjsl:月实际水量
65 String dataViewName4411 = ReportViewUtil.buildViewLike(view4411,"ysfsl,ysjsl,yyf", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime()); 62 String dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,"ysfsl,ysjsl,yyf", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime());
66 sql = "select sum( aaa.ysfsl ) 'ysfsl' , sum( aaa.ysjsl ) 'ysjsl' , sum(tc.target_water ) 'target_water', sum(tc.target_drug ) 'target_drug' ,round((sum( aaa.ysfsl ) *100 / sum(tc.target_water )),2) as 'completeRatio' from "+dataViewName4411+" aaa"; 63 sql = "select sum( aaa.ysfsl ) 'ysfsl' , sum( aaa.ysjsl ) 'ysjsl' , sum(tc.target_water ) 'target_water', sum(tc.target_drug ) 'target_drug' ,round((sum( aaa.ysfsl ) *100 / sum(tc.target_water )),2) as 'completeRatio' from "+dataViewName4411+" aaa";
67 sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year = '"+year+"')"; 64 sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year = '"+year+"')";
68 List<Map<String, Object>> mapList = getJdbcTemplate().queryForList(sql); 65 List<Map<String, Object>> mapList = getJdbcTemplate().queryForList(sql);
...@@ -93,7 +90,7 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -93,7 +90,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
93 } 90 }
94 // 去年水数据:月收费水量、月实际水量 91 // 去年水数据:月收费水量、月实际水量
95 // ysfsl:月收费水量 ; yyf:月药费 ; ysjsl:月实际水量 92 // ysfsl:月收费水量 ; yyf:月药费 ; ysjsl:月实际水量
96 dataViewName4411 = ReportViewUtil.buildViewLike(view4411,"ysfsl,ysjsl", departId, lastSeasonTimeVO.getStartTime(),lastSeasonTimeVO.getEndTime()); 93 dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,"ysfsl,ysjsl", departId, lastSeasonTimeVO.getStartTime(),lastSeasonTimeVO.getEndTime());
97 sql = "select sum( aaa.ysfsl ) 'ysfsl' , sum( aaa.ysjsl ) 'ysjsl' from "+dataViewName4411+" aaa"; 94 sql = "select sum( aaa.ysfsl ) 'ysfsl' , sum( aaa.ysjsl ) 'ysjsl' from "+dataViewName4411+" aaa";
98 95
99 if(mapList != null ){ 96 if(mapList != null ){
...@@ -113,7 +110,7 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -113,7 +110,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
113 //tqysjsl 同期月实际水量 110 //tqysjsl 同期月实际水量
114 //ysjsl 月实际水量 111 //ysjsl 月实际水量
115 // fields = "ysjsl,tqysjsl,ysjsldyqntqyy"; 112 // fields = "ysjsl,tqysjsl,ysjsldyqntqyy";
116 dataViewName4411 = ReportViewUtil.buildView(view4411,"ysjsl,tqysjsl,ysjsldyqntqyy", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime()); 113 dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"ysjsl,tqysjsl,ysjsldyqntqyy", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime());
117 // sql = "select sum( aaa.ysfsl ) 'ysfsl' , sum( aaa.ysjsl ) 'ysjsl' , sum(tc.target_water ) 'target_water' , sum(tc.target_power) 'target_power' ,round((sum( aaa.ysfsl ) *100 / sum(tc.target_water )),2) as 'completeRatio' from "+dataViewName4411+" aaa"; 114 // sql = "select sum( aaa.ysfsl ) 'ysfsl' , sum( aaa.ysjsl ) 'ysjsl' , sum(tc.target_water ) 'target_water' , sum(tc.target_power) 'target_power' ,round((sum( aaa.ysfsl ) *100 / sum(tc.target_water )),2) as 'completeRatio' from "+dataViewName4411+" aaa";
118 sql = "select round( (aaa.tqysjsl - aaa.ysjsl ) / aaa.tqysjsl ,2 ) 'ratio' , aaa.tqysjsl , aaa.ysjsl , aaa.ysjsldyqntqyy 'causeAnalysis' , d.depart_name from "+dataViewName4411 +" aaa"; 115 sql = "select round( (aaa.tqysjsl - aaa.ysjsl ) / aaa.tqysjsl ,2 ) 'ratio' , aaa.tqysjsl , aaa.ysjsl , aaa.ysjsldyqntqyy 'causeAnalysis' , d.depart_name from "+dataViewName4411 +" aaa";
119 sql += " left join sys_depart d on d.id = aaa.depart_id where aaa.tqysjsl > aaa.ysjsl"; 116 sql += " left join sys_depart d on d.id = aaa.depart_id where aaa.tqysjsl > aaa.ysjsl";
...@@ -121,7 +118,7 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -121,7 +118,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
121 productDataVO.setWaterDeptartList(waterMonthDataList); 118 productDataVO.setWaterDeptartList(waterMonthDataList);
122 119
123 //水电耗高于控制目标--水务公司列表 120 //水电耗高于控制目标--水务公司列表
124 dataViewName4411 = ReportViewUtil.buildViewLike(view4411,"ydh,qntqdh,dhgyqntqyy", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime(),"max"); 121 dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,"ydh,qntqdh,dhgyqntqyy", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime(),"max");
125 sql = "select aaa.dhgyqntqyy 'causeAnalysis' , aaa.qntqdh ,aaa.ydh 'realConsume' ,d.depart_name 'deptartName' , IFNULL(tc.target_power,'-') 'targetConsume' from " + dataViewName4411 + " aaa "; 122 sql = "select aaa.dhgyqntqyy 'causeAnalysis' , aaa.qntqdh ,aaa.ydh 'realConsume' ,d.depart_name 'deptartName' , IFNULL(tc.target_power,'-') 'targetConsume' from " + dataViewName4411 + " aaa ";
126 sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year ="+year+")"; 123 sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year ="+year+")";
127 sql += " left join sys_depart d on d.id = aaa.depart_id "; 124 sql += " left join sys_depart d on d.id = aaa.depart_id ";
...@@ -131,7 +128,7 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -131,7 +128,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
131 128
132 /** ysjsl:月实际水量 ; 月药耗 yyh; 去年同期药耗 qntqyh; 月药费 yyf;药耗高于去年同期原因 yhgyqntqyy;药耗超预期原因 yhcyqyy; 本年实际药耗 bnsjyh; 本年药耗目标 bnyhmb*/ 129 /** ysjsl:月实际水量 ; 月药耗 yyh; 去年同期药耗 qntqyh; 月药费 yyf;药耗高于去年同期原因 yhgyqntqyy;药耗超预期原因 yhcyqyy; 本年实际药耗 bnsjyh; 本年药耗目标 bnyhmb*/
133 //药剂成本高于控制目标--水务公司列表 130 //药剂成本高于控制目标--水务公司列表
134 dataViewName4411 = ReportViewUtil.buildViewLike(view4411,"ysjsl,yyh,qntqyh,qntqyh,yhgyqntqyy,bnsjyh,bnyhmb", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime(),"max"); 131 dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,"ysjsl,yyh,qntqyh,qntqyh,yhgyqntqyy,bnsjyh,bnyhmb", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime(),"max");
135 // sql = "select round((aaa.yyh/aaa.ysjsl),2) 'realConsume',aaa.ysjsl,aaa.qntqyh,aaa.qntqyh,aaa.yhgyqntqyy '',aaa.bnsjyh,aaa.bnyhmb,aaa.depart_id ,d.depart_name ,IFNULL(tc.target_drug,'-') 'targetConsume' from " + dataViewName4411 + " aaa "; 132 // sql = "select round((aaa.yyh/aaa.ysjsl),2) 'realConsume',aaa.ysjsl,aaa.qntqyh,aaa.qntqyh,aaa.yhgyqntqyy '',aaa.bnsjyh,aaa.bnyhmb,aaa.depart_id ,d.depart_name ,IFNULL(tc.target_drug,'-') 'targetConsume' from " + dataViewName4411 + " aaa ";
136 sql = "select round((aaa.yyh/aaa.ysjsl),2) 'realConsume',aaa.yhgyqntqyy 'causeAnalysis',d.depart_name 'deptartName' ,IFNULL(tc.target_drug,'-') 'targetConsume' from " + dataViewName4411 + " aaa "; 133 sql = "select round((aaa.yyh/aaa.ysjsl),2) 'realConsume',aaa.yhgyqntqyy 'causeAnalysis',d.depart_name 'deptartName' ,IFNULL(tc.target_drug,'-') 'targetConsume' from " + dataViewName4411 + " aaa ";
137 sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year ="+year+")"; 134 sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year ="+year+")";
......
...@@ -54,9 +54,9 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly ...@@ -54,9 +54,9 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
54 displayVO = new DrugConsumptionDisplayVO( CSL, tbqnCsl, tbsyCsl, zyh, hbsyzyh, tbqnzyh); 54 displayVO = new DrugConsumptionDisplayVO( CSL, tbqnCsl, tbsyCsl, zyh, hbsyzyh, tbqnzyh);
55 55
56 //历史最低吨水药耗??? 56 //历史最低吨水药耗???
57 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departId, null,null); 57 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl, departId, null,null);
58 //System.out.println("dataViewName2119 "+dataViewName2119); 58 //System.out.println("dataViewName2119 "+dataViewName2119);
59 String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, null,null); 59 String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,ReportConstant.fieldYj, departId, null,null);
60 //System.out.println("dataViewName3a24 "+dataViewName3a24); 60 //System.out.println("dataViewName3a24 "+dataViewName3a24);
61 StringBuffer sql = new StringBuffer(); 61 StringBuffer sql = new StringBuffer();
62 sql.append(" select ccc.CSL,ccc.depart_id,ccc.time,ddd.YH ,round(( ddd.YH /ccc.CSL ),2) as 'dsyh' ") ; 62 sql.append(" select ccc.CSL,ccc.depart_id,ccc.time,ddd.YH ,round(( ddd.YH /ccc.CSL ),2) as 'dsyh' ") ;
...@@ -103,40 +103,6 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly ...@@ -103,40 +103,6 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
103 chartVOList.add( chartVO ) ; 103 chartVOList.add( chartVO ) ;
104 } 104 }
105 return chartVOList; 105 return chartVOList;
106 /* String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, startTime,endTime);
107
108 StringBuffer sql2 = new StringBuffer("select DATE_FORMAT(aaa.time,'%Y-%m') 'time', ");
109 sql2.append(" round((aaa.PAMZ + aaa.PAMF+ aaa.PAMRJ+ aaa.SCLPAMZ+ aaa.SCLPAMF+ aaa.NACLO+ aaa.PACGT+ aaa.PACYT+ aaa.FESO4G+ aaa.FESO4Y+ aaa.H2O2+ aaa.CH3COOH+ aaa.SH+ aaa.FECL3+ aaa.HXT+ aaa.PFS+ aaa.CH3COONA+ aaa.GXCLJ+ aaa.YWL+ aaa.RYXNJ+ aaa.FHTY),2) 'zyh' from ");
110 sql2.append( " "+dataViewName3a24+" aaa group by DATE_FORMAT(aaa.time,'%Y-%m')");
111 System.out.println("统计药耗 ="+sql2.toString());
112 List<DrugConsumptionTrendChartVO> chartVOList = getJdbcTemplate().query(sql2.toString(),new BeanPropertyRowMapper<DrugConsumptionTrendChartVO>(DrugConsumptionTrendChartVO.class));
113
114 Map<String,DrugConsumptionTrendChartVO> chartVOMap = new HashMap<>();
115 if( chartVOList != null ){
116 for(DrugConsumptionTrendChartVO consumptionTrendChartVO : chartVOList){
117 chartVOMap.put(consumptionTrendChartVO.getTime(),consumptionTrendChartVO);
118 }
119 }
120
121 List<DrugConsumptionTrendChartVO> chartVOList1 = new ArrayList<>();
122 DrugConsumptionTrendChartVO chartVOTemp = null;
123 //查询当前时间往前推12个月的数据
124 List<String> months=this.getTwelve(time);
125 for (String month : months) {
126 String yesmonth=this.getMonthBytime(-12,month);
127
128 chartVOTemp = chartVOMap.get(month);
129 if(chartVOTemp == null ){
130 chartVOTemp = new DrugConsumptionTrendChartVO();
131 chartVOTemp.setTime( month);
132 chartVOTemp.setZyh(0.0d);
133 }
134 if(chartVOMap.get(yesmonth)!= null ){
135 chartVOTemp.setTbzyh( chartVOMap.get(yesmonth).getZyh() );
136 }
137 chartVOList1.add( chartVOTemp) ;
138 }
139 return chartVOList1;*/
140 } 106 }
141 107
142 //吨水药耗趋势 108 //吨水药耗趋势
...@@ -146,9 +112,9 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly ...@@ -146,9 +112,9 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
146 String startTime=this.getMonthBytime(-12,time)+"-01"; 112 String startTime=this.getMonthBytime(-12,time)+"-01";
147 String endTime=this.getMonthBytime(-1,time)+"-31"; 113 String endTime=this.getMonthBytime(-1,time)+"-31";
148 //历史最低吨水药耗??? 114 //历史最低吨水药耗???
149 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departId, startTime,endTime); 115 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119, ReportConstant.fieldClsl, departId, startTime,endTime);
150 //System.out.println("dataViewName2119 "+dataViewName2119); 116 //System.out.println("dataViewName2119 "+dataViewName2119);
151 String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, startTime,endTime); 117 String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, ReportConstant.fieldYj, departId, startTime,endTime);
152 //System.out.println("dataViewName3a24 "+dataViewName3a24); 118 //System.out.println("dataViewName3a24 "+dataViewName3a24);
153 StringBuffer sql = new StringBuffer(); 119 StringBuffer sql = new StringBuffer();
154 sql.append(" select ccc.CSL,ccc.depart_id,ccc.time,ddd.YH ,round((ddd.YH /ccc.CSL ),2) as 'dsyh' ") ; 120 sql.append(" select ccc.CSL,ccc.depart_id,ccc.time,ddd.YH ,round((ddd.YH /ccc.CSL ),2) as 'dsyh' ") ;
...@@ -189,7 +155,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly ...@@ -189,7 +155,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
189 public List<DrugConsumptionDisplayVO> proportionStatistics(String time,String departId){ 155 public List<DrugConsumptionDisplayVO> proportionStatistics(String time,String departId){
190 DateVO dateVO = new DateVO(time);//转换后的时间参数 156 DateVO dateVO = new DateVO(time);//转换后的时间参数
191 //本月处理水量 157 //本月处理水量
192 String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); 158 String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl, departId, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
193 Double nowMonthCSL = null;//getJdbcTemplate().queryForObject(dataViewName2119,Double.class); 159 Double nowMonthCSL = null;//getJdbcTemplate().queryForObject(dataViewName2119,Double.class);
194 List<Map<String, Object>> dataMapList = getJdbcTemplate().queryForList(dataViewName2119); 160 List<Map<String, Object>> dataMapList = getJdbcTemplate().queryForList(dataViewName2119);
195 if(dataMapList != null ){ 161 if(dataMapList != null ){
...@@ -199,7 +165,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly ...@@ -199,7 +165,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
199 } 165 }
200 166
201 //环比:上月处理水量 167 //环比:上月处理水量
202 dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); 168 dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl, departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
203 Double hbsyCsl = null;// getJdbcTemplate().queryForObject(dataViewName2119,Double.class); 169 Double hbsyCsl = null;// getJdbcTemplate().queryForObject(dataViewName2119,Double.class);
204 dataMapList = getJdbcTemplate().queryForList(dataViewName2119); 170 dataMapList = getJdbcTemplate().queryForList(dataViewName2119);
205 if(dataMapList != null ){ 171 if(dataMapList != null ){
...@@ -217,17 +183,14 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly ...@@ -217,17 +183,14 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
217 } 183 }
218 } 184 }
219 185
220
221 String fileds = "PAMZ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY";
222
223 //本月药剂 总药耗 186 //本月药剂 总药耗
224 String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,fileds, departId, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate()); 187 String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24, ReportConstant.fieldYj, departId, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
225 Map<String, Object> nowMonthDataMap =queryForMap(dataViewName3a24);// getJdbcTemplate().queryForMap(dataViewName3a24); 188 Map<String, Object> nowMonthDataMap =queryForMap(dataViewName3a24);// getJdbcTemplate().queryForMap(dataViewName3a24);
226 //环比:上月药剂 总药耗 189 //环比:上月药剂 总药耗
227 dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,fileds, departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime()); 190 dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24, ReportConstant.fieldYj, departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
228 Map<String, Object> lastMonthDataMap = queryForMap(dataViewName3a24);//getJdbcTemplate().queryForMap(dataViewName3a24); 191 Map<String, Object> lastMonthDataMap = queryForMap(dataViewName3a24);//getJdbcTemplate().queryForMap(dataViewName3a24);
229 //同比:去年本月药剂: 总药耗 192 //同比:去年本月药剂: 总药耗
230 dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,fileds, departId, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime()); 193 dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24, ReportConstant.fieldYj, departId, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime());
231 Map<String, Object> lastYearMonthDataMap = queryForMap(dataViewName3a24);//getJdbcTemplate().queryForMap(dataViewName3a24); 194 Map<String, Object> lastYearMonthDataMap = queryForMap(dataViewName3a24);//getJdbcTemplate().queryForMap(dataViewName3a24);
232 195
233 String filedsSql = "select item_code ,item_alias from f_report_item where item_code in ('PAMZ','PAMF','PAMRJ','SCLPAMZ','SCLPAMF','NACLO','PACGT','PACYT','FESO4G','FESO4Y','H2O2','CH3COOH','SH','FECL3','HXT','PFS','CH3COONA','GXCLJ','YWL','RYXNJ','FHTY') "; 196 String filedsSql = "select item_code ,item_alias from f_report_item where item_code in ('PAMZ','PAMF','PAMRJ','SCLPAMZ','SCLPAMF','NACLO','PACGT','PACYT','FESO4G','FESO4Y','H2O2','CH3COOH','SH','FECL3','HXT','PFS','CH3COONA','GXCLJ','YWL','RYXNJ','FHTY') ";
...@@ -297,12 +260,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly ...@@ -297,12 +260,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
297 CorrelationAnalysisVO correlationAnalysisVO = null; 260 CorrelationAnalysisVO correlationAnalysisVO = null;
298 if(dataList != null){ 261 if(dataList != null){
299 for(Map<String,Object> map : dataList){ 262 for(Map<String,Object> map : dataList){
300 //String time, String zyh, String dnhl, String wnl, String wnhsl
301 correlationAnalysisVO = new CorrelationAnalysisVO(ConvertUtils.getString(map.get("time")),ConvertUtils.getString(map.get("zyh")),ConvertUtils.getString(map.get("wnl")),ConvertUtils.getString(map.get("wnhsl"))); 263 correlationAnalysisVO = new CorrelationAnalysisVO(ConvertUtils.getString(map.get("time")),ConvertUtils.getString(map.get("zyh")),ConvertUtils.getString(map.get("wnl")),ConvertUtils.getString(map.get("wnhsl")));
302 /* if(map.get("time") != null ) correlationAnalysisVO.setTime(map.get("time") +"");
303 if(map.get("zyh") != null ) correlationAnalysisVO.setZyh(map.get("zyh") +"");
304 if(map.get("wnl") != null ) correlationAnalysisVO.setWnl(map.get("wnl") +"");
305 if(map.get("wnhsl") != null ) correlationAnalysisVO.setWnhsl(map.get("wnhsl") +"");*/
306 zyhMap.put(map.get("time").toString(),correlationAnalysisVO); 264 zyhMap.put(map.get("time").toString(),correlationAnalysisVO);
307 } 265 }
308 } 266 }
...@@ -328,12 +286,11 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly ...@@ -328,12 +286,11 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
328 * @return 286 * @return
329 */ 287 */
330 private Double countDSYH(String departId ,String startTime ,String endTime ){ 288 private Double countDSYH(String departId ,String startTime ,String endTime ){
331 String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, startTime,endTime); 289 String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,ReportConstant.fieldYj, departId, startTime,endTime);
332 StringBuffer sql2 = new StringBuffer("select "); 290 StringBuffer sql2 = new StringBuffer("select ");
333 sql2.append(" round((aaa.PAMZ + aaa.PAMF+ aaa.PAMRJ+ aaa.SCLPAMZ+ aaa.SCLPAMF+ aaa.NACLO+ aaa.PACGT+ aaa.PACYT+ aaa.FESO4G+ aaa.FESO4Y+ aaa.H2O2+ aaa.CH3COOH+ aaa.SH+ aaa.FECL3+ aaa.HXT+ aaa.PFS+ aaa.CH3COONA+ aaa.GXCLJ+ aaa.YWL+ aaa.RYXNJ+ aaa.FHTY),2) 'YH' from "); 291 sql2.append(" round((aaa.PAMZ + aaa.PAMF+ aaa.PAMRJ+ aaa.SCLPAMZ+ aaa.SCLPAMF+ aaa.NACLO+ aaa.PACGT+ aaa.PACYT+ aaa.FESO4G+ aaa.FESO4Y+ " +
292 "aaa.H2O2+ aaa.CH3COOH+ aaa.SH+ aaa.FECL3+ aaa.HXT+ aaa.PFS+ aaa.CH3COONA+ aaa.GXCLJ+ aaa.YWL+ aaa.RYXNJ+ aaa.FHTY),2) 'YH' from ");
334 sql2.append( " "+dataViewName3a24+" aaa "); 293 sql2.append( " "+dataViewName3a24+" aaa ");
335 // System.out.println("sql2 = "+sql2.toString());
336 // return getJdbcTemplate().queryForObject(sql2.toString(),Double.class);
337 List<Map<String, Object>> mapList = getJdbcTemplate().queryForList(sql2.toString()); 294 List<Map<String, Object>> mapList = getJdbcTemplate().queryForList(sql2.toString());
338 String YH = null; 295 String YH = null;
339 for(Map<String,Object> map : mapList ){ 296 for(Map<String,Object> map : mapList ){
......
...@@ -351,6 +351,11 @@ ...@@ -351,6 +351,11 @@
351 '${item}' 351 '${item}'
352 </foreach> 352 </foreach>
353 ) 353 )
354 OR parent_id IN ( SELECT id FROM sys_depart WHERE parent_id IN ( SELECT id FROM sys_depart WHERE parent_id IN
355 <foreach item="item" index="index" collection="departIds.split(',')" open="(" separator="," close=")">
356 '${item}'
357 </foreach>
358 ))
354 </select> 359 </select>
355 360
356 <select id="queryDepartsByIds" resultType="com.skua.modules.system.entity.SysDepart"> 361 <select id="queryDepartsByIds" resultType="com.skua.modules.system.entity.SysDepart">
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!