diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java index 56e729f9..29e19c34 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java @@ -35,7 +35,6 @@ import java.util.Map; import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS; import static com.xhpc.common.data.redis.StaticBeanUtil.seqHex; -import static com.xhpc.pp.logic.RegisterLogic.REGISTERED; import static com.xhpc.pp.server.ChargingPileServer.*; import static com.xhpc.pp.utils.HexUtils.toHexInt; @@ -158,10 +157,10 @@ public class ChargingController { if (cachePile.isEmpty()) { r = R.fail("充电桩未注册"); } - String status = cachePile.get("status"); - if (!REGISTERED.equals(status)) { - r = R.fail("充电桩离线"); - } +// String status = cachePile.get("status"); +// if (!REGISTERED.equals(status)) { +// r = R.fail("充电桩离线"); +// } String gunkey = "gun:".concat(connectorId); final Map cacheGun = REDIS.getCacheMap(gunkey); // if (cacheGun.get("orderkey") == null || !cacheGun.get("orderkey").toString().endsWith(orderNo) || !orderNo.contains diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/HBLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/HBLogic.java index 686494a3..15c17da2 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/HBLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/HBLogic.java @@ -1,10 +1,12 @@ package com.xhpc.pp.logic; +import com.xhpc.pp.server.ChargingPileServer; import com.xhpc.pp.tx.ServiceParameter; import com.xhpc.pp.tx.ServiceResult; import com.xhpc.pp.tx.logic.ServiceLogic; import com.xhpc.pp.utils.HexUtils; import com.xhpc.pp.utils.security.CRCCalculator; +import org.quickserver.net.server.ClientHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Lazy; @@ -38,6 +40,8 @@ public class HBLogic implements ServiceLogic { if ("离线".equals(status) || "故障".equals(status)) { cacheGun.put("status", stable[gunStatus]); } + ClientHandler handler = ChargingPileServer.getHandler(pileNo); + if (handler == null) return new ServiceResult(ServiceResult.FAIL); REDIS.setCacheMap(gunkey, cacheGun); String skey = gunkey.concat(".seqhex"); String seq = seqHex(skey);