|
|
|
|
@@ -1,21 +1,27 @@
|
|
|
|
|
package com.jsowell.thirdparty.platform.service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
import com.google.common.collect.Maps;
|
|
|
|
|
import com.jsowell.common.constant.CacheConstants;
|
|
|
|
|
import com.jsowell.common.constant.Constants;
|
|
|
|
|
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
|
|
|
|
import com.jsowell.common.core.redis.RedisCache;
|
|
|
|
|
import com.jsowell.common.enums.thirdparty.BusinessInformationExchangeEnum;
|
|
|
|
|
import com.jsowell.common.enums.thirdparty.ThirdPartyOperatorIdEnum;
|
|
|
|
|
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
|
|
|
|
import com.jsowell.common.enums.ykc.BillingTimeTypeEnum;
|
|
|
|
|
import com.jsowell.common.enums.ykc.OrderStatusEnum;
|
|
|
|
|
import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum;
|
|
|
|
|
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
|
|
|
|
import com.jsowell.common.exception.BusinessException;
|
|
|
|
|
import com.jsowell.common.util.*;
|
|
|
|
|
import com.jsowell.common.util.bean.BeanUtils;
|
|
|
|
|
import com.jsowell.pile.domain.OrderBasicInfo;
|
|
|
|
|
import com.jsowell.pile.domain.OrderDetail;
|
|
|
|
|
import com.jsowell.pile.domain.ThirdPartyPlatformConfig;
|
|
|
|
|
@@ -41,15 +47,13 @@ import com.jsowell.thirdparty.lianlian.domain.ConnectorChargeStatusInfo;
|
|
|
|
|
import com.jsowell.thirdparty.lianlian.domain.ConnectorStatusInfo;
|
|
|
|
|
import com.jsowell.thirdparty.lianlian.domain.StationStatusInfo;
|
|
|
|
|
import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO;
|
|
|
|
|
import com.jsowell.thirdparty.lianlian.vo.LianLianResultVO;
|
|
|
|
|
import com.jsowell.thirdparty.lianlian.vo.QueryChargingStatusVO;
|
|
|
|
|
import com.jsowell.thirdparty.platform.domain.*;
|
|
|
|
|
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
|
|
|
|
|
import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory;
|
|
|
|
|
|
|
|
|
|
import com.jsowell.thirdparty.platform.util.Cryptos;
|
|
|
|
|
import com.jsowell.thirdparty.platform.util.Encodes;
|
|
|
|
|
import com.jsowell.thirdparty.platform.util.HttpRequestUtil;
|
|
|
|
|
import com.jsowell.thirdparty.platform.util.ThirdPartyPlatformUtils;
|
|
|
|
|
import com.jsowell.thirdparty.platform.util.*;
|
|
|
|
|
import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
|
|
|
|
|
import com.yi.business.geo.GeoCodeInfo;
|
|
|
|
|
import com.yi.business.geo.TermRelationTreeCoordinate;
|
|
|
|
|
@@ -61,6 +65,7 @@ import java.math.BigDecimal;
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@@ -196,7 +201,8 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|
|
|
|
map.put("ItemSize", pageInfo.getTotal());
|
|
|
|
|
map.put("OperatorInfos", operatorInfos);
|
|
|
|
|
|
|
|
|
|
Map<String, String> resultMap = ThirdPartyPlatformUtils.generateResultMap(map, thirdPartySecretInfoVO);
|
|
|
|
|
Map<String, String> resultMap = ThirdPartyPlatformUtils.generateResultMapV2(map, thirdPartySecretInfoVO.getOurDataSecret(),
|
|
|
|
|
thirdPartySecretInfoVO.getOurDataSecretIv(), thirdPartySecretInfoVO.getTheirSigSecret());
|
|
|
|
|
return resultMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -299,7 +305,8 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|
|
|
|
map.put("PageCount", pageInfo.getPages());
|
|
|
|
|
map.put("ItemSize", pageInfo.getTotal());
|
|
|
|
|
map.put("StationInfos", resultList);
|
|
|
|
|
Map<String, String> resultMap = ThirdPartyPlatformUtils.generateResultMap(map, thirdPartySecretInfoVO);
|
|
|
|
|
Map<String, String> resultMap = ThirdPartyPlatformUtils.generateResultMapV2(map, thirdPartySecretInfoVO.getOurDataSecret(),
|
|
|
|
|
thirdPartySecretInfoVO.getOurDataSecretIv(), thirdPartySecretInfoVO.getTheirSigSecret());
|
|
|
|
|
return resultMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -405,7 +412,8 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|
|
|
|
// map.put("Total", total);
|
|
|
|
|
map.put("StationStatusInfos", collect);
|
|
|
|
|
|
|
|
|
|
Map<String, String> resultMap = ThirdPartyPlatformUtils.generateResultMap(map, thirdPartySecretInfoVO);
|
|
|
|
|
Map<String, String> resultMap = ThirdPartyPlatformUtils.generateResultMapV2(map, thirdPartySecretInfoVO.getOurDataSecret(),
|
|
|
|
|
thirdPartySecretInfoVO.getOurDataSecretIv(), thirdPartySecretInfoVO.getTheirSigSecret());
|
|
|
|
|
return resultMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -456,7 +464,8 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|
|
|
|
// 结果集
|
|
|
|
|
Map<String, Object> map = Maps.newHashMap();
|
|
|
|
|
map.put("StationStatusInfos", stationStatusInfos);
|
|
|
|
|
Map<String, String> resultMap = ThirdPartyPlatformUtils.generateResultMap(map, thirdPartySecretInfoVO);
|
|
|
|
|
Map<String, String> resultMap = ThirdPartyPlatformUtils.generateResultMapV2(map, thirdPartySecretInfoVO.getOurDataSecret(),
|
|
|
|
|
thirdPartySecretInfoVO.getOurDataSecretIv(), thirdPartySecretInfoVO.getTheirSigSecret());
|
|
|
|
|
return resultMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -479,7 +488,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|
|
|
|
// 查询相关配置信息
|
|
|
|
|
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getNeiMengGuPlatformSecretInfo();
|
|
|
|
|
|
|
|
|
|
String operatorId = thirdPartySecretInfoVO.getTheirOperatorId();
|
|
|
|
|
String operatorId = Constants.OPERATORID_LIANLIAN;
|
|
|
|
|
String operatorSecret = thirdPartySecretInfoVO.getTheirOperatorSecret();
|
|
|
|
|
String signSecret = thirdPartySecretInfoVO.getTheirSigSecret();
|
|
|
|
|
String dataSecret = thirdPartySecretInfoVO.getTheirDataSecret();
|
|
|
|
|
@@ -497,7 +506,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|
|
|
|
String jsonString = JSON.toJSONString(json);
|
|
|
|
|
// 获取令牌
|
|
|
|
|
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
|
|
|
|
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
|
|
|
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret, thirdPlatformType);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -532,7 +541,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
|
|
// 调用联联平台接口
|
|
|
|
|
String operatorId = secretInfoVO.getTheirOperatorId();
|
|
|
|
|
String operatorId = Constants.OPERATORID_LIANLIAN;
|
|
|
|
|
String operatorSecret = secretInfoVO.getTheirOperatorSecret();
|
|
|
|
|
String signSecret = secretInfoVO.getTheirSigSecret();
|
|
|
|
|
String dataSecret = secretInfoVO.getTheirDataSecret();
|
|
|
|
|
@@ -545,10 +554,75 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|
|
|
|
String jsonString = JSON.toJSONString(info);
|
|
|
|
|
// 获取令牌
|
|
|
|
|
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
|
|
|
|
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
|
|
|
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret, secretInfoVO.getPlatformType());
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getToken(String urlAddress, String operatorId, String operatorSecret, String dataSecretIv, String signSecret, String dataSecret) {
|
|
|
|
|
String token = "";
|
|
|
|
|
// 先查询缓存有没有token
|
|
|
|
|
String tokenKey = CacheConstants.THIRD_PARTY_TOKEN_BY_OPERATOR_SECRET + operatorSecret;
|
|
|
|
|
RedisCache redisCache = BeanUtils.getBean(RedisCache.class);
|
|
|
|
|
String cacheToken = redisCache.getCacheObject(tokenKey);
|
|
|
|
|
if (StringUtils.isNotBlank(cacheToken)) {
|
|
|
|
|
token = cacheToken;
|
|
|
|
|
return token;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// 请求地址
|
|
|
|
|
String requestUrl = urlAddress + "query_token";
|
|
|
|
|
|
|
|
|
|
// 请求data
|
|
|
|
|
Map<String, String> data = new HashMap<>();
|
|
|
|
|
data.put("PlatformID", operatorId);
|
|
|
|
|
data.put("OperatorSecret", operatorSecret);
|
|
|
|
|
data.put("DataSecretIV", dataSecretIv);
|
|
|
|
|
String dataJson = JSONUtil.toJsonStr(data);
|
|
|
|
|
|
|
|
|
|
// 加密
|
|
|
|
|
byte[] encryptText = Cryptos.aesEncrypt(dataJson.getBytes(StandardCharsets.UTF_8),
|
|
|
|
|
dataSecret.getBytes(), dataSecretIv.getBytes());
|
|
|
|
|
String strData = Encodes.encodeBase64(encryptText);
|
|
|
|
|
|
|
|
|
|
Map<String, String> request = new LinkedHashMap<>();
|
|
|
|
|
request.put("PlatformID", operatorId);
|
|
|
|
|
request.put("Data", strData);
|
|
|
|
|
request.put("TimeStamp", DateUtils.parseDateToStr(DateUtils.YYYYMMDDHHMMSS, new Date()));
|
|
|
|
|
request.put("Seq", "0001");
|
|
|
|
|
|
|
|
|
|
// 生成签名
|
|
|
|
|
String sig = GBSignUtils.sign(request, signSecret);
|
|
|
|
|
request.put("Sig", sig);
|
|
|
|
|
|
|
|
|
|
String tokenRequest = JSONUtil.toJsonStr(request);
|
|
|
|
|
|
|
|
|
|
String response = HttpUtil.post(requestUrl, tokenRequest);
|
|
|
|
|
LianLianResultVO result = JSON.parseObject(response, LianLianResultVO.class);
|
|
|
|
|
// logger.info("获取令牌 result:{}", result);
|
|
|
|
|
|
|
|
|
|
if (result.getRet() == 0) {
|
|
|
|
|
// 解密data
|
|
|
|
|
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64((String) result.getData()),
|
|
|
|
|
dataSecret.getBytes(), dataSecretIv.getBytes());
|
|
|
|
|
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
|
|
|
|
Map<String, Object> resultMap = (Map<String, Object>) JSON.parse(dataStr);
|
|
|
|
|
token = String.valueOf(resultMap.get("AccessToken"));
|
|
|
|
|
if (resultMap.get("TokenAvailableTime") != null) {
|
|
|
|
|
int tokenAvailableTime = Integer.parseInt(String.valueOf(resultMap.get("TokenAvailableTime")));
|
|
|
|
|
// 将token存入缓存
|
|
|
|
|
redisCache.setCacheObject(tokenKey, token, tokenAvailableTime, TimeUnit.SECONDS);
|
|
|
|
|
}
|
|
|
|
|
// logger.info("token: {}", token);
|
|
|
|
|
}
|
|
|
|
|
// logger.info("获取令牌 result:{}, token: {}", result, token);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return token;
|
|
|
|
|
}
|
|
|
|
|
return token;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 充电订单推送 notification_charge_order_info
|
|
|
|
|
*
|
|
|
|
|
@@ -566,7 +640,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|
|
|
|
// 查询相关配置信息
|
|
|
|
|
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getNeiMengGuPlatformSecretInfo();
|
|
|
|
|
|
|
|
|
|
String operatorId = thirdPartySecretInfoVO.getTheirOperatorId();
|
|
|
|
|
String operatorId = Constants.OPERATORID_LIANLIAN;
|
|
|
|
|
String operatorSecret = thirdPartySecretInfoVO.getTheirOperatorSecret();
|
|
|
|
|
String signSecret = thirdPartySecretInfoVO.getTheirSigSecret();
|
|
|
|
|
String dataSecret = thirdPartySecretInfoVO.getTheirDataSecret();
|
|
|
|
|
@@ -609,7 +683,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|
|
|
|
JSONObject json = new JSONObject();
|
|
|
|
|
json.put("ChargeOrderInfo", orderInfo);
|
|
|
|
|
String jsonString = JSON.toJSONString(json);
|
|
|
|
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
|
|
|
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret, thirdPlatformType);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -627,7 +701,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|
|
|
|
// return null;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
String operatorId = secretInfoVO.getTheirOperatorId();
|
|
|
|
|
String operatorId = Constants.OPERATORID_LIANLIAN;
|
|
|
|
|
String operatorSecret = secretInfoVO.getTheirOperatorSecret();
|
|
|
|
|
String signSecret = secretInfoVO.getTheirSigSecret();
|
|
|
|
|
String dataSecret = secretInfoVO.getTheirDataSecret();
|
|
|
|
|
@@ -641,7 +715,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 推送地址
|
|
|
|
|
String url = urlAddress + "notification_orderInfo";
|
|
|
|
|
String url = urlAddress + "supervise_notification_charge_order_info";
|
|
|
|
|
|
|
|
|
|
// 拼装成内蒙古平台所需格式对象
|
|
|
|
|
ChargeOrderInfo orderInfo = transformChargeOrderInfo(orderBasicInfo, orderDetail);
|
|
|
|
|
@@ -667,10 +741,10 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
// 调用联联平台接口
|
|
|
|
|
JSONObject json = new JSONObject();
|
|
|
|
|
json.put("ChargeOrderInfo", orderInfo);
|
|
|
|
|
String jsonString = JSON.toJSONString(json);
|
|
|
|
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
|
|
|
|
// JSONObject json = new JSONObject();
|
|
|
|
|
// json.put("ChargeOrderInfo", orderInfo);
|
|
|
|
|
String jsonString = JSON.toJSONString(orderInfo);
|
|
|
|
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret, thirdPlatformType);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -685,39 +759,72 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|
|
|
|
public String notificationEquipChargeStatus(String orderCode) {
|
|
|
|
|
// 根据订单号查询订单信息
|
|
|
|
|
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
|
|
|
|
// OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderInfo.getOrderCode());
|
|
|
|
|
// 根据站点id查询运营商id
|
|
|
|
|
PileStationVO stationVO = pileStationInfoService.getStationInfo(orderInfo.getStationId());
|
|
|
|
|
|
|
|
|
|
// 查询枪口实时状态
|
|
|
|
|
List<RealTimeMonitorData> chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderInfo.getTransactionCode());
|
|
|
|
|
RealTimeMonitorData realTimeMonitorData;
|
|
|
|
|
if (CollectionUtils.isEmpty(chargingRealTimeData)) {
|
|
|
|
|
realTimeMonitorData = RealTimeMonitorData.builder()
|
|
|
|
|
.chargingDegree(Constants.ZERO)
|
|
|
|
|
.connectorStatus("3")
|
|
|
|
|
.build();
|
|
|
|
|
chargingRealTimeData.add(realTimeMonitorData);
|
|
|
|
|
} else {
|
|
|
|
|
realTimeMonitorData = chargingRealTimeData.get(0);
|
|
|
|
|
}
|
|
|
|
|
String orderStatus = orderInfo.getOrderStatus();
|
|
|
|
|
if (StringUtils.equals(OrderStatusEnum.IN_THE_CHARGING.getValue(), orderStatus)) {
|
|
|
|
|
// 充电中
|
|
|
|
|
orderStatus = "2";
|
|
|
|
|
} else if (StringUtils.equals(OrderStatusEnum.ORDER_COMPLETE.getValue(), orderStatus)) {
|
|
|
|
|
// 充电完成
|
|
|
|
|
orderStatus = "4";
|
|
|
|
|
}
|
|
|
|
|
BigDecimal current = realTimeMonitorData.getOutputCurrent() == null ? BigDecimal.ZERO : new BigDecimal(realTimeMonitorData.getOutputCurrent());
|
|
|
|
|
BigDecimal voltage = realTimeMonitorData.getOutputVoltage() == null ? BigDecimal.ZERO : new BigDecimal(realTimeMonitorData.getOutputVoltage());
|
|
|
|
|
String soc = realTimeMonitorData.getSOC() == null ? Constants.ZERO : realTimeMonitorData.getSOC();
|
|
|
|
|
// 查询相关配置信息
|
|
|
|
|
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getNeiMengGuPlatformSecretInfo();
|
|
|
|
|
|
|
|
|
|
String operatorId = thirdPartySecretInfoVO.getTheirOperatorId();
|
|
|
|
|
String operatorId = Constants.OPERATORID_LIANLIAN;
|
|
|
|
|
String operatorSecret = thirdPartySecretInfoVO.getTheirOperatorSecret();
|
|
|
|
|
String signSecret = thirdPartySecretInfoVO.getTheirSigSecret();
|
|
|
|
|
String dataSecret = thirdPartySecretInfoVO.getTheirDataSecret();
|
|
|
|
|
String dataSecretIv = thirdPartySecretInfoVO.getTheirDataSecretIv();
|
|
|
|
|
String urlAddress = thirdPartySecretInfoVO.getTheirUrlPrefix();
|
|
|
|
|
|
|
|
|
|
// 调用 查询充电状态方法
|
|
|
|
|
QueryEquipChargeStatusDTO dto = new QueryEquipChargeStatusDTO();
|
|
|
|
|
dto.setStartChargeSeq(orderCode);
|
|
|
|
|
dto.setOperatorID(thirdPartySecretInfoVO.getTheirOperatorId());
|
|
|
|
|
Map<String, String> map = queryEquipChargeStatus(dto);
|
|
|
|
|
if (map == null) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
String data = map.get("Data");
|
|
|
|
|
// 解密data (此处解密需用 thirdparty_platform_config 的密钥配置)
|
|
|
|
|
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(data),
|
|
|
|
|
thirdPartySecretInfoVO.getOurDataSecret().getBytes(), thirdPartySecretInfoVO.getOurDataSecretIv().getBytes());
|
|
|
|
|
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
|
|
|
|
// 转成对应的对象
|
|
|
|
|
QueryChargingStatusVO vo = JSONObject.parseObject(dataStr, QueryChargingStatusVO.class);
|
|
|
|
|
SupEquipChargeStatusInfo equipChargeStatusInfo = SupEquipChargeStatusInfo.builder()
|
|
|
|
|
.operatorID(operatorId)
|
|
|
|
|
.equipmentOwnerID(ThirdPartyPlatformUtils.extractEquipmentOwnerID(stationVO.getOrganizationCode()))
|
|
|
|
|
.stationID(orderInfo.getStationId())
|
|
|
|
|
.equipmentID(orderInfo.getPileSn())
|
|
|
|
|
.orderNo(orderInfo.getOrderCode())
|
|
|
|
|
.orderStatus(Integer.parseInt(orderStatus))
|
|
|
|
|
.connectorID(orderInfo.getPileConnectorCode())
|
|
|
|
|
.equipmentClassification(1) // 车辆充电设备接口
|
|
|
|
|
.pushTimeStamp(DateUtils.dateTimeNow())
|
|
|
|
|
.connectorStatus(Integer.parseInt(realTimeMonitorData.getConnectorStatus()))
|
|
|
|
|
.currentA(current)
|
|
|
|
|
.voltageA(voltage)
|
|
|
|
|
.soc(new BigDecimal(soc))
|
|
|
|
|
.startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime()))
|
|
|
|
|
.endTime(DateUtils.getDateTime())
|
|
|
|
|
.totalPower(new BigDecimal(realTimeMonitorData.getChargingDegree()))
|
|
|
|
|
.batteryPackId("")
|
|
|
|
|
.currentMeter("")
|
|
|
|
|
|
|
|
|
|
String url = urlAddress + BusinessInformationExchangeEnum.NOTIFICATION_EQUIP_CHARGE_STATUS.getValue();
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
|
|
String url = urlAddress + "supervise_notification_equip_charge_status";
|
|
|
|
|
// 调用联联平台接口
|
|
|
|
|
String jsonString = JSON.toJSONString(vo);
|
|
|
|
|
String jsonString = JSON.toJSONString(equipChargeStatusInfo);
|
|
|
|
|
|
|
|
|
|
// 获取令牌
|
|
|
|
|
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
|
|
|
|
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
|
|
|
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret, thirdPlatformType);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -747,7 +854,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|
|
|
|
// 查询相关配置信息
|
|
|
|
|
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getNeiMengGuPlatformSecretInfo();
|
|
|
|
|
|
|
|
|
|
String operatorId = thirdPartySecretInfoVO.getTheirOperatorId();
|
|
|
|
|
String operatorId = Constants.OPERATORID_LIANLIAN;
|
|
|
|
|
String operatorSecret = thirdPartySecretInfoVO.getTheirOperatorSecret();
|
|
|
|
|
String signSecret = thirdPartySecretInfoVO.getTheirSigSecret();
|
|
|
|
|
String dataSecret = thirdPartySecretInfoVO.getTheirDataSecret();
|
|
|
|
|
@@ -783,7 +890,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|
|
|
|
JSONObject json = new JSONObject();
|
|
|
|
|
json.put("ChargeOrderInfo", orderInfo);
|
|
|
|
|
String jsonString = JSON.toJSONString(json);
|
|
|
|
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
|
|
|
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret, thirdPlatformType);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -885,7 +992,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|
|
|
|
if (thirdPartySecretInfoVO == null) {
|
|
|
|
|
throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL);
|
|
|
|
|
}
|
|
|
|
|
thirdPartySecretInfoVO.setOurOperatorId(Constants.OPERATORID_JIANG_SU);
|
|
|
|
|
thirdPartySecretInfoVO.setOurOperatorId(Constants.OPERATORID_LIANLIAN);
|
|
|
|
|
return thirdPartySecretInfoVO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|