报表问题修改
正在显示
13 个修改的文件
包含
288 行增加
和
159 行删除
... | @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ... | @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
4 | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; | 4 | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
5 | import com.baomidou.mybatisplus.core.toolkit.Constants; | 5 | import com.baomidou.mybatisplus.core.toolkit.Constants; |
6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
7 | import com.skua.modules.common.vo.DepartVO; | ||
7 | import com.skua.tool.annotation.Anonymous; | 8 | import com.skua.tool.annotation.Anonymous; |
8 | import org.apache.ibatis.annotations.Param; | 9 | import org.apache.ibatis.annotations.Param; |
9 | 10 | ||
... | @@ -59,4 +60,6 @@ public interface CommonSqlMapper { | ... | @@ -59,4 +60,6 @@ public interface CommonSqlMapper { |
59 | String getChildDeparts(@Param(value="departId") String departId); | 60 | String getChildDeparts(@Param(value="departId") String departId); |
60 | 61 | ||
61 | String getChildDepartByUserId(@Param(value="userId") String userId); | 62 | String getChildDepartByUserId(@Param(value="userId") String userId); |
63 | |||
64 | List<DepartVO> getChildDepartList(@Param(value="departId") String departId); | ||
62 | } | 65 | } | ... | ... |
... | @@ -121,4 +121,28 @@ | ... | @@ -121,4 +121,28 @@ |
121 | from sys_user_depart | 121 | from sys_user_depart |
122 | where user_id = #{userId} | 122 | where user_id = #{userId} |
123 | </select> | 123 | </select> |
124 | |||
125 | <select id="getChildDepartList" resultType="com.skua.modules.common.vo.DepartVO"> | ||
126 | SELECT | ||
127 | id as depart_id, | ||
128 | depart_name | ||
129 | FROM | ||
130 | sys_depart | ||
131 | WHERE | ||
132 | depart_type = '1' | ||
133 | AND ( | ||
134 | parent_id IN | ||
135 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
136 | '${item}' | ||
137 | </foreach> | ||
138 | OR id IN | ||
139 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
140 | '${item}' | ||
141 | </foreach> | ||
142 | OR parent_id IN ( SELECT id FROM sys_depart WHERE parent_id IN | ||
143 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
144 | '${item}' | ||
145 | </foreach> | ||
146 | )) | ||
147 | </select> | ||
124 | </mapper> | 148 | </mapper> | ... | ... |
... | @@ -3,6 +3,8 @@ package com.skua.modules.common.service; | ... | @@ -3,6 +3,8 @@ package com.skua.modules.common.service; |
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
4 | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; | 4 | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
6 | import com.skua.modules.common.vo.DepartVO; | ||
7 | |||
6 | import java.util.List; | 8 | import java.util.List; |
7 | import java.util.Map; | 9 | import java.util.Map; |
8 | 10 | ||
... | @@ -47,4 +49,6 @@ public interface ICommonSqlService { | ... | @@ -47,4 +49,6 @@ public interface ICommonSqlService { |
47 | String getChildDepartId( String departId); | 49 | String getChildDepartId( String departId); |
48 | 50 | ||
49 | String getChildFactorys(String departId); | 51 | String getChildFactorys(String departId); |
52 | |||
53 | List<DepartVO> getChildDepartList(String departId); | ||
50 | } | 54 | } | ... | ... |
... | @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; | ... | @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
6 | import com.skua.modules.common.mapper.CommonSqlMapper; | 6 | import com.skua.modules.common.mapper.CommonSqlMapper; |
7 | import com.skua.modules.common.service.ICommonSqlService; | 7 | import com.skua.modules.common.service.ICommonSqlService; |
8 | import com.skua.modules.common.vo.DepartVO; | ||
8 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
9 | 10 | ||
10 | import javax.annotation.Resource; | 11 | import javax.annotation.Resource; |
... | @@ -96,4 +97,10 @@ public class CommonSqlServiceImpl implements ICommonSqlService { | ... | @@ -96,4 +97,10 @@ public class CommonSqlServiceImpl implements ICommonSqlService { |
96 | return commonSqlMapper.getChildFactorys(departId); | 97 | return commonSqlMapper.getChildFactorys(departId); |
97 | } | 98 | } |
98 | 99 | ||
100 | @Override | ||
101 | public List<DepartVO> getChildDepartList(String departId) { | ||
102 | List<DepartVO> list = commonSqlMapper.getChildDepartList(departId); | ||
103 | return list; | ||
104 | } | ||
105 | |||
99 | } | 106 | } | ... | ... |
... | @@ -115,24 +115,26 @@ public class AjhMeetingSendController { | ... | @@ -115,24 +115,26 @@ public class AjhMeetingSendController { |
115 | LocalDateTime nowTime = LocalDateTime.now(); | 115 | LocalDateTime nowTime = LocalDateTime.now(); |
116 | List<AjhMeetingSend> list = ajhMeetingSendService.list(); | 116 | List<AjhMeetingSend> list = ajhMeetingSendService.list(); |
117 | List<AjhMeetingSend> newList = new ArrayList<>(); | 117 | List<AjhMeetingSend> newList = new ArrayList<>(); |
118 | for (AjhMeetingSend ajhMeetingSend : list) { | 118 | if(list.size() > 0){ |
119 | if(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetStartTime())&& | 119 | for (AjhMeetingSend ajhMeetingSend : list) { |
120 | ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetEndTime())){ | 120 | if(ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetStartTime())&& |
121 | String start = ajhMeetingSend.getMeetStartTime(); | 121 | ConvertUtils.isNotEmpty(ajhMeetingSend.getMeetEndTime())){ |
122 | String end = ajhMeetingSend.getMeetEndTime(); | 122 | String start = ajhMeetingSend.getMeetStartTime(); |
123 | LocalDateTime startTime = LocalDateTime.parse(start, formatter); | 123 | String end = ajhMeetingSend.getMeetEndTime(); |
124 | LocalDateTime endTime = LocalDateTime.parse(end, formatter); | 124 | LocalDateTime startTime = LocalDateTime.parse(start, formatter); |
125 | if (nowTime.isBefore(startTime)) { | 125 | LocalDateTime endTime = LocalDateTime.parse(end, formatter); |
126 | ajhMeetingSend.setMeetStatus(0); | 126 | if (nowTime.isBefore(startTime)) { |
127 | } else if (nowTime.isAfter(endTime)) { | 127 | ajhMeetingSend.setMeetStatus(0); |
128 | ajhMeetingSend.setMeetStatus(2); | 128 | } else if (nowTime.isAfter(endTime)) { |
129 | } else { | 129 | ajhMeetingSend.setMeetStatus(2); |
130 | ajhMeetingSend.setMeetStatus(1); | 130 | } else { |
131 | ajhMeetingSend.setMeetStatus(1); | ||
132 | } | ||
133 | newList.add(ajhMeetingSend); | ||
131 | } | 134 | } |
132 | newList.add(ajhMeetingSend); | ||
133 | } | 135 | } |
136 | ajhMeetingSendService.updateBatchById(newList); | ||
134 | } | 137 | } |
135 | ajhMeetingSendService.updateBatchById(newList); | ||
136 | } | 138 | } |
137 | 139 | ||
138 | @AutoLog(value = "会议记录-数量统计") | 140 | @AutoLog(value = "会议记录-数量统计") | ... | ... |
... | @@ -94,7 +94,7 @@ public class AjhMeetingSend { | ... | @@ -94,7 +94,7 @@ public class AjhMeetingSend { |
94 | @Dict(dicCode = "accept_flag") | 94 | @Dict(dicCode = "accept_flag") |
95 | private String acceptFlag; | 95 | private String acceptFlag; |
96 | /**发布状态(0未发布,1已发布,2已撤销)*/ | 96 | /**发布状态(0未发布,1已发布,2已撤销)*/ |
97 | @Excel(name = "发布状态(0未发布,1已发布,2已撤销)", width = 15 ,dicCode = "meet_status" ,orderNum = "10") | 97 | @Excel(name = "发布状态", width = 15 ,dicCode = "meet_status" ,orderNum = "10") |
98 | @ApiModelProperty(value = "发布状态(0未发布,1已发布,2已撤销)") | 98 | @ApiModelProperty(value = "发布状态(0未发布,1已发布,2已撤销)") |
99 | @Dict(dicCode = "meet_status") | 99 | @Dict(dicCode = "meet_status") |
100 | private String sendStatus; | 100 | private String sendStatus; | ... | ... |
... | @@ -6,6 +6,11 @@ import java.util.List; | ... | @@ -6,6 +6,11 @@ import java.util.List; |
6 | import java.util.Map; | 6 | import java.util.Map; |
7 | import java.util.Set; | 7 | import java.util.Set; |
8 | 8 | ||
9 | import com.skua.common.constant.ReportConstant; | ||
10 | import com.skua.modules.common.service.ICommonSqlService; | ||
11 | import com.skua.modules.common.vo.DepartVO; | ||
12 | import com.skua.modules.dataAnalysis.service.IFactoryCenterService; | ||
13 | import com.skua.tool.util.DateUtils; | ||
9 | import org.apache.commons.lang.StringUtils; | 14 | import org.apache.commons.lang.StringUtils; |
10 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
11 | import org.springframework.jdbc.core.JdbcTemplate; | 16 | import org.springframework.jdbc.core.JdbcTemplate; |
... | @@ -20,6 +25,8 @@ import com.skua.modules.custom.handle.ICustomHandle; | ... | @@ -20,6 +25,8 @@ import com.skua.modules.custom.handle.ICustomHandle; |
20 | import com.skua.modules.custom.service.IFCustomReportDatasetService; | 25 | import com.skua.modules.custom.service.IFCustomReportDatasetService; |
21 | import com.skua.modules.custom.vo.FCustomReportDatasetVO; | 26 | import com.skua.modules.custom.vo.FCustomReportDatasetVO; |
22 | 27 | ||
28 | import javax.annotation.Resource; | ||
29 | |||
23 | /** | 30 | /** |
24 | * <pre> | 31 | * <pre> |
25 | * 运营日报自定义逻辑 | 32 | * 运营日报自定义逻辑 |
... | @@ -31,155 +38,105 @@ import com.skua.modules.custom.vo.FCustomReportDatasetVO; | ... | @@ -31,155 +38,105 @@ import com.skua.modules.custom.vo.FCustomReportDatasetVO; |
31 | public class YyrbReportHandle implements ICustomHandle{ | 38 | public class YyrbReportHandle implements ICustomHandle{ |
32 | @Autowired | 39 | @Autowired |
33 | private IFCustomReportDatasetService fCustomReportDatasetService; | 40 | private IFCustomReportDatasetService fCustomReportDatasetService; |
41 | @Autowired | ||
42 | private ICommonSqlService commonSqlService; | ||
43 | |||
34 | @Override | 44 | @Override |
35 | public Map<String, List<Map<String, ValueEntity>>> buildDataMap(String reportId, String startTime, String endTime, | 45 | public Map<String, List<Map<String, ValueEntity>>> buildDataMap(String reportId, String startTime, String endTime, |
36 | String departId,String indexCode) { | 46 | String departId,String indexCode) { |
37 | //主库数据源 | 47 | String departIds = ""; |
38 | JdbcTemplate masterDB = (JdbcTemplate)SpringContextUtils.getBean("master"); | 48 | List<DepartVO> departList = commonSqlService.getChildDepartList(departId); |
39 | 49 | for (DepartVO departVO : departList) { | |
40 | Map<String,List<Map<String,ValueEntity>>> dataMap = new HashMap<String,List<Map<String,ValueEntity>>>(); | 50 | departIds = departVO.getDepartId() + "," + departIds; |
41 | //获取数据集 | ||
42 | List<FCustomReportDatasetVO> dataSetList = fCustomReportDatasetService.getDataset(reportId); | ||
43 | for(FCustomReportDatasetVO fv : dataSetList) { | ||
44 | String dataSetId = fv.getDatasetId(); | ||
45 | //获取填报数据及报表数据项信息,组装报表所需数据机构 | ||
46 | List<Map<String,ValueEntity>> list = new ArrayList<Map<String,ValueEntity>>(); | ||
47 | //根据数据集id获取数据项及填报数据 | ||
48 | List<FCustomReportDatasetVO> dataFieldList = fCustomReportDatasetService.getDataField(dataSetId); | ||
49 | Map<String,String> dataFieldDict = new HashMap<String,String>(); | ||
50 | for(FCustomReportDatasetVO dataField : dataFieldList) { | ||
51 | dataFieldDict.put(dataField.getDatasetId(), dataField.getDatasetName()); | ||
52 | } | ||
53 | //添加厂站、时间字段 | ||
54 | dataFieldDict.put("depart_name", "厂站名称"); | ||
55 | dataFieldDict.put("time", "时间"); | ||
56 | dataFieldDict.put("paramTime", "参数时间"); | ||
57 | |||
58 | //获取填报数据 | ||
59 | //String dataViewName = "view_"+dataSetId.substring(0,4); | ||
60 | String dataViewName = ReportViewUtil.buildView(dataSetId,"", departId, startTime, endTime); | ||
61 | //结果集 | ||
62 | List<Map<String, Object>> valueMapList = fCustomReportDatasetService.queryReportValue(dataViewName,startTime,endTime,departId); | ||
63 | for(Map<String,Object> valueMap : valueMapList) { | ||
64 | Map<String,ValueEntity> handleMap = new HashMap<String,ValueEntity>(); | ||
65 | //添加时间参数 | ||
66 | ValueEntity startTimeValueEntity = new ValueEntity(); | ||
67 | startTimeValueEntity.setValue(startTime); | ||
68 | handleMap.put("参数时间", startTimeValueEntity); | ||
69 | Set<String> keySet = valueMap.keySet(); | ||
70 | for(String key : keySet) { | ||
71 | if(!StringUtils.isEmpty(dataFieldDict.get(key))) { | ||
72 | ValueEntity valueEntity = new ValueEntity(); | ||
73 | valueEntity.setValue(ConvertUtils.getString(valueMap.get(key))); | ||
74 | handleMap.put(dataFieldDict.get(key),valueEntity); | ||
75 | } | ||
76 | } | ||
77 | list.add(handleMap); | ||
78 | } | ||
79 | dataMap.put(fv.getDatasetName(), list); | ||
80 | } | 51 | } |
81 | 52 | String[] departIdArray = departIds.split(","); | |
82 | List<Map<String,ValueEntity>> bzList = new ArrayList<Map<String,ValueEntity>>(); | 53 | Map<String,List<Map<String,ValueEntity>>> resMap = new HashMap<String,List<Map<String,ValueEntity>>>(); |
83 | Map<String,ValueEntity> bzMap = new HashMap<String,ValueEntity>(); | 54 | Map<String,List<Map<String,ValueEntity>>> dataMap = new HashMap<String,List<Map<String,ValueEntity>>>(); |
84 | bzList.add(bzMap); | 55 | //获取填报数据及报表数据项信息,组装报表所需数据机构 |
85 | dataMap.put("水质标准", bzList); | 56 | List<Map<String,ValueEntity>> list = new ArrayList<Map<String,ValueEntity>>(); |
86 | //添加进出水标准及污泥含水率 | 57 | //根据数据集id获取数据项及填报数据 |
87 | //获取污泥含水率 | 58 | List<FCustomReportDatasetVO> dataFieldList1 = fCustomReportDatasetService.getDataField(ReportConstant.view3a24); |
88 | List<Map<String, Object>> moistureRateList = masterDB.queryForList("select moisture_rate from sys_factory_info where depart_id='"+departId+"'"); | 59 | Map<String,String> dataFieldDict = new HashMap<String,String>(); |
89 | Map<String,Object> moistureRateMap = new HashMap<String,Object>(); | 60 | for(FCustomReportDatasetVO dataField : dataFieldList1) { |
90 | if(moistureRateList!=null&&moistureRateList.size()>0) { | 61 | dataFieldDict.put(dataField.getDatasetId(), dataField.getDatasetName()); |
91 | moistureRateMap = moistureRateList.get(0); | ||
92 | } | 62 | } |
93 | String wnhsl = ConvertUtils.getString(moistureRateMap.get("moisture_rate"), "-"); | 63 | List<FCustomReportDatasetVO> dataFieldList2 = fCustomReportDatasetService.getDataField(ReportConstant.view2119); |
94 | 64 | for(FCustomReportDatasetVO dataField : dataFieldList2) { | |
95 | ValueEntity wnhslValueEntity = new ValueEntity(); | 65 | dataFieldDict.put(dataField.getDatasetId(), dataField.getDatasetName()); |
96 | wnhslValueEntity.setValue(wnhsl=="-"?"-":"≤"+wnhsl); | ||
97 | bzMap.put("污泥含水率", wnhslValueEntity); | ||
98 | |||
99 | //获取进水 | ||
100 | Map<String,Object> inLevelMap = new HashMap<String,Object>(); | ||
101 | List<Map<String, Object>> inLevelList = masterDB.queryForList("select index_code,upper from water_quality_in_level where depart_id='"+departId+"'"); | ||
102 | if(inLevelList!=null&&inLevelList.size()>0) { | ||
103 | for(Map<String,Object> map :inLevelList) { | ||
104 | inLevelMap.put(String.valueOf(map.get("index_code")), map.get("upper")); | ||
105 | } | ||
106 | } | 66 | } |
107 | String jscod = ConvertUtils.getString(inLevelMap.get("JSCOD"), "-"); | 67 | //添加厂站、时间字段 |
108 | ValueEntity jscodValueEntity = new ValueEntity(); | 68 | dataFieldDict.put("depart_name", "机构名称"); |
109 | jscodValueEntity.setValue(jscod=="-"?"-":"≤"+jscod); | 69 | dataFieldDict.put("time", "时间"); |
110 | bzMap.put("进水化学需氧量 CODcr", jscodValueEntity); | 70 | dataFieldDict.put("paramDepart", "参数机构"); |
111 | String jsbod = ConvertUtils.getString(inLevelMap.get("JSBOD"), "-"); | 71 | dataFieldDict.put("depart_id", "机构编码"); |
112 | ValueEntity jsbodValueEntity = new ValueEntity(); | 72 | //获取填报数据 |
113 | jsbodValueEntity.setValue(jsbod=="-"?"-":"≤"+jsbod); | 73 | String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"", departIds, startTime, endTime); |
114 | bzMap.put("进水五日生化需氧量BOD5", jsbodValueEntity); | 74 | String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"", departIds, startTime, endTime); |
115 | 75 | //结果集 | |
116 | String jsss = ConvertUtils.getString(inLevelMap.get("JSSS"), "-"); | 76 | List<Map<String, Object>> szMapList = fCustomReportDatasetService.querySzYyrbReport(dataViewName2119, startTime, endTime, departIds); |
117 | ValueEntity jsssValueEntity = new ValueEntity(); | 77 | list = changeDataList(szMapList,list,startTime,dataFieldDict); |
118 | jsssValueEntity.setValue(jsss=="-"?"-":"≤"+jsss); | 78 | dataMap.put("水质水量报表", list); |
119 | bzMap.put("进水悬浮固体SS", jsssValueEntity); | 79 | |
120 | 80 | List<Map<String, Object>> nhMapList = fCustomReportDatasetService.queryNhYyrbReport(dataViewName3a24, startTime, endTime, departIds); | |
121 | String jsnh3n = ConvertUtils.getString(inLevelMap.get("JSNH3N"), "-"); | 81 | list = changeDataList(nhMapList,list,startTime,dataFieldDict); |
122 | ValueEntity jsnh3nValueEntity = new ValueEntity(); | 82 | dataMap.put("能耗报表", list); |
123 | jsnh3nValueEntity.setValue(jsnh3n=="-"?"-":"≤"+jsnh3n); | 83 | |
124 | bzMap.put("进水氨氮NH₃-N", jsnh3nValueEntity); | 84 | List<Map<String,ValueEntity>> dList = new ArrayList<>(); |
125 | 85 | for (DepartVO departVO : departList) { | |
126 | String jstn = ConvertUtils.getString(inLevelMap.get("JSTN"), "-"); | 86 | String departStr = departVO.getDepartId(); |
127 | ValueEntity jstnValueEntity = new ValueEntity(); | 87 | Map<String,ValueEntity> newDataMap = new HashMap<>(); |
128 | jstnValueEntity.setValue(jstn=="-"?"-":"≤"+jstn); | 88 | ValueEntity codeEntity = new ValueEntity(); |
129 | bzMap.put("进水总氮TN", jstnValueEntity); | 89 | codeEntity.setValue(departStr); |
130 | 90 | newDataMap.put("机构编码", codeEntity); | |
131 | String jstp = ConvertUtils.getString(inLevelMap.get("JSTP"), "-"); | 91 | ValueEntity nameEntity = new ValueEntity(); |
132 | ValueEntity jstpValueEntity = new ValueEntity(); | 92 | nameEntity.setValue(departVO.getDepartName()); |
133 | jstpValueEntity.setValue(jstp=="-"?"-":"≤"+jstp); | 93 | newDataMap.put("机构名称", nameEntity); |
134 | bzMap.put("进水总磷TP", jstpValueEntity); | 94 | for (Map.Entry<String, List<Map<String,ValueEntity>>> entry : dataMap.entrySet()) { |
135 | 95 | List<Map<String,ValueEntity>> dataList = entry.getValue(); | |
136 | 96 | for (Map<String,ValueEntity> dMap: dataList) { | |
137 | 97 | if(departStr.equals(dMap.get("机构编码").getValue())){ | |
138 | //获取出水 | 98 | newDataMap.putAll(dMap); |
139 | Map<String,Object> outLevelMap = new HashMap<String,Object>(); | 99 | } |
140 | List<Map<String, Object>> outLevelList = masterDB.queryForList("select a.id,b.alarm_param_code as index_code,b.alarm_param_upper_limit as upper,alarm_param_lower_limit from alarm_level_standard_config a left join alarm_param_standard_config b\r\n" + | 100 | } |
141 | "on a.id=b.alarm_level_standard_id where a.alarm_standard_level_code=(select out_level from sys_factory_info where depart_id='"+departId+"')"); | ||
142 | if(outLevelList!=null&&outLevelList.size()>0) { | ||
143 | for(Map<String,Object> map :outLevelList) { | ||
144 | outLevelMap.put(String.valueOf(map.get("index_code")), map.get("upper")); | ||
145 | } | 101 | } |
102 | dList.add(newDataMap); | ||
146 | } | 103 | } |
147 | 104 | resMap.put("综合数据源", dList); | |
148 | String cscod = ConvertUtils.getString(outLevelMap.get("CSCOD"), "-"); | 105 | return resMap; |
149 | ValueEntity cscodValueEntity = new ValueEntity(); | ||
150 | cscodValueEntity.setValue(cscod=="-"?"-":"≤"+cscod); | ||
151 | bzMap.put("出水化学需氧量 CODcr", cscodValueEntity); | ||
152 | |||
153 | String csbod = ConvertUtils.getString(outLevelMap.get("CSBOD"), "-"); | ||
154 | ValueEntity csbodValueEntity = new ValueEntity(); | ||
155 | csbodValueEntity.setValue(csbod=="-"?"-":"≤"+csbod); | ||
156 | bzMap.put("出水五日生化需氧量BOD5", csbodValueEntity); | ||
157 | |||
158 | String csss = ConvertUtils.getString(outLevelMap.get("CSSS"), "-"); | ||
159 | ValueEntity csssValueEntity = new ValueEntity(); | ||
160 | csssValueEntity.setValue(csss=="-"?"-":"≤"+csss); | ||
161 | bzMap.put("出水悬浮固体SS", csssValueEntity); | ||
162 | |||
163 | String csnh3n = ConvertUtils.getString(outLevelMap.get("CSNH3N"), "-"); | ||
164 | ValueEntity csnh3nValueEntity = new ValueEntity(); | ||
165 | csnh3nValueEntity.setValue(csnh3n=="-"?"-":"≤"+csnh3n); | ||
166 | bzMap.put("出水氨氮NH₃-N", csnh3nValueEntity); | ||
167 | |||
168 | String cstn = ConvertUtils.getString(outLevelMap.get("CSTN"), "-"); | ||
169 | ValueEntity cstnValueEntity = new ValueEntity(); | ||
170 | cstnValueEntity.setValue(cstn=="-"?"-":"≤"+cstn); | ||
171 | bzMap.put("出水总氮TN", cstnValueEntity); | ||
172 | |||
173 | String cstp = ConvertUtils.getString(outLevelMap.get("CSTP"), "-"); | ||
174 | ValueEntity cstpValueEntity = new ValueEntity(); | ||
175 | cstpValueEntity.setValue(cstp=="-"?"-":"≤"+cstp); | ||
176 | bzMap.put("出水总磷TP", cstpValueEntity); | ||
177 | |||
178 | return dataMap; | ||
179 | } | 106 | } |
107 | |||
180 | @Override | 108 | @Override |
181 | public String buildWaterQualityAlarmValue(String reportId, String departId, String json) { | 109 | public String buildWaterQualityAlarmValue(String reportId, String departId, String json) { |
182 | return json; | 110 | return json; |
183 | } | 111 | } |
184 | 112 | ||
113 | /** | ||
114 | * 构造LIST | ||
115 | * @param szMapList | ||
116 | * @param list | ||
117 | * @param startTime | ||
118 | * @param dataFieldDict | ||
119 | * @return | ||
120 | */ | ||
121 | private List<Map<String, ValueEntity>> changeDataList(List<Map<String, Object>> szMapList, List<Map<String, ValueEntity>> list, | ||
122 | String startTime, Map<String, String> dataFieldDict) { | ||
123 | for(Map<String,Object> valueMap : szMapList) { | ||
124 | Map<String,ValueEntity> handleMap = new HashMap<String,ValueEntity>(); | ||
125 | //添加时间参数 | ||
126 | ValueEntity startTimeValueEntity = new ValueEntity(); | ||
127 | startTimeValueEntity.setValue(startTime); | ||
128 | handleMap.put("参数机构", startTimeValueEntity); | ||
129 | Set<String> keySet = valueMap.keySet(); | ||
130 | for(String key : keySet) { | ||
131 | if(!StringUtils.isEmpty(dataFieldDict.get(key))) { | ||
132 | ValueEntity valueEntity = new ValueEntity(); | ||
133 | valueEntity.setValue(ConvertUtils.getString(valueMap.get(key))); | ||
134 | handleMap.put(dataFieldDict.get(key),valueEntity); | ||
135 | } | ||
136 | } | ||
137 | list.add(handleMap); | ||
138 | } | ||
139 | return list; | ||
140 | } | ||
141 | |||
185 | } | 142 | } | ... | ... |
... | @@ -136,4 +136,12 @@ public interface FCustomReportDatasetMapper extends BaseMapper<FCustomReportData | ... | @@ -136,4 +136,12 @@ public interface FCustomReportDatasetMapper extends BaseMapper<FCustomReportData |
136 | List<Map<String, Object>> queryNhYyybReport(@Param(value="dataViewName3a24") String dataViewName3a24, | 136 | List<Map<String, Object>> queryNhYyybReport(@Param(value="dataViewName3a24") String dataViewName3a24, |
137 | @Param(value="startTime") String startTime, @Param(value="endTime") String endTime, | 137 | @Param(value="startTime") String startTime, @Param(value="endTime") String endTime, |
138 | @Param(value="departId") String departId); | 138 | @Param(value="departId") String departId); |
139 | |||
140 | List<Map<String, Object>> querySzYyrbReport(@Param(value="dataViewName2119") String dataViewName2119, | ||
141 | @Param(value="startTime")String startTime, @Param(value="endTime")String endTime, | ||
142 | @Param(value="departId") String departId); | ||
143 | |||
144 | List<Map<String, Object>> queryNhYyrbReport(@Param(value="dataViewName3a24") String dataViewName3a24, | ||
145 | @Param(value="startTime") String startTime, @Param(value="endTime") String endTime, | ||
146 | @Param(value="departId") String departId); | ||
139 | } | 147 | } | ... | ... |
... | @@ -677,4 +677,90 @@ | ... | @@ -677,4 +677,90 @@ |
677 | AND v3.time <= #{endTime} | 677 | AND v3.time <= #{endTime} |
678 | GROUP BY v3.time | 678 | GROUP BY v3.time |
679 | </select> | 679 | </select> |
680 | |||
681 | <select id="querySzYyrbReport" resultType="java.util.HashMap"> | ||
682 | SELECT | ||
683 | ROUND( SUM( v.JSL )/10000, 2 ) AS `JSL`, | ||
684 | ROUND( SUM( v.CSL )/10000, 2 ) AS `CSL`, | ||
685 | ROUND( AVG( v.JSPH ), 2 ) AS `JSPH`, | ||
686 | ROUND( AVG( v.CSPH ), 2 ) AS `CSPH`, | ||
687 | ROUND( AVG( v.JSCOD ), 2 ) AS `JSCOD`, | ||
688 | ROUND( AVG( v.CSCOD ), 2 ) AS `CSCOD`, | ||
689 | ROUND( AVG( v.CSTN ), 2 ) AS `CSTN`, | ||
690 | ROUND( AVG( v.JSZD ), 2 ) AS `JSZD`, | ||
691 | ROUND( AVG( v.JSZL ), 2 ) AS `JSZL`, | ||
692 | ROUND( AVG( v.CSZL ), 2 ) AS `CSZL`, | ||
693 | ROUND( AVG( v.JSAD ), 2 ) AS `JSAD`, | ||
694 | ROUND( AVG( v.CSAD ), 2 ) AS `CSAD`, | ||
695 | ROUND( AVG( v.JSSS ), 2 ) AS `JSSS`, | ||
696 | ROUND( AVG( v.CSSS ), 2 ) AS `CSSS`, | ||
697 | v.BZ, | ||
698 | v.depart_id, | ||
699 | d.depart_name as depart_name, | ||
700 | v.time | ||
701 | FROM | ||
702 | ${dataViewName2119} v | ||
703 | LEFT JOIN sys_depart d ON v.depart_id = d.id | ||
704 | WHERE | ||
705 | v.depart_id IN | ||
706 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
707 | '${item}' | ||
708 | </foreach> | ||
709 | AND v.time >= #{startTime} | ||
710 | AND v.time <= #{endTime} | ||
711 | GROUP BY v.depart_id | ||
712 | </select> | ||
713 | |||
714 | <select id="queryNhYyrbReport" resultType="java.util.HashMap"> | ||
715 | SELECT | ||
716 | ROUND(SUM(v3.PFS),2) AS PFS, | ||
717 | ROUND(SUM(v3.FHTY),2) AS FHTY, | ||
718 | ROUND(SUM(v3.RYXNJ),2) AS RYXNJ, | ||
719 | ROUND(SUM(v3.YWL),2) AS YWL, | ||
720 | ROUND(SUM(v3.GXCLJ),2) AS GXCLJ, | ||
721 | ROUND(SUM(v3.CH3COONA),2) AS CH3COONA, | ||
722 | ROUND(SUM(v3.HXT),2) AS HXT, | ||
723 | ROUND(SUM(v3.FECL3),2) AS FECL3, | ||
724 | ROUND(SUM(v3.SH),2) AS SH, | ||
725 | ROUND(SUM(v3.CH3COOH),2) AS CH3COOH, | ||
726 | ROUND(SUM(v3.FESO4G),2) AS FESO4G, | ||
727 | ROUND(SUM(v3.FESO4Y),2) AS FESO4Y, | ||
728 | ROUND(SUM(v3.H2O2),2) AS H2O2, | ||
729 | ROUND(SUM(v3.GFFDL),2) AS GFFDL, | ||
730 | ROUND(SUM(v3.QY),2) AS QY, | ||
731 | ROUND(SUM(v3.GFCZL),2) AS GFCZL, | ||
732 | ROUND(SUM(v3.WNHSL),2) AS WNHSL, | ||
733 | ROUND(SUM(v3.WFCSL),2) AS WFCSL, | ||
734 | ROUND(SUM(v3.WFCZL),2) AS WFCZL, | ||
735 | ROUND(SUM(v3.DLJZ),2) AS DLJZ, | ||
736 | ROUND(SUM(v3.GFSYL),2) AS GFSYL, | ||
737 | ROUND(SUM(v3.WNL),2) AS WNL, | ||
738 | ROUND(SUM(v3.DLFZ),2) AS DLFZ, | ||
739 | ROUND(SUM(v3.DLPZ),2) AS DLPZ, | ||
740 | ROUND(SUM(v3.DLGZ),2) AS DLGZ, | ||
741 | ROUND(SUM(v3.DLHJ)/10000,2) AS DLHJ, | ||
742 | ROUND(SUM(v3.YSL),2) AS YSL, | ||
743 | ROUND(SUM(v3.PAMZ),2) AS PAMZ, | ||
744 | ROUND(SUM(v3.PAMF),2) AS PAMF, | ||
745 | ROUND(SUM(v3.PAMRJ),2) AS PAMRJ, | ||
746 | ROUND(SUM(v3.SCLPAMZ),2) AS SCLPAMZ, | ||
747 | ROUND(SUM(v3.SCLPAMF),2) AS SCLPAMF, | ||
748 | ROUND(SUM(v3.NACLO),2) AS NACLO, | ||
749 | ROUND(SUM(v3.PACGT),2) AS PACGT, | ||
750 | ROUND(SUM(v3.PACYT),2) AS PACYT, | ||
751 | v3.BZ AS BZ, | ||
752 | v3.depart_id AS depart_id, | ||
753 | d.depart_name as depart_name, | ||
754 | v3.time | ||
755 | FROM ${dataViewName3a24} v3 | ||
756 | LEFT JOIN sys_depart d ON v3.depart_id = d.id | ||
757 | WHERE | ||
758 | v3.depart_id IN | ||
759 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
760 | '${item}' | ||
761 | </foreach> | ||
762 | AND v3.time >= #{startTime} | ||
763 | AND v3.time <= #{endTime} | ||
764 | GROUP BY v3.depart_id | ||
765 | </select> | ||
680 | </mapper> | 766 | </mapper> | ... | ... |
... | @@ -136,4 +136,8 @@ public interface IFCustomReportDatasetService extends IService<FCustomReportData | ... | @@ -136,4 +136,8 @@ public interface IFCustomReportDatasetService extends IService<FCustomReportData |
136 | List<Map<String, Object>> querySzYyybReport(String dataViewName2119, String startTime, String endTime, String departId); | 136 | List<Map<String, Object>> querySzYyybReport(String dataViewName2119, String startTime, String endTime, String departId); |
137 | 137 | ||
138 | List<Map<String, Object>> queryNhYyybReport(String dataViewName3a24, String startTime, String endTime, String departId); | 138 | List<Map<String, Object>> queryNhYyybReport(String dataViewName3a24, String startTime, String endTime, String departId); |
139 | |||
140 | List<Map<String, Object>> querySzYyrbReport(String dataViewName2119, String startTime, String endTime, String departId); | ||
141 | |||
142 | List<Map<String, Object>> queryNhYyrbReport(String dataViewName3a24, String startTime, String endTime, String departId); | ||
139 | } | 143 | } | ... | ... |
... | @@ -454,6 +454,18 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -454,6 +454,18 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
454 | return list; | 454 | return list; |
455 | } | 455 | } |
456 | 456 | ||
457 | @Override | ||
458 | public List<Map<String, Object>> querySzYyrbReport(String dataViewName2119, String startTime, String endTime, String departId) { | ||
459 | List<Map<String, Object>> list = mapper.querySzYyrbReport(dataViewName2119, startTime, endTime, departId); | ||
460 | return list; | ||
461 | } | ||
462 | |||
463 | @Override | ||
464 | public List<Map<String, Object>> queryNhYyrbReport(String dataViewName3a24, String startTime, String endTime, String departId) { | ||
465 | List<Map<String, Object>> list = mapper.queryNhYyrbReport(dataViewName3a24, startTime, endTime, departId); | ||
466 | return list; | ||
467 | } | ||
468 | |||
457 | /**转换为Map<部门编号,JnhbReportData> */ | 469 | /**转换为Map<部门编号,JnhbReportData> */ |
458 | private Map<String,JnhbReportData> convertJnhbReportDataMap(List<JnhbReportData> dataList){// Map<部门编号,JnhbReportData> | 470 | private Map<String,JnhbReportData> convertJnhbReportDataMap(List<JnhbReportData> dataList){// Map<部门编号,JnhbReportData> |
459 | Map<String,JnhbReportData> dataMap = new HashMap<>(); | 471 | Map<String,JnhbReportData> dataMap = new HashMap<>(); | ... | ... |
... | @@ -728,10 +728,13 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -728,10 +728,13 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
728 | Map<String, Object> maptb = factoryCenterMapper.getDhData(startDateTb, endDateTb, statisticsParam.getDepartId(), dataView3a24tb, dataView2119tb); | 728 | Map<String, Object> maptb = factoryCenterMapper.getDhData(startDateTb, endDateTb, statisticsParam.getDepartId(), dataView3a24tb, dataView2119tb); |
729 | if(maptb!=null){ | 729 | if(maptb!=null){ |
730 | zdhTb = Double.parseDouble(maptb.get("zdh").toString()); | 730 | zdhTb = Double.parseDouble(maptb.get("zdh").toString()); |
731 | if(zdhTb > 0.0){ | ||
732 | zdhTb = Double.parseDouble(df.format(100*(zdh - zdhTb)/zdhTb)); | ||
733 | } | ||
731 | rjdhTb = Double.parseDouble(maptb.get("rjdh").toString()); | 734 | rjdhTb = Double.parseDouble(maptb.get("rjdh").toString()); |
732 | 735 | if(rjdhTb > 0.0){ | |
733 | zdhTb = Double.parseDouble(df.format(100*(zdh - zdhTb)/zdhTb)); | 736 | rjdhTb = Double.parseDouble(df.format(100*(rjdh - rjdhTb)/rjdhTb)); |
734 | rjdhTb = Double.parseDouble(df.format(100*(rjdh - rjdhTb)/rjdhTb)); | 737 | } |
735 | if(maptb.get("dsdh")!=null){ | 738 | if(maptb.get("dsdh")!=null){ |
736 | dsdhTb = Double.parseDouble(maptb.get("dsdh").toString()); | 739 | dsdhTb = Double.parseDouble(maptb.get("dsdh").toString()); |
737 | dsdhTb = Double.parseDouble(df.format(100*(dsdh - dsdhTb)/dsdhTb)); | 740 | dsdhTb = Double.parseDouble(df.format(100*(dsdh - dsdhTb)/dsdhTb)); |
... | @@ -743,9 +746,13 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -743,9 +746,13 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
743 | Map<String, Object> maphb = factoryCenterMapper.getDhData(startDateHb, endDateHb, statisticsParam.getDepartId(), dataView3a24hb, dataView2119hb); | 746 | Map<String, Object> maphb = factoryCenterMapper.getDhData(startDateHb, endDateHb, statisticsParam.getDepartId(), dataView3a24hb, dataView2119hb); |
744 | if(maphb!=null){ | 747 | if(maphb!=null){ |
745 | zdhHb = Double.parseDouble(maphb.get("zdh").toString()); | 748 | zdhHb = Double.parseDouble(maphb.get("zdh").toString()); |
749 | if(zdhHb > 0.0){ | ||
750 | zdhHb = Double.parseDouble(df.format(100*(zdh - zdhHb)/zdhHb)); | ||
751 | } | ||
746 | rjdhHb = Double.parseDouble(maphb.get("rjdh").toString()); | 752 | rjdhHb = Double.parseDouble(maphb.get("rjdh").toString()); |
747 | zdhHb = Double.parseDouble(df.format(100*(zdh - zdhHb)/zdhHb)); | 753 | if(rjdhHb > 0.0){ |
748 | rjdhHb = Double.parseDouble(df.format(100*(rjdh - rjdhHb)/rjdhHb)); | 754 | rjdhHb = Double.parseDouble(df.format(100*(rjdh - rjdhHb)/rjdhHb)); |
755 | } | ||
749 | if(maphb.get("dsdh")!=null){ | 756 | if(maphb.get("dsdh")!=null){ |
750 | dsdhHb = Double.parseDouble(maphb.get("dsdh").toString()); | 757 | dsdhHb = Double.parseDouble(maphb.get("dsdh").toString()); |
751 | dsdhHb = Double.parseDouble(df.format(100*(dsdh - dsdhHb)/dsdhHb)); | 758 | dsdhHb = Double.parseDouble(df.format(100*(dsdh - dsdhHb)/dsdhHb)); | ... | ... |
-
请 注册 或 登录 后发表评论