From 2058480f771d46ca29689d9e1005fdcc454d1948 Mon Sep 17 00:00:00 2001 From: Lemon Date: Thu, 16 May 2024 09:10:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B7=B1=E5=9C=B3=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=20=E8=AE=BE=E5=A4=87=E7=8A=B6=E6=80=81=E5=8F=98?= =?UTF-8?q?=E5=8C=96=E6=8E=A8=E9=80=81=20=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ShenZhenPlatformServiceImpl.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ShenZhenPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ShenZhenPlatformServiceImpl.java index e489f1b33..c6986549a 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ShenZhenPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ShenZhenPlatformServiceImpl.java @@ -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