From 6fc3fdb77e56ba93954652e7999c83786963a858 Mon Sep 17 00:00:00 2001 From: wuzeyu <1223318623@qq.com> Date: 星期五, 29 三月 2024 14:35:47 +0800 Subject: [PATCH] 修改 查询监测站流量计绑定记录接口 一个监测站只显示最近一次操作 --- pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java | 18 +++++------------- 1 files changed, 5 insertions(+), 13 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java index 362b1ca..e0d70d1 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java @@ -3,6 +3,7 @@ import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; +import com.dy.common.mw.protocol.Command; import com.dy.common.webUtil.QueryResultVo; import com.dy.pipIrrGlobal.daoPr.PrControllerMapper; import com.dy.pipIrrGlobal.daoPr.PrIntakeControllerMapper; @@ -14,15 +15,19 @@ import org.apache.dubbo.common.utils.PojoUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; +import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; + +import static com.dy.common.mw.protocol.CommandType.innerCommand; /** * @author ZhuBaoMin @@ -65,19 +70,6 @@ rsVo.calculateAndSet(itemTotal, params); rsVo.obj = prControllerMapper.getControllers(params); - - ArrayList<Object> list = new ArrayList<>(); - List<VoController> controllers = prControllerMapper.getControllers(params); - for (int i = 0; i < controllers.size(); i++) { - VoController controller = controllers.get(i); - String rtuAddr = controller.getRtuAddr(); - list.add(rtuAddr); - } - String url = "http://localhost:8080/accMw/com/send"; - HttpEntity<?> httpEntity = new HttpEntity<>(list); - ResponseEntity<String> entity = restTemplate.exchange(url, HttpMethod.GET, httpEntity, String.class); - JSONObject data = JSONObject.parseObject(entity.getBody()).getJSONObject("data"); - data.getString("rtuAddr"); return rsVo; } -- Gitblit v1.8.0