Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-api
Commits
4935dfe7
Commit
4935dfe7
authored
Nov 13, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复应用更新其他信息时,导致【变量】更新
parent
fd0c55a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
AgentApplicationInfoServiceImpl.java
...ation/aggregate/impl/AgentApplicationInfoServiceImpl.java
+16
-1
No files found.
src/main/java/cn/com/poc/agent_application/aggregate/impl/AgentApplicationInfoServiceImpl.java
View file @
4935dfe7
...
@@ -101,12 +101,27 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
...
@@ -101,12 +101,27 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
@Override
@Override
public
BizAgentApplicationInfoEntity
saveOrUpdate
(
BizAgentApplicationInfoEntity
entity
)
throws
Exception
{
public
BizAgentApplicationInfoEntity
saveOrUpdate
(
BizAgentApplicationInfoEntity
entity
)
throws
Exception
{
// 如果存在agentId,则判断变量结构是否有变化,如果有变化,则删除redis中的数据
// 如果存在agentId,则判断变量结构是否有变化,如果有变化,则删除redis中的数据
boolean
needClean
=
false
;
if
(
StringUtils
.
isNotBlank
(
entity
.
getAgentId
()))
{
if
(
StringUtils
.
isNotBlank
(
entity
.
getAgentId
()))
{
BizAgentApplicationInfoEntity
infoEntity
=
bizAgentApplicationInfoService
.
getByAgentId
(
entity
.
getAgentId
());
if
(
CollectionUtils
.
isEmpty
(
entity
.
getVariableStructure
())
||
CollectionUtils
.
isEmpty
(
infoEntity
.
getVariableStructure
()))
{
needClean
=
true
;
}
else
if
(
infoEntity
.
getVariableStructure
().
size
()
!=
entity
.
getVariableStructure
().
size
())
{
needClean
=
true
;
}
else
{
String
sourceVariable
=
JsonUtils
.
serialize
(
infoEntity
.
getVariableStructure
());
String
targetVariable
=
JsonUtils
.
serialize
(
entity
.
getVariableStructure
());
needClean
=
!
StringUtils
.
equals
(
sourceVariable
,
targetVariable
);
}
}
if
(
needClean
)
{
String
contentKey
=
SetValueMemoryConstants
.
REDIS_PREFIX
+
entity
.
getAgentId
()
+
":"
+
entity
.
getMemberId
();
String
contentKey
=
SetValueMemoryConstants
.
REDIS_PREFIX
+
entity
.
getAgentId
()
+
":"
+
entity
.
getMemberId
();
redisService
.
del
(
contentKey
);
redisService
.
del
(
contentKey
);
}
}
// 保存或更新
// 保存或更新
return
StringUtils
.
isEmpty
(
entity
.
getAgentId
())
?
return
StringUtils
.
isEmpty
(
entity
.
getAgentId
())
?
bizAgentApplicationInfoService
.
save
(
entity
)
:
bizAgentApplicationInfoService
.
update
(
entity
);
bizAgentApplicationInfoService
.
save
(
entity
)
:
bizAgentApplicationInfoService
.
update
(
entity
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment