mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
update
This commit is contained in:
@@ -20,6 +20,8 @@ import com.jsowell.thirdparty.lianlian.util.Cryptos;
|
||||
import com.jsowell.thirdparty.lianlian.util.Encodes;
|
||||
import com.jsowell.thirdparty.lianlian.util.GBSignUtils;
|
||||
import com.jsowell.thirdparty.lianlian.util.HttpRequestUtil;
|
||||
import com.jsowell.thirdparty.yongchengboche.dto.YCBCGetTokenDTO;
|
||||
import com.jsowell.thirdparty.yongchengboche.service.YCBCService;
|
||||
import com.jsowell.thirdparty.zhongdianlian.domain.ZDLConnectorInfo;
|
||||
import com.jsowell.thirdparty.zhongdianlian.domain.ZDLEquipmentInfo;
|
||||
import com.jsowell.thirdparty.zhongdianlian.domain.ZDLStationInfo;
|
||||
@@ -48,6 +50,9 @@ public class ZDLServiceImpl implements ZDLService {
|
||||
@Autowired
|
||||
private LianLianService lianLianService;
|
||||
|
||||
@Autowired
|
||||
private YCBCService ycbcService;
|
||||
|
||||
@Autowired
|
||||
private IPileStationInfoService pileStationInfoService;
|
||||
|
||||
@@ -109,6 +114,7 @@ public class ZDLServiceImpl implements ZDLService {
|
||||
String dataSecret = relationInfo.getDataSecret();
|
||||
String dataSecretIv = relationInfo.getDataSecretIv();
|
||||
String urlAddress = relationInfo.getUrlAddress();
|
||||
String thirdPartyType = relation.getThirdPartyType();
|
||||
|
||||
// 组装中电联平台所需要的数据格式
|
||||
ZDLStationInfo info = ZDLStationInfo.builder()
|
||||
@@ -151,22 +157,31 @@ public class ZDLServiceImpl implements ZDLService {
|
||||
System.out.println("jsonString : " + jsonString);
|
||||
|
||||
// 获取令牌
|
||||
ZDLGetTokenDTO tokenDTO = ZDLGetTokenDTO.builder()
|
||||
.urlAddress(urlAddress)
|
||||
.operatorId(operatorId)
|
||||
.operatorSecret(operatorSecret)
|
||||
.dataSecret(dataSecret)
|
||||
.dataSecretIv(dataSecretIv)
|
||||
.signSecret(signSecret)
|
||||
.build();
|
||||
String token = ZDLGetToken(tokenDTO);
|
||||
String token = "";
|
||||
String result = "";
|
||||
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), relationInfo.getThirdPartyType())) {
|
||||
if (StringUtils.equals(ThirdPlatformTypeEnum.YONG_CHENG_BO_CHE.getCode(), thirdPartyType)) {
|
||||
YCBCGetTokenDTO ycbcGetTokenDTO = new YCBCGetTokenDTO();
|
||||
ycbcGetTokenDTO.setOperatorId(operatorId);
|
||||
ycbcGetTokenDTO.setDataSecret(dataSecret);
|
||||
ycbcGetTokenDTO.setSignSecret(signSecret);
|
||||
ycbcGetTokenDTO.setUrlAddress(urlAddress);
|
||||
ycbcGetTokenDTO.setDataSecretIv(dataSecretIv);
|
||||
ycbcGetTokenDTO.setOperatorSecret(operatorSecret);
|
||||
|
||||
token = ycbcService.YCBCGetToken(ycbcGetTokenDTO);
|
||||
result = HttpRequestUtil.YCBCSendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||
}else {
|
||||
ZDLGetTokenDTO tokenDTO = ZDLGetTokenDTO.builder()
|
||||
.urlAddress(urlAddress)
|
||||
.operatorId(operatorId)
|
||||
.operatorSecret(operatorSecret)
|
||||
.dataSecret(dataSecret)
|
||||
.dataSecretIv(dataSecretIv)
|
||||
.signSecret(signSecret)
|
||||
.build();
|
||||
token = ZDLGetToken(tokenDTO);
|
||||
result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||
}
|
||||
|
||||
// System.out.println(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user