diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/lianlian/service/LianLianPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/lianlian/service/LianLianPlatformServiceImpl.java index dd5bb4480..b9c6939c5 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/lianlian/service/LianLianPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/lianlian/service/LianLianPlatformServiceImpl.java @@ -40,10 +40,7 @@ import com.jsowell.thirdparty.platform.ThirdPartyPlatformService; import com.jsowell.thirdparty.platform.common.ChargeDetail; import com.jsowell.thirdparty.platform.common.OrderInfo; import com.jsowell.thirdparty.platform.common.StationInfo; -import com.jsowell.thirdparty.platform.util.Cryptos; -import com.jsowell.thirdparty.platform.util.Encodes; -import com.jsowell.thirdparty.platform.util.GBSignUtils; -import com.jsowell.thirdparty.platform.util.HttpRequestUtil; +import com.jsowell.thirdparty.platform.util.*; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -916,7 +913,7 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService { EquipmentAuthVO vo = new EquipmentAuthVO(); String equipAuthSeq = dto.getEquipAuthSeq(); // MA1X78KH5202311071202015732 - String pileConnectorCode = dto.getConnectorID(); + String pileConnectorCode = ThirdPartyPlatformUtils.extractConnectorID(dto.getConnectorID()); // 先查询配置密钥相关信息 ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorID()); if (configInfo == null) { diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/util/ThirdPartyPlatformUtils.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/util/ThirdPartyPlatformUtils.java index db1dcfa80..33148f288 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/util/ThirdPartyPlatformUtils.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/util/ThirdPartyPlatformUtils.java @@ -5,6 +5,8 @@ import com.google.common.collect.Maps; import com.jsowell.pile.domain.ThirdPartyPlatformConfig; import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public class ThirdPartyPlatformUtils { @@ -37,5 +39,20 @@ public class ThirdPartyPlatformUtils { return resultMap; } + /** + * 从给定的URL字符串中提取充电桩枪口号。 + * + * @param url URL字符串 + * @return 提取的枪口号,如果没有找到则返回null + */ + public static String extractConnectorID(String url) { + String regex = "/app-xcx-h5/pile/connectorDetail/(\\d+)"; + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(url); + if (matcher.find()) { + return matcher.group(1); // 返回正则表达式括号内匹配的数字 + } + return null; // 没有找到匹配项 + } }