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)); } } }