mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-13 03:39:55 +08:00
update 联联平台推送接口设置缓存
This commit is contained in:
@@ -320,6 +320,11 @@ public class CacheConstants {
|
|||||||
*/
|
*/
|
||||||
public static final String HUA_WEI_ORDER_INFO_BY_ORDER_CODE = "HUA_WEI_ORDER_INFO_BY_ORDER_CODE:";
|
public static final String HUA_WEI_ORDER_INFO_BY_ORDER_CODE = "HUA_WEI_ORDER_INFO_BY_ORDER_CODE:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联联平台推送枪口充电状态缓存key
|
||||||
|
*/
|
||||||
|
public static final String LIANLIAN_NOTIFICATION_CONNECTOR_CHARGE_STATUS = "LIANLIAN_NOTIFICATION_CONNECTOR_CHARGE_STATUS_";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 桩硬件故障 根据枪口号查询故障原因
|
* 桩硬件故障 根据枪口号查询故障原因
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -677,6 +677,12 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String notificationConnectorChargeStatus(String orderCode) {
|
public String notificationConnectorChargeStatus(String orderCode) {
|
||||||
|
// 设置2分钟缓存,2分钟只推送一次
|
||||||
|
String redisKey = CacheConstants.LIANLIAN_NOTIFICATION_CONNECTOR_CHARGE_STATUS + orderCode;
|
||||||
|
Object cacheObject = redisCache.getCacheObject(redisKey);
|
||||||
|
if (cacheObject != null) {
|
||||||
|
return "Success";
|
||||||
|
}
|
||||||
// 通过订单号查询信息
|
// 通过订单号查询信息
|
||||||
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||||
// 根据枪口号查询充电实时状态
|
// 根据枪口号查询充电实时状态
|
||||||
@@ -720,6 +726,8 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
String jsonString = JSON.toJSONString(json);
|
String jsonString = JSON.toJSONString(json);
|
||||||
// 发送请求
|
// 发送请求
|
||||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||||
|
// 将信息存入缓存,时间设置2分钟
|
||||||
|
redisCache.setCacheObject(redisKey, result, 2, TimeUnit.MINUTES);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user