update 电单车

This commit is contained in:
Guoqs
2024-09-13 09:33:23 +08:00
parent e154b0c0dc
commit decd185c79
3 changed files with 21 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
package com.jsowell.pile.domain.ebike.deviceupload;
import com.jsowell.common.YouDianUtils;
import com.jsowell.common.util.BytesUtil;
import com.jsowell.pile.domain.ebike.AbsEBikeMessage;
import lombok.Getter;
@@ -42,7 +43,7 @@ public class EBikeMessageCmd06 extends AbsEBikeMessage {
@Setter
public static class PowerHeartbeat {
/**
* 端口号当前充电的端口号。注00表示1号端口01表示2号端口
* 端口号当前充电的端口号。注00表示1号端口01表示2号端口; port+1为实际端口
*/
private String port;
@@ -135,7 +136,8 @@ public class EBikeMessageCmd06 extends AbsEBikeMessage {
public PowerHeartbeat(byte[] dataBytes) {
int startIndex = 0;
int length = 1;
this.port = BytesUtil.bytesToIntLittle(Arrays.copyOfRange(dataBytes, startIndex, startIndex = startIndex + length)) + "";
int i = BytesUtil.bytesToIntLittle(Arrays.copyOfRange(dataBytes, startIndex, startIndex = startIndex + length));
this.port = i + YouDianUtils.convertPortNumberToString(i);
length = 1;
this.portStatus = BytesUtil.bytesToIntLittle(Arrays.copyOfRange(dataBytes, startIndex, startIndex = startIndex + length)) + "";

View File

@@ -1954,12 +1954,13 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
String redisKey = CacheConstants.PILE_REAL_TIME_MONITOR_DATA + pileConnectorCode + "_" + transactionCode;
// 拿到所有数据
Map<Object, Object> map = redisCache.hmget(redisKey);
if (map == null) {
logger.info("查redis中的实时数据, pileConnectorCode:{}, transactionCode:{}, map:{}", pileConnectorCode, transactionCode, map);
if (map == null || map.isEmpty()) {
// 按照电单车重新查
pileConnectorCode = transactionCode.substring(0, 10); // 电单车车桩
redisKey = CacheConstants.PILE_REAL_TIME_MONITOR_DATA + pileConnectorCode + "_" + transactionCode;
map = redisCache.hmget(redisKey);
logger.info("按照电单车重新查, pileConnectorCode:{}, transactionCode:{}, map:{}", pileConnectorCode, transactionCode, map);
}
if (map != null && !map.isEmpty()) {