| | |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrIntakeController; |
| | | import com.dy.pipIrrGlobal.voPr.VoController; |
| | | import com.dy.pipIrrGlobal.voPr.VoOnLineIntake; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | comSendUrl = env.getProperty(pro_mw + "." + DataSourceContext.get() + "." + key_mw); |
| | | |
| | | 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); |
| | | //JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment").getJSONObject("onLineMap"); |
| | | JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment"); |
| | | |
| | | 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); |
| | | if(attachment != null) { |
| | | //HashMap<String, Boolean> onLineMap = JSON.parseObject(attachment.toJSONString(), HashMap.class); |
| | | //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); |
| | | //} |
| | | attachment.forEach((key, value) -> { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("rtuAddr", key); |
| | | jsonObject.put("isOnLine", value); |
| | | jsonArray.add(jsonObject); |
| | | |
| | | }); |
| | | } |
| | | |
| | | queryVo.setOnLineMap(jsonArray.toJSONString()); |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | |
| | | import com.dy.pipIrrGlobal.pojoPr.PrIntake; |
| | | import com.dy.pipIrrGlobal.voPr.VoIntake; |
| | | import com.dy.pipIrrGlobal.voPr.VoOnLineIntake; |
| | | import com.dy.pipIrrProject.intake.qo.OnLineIntakesQO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | 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); |
| | | //JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment").getJSONObject("onLineMap"); |
| | | JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment"); |
| | | |
| | | 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); |
| | | if(attachment != null) { |
| | | //HashMap<String, Boolean> onLineMap = JSON.parseObject(attachment.toJSONString(), HashMap.class); |
| | | //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); |
| | | //} |
| | | attachment.forEach((key, value) -> { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("rtuAddr", key); |
| | | jsonObject.put("isOnLine", value); |
| | | jsonArray.add(jsonObject); |
| | | |
| | | }); |
| | | } |
| | | return prIntakeMapper.getUsedIntakes(jsonArray.toJSONString(), operator); |
| | | } else { |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | JSONObject response = (JSONObject) JSON.toJSON(sendCom2Mw(com)); |
| | | if(response != null && response.getString("code").equals("0001")) { |
| | | JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment").getJSONObject("onLineMap"); |
| | | //JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment").getJSONObject("onLineMap"); |
| | | JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment"); |
| | | |
| | | JSONArray jsonArray = new JSONArray(); |
| | | if(attachment != null) { |
| | | HashMap<String, Boolean> onLineMap = JSON.parseObject(attachment.toJSONString(), HashMap.class); |
| | | for (Map.Entry<String, Boolean> entry : onLineMap.entrySet()) { |
| | | //HashMap<String, Boolean> onLineMap = JSON.parseObject(attachment.toJSONString(), HashMap.class); |
| | | //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); |
| | | //} |
| | | attachment.forEach((key, value) -> { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("rtuAddr", entry.getKey()); |
| | | jsonObject.put("isOnLine", entry.getValue()); |
| | | jsonObject.put("rtuAddr", key); |
| | | jsonObject.put("isOnLine", value); |
| | | jsonArray.add(jsonObject); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | | System.out.println(jsonArray); |
| | |
| | | |
| | | 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); |
| | | //JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment").getJSONObject("onLineMap"); |
| | | JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment"); |
| | | |
| | | 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); |
| | | if(attachment != null) { |
| | | //HashMap<String, Boolean> onLineMap = JSON.parseObject(attachment.toJSONString(), HashMap.class); |
| | | //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); |
| | | //} |
| | | attachment.forEach((key, value) -> { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("rtuAddr", key); |
| | | jsonObject.put("isOnLine", value); |
| | | jsonArray.add(jsonObject); |
| | | |
| | | }); |
| | | } |
| | | System.out.println(jsonArray); |
| | | return rmCommandHistoryMapper.getUncloseParam(jsonArray.toJSONString(), intakeId); |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | |
| | | |
| | | JSONObject response = (JSONObject) JSON.toJSON(sendCom2Mw(com)); |
| | | if(response != null && response.getString("code").equals("0001")) { |
| | | JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment").getJSONObject("onLineMap"); |
| | | //JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment").getJSONObject("onLineMap"); |
| | | JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment"); |
| | | |
| | | JSONArray jsonArray = new JSONArray(); |
| | | if(attachment != null) { |
| | | HashMap<String, Boolean> onLineMap = JSON.parseObject(attachment.toJSONString(), HashMap.class); |
| | | for (Map.Entry<String, Boolean> entry : onLineMap.entrySet()) { |
| | | //HashMap<String, Boolean> onLineMap = JSON.parseObject(attachment.toJSONString(), HashMap.class); |
| | | //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); |
| | | //} |
| | | attachment.forEach((key, value) -> { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("rtuAddr", entry.getKey()); |
| | | jsonObject.put("isOnLine", entry.getValue()); |
| | | jsonObject.put("rtuAddr", key); |
| | | jsonObject.put("isOnLine", value); |
| | | jsonArray.add(jsonObject); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | | System.out.println(jsonArray.toJSONString()); |
| | |
| | | import org.springframework.web.util.UriComponentsBuilder; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | JSONObject response = (JSONObject) JSON.toJSON(sendCom2Mw(com)); |
| | | if(response != null && response.getString("code").equals("0001")) { |
| | | JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment").getJSONObject("onLineMap"); |
| | | //JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment").getJSONObject("onLineMap"); |
| | | JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment"); |
| | | |
| | | JSONArray jsonArray = new JSONArray(); |
| | | if(attachment != null) { |
| | | HashMap<String, Boolean> onLineMap = JSON.parseObject(attachment.toJSONString(), HashMap.class); |
| | | for (Map.Entry<String, Boolean> entry : onLineMap.entrySet()) { |
| | | //HashMap<String, Boolean> onLineMap = JSON.parseObject(attachment.toJSONString(), HashMap.class); |
| | | //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); |
| | | //} |
| | | attachment.forEach((key, value) -> { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("rtuAddr", entry.getKey()); |
| | | jsonObject.put("isOnLine", entry.getValue()); |
| | | jsonObject.put("rtuAddr", key); |
| | | jsonObject.put("isOnLine", value); |
| | | jsonArray.add(jsonObject); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | | qo.setOnLineMap(jsonArray.toJSONString()); |
| | |
| | | |
| | | JSONObject response = (JSONObject) JSON.toJSON(sendCom2Mw(com)); |
| | | if(response != null && response.getString("code").equals("0001")) { |
| | | JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment").getJSONObject("onLineMap"); |
| | | //JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment").getJSONObject("onLineMap"); |
| | | JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment"); |
| | | |
| | | JSONArray jsonArray = new JSONArray(); |
| | | if(attachment != null) { |
| | | HashMap<String, Boolean> onLineMap = JSON.parseObject(attachment.toJSONString(), HashMap.class); |
| | | for (Map.Entry<String, Boolean> entry : onLineMap.entrySet()) { |
| | | //HashMap<String, Boolean> onLineMap = JSON.parseObject(attachment.toJSONString(), HashMap.class); |
| | | //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); |
| | | //} |
| | | attachment.forEach((key, value) -> { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("rtuAddr", entry.getKey()); |
| | | jsonObject.put("isOnLine", entry.getValue()); |
| | | jsonObject.put("rtuAddr", key); |
| | | jsonObject.put("isOnLine", value); |
| | | jsonArray.add(jsonObject); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | | qo.setOnLineMap(jsonArray.toJSONString()); |