Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
indicators
Overview
Overview
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
zhangkb
indicators
Commits
61f16ac2
Commit
61f16ac2
authored
Sep 11, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
判断报表3数据是否存在地方加同步锁机制,防止重复数据插入。
parent
6a786477
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
BeforeCompareUnitCalActor.java
...tors/akka/actor/indicators/BeforeCompareUnitCalActor.java
+0
-2
IndicatorsReportService.java
...le/indicators/service/report/IndicatorsReportService.java
+5
-1
No files found.
src/main/java/com/keymobile/indicators/akka/actor/indicators/BeforeCompareUnitCalActor.java
View file @
61f16ac2
...
...
@@ -130,13 +130,11 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
indicatorsReportService
.
deleteReportThreeDataByParam
(
currentDate
,
new
ArrayList
<
String
>(
compareObjMap
.
keySet
()),
code
);
for
(
CompareUnitDef
unitDef
:
currentCompareUnitDef
)
{
synchronized
(
this
){
indicatorsReportService
.
dealDriveIndReportThreeData
(
unitDef
.
getCompareId
(),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
unitDef
.
getDate
(),
code
);
}
}
}
if
(
"0"
.
equals
(
isTest
))
{
logger
.
info
(
"本期同期对标单元试运行计算完成"
);
}
else
{
...
...
src/main/java/com/keymobile/indicators/service/report/IndicatorsReportService.java
View file @
61f16ac2
...
...
@@ -153,9 +153,13 @@ public class IndicatorsReportService {
findByIndIdAndDateAndCompareIdAndSort
(
indId
,
date
,
compareId
,
code
);
if
(!
calResults
.
isEmpty
())
{
for
(
DriveIndCalResultDef
calResult
:
calResults
)
{
IndicatorsReportThree
indReportData
=
null
;
//多线程查询会导致重复数据插入问题
synchronized
(
this
){
//判断是否存在
IndicatorsReportThree
indReportData
=
reportThreeMapper
.
getByParam
(
indReportData
=
reportThreeMapper
.
getByParam
(
calResult
.
getCompareObj
(),
date
,
type
,
code
);
}
if
(
indReportData
==
null
)
{
indReportData
=
new
IndicatorsReportThree
();
}
...
...
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