From c8ffc5ed851f85808aa735a575402ebae4b00da9 Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期六, 09 十一月 2024 08:19:21 +0800 Subject: [PATCH] 获取全部取水口接口取消在线情况判断 --- pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/intake/qo/OnLineIntakesQO.java | 13 ---- pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/intake/IntakeCtrl.java | 1 pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/intake/IntakeSv.java | 89 ++++++++++++++--------------- pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml | 27 +------- 4 files changed, 47 insertions(+), 83 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml index 5c02036..6b07701 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrIntakeMapper.xml @@ -603,31 +603,14 @@ </trim> </select> - - - - - - - - - - <!--鏍规嵁鍙栨按鍙g紪鍙疯幏鍙栧彇姘村彛瀵硅薄--> <select id="getIntakeByName" resultType="com.dy.pipIrrGlobal.voPr.VoOnLineIntake"> - SELECT con.intakeId, - con.rtuAddr, - inta.name AS intakeNum, - rtus.isOnLine + SELECT + con.intakeId, + con.rtuAddr, + inta.name AS intakeNum FROM pr_controller con - INNER JOIN pr_intake inta ON con.intakeId = inta.id - left JOIN JSON_TABLE( - #{onLineMap}, - '$[*]' COLUMNS ( - rtuAddr VARCHAR(20) PATH '$.rtuAddr', - isOnLine BOOLEAN PATH '$.isOnLine' - ) - ) rtus ON con.rtuAddr = rtus.rtuAddr + INNER JOIN pr_intake inta ON con.intakeId = inta.id <where> <if test="intakeNum != null and intakeNum != ''"> AND LOWER(inta.name) = #{intakeNum} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/intake/IntakeCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/intake/IntakeCtrl.java index b8a722e..435445d 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/intake/IntakeCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/intake/IntakeCtrl.java @@ -36,7 +36,6 @@ * @param qo * @return */ - //@GetMapping(path = "one_intake") @GetMapping(path = "all_intakes") public BaseResponse<QueryResultVo<VoOnLineIntake>> getOneIntake(OnLineIntakesQO qo) { try { diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/intake/IntakeSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/intake/IntakeSv.java index f8ce89c..d48c4fd 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/intake/IntakeSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/intake/IntakeSv.java @@ -68,30 +68,28 @@ * @return */ public VoOnLineIntake selectOneIntake(OnLineIntakesQO qo) { - Command com = new Command() ; - com.id = Command.defaultId; - com.code = "LCD0001"; - com.type = "innerCommand"; - comSendUrl = env.getProperty(pro_mw + "." + DataSourceContext.get() + "." + key_mw); + //Command com = new Command() ; + //com.id = Command.defaultId; + //com.code = "LCD0001"; + //com.type = "innerCommand"; + //comSendUrl = env.getProperty(pro_mw + "." + DataSourceContext.get() + "." + key_mw); + // + //JSONObject response = (JSONObject) JSON.toJSON(sendCom2Mw(com)); + // + //JSONArray jsonArray = new JSONArray(); + //if(response != null && response.getString("code").equals("0001")) { + // JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment"); + // if(attachment != null) { + // attachment.forEach((key, value) -> { + // JSONObject jsonObject = new JSONObject(); + // jsonObject.put("rtuAddr", key); + // jsonObject.put("isOnLine", value); + // jsonArray.add(jsonObject); + // }); + // } + //} + //qo.setOnLineMap(jsonArray.toJSONString()); - JSONObject response = (JSONObject) JSON.toJSON(sendCom2Mw(com)); - - JSONArray jsonArray = new JSONArray(); - if(response != null && response.getString("code").equals("0001")) { - JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment"); - if(attachment != null) { - attachment.forEach((key, value) -> { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("rtuAddr", key); - jsonObject.put("isOnLine", value); - jsonArray.add(jsonObject); - }); - } - //} else { - // return new VoOnLineIntake(); - } - - qo.setOnLineMap(jsonArray.toJSONString()); // 濡傛灉 intakeNum 涓嶄负绌猴紝鍒欒浆涓哄皬鍐欏啀鍐欏叆qo瀵硅薄 String intakeNum = qo.getIntakeNum(); if(intakeNum != null) { @@ -107,31 +105,28 @@ * @return */ public QueryResultVo<List<VoOnLineIntake>> selectAllIntakes(OnLineIntakesQO qo) { - Command com = new Command() ; - com.id = Command.defaultId; - com.code = "LCD0001"; - com.type = "innerCommand"; - comSendUrl = env.getProperty(pro_mw + "." + DataSourceContext.get() + "." + key_mw); + //Command com = new Command() ; + //com.id = Command.defaultId; + //com.code = "LCD0001"; + //com.type = "innerCommand"; + //comSendUrl = env.getProperty(pro_mw + "." + DataSourceContext.get() + "." + key_mw); + // + //JSONObject response = (JSONObject) JSON.toJSON(sendCom2Mw(com)); + // + //JSONArray jsonArray = new JSONArray(); + //if(response != null && response.getString("code").equals("0001")) { + // JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment"); + // if(attachment != null) { + // attachment.forEach((key, value) -> { + // JSONObject jsonObject = new JSONObject(); + // jsonObject.put("rtuAddr", key); + // jsonObject.put("isOnLine", value); + // jsonArray.add(jsonObject); + // }); + // } + //} + //qo.setOnLineMap(jsonArray.toJSONString()); - JSONObject response = (JSONObject) JSON.toJSON(sendCom2Mw(com)); - - JSONArray jsonArray = new JSONArray(); - if(response != null && response.getString("code").equals("0001")) { - JSONObject attachment = response.getJSONObject("content").getJSONObject("attachment"); - if(attachment != null) { - attachment.forEach((key, value) -> { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("rtuAddr", key); - jsonObject.put("isOnLine", value); - jsonArray.add(jsonObject); - }); - } - //} else { - // QueryResultVo<List<VoOnLineIntake>> rsVo = new QueryResultVo<>(); - // return rsVo; - } - - qo.setOnLineMap(jsonArray.toJSONString()); // 濡傛灉 intakeNum 涓嶄负绌猴紝鍒欒浆涓哄皬鍐欏啀鍐欏叆qo瀵硅薄 String intakeNum = qo.getIntakeNum(); if(intakeNum != null) { diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/intake/qo/OnLineIntakesQO.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/intake/qo/OnLineIntakesQO.java index da34da0..bf92c9f 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/intake/qo/OnLineIntakesQO.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/intake/qo/OnLineIntakesQO.java @@ -1,8 +1,6 @@ package com.dy.pipIrrWechat.intake.qo; import com.dy.common.webUtil.QueryConditionVo; -import jakarta.validation.constraints.Max; -import jakarta.validation.constraints.Min; import lombok.Data; import lombok.EqualsAndHashCode; @@ -17,19 +15,8 @@ @EqualsAndHashCode(callSuper = false) public class OnLineIntakesQO extends QueryConditionVo { /** - * 涓棿浠惰繑鍥炵殑RTU鍦ㄧ嚎鎯呭喌瀵硅薄鏁扮粍 - */ - private String onLineMap; - - /** * 鍙栨按鍙g紪鍙� */ private String intakeNum; - /** - * 鏄惁鍦ㄧ嚎 - */ - @Max(value = 1,message = "鏄惁鍦ㄧ嚎浠呭厑璁镐负鐪熸垨鍋�") - @Min(value = 0,message = "鏄惁鍦ㄧ嚎浠呭厑璁镐负鐪熸垨鍋�") - private Boolean isOnLine; } -- Gitblit v1.8.0