Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
0a552956
Commit
0a552956
authored
Sep 16, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
检查静态数据与视图差额
parent
e3eed673
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
4 deletions
+23
-4
performance/Performance.Services/DapperService.cs
+23
-4
No files found.
performance/Performance.Services/DapperService.cs
View file @
0a552956
...
@@ -39,17 +39,36 @@ public void FreezeAllotSync(int allotId)
...
@@ -39,17 +39,36 @@ public void FreezeAllotSync(int allotId)
/// <returns></returns>
/// <returns></returns>
public
void
FreezeAllot
(
int
allotId
)
public
void
FreezeAllot
(
int
allotId
)
{
{
try
{
int
i
=
0
;
do
{
HanderFreeze
(
allotId
);
i
++;
}
while
(
QueryDiff
(
allotId
)
<
-
50
&&
i
<=
3
);
}
catch
{
}
void
HanderFreeze
(
int
allotId
)
{
using
(
var
connection
=
new
MySqlConnection
(
_options
.
Value
.
PerformanceConnectionString
))
using
(
var
connection
=
new
MySqlConnection
(
_options
.
Value
.
PerformanceConnectionString
))
{
{
if
(
connection
.
State
!=
ConnectionState
.
Open
)
connection
.
Open
();
if
(
connection
.
State
!=
ConnectionState
.
Open
)
connection
.
Open
();
try
{
string
sql
=
$@"call proc_freeze_allot(
{
allotId
}
)"
;
string
sql
=
$@"call proc_freeze_allot(
{
allotId
}
)"
;
connection
.
Execute
(
sql
,
commandTimeout
:
60
*
60
);
connection
.
Execute
(
sql
,
commandTimeout
:
60
*
60
);
}
}
catch
(
Exception
)
}
decimal
QueryDiff
(
int
allotId
)
{
{
throw
;
using
(
var
connection
=
new
MySqlConnection
(
_options
.
Value
.
PerformanceConnectionString
))
{
if
(
connection
.
State
!=
ConnectionState
.
Open
)
connection
.
Open
();
string
sql
=
$@"SELECT Diff FROM view_allot_result_diff WHERE AllotID = @allotId LIMIT 1"
;
return
connection
.
QuerySingle
<
decimal
>(
sql
,
new
{
allotId
},
commandTimeout
:
60
*
60
);
}
}
}
}
}
}
...
...
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