Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
Jst.Domain.Lims.Timeliness.V4.5
Project
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
陶然
Jst.Domain.Lims.Timeliness.V4.5
Commits
6bde20d7
Commit
6bde20d7
authored
Sep 24, 2024
by
陶然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加缓存
parent
b89945db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
AssemblyInfo.cs
Src/Properties/AssemblyInfo.cs
+2
-2
RestfulTimeliness.cs
Src/RestfulTimeliness.cs
+2
-1
No files found.
Src/Properties/AssemblyInfo.cs
View file @
6bde20d7
...
...
@@ -32,6 +32,6 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.2024.9
18
0")]
[assembly: AssemblyFileVersion("5.4.2024.9
18
0")]
[assembly: AssemblyVersion("5.4.2024.9
24
0")]
[assembly: AssemblyFileVersion("5.4.2024.9
24
0")]
Src/RestfulTimeliness.cs
View file @
6bde20d7
...
...
@@ -104,9 +104,10 @@ namespace Jst.Lims.Timeliness
EndDate
=
DateTime
.
Parse
(
EndDate
.
ToString
(
"yyyy-MM-dd"
));
if
(
EndDate
<
BeginDate
)
throw
new
Exception
(
"查询结束日期不可小于开始日期!"
);
(
EndDate
.
Subtract
(
BeginDate
).
Days
>
31
).
ThrowIfTrue
(
"时间跨度不得大于31天!"
);
var
kvids
=
PolicyNodeKvids
.
OrderBy
(
o
=>
o
).
Join
(
","
);
#
region
启用缓存
,
20
分钟内查询条件相同不重复请求数据库
var
cache
=
KiviiContext
.
GetCacheClient
();
var
cacheKey
=
KiviiContext
.
GetUrnKey
(
$"
{
this
.
GetType
().
FullName
}
_Request_
{
BeginDate
:
G
}
_
{
EndDate
:
G
}
_
{
TimeFilter
}
_
{
Grouped
}
_
{
Urgent
}
_
{
PolicyNodeKvids
.
Join
(
","
)
}
"
);
var
cacheKey
=
KiviiContext
.
GetUrnKey
(
$"
{
this
.
GetType
().
FullName
}
_Request_
{
BeginDate
:
G
}
_
{
EndDate
:
G
}
_
{
TimeFilter
}
_
{
Grouped
}
_
{
Urgent
}
_
{
kvids
}
"
);
var
cacheValue
=
cache
.
Get
<
RestfulQueryResponse
<
TimelineStatistic
>>(
cacheKey
);
if
(
cacheValue
!=
null
)
{
...
...
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