From 126c2efc23cb8a02e4ff4d300050a590b8a0f1fa Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期五, 25 十月 2024 10:33:25 +0800 Subject: [PATCH] 取水口管理功能中去除顯示在線情況,優化SQL語句。 --- pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java | 29 ++++++++++++++++++++++------- 1 files changed, 22 insertions(+), 7 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java index 8af5d2f..6118669 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java @@ -12,6 +12,7 @@ import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper; import com.dy.pipIrrGlobal.daoRm.RmCommandHistoryMapper; import com.dy.pipIrrGlobal.daoRm.RmIrrigateProfileMapper; +import com.dy.pipIrrGlobal.daoRm.RmOpenCloseValveLastMapper; import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper; import com.dy.pipIrrGlobal.pojoRm.RmCommandHistory; @@ -49,6 +50,7 @@ private final PrIntakeVcMapper prIntakeVcMapper; private final SeClientCardMapper seClientCardMapper; private final RmIrrigateProfileMapper rmIrrigateProfileMapper; + private RmOpenCloseValveLastMapper rmOpenCloseValveLastMapper; /** * pro_mw锛氬睘鎬� @@ -59,8 +61,9 @@ private String pro_mw = "mw"; private String key_mw = "comSendUrl"; @Autowired - public CommandSv(RmCommandHistoryMapper rmCommandHistoryMapper, SeVirtualCardMapper seVirtualCardMapper, PrIntakeMapper prIntakeMapper, PrWaterPriceMapper prWaterPriceMapper, PrIntakeVcMapper prIntakeVcMapper, SeClientCardMapper seClientCardMapper, RmIrrigateProfileMapper rmIrrigateProfileMapper, Environment env) { + public CommandSv(RmCommandHistoryMapper rmCommandHistoryMapper,RmOpenCloseValveLastMapper rmOpenCloseValveLastMapper, SeVirtualCardMapper seVirtualCardMapper, PrIntakeMapper prIntakeMapper, PrWaterPriceMapper prWaterPriceMapper, PrIntakeVcMapper prIntakeVcMapper, SeClientCardMapper seClientCardMapper, RmIrrigateProfileMapper rmIrrigateProfileMapper, Environment env) { this.rmCommandHistoryMapper = rmCommandHistoryMapper; + this.rmOpenCloseValveLastMapper = rmOpenCloseValveLastMapper; this.seVirtualCardMapper = seVirtualCardMapper; this.prIntakeMapper = prIntakeMapper; this.prWaterPriceMapper = prWaterPriceMapper; @@ -101,14 +104,16 @@ 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); 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); + } } System.out.println(jsonArray.toJSONString()); @@ -125,6 +130,16 @@ } /** + * 涓烘寚瀹氾紙闃�鎺у櫒鍦板潃銆佹按鍗$紪鍙枫�佹棤鍏抽榾璁板綍锛夊紑鍏抽榾鏈�鏂拌褰曟坊鍔犲叧闃�鏃堕棿锛屼娇涔嬩笉鍦ㄦ湭鍏抽榾璁板綍涓樉绀� + * @param rtuAddr + * @param icCardNo + * @return + */ + public Integer addClostTime(String rtuAddr, String icCardNo) { + return rmOpenCloseValveLastMapper.addCloseTime(rtuAddr, icCardNo); + } + + /** * 鏍规嵁鍙栨按鍙D鑾峰彇涓庝箣缁戝畾铏氭嫙鍗D * @param intakeId * @return -- Gitblit v1.8.0