|
@@ -3,11 +3,10 @@ package com.zsElectric.boot.charging.service.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.Gson;
|
|
|
import com.google.gson.JsonObject;
|
|
import com.google.gson.JsonObject;
|
|
|
|
|
+import com.zsElectric.boot.charging.dto.StartChargingRequestDTO;
|
|
|
|
|
+import com.zsElectric.boot.charging.dto.StartChargingResponseVO;
|
|
|
import com.zsElectric.boot.charging.service.ChargingBusinessService;
|
|
import com.zsElectric.boot.charging.service.ChargingBusinessService;
|
|
|
-import com.zsElectric.boot.charging.vo.ChargingPricePolicyVO;
|
|
|
|
|
-import com.zsElectric.boot.charging.vo.EquipmentAuthResponseVO;
|
|
|
|
|
-import com.zsElectric.boot.charging.vo.QueryStationStatusVO;
|
|
|
|
|
-import com.zsElectric.boot.charging.vo.QueryStationsInfoVO;
|
|
|
|
|
|
|
+import com.zsElectric.boot.charging.vo.*;
|
|
|
import com.zsElectric.boot.common.constant.ConnectivityConstants;
|
|
import com.zsElectric.boot.common.constant.ConnectivityConstants;
|
|
|
import com.zsElectric.boot.common.util.electric.ChargingUtil;
|
|
import com.zsElectric.boot.common.util.electric.ChargingUtil;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
@@ -77,4 +76,40 @@ public class ChargingBusinessServiceImpl implements ChargingBusinessService {
|
|
|
log.info("设备接口状态查询返回结果解密后:{}", responseDecode);
|
|
log.info("设备接口状态查询返回结果解密后:{}", responseDecode);
|
|
|
return new Gson().fromJson(responseDecode, QueryStationStatusVO.class);
|
|
return new Gson().fromJson(responseDecode, QueryStationStatusVO.class);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public StartChargingResponseVO startCharging(StartChargingRequestDTO requestDTO){
|
|
|
|
|
+ Map<String, Object> stringObjectMap = BeanUtil.beanToMap(requestDTO);
|
|
|
|
|
+ log.info("设备接口状态查询请求参数:{}", stringObjectMap);
|
|
|
|
|
+ JsonObject jsonObject = chargingUtil.chargingRequest(ConnectivityConstants.TEST_DOMAIN + ConnectivityConstants.QUERY_START_CHARGE, stringObjectMap, true);
|
|
|
|
|
+ log.info("设备接口状态查询返回结果:{}", jsonObject);
|
|
|
|
|
+ JsonObject responseDecode = chargingUtil.responseDecode(jsonObject);
|
|
|
|
|
+ log.info("设备接口状态查询返回结果解密后:{}", responseDecode);
|
|
|
|
|
+ return new Gson().fromJson(responseDecode, StartChargingResponseVO.class);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public ChargingStatusQueryResponseVO queryChargingStatus(String StartChargeSeq) {
|
|
|
|
|
+ Map<String, Object> queryParms = new HashMap<>();
|
|
|
|
|
+ queryParms.put("StartChargeSeq", StartChargeSeq);
|
|
|
|
|
+ log.info("查询充电订单状态请求参数:{}", queryParms);
|
|
|
|
|
+ JsonObject jsonObject = chargingUtil.chargingRequest(ConnectivityConstants.TEST_DOMAIN + ConnectivityConstants.QUERY_EQUIP_CHARGE_STATUS, queryParms, true);
|
|
|
|
|
+ log.info("查询充电订单状态返回结果:{}", jsonObject);
|
|
|
|
|
+ JsonObject responseDecode = chargingUtil.responseDecode(jsonObject);
|
|
|
|
|
+ log.info("查询充电订单状态返回结果解密后:{}", responseDecode);
|
|
|
|
|
+ return new Gson().fromJson(responseDecode, ChargingStatusQueryResponseVO.class);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public StopChargingOperationResponseVO stopCharging(String StartChargeSeq, String ConnectorID) {
|
|
|
|
|
+ Map<String, Object> queryTokenParms = new HashMap<>();
|
|
|
|
|
+ queryTokenParms.put("StartChargeSeq", StartChargeSeq);
|
|
|
|
|
+ queryTokenParms.put("ConnectorID", ConnectorID);
|
|
|
|
|
+ log.info("停止充电请求参数:{}", queryTokenParms);
|
|
|
|
|
+ JsonObject jsonObject = chargingUtil.chargingRequest(ConnectivityConstants.TEST_DOMAIN + ConnectivityConstants.QUERY_STOP_CHARGE, queryTokenParms, true);
|
|
|
|
|
+ log.info("停止充电返回结果:{}", jsonObject);
|
|
|
|
|
+ JsonObject responseDecode = chargingUtil.responseDecode(jsonObject);
|
|
|
|
|
+ log.info("停止充电返回结果解密后:{}", responseDecode);
|
|
|
|
|
+ return new Gson().fromJson(responseDecode, StopChargingOperationResponseVO.class);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|