From ea10b34005e406a0495a100f9eb935126734d851 Mon Sep 17 00:00:00 2001 From: ZZ Date: Tue, 14 Sep 2021 18:39:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E5=BA=94=E7=AD=94=E6=98=AF?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=BA=94=E7=AD=94=E5=90=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/xhpc/pp/logic/OrderDataLogic.java | 6 +----- .../java/com/xhpc/pp/server/ChargingPileBinaryHandler.java | 6 ++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/OrderDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/OrderDataLogic.java index 9c1d986f..4a37e3fe 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/OrderDataLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/OrderDataLogic.java @@ -20,7 +20,6 @@ import java.lang.reflect.InvocationTargetException; 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.utils.security.CacheDataUtils.reflectTranslate; @Lazy @@ -52,10 +51,7 @@ public class OrderDataLogic implements ServiceLogic { Map cacheGun = REDIS.getCacheMap(gunkey); cacheGun.put("orderstoptime", cacheOrderData.getEndTime()); cacheGun.put("orderkey", null); - REDIS.setCacheMap(gunkey, cacheGun); - String skey = gunkey.concat(".seqhex"); - String seq = seqHex(skey); - String resultStr = "6815".concat(seq).concat("0040").concat(orderNo).concat(ServiceResult.HEX_00); + String resultStr = "6815".concat(req.get("seq").toString()).concat("0040").concat(orderNo).concat(ServiceResult.HEX_00); pileOrderService.pileEndOrder(orderNo); return new ServiceResult(HexUtils.toBytes(resultStr), ServiceResult.OK); } 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 5228b6e8..1067cfd4 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 @@ -213,7 +213,13 @@ public class ChargingPileBinaryHandler implements ClientBinaryHandler { pos += field.getLen(); } result.put("hex", toHex(data)); + result.put("seq", getSeq(data)); return result; } + private String getSeq(byte[] data) { + + return toHex(ArrayUtils.subarray(data, 3, 5)); + } + }