Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-cdp-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit eabb6bd3
authored
Oct 08, 2023
by
ThomasAdv
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加事务注解,去除todo标识
1 parent
fece0554
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
platform-cdp/src/main/java/cn/com/glsx/cdp/modules/queue/DataReportRabbitMQConsumer.java
platform-cdp/src/main/java/cn/com/glsx/cdp/modules/service/ModelService.java
platform-cdp/src/main/java/cn/com/glsx/cdp/modules/service/OneIdService.java
platform-cdp/src/main/java/cn/com/glsx/cdp/modules/queue/DataReportRabbitMQConsumer.java
View file @
eabb6bd
...
...
@@ -107,9 +107,9 @@ public class DataReportRabbitMQConsumer {
if
(
CollectionUtils
.
isNotEmpty
(
modelDTO
.
getModelFieldMappings
()))
{
Map
<
String
,
Object
>
existModelData
=
getExistModelData
(
modelDTO
);
if
(
existModelData
==
null
)
{
addModelData
(
modelDTO
);
thiz
.
addModelData
(
modelDTO
);
}
else
{
updateModelData
(
modelDTO
,
existModelData
);
thiz
.
updateModelData
(
modelDTO
,
existModelData
);
}
}
else
{
log
.
error
(
"model field mapping is empty, model:{}"
,
modelDTO
);
...
...
@@ -125,7 +125,8 @@ public class DataReportRabbitMQConsumer {
* @author caiym
* @date 2023年09月15日 17:14:42
*/
private
void
updateModelData
(
ModelDTO
modelDTO
,
Map
<
String
,
Object
>
existModelData
)
{
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
RpcServiceException
.
class
)
public
void
updateModelData
(
ModelDTO
modelDTO
,
Map
<
String
,
Object
>
existModelData
)
{
log
.
info
(
"updateModelData, modelDTO:{}, existModelData:{}"
,
modelDTO
,
existModelData
);
if
(
CollectionUtils
.
isNotEmpty
(
modelDTO
.
getModelFieldMappings
()))
{
Map
<
String
,
Object
>
fieldMap
=
mergeModelData
(
modelDTO
,
existModelData
);
...
...
@@ -287,7 +288,8 @@ public class DataReportRabbitMQConsumer {
* @author caiym
* @date 2023年09月15日 17:14:29
*/
private
void
addModelData
(
ModelDTO
modelDTO
)
{
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
RpcServiceException
.
class
)
public
void
addModelData
(
ModelDTO
modelDTO
)
{
log
.
info
(
"addModelData, modelDTO:{}"
,
modelDTO
);
if
(
CollectionUtils
.
isNotEmpty
(
modelDTO
.
getModelFieldMappings
()))
{
JSONObject
exJson
=
new
JSONObject
();
...
...
platform-cdp/src/main/java/cn/com/glsx/cdp/modules/service/ModelService.java
View file @
eabb6bd
...
...
@@ -60,6 +60,8 @@ public class ModelService {
}
}
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
RpcServiceException
.
class
)
public
void
insertTable
(
String
sql
){
try
{
modelMapper
.
insertTable
(
sql
);
...
...
@@ -69,6 +71,7 @@ public class ModelService {
}
}
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
RpcServiceException
.
class
)
public
void
updateTable
(
String
sql
){
try
{
modelMapper
.
updateTable
(
sql
);
...
...
platform-cdp/src/main/java/cn/com/glsx/cdp/modules/service/OneIdService.java
View file @
eabb6bd
...
...
@@ -55,7 +55,6 @@ public class OneIdService {
RpcAssert
.
assertNotNull
(
param
.
getBusinessType
(),
DefaultErrorEnum
.
DATA_NULL
,
"param.getBusinessType() not be null"
);
RpcAssert
.
assertNotEmpty
(
param
.
getOneIdFieldJson
(),
DefaultErrorEnum
.
DATA_NULL
,
"param.getOneIdFieldJson() not be empty"
);
List
<
OneIdFieldConfigDTO
>
readyMatchOneIdFieldConfigs
=
getReadyMatchOneIdFieldConfigs
(
param
);
//TODO 分布式锁
String
finalOneId
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
readyMatchOneIdFieldConfigs
))
{
for
(
OneIdFieldConfigDTO
readyMatchOneIdFieldConfig
:
readyMatchOneIdFieldConfigs
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment