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;
    }