Commit a646a903 authored by xixinzhao's avatar xixinzhao

修改问题

parent 9a5a28e1
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONPObject;
import com.yeejoin.amos.boot.module.jcs.api.dto.AuthDataDto;
......@@ -122,6 +123,7 @@ public class CcsToStationUserInfoImpl implements ICcsToStationUserInfo {
jsonObject.put("traceId", json.get("id"));
JSONObject jsonObject1 = new JSONObject();
JSONObject jsonObject2 = new JSONObject();
JSONArray jsonArray = new JSONArray();
jsonObject1.put("warningObjectName", "巡检点");
jsonObject1.put("warningObjectCode", json.get("input_id"));
......@@ -129,7 +131,8 @@ public class CcsToStationUserInfoImpl implements ICcsToStationUserInfo {
jsonObject1.put("sourceAttributionDesc", "鄱阳湖");
jsonObject2.put("tabName", "页签");
jsonObject2.put("tabContent", new ArrayList<>());
jsonObject1.put("dynamicDetails", jsonObject2);
jsonArray.add(jsonObject2);
jsonObject1.put("dynamicDetails", jsonArray);
jsonObject.put("bizInfo", jsonObject1);
emqKeeper.getMqttClient().publish("patrol/data/analysis", jsonObject.toJSONString().getBytes(StandardCharsets.UTF_8), 1, false);
// mqttSendGateway.sendToMqtt("patrol/data/analysis", JSON.toJSONString(jsonObject));
......@@ -166,14 +169,14 @@ public class CcsToStationUserInfoImpl implements ICcsToStationUserInfo {
private void removeSession(String actionByProduct ,String loginId) {
AuthDataDto sessionsModel = (AuthDataDto)this.redisTemplate.opsForValue().get(sessionCacheKeyWithLoginId(loginId,actionByProduct));
SsoSessionsModel sessionsModel = (SsoSessionsModel)this.redisTemplate.opsForValue().get(sessionCacheKeyWithLoginId(loginId,actionByProduct));
if(!ObjectUtils.isEmpty(sessionsModel)) {
this.redisTemplate.delete(sessionCacheKeyWithLoginId(loginId,actionByProduct));
this.redisTemplate.delete(sessionCacheKeyWithToken(sessionsModel.getToken(),actionByProduct));
AuthDataDto model = queryByUserId(sessionsModel.getUserId());
SsoSessionsModel model = queryByUserId(sessionsModel.getUserId());
if(!ObjectUtils.isEmpty(model) && model.getToken().equals(sessionsModel.getToken())) {
this.redisTemplate.delete(sessionCacheKeyWithUserId(sessionsModel.getUserId()));
......@@ -198,8 +201,8 @@ public class CcsToStationUserInfoImpl implements ICcsToStationUserInfo {
return Redis.genKey(CacheType.ERASABLE.name(),SESSION_USERID,userId);
}
private AuthDataDto queryByUserId(String userId) {
return (AuthDataDto) this.redisTemplate.opsForValue().get(sessionCacheKeyWithUserId(userId));
private SsoSessionsModel queryByUserId(String userId) {
return (SsoSessionsModel) this.redisTemplate.opsForValue().get(sessionCacheKeyWithUserId(userId));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment