From 117ee42ac05e916270492b5f2cd5ce4b7ebe8101 Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Thu, 28 Nov 2024 08:51:55 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BD=BF=E7=94=A8=E6=97=A0=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=80=BC=E7=9A=84=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/YKCPushCommandServiceImpl.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/YKCPushCommandServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/YKCPushCommandServiceImpl.java index 5d3a9a608..b3852c339 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/YKCPushCommandServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/YKCPushCommandServiceImpl.java @@ -64,7 +64,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { /** * 发送消息,无返回值 */ - public void runSend(byte[] msg, String pileSn, Enum frameTypeCode) throws Exception { + public void runSend(byte[] msg, String pileSn, Enum frameTypeCode) { // 通过桩编号获取channel ChannelHandlerContext ctx = PileChannelEntity.getChannelByPileSn(pileSn); String value = ((YKCFrameTypeCode) frameTypeCode).getValue(); // 帧类型名称 @@ -73,7 +73,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { throw new NullPointerException("channel"); } if(msg == null) { - throw new NullPointerException("msg"); + throw new NullPointerException("发送消息msg为空"); } /* @@ -157,7 +157,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { throw new NullPointerException("channel"); } if(msg == null) { - throw new NullPointerException("msg"); + throw new NullPointerException("发送消息msg为空"); } if(timeout <= 0) { throw new IllegalArgumentException("timeout must greater than 0"); @@ -285,7 +285,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { byte[] msgBody = Bytes.concat(orderIdByteArr, pileSnByteArr, connectorCodeByteArr, logicCardNumByteArr, physicsCardNumByteArr, accountBalanceByteArr); try { - this.supplySend(msgBody, pileSn, YKCFrameTypeCode.REMOTE_CONTROL_START_CHARGING_CODE); + this.runSend(msgBody, pileSn, YKCFrameTypeCode.REMOTE_CONTROL_START_CHARGING_CODE); } catch (Exception e) { throw new RuntimeException(e); } @@ -306,7 +306,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { // 远程停机 byte[] msgBody = Bytes.concat(BytesUtil.str2Bcd(pileSn), BytesUtil.str2Bcd(connectorCode)); try { - this.supplySend(msgBody, pileSn, YKCFrameTypeCode.REMOTE_CONTROL_STOP_CHARGING_CODE); + this.runSend(msgBody, pileSn, YKCFrameTypeCode.REMOTE_CONTROL_STOP_CHARGING_CODE); } catch (Exception e) { log.error("发送停止充电 error:", e); } @@ -319,7 +319,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { String connectorCode = command.getConnectorCode(); byte[] msg = BytesUtil.str2Bcd(pileSn + connectorCode); try { - this.supplySend(msg, pileSn, YKCFrameTypeCode.READ_REAL_TIME_MONITOR_DATA_CODE); + this.runSend(msg, pileSn, YKCFrameTypeCode.READ_REAL_TIME_MONITOR_DATA_CODE); } catch (Exception e) { throw new RuntimeException(e); } @@ -332,7 +332,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { byte[] msg = BytesUtil.str2Bcd(pileSn + Constants.ZERO_ONE); log.info("【=====平台下发指令=====】:重启充电桩:,{}", pileSn); try { - this.supplySend(msg, pileSn, YKCFrameTypeCode.REMOTE_RESTART_CODE); + this.runSend(msg, pileSn, YKCFrameTypeCode.REMOTE_RESTART_CODE); } catch (Exception e) { throw new RuntimeException(e); } @@ -377,7 +377,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { // push消息 try { - this.supplySend(msg, pileSn, YKCFrameTypeCode.REMOTE_ISSUE_QRCODE_CODE); + this.runSend(msg, pileSn, YKCFrameTypeCode.REMOTE_ISSUE_QRCODE_CODE); } catch (Exception e) { throw new RuntimeException(e); } @@ -403,7 +403,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { byte[] msg = Bytes.concat(pileSnByteArr, dateBytes); try { - this.supplySend(msg, pileSn, YKCFrameTypeCode.TIME_CHECK_SETTING_CODE); + this.runSend(msg, pileSn, YKCFrameTypeCode.TIME_CHECK_SETTING_CODE); } catch (Exception e) { throw new RuntimeException(e); } @@ -487,7 +487,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { updateServerPortByteArr, userNameByteArr, passwordByteArr, filePathByteArr, performTypeByteArr, overTimeByteArr); try { - this.supplySend(msgBody, pileModelInfoVO.getPileSn(), YKCFrameTypeCode.REMOTE_UPDATE_CODE); + this.runSend(msgBody, pileModelInfoVO.getPileSn(), YKCFrameTypeCode.REMOTE_UPDATE_CODE); } catch (Exception e) { throw new RuntimeException(e); } @@ -521,7 +521,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { byte[] msg = Bytes.concat(pileSnByteArr, workingStateByteArr, maxPowerByteArr); try { - this.supplySend(msg, pileSn, YKCFrameTypeCode.CHARGING_PILE_WORKING_PARAMETER_SETTING_CODE); + this.runSend(msg, pileSn, YKCFrameTypeCode.CHARGING_PILE_WORKING_PARAMETER_SETTING_CODE); } catch (Exception e) { throw new RuntimeException(e); } @@ -552,7 +552,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { byte[] msg = Bytes.concat(pileSnByteArr, pileType); try { - this.supplySend(msg, pileSn, YKCFrameTypeCode.QUERY_PILE_WORK_PARAMS_CODE); + this.runSend(msg, pileSn, YKCFrameTypeCode.QUERY_PILE_WORK_PARAMS_CODE); } catch (Exception e) { throw new RuntimeException(e); } @@ -582,7 +582,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { byte[] msg = Bytes.concat(pileSnByteArr, connectorCodeByteArr, logicByteArr, priceByte); try { - this.supplySend(msg, pileSn, YKCFrameTypeCode.REMOTE_ACCOUNT_BALANCE_UPDATE_CODE); + this.runSend(msg, pileSn, YKCFrameTypeCode.REMOTE_ACCOUNT_BALANCE_UPDATE_CODE); } catch (Exception e) { throw new RuntimeException(e); } @@ -619,7 +619,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { byte[] msg = Bytes.concat(pileSnByteArr, connectorCodeByteArr, operateByteArr, obligateByteArr); try { - this.supplySend(msg, pileSn, YKCFrameTypeCode.REMOTE_CONTROL_GROUND_LOCK_CODE); + this.runSend(msg, pileSn, YKCFrameTypeCode.REMOTE_CONTROL_GROUND_LOCK_CODE); } catch (Exception e) { throw new RuntimeException(e); }