Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
10695ffd
Commit
10695ffd
authored
Mar 25, 2021
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:区域删除数据同步
parent
b531a441
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
19 deletions
+16
-19
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+9
-8
View3dServiceImpl.java
...oin/amos/fas/business/service/impl/View3dServiceImpl.java
+1
-1
DataSyncUtil.java
...java/com/yeejoin/amos/fas/business/util/DataSyncUtil.java
+1
-5
AstDataSyncTopic.java
...ava/com/yeejoin/amos/fas/core/enums/AstDataSyncTopic.java
+5
-5
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
10695ffd
...
@@ -23,7 +23,6 @@ import javax.annotation.PostConstruct;
...
@@ -23,7 +23,6 @@ import javax.annotation.PostConstruct;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
com.yeejoin.amos.fas.business.util.DataSyncUtil
;
import
com.yeejoin.amos.fas.business.util.DataSyncUtil
;
import
com.yeejoin.dataprocess.common.enums.TopicName
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -267,11 +266,12 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -267,11 +266,12 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
riskSource
.
setStatus
(
oldRiskSource
.
getStatus
());
riskSource
.
setStatus
(
oldRiskSource
.
getStatus
());
}
}
iRiskSourceDao
.
saveAndFlush
(
riskSource
);
iRiskSourceDao
.
saveAndFlush
(
riskSource
);
dataSyncUtil
.
ast
GeographicalRegionDataSync
(
String
.
join
(
"_"
,
TopicName
.
AST_SAVE
.
getValue
(),
riskSource
.
getCode
(
)),
JSON
.
toJSONString
(
riskSource
));
dataSyncUtil
.
ast
DataSync
(
String
.
join
(
"_"
,
com
.
yeejoin
.
dataprocess
.
common
.
enums
.
AstDataSyncTopic
.
AST_REGION_SAVE
.
getValue
(),
String
.
valueOf
(
riskSource
.
getId
()
)),
JSON
.
toJSONString
(
riskSource
));
return
riskSource
;
return
riskSource
;
}
}
@Override
@Override
@Transactional
public
void
deleteRiskSource
(
String
appKey
,
String
product
,
String
token
,
String
success
,
Long
[]
riskSourceId
)
throws
Exception
{
public
void
deleteRiskSource
(
String
appKey
,
String
product
,
String
token
,
String
success
,
Long
[]
riskSourceId
)
throws
Exception
{
Set
<
Long
>
parentIds
=
new
LinkedHashSet
<>();
Set
<
Long
>
parentIds
=
new
LinkedHashSet
<>();
for
(
Long
rId
:
riskSourceId
)
{
for
(
Long
rId
:
riskSourceId
)
{
...
@@ -287,6 +287,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -287,6 +287,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
//1、删除风险点
//1、删除风险点
iRiskSourceDao
.
deleteById
(
rId
);
iRiskSourceDao
.
deleteById
(
rId
);
dataSyncUtil
.
astDataSync
(
String
.
join
(
"_"
,
com
.
yeejoin
.
dataprocess
.
common
.
enums
.
AstDataSyncTopic
.
AST_REGION_DELETE_BY_ID
.
getValue
(),
String
.
valueOf
(
rId
)),
String
.
valueOf
(
rId
));
//2.删除关联建筑关系,防止对站服务有问题,捕获异常,不影响业务正常秩序
//2.删除关联建筑关系,防止对站服务有问题,捕获异常,不影响业务正常秩序
try
{
try
{
rs
.
ifPresent
(
r
->{
rs
.
ifPresent
(
r
->{
...
@@ -311,6 +312,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -311,6 +312,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Override
@Override
public
void
deleteById
(
Long
id
)
{
public
void
deleteById
(
Long
id
)
{
iRiskSourceDao
.
deleteById
(
id
);
iRiskSourceDao
.
deleteById
(
id
);
dataSyncUtil
.
astDataSync
(
String
.
join
(
"_"
,
com
.
yeejoin
.
dataprocess
.
common
.
enums
.
AstDataSyncTopic
.
AST_REGION_DELETE_BY_ID
.
getValue
(),
String
.
valueOf
(
id
)),
String
.
valueOf
(
id
));
}
}
@Override
@Override
...
@@ -331,9 +333,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -331,9 +333,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
fillBasicParams
(
userId
,
orgCode
,
synBo
.
getId
(),
riskSource
);
fillBasicParams
(
userId
,
orgCode
,
synBo
.
getId
(),
riskSource
);
riskSource
=
iRiskSourceDao
.
save
(
riskSource
);
riskSource
=
iRiskSourceDao
.
save
(
riskSource
);
}
}
// redisTemplate.opsForValue().set(String.join("-", "ast_save", riskSource.getCode()), riskSource);
dataSyncUtil
.
astDataSync
(
String
.
join
(
"_"
,
com
.
yeejoin
.
dataprocess
.
common
.
enums
.
AstDataSyncTopic
.
AST_REGION_SAVE
.
getValue
(),
String
.
valueOf
(
riskSource
.
getId
())),
JSON
.
toJSONString
(
riskSource
));
// webMqttComponent.publish("/ast/save", JSON.toJSONString(riskSource));
dataSyncUtil
.
astGeographicalRegionDataSync
(
String
.
join
(
"_"
,
TopicName
.
AST_SAVE
.
getValue
(),
riskSource
.
getCode
()),
JSON
.
toJSONString
(
riskSource
));
//2.同步下级(只有一级)
//2.同步下级(只有一级)
if
(!
CollectionUtils
.
isEmpty
(
synBo
.
getChildren
())){
if
(!
CollectionUtils
.
isEmpty
(
synBo
.
getChildren
())){
RiskSource
finalRiskSource
=
riskSource
;
RiskSource
finalRiskSource
=
riskSource
;
...
@@ -345,7 +345,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -345,7 +345,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
return
t
;
return
t
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
iRiskSourceDao
.
saveAll
(
children
);
iRiskSourceDao
.
saveAll
(
children
);
dataSyncUtil
.
ast
GeographicalRegionDataSync
(
String
.
join
(
"_"
,
TopicName
.
AST_SAVE_ALL
.
getValue
(),
riskSource
.
getCode
()),
JSON
.
toJSONString
(
riskSource
));
dataSyncUtil
.
ast
DataSync
(
com
.
yeejoin
.
dataprocess
.
common
.
enums
.
AstDataSyncTopic
.
AST_REGION_SAVE_ALL
.
getValue
(),
JSON
.
toJSONString
(
children
));
}
}
return
riskSource
;
return
riskSource
;
}
}
...
@@ -367,7 +367,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -367,7 +367,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
RiskSource
riskSource
=
exist
.
get
();
RiskSource
riskSource
=
exist
.
get
();
riskSource
.
setSourceId
(
null
);
riskSource
.
setSourceId
(
null
);
iRiskSourceDao
.
save
(
riskSource
);
iRiskSourceDao
.
save
(
riskSource
);
dataSyncUtil
.
ast
GeographicalRegionDataSync
(
String
.
join
(
"_"
,
TopicName
.
AST_SAVE
.
getValue
(),
riskSource
.
getCode
(
)),
JSON
.
toJSONString
(
riskSource
));
dataSyncUtil
.
ast
DataSync
(
String
.
join
(
"_"
,
com
.
yeejoin
.
dataprocess
.
common
.
enums
.
AstDataSyncTopic
.
AST_REGION_SAVE
.
getValue
(),
String
.
valueOf
(
riskSource
.
getId
()
)),
JSON
.
toJSONString
(
riskSource
));
}
}
return
exist
.
isPresent
();
return
exist
.
isPresent
();
}
}
...
@@ -1830,6 +1830,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1830,6 +1830,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
riskSource
.
setRpni
(
null
);
riskSource
.
setRpni
(
null
);
riskSource
.
setRiskLevelId
(
null
);
riskSource
.
setRiskLevelId
(
null
);
iRiskSourceDao
.
save
(
riskSource
);
iRiskSourceDao
.
save
(
riskSource
);
dataSyncUtil
.
astDataSync
(
String
.
join
(
"_"
,
com
.
yeejoin
.
dataprocess
.
common
.
enums
.
AstDataSyncTopic
.
AST_REGION_SAVE
.
getValue
(),
String
.
valueOf
(
riskSource
.
getId
())),
JSON
.
toJSONString
(
riskSource
));
return
;
return
;
}
}
BigDecimal
rpn
=
rpnValueBo
.
getRpn
();
BigDecimal
rpn
=
rpnValueBo
.
getRpn
();
...
@@ -1843,7 +1844,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1843,7 +1844,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
}
}
iRiskSourceDao
.
save
(
riskSource
);
iRiskSourceDao
.
save
(
riskSource
);
dataSyncUtil
.
ast
GeographicalRegionDataSync
(
String
.
join
(
"_"
,
TopicName
.
AST_SAVE
.
getValue
(),
riskSource
.
getCode
(
)),
JSON
.
toJSONString
(
riskSource
));
dataSyncUtil
.
ast
DataSync
(
String
.
join
(
"_"
,
com
.
yeejoin
.
dataprocess
.
common
.
enums
.
AstDataSyncTopic
.
AST_REGION_SAVE
.
getValue
(),
String
.
valueOf
(
riskSource
.
getId
()
)),
JSON
.
toJSONString
(
riskSource
));
this
.
updateParentRpn
(
riskSource
.
getParentId
());
this
.
updateParentRpn
(
riskSource
.
getParentId
());
}
}
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/View3dServiceImpl.java
View file @
10695ffd
...
@@ -252,7 +252,7 @@ public class View3dServiceImpl implements IView3dService {
...
@@ -252,7 +252,7 @@ public class View3dServiceImpl implements IView3dService {
if
(
ue4Rotation
!=
null
)
riskSource
.
setUe4Rotation
(
pointBo
.
getUe4Rotation
());
if
(
ue4Rotation
!=
null
)
riskSource
.
setUe4Rotation
(
pointBo
.
getUe4Rotation
());
if
(
position3d
!=
null
)
riskSource
.
setPosition3d
(
position3d
);
if
(
position3d
!=
null
)
riskSource
.
setPosition3d
(
position3d
);
iRiskSourceDao
.
save
(
riskSource
);
iRiskSourceDao
.
save
(
riskSource
);
dataSyncUtil
.
ast
GeographicalRegionDataSync
(
String
.
join
(
"_"
,
com
.
yeejoin
.
dataprocess
.
common
.
enums
.
TopicName
.
AST_SAVE
.
getValue
(),
riskSource
.
getCode
(
)),
JSON
.
toJSONString
(
riskSource
));
dataSyncUtil
.
ast
DataSync
(
String
.
join
(
"_"
,
com
.
yeejoin
.
dataprocess
.
common
.
enums
.
AstDataSyncTopic
.
AST_REGION_SAVE
.
getValue
(),
String
.
valueOf
(
riskSource
.
getId
()
)),
JSON
.
toJSONString
(
riskSource
));
}
}
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/util/DataSyncUtil.java
View file @
10695ffd
...
@@ -23,11 +23,7 @@ public class DataSyncUtil {
...
@@ -23,11 +23,7 @@ public class DataSyncUtil {
@Autowired
@Autowired
private
WebMqttComponent
webMqttComponent
;
private
WebMqttComponent
webMqttComponent
;
// RedisTemplate redisTemplate = SpringContextHolder.getApplicationContext().getBean(RedisTemplate.class);
public
void
astDataSync
(
String
topic
,
String
message
)
{
//
// WebMqttComponent webMqttComponent = SpringContextHolder.getApplicationContext().getBean(WebMqttComponent.class);
public
void
astGeographicalRegionDataSync
(
String
topic
,
String
message
)
{
redisTemplate
.
opsForValue
().
set
(
topic
,
message
);
redisTemplate
.
opsForValue
().
set
(
topic
,
message
);
webMqttComponent
.
publish
(
topic
.
substring
(
0
,
topic
.
lastIndexOf
(
"_"
)),
message
);
webMqttComponent
.
publish
(
topic
.
substring
(
0
,
topic
.
lastIndexOf
(
"_"
)),
message
);
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/core/enums/
TopicName
.java
→
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/core/enums/
AstDataSyncTopic
.java
View file @
10695ffd
...
@@ -9,15 +9,15 @@ package com.yeejoin.dataprocess.common.enums;
...
@@ -9,15 +9,15 @@ package com.yeejoin.dataprocess.common.enums;
* @Date: 2021/3/23 15:55
* @Date: 2021/3/23 15:55
* @Version: 1.0
* @Version: 1.0
*/
*/
public
enum
TopicName
{
public
enum
AstDataSyncTopic
{
ROLL_CALL_DEFAULT
(
1
,
"listenDefault
"
),
AST_REGION_SAVE
(
10
,
"ast_save
"
),
AST_
SAVE
(
2
,
"ast_save
"
),
AST_
REGION_SAVE_ALL
(
11
,
"ast_save_all
"
),
AST_
SAVE_ALL
(
3
,
"ast_save_all
"
);
AST_
REGION_DELETE_BY_ID
(
12
,
"ast_delete_by_id
"
);
private
final
Integer
key
;
private
final
Integer
key
;
private
final
String
value
;
private
final
String
value
;
private
TopicName
(
Integer
key
,
String
value
)
{
private
AstDataSyncTopic
(
Integer
key
,
String
value
)
{
this
.
key
=
key
;
this
.
key
=
key
;
this
.
value
=
value
;
this
.
value
=
value
;
}
}
...
...
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