报表问题修改
正在显示
12 个修改的文件
包含
294 行增加
和
58 行删除
... | @@ -60,8 +60,8 @@ public class VideoController { | ... | @@ -60,8 +60,8 @@ public class VideoController { |
60 | public Result<Object> videoMessage(){ | 60 | public Result<Object> videoMessage(){ |
61 | Result<Object> result = new Result<Object>(); | 61 | Result<Object> result = new Result<Object>(); |
62 | //获取摄像头所有的列表 | 62 | //获取摄像头所有的列表 |
63 | String factoryids = BaseContextHandler.getDeparts(); | 63 | String departIds = BaseContextHandler.getDeparts(); |
64 | List<Map<String,Object>> videoList = tVideoService.queryVideoList(factoryids); | 64 | List<Map<String,Object>> videoList = tVideoService.queryVideoList(departIds); |
65 | //将业务数据转换为构造树所需的数据结构 | 65 | //将业务数据转换为构造树所需的数据结构 |
66 | List<TransTreeModel> transTreeModels = videoList.stream().map(bo -> convertToTreeModel(bo)).collect(Collectors.toList()); | 66 | List<TransTreeModel> transTreeModels = videoList.stream().map(bo -> convertToTreeModel(bo)).collect(Collectors.toList()); |
67 | //此处工具类构建树通过拼接root构造根节点 | 67 | //此处工具类构建树通过拼接root构造根节点 | ... | ... |
... | @@ -23,7 +23,7 @@ public interface TVideoMapper extends BaseMapper<TVideo> { | ... | @@ -23,7 +23,7 @@ public interface TVideoMapper extends BaseMapper<TVideo> { |
23 | 23 | ||
24 | /** | 24 | /** |
25 | * APP查询摄像头列表 | 25 | * APP查询摄像头列表 |
26 | * @param orgCode | 26 | * @param departIds |
27 | * @return | 27 | * @return |
28 | */ | 28 | */ |
29 | List<Map<String, Object>> queryVideoList(@Param("departIds") String departIds); | 29 | List<Map<String, Object>> queryVideoList(@Param("departIds") String departIds); | ... | ... |
... | @@ -73,11 +73,11 @@ | ... | @@ -73,11 +73,11 @@ |
73 | FROM | 73 | FROM |
74 | sys_depart f | 74 | sys_depart f |
75 | WHERE | 75 | WHERE |
76 | <!-- id in--> | 76 | id in |
77 | <!-- <foreach item="item" index="index" collection="departIds.split(',')" open="(" separator="," close=")">--> | 77 | <foreach item="item" index="index" collection="departIds.split(',')" open="(" separator="," close=")"> |
78 | <!-- #{item}--> | 78 | #{item} |
79 | <!-- </foreach>--> | 79 | </foreach> |
80 | <!-- and --> | 80 | and |
81 | depart_type ='1' | 81 | depart_type ='1' |
82 | UNION ALL | 82 | UNION ALL |
83 | SELECT | 83 | SELECT |
... | @@ -89,10 +89,10 @@ | ... | @@ -89,10 +89,10 @@ |
89 | 2222222 AS depart_order | 89 | 2222222 AS depart_order |
90 | FROM | 90 | FROM |
91 | t_video | 91 | t_video |
92 | <!-- where depart_id in--> | 92 | where depart_id in |
93 | <!-- <foreach item="item" index="index" collection="departIds.split(',')" open="(" separator="," close=")">--> | 93 | <foreach item="item" index="index" collection="departIds.split(',')" open="(" separator="," close=")"> |
94 | <!-- #{item}--> | 94 | #{item} |
95 | <!-- </foreach>--> | 95 | </foreach> |
96 | ) ss | 96 | ) ss |
97 | ORDER BY | 97 | ORDER BY |
98 | ss.depart_order,ss.video_name | 98 | ss.depart_order,ss.video_name | ... | ... |
... | @@ -24,7 +24,7 @@ public interface ITVideoService extends IService<TVideo> { | ... | @@ -24,7 +24,7 @@ public interface ITVideoService extends IService<TVideo> { |
24 | * @param orgCode | 24 | * @param orgCode |
25 | * @return | 25 | * @return |
26 | */ | 26 | */ |
27 | List<Map<String, Object>> queryVideoList(String orgCode); | 27 | List<Map<String, Object>> queryVideoList(String departIds); |
28 | /** | 28 | /** |
29 | * <pre> | 29 | * <pre> |
30 | * App摄像头模糊搜索 | 30 | * App摄像头模糊搜索 | ... | ... |
... | @@ -41,8 +41,8 @@ public class TVideoServiceImpl extends ServiceImpl<TVideoMapper, TVideo> impleme | ... | @@ -41,8 +41,8 @@ public class TVideoServiceImpl extends ServiceImpl<TVideoMapper, TVideo> impleme |
41 | } | 41 | } |
42 | 42 | ||
43 | @Override | 43 | @Override |
44 | public List<Map<String, Object>> queryVideoList(String orgCode) { | 44 | public List<Map<String, Object>> queryVideoList(String departIds) { |
45 | return tVideoMapper.queryVideoList(orgCode); | 45 | return tVideoMapper.queryVideoList(departIds); |
46 | } | 46 | } |
47 | 47 | ||
48 | @Override | 48 | @Override | ... | ... |
sk-module-datafill/src/main/java/com/skua/modules/custom/handle/impl/YynbReportHandle.java
0 → 100644
此文件的差异被折叠,
点击展开。
1 | package com.skua.modules.custom.handle.impl; | 1 | package com.skua.modules.custom.handle.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.common.report.entity.ValueEntity; | 5 | import com.skua.common.report.entity.ValueEntity; |
5 | import com.skua.core.context.SpringContextUtils; | 6 | import com.skua.core.context.SpringContextUtils; |
6 | import com.skua.core.util.ConvertUtils; | 7 | import com.skua.core.util.ConvertUtils; |
8 | import com.skua.modules.common.service.ICommonSqlService; | ||
7 | import com.skua.modules.custom.handle.ICustomHandle; | 9 | import com.skua.modules.custom.handle.ICustomHandle; |
8 | import com.skua.modules.custom.service.IFCustomReportDatasetService; | 10 | import com.skua.modules.custom.service.IFCustomReportDatasetService; |
9 | import com.skua.modules.custom.vo.FCustomReportDatasetVO; | 11 | import com.skua.modules.custom.vo.FCustomReportDatasetVO; |
... | @@ -32,53 +34,46 @@ public class YyybReportHandle implements ICustomHandle{ | ... | @@ -32,53 +34,46 @@ public class YyybReportHandle implements ICustomHandle{ |
32 | private IFCustomReportDatasetService fCustomReportDatasetService; | 34 | private IFCustomReportDatasetService fCustomReportDatasetService; |
33 | @Resource | 35 | @Resource |
34 | private IFactoryCenterService factoryCenterService; | 36 | private IFactoryCenterService factoryCenterService; |
35 | 37 | @Autowired | |
38 | private ICommonSqlService commonSqlService; | ||
36 | 39 | ||
37 | @Override | 40 | @Override |
38 | public Map<String, List<Map<String, ValueEntity>>> buildDataMap(String reportId, String startTime, String endTime, | 41 | public Map<String, List<Map<String, ValueEntity>>> buildDataMap(String reportId, String startTime, String endTime, |
39 | String departId,String indexCode) { | 42 | String departId,String indexCode) { |
40 | List<String> timeList = DateUtils.getDatesBetween(startTime, endTime); | 43 | List<String> timeList = DateUtils.getDatesBetween(startTime, endTime); |
41 | Map<String, Object> levelMap = factoryCenterService.getMonitorThreshold(departId); | 44 | Map<String, Object> levelMap = factoryCenterService.getMonitorThreshold(departId); |
45 | String departIds = commonSqlService.getChildDepartId(departId); | ||
42 | Map<String,List<Map<String,ValueEntity>>> resMap = new HashMap<String,List<Map<String,ValueEntity>>>(); | 46 | Map<String,List<Map<String,ValueEntity>>> resMap = new HashMap<String,List<Map<String,ValueEntity>>>(); |
43 | Map<String,List<Map<String,ValueEntity>>> dataMap = new HashMap<String,List<Map<String,ValueEntity>>>(); | 47 | Map<String,List<Map<String,ValueEntity>>> dataMap = new HashMap<String,List<Map<String,ValueEntity>>>(); |
44 | //获取数据集 | 48 | //获取数据集 |
45 | List<FCustomReportDatasetVO> dataSetList = fCustomReportDatasetService.getDataset(reportId); | ||
46 | for(FCustomReportDatasetVO fv : dataSetList) { | ||
47 | String dataSetId = fv.getDatasetId(); | ||
48 | //获取填报数据及报表数据项信息,组装报表所需数据机构 | 49 | //获取填报数据及报表数据项信息,组装报表所需数据机构 |
49 | List<Map<String,ValueEntity>> list = new ArrayList<Map<String,ValueEntity>>(); | 50 | List<Map<String,ValueEntity>> list = new ArrayList<Map<String,ValueEntity>>(); |
51 | //获取填报数据 | ||
52 | String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"", departIds, startTime, endTime); | ||
50 | //根据数据集id获取数据项及填报数据 | 53 | //根据数据集id获取数据项及填报数据 |
51 | List<FCustomReportDatasetVO> dataFieldList = fCustomReportDatasetService.getDataField(dataSetId); | 54 | List<FCustomReportDatasetVO> dataFieldList1 = fCustomReportDatasetService.getDataField(ReportConstant.view3a24); |
52 | Map<String,String> dataFieldDict = new HashMap<String,String>(); | 55 | Map<String,String> dataFieldDict = new HashMap<String,String>(); |
53 | for(FCustomReportDatasetVO dataField : dataFieldList) { | 56 | for(FCustomReportDatasetVO dataField : dataFieldList1) { |
57 | dataFieldDict.put(dataField.getDatasetId(), dataField.getDatasetName()); | ||
58 | } | ||
59 | List<FCustomReportDatasetVO> dataFieldList2 = fCustomReportDatasetService.getDataField(ReportConstant.view2119); | ||
60 | for(FCustomReportDatasetVO dataField : dataFieldList2) { | ||
54 | dataFieldDict.put(dataField.getDatasetId(), dataField.getDatasetName()); | 61 | dataFieldDict.put(dataField.getDatasetId(), dataField.getDatasetName()); |
55 | } | 62 | } |
56 | //添加厂站、时间字段 | 63 | //添加厂站、时间字段 |
57 | dataFieldDict.put("depart_name", "厂站名称"); | 64 | dataFieldDict.put("depart_name", "厂站名称"); |
58 | dataFieldDict.put("time", "时间"); | 65 | dataFieldDict.put("time", "时间"); |
59 | dataFieldDict.put("paramTime", "参数时间"); | 66 | dataFieldDict.put("paramTime", "参数时间"); |
60 | //获取填报数据 | 67 | String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"", departIds, startTime, endTime); |
61 | String dataViewName = ReportViewUtil.buildView(dataSetId,"", departId, startTime,endTime); | ||
62 | //结果集 | 68 | //结果集 |
63 | List<Map<String, Object>> valueMapList = fCustomReportDatasetService.queryReportValue(dataViewName,startTime,endTime,departId); | 69 | List<Map<String, Object>> szMapList = fCustomReportDatasetService.querySzYyybReport(dataViewName2119, startTime, endTime, departIds); |
64 | for(Map<String,Object> valueMap : valueMapList) { | 70 | list = changeDataList(szMapList,list,startTime,dataFieldDict); |
65 | Map<String,ValueEntity> handleMap = new HashMap<String,ValueEntity>(); | 71 | dataMap.put("水质水量报表", list); |
66 | //添加时间参数 | 72 | |
67 | ValueEntity startTimeValueEntity = new ValueEntity(); | 73 | List<Map<String, Object>> nhMapList = fCustomReportDatasetService.queryNhYyybReport(dataViewName3a24, startTime, endTime, departIds); |
68 | startTimeValueEntity.setValue(startTime); | 74 | list = changeDataList(nhMapList,list,startTime,dataFieldDict); |
69 | handleMap.put("参数时间", startTimeValueEntity); | 75 | dataMap.put("能耗报表", list); |
70 | Set<String> keySet = valueMap.keySet(); | 76 | |
71 | for(String key : keySet) { | ||
72 | if(!StringUtils.isEmpty(dataFieldDict.get(key))) { | ||
73 | ValueEntity valueEntity = new ValueEntity(); | ||
74 | valueEntity.setValue(ConvertUtils.getString(valueMap.get(key))); | ||
75 | handleMap.put(dataFieldDict.get(key),valueEntity); | ||
76 | } | ||
77 | } | ||
78 | list.add(handleMap); | ||
79 | } | ||
80 | dataMap.put(fv.getDatasetName(), list); | ||
81 | } | ||
82 | List<Map<String,ValueEntity>> dList = new ArrayList<>(); | 77 | List<Map<String,ValueEntity>> dList = new ArrayList<>(); |
83 | for (String time: timeList) { | 78 | for (String time: timeList) { |
84 | Map<String,ValueEntity> newDataMap = new HashMap<>(); | 79 | Map<String,ValueEntity> newDataMap = new HashMap<>(); |
... | @@ -86,8 +81,8 @@ public class YyybReportHandle implements ICustomHandle{ | ... | @@ -86,8 +81,8 @@ public class YyybReportHandle implements ICustomHandle{ |
86 | valueEntity.setValue(time); | 81 | valueEntity.setValue(time); |
87 | newDataMap.put("时间", valueEntity); | 82 | newDataMap.put("时间", valueEntity); |
88 | for (Map.Entry<String, List<Map<String,ValueEntity>>> entry : dataMap.entrySet()) { | 83 | for (Map.Entry<String, List<Map<String,ValueEntity>>> entry : dataMap.entrySet()) { |
89 | List<Map<String,ValueEntity>> list = entry.getValue(); | 84 | List<Map<String,ValueEntity>> dataList = entry.getValue(); |
90 | for (Map<String,ValueEntity> dMap: list) { | 85 | for (Map<String,ValueEntity> dMap: dataList) { |
91 | if(time.equals(dMap.get("时间").getValue())){ | 86 | if(time.equals(dMap.get("时间").getValue())){ |
92 | if(levelMap!=null){ | 87 | if(levelMap!=null){ |
93 | dMap = changeDataColor(dMap,levelMap); | 88 | dMap = changeDataColor(dMap,levelMap); |
... | @@ -107,6 +102,35 @@ public class YyybReportHandle implements ICustomHandle{ | ... | @@ -107,6 +102,35 @@ public class YyybReportHandle implements ICustomHandle{ |
107 | } | 102 | } |
108 | 103 | ||
109 | /** | 104 | /** |
105 | * 构造LIST | ||
106 | * @param szMapList | ||
107 | * @param list | ||
108 | * @param startTime | ||
109 | * @param dataFieldDict | ||
110 | * @return | ||
111 | */ | ||
112 | private List<Map<String, ValueEntity>> changeDataList(List<Map<String, Object>> szMapList, List<Map<String, ValueEntity>> list, | ||
113 | String startTime, Map<String, String> dataFieldDict) { | ||
114 | for(Map<String,Object> valueMap : szMapList) { | ||
115 | Map<String,ValueEntity> handleMap = new HashMap<String,ValueEntity>(); | ||
116 | //添加时间参数 | ||
117 | ValueEntity startTimeValueEntity = new ValueEntity(); | ||
118 | startTimeValueEntity.setValue(startTime); | ||
119 | handleMap.put("参数时间", startTimeValueEntity); | ||
120 | Set<String> keySet = valueMap.keySet(); | ||
121 | for(String key : keySet) { | ||
122 | if(!StringUtils.isEmpty(dataFieldDict.get(key))) { | ||
123 | ValueEntity valueEntity = new ValueEntity(); | ||
124 | valueEntity.setValue(ConvertUtils.getString(valueMap.get(key))); | ||
125 | handleMap.put(dataFieldDict.get(key),valueEntity); | ||
126 | } | ||
127 | } | ||
128 | list.add(handleMap); | ||
129 | } | ||
130 | return list; | ||
131 | } | ||
132 | |||
133 | /** | ||
110 | * 指标变色 | 134 | * 指标变色 |
111 | * @param map | 135 | * @param map |
112 | * @param levelMap | 136 | * @param levelMap |
... | @@ -117,7 +141,7 @@ public class YyybReportHandle implements ICustomHandle{ | ... | @@ -117,7 +141,7 @@ public class YyybReportHandle implements ICustomHandle{ |
117 | String key = entry.getKey(); | 141 | String key = entry.getKey(); |
118 | ValueEntity value = entry.getValue(); | 142 | ValueEntity value = entry.getValue(); |
119 | if("进水COD".equals(key)){ | 143 | if("进水COD".equals(key)){ |
120 | if(levelMap.get("JSCOD")!=null){ | 144 | if(ConvertUtils.isNotEmpty(levelMap.get("JSCOD"))){ |
121 | if(ConvertUtils.isNotEmpty(value.getValue())){ | 145 | if(ConvertUtils.isNotEmpty(value.getValue())){ |
122 | double v = Double.parseDouble(value.getValue()); | 146 | double v = Double.parseDouble(value.getValue()); |
123 | double l = Double.parseDouble(levelMap.get("JSCOD").toString()); | 147 | double l = Double.parseDouble(levelMap.get("JSCOD").toString()); |
... | @@ -129,7 +153,7 @@ public class YyybReportHandle implements ICustomHandle{ | ... | @@ -129,7 +153,7 @@ public class YyybReportHandle implements ICustomHandle{ |
129 | } | 153 | } |
130 | } | 154 | } |
131 | if("出水COD".equals(key)){ | 155 | if("出水COD".equals(key)){ |
132 | if(levelMap.get("CSCOD")!=null){ | 156 | if(ConvertUtils.isNotEmpty(levelMap.get("CSCOD"))){ |
133 | if(ConvertUtils.isNotEmpty(value.getValue())){ | 157 | if(ConvertUtils.isNotEmpty(value.getValue())){ |
134 | double v = Double.parseDouble(value.getValue()); | 158 | double v = Double.parseDouble(value.getValue()); |
135 | double l = Double.parseDouble(levelMap.get("CSCOD").toString()); | 159 | double l = Double.parseDouble(levelMap.get("CSCOD").toString()); |
... | @@ -141,7 +165,7 @@ public class YyybReportHandle implements ICustomHandle{ | ... | @@ -141,7 +165,7 @@ public class YyybReportHandle implements ICustomHandle{ |
141 | } | 165 | } |
142 | } | 166 | } |
143 | if("进水氨氮".equals(key)){ | 167 | if("进水氨氮".equals(key)){ |
144 | if(levelMap.get("JSNH3N")!=null){ | 168 | if(ConvertUtils.isNotEmpty(levelMap.get("JSNH3N"))){ |
145 | if(ConvertUtils.isNotEmpty(value.getValue())){ | 169 | if(ConvertUtils.isNotEmpty(value.getValue())){ |
146 | double v = Double.parseDouble(value.getValue()); | 170 | double v = Double.parseDouble(value.getValue()); |
147 | double l = Double.parseDouble(levelMap.get("JSNH3N").toString()); | 171 | double l = Double.parseDouble(levelMap.get("JSNH3N").toString()); |
... | @@ -153,7 +177,7 @@ public class YyybReportHandle implements ICustomHandle{ | ... | @@ -153,7 +177,7 @@ public class YyybReportHandle implements ICustomHandle{ |
153 | } | 177 | } |
154 | } | 178 | } |
155 | if("出水氨氮".equals(key)){ | 179 | if("出水氨氮".equals(key)){ |
156 | if(levelMap.get("CSNH3N")!=null){ | 180 | if(ConvertUtils.isNotEmpty(levelMap.get("CSNH3N"))){ |
157 | if(ConvertUtils.isNotEmpty(value.getValue())){ | 181 | if(ConvertUtils.isNotEmpty(value.getValue())){ |
158 | double v = Double.parseDouble(value.getValue()); | 182 | double v = Double.parseDouble(value.getValue()); |
159 | double l = Double.parseDouble(levelMap.get("CSNH3N").toString()); | 183 | double l = Double.parseDouble(levelMap.get("CSNH3N").toString()); |
... | @@ -165,7 +189,7 @@ public class YyybReportHandle implements ICustomHandle{ | ... | @@ -165,7 +189,7 @@ public class YyybReportHandle implements ICustomHandle{ |
165 | } | 189 | } |
166 | } | 190 | } |
167 | if("进水总氮".equals(key)){ | 191 | if("进水总氮".equals(key)){ |
168 | if(levelMap.get("JSTN")!=null){ | 192 | if(ConvertUtils.isNotEmpty(levelMap.get("JSTN"))){ |
169 | if(ConvertUtils.isNotEmpty(value.getValue())){ | 193 | if(ConvertUtils.isNotEmpty(value.getValue())){ |
170 | double v = Double.parseDouble(value.getValue()); | 194 | double v = Double.parseDouble(value.getValue()); |
171 | double l = Double.parseDouble(levelMap.get("JSTN").toString()); | 195 | double l = Double.parseDouble(levelMap.get("JSTN").toString()); |
... | @@ -177,7 +201,7 @@ public class YyybReportHandle implements ICustomHandle{ | ... | @@ -177,7 +201,7 @@ public class YyybReportHandle implements ICustomHandle{ |
177 | } | 201 | } |
178 | } | 202 | } |
179 | if("出水总氮".equals(key)){ | 203 | if("出水总氮".equals(key)){ |
180 | if(levelMap.get("CSTN")!=null){ | 204 | if(ConvertUtils.isNotEmpty(levelMap.get("CSTN"))){ |
181 | if(ConvertUtils.isNotEmpty(value.getValue())){ | 205 | if(ConvertUtils.isNotEmpty(value.getValue())){ |
182 | double v = Double.parseDouble(value.getValue()); | 206 | double v = Double.parseDouble(value.getValue()); |
183 | double l = Double.parseDouble(levelMap.get("CSTN").toString()); | 207 | double l = Double.parseDouble(levelMap.get("CSTN").toString()); |
... | @@ -189,7 +213,7 @@ public class YyybReportHandle implements ICustomHandle{ | ... | @@ -189,7 +213,7 @@ public class YyybReportHandle implements ICustomHandle{ |
189 | } | 213 | } |
190 | } | 214 | } |
191 | if("进水总磷".equals(key)){ | 215 | if("进水总磷".equals(key)){ |
192 | if(levelMap.get("JSTP")!=null){ | 216 | if(ConvertUtils.isNotEmpty(levelMap.get("JSTP"))){ |
193 | if(ConvertUtils.isNotEmpty(value.getValue())){ | 217 | if(ConvertUtils.isNotEmpty(value.getValue())){ |
194 | double v = Double.parseDouble(value.getValue()); | 218 | double v = Double.parseDouble(value.getValue()); |
195 | double l = Double.parseDouble(levelMap.get("JSTP").toString()); | 219 | double l = Double.parseDouble(levelMap.get("JSTP").toString()); |
... | @@ -201,7 +225,7 @@ public class YyybReportHandle implements ICustomHandle{ | ... | @@ -201,7 +225,7 @@ public class YyybReportHandle implements ICustomHandle{ |
201 | } | 225 | } |
202 | } | 226 | } |
203 | if("出水总磷".equals(key)){ | 227 | if("出水总磷".equals(key)){ |
204 | if(levelMap.get("CSTP")!=null){ | 228 | if(ConvertUtils.isNotEmpty(levelMap.get("CSTP"))){ |
205 | if(ConvertUtils.isNotEmpty(value.getValue())){ | 229 | if(ConvertUtils.isNotEmpty(value.getValue())){ |
206 | double v = Double.parseDouble(value.getValue()); | 230 | double v = Double.parseDouble(value.getValue()); |
207 | double l = Double.parseDouble(levelMap.get("CSTP").toString()); | 231 | double l = Double.parseDouble(levelMap.get("CSTP").toString()); |
... | @@ -213,7 +237,7 @@ public class YyybReportHandle implements ICustomHandle{ | ... | @@ -213,7 +237,7 @@ public class YyybReportHandle implements ICustomHandle{ |
213 | } | 237 | } |
214 | } | 238 | } |
215 | if("进水pH".equals(key)){ | 239 | if("进水pH".equals(key)){ |
216 | if(levelMap.get("JSPH")!=null){ | 240 | if(ConvertUtils.isNotEmpty(levelMap.get("JSPH"))){ |
217 | if(ConvertUtils.isNotEmpty(value.getValue())){ | 241 | if(ConvertUtils.isNotEmpty(value.getValue())){ |
218 | double v = Double.parseDouble(value.getValue()); | 242 | double v = Double.parseDouble(value.getValue()); |
219 | double l = Double.parseDouble(levelMap.get("JSPH").toString()); | 243 | double l = Double.parseDouble(levelMap.get("JSPH").toString()); |
... | @@ -225,7 +249,7 @@ public class YyybReportHandle implements ICustomHandle{ | ... | @@ -225,7 +249,7 @@ public class YyybReportHandle implements ICustomHandle{ |
225 | } | 249 | } |
226 | } | 250 | } |
227 | if("出水pH".equals(key)){ | 251 | if("出水pH".equals(key)){ |
228 | if(levelMap.get("CSPH")!=null){ | 252 | if(ConvertUtils.isNotEmpty(levelMap.get("CSPH"))){ |
229 | if(ConvertUtils.isNotEmpty(value.getValue())){ | 253 | if(ConvertUtils.isNotEmpty(value.getValue())){ |
230 | double v = Double.parseDouble(value.getValue()); | 254 | double v = Double.parseDouble(value.getValue()); |
231 | double l = Double.parseDouble(levelMap.get("CSPH").toString()); | 255 | double l = Double.parseDouble(levelMap.get("CSPH").toString()); |
... | @@ -237,7 +261,7 @@ public class YyybReportHandle implements ICustomHandle{ | ... | @@ -237,7 +261,7 @@ public class YyybReportHandle implements ICustomHandle{ |
237 | } | 261 | } |
238 | } | 262 | } |
239 | if("进水SS".equals(key)){ | 263 | if("进水SS".equals(key)){ |
240 | if(levelMap.get("JSSS")!=null){ | 264 | if(ConvertUtils.isNotEmpty(levelMap.get("JSSS"))){ |
241 | if(ConvertUtils.isNotEmpty(value.getValue())){ | 265 | if(ConvertUtils.isNotEmpty(value.getValue())){ |
242 | double v = Double.parseDouble(value.getValue()); | 266 | double v = Double.parseDouble(value.getValue()); |
243 | double l = Double.parseDouble(levelMap.get("JSSS").toString()); | 267 | double l = Double.parseDouble(levelMap.get("JSSS").toString()); |
... | @@ -249,7 +273,7 @@ public class YyybReportHandle implements ICustomHandle{ | ... | @@ -249,7 +273,7 @@ public class YyybReportHandle implements ICustomHandle{ |
249 | } | 273 | } |
250 | } | 274 | } |
251 | if("出水SS".equals(key)){ | 275 | if("出水SS".equals(key)){ |
252 | if(levelMap.get("CSSS")!=null){ | 276 | if(ConvertUtils.isNotEmpty(levelMap.get("CSSS"))){ |
253 | if(ConvertUtils.isNotEmpty(value.getValue())){ | 277 | if(ConvertUtils.isNotEmpty(value.getValue())){ |
254 | double v = Double.parseDouble(value.getValue()); | 278 | double v = Double.parseDouble(value.getValue()); |
255 | double l = Double.parseDouble(levelMap.get("CSSS").toString()); | 279 | double l = Double.parseDouble(levelMap.get("CSSS").toString()); | ... | ... |
... | @@ -120,4 +120,20 @@ public interface FCustomReportDatasetMapper extends BaseMapper<FCustomReportData | ... | @@ -120,4 +120,20 @@ public interface FCustomReportDatasetMapper extends BaseMapper<FCustomReportData |
120 | 120 | ||
121 | List<JnhbReportDetailsHj> getHjList(@Param(value="dataViewName2") String dataViewName2, @Param(value="dataViewName3") String dataViewName3, | 121 | List<JnhbReportDetailsHj> getHjList(@Param(value="dataViewName2") String dataViewName2, @Param(value="dataViewName3") String dataViewName3, |
122 | @Param(value="departId") String departId, @Param(value="year") String year); | 122 | @Param(value="departId") String departId, @Param(value="year") String year); |
123 | |||
124 | List<Map<String, Object>> querySzYynbReport(@Param(value="dataViewName2119") String dataViewName2119, | ||
125 | @Param(value="startTime")String startTime, @Param(value="endTime")String endTime, | ||
126 | @Param(value="departId") String departId); | ||
127 | |||
128 | List<Map<String, Object>> queryNhYynbReport(@Param(value="dataViewName3a24") String dataViewName3a24, | ||
129 | @Param(value="startTime") String startTime, @Param(value="endTime") String endTime, | ||
130 | @Param(value="departId") String departId); | ||
131 | |||
132 | List<Map<String, Object>> querySzYyybReport(@Param(value="dataViewName2119") String dataViewName2119, | ||
133 | @Param(value="startTime")String startTime, @Param(value="endTime")String endTime, | ||
134 | @Param(value="departId") String departId); | ||
135 | |||
136 | List<Map<String, Object>> queryNhYyybReport(@Param(value="dataViewName3a24") String dataViewName3a24, | ||
137 | @Param(value="startTime") String startTime, @Param(value="endTime") String endTime, | ||
138 | @Param(value="departId") String departId); | ||
123 | } | 139 | } | ... | ... |
... | @@ -512,4 +512,169 @@ | ... | @@ -512,4 +512,169 @@ |
512 | GROUP BY | 512 | GROUP BY |
513 | LEFT ( v.time, 7 ) | 513 | LEFT ( v.time, 7 ) |
514 | </select> | 514 | </select> |
515 | |||
516 | <select id="querySzYynbReport" resultType="java.util.HashMap"> | ||
517 | SELECT | ||
518 | ROUND( SUM( v.JSL ), 2 ) AS `JSL`, | ||
519 | ROUND( SUM( v.CSL ), 2 ) AS `CSL`, | ||
520 | ROUND( AVG( v.JSPH ), 2 ) AS `JSPH`, | ||
521 | ROUND( AVG( v.CSPH ), 2 ) AS `CSPH`, | ||
522 | ROUND( AVG( v.JSCOD ), 2 ) AS `JSCOD`, | ||
523 | ROUND( AVG( v.CSCOD ), 2 ) AS `CSCOD`, | ||
524 | ROUND( AVG( v.CSTN ), 2 ) AS `CSTN`, | ||
525 | ROUND( AVG( v.JSZD ), 2 ) AS `JSZD`, | ||
526 | ROUND( AVG( v.JSZL ), 2 ) AS `JSZL`, | ||
527 | ROUND( AVG( v.CSZL ), 2 ) AS `CSZL`, | ||
528 | ROUND( AVG( v.JSAD ), 2 ) AS `JSAD`, | ||
529 | ROUND( AVG( v.CSAD ), 2 ) AS `CSAD`, | ||
530 | ROUND( AVG( v.JSSS ), 2 ) AS `JSSS`, | ||
531 | ROUND( AVG( v.CSSS ), 2 ) AS `CSSS`, | ||
532 | v.BZ, | ||
533 | v.depart_id, | ||
534 | LEFT ( v.time, 7 ) AS time | ||
535 | FROM | ||
536 | ${dataViewName2119} v | ||
537 | WHERE | ||
538 | v.depart_id IN | ||
539 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
540 | '${item}' | ||
541 | </foreach> | ||
542 | AND v.time >= #{startTime} | ||
543 | AND v.time <= #{endTime} | ||
544 | GROUP BY | ||
545 | LEFT ( v.time, 7 ) | ||
546 | </select> | ||
547 | |||
548 | <select id="queryNhYynbReport" resultType="java.util.HashMap"> | ||
549 | SELECT | ||
550 | SUM(v3.PFS) AS PFS, | ||
551 | SUM(v3.FHTY) AS FHTY, | ||
552 | SUM(v3.RYXNJ) AS RYXNJ, | ||
553 | SUM(v3.YWL) AS YWL, | ||
554 | SUM(v3.GXCLJ) AS GXCLJ, | ||
555 | SUM(v3.CH3COONA) AS CH3COONA, | ||
556 | SUM(v3.HXT) AS HXT, | ||
557 | SUM(v3.FECL3) AS FECL3, | ||
558 | SUM(v3.SH) AS SH, | ||
559 | SUM(v3.CH3COOH) AS CH3COOH, | ||
560 | SUM(v3.FESO4G) AS FESO4G, | ||
561 | SUM(v3.FESO4Y) AS FESO4Y, | ||
562 | SUM(v3.H2O2) AS H2O2, | ||
563 | SUM(v3.GFFDL) AS GFFDL, | ||
564 | SUM(v3.QY) AS QY, | ||
565 | SUM(v3.GFCZL) AS GFCZL, | ||
566 | SUM(v3.WNHSL) AS WNHSL, | ||
567 | SUM(v3.WFCSL) AS WFCSL, | ||
568 | SUM(v3.WFCZL) AS WFCZL, | ||
569 | SUM(v3.DLJZ) AS DLJZ, | ||
570 | SUM(v3.GFSYL) AS GFSYL, | ||
571 | SUM(v3.WNL) AS WNL, | ||
572 | SUM(v3.DLFZ) AS DLFZ, | ||
573 | SUM(v3.DLPZ) AS DLPZ, | ||
574 | SUM(v3.DLGZ) AS DLGZ, | ||
575 | SUM(v3.DLHJ) AS DLHJ, | ||
576 | SUM(v3.YSL) AS YSL, | ||
577 | SUM(v3.PAMZ) AS PAMZ, | ||
578 | SUM(v3.PAMF) AS PAMF, | ||
579 | SUM(v3.PAMRJ) AS PAMRJ, | ||
580 | SUM(v3.SCLPAMZ) AS SCLPAMZ, | ||
581 | SUM(v3.SCLPAMF) AS SCLPAMF, | ||
582 | SUM(v3.NACLO) AS NACLO, | ||
583 | SUM(v3.PACGT) AS PACGT, | ||
584 | SUM(v3.PACYT) AS PACYT, | ||
585 | v3.BZ AS BZ, | ||
586 | v3.depart_id AS depart_id, | ||
587 | LEFT(v3.time,7) AS time | ||
588 | FROM ${dataViewName3a24} v3 | ||
589 | WHERE | ||
590 | v3.depart_id IN | ||
591 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
592 | '${item}' | ||
593 | </foreach> | ||
594 | AND v3.time >= #{startTime} | ||
595 | AND v3.time <= #{endTime} | ||
596 | GROUP BY LEFT(v3.time,7) | ||
597 | </select> | ||
598 | |||
599 | <select id="querySzYyybReport" resultType="java.util.HashMap"> | ||
600 | SELECT | ||
601 | ROUND( SUM( v.JSL ), 2 ) AS `JSL`, | ||
602 | ROUND( SUM( v.CSL ), 2 ) AS `CSL`, | ||
603 | ROUND( AVG( v.JSPH ), 2 ) AS `JSPH`, | ||
604 | ROUND( AVG( v.CSPH ), 2 ) AS `CSPH`, | ||
605 | ROUND( AVG( v.JSCOD ), 2 ) AS `JSCOD`, | ||
606 | ROUND( AVG( v.CSCOD ), 2 ) AS `CSCOD`, | ||
607 | ROUND( AVG( v.CSTN ), 2 ) AS `CSTN`, | ||
608 | ROUND( AVG( v.JSZD ), 2 ) AS `JSZD`, | ||
609 | ROUND( AVG( v.JSZL ), 2 ) AS `JSZL`, | ||
610 | ROUND( AVG( v.CSZL ), 2 ) AS `CSZL`, | ||
611 | ROUND( AVG( v.JSAD ), 2 ) AS `JSAD`, | ||
612 | ROUND( AVG( v.CSAD ), 2 ) AS `CSAD`, | ||
613 | ROUND( AVG( v.JSSS ), 2 ) AS `JSSS`, | ||
614 | ROUND( AVG( v.CSSS ), 2 ) AS `CSSS`, | ||
615 | v.BZ, | ||
616 | v.depart_id, | ||
617 | v.time | ||
618 | FROM | ||
619 | ${dataViewName2119} v | ||
620 | WHERE | ||
621 | v.depart_id IN | ||
622 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
623 | '${item}' | ||
624 | </foreach> | ||
625 | AND v.time >= #{startTime} | ||
626 | AND v.time <= #{endTime} | ||
627 | GROUP BY v.time | ||
628 | </select> | ||
629 | |||
630 | <select id="queryNhYyybReport" resultType="java.util.HashMap"> | ||
631 | SELECT | ||
632 | SUM(v3.PFS) AS PFS, | ||
633 | SUM(v3.FHTY) AS FHTY, | ||
634 | SUM(v3.RYXNJ) AS RYXNJ, | ||
635 | SUM(v3.YWL) AS YWL, | ||
636 | SUM(v3.GXCLJ) AS GXCLJ, | ||
637 | SUM(v3.CH3COONA) AS CH3COONA, | ||
638 | SUM(v3.HXT) AS HXT, | ||
639 | SUM(v3.FECL3) AS FECL3, | ||
640 | SUM(v3.SH) AS SH, | ||
641 | SUM(v3.CH3COOH) AS CH3COOH, | ||
642 | SUM(v3.FESO4G) AS FESO4G, | ||
643 | SUM(v3.FESO4Y) AS FESO4Y, | ||
644 | SUM(v3.H2O2) AS H2O2, | ||
645 | SUM(v3.GFFDL) AS GFFDL, | ||
646 | SUM(v3.QY) AS QY, | ||
647 | SUM(v3.GFCZL) AS GFCZL, | ||
648 | SUM(v3.WNHSL) AS WNHSL, | ||
649 | SUM(v3.WFCSL) AS WFCSL, | ||
650 | SUM(v3.WFCZL) AS WFCZL, | ||
651 | SUM(v3.DLJZ) AS DLJZ, | ||
652 | SUM(v3.GFSYL) AS GFSYL, | ||
653 | SUM(v3.WNL) AS WNL, | ||
654 | SUM(v3.DLFZ) AS DLFZ, | ||
655 | SUM(v3.DLPZ) AS DLPZ, | ||
656 | SUM(v3.DLGZ) AS DLGZ, | ||
657 | SUM(v3.DLHJ) AS DLHJ, | ||
658 | SUM(v3.YSL) AS YSL, | ||
659 | SUM(v3.PAMZ) AS PAMZ, | ||
660 | SUM(v3.PAMF) AS PAMF, | ||
661 | SUM(v3.PAMRJ) AS PAMRJ, | ||
662 | SUM(v3.SCLPAMZ) AS SCLPAMZ, | ||
663 | SUM(v3.SCLPAMF) AS SCLPAMF, | ||
664 | SUM(v3.NACLO) AS NACLO, | ||
665 | SUM(v3.PACGT) AS PACGT, | ||
666 | SUM(v3.PACYT) AS PACYT, | ||
667 | v3.BZ AS BZ, | ||
668 | v3.depart_id AS depart_id, | ||
669 | v3.time | ||
670 | FROM ${dataViewName3a24} v3 | ||
671 | WHERE | ||
672 | v3.depart_id IN | ||
673 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
674 | '${item}' | ||
675 | </foreach> | ||
676 | AND v3.time >= #{startTime} | ||
677 | AND v3.time <= #{endTime} | ||
678 | GROUP BY v3.time | ||
679 | </select> | ||
515 | </mapper> | 680 | </mapper> | ... | ... |
... | @@ -129,4 +129,11 @@ public interface IFCustomReportDatasetService extends IService<FCustomReportData | ... | @@ -129,4 +129,11 @@ public interface IFCustomReportDatasetService extends IService<FCustomReportData |
129 | */ | 129 | */ |
130 | List<ResultNumberVO> jnhbLargeScreenShowResultNumber(String departIds, String time); | 130 | List<ResultNumberVO> jnhbLargeScreenShowResultNumber(String departIds, String time); |
131 | 131 | ||
132 | List<Map<String, Object>> querySzYynbReport(String dataViewName2119, String startTime, String endTime, String departId); | ||
133 | |||
134 | List<Map<String, Object>> queryNhYynbReport(String dataViewName3a24, String startTime, String endTime, String departId); | ||
135 | |||
136 | List<Map<String, Object>> querySzYyybReport(String dataViewName2119, String startTime, String endTime, String departId); | ||
137 | |||
138 | List<Map<String, Object>> queryNhYyybReport(String dataViewName3a24, String startTime, String endTime, String departId); | ||
132 | } | 139 | } | ... | ... |
... | @@ -430,6 +430,30 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -430,6 +430,30 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
430 | return reduceStatisticsList; | 430 | return reduceStatisticsList; |
431 | } | 431 | } |
432 | 432 | ||
433 | @Override | ||
434 | public List<Map<String, Object>> querySzYynbReport(String dataViewName2119, String startTime, String endTime, String departId) { | ||
435 | List<Map<String, Object>> list = mapper.querySzYynbReport(dataViewName2119, startTime, endTime, departId); | ||
436 | return list; | ||
437 | } | ||
438 | |||
439 | @Override | ||
440 | public List<Map<String, Object>> queryNhYynbReport(String dataViewName3a24, String startTime, String endTime, String departId) { | ||
441 | List<Map<String, Object>> list = mapper.queryNhYynbReport(dataViewName3a24, startTime, endTime, departId); | ||
442 | return list; | ||
443 | } | ||
444 | |||
445 | @Override | ||
446 | public List<Map<String, Object>> querySzYyybReport(String dataViewName2119, String startTime, String endTime, String departId) { | ||
447 | List<Map<String, Object>> list = mapper.querySzYyybReport(dataViewName2119, startTime, endTime, departId); | ||
448 | return list; | ||
449 | } | ||
450 | |||
451 | @Override | ||
452 | public List<Map<String, Object>> queryNhYyybReport(String dataViewName3a24, String startTime, String endTime, String departId) { | ||
453 | List<Map<String, Object>> list = mapper.queryNhYyybReport(dataViewName3a24, startTime, endTime, departId); | ||
454 | return list; | ||
455 | } | ||
456 | |||
433 | /**转换为Map<部门编号,JnhbReportData> */ | 457 | /**转换为Map<部门编号,JnhbReportData> */ |
434 | private Map<String,JnhbReportData> convertJnhbReportDataMap(List<JnhbReportData> dataList){// Map<部门编号,JnhbReportData> | 458 | private Map<String,JnhbReportData> convertJnhbReportDataMap(List<JnhbReportData> dataList){// Map<部门编号,JnhbReportData> |
435 | Map<String,JnhbReportData> dataMap = new HashMap<>(); | 459 | Map<String,JnhbReportData> dataMap = new HashMap<>(); | ... | ... |
... | @@ -51,8 +51,8 @@ public class FCustomReportInfoServiceImpl extends ServiceImpl<FCustomReportInfoM | ... | @@ -51,8 +51,8 @@ public class FCustomReportInfoServiceImpl extends ServiceImpl<FCustomReportInfoM |
51 | //获取自定义报表对象 | 51 | //获取自定义报表对象 |
52 | FCustomReportInfo reportInfo = this.getById(reportId); | 52 | FCustomReportInfo reportInfo = this.getById(reportId); |
53 | if("3".equals(reportInfo.getReportTimeQueryType())){//年 | 53 | if("3".equals(reportInfo.getReportTimeQueryType())){//年 |
54 | startTime = startTime + "-01-01"; | 54 | startTime = startTime + "-01"; |
55 | endTime = endTime + "-12-31"; | 55 | endTime = endTime + "-31"; |
56 | }else if("2".equals(reportInfo.getReportTimeQueryType())){//月 | 56 | }else if("2".equals(reportInfo.getReportTimeQueryType())){//月 |
57 | startTime = startTime + "-01"; | 57 | startTime = startTime + "-01"; |
58 | endTime = endTime + "-31"; | 58 | endTime = endTime + "-31"; | ... | ... |
-
请 注册 或 登录 后发表评论