From 2058480f771d46ca29689d9e1005fdcc454d1948 Mon Sep 17 00:00:00 2001 From: Lemon Date: Thu, 16 May 2024 09:10:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B7=B1=E5=9C=B3?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=20=E8=AE=BE=E5=A4=87=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=8F=98=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 From cb08fcabe9d6b41707c9e8a2f5e2a1b34985432c Mon Sep 17 00:00:00 2001 From: Lemon Date: Thu, 16 May 2024 09:17:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?update=20=20=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E7=AB=99=E7=82=B9=E8=AF=A6=E6=83=85=E6=96=B0=E5=A2=9E=E8=81=94?= =?UTF-8?q?=E7=B3=BB=E7=94=B5=E8=AF=9D=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsowell/pile/service/impl/PileStationInfoServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java index e3b10b1af..5685a66a4 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java @@ -491,7 +491,7 @@ public class PileStationInfoServiceImpl implements PileStationInfoService { } // 站点联系电话 if (StringUtils.isNotBlank(pileStationVO.getStationTel())) { - stationVO.setStationTel(stationVO.getStationTel()); + stationVO.setStationTel(pileStationVO.getStationTel()); } // 站点图片 if (StringUtils.isNotBlank(pileStationVO.getPictures())) {