| | |
| | | return rmCommandHistoryMapper.updateByPrimaryKeySelective(po); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据操作员ID获取未关阀记录 |
| | | * @param operator |
| | | * @return |
| | | */ |
| | | public List<VoUnclosedValve> getUnclosedValves(Long operator) { |
| | | return rmCommandHistoryMapper.getUnclosedValves(operator); |
| | | } |
| | | |
| | | /** |
| | | * 获取取水口列表 |
| | | * @return |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据操作员ID获取未关阀记录(包含在线情况) |
| | | * @param operator |
| | | * @return |
| | | */ |
| | | public List<VoUnclosedValve> getUnclosedValves(Long operator) { |
| | | Command com = new Command() ; |
| | | com.id = Command.defaultId; |
| | | com.code = "LCD0001"; |
| | | com.type = "innerCommand"; |
| | | |
| | | JSONObject response = (JSONObject) JSON.toJSON(sendCom2Mw(com)); |
| | | |
| | | if(response != null && response.getString("code").equals("0001")) { |
| | | JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment").getJSONObject("onLineMap"); |
| | | HashMap<String, Boolean> onLineMap = JSON.parseObject(attachment.toJSONString(), HashMap.class); |
| | | |
| | | JSONArray jsonArray = new JSONArray(); |
| | | for (Map.Entry<String, Boolean> entry : onLineMap.entrySet()) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("rtuAddr", entry.getKey()); |
| | | jsonObject.put("isOnLine", entry.getValue()); |
| | | jsonArray.add(jsonObject); |
| | | } |
| | | |
| | | List<VoUnclosedValve> res = rmCommandHistoryMapper.getUnclosedValves(jsonArray.toJSONString(), operator); |
| | | if(res != null) { |
| | | return res; |
| | | } else { |
| | | return new ArrayList<>(); |
| | | } |
| | | } else { |
| | | QueryResultVo<List<VoOnLineIntake>> rsVo = new QueryResultVo<>(); |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | |
| | | } |