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
b89945db
Commit
b89945db
authored
Sep 24, 2024
by
Neo Turing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
6650ff7c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
Class1.cs
Src/Class1.cs
+0
-0
AssemblyInfo.cs
Src/Properties/AssemblyInfo.cs
+2
-2
RestfulTimeliness.cs
Src/RestfulTimeliness.cs
+11
-2
No files found.
Src/Class1.cs
View file @
b89945db
This diff is collapsed.
Click to expand it.
Src/Properties/AssemblyInfo.cs
View file @
b89945db
...
...
@@ -32,6 +32,6 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.2024.
820
0")]
[assembly: AssemblyFileVersion("5.4.2024.
820
0")]
[assembly: AssemblyVersion("5.4.2024.
918
0")]
[assembly: AssemblyFileVersion("5.4.2024.
918
0")]
Src/RestfulTimeliness.cs
View file @
b89945db
...
...
@@ -103,8 +103,16 @@ namespace Jst.Lims.Timeliness
BeginDate
=
DateTime
.
Parse
(
BeginDate
.
ToString
(
"yyyy-MM-dd"
));
EndDate
=
DateTime
.
Parse
(
EndDate
.
ToString
(
"yyyy-MM-dd"
));
if
(
EndDate
<
BeginDate
)
throw
new
Exception
(
"查询结束日期不可小于开始日期!"
);
var
days
=
EndDate
.
Subtract
(
BeginDate
).
Days
;
if
(
days
>
92
)
throw
new
Exception
(
"最多查询三个月的数据,您已超出日期范围上线!"
);
(
EndDate
.
Subtract
(
BeginDate
).
Days
>
31
).
ThrowIfTrue
(
"时间跨度不得大于31天!"
);
#
region
启用缓存
,
20
分钟内查询条件相同不重复请求数据库
var
cache
=
KiviiContext
.
GetCacheClient
();
var
cacheKey
=
KiviiContext
.
GetUrnKey
(
$"
{
this
.
GetType
().
FullName
}
_Request_
{
BeginDate
:
G
}
_
{
EndDate
:
G
}
_
{
TimeFilter
}
_
{
Grouped
}
_
{
Urgent
}
_
{
PolicyNodeKvids
.
Join
(
","
)}
"
);
var
cacheValue
=
cache
.
Get
<
RestfulQueryResponse
<
TimelineStatistic
>>(
cacheKey
);
if
(
cacheValue
!=
null
)
{
return
cacheValue
;
}
#
endregion
var
rtns
=
new
RestfulQueryResponse
<
TimelineStatistic
>();
rtns
.
Results
=
new
List
<
TimelineStatistic
>();
...
...
@@ -390,6 +398,7 @@ namespace Jst.Lims.Timeliness
}
rtns
.
Results
=
rtns
.
Results
.
OrderBy
(
o
=>
o
.
SortId
).
ToList
();
rtns
.
Total
=
rtns
.
Results
.
Count
;
cache
.
Set
(
cacheKey
,
rtns
,
TimeSpan
.
FromMinutes
(
20
));
return
rtns
;
}
}
...
...
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