From 4bd0c2c252df008b98d3e9c7dac708ff642c90d1 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期三, 17 七月 2024 16:21:47 +0800 Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV --- pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/intake/IntakeSv.java | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 49 insertions(+), 2 deletions(-) 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 32c3ed8..47ecf84 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 @@ -6,6 +6,7 @@ import com.dy.common.multiDataSource.DataSourceContext; import com.dy.common.mw.protocol.Command; import com.dy.common.webUtil.BaseResponse; +import com.dy.common.webUtil.QueryResultVo; import com.dy.pipIrrGlobal.daoPr.PrIntakeMapper; import com.dy.pipIrrGlobal.voPr.VoOnLineIntake; import com.dy.pipIrrWechat.intake.qo.OnLineIntakesQO; @@ -58,10 +59,10 @@ } /** - * 鑾峰彇鍙栨按鍙� + * 鏍规嵁鍙栨按鍙g紪鍙疯幏鍙栧彇姘村彛瀵硅薄 * @return */ - public VoOnLineIntake selectOnLineIntakes(OnLineIntakesQO qo) { + public VoOnLineIntake selectOneIntake(OnLineIntakesQO qo) { Command com = new Command() ; com.id = Command.defaultId; com.code = "LCD0001"; @@ -96,6 +97,52 @@ } /** + * 鑾峰彇鍙栨按鍙e垪琛紙鍦ㄧ嚎鍜屼笉鍦ㄧ嚎锛� + * @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); + + 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); + } + + qo.setOnLineMap(jsonArray.toJSONString()); + // 濡傛灉 intakeNum 涓嶄负绌猴紝鍒欒浆涓哄皬鍐欏啀鍐欏叆qo瀵硅薄 + String intakeNum = qo.getIntakeNum(); + if(intakeNum != null) { + qo.setIntakeNum(intakeNum.toLowerCase()); + } + + Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; + Long itemTotal = prIntakeMapper.getOnLineIntakesCount(params); + + QueryResultVo<List<VoOnLineIntake>> rsVo = new QueryResultVo<>() ; + rsVo.pageSize = qo.pageSize ; + rsVo.pageCurr = qo.pageCurr ; + rsVo.calculateAndSet(itemTotal, params); + rsVo.obj = prIntakeMapper.getOnLineIntakes(params); + return rsVo; + } else { + QueryResultVo<List<VoOnLineIntake>> rsVo = new QueryResultVo<>(); + return rsVo; + } + } + + /** * 鏍规嵁鎿嶄綔鍛樿幏鍙栧父鐢ㄥ彇姘村彛 * @param operator * @return -- Gitblit v1.8.0