mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-23 04:25:21 +08:00
update 联联平台推送接口设置缓存
This commit is contained in:
@@ -677,6 +677,12 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
*/
|
||||
@Override
|
||||
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);
|
||||
// 根据枪口号查询充电实时状态
|
||||
@@ -720,6 +726,8 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
String jsonString = JSON.toJSONString(json);
|
||||
// 发送请求
|
||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||
// 将信息存入缓存,时间设置2分钟
|
||||
redisCache.setCacheObject(redisKey, result, 2, TimeUnit.MINUTES);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user