update 对接lianlian平台

This commit is contained in:
2024-04-17 13:54:53 +08:00
parent cbaea86589
commit 56e92a11f9
2 changed files with 19 additions and 5 deletions

View File

@@ -40,10 +40,7 @@ import com.jsowell.thirdparty.platform.ThirdPartyPlatformService;
import com.jsowell.thirdparty.platform.common.ChargeDetail; import com.jsowell.thirdparty.platform.common.ChargeDetail;
import com.jsowell.thirdparty.platform.common.OrderInfo; import com.jsowell.thirdparty.platform.common.OrderInfo;
import com.jsowell.thirdparty.platform.common.StationInfo; import com.jsowell.thirdparty.platform.common.StationInfo;
import com.jsowell.thirdparty.platform.util.Cryptos; import com.jsowell.thirdparty.platform.util.*;
import com.jsowell.thirdparty.platform.util.Encodes;
import com.jsowell.thirdparty.platform.util.GBSignUtils;
import com.jsowell.thirdparty.platform.util.HttpRequestUtil;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -916,7 +913,7 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
EquipmentAuthVO vo = new EquipmentAuthVO(); EquipmentAuthVO vo = new EquipmentAuthVO();
String equipAuthSeq = dto.getEquipAuthSeq(); // MA1X78KH5202311071202015732 String equipAuthSeq = dto.getEquipAuthSeq(); // MA1X78KH5202311071202015732
String pileConnectorCode = dto.getConnectorID(); String pileConnectorCode = ThirdPartyPlatformUtils.extractConnectorID(dto.getConnectorID());
// 先查询配置密钥相关信息 // 先查询配置密钥相关信息
ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorID()); ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorID());
if (configInfo == null) { if (configInfo == null) {

View File

@@ -5,6 +5,8 @@ import com.google.common.collect.Maps;
import com.jsowell.pile.domain.ThirdPartyPlatformConfig; import com.jsowell.pile.domain.ThirdPartyPlatformConfig;
import java.util.Map; import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ThirdPartyPlatformUtils { public class ThirdPartyPlatformUtils {
@@ -37,5 +39,20 @@ public class ThirdPartyPlatformUtils {
return resultMap; 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; // 没有找到匹配项
}
} }