mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 19:45:09 +08:00
新增深圳平台 设备状态变化推送 接口
This commit is contained in:
@@ -15,6 +15,7 @@ import com.jsowell.common.util.PageUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.ThirdPartyPlatformConfig;
|
||||
import com.jsowell.pile.domain.ThirdPartyStationRelation;
|
||||
import com.jsowell.pile.dto.PushRealTimeInfoDTO;
|
||||
import com.jsowell.pile.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.pile.service.PileBasicInfoService;
|
||||
import com.jsowell.pile.service.PileStationInfoService;
|
||||
@@ -24,7 +25,9 @@ import com.jsowell.pile.thirdparty.EquipmentInfo;
|
||||
import com.jsowell.pile.thirdparty.ZDLStationInfo;
|
||||
import com.jsowell.pile.vo.ThirdPartySecretInfoVO;
|
||||
import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO;
|
||||
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
|
||||
import com.jsowell.pile.vo.web.PileStationVO;
|
||||
import com.jsowell.thirdparty.lianlian.domain.ConnectorStatusInfo;
|
||||
import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO;
|
||||
import com.jsowell.thirdparty.platform.common.StationInfo;
|
||||
import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory;
|
||||
@@ -254,6 +257,41 @@ public class ShenZhenPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设备状态变化推送 notification_stationStatus
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String notificationStationStatus(PushRealTimeInfoDTO dto) {
|
||||
String thirdPartyType = dto.getThirdPartyType();
|
||||
String status = dto.getStatus();
|
||||
String pileConnectorCode = dto.getPileConnectorCode();
|
||||
|
||||
ThirdPartySecretInfoVO shenZhenSecretInfo = getShenZhenSecretInfo();
|
||||
String operatorId = shenZhenSecretInfo.getTheirOperatorId();
|
||||
String operatorSecret = shenZhenSecretInfo.getTheirOperatorSecret();
|
||||
String signSecret = shenZhenSecretInfo.getTheirSigSecret();
|
||||
String dataSecret = shenZhenSecretInfo.getTheirDataSecret();
|
||||
String dataSecretIv = shenZhenSecretInfo.getTheirDataSecretIv();
|
||||
String urlAddress = shenZhenSecretInfo.getTheirUrlPrefix();
|
||||
String url = urlAddress + BusinessInformationExchangeEnum.NOTIFICATION_STATION_STATUS.getValue();
|
||||
ConnectorStatusInfo info = ConnectorStatusInfo.builder()
|
||||
.connectorID(pileConnectorCode)
|
||||
.status(Integer.parseInt(status))
|
||||
.build();
|
||||
// 调用平台接口
|
||||
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);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取深圳平台相关密钥信息
|
||||
* @return
|
||||
|
||||
Reference in New Issue
Block a user