水厂运营大屏接口开发
正在显示
13 个修改的文件
包含
676 行增加
和
110 行删除
1 | |||
2 | package com.skua.modules.flow.service; | 1 | package com.skua.modules.flow.service; |
3 | 2 | ||
4 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
5 | import com.skua.modules.flow.core.entity.BladeFlow; | 3 | import com.skua.modules.flow.core.entity.BladeFlow; |
6 | import com.skua.modules.flow.core.entity.FlowAssemblyEntity; | ||
7 | |||
8 | import java.util.List; | 4 | import java.util.List; |
9 | import java.util.Map; | ||
10 | import java.util.Set; | ||
11 | 5 | ||
12 | /** | 6 | /** |
13 | * 流程业务类 | 7 | * 流程业务类 |
... | @@ -21,13 +15,27 @@ public interface FlowForThirdBusinessService { | ... | @@ -21,13 +15,27 @@ public interface FlowForThirdBusinessService { |
21 | * @param bladeFlow 流程类 | 15 | * @param bladeFlow 流程类 |
22 | * @return | 16 | * @return |
23 | */ | 17 | */ |
24 | List<BladeFlow> selectClaimPage(BladeFlow bladeFlow, String userId, String roles); | 18 | List<BladeFlow> selectClaimList(BladeFlow bladeFlow, String userId, String roles); |
25 | 19 | ||
26 | /** | 20 | /** |
27 | * 流程待办列表 | 21 | * 流程待办列表 |
28 | * @param bladeFlow 流程类 | 22 | * @param bladeFlow 流程类 |
29 | * @return | 23 | * @return |
30 | */ | 24 | */ |
31 | List<BladeFlow> selectTodoPage(BladeFlow bladeFlow, String userId); | 25 | List<BladeFlow> selectTodoList(BladeFlow bladeFlow, String userId); |
26 | |||
27 | /** | ||
28 | * 流程已发列表 | ||
29 | * @param bladeFlow 流程类 | ||
30 | * @return | ||
31 | */ | ||
32 | List<BladeFlow> selectSendList(BladeFlow bladeFlow, String userId); | ||
33 | |||
34 | /** | ||
35 | * 流程办结列表 | ||
36 | * @param bladeFlow 流程类 | ||
37 | * @return | ||
38 | */ | ||
39 | List<BladeFlow> selectDoneList(BladeFlow bladeFlow, String userId); | ||
32 | 40 | ||
33 | } | 41 | } | ... | ... |
... | @@ -7,6 +7,7 @@ import com.skua.modules.flow.core.entity.BladeFlow; | ... | @@ -7,6 +7,7 @@ import com.skua.modules.flow.core.entity.BladeFlow; |
7 | import com.skua.modules.flow.core.utils.TaskUtil; | 7 | import com.skua.modules.flow.core.utils.TaskUtil; |
8 | import com.skua.modules.flow.custombiz.handle.IFlowBusinessDescService; | 8 | import com.skua.modules.flow.custombiz.handle.IFlowBusinessDescService; |
9 | import com.skua.modules.flow.engine.constant.FlowEngineConstant; | 9 | import com.skua.modules.flow.engine.constant.FlowEngineConstant; |
10 | import com.skua.modules.flow.engine.utils.FlowCache; | ||
10 | import com.skua.modules.flow.service.FlowForThirdBusinessService; | 11 | import com.skua.modules.flow.service.FlowForThirdBusinessService; |
11 | import com.skua.modules.flow.utils.Func; | 12 | import com.skua.modules.flow.utils.Func; |
12 | import com.skua.modules.flow.utils.StringPool; | 13 | import com.skua.modules.flow.utils.StringPool; |
... | @@ -15,9 +16,12 @@ import org.flowable.engine.HistoryService; | ... | @@ -15,9 +16,12 @@ import org.flowable.engine.HistoryService; |
15 | import org.flowable.engine.RepositoryService; | 16 | import org.flowable.engine.RepositoryService; |
16 | import org.flowable.engine.TaskService; | 17 | import org.flowable.engine.TaskService; |
17 | import org.flowable.engine.history.HistoricProcessInstance; | 18 | import org.flowable.engine.history.HistoricProcessInstance; |
19 | import org.flowable.engine.history.HistoricProcessInstanceQuery; | ||
18 | import org.flowable.engine.repository.ProcessDefinition; | 20 | import org.flowable.engine.repository.ProcessDefinition; |
19 | import org.flowable.task.api.Task; | 21 | import org.flowable.task.api.Task; |
20 | import org.flowable.task.api.TaskQuery; | 22 | import org.flowable.task.api.TaskQuery; |
23 | import org.flowable.task.api.history.HistoricTaskInstance; | ||
24 | import org.flowable.task.api.history.HistoricTaskInstanceQuery; | ||
21 | import org.springframework.beans.factory.annotation.Autowired; | 25 | import org.springframework.beans.factory.annotation.Autowired; |
22 | import org.springframework.stereotype.Service; | 26 | import org.springframework.stereotype.Service; |
23 | import javax.servlet.http.HttpServletRequest; | 27 | import javax.servlet.http.HttpServletRequest; |
... | @@ -42,7 +46,7 @@ public class FlowForThirdBusinessServiceImpl implements FlowForThirdBusinessServ | ... | @@ -42,7 +46,7 @@ public class FlowForThirdBusinessServiceImpl implements FlowForThirdBusinessServ |
42 | private IFlowService flowService; | 46 | private IFlowService flowService; |
43 | 47 | ||
44 | @Override | 48 | @Override |
45 | public List<BladeFlow> selectClaimPage(BladeFlow bladeFlow, String userId, String roles) { | 49 | public List<BladeFlow> selectClaimList(BladeFlow bladeFlow, String userId, String roles) { |
46 | String taskUser = TaskUtil.getTaskUser(userId); | 50 | String taskUser = TaskUtil.getTaskUser(userId); |
47 | String taskGroup = roles; | 51 | String taskGroup = roles; |
48 | List<BladeFlow> flowList = new LinkedList<>(); | 52 | List<BladeFlow> flowList = new LinkedList<>(); |
... | @@ -63,7 +67,7 @@ public class FlowForThirdBusinessServiceImpl implements FlowForThirdBusinessServ | ... | @@ -63,7 +67,7 @@ public class FlowForThirdBusinessServiceImpl implements FlowForThirdBusinessServ |
63 | } | 67 | } |
64 | 68 | ||
65 | @Override | 69 | @Override |
66 | public List<BladeFlow> selectTodoPage(BladeFlow bladeFlow, String userId) { | 70 | public List<BladeFlow> selectTodoList(BladeFlow bladeFlow, String userId) { |
67 | String taskUser = TaskUtil.getTaskUser(userId); | 71 | String taskUser = TaskUtil.getTaskUser(userId); |
68 | List<BladeFlow> flowList = new LinkedList<>(); | 72 | List<BladeFlow> flowList = new LinkedList<>(); |
69 | 73 | ||
... | @@ -80,6 +84,202 @@ public class FlowForThirdBusinessServiceImpl implements FlowForThirdBusinessServ | ... | @@ -80,6 +84,202 @@ public class FlowForThirdBusinessServiceImpl implements FlowForThirdBusinessServ |
80 | return flowList; | 84 | return flowList; |
81 | } | 85 | } |
82 | 86 | ||
87 | @Override | ||
88 | public List<BladeFlow> selectSendList(BladeFlow bladeFlow, String userId) { | ||
89 | String taskUser = TaskUtil.getTaskUser(userId); | ||
90 | List<BladeFlow> flowList = new LinkedList<>(); | ||
91 | |||
92 | HistoricProcessInstanceQuery historyQuery = historyService.createHistoricProcessInstanceQuery().startedBy(taskUser).orderByProcessInstanceStartTime().desc(); | ||
93 | |||
94 | if (bladeFlow.getCategory() != null) { | ||
95 | historyQuery.processDefinitionCategory(bladeFlow.getCategory()); | ||
96 | } | ||
97 | if (bladeFlow.getBeginDate() != null) { | ||
98 | historyQuery.startedAfter(bladeFlow.getBeginDate()); | ||
99 | } | ||
100 | if (bladeFlow.getEndDate() != null) { | ||
101 | historyQuery.startedBefore(bladeFlow.getEndDate()); | ||
102 | } | ||
103 | if (bladeFlow.getProcessDefinitionName() != null) { | ||
104 | historyQuery.processDefinitionName(bladeFlow.getProcessDefinitionName()); | ||
105 | } | ||
106 | if (!org.apache.commons.lang3.StringUtils.isBlank(bladeFlow.getProcessInstanceId())){ | ||
107 | historyQuery.processInstanceId(bladeFlow.getProcessInstanceId()); | ||
108 | } | ||
109 | if (!org.apache.commons.lang3.StringUtils.isBlank(bladeFlow.getProcessDefinitionId())){ | ||
110 | historyQuery.processDefinitionId(bladeFlow.getProcessDefinitionId()); | ||
111 | } | ||
112 | if (!org.apache.commons.lang3.StringUtils.isBlank(bladeFlow.getProcessDefinitionKey())){ | ||
113 | historyQuery.processDefinitionKey(bladeFlow.getProcessDefinitionKey()); | ||
114 | } | ||
115 | |||
116 | // 查询列表 | ||
117 | List<HistoricProcessInstance> historyList = historyQuery.list(); | ||
118 | |||
119 | if (historyList.size() > 0) { | ||
120 | List<String> processInstanceIdList = new ArrayList<>(); | ||
121 | Set<String> processDefinitionIdSet = new HashSet<>(); | ||
122 | |||
123 | historyList.forEach(task -> { | ||
124 | processInstanceIdList.add(task.getId()); | ||
125 | processDefinitionIdSet.add(task.getProcessDefinitionId()); | ||
126 | }); | ||
127 | |||
128 | List<ProcessDefinition> processDefinitionList = getProcessDefinitionList(processDefinitionIdSet); | ||
129 | Map<String, ProcessDefinition> processDefinitionMap = new HashMap<>(); | ||
130 | processDefinitionList.forEach(processDefinition -> { | ||
131 | processDefinitionMap.put(processDefinition.getId(), processDefinition); | ||
132 | }); | ||
133 | |||
134 | List<HistoricTaskInstance> historicTaskInstanceList = getHistoricTaskInstanceList(processInstanceIdList); | ||
135 | Map<String, HistoricTaskInstance> historicTaskInstanceMap = new HashMap<>(); | ||
136 | historicTaskInstanceList.forEach(historicTaskInstance -> { | ||
137 | historicTaskInstanceMap.put(historicTaskInstance.getProcessInstanceId(), historicTaskInstance); | ||
138 | }); | ||
139 | |||
140 | historyList.forEach(historicProcessInstance -> { | ||
141 | BladeFlow flow = new BladeFlow(); | ||
142 | // historicProcessInstance | ||
143 | flow.setCreateTime(historicProcessInstance.getStartTime()); | ||
144 | flow.setEndTime(historicProcessInstance.getEndTime()); | ||
145 | flow.setVariables(historicProcessInstance.getProcessVariables()); | ||
146 | String[] businessKey = Func.toStrArray(StringPool.COLON, historicProcessInstance.getBusinessKey()); | ||
147 | if (businessKey.length > 1) { | ||
148 | flow.setBusinessTable(businessKey[0]); | ||
149 | flow.setBusinessId(businessKey[1]); | ||
150 | } | ||
151 | flow.setHistoryActivityName(historicProcessInstance.getName()); | ||
152 | flow.setProcessInstanceId(historicProcessInstance.getId()); | ||
153 | flow.setHistoryProcessInstanceId(historicProcessInstance.getId()); | ||
154 | // ProcessDefinition | ||
155 | ProcessDefinition processDefinition = processDefinitionMap.get(historicProcessInstance.getProcessDefinitionId()); | ||
156 | if (Func.isNotEmpty(processDefinition)) { | ||
157 | flow.setProcessDefinitionId(processDefinition.getId()); | ||
158 | flow.setProcessDefinitionName(processDefinition.getName()); | ||
159 | flow.setProcessDefinitionVersion(processDefinition.getVersion()); | ||
160 | flow.setProcessDefinitionKey(processDefinition.getKey()); | ||
161 | flow.setCategory(processDefinition.getCategory()); | ||
162 | } | ||
163 | flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory())); | ||
164 | flow.setProcessInstanceId(historicProcessInstance.getId()); | ||
165 | // HistoricTaskInstance | ||
166 | HistoricTaskInstance historicTaskInstance = historicTaskInstanceMap.get(historicProcessInstance.getId()); | ||
167 | if (Func.isNotEmpty(historicTaskInstance)) { | ||
168 | flow.setTaskId(historicTaskInstance.getId()); | ||
169 | flow.setTaskName(historicTaskInstance.getName()); | ||
170 | flow.setTaskDefinitionKey(historicTaskInstance.getTaskDefinitionKey()); | ||
171 | } | ||
172 | // Status | ||
173 | if (historicProcessInstance.getEndActivityId() != null) { | ||
174 | flow.setProcessIsFinished(FlowEngineConstant.STATUS_FINISHED); | ||
175 | } else { | ||
176 | flow.setProcessIsFinished(FlowEngineConstant.STATUS_UNFINISHED); | ||
177 | } | ||
178 | flow.setStatus(FlowEngineConstant.STATUS_FINISH); | ||
179 | flowList.add(flow); | ||
180 | }); | ||
181 | } | ||
182 | getFlowBusinessDesc(flowList); | ||
183 | return flowList; | ||
184 | } | ||
185 | |||
186 | private List<HistoricTaskInstance> getHistoricTaskInstanceList(List<String> processInstanceIdList) { | ||
187 | return historyService.createHistoricTaskInstanceQuery().processInstanceIdIn(processInstanceIdList).orderByHistoricTaskInstanceEndTime().desc().list(); | ||
188 | } | ||
189 | |||
190 | @Override | ||
191 | public List<BladeFlow> selectDoneList(BladeFlow bladeFlow, String userId) { | ||
192 | String taskUser = TaskUtil.getTaskUser(userId); | ||
193 | List<BladeFlow> flowList = new LinkedList<>(); | ||
194 | |||
195 | HistoricTaskInstanceQuery doneQuery = historyService.createHistoricTaskInstanceQuery().taskAssignee(taskUser).finished() | ||
196 | .includeProcessVariables().orderByHistoricTaskInstanceEndTime().desc(); | ||
197 | |||
198 | if (bladeFlow.getCategory() != null) { | ||
199 | doneQuery.processCategoryIn(Func.toStrList(bladeFlow.getCategory())); | ||
200 | } | ||
201 | if (bladeFlow.getBeginDate() != null) { | ||
202 | doneQuery.taskCompletedAfter(bladeFlow.getBeginDate()); | ||
203 | } | ||
204 | if (bladeFlow.getEndDate() != null) { | ||
205 | doneQuery.taskCompletedBefore(bladeFlow.getEndDate()); | ||
206 | } | ||
207 | if (bladeFlow.getProcessDefinitionName() != null) { | ||
208 | doneQuery.processDefinitionNameLike(bladeFlow.getProcessDefinitionName()); | ||
209 | } | ||
210 | if (!org.apache.commons.lang3.StringUtils.isBlank(bladeFlow.getProcessInstanceId())){ | ||
211 | doneQuery.processInstanceId(bladeFlow.getProcessInstanceId()); | ||
212 | } | ||
213 | if (!org.apache.commons.lang3.StringUtils.isBlank(bladeFlow.getProcessDefinitionId())){ | ||
214 | doneQuery.processDefinitionId(bladeFlow.getProcessDefinitionId()); | ||
215 | } | ||
216 | if (!org.apache.commons.lang3.StringUtils.isBlank(bladeFlow.getProcessDefinitionKey())){ | ||
217 | doneQuery.processDefinitionKey(bladeFlow.getProcessDefinitionKey()); | ||
218 | } | ||
219 | |||
220 | // 查询列表 | ||
221 | List<HistoricTaskInstance> doneList = doneQuery.list(); | ||
222 | |||
223 | Set<String> processInstanceIdSet = new HashSet<>(); | ||
224 | Set<String> processDefinitionIdSet = new HashSet<>(); | ||
225 | |||
226 | doneList.forEach(task -> { | ||
227 | processInstanceIdSet.add(task.getProcessInstanceId()); | ||
228 | processDefinitionIdSet.add(task.getProcessDefinitionId()); | ||
229 | }); | ||
230 | |||
231 | List<HistoricProcessInstance> historicProcessInstanceList = getHistoricProcessInstances(processInstanceIdSet); | ||
232 | Map<String,HistoricProcessInstance> historicProcessInstanceMap = new HashMap<>(); | ||
233 | historicProcessInstanceList.forEach(historicProcessInstance -> { | ||
234 | historicProcessInstanceMap.put(historicProcessInstance.getId(),historicProcessInstance); | ||
235 | }); | ||
236 | |||
237 | List<ProcessDefinition> processDefinitionList = getProcessDefinitionList(processDefinitionIdSet); | ||
238 | Map<String,ProcessDefinition> processDefinitionMap = new HashMap<>(); | ||
239 | processDefinitionList.forEach(processDefinition -> { | ||
240 | processDefinitionMap.put(processDefinition.getId(),processDefinition); | ||
241 | }); | ||
242 | |||
243 | doneList.forEach(historicTaskInstance -> { | ||
244 | BladeFlow flow = new BladeFlow(); | ||
245 | flow.setTaskId(historicTaskInstance.getId()); | ||
246 | flow.setTaskDefinitionKey(historicTaskInstance.getTaskDefinitionKey()); | ||
247 | flow.setTaskName(historicTaskInstance.getName()); | ||
248 | flow.setAssignee(historicTaskInstance.getAssignee()); | ||
249 | flow.setCreateTime(historicTaskInstance.getCreateTime()); | ||
250 | flow.setExecutionId(historicTaskInstance.getExecutionId()); | ||
251 | flow.setHistoryTaskEndTime(historicTaskInstance.getEndTime()); | ||
252 | flow.setVariables(historicTaskInstance.getProcessVariables()); | ||
253 | //ProcessDefinition processDefinition = FlowCache.getProcessDefinition(historicTaskInstance.getProcessDefinitionId()); | ||
254 | ProcessDefinition processDefinition = processDefinitionMap.get(historicTaskInstance.getProcessDefinitionId()); | ||
255 | if (Func.isNotEmpty(processDefinition)) { | ||
256 | flow.setProcessDefinitionId(processDefinition.getId()); | ||
257 | flow.setProcessDefinitionName(processDefinition.getName()); | ||
258 | flow.setProcessDefinitionKey(processDefinition.getKey()); | ||
259 | flow.setProcessDefinitionVersion(processDefinition.getVersion()); | ||
260 | flow.setCategory(processDefinition.getCategory()); | ||
261 | } | ||
262 | flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory())); | ||
263 | flow.setProcessInstanceId(historicTaskInstance.getProcessInstanceId()); | ||
264 | flow.setHistoryProcessInstanceId(historicTaskInstance.getProcessInstanceId()); | ||
265 | HistoricProcessInstance historicProcessInstance = historicProcessInstanceMap.get(historicTaskInstance.getProcessInstanceId()); | ||
266 | if (Func.isNotEmpty(historicProcessInstance)) { | ||
267 | String[] businessKey = Func.toStrArray(StringPool.COLON, historicProcessInstance.getBusinessKey()); | ||
268 | flow.setBusinessTable(businessKey[0]); | ||
269 | flow.setBusinessId(businessKey[1]); | ||
270 | if (historicProcessInstance.getEndActivityId() != null) { | ||
271 | flow.setProcessIsFinished(FlowEngineConstant.STATUS_FINISHED); | ||
272 | } else { | ||
273 | flow.setProcessIsFinished(FlowEngineConstant.STATUS_UNFINISHED); | ||
274 | } | ||
275 | } | ||
276 | flow.setStatus(FlowEngineConstant.STATUS_FINISH); | ||
277 | flowList.add(flow); | ||
278 | }); | ||
279 | getFlowBusinessDesc(flowList); | ||
280 | return flowList; | ||
281 | } | ||
282 | |||
83 | /** | 283 | /** |
84 | * 构建流程 | 284 | * 构建流程 |
85 | * | 285 | * |
... | @@ -150,7 +350,7 @@ public class FlowForThirdBusinessServiceImpl implements FlowForThirdBusinessServ | ... | @@ -150,7 +350,7 @@ public class FlowForThirdBusinessServiceImpl implements FlowForThirdBusinessServ |
150 | ProcessDefinition processDefinition = processDefinitionMap.get(task.getProcessDefinitionId()); | 350 | ProcessDefinition processDefinition = processDefinitionMap.get(task.getProcessDefinitionId()); |
151 | if (Func.isNotEmpty(processDefinition)) { | 351 | if (Func.isNotEmpty(processDefinition)) { |
152 | flow.setCategory(processDefinition.getCategory()); | 352 | flow.setCategory(processDefinition.getCategory()); |
153 | flow.setCategoryName("请假流程"); | 353 | flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory())); |
154 | flow.setProcessDefinitionId(processDefinition.getId()); | 354 | flow.setProcessDefinitionId(processDefinition.getId()); |
155 | flow.setProcessDefinitionName(processDefinition.getName()); | 355 | flow.setProcessDefinitionName(processDefinition.getName()); |
156 | flow.setProcessDefinitionKey(processDefinition.getKey()); | 356 | flow.setProcessDefinitionKey(processDefinition.getKey()); | ... | ... |
... | @@ -189,7 +189,7 @@ public class ProcessStatisticsController { | ... | @@ -189,7 +189,7 @@ public class ProcessStatisticsController { |
189 | List<String> roleList = sysBaseAPI.getRolesByUserId(sysUser.getId()); | 189 | List<String> roleList = sysBaseAPI.getRolesByUserId(sysUser.getId()); |
190 | String roles = roleList.stream().map(s -> s.trim()).collect(Collectors.joining(",")); | 190 | String roles = roleList.stream().map(s -> s.trim()).collect(Collectors.joining(",")); |
191 | if(roleList.size() > 0){ | 191 | if(roleList.size() > 0){ |
192 | claimList = flowForThirdBusinessService.selectClaimPage(bladeFlow, sysUser.getId(), roles); | 192 | claimList = flowForThirdBusinessService.selectClaimList(bladeFlow, sysUser.getId(), roles); |
193 | for (BladeFlow claim : claimList) { | 193 | for (BladeFlow claim : claimList) { |
194 | ThirdProcessVO claimVO = new ThirdProcessVO(); | 194 | ThirdProcessVO claimVO = new ThirdProcessVO(); |
195 | claimVO.setMsgid(claim.getTaskId()); | 195 | claimVO.setMsgid(claim.getTaskId()); |
... | @@ -204,7 +204,7 @@ public class ProcessStatisticsController { | ... | @@ -204,7 +204,7 @@ public class ProcessStatisticsController { |
204 | list.add(claimVO); | 204 | list.add(claimVO); |
205 | } | 205 | } |
206 | } | 206 | } |
207 | todoList = flowForThirdBusinessService.selectTodoPage(bladeFlow, sysUser.getId()); | 207 | todoList = flowForThirdBusinessService.selectTodoList(bladeFlow, sysUser.getId()); |
208 | for (BladeFlow todo : todoList) { | 208 | for (BladeFlow todo : todoList) { |
209 | ThirdProcessVO todoVO = new ThirdProcessVO(); | 209 | ThirdProcessVO todoVO = new ThirdProcessVO(); |
210 | todoVO.setMsgid(todo.getTaskId()); | 210 | todoVO.setMsgid(todo.getTaskId()); | ... | ... |
... | @@ -197,7 +197,7 @@ public class SysMonitorLocationController { | ... | @@ -197,7 +197,7 @@ public class SysMonitorLocationController { |
197 | String sExpress = bean.getMonitorStop(); | 197 | String sExpress = bean.getMonitorStop(); |
198 | str.append(getFields(sExpress)).append(","); | 198 | str.append(getFields(sExpress)).append(","); |
199 | } | 199 | } |
200 | str.append(bean.getMonitorId()).append(","); | 200 | str.append(bean.getMonitorId()).append(","); |
201 | } | 201 | } |
202 | } | 202 | } |
203 | //查询点信息 | 203 | //查询点信息 |
... | @@ -516,7 +516,7 @@ public class SysMonitorLocationController { | ... | @@ -516,7 +516,7 @@ public class SysMonitorLocationController { |
516 | Map<String, Object> map = new HashMap<>(); | 516 | Map<String, Object> map = new HashMap<>(); |
517 | // Map<String,Object> dataMap = sysMonitorLocationService.getLocationDataList(monitorLocationVO.getDepartId(),monitorLocationVO.getStructId()); | 517 | // Map<String,Object> dataMap = sysMonitorLocationService.getLocationDataList(monitorLocationVO.getDepartId(),monitorLocationVO.getStructId()); |
518 | List<MonitorLocationVO> list = sysMonitorLocationService.getLoctionList(monitorLocationVO.getDepartId(), monitorLocationVO.getPictureId()); | 518 | List<MonitorLocationVO> list = sysMonitorLocationService.getLoctionList(monitorLocationVO.getDepartId(), monitorLocationVO.getPictureId()); |
519 | if (list.size() > 0) { | 519 | if(list!=null&&list.size() > 0){ |
520 | map = getLoctionGroup(list, true); | 520 | map = getLoctionGroup(list, true); |
521 | } | 521 | } |
522 | result.setSuccess(true); | 522 | result.setSuccess(true); |
... | @@ -673,11 +673,11 @@ public class SysMonitorLocationController { | ... | @@ -673,11 +673,11 @@ public class SysMonitorLocationController { |
673 | } | 673 | } |
674 | 674 | ||
675 | } | 675 | } |
676 | 676 | ||
677 | //保存设备台账信息 | 677 | //保存设备台账信息 |
678 | JSONArray materialArray = jsonObject.getJSONArray("materialData"); | 678 | JSONArray materialArray = jsonObject.getJSONArray("materialData"); |
679 | 679 | ||
680 | 680 | ||
681 | delLoctionCache(null,null); | 681 | delLoctionCache(null,null); |
682 | 682 | ||
683 | result.success("添加成功!"); | 683 | result.success("添加成功!"); | ... | ... |
... | @@ -3,8 +3,7 @@ package com.skua.modules.dataAnalysis.controller; | ... | @@ -3,8 +3,7 @@ package com.skua.modules.dataAnalysis.controller; |
3 | import com.skua.core.api.vo.Result; | 3 | import com.skua.core.api.vo.Result; |
4 | import com.skua.modules.dataAnalysis.service.IFactoryCenterService; | 4 | import com.skua.modules.dataAnalysis.service.IFactoryCenterService; |
5 | import com.skua.modules.dataAnalysis.service.IFactoryOperateCenterService; | 5 | import com.skua.modules.dataAnalysis.service.IFactoryOperateCenterService; |
6 | import com.skua.modules.dataAnalysis.vo.StatisticsParam; | 6 | import com.skua.modules.dataAnalysis.vo.*; |
7 | import com.skua.modules.dataAnalysis.vo.WaterQualityMonitoringDetailVO; | ||
8 | import io.swagger.annotations.Api; | 7 | import io.swagger.annotations.Api; |
9 | import io.swagger.annotations.ApiOperation; | 8 | import io.swagger.annotations.ApiOperation; |
10 | import lombok.extern.slf4j.Slf4j; | 9 | import lombok.extern.slf4j.Slf4j; |
... | @@ -36,4 +35,64 @@ public class FactoryOperateCenterController { | ... | @@ -36,4 +35,64 @@ public class FactoryOperateCenterController { |
36 | return result; | 35 | return result; |
37 | } | 36 | } |
38 | 37 | ||
38 | @ApiOperation(value="厂区报表统计数据", notes="厂区报表统计数据") | ||
39 | @GetMapping(value = "/report") | ||
40 | public Result<Map<String,Object>> getReportData(String departId,String month) { | ||
41 | Result<Map<String,Object>> result = new Result<Map<String,Object>>(); | ||
42 | Map<String,Object> map = factoryOperateCenterService.getReportData(departId,month); | ||
43 | result.setSuccess(true); | ||
44 | result.setResult(map); | ||
45 | return result; | ||
46 | } | ||
47 | |||
48 | @ApiOperation(value="厂区设备报警信息", notes="厂区设备报警信息") | ||
49 | @GetMapping(value = "/alarm") | ||
50 | public Result<List<EquipAlarmVO>> getEquipAlarm(String departId, String month) { | ||
51 | Result<List<EquipAlarmVO>> result = new Result<List<EquipAlarmVO>>(); | ||
52 | List<EquipAlarmVO> list = factoryOperateCenterService.getEquipAlarm(departId,month); | ||
53 | result.setSuccess(true); | ||
54 | result.setResult(list); | ||
55 | return result; | ||
56 | } | ||
57 | |||
58 | @ApiOperation(value="厂区设备预警数据", notes="厂区设备预警数据") | ||
59 | @GetMapping(value = "/equip/warn") | ||
60 | public Result<List<EquipWarnVO>> getEquipWarn(String departId, String month) { | ||
61 | Result<List<EquipWarnVO>> result = new Result<List<EquipWarnVO>>(); | ||
62 | List<EquipWarnVO> list = factoryOperateCenterService.getEquipWarn(departId,month); | ||
63 | result.setSuccess(true); | ||
64 | result.setResult(list); | ||
65 | return result; | ||
66 | } | ||
67 | |||
68 | @ApiOperation(value="厂区设备运行时间", notes="厂区设备运行时间") | ||
69 | @GetMapping(value = "/equip/runtime") | ||
70 | public Result<List<EquipRunTimeVO>> getEquipRunTime(String departId, String month) { | ||
71 | Result<List<EquipRunTimeVO>> result = new Result<List<EquipRunTimeVO>>(); | ||
72 | List<EquipRunTimeVO> list = factoryOperateCenterService.getEquipRunTime(departId,month); | ||
73 | result.setSuccess(true); | ||
74 | result.setResult(list); | ||
75 | return result; | ||
76 | } | ||
77 | |||
78 | @ApiOperation(value="厂区报表档案到期提醒", notes="厂区报表档案到期提醒") | ||
79 | @GetMapping(value = "/archives/warn") | ||
80 | public Result<List<ArchivesWarnVO>> getArchivesWarn(String departId,String month) { | ||
81 | Result<List<ArchivesWarnVO>> result = new Result<List<ArchivesWarnVO>>(); | ||
82 | List<ArchivesWarnVO> list = factoryOperateCenterService.getArchivesWarn(departId); | ||
83 | result.setSuccess(true); | ||
84 | result.setResult(list); | ||
85 | return result; | ||
86 | } | ||
87 | |||
88 | @ApiOperation(value="厂区工单完成情况", notes="厂区工单完成情况") | ||
89 | @GetMapping(value = "/flow") | ||
90 | public Result<Map<String,Object>> getFlowData(String departId,String month) { | ||
91 | Result<Map<String,Object>> result = new Result<Map<String,Object>>(); | ||
92 | Map<String,Object> map = factoryOperateCenterService.getFlowData(departId,month); | ||
93 | result.setSuccess(true); | ||
94 | result.setResult(map); | ||
95 | return result; | ||
96 | } | ||
97 | |||
39 | } | 98 | } | ... | ... |
1 | package com.skua.modules.dataAnalysis.mapper; | 1 | package com.skua.modules.dataAnalysis.mapper; |
2 | 2 | ||
3 | import com.skua.modules.dataAnalysis.vo.ArchivesWarnVO; | ||
4 | import com.skua.modules.dataAnalysis.vo.EquipAlarmVO; | ||
5 | import com.skua.modules.dataAnalysis.vo.EquipRunTimeVO; | ||
6 | import com.skua.modules.dataAnalysis.vo.EquipWarnVO; | ||
3 | import org.apache.ibatis.annotations.Param; | 7 | import org.apache.ibatis.annotations.Param; |
4 | 8 | ||
5 | import java.util.List; | 9 | import java.util.List; |
... | @@ -10,4 +14,13 @@ public interface FactoryOperateCenterMapper { | ... | @@ -10,4 +14,13 @@ public interface FactoryOperateCenterMapper { |
10 | Map<String, Object> getData(@Param("month") String month, @Param("departId") String departId, | 14 | Map<String, Object> getData(@Param("month") String month, @Param("departId") String departId, |
11 | @Param("view3a24") String view3a24, @Param("view2119") String view2119); | 15 | @Param("view3a24") String view3a24, @Param("view2119") String view2119); |
12 | 16 | ||
17 | List<EquipAlarmVO> getEquipAlarm(@Param("departId") String departId, @Param("month") String month); | ||
18 | |||
19 | List<EquipWarnVO> getEquipWarn(@Param("departId") String departId, @Param("month") String month); | ||
20 | |||
21 | List<EquipRunTimeVO> getEquipRunTime(@Param("departId") String departId, @Param("month") String month); | ||
22 | |||
23 | List<ArchivesWarnVO> getArchivesWarn(@Param("departId") String departId); | ||
24 | |||
25 | List<Map<String, Object>> getFlowData(@Param("departId") String departId, @Param("month") String month); | ||
13 | } | 26 | } | ... | ... |
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
3 | <mapper namespace="com.skua.modules.dataAnalysis.mapper.FactoryCenterMapper"> | 3 | <mapper namespace="com.skua.modules.dataAnalysis.mapper.FactoryOperateCenterMapper"> |
4 | <select id="getData" resultType="java.util.HashMap"> | 4 | <select id="getData" resultType="java.util.HashMap"> |
5 | SELECT | 5 | SELECT |
6 | ROUND(SUM( v3.DLHJ )/10000,2) AS yzdl, | 6 | ROUND(SUM( v3.DLHJ )/10000,2) AS yzdl, |
... | @@ -15,6 +15,109 @@ | ... | @@ -15,6 +15,109 @@ |
15 | ${view3a24} v3 | 15 | ${view3a24} v3 |
16 | LEFT JOIN (select v.CSL,v.time from ${view2119} v where LEFT ( v.time, 7 ) = #{month} and v.depart_id = #{departId}) v2 ON v2.time = v3.time | 16 | LEFT JOIN (select v.CSL,v.time from ${view2119} v where LEFT ( v.time, 7 ) = #{month} and v.depart_id = #{departId}) v2 ON v2.time = v3.time |
17 | where LEFT ( v3.time, 7 ) = #{month} | 17 | where LEFT ( v3.time, 7 ) = #{month} |
18 | and v3.depart_id = #{departId} | 18 | and v3.depart_id in |
19 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
20 | #{item} | ||
21 | </foreach> | ||
22 | </select> | ||
23 | |||
24 | <select id="getEquipAlarm" resultType="com.skua.modules.dataAnalysis.vo.EquipAlarmVO"> | ||
25 | SELECT | ||
26 | a.alarm_content AS content, | ||
27 | a.record_time AS date_time, | ||
28 | a.alarm_rule_level_name AS level, | ||
29 | a.alarm_rule_level_name AS type | ||
30 | FROM | ||
31 | alarm_record_history a | ||
32 | WHERE | ||
33 | a.depart_id in | ||
34 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
35 | #{item} | ||
36 | </foreach> | ||
37 | AND a.record_time LIKE CONCAT(#{month},'%') | ||
38 | AND a.alarm_rule_type IN ( 'B001B001', 'B001B002', 'B001B003', 'B001B004' ) | ||
39 | ORDER BY | ||
40 | a.record_time | ||
41 | </select> | ||
42 | |||
43 | <select id="getEquipWarn" resultType="com.skua.modules.dataAnalysis.vo.EquipWarnVO"> | ||
44 | SELECT | ||
45 | e.equipment_name AS equip_name, | ||
46 | '报废提醒' AS equip_type, | ||
47 | e.scrap_date AS over_time | ||
48 | FROM | ||
49 | equipment_info e | ||
50 | WHERE | ||
51 | e.depart_id in | ||
52 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
53 | #{item} | ||
54 | </foreach> | ||
55 | AND e.scrap_date != '' | ||
56 | AND LEFT(e.scrap_date,11) < DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 3 MONTH), '%Y-%m-%d') | ||
57 | </select> | ||
58 | |||
59 | <select id="getEquipRunTime" resultType="com.skua.modules.dataAnalysis.vo.EquipRunTimeVO"> | ||
60 | SELECT | ||
61 | e.equipment_name AS equip_name, | ||
62 | c.des AS equip_type, | ||
63 | m.id AS run_time | ||
64 | FROM | ||
65 | sys_monitor_metric_info m | ||
66 | LEFT JOIN equipment_info e ON m.equipment_code = e.id | ||
67 | LEFT JOIN equipment_category c ON e.equipment_type = c.id | ||
68 | WHERE | ||
69 | m.depart_id in | ||
70 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
71 | #{item} | ||
72 | </foreach> | ||
73 | AND m.metric_type = 1 | ||
74 | AND m.equipment_code IS NOT NULL | ||
75 | </select> | ||
76 | |||
77 | <select id="getArchivesWarn" resultType="com.skua.modules.dataAnalysis.vo.ArchivesWarnVO"> | ||
78 | SELECT | ||
79 | CONCAT( u.user_name, '人员合同' ) AS archives_name, | ||
80 | '人员合同' AS archives_type, | ||
81 | u.contract_enddate AS over_time | ||
82 | FROM | ||
83 | sys_factory_user_info u | ||
84 | WHERE | ||
85 | u.depart_id in | ||
86 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
87 | #{item} | ||
88 | </foreach> | ||
89 | AND LEFT ( u.contract_enddate, 11 ) < DATE_FORMAT( DATE_SUB( CURDATE( ), INTERVAL - 3 MONTH ), '%Y-%m-%d' ) | ||
90 | UNION ALL | ||
91 | SELECT | ||
92 | CONCAT( u.user_name, d.certifies_name ) AS archives_name, | ||
93 | '证件证书' AS archives_type, | ||
94 | d.end_time AS over_time | ||
95 | FROM | ||
96 | sys_factory_user_data d | ||
97 | LEFT JOIN sys_factory_user_info u ON d.base_id = u.id | ||
98 | WHERE | ||
99 | u.depart_id in | ||
100 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
101 | #{item} | ||
102 | </foreach> | ||
103 | AND LEFT ( d.end_time, 11 ) < DATE_FORMAT( DATE_SUB( CURDATE( ), INTERVAL - 3 MONTH ), '%Y-%m-%d' ) | ||
104 | </select> | ||
105 | |||
106 | <select id="getFlowData" resultType="java.util.HashMap"> | ||
107 | SELECT | ||
108 | a.REV_ AS status, | ||
109 | COUNT(a.ASSIGNEE_) AS count | ||
110 | FROM | ||
111 | act_ru_task a | ||
112 | LEFT JOIN sys_user u ON a.ASSIGNEE_ = CONCAT( 'taskUser_', u.id ) | ||
113 | LEFT JOIN sys_user_depart d ON u.id = d.user_id | ||
114 | WHERE | ||
115 | a.ASSIGNEE_ IS NOT NULL | ||
116 | AND d.dep_id in | ||
117 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
118 | #{item} | ||
119 | </foreach> | ||
120 | AND CREATE_TIME_ LIKE CONCAT(#{month},'%') | ||
121 | GROUP BY a.REV_ | ||
19 | </select> | 122 | </select> |
20 | </mapper> | 123 | </mapper> | ... | ... |
1 | package com.skua.modules.dataAnalysis.service; | 1 | package com.skua.modules.dataAnalysis.service; |
2 | 2 | ||
3 | import com.skua.modules.dataAnalysis.vo.ArchivesWarnVO; | ||
4 | import com.skua.modules.dataAnalysis.vo.EquipAlarmVO; | ||
5 | import com.skua.modules.dataAnalysis.vo.EquipRunTimeVO; | ||
6 | import com.skua.modules.dataAnalysis.vo.EquipWarnVO; | ||
7 | |||
8 | import java.util.List; | ||
3 | import java.util.Map; | 9 | import java.util.Map; |
4 | 10 | ||
5 | public interface IFactoryOperateCenterService { | 11 | public interface IFactoryOperateCenterService { |
6 | 12 | ||
7 | Map<String, Object> getData(String departId,String month); | 13 | Map<String, Object> getData(String departId,String month); |
8 | 14 | ||
15 | Map<String, Object> getReportData(String departId, String month); | ||
16 | |||
17 | List<EquipAlarmVO> getEquipAlarm(String departId, String month); | ||
18 | |||
19 | List<EquipWarnVO> getEquipWarn(String departId, String month); | ||
20 | |||
21 | List<EquipRunTimeVO> getEquipRunTime(String departId, String month); | ||
22 | |||
23 | List<ArchivesWarnVO> getArchivesWarn(String departId); | ||
24 | |||
25 | Map<String, Object> getFlowData(String departId, String month); | ||
9 | } | 26 | } |
10 | 27 | ... | ... |
... | @@ -5,10 +5,18 @@ import com.skua.common.report.ReportViewUtil; | ... | @@ -5,10 +5,18 @@ import com.skua.common.report.ReportViewUtil; |
5 | import com.skua.core.util.ConvertUtils; | 5 | import com.skua.core.util.ConvertUtils; |
6 | import com.skua.modules.dataAnalysis.mapper.FactoryOperateCenterMapper; | 6 | import com.skua.modules.dataAnalysis.mapper.FactoryOperateCenterMapper; |
7 | import com.skua.modules.dataAnalysis.service.IFactoryOperateCenterService; | 7 | import com.skua.modules.dataAnalysis.service.IFactoryOperateCenterService; |
8 | import com.skua.modules.dataAnalysis.vo.ArchivesWarnVO; | ||
9 | import com.skua.modules.dataAnalysis.vo.EquipAlarmVO; | ||
10 | import com.skua.modules.dataAnalysis.vo.EquipRunTimeVO; | ||
11 | import com.skua.modules.dataAnalysis.vo.EquipWarnVO; | ||
12 | import com.skua.modules.flow.service.FlowForThirdBusinessService; | ||
8 | import com.skua.tool.util.DateUtils; | 13 | import com.skua.tool.util.DateUtils; |
14 | import org.springframework.beans.factory.annotation.Autowired; | ||
9 | import org.springframework.stereotype.Service; | 15 | import org.springframework.stereotype.Service; |
10 | import javax.annotation.Resource; | 16 | import javax.annotation.Resource; |
17 | import java.util.ArrayList; | ||
11 | import java.util.HashMap; | 18 | import java.util.HashMap; |
19 | import java.util.List; | ||
12 | import java.util.Map; | 20 | import java.util.Map; |
13 | 21 | ||
14 | @Service | 22 | @Service |
... | @@ -16,104 +24,183 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer | ... | @@ -16,104 +24,183 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer |
16 | 24 | ||
17 | @Resource | 25 | @Resource |
18 | private FactoryOperateCenterMapper factoryOperateCenterMapper; | 26 | private FactoryOperateCenterMapper factoryOperateCenterMapper; |
27 | @Autowired | ||
28 | private FlowForThirdBusinessService flowForThirdBusinessService; | ||
19 | 29 | ||
20 | @Override | 30 | @Override |
21 | public Map<String, Object> getData(String departId, String month) { | 31 | public Map<String, Object> getData(String departId, String month) { |
22 | Map<String, Object> map = new HashMap<>(); | 32 | Map<String, Object> map = new HashMap<>(); |
23 | String monthTb = DateUtils.getTbMonth(month); | 33 | map.put("nclsl",new HashMap<>()); |
24 | String monthHb = DateUtils.getHbMonth(month); | 34 | Map<String, Object> nclslMap = new HashMap<>(); |
25 | String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," + | 35 | nclslMap.put("nsjsl","1267"); |
26 | "YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2"; | 36 | nclslMap.put("wcbfb","80"); |
27 | String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, month); | 37 | nclslMap.put("nmb","1678"); |
28 | String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, month); | 38 | nclslMap.put("nmbTb","5"); |
29 | Map<String, Object> valueMap = factoryOperateCenterMapper.getData(month, departId, dataViewName3a24, dataViewName2119); | 39 | nclslMap.put("nwcd","1234"); |
30 | String dataViewName3a24Hb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, monthHb); | 40 | nclslMap.put("nwcdTb","5"); |
31 | String dataViewName2119Hb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, monthHb); | 41 | |
32 | Map<String, Object> hbValueMap = factoryOperateCenterMapper.getData(monthHb, departId, dataViewName3a24Hb, dataViewName2119Hb); | ||
33 | String dataViewName3a24Tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, monthTb); | ||
34 | String dataViewName2119Tb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, monthTb); | ||
35 | Map<String, Object> tbValueMap = factoryOperateCenterMapper.getData(monthTb, departId, dataViewName3a24Tb, dataViewName2119Tb); | ||
36 | map.put("yclsl",new HashMap<>()); | 42 | map.put("yclsl",new HashMap<>()); |
37 | Map<String, Object> yclslMap = new HashMap<>(); | 43 | Map<String, Object> yclslMap = new HashMap<>(); |
38 | yclslMap.put("unit","万吨"); | 44 | yclslMap.put("ysjsl","185"); |
39 | map.put("rjclsl",new HashMap<>()); | 45 | yclslMap.put("wcbfb","80"); |
40 | Map<String, Object> rjclslMap = new HashMap<>(); | 46 | yclslMap.put("ymb","161"); |
41 | rjclslMap.put("unit","万吨"); | 47 | yclslMap.put("ymbTb","5"); |
42 | map.put("yzdl",new HashMap<>()); | 48 | yclslMap.put("ywcd","161"); |
43 | Map<String, Object> yzdlMap = new HashMap<>(); | 49 | yclslMap.put("ywcdTb","5"); |
44 | yzdlMap.put("unit","万Kw.h"); | 50 | |
45 | map.put("dsdh",new HashMap<>()); | 51 | map.put("ndsdh",new HashMap<>()); |
46 | Map<String, Object> dsdhMap = new HashMap<>(); | 52 | Map<String, Object> ndsdhMap = new HashMap<>(); |
47 | dsdhMap.put("unit","Kw.h/吨水"); | 53 | ndsdhMap.put("ndsdh","0.5"); |
48 | map.put("yzcnl",new HashMap<>()); | 54 | ndsdhMap.put("nmb","0.45"); |
49 | Map<String, Object> yzcnlMap = new HashMap<>(); | 55 | ndsdhMap.put("nmbTb","5"); |
50 | yzcnlMap.put("unit","吨"); | 56 | ndsdhMap.put("ydsdh","1234"); |
51 | map.put("wdscnl",new HashMap<>()); | 57 | ndsdhMap.put("ydsdhTb","5"); |
52 | Map<String, Object> wdscnlMap = new HashMap<>(); | 58 | |
53 | wdscnlMap.put("unit","吨/万吨"); | 59 | map.put("ndsyf",new HashMap<>()); |
54 | map.put("rjdl",new HashMap<>()); | 60 | Map<String, Object> ndsyfMap = new HashMap<>(); |
55 | Map<String, Object> rjdlMap = new HashMap<>(); | 61 | ndsyfMap.put("ndsyf","0.8"); |
56 | rjdlMap.put("unit","万Kw.h"); | 62 | ndsyfMap.put("nmb","0.65"); |
57 | if(valueMap != null){ | 63 | ndsyfMap.put("nmbTb","4"); |
58 | yclslMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("yclsl")) ? valueMap.get("yclsl").toString() : "-");//月总处理水量 | 64 | ndsyfMap.put("ydsyf","0.68"); |
59 | rjclslMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("rjclsl")) ? valueMap.get("rjclsl").toString() : "-");//日均处理水量 | 65 | ndsyfMap.put("ydsyfTb","5"); |
60 | yzdlMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("yzdl")) ? valueMap.get("yzdl").toString() : "-");//月总电量 | 66 | |
61 | dsdhMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("dsdh")) ? valueMap.get("dsdh").toString() : "-");//吨水电耗 | 67 | map.put("zhpf",new HashMap<>()); |
62 | yzcnlMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("yzcnl")) ? valueMap.get("yzcnl").toString() : "-");//月总产泥量 | 68 | Map<String, Object> zhpfMap = new HashMap<>(); |
63 | wdscnlMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("wdscnl")) ? valueMap.get("wdscnl").toString() : "-");//万吨水产泥量 | 69 | int sl = 100;int dh = 98;int yh = 91; |
64 | rjdlMap.put("value", ConvertUtils.isNotEmpty(valueMap.get("rjdl")) ? valueMap.get("rjdl").toString() : "-");//日均电量 | 70 | int slTb = 95;int dhTb = 93;int yhTb = 95; |
65 | }else{ | 71 | int zh = (sl + dh + yh)/3; |
66 | yclslMap.put("value","-");//月总处理水量 | 72 | int zhTb = (slTb + dhTb + yhTb)/3; |
67 | rjclslMap.put("value","-");//日均处理水量 | 73 | int zhBfb = 100 * (zh - zhTb)/zhTb; |
68 | yzdlMap.put("value","-");//月总电量 | 74 | int slBfb = 100 * (sl - slTb)/slTb; |
69 | dsdhMap.put("value","-");//吨水电耗 | 75 | int dhBfb = 100 * (dh - dhTb)/dhTb; |
70 | yzcnlMap.put("value","-");//月总产泥量 | 76 | int yhBfb = 100 * (yh - yhTb)/yhTb; |
71 | wdscnlMap.put("value","-");//万吨水产泥量 | 77 | zhpfMap.put("zh", zh); |
72 | rjdlMap.put("value","-");//日均电量 | 78 | zhpfMap.put("zhTb", zhBfb); |
73 | } | 79 | zhpfMap.put("sl", sl); |
74 | if(hbValueMap != null){ | 80 | zhpfMap.put("slTb", slBfb); |
75 | yclslMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("yclsl")) ? hbValueMap.get("yclsl").toString() : "-");//月总处理水量 | 81 | zhpfMap.put("dh", dh); |
76 | rjclslMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("rjclsl")) ? hbValueMap.get("rjclsl").toString() : "-");//日均处理水量 | 82 | zhpfMap.put("dhTb", dhBfb); |
77 | yzdlMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("yzdl")) ? hbValueMap.get("yzdl").toString() : "-");//月总电量 | 83 | zhpfMap.put("yh", yh); |
78 | dsdhMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("dsdh")) ? hbValueMap.get("dsdh").toString() : "-");//吨水电耗 | 84 | zhpfMap.put("yhTb", yhBfb); |
79 | yzcnlMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("yzcnl")) ? hbValueMap.get("yzcnl").toString() : "-");//月总产泥量 | ||
80 | wdscnlMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("wdscnl")) ? hbValueMap.get("wdscnl").toString() : "-");//万吨水产泥量 | ||
81 | rjdlMap.put("valueHb", ConvertUtils.isNotEmpty(hbValueMap.get("rjdl")) ? hbValueMap.get("rjdl").toString() : "-");//日均电量 | ||
82 | }else{ | ||
83 | yclslMap.put("valueHb","-");//月总处理水量 | ||
84 | rjclslMap.put("valueHb","-");//日均处理水量 | ||
85 | yzdlMap.put("valueHb","-");//月总电量 | ||
86 | dsdhMap.put("valueHb","-");//吨水电耗 | ||
87 | yzcnlMap.put("valueHb","-");//月总产泥量 | ||
88 | wdscnlMap.put("valueHb","-");//万吨水产泥量 | ||
89 | rjdlMap.put("valueHb","-");//日均电量 | ||
90 | } | ||
91 | if(tbValueMap != null){ | ||
92 | yclslMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("yclsl")) ? tbValueMap.get("yclsl").toString() : "-");//月总处理水量 | ||
93 | rjclslMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("rjclsl")) ? tbValueMap.get("rjclsl").toString() : "-");//日均处理水量 | ||
94 | yzdlMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("yzdl")) ? tbValueMap.get("yzdl").toString() : "-");//月总电量 | ||
95 | dsdhMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("dsdh")) ? tbValueMap.get("dsdh").toString() : "-");//吨水电耗 | ||
96 | yzcnlMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("yzcnl")) ? tbValueMap.get("yzcnl").toString() : "-");//月总产泥量 | ||
97 | wdscnlMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("wdscnl")) ? tbValueMap.get("wdscnl").toString() : "-");//万吨水产泥量 | ||
98 | rjdlMap.put("valueTb", ConvertUtils.isNotEmpty(tbValueMap.get("rjdl")) ? tbValueMap.get("rjdl").toString() : "-");//日均电量 | ||
99 | }else{ | ||
100 | yclslMap.put("valueTb","-");//月总处理水量 | ||
101 | rjclslMap.put("valueTb","-");//日均处理水量 | ||
102 | yzdlMap.put("valueTb","-");//月总电量 | ||
103 | dsdhMap.put("valueTb","-");//吨水电耗 | ||
104 | yzcnlMap.put("valueTb","-");//月总产泥量 | ||
105 | wdscnlMap.put("valueTb","-");//万吨水产泥量 | ||
106 | rjdlMap.put("valueTb","-");//日均电量 | ||
107 | } | ||
108 | //汇总 | 85 | //汇总 |
86 | map.put("nclsl", nclslMap); | ||
109 | map.put("yclsl", yclslMap); | 87 | map.put("yclsl", yclslMap); |
110 | map.put("rjclsl", rjclslMap); | 88 | map.put("ndsdh", ndsdhMap); |
111 | map.put("yzdl", yzdlMap); | 89 | map.put("ndsyf", ndsyfMap); |
112 | map.put("dsdh", dsdhMap); | 90 | map.put("zhpf", zhpfMap); |
113 | map.put("yzcnl", yzcnlMap); | 91 | return map; |
114 | map.put("wdscnl", wdscnlMap); | 92 | } |
115 | map.put("rjdl", rjdlMap); | 93 | |
94 | @Override | ||
95 | public Map<String, Object> getReportData(String departId, String month) { | ||
96 | Map<String, Object> map = new HashMap<>(); | ||
97 | int nh = 100; | ||
98 | int hy = 100; | ||
99 | int df = 100; | ||
100 | int yyzb = 100; | ||
101 | int ndmb = 100; | ||
102 | int scyb = 100; | ||
103 | int zhf = 100; | ||
104 | map.put("nh",new HashMap<>()); | ||
105 | Map<String, Object> nhMap = new HashMap<>(); | ||
106 | nhMap.put("bfb",98); | ||
107 | nhMap.put("done",29); | ||
108 | nhMap.put("should",30); | ||
109 | |||
110 | map.put("hy",new HashMap<>()); | ||
111 | Map<String, Object> hyMap = new HashMap<>(); | ||
112 | hyMap.put("bfb",98); | ||
113 | hyMap.put("done",29); | ||
114 | hyMap.put("should",30); | ||
115 | |||
116 | map.put("df",new HashMap<>()); | ||
117 | Map<String, Object> dfMap = new HashMap<>(); | ||
118 | dfMap.put("bfb",98); | ||
119 | dfMap.put("done",29); | ||
120 | dfMap.put("should",30); | ||
121 | |||
122 | map.put("yyzb",new HashMap<>()); | ||
123 | Map<String, Object> yyzbMap = new HashMap<>(); | ||
124 | yyzbMap.put("bfb",75); | ||
125 | yyzbMap.put("done",3); | ||
126 | yyzbMap.put("should",4); | ||
127 | |||
128 | map.put("ndmb",new HashMap<>()); | ||
129 | Map<String, Object> ndmbMap = new HashMap<>(); | ||
130 | ndmbMap.put("bfb",100); | ||
131 | ndmbMap.put("done",1); | ||
132 | ndmbMap.put("should",1); | ||
133 | |||
134 | map.put("scyb",new HashMap<>()); | ||
135 | Map<String, Object> scybMap = new HashMap<>(); | ||
136 | scybMap.put("bfb",100); | ||
137 | scybMap.put("done",1); | ||
138 | scybMap.put("should",1); | ||
139 | |||
140 | map.put("zhf",new HashMap<>()); | ||
141 | Map<String, Object> zhfMap = new HashMap<>(); | ||
142 | zhfMap.put("zhf",98); | ||
143 | zhfMap.put("zhfHb",3); | ||
144 | //汇总 | ||
145 | map.put("nh", nhMap); | ||
146 | map.put("hy", hyMap); | ||
147 | map.put("df", dfMap); | ||
148 | map.put("yyzb", yyzbMap); | ||
149 | map.put("ndmb", ndmbMap); | ||
150 | map.put("scyb", scybMap); | ||
151 | map.put("zhf", zhfMap); | ||
116 | return map; | 152 | return map; |
117 | } | 153 | } |
118 | 154 | ||
155 | @Override | ||
156 | public List<EquipAlarmVO> getEquipAlarm(String departId, String month) { | ||
157 | List<EquipAlarmVO> list = new ArrayList<>(); | ||
158 | list = factoryOperateCenterMapper.getEquipAlarm(departId, month); | ||
159 | return list; | ||
160 | } | ||
161 | |||
162 | @Override | ||
163 | public List<EquipWarnVO> getEquipWarn(String departId, String month) { | ||
164 | List<EquipWarnVO> list = new ArrayList<>(); | ||
165 | list = factoryOperateCenterMapper.getEquipWarn(departId, month); | ||
166 | return list; | ||
167 | } | ||
168 | |||
169 | @Override | ||
170 | public List<EquipRunTimeVO> getEquipRunTime(String departId, String month) { | ||
171 | List<EquipRunTimeVO> list = new ArrayList<>(); | ||
172 | list = factoryOperateCenterMapper.getEquipRunTime(departId, month); | ||
173 | return list; | ||
174 | } | ||
175 | |||
176 | @Override | ||
177 | public List<ArchivesWarnVO> getArchivesWarn(String departId) { | ||
178 | List<ArchivesWarnVO> list = new ArrayList<>(); | ||
179 | list = factoryOperateCenterMapper.getArchivesWarn(departId); | ||
180 | return list; | ||
181 | } | ||
182 | |||
183 | @Override | ||
184 | public Map<String, Object> getFlowData(String departId, String month) { | ||
185 | Map<String, Object> map = new HashMap<>(); | ||
186 | int no = 0;//未完成工单 | ||
187 | int yes = 0;//完成工单 | ||
188 | List<Map<String, Object>> list = factoryOperateCenterMapper.getFlowData(departId,month); | ||
189 | if(list.size() > 0){ | ||
190 | for (Map<String, Object> flowMap : list) { | ||
191 | if("2".equals(flowMap.get("status").toString())){ | ||
192 | yes = Integer.parseInt(flowMap.get("status").toString()); | ||
193 | }else{ | ||
194 | no = no + Integer.parseInt(flowMap.get("status").toString()); | ||
195 | } | ||
196 | } | ||
197 | } | ||
198 | map.put("total", yes + no); | ||
199 | map.put("no", no); | ||
200 | map.put("ing", no); | ||
201 | map.put("yes", yes); | ||
202 | return map; | ||
203 | } | ||
204 | |||
205 | |||
119 | } | 206 | } | ... | ... |
1 | package com.skua.modules.dataAnalysis.vo; | ||
2 | |||
3 | import io.swagger.annotations.ApiModelProperty; | ||
4 | import lombok.Data; | ||
5 | |||
6 | |||
7 | @Data | ||
8 | public class ArchivesWarnVO { | ||
9 | |||
10 | @ApiModelProperty(value = "档案名称") | ||
11 | private String archivesName; | ||
12 | |||
13 | @ApiModelProperty(value = "档案类型") | ||
14 | private String archivesType; | ||
15 | |||
16 | @ApiModelProperty(value = "到期时间") | ||
17 | private String overTime; | ||
18 | |||
19 | } |
1 | package com.skua.modules.dataAnalysis.vo; | ||
2 | |||
3 | import io.swagger.annotations.ApiModelProperty; | ||
4 | import lombok.Data; | ||
5 | |||
6 | |||
7 | @Data | ||
8 | public class EquipAlarmVO { | ||
9 | |||
10 | @ApiModelProperty(value = "内容") | ||
11 | private String content; | ||
12 | |||
13 | @ApiModelProperty(value = "时间") | ||
14 | private String dateTime; | ||
15 | |||
16 | @ApiModelProperty(value = "级别") | ||
17 | private String level; | ||
18 | |||
19 | @ApiModelProperty(value = "类型") | ||
20 | private String type; | ||
21 | |||
22 | } |
1 | package com.skua.modules.dataAnalysis.vo; | ||
2 | |||
3 | import io.swagger.annotations.ApiModelProperty; | ||
4 | import lombok.Data; | ||
5 | |||
6 | |||
7 | @Data | ||
8 | public class EquipRunTimeVO { | ||
9 | |||
10 | @ApiModelProperty(value = "设备名称") | ||
11 | private String equipName; | ||
12 | |||
13 | @ApiModelProperty(value = "设备类型") | ||
14 | private String equipType; | ||
15 | |||
16 | @ApiModelProperty(value = "运行时间") | ||
17 | private String runTime; | ||
18 | |||
19 | } |
1 | package com.skua.modules.dataAnalysis.vo; | ||
2 | |||
3 | import io.swagger.annotations.ApiModelProperty; | ||
4 | import lombok.Data; | ||
5 | |||
6 | |||
7 | @Data | ||
8 | public class EquipWarnVO { | ||
9 | |||
10 | @ApiModelProperty(value = "设备名称") | ||
11 | private String equipName; | ||
12 | |||
13 | @ApiModelProperty(value = "设备类型") | ||
14 | private String equipType; | ||
15 | |||
16 | @ApiModelProperty(value = "逾期时间") | ||
17 | private String overTime; | ||
18 | |||
19 | } |
-
请 注册 或 登录 后发表评论