mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-11 18:59:51 +08:00
update 联联平台相关配置信息从数据库调取
This commit is contained in:
@@ -28,6 +28,7 @@ import com.jsowell.pile.vo.lianlian.AccumulativeInfoVO;
|
|||||||
import com.jsowell.pile.vo.uniapp.BillingPriceVO;
|
import com.jsowell.pile.vo.uniapp.BillingPriceVO;
|
||||||
import com.jsowell.pile.vo.web.PileConnectorInfoVO;
|
import com.jsowell.pile.vo.web.PileConnectorInfoVO;
|
||||||
import com.jsowell.pile.vo.web.PileModelInfoVO;
|
import com.jsowell.pile.vo.web.PileModelInfoVO;
|
||||||
|
import com.jsowell.pile.vo.web.PileStationVO;
|
||||||
import com.jsowell.thirdparty.domain.*;
|
import com.jsowell.thirdparty.domain.*;
|
||||||
import com.jsowell.thirdparty.service.LianLianService;
|
import com.jsowell.thirdparty.service.LianLianService;
|
||||||
import com.jsowell.thirdparty.vo.*;
|
import com.jsowell.thirdparty.vo.*;
|
||||||
@@ -42,11 +43,11 @@ import java.util.stream.Collectors;
|
|||||||
@Service
|
@Service
|
||||||
public class LianLianServiceImpl implements LianLianService {
|
public class LianLianServiceImpl implements LianLianService {
|
||||||
private static final String TEST_URL = "http://dataexchange.evchargeonline.com:81/shevcs/v1/"; // http://testdataexchange.evchargeonline.com:82/shevcs/v1/
|
private static final String TEST_URL = "http://dataexchange.evchargeonline.com:81/shevcs/v1/"; // http://testdataexchange.evchargeonline.com:82/shevcs/v1/
|
||||||
private static final String OPERATOR_ID = "MA1JLFUU8"; // MA1JLFUU8 987654321
|
// private static final String OPERATOR_ID = "MA1JLFUU8"; // MA1JLFUU8 987654321
|
||||||
private static final String OPERATOR_SECRET = "fGwLsxW1HdzLw7jp"; // fGwLsxW1HdzLw7jp 1234567890abcdef
|
// private static final String OPERATOR_SECRET = "fGwLsxW1HdzLw7jp"; // fGwLsxW1HdzLw7jp 1234567890abcdef
|
||||||
private static final String SIG_SECRET = "TmsdVaFVTtjzZbLi"; // 签名秘钥 TmsdVaFVTtjzZbLi 1234567890abcdef
|
// private static final String SIG_SECRET = "TmsdVaFVTtjzZbLi"; // 签名秘钥 TmsdVaFVTtjzZbLi 1234567890abcdef
|
||||||
private static final String DATA_SECRET = "R1Hdq80mSWswwCzt"; // 消息密钥 R1Hdq80mSWswwCzt 1234567890abcdef
|
// private static final String DATA_SECRET = "R1Hdq80mSWswwCzt"; // 消息密钥 R1Hdq80mSWswwCzt 1234567890abcdef
|
||||||
private static final String DATA_SECRETIV = "LVpz3qHD8sM2PYjl"; // 消息密钥初始化向量 LVpz3qHD8sM2PYjl 1234567890abcdef
|
// private static final String DATA_SECRETIV = "LVpz3qHD8sM2PYjl"; // 消息密钥初始化向量 LVpz3qHD8sM2PYjl 1234567890abcdef
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IPileMerchantInfoService pileMerchantInfoService;
|
private IPileMerchantInfoService pileMerchantInfoService;
|
||||||
@@ -72,6 +73,9 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IPileBillingTemplateService pileBillingTemplateService;
|
private IPileBillingTemplateService pileBillingTemplateService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IThirdPartySettingInfoService thirdPartySettingInfoService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void pushMerchantInfo(Long merchantId) {
|
public void pushMerchantInfo(Long merchantId) {
|
||||||
// 通过id查询运营商信息
|
// 通过id查询运营商信息
|
||||||
@@ -101,10 +105,21 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
|
|
||||||
// 通过id查询站点相关信息
|
// 通过id查询站点相关信息
|
||||||
PileStationInfo pileStationInfo = pileStationInfoService.selectPileStationInfoById(dto.getStationId());
|
PileStationInfo pileStationInfo = pileStationInfoService.selectPileStationInfoById(dto.getStationId());
|
||||||
|
// 通过站点id查询相关配置信息
|
||||||
|
ThirdPartySettingInfo settingInfo = thirdPartySettingInfoService.getInfoByStationId(dto.getStationId());
|
||||||
|
if (settingInfo == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String operatorId = settingInfo.getOperatorId();
|
||||||
|
String operatorSecret = settingInfo.getOperatorSecret();
|
||||||
|
String signSecret = settingInfo.getSignSecret();
|
||||||
|
String dataSecret = settingInfo.getDataSecret();
|
||||||
|
String dataSecretIv = settingInfo.getDataSecretIv();
|
||||||
|
|
||||||
// 组装联联平台所需要的数据格式
|
// 组装联联平台所需要的数据格式
|
||||||
StationInfo info = StationInfo.builder()
|
StationInfo info = StationInfo.builder()
|
||||||
.stationID(String.valueOf(dto.getStationId()))
|
.stationID(String.valueOf(dto.getStationId()))
|
||||||
.operatorID(dto.getOperatorID())
|
.operatorID(operatorId)
|
||||||
.equipmentOwnerID(Constants.OPERATORID_LIANLIAN)
|
.equipmentOwnerID(Constants.OPERATORID_LIANLIAN)
|
||||||
.stationName(pileStationInfo.getStationName())
|
.stationName(pileStationInfo.getStationName())
|
||||||
.isAloneApply(Integer.valueOf(pileStationInfo.getAloneApply()))
|
.isAloneApply(Integer.valueOf(pileStationInfo.getAloneApply()))
|
||||||
@@ -157,9 +172,9 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
System.out.println("jsonString : " + jsonString);
|
System.out.println("jsonString : " + jsonString);
|
||||||
|
|
||||||
// 获取令牌
|
// 获取令牌
|
||||||
String token = getToken(dto.getOperatorID(), OPERATOR_SECRET);
|
String token = getToken(operatorId, operatorSecret);
|
||||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, dto.getDataSecret()
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret
|
||||||
, dto.getDataSecretIV(), dto.getOperatorID(), dto.getSigSecret());
|
, dataSecretIv, operatorId, signSecret);
|
||||||
|
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
|
|
||||||
@@ -632,10 +647,24 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String pushConnectorStatus(String pileConnectorCode, String status) {
|
public String pushConnectorStatus(String pileConnectorCode, String status) {
|
||||||
|
// 查出该桩所属哪个站点
|
||||||
|
String pileSn = StringUtils.substring(pileConnectorCode, 0, 16);
|
||||||
|
PileStationVO stationVO = pileStationInfoService.getStationInfoByPileSn(pileSn);
|
||||||
|
// 通过站点id查询相关配置信息
|
||||||
|
ThirdPartySettingInfo settingInfo = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(stationVO.getId()));
|
||||||
|
if (settingInfo == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String operatorId = settingInfo.getOperatorId();
|
||||||
|
String operatorSecret = settingInfo.getOperatorSecret();
|
||||||
|
String signSecret = settingInfo.getSignSecret();
|
||||||
|
String dataSecret = settingInfo.getDataSecret();
|
||||||
|
String dataSecretIv = settingInfo.getDataSecretIv();
|
||||||
|
|
||||||
String url = TEST_URL + "notification_stationStatus";
|
String url = TEST_URL + "notification_stationStatus";
|
||||||
|
|
||||||
// 获取令牌
|
// 获取令牌
|
||||||
String token = getToken(OPERATOR_ID, OPERATOR_SECRET);
|
String token = getToken(operatorId, operatorSecret);
|
||||||
if (StringUtils.isBlank(token)) {
|
if (StringUtils.isBlank(token)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -648,7 +677,7 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
json.put("ConnectorStatusInfo", info);
|
json.put("ConnectorStatusInfo", info);
|
||||||
String jsonString = JSONObject.toJSONString(json);
|
String jsonString = JSONObject.toJSONString(json);
|
||||||
|
|
||||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, DATA_SECRET, DATA_SECRETIV, OPERATOR_ID, SIG_SECRET);
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -665,12 +694,23 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||||
|
|
||||||
|
// 通过站点id查询相关配置信息
|
||||||
|
ThirdPartySettingInfo settingInfo = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(orderBasicInfo.getStationId()));
|
||||||
|
if (settingInfo == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String operatorId = settingInfo.getOperatorId();
|
||||||
|
String operatorSecret = settingInfo.getOperatorSecret();
|
||||||
|
String signSecret = settingInfo.getSignSecret();
|
||||||
|
String dataSecret = settingInfo.getDataSecret();
|
||||||
|
String dataSecretIv = settingInfo.getDataSecretIv();
|
||||||
|
|
||||||
String url = TEST_URL + "notification_orderInfo";
|
String url = TEST_URL + "notification_orderInfo";
|
||||||
|
|
||||||
// 拼装成联联平台所需格式对象
|
// 拼装成联联平台所需格式对象
|
||||||
OrderInfo orderInfo = OrderInfo.builder()
|
OrderInfo orderInfo = OrderInfo.builder()
|
||||||
.operatorID(OPERATOR_ID)
|
.operatorID(operatorId)
|
||||||
.equipmentOwnerID(OPERATOR_ID)
|
.equipmentOwnerID(Constants.OPERATORID_LIANLIAN)
|
||||||
.stationID(orderBasicInfo.getStationId())
|
.stationID(orderBasicInfo.getStationId())
|
||||||
.equipmentID(orderBasicInfo.getPileSn())
|
.equipmentID(orderBasicInfo.getPileSn())
|
||||||
.connectorID(orderBasicInfo.getPileConnectorCode())
|
.connectorID(orderBasicInfo.getPileConnectorCode())
|
||||||
@@ -750,7 +790,7 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
orderInfo.setChargeDetails(chargeDetails);
|
orderInfo.setChargeDetails(chargeDetails);
|
||||||
|
|
||||||
// 获取令牌
|
// 获取令牌
|
||||||
String token = getToken(OPERATOR_ID, OPERATOR_SECRET);
|
String token = getToken(operatorId, operatorSecret);
|
||||||
if (StringUtils.isBlank(token)) {
|
if (StringUtils.isBlank(token)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -759,7 +799,7 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
json.put("OrderInfo", orderInfo);
|
json.put("OrderInfo", orderInfo);
|
||||||
String jsonString = JSONObject.toJSONString(json);
|
String jsonString = JSONObject.toJSONString(json);
|
||||||
|
|
||||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, DATA_SECRET, DATA_SECRETIV, OPERATOR_ID, SIG_SECRET);
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -776,10 +816,21 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
if (orderInfo == null) {
|
if (orderInfo == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
// 通过站点id查询相关配置信息
|
||||||
|
ThirdPartySettingInfo settingInfo = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(orderInfo.getStationId()));
|
||||||
|
if (settingInfo == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String operatorId = settingInfo.getOperatorId();
|
||||||
|
String operatorSecret = settingInfo.getOperatorSecret();
|
||||||
|
String signSecret = settingInfo.getSignSecret();
|
||||||
|
String dataSecret = settingInfo.getDataSecret();
|
||||||
|
String dataSecretIv = settingInfo.getDataSecretIv();
|
||||||
|
|
||||||
// 推送启动充电结果(调用接口 notification_start_charge_result)
|
// 推送启动充电结果(调用接口 notification_start_charge_result)
|
||||||
String url = TEST_URL + "notification_start_charge_result";
|
String url = TEST_URL + "notification_start_charge_result";
|
||||||
// 获取令牌
|
// 获取令牌
|
||||||
String token = getToken(OPERATOR_ID, OPERATOR_SECRET);
|
String token = getToken(operatorId, operatorSecret);
|
||||||
if (StringUtils.isBlank(token)) {
|
if (StringUtils.isBlank(token)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -804,7 +855,7 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
|
|
||||||
String jsonString = JSONObject.toJSONString(json);
|
String jsonString = JSONObject.toJSONString(json);
|
||||||
|
|
||||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, DATA_SECRET, DATA_SECRETIV, OPERATOR_ID, SIG_SECRET);
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -816,10 +867,23 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String pushChargeStatus(String orderCode) {
|
public String pushChargeStatus(String orderCode) {
|
||||||
|
// 根据订单号查询订单信息
|
||||||
|
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||||
|
// 通过站点id查询相关配置信息
|
||||||
|
ThirdPartySettingInfo settingInfo = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(orderInfo.getStationId()));
|
||||||
|
if (settingInfo == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String operatorId = settingInfo.getOperatorId();
|
||||||
|
String operatorSecret = settingInfo.getOperatorSecret();
|
||||||
|
String signSecret = settingInfo.getSignSecret();
|
||||||
|
String dataSecret = settingInfo.getDataSecret();
|
||||||
|
String dataSecretIv = settingInfo.getDataSecretIv();
|
||||||
|
|
||||||
// 调用 查询充电状态方法
|
// 调用 查询充电状态方法
|
||||||
QueryChargingStatusVO vo = query_equip_charge_status(orderCode);
|
QueryChargingStatusVO vo = query_equip_charge_status(orderCode);
|
||||||
// 获取令牌
|
// 获取令牌
|
||||||
String token = getToken(OPERATOR_ID, OPERATOR_SECRET);
|
String token = getToken(operatorId, operatorSecret);
|
||||||
if (StringUtils.isBlank(token)) {
|
if (StringUtils.isBlank(token)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -827,7 +891,7 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
// 调用联联平台接口
|
// 调用联联平台接口
|
||||||
String jsonString = JSONObject.toJSONString(vo);
|
String jsonString = JSONObject.toJSONString(vo);
|
||||||
|
|
||||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, DATA_SECRET, DATA_SECRETIV, OPERATOR_ID, SIG_SECRET);
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -845,6 +909,17 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
if (orderInfo == null) {
|
if (orderInfo == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
// 通过站点id查询相关配置信息
|
||||||
|
ThirdPartySettingInfo settingInfo = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(orderInfo.getStationId()));
|
||||||
|
if (settingInfo == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String operatorId = settingInfo.getOperatorId();
|
||||||
|
String operatorSecret = settingInfo.getOperatorSecret();
|
||||||
|
String signSecret = settingInfo.getSignSecret();
|
||||||
|
String dataSecret = settingInfo.getDataSecret();
|
||||||
|
String dataSecretIv = settingInfo.getDataSecretIv();
|
||||||
|
|
||||||
String orderStatus = orderInfo.getOrderStatus();
|
String orderStatus = orderInfo.getOrderStatus();
|
||||||
String successFlag = "1";
|
String successFlag = "1";
|
||||||
if (StringUtils.equals(orderStatus, OrderStatusEnum.IN_THE_CHARGING.getValue())) {
|
if (StringUtils.equals(orderStatus, OrderStatusEnum.IN_THE_CHARGING.getValue())) {
|
||||||
@@ -858,7 +933,7 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
orderStatus = "5";
|
orderStatus = "5";
|
||||||
}
|
}
|
||||||
// 获取token
|
// 获取token
|
||||||
String token = getToken(OPERATOR_ID, OPERATOR_SECRET);
|
String token = getToken(operatorId, operatorSecret);
|
||||||
if (StringUtils.isBlank(token)) {
|
if (StringUtils.isBlank(token)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -874,7 +949,7 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
String jsonString = JSONObject.toJSONString(json);
|
String jsonString = JSONObject.toJSONString(json);
|
||||||
|
|
||||||
// 发送请求
|
// 发送请求
|
||||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, DATA_SECRET, DATA_SECRETIV, OPERATOR_ID, SIG_SECRET);
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -890,6 +965,17 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||||
|
|
||||||
|
// 通过站点id查询相关配置信息
|
||||||
|
ThirdPartySettingInfo settingInfo = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(orderBasicInfo.getStationId()));
|
||||||
|
if (settingInfo == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String operatorId = settingInfo.getOperatorId();
|
||||||
|
String operatorSecret = settingInfo.getOperatorSecret();
|
||||||
|
String signSecret = settingInfo.getSignSecret();
|
||||||
|
String dataSecret = settingInfo.getDataSecret();
|
||||||
|
String dataSecretIv = settingInfo.getDataSecretIv();
|
||||||
|
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("StartChargeSeq", orderCode);
|
json.put("StartChargeSeq", orderCode);
|
||||||
json.put("ConnectorID", orderBasicInfo.getPileConnectorCode());
|
json.put("ConnectorID", orderBasicInfo.getPileConnectorCode());
|
||||||
@@ -902,12 +988,12 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
json.put("StopReason", 2); // 2:BMS 停止充电
|
json.put("StopReason", 2); // 2:BMS 停止充电
|
||||||
|
|
||||||
String jsonString = JSONObject.toJSONString(json);
|
String jsonString = JSONObject.toJSONString(json);
|
||||||
String token = getToken(OPERATOR_ID, OPERATOR_SECRET);
|
String token = getToken(operatorId, operatorSecret);
|
||||||
if (token == null) {
|
if (token == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// 发送请求
|
// 发送请求
|
||||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, DATA_SECRET, DATA_SECRETIV, OPERATOR_ID, SIG_SECRET);
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -954,13 +1040,27 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("StartChargeSeq", orderCode);
|
json.put("StartChargeSeq", orderCode);
|
||||||
String jsonString = JSONObject.toJSONString(json);
|
String jsonString = JSONObject.toJSONString(json);
|
||||||
|
|
||||||
|
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||||
|
|
||||||
|
// 通过站点id查询相关配置信息
|
||||||
|
ThirdPartySettingInfo settingInfo = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(orderBasicInfo.getStationId()));
|
||||||
|
if (settingInfo == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String operatorId = settingInfo.getOperatorId();
|
||||||
|
String operatorSecret = settingInfo.getOperatorSecret();
|
||||||
|
String signSecret = settingInfo.getSignSecret();
|
||||||
|
String dataSecret = settingInfo.getDataSecret();
|
||||||
|
String dataSecretIv = settingInfo.getDataSecretIv();
|
||||||
|
|
||||||
// 获取令牌
|
// 获取令牌
|
||||||
String token = getToken(OPERATOR_ID, OPERATOR_SECRET);
|
String token = getToken(operatorId, operatorSecret);
|
||||||
if (StringUtils.isBlank(token)){
|
if (StringUtils.isBlank(token)){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// 发送请求
|
// 发送请求
|
||||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, DATA_SECRET, DATA_SECRETIV, OPERATOR_ID, SIG_SECRET);
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -980,6 +1080,18 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
if (orderInfo == null || orderDetail == null) {
|
if (orderInfo == null || orderDetail == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 通过站点id查询相关配置信息
|
||||||
|
ThirdPartySettingInfo settingInfo = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(orderInfo.getStationId()));
|
||||||
|
if (settingInfo == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String operatorId = settingInfo.getOperatorId();
|
||||||
|
String operatorSecret = settingInfo.getOperatorSecret();
|
||||||
|
String signSecret = settingInfo.getSignSecret();
|
||||||
|
String dataSecret = settingInfo.getDataSecret();
|
||||||
|
String dataSecretIv = settingInfo.getDataSecretIv();
|
||||||
|
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("CheckOrderSeq", orderCode);
|
json.put("CheckOrderSeq", orderCode);
|
||||||
json.put("StartTime", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime()));
|
json.put("StartTime", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime()));
|
||||||
@@ -997,13 +1109,13 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
json.put("ChargeOrders", list);
|
json.put("ChargeOrders", list);
|
||||||
|
|
||||||
// 获取令牌
|
// 获取令牌
|
||||||
String token = getToken(OPERATOR_ID, OPERATOR_SECRET);
|
String token = getToken(operatorId, operatorSecret);
|
||||||
if (StringUtils.isBlank(token)){
|
if (StringUtils.isBlank(token)){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String jsonString = JSONObject.toJSONString(json);
|
String jsonString = JSONObject.toJSONString(json);
|
||||||
// 发送请求
|
// 发送请求
|
||||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, DATA_SECRET, DATA_SECRETIV, OPERATOR_ID, SIG_SECRET);
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user