From a8f0416be75011bd841065a27d764d4304ade336 Mon Sep 17 00:00:00 2001 From: ZZ Date: Tue, 17 Aug 2021 17:12:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E8=BF=9F=E5=AF=B9=E6=97=B6=E8=87=B3?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E5=93=8D=E5=BA=94=E4=B8=8B=E5=8F=91=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xhpc/pp/server/ChargingPileBinaryHandler.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileBinaryHandler.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileBinaryHandler.java index 6c6fbb5c..634789cf 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileBinaryHandler.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileBinaryHandler.java @@ -94,13 +94,6 @@ public class ChargingPileBinaryHandler implements ClientBinaryHandler { String pilekey = "pile:".concat(pileNo); if (SERVICE_REGISTER.equals(serviceName) && OK.equals(resultCode)) { regHandler(handler, pileNo, req); - Date date = Calendar.getInstance().getTime(); - String timebin = getTimeBin(seqHex(pilekey.concat("seqhex")), pileNo, date); - Map cachePile = REDIS.getCacheMap(pilekey); - cachePile.put("configTime", DateUtil.format(date, UTC_PATTERN)); - REDIS.setCacheMap(pilekey, cachePile); - log.info("server send time config msg >>>> ({}) |{}|", pileNo, timebin); - handler.sendClientBinary(HexUtils.toBytes(timebin)); } else if (SERVICE_RMCR.equals(serviceName) && OK.equals(resultCode)) { setCachePileRM(pilekey); } @@ -109,6 +102,14 @@ public class ChargingPileBinaryHandler implements ClientBinaryHandler { handler.sendClientBinary(result.getBinary()); if (SERVICE_RMR.equals(serviceName) && OK.equals(resultCode)) { setCachePileRM(pilekey); + } else if (SERVICE_REGISTER.equals(serviceName) && OK.equals(resultCode)) { + Date date = Calendar.getInstance().getTime(); + String timebin = getTimeBin(seqHex(pilekey.concat("seqhex")), pileNo, date); + Map cachePile = REDIS.getCacheMap(pilekey); + cachePile.put("configTime", DateUtil.format(date, UTC_PATTERN)); + REDIS.setCacheMap(pilekey, cachePile); + log.info("server send time config msg >>>> ({}) |{}|", pileNo, timebin); + handler.sendClientBinary(HexUtils.toBytes(timebin)); } } }