wuzeyu
2024-03-28 9a096e808f24e953dcfcdb1383a05032187bd819
修改 监测站编号获取绑定记录接口 ID由Long变为String
5个文件已修改
62 ■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrMonitoringFlowmeterMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrMonitoringFlowmeterMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/flowMonitoring/MoniFlowCtrl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/flowMonitoring/MoniFlowSv.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrMonitoringFlowmeterMapper.java
@@ -39,5 +39,5 @@
     * @param monitoringId 监测站编号
     * @return 绑定记录
     */
    List<Map<String, Object>> getBingRecordsByMonitoringId(Long monitoringId);
    List<Map<String, Object>> getBingRecordsByMonitoringId(String monitoringId);
}
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrMonitoringFlowmeterMapper.xml
@@ -149,11 +149,10 @@
  </select>
  <!--根据 流量监测站编号 获取 绑定记录 按操作时间降序-->
  <select id="getBingRecordsByMonitoringId" parameterType="_long" resultType="java.util.Map">
    select  (@i:=@i+1)                                           AS id,
  <select id="getBingRecordsByMonitoringId" parameterType="string" resultType="java.util.Map">
    select  CAST(pmf.id AS char)AS id,
    <include refid="Base_Column_List_NoId" />
    from pr_monitoring_flowmeter
    ,(SELECT @i:=0) AS itable
    from pr_monitoring_flowmeter pmf
    where
    monitoringId=#{monitoringId,jdbcType=BIGINT}
    order by operateDt desc
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/controller/ControllerSv.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoPr.PrControllerMapper;
import com.dy.pipIrrGlobal.daoPr.PrIntakeControllerMapper;
@@ -12,7 +13,11 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.List;
@@ -38,8 +43,13 @@
    @Autowired
    private PrIntakeControllerMapper prIntakeControllerMapper;
    @Autowired
    private RestTemplate restTemplate;
    /**
     * 根据指定获取控制器记录
     *
     * @param queryVo
     * @return
     */
@@ -48,17 +58,32 @@
        Long itemTotal = prControllerMapper.getRecordCount(params);
        QueryResultVo<List<VoController>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = queryVo.pageSize ;
        rsVo.pageCurr = queryVo.pageCurr ;
        QueryResultVo<List<VoController>> rsVo = new QueryResultVo<>();
        rsVo.pageSize = queryVo.pageSize;
        rsVo.pageCurr = queryVo.pageCurr;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = prControllerMapper.getControllers(params);
        return rsVo ;
        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;
    }
    /**
     * 添加控制器
     *
     * @param po
     * @return
     */
@@ -77,6 +102,7 @@
    /**
     * 根据控制器地址获取控制器列表
     *
     * @param rtuAddr
     * @return
     */
@@ -86,6 +112,7 @@
    /**
     * 根据控制器编号逻辑删除控制
     *
     * @param controllerId
     * @return
     */
@@ -95,6 +122,7 @@
    /**
     * 根据指定条件导出控制器列表
     *
     * @param queryVo
     * @return
     */
@@ -102,19 +130,22 @@
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
        List<VoController> rsVo = new ArrayList<>();
        rsVo = prControllerMapper.getControllers(params);
        return rsVo ;
        return rsVo;
    }
    /**
     * 根据控制器编号获取未删除的控制器数量
     *
     * @param controllerId
     * @return
     */
    public Integer getRecordCountOfController(Long controllerId) {
        return prControllerMapper.getRecordCountOfController(controllerId);
    }
    /**
     * 根据控制器编号获取已绑定记录数
     *
     * @param controllerId
     * @return
     */
@@ -124,6 +155,7 @@
    /**
     * 根据主键删除外键
     *
     * @param controllerId
     * @return
     */
@@ -133,13 +165,14 @@
    /**
     * 获取未绑控制器的取水口列表
     *
     * @return
     */
    public JSONArray getNoBindingIntakes() {
        List<Map<String, Object>> list = Optional.ofNullable(prIntakeMapper.getNoBindingIntakes()).orElse(new ArrayList<>());
        JSONArray array= null;
        if(list.size() > 0) {
            array= JSONArray.parseArray(JSON.toJSONString(list));
        JSONArray array = null;
        if (list.size() > 0) {
            array = JSONArray.parseArray(JSON.toJSONString(list));
        }
        return array;
    }
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/flowMonitoring/MoniFlowCtrl.java
@@ -151,7 +151,7 @@
    })
    @GetMapping(path = "bingRecords/{monitoringId}")
    @SsoAop()
    public BaseResponse<List<Map<String, Object>>> getBingRecordsByMonitoringId(@PathVariable("monitoringId") Long monitoringId) {
    public BaseResponse<List<Map<String, Object>>> getBingRecordsByMonitoringId(@PathVariable("monitoringId") String monitoringId) {
        try {
            List<Map<String, Object>> list = Optional.ofNullable(moniFlowSv.getBingRecordsByMonitoringId(monitoringId)).orElse(new ArrayList<>());
            if (list.size() <= 0) {
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/flowMonitoring/MoniFlowSv.java
@@ -47,7 +47,7 @@
     * @param monitoringId
     * @return  PrMonitoringFlowmeter
     * */
    public List<Map<String, Object>> getBingRecordsByMonitoringId(Long monitoringId){
    public List<Map<String, Object>> getBingRecordsByMonitoringId(String monitoringId){
        return prMonitoringFlowmeterMapper.getBingRecordsByMonitoringId(monitoringId);
    }
}