Commit a646a903 authored by xixinzhao's avatar xixinzhao

修改问题

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