mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 19:45:09 +08:00
update 华为相关接口添加日志
This commit is contained in:
@@ -229,7 +229,7 @@ public class HuaweiServiceV2 {
|
||||
* @param stationIds
|
||||
* @return
|
||||
*/
|
||||
public List<StationStatusInfo> queryStationStatus(List<String> stationIds) {
|
||||
public String queryStationStatus(List<String> stationIds) {
|
||||
String requestName = "query_station_status";
|
||||
|
||||
// 拼装参数
|
||||
@@ -241,15 +241,18 @@ public class HuaweiServiceV2 {
|
||||
String token = getHuaWeiToken();
|
||||
// 发送请求
|
||||
String result = sendMsg2HuaWei(jsonString, token, requestName);
|
||||
if (result == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
// 转换成 StationStatus 对象
|
||||
List<StationStatusInfo> list = JSON.parseArray(result, StationStatusInfo.class);
|
||||
return list;
|
||||
// List<StationStatusInfo> list = JSON.parseArray(result, StationStatusInfo.class);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String result = "{\"StationStatusInfos\":[{\"ConnectorStatusInfos\":[{\"ConnectorID\":\"8823000000112302\",\"Status\":2},{\"ConnectorID\":\"8823000000112301\",\"Status\":2}],\"StationID\":\"19\"}]}";
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
System.out.println(jsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 接收设备接口状态变化推送
|
||||
* 需在Controller传入operatorId
|
||||
@@ -857,6 +860,7 @@ public class HuaweiServiceV2 {
|
||||
* @return 请求结果
|
||||
*/
|
||||
private String sendMsg2HuaWei(String jsonString, String token, String requestName) {
|
||||
log.info("向华为发送请求 jsonString:{}, token:{}, requestName:{}", jsonString, token, requestName);
|
||||
ThirdPartySettingInfo settingInfo = getHuaWeiSettingInfo();
|
||||
if (settingInfo == null) {
|
||||
return null;
|
||||
@@ -909,6 +913,7 @@ public class HuaweiServiceV2 {
|
||||
* @return
|
||||
*/
|
||||
private Map<String, String> getResultMap(JSONObject jsonObject) {
|
||||
log.info("加密华为数据 jsonObject:{}", jsonObject.toJSONString());
|
||||
String operatorId = ThirdPartyOperatorIdEnum.HUA_WEI.getOperatorId();
|
||||
ThirdPartyPlatformConfig platformConfig = thirdPartyPlatformConfigService.getInfoByOperatorId(operatorId);
|
||||
if (platformConfig == null) {
|
||||
|
||||
Reference in New Issue
Block a user