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
6932b452
Commit
6932b452
authored
May 12, 2025
by
Neo Turing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
a94c721a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
180 additions
and
4 deletions
+180
-4
AssemblyInfo.cs
Src/Properties/AssemblyInfo.cs
+2
-2
RestfulTimeliness.cs
Src/RestfulTimeliness.cs
+178
-2
No files found.
Src/Properties/AssemblyInfo.cs
View file @
6932b452
...
...
@@ -32,6 +32,6 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.2025.
428
0")]
[assembly: AssemblyFileVersion("5.4.2025.
428
0")]
[assembly: AssemblyVersion("5.4.2025.
512
0")]
[assembly: AssemblyFileVersion("5.4.2025.
512
0")]
Src/RestfulTimeliness.cs
View file @
6932b452
...
...
@@ -73,7 +73,7 @@ namespace Jst.Lims.Timeliness
}
[
Api
(
Description
=
"报告数据录入
/报告编制
时效统计"
)]
[
Api
(
Description
=
"报告数据录入时效统计"
)]
[
RequiresAnyRole
(
SystemRoles
.
Everyone
)]
public
class
TimelineStatisticDataEntry2
:
RestfulExecution
<
TimelineStatistic
>
{
...
...
@@ -411,7 +411,7 @@ namespace Jst.Lims.Timeliness
}
}
[
Api
(
Description
=
"报告数据录入
/报告编制
时效统计"
)]
[
Api
(
Description
=
"报告数据录入时效统计"
)]
[
RequiresAnyRole
(
SystemRoles
.
Everyone
)]
public
class
TimelineStatisticDataEntry
:
RestfulExecution
<
TimelineStatistic
>
{
...
...
@@ -788,6 +788,182 @@ namespace Jst.Lims.Timeliness
}
}
[
Api
(
Description
=
"报告编审签时效统计"
)]
[
RequiresAnyRole
(
SystemRoles
.
Everyone
)]
public
class
TimelineStatisticOther
:
RestfulExecution
<
TimelineStatistic
>
{
public
List
<
Guid
>
PolicyNodeKvids
{
get
;
set
;
}
/// <summary>
/// 统计的开始日期
/// </summary>
public
DateTime
BeginDate
{
get
;
set
;
}
/// <summary>
/// 统计的结束日期
/// </summary>
public
DateTime
EndDate
{
get
;
set
;
}
//public TimeFilter TimeFilter { get; set; }
public
bool
Grouped
{
get
;
set
;
}
public
bool
?
Urgent
{
get
;
set
;
}
public
override
object
OnExecution
(
IRequest
req
,
IResponse
res
)
{
int
monthDay
=
DateTime
.
DaysInMonth
(
DateTime
.
Now
.
Year
,
DateTime
.
Now
.
Month
);
if
(
BeginDate
==
DateTime
.
MinValue
)
BeginDate
=
new
DateTime
(
DateTime
.
Now
.
Year
,
DateTime
.
Now
.
Month
,
1
);
if
(
EndDate
==
DateTime
.
MinValue
)
EndDate
=
new
DateTime
(
DateTime
.
Now
.
Year
,
DateTime
.
Now
.
Month
,
monthDay
);
BeginDate
=
DateTime
.
Parse
(
BeginDate
.
ToString
(
"yyyy-MM-dd"
));
EndDate
=
DateTime
.
Parse
(
EndDate
.
ToString
(
"yyyy-MM-dd"
));
if
(
EndDate
<
BeginDate
)
throw
new
Exception
(
"查询结束日期不可小于开始日期!"
);
var
rtns
=
new
RestfulQueryResponse
<
TimelineStatistic
>();
rtns
.
Results
=
new
List
<
TimelineStatistic
>();
var
connL
=
KiviiContext
.
GetOpenedDbConnection
<
Report
>();
var
conn
=
KiviiContext
.
GetOpenedDbConnection
<
Timeline
>();
var
results
=
new
List
<
TimelineStatistic
>();
if
(
connL
.
ConnectionString
==
conn
.
ConnectionString
)
//同一个数据库下的情况 用leftjoin联合查询
{
//connL.Close();
connL
=
conn
;
var
query
=
conn
.
From
<
Timeline
>();
query
.
LeftJoin
<
Report
>((
o
,
r
)
=>
o
.
BizKvid
==
r
.
Kvid
);
if
(
PolicyNodeKvids
.
IsNullOrEmpty
())
query
.
Where
<
Timeline
>(
o
=>
o
.
PreKvid
==
Guid
.
Empty
&&
o
.
RootKvid
==
o
.
Kvid
);
//不指定节点,就查根节点
else
query
.
Where
<
Timeline
>(
o
=>
Sql
.
In
(
o
.
PolicyNodeKvid
,
PolicyNodeKvids
)
&&
o
.
PreKvid
!=
Guid
.
Empty
);
//指定节点,不能包含根节点
query
.
Where
<
Report
>(
o
=>
o
.
DeadDate
>=
BeginDate
&&
o
.
DeadDate
<=
EndDate
&&
Sql
.
In
(
o
.
TypeEx
,
"W"
,
"Z"
));
//只查看不加急并且要求完成日期在所选范围内的时效记录
query
.
And
<
Report
>(
o
=>
!
o
.
ReportId
.
ToLower
().
Contains
(
"test"
));
if
(
Urgent
!=
null
)
{
if
(
Urgent
.
Value
)
query
.
And
<
Report
>(
o
=>
o
.
UrgentRate
>
1
);
else
query
.
And
<
Report
>(
o
=>
o
.
UrgentRate
==
1
);
}
query
.
And
<
Report
>(
o
=>
(
o
.
BizType
!=
"G0"
&&
o
.
BizType
!=
"G1"
)
||
o
.
BizType
==
null
);
query
.
OrderBy
<
Timeline
>(
o
=>
o
.
PolicyNodeKvid
);
query
.
ThenBy
<
Report
>(
o
=>
o
.
DeadDate
);
query
.
Select
<
Timeline
,
Report
>((
o
,
r
)
=>
new
{
o
.
Kvid
,
o
.
RootKvid
,
o
.
ParentKvid
,
o
.
PolicyNodeKvid
,
o
.
OwnerKvid
,
o
.
OwnerName
,
o
.
OperatorName
,
r
.
ReportId
,
o
.
Title
,
o
.
PlanStartTime
,
o
.
RealStartTime
,
o
.
PlanFinishTime
,
o
.
RealFinishTime
,
o
.
Summary
,
o
.
Remark
,
ReportDealDate
=
r
.
DealDate
,
ReportDeadDate
=
r
.
DeadDate
,
ReportPreparationDate
=
r
.
PreparationDate
,
ReportReviewDate
=
r
.
ReviewDate
,
ReportIssueDate
=
r
.
IssueDate
,
ReportUrgentRate
=
r
.
UrgentRate
});
results
=
conn
.
Select
<
TimelineStatistic
>(
query
);
}
if
(
Grouped
)
{
if
(
PolicyNodeKvids
.
IsNullOrEmpty
())
//不按照节点Group统计,按照整个报告的时效进行统计
{
var
group
=
results
.
GroupBy
(
o
=>
o
.
ReportDeadDate
);
foreach
(
var
kv
in
group
)
{
var
total
=
new
TimelineStatistic
();
total
.
ReportDeadDate
=
kv
.
Key
;
total
.
Quantity
=
kv
.
Count
();
total
.
Details
=
new
List
<
TimelineStatistic
>();
var
records
=
kv
.
OrderBy
(
o
=>
o
.
PlanFinishTime
).
ToList
();
var
grop
=
records
.
GroupBy
(
o
=>
o
.
PlanFinishTime
);
foreach
(
var
gp
in
grop
)
{
var
detail
=
new
TimelineStatistic
();
detail
.
PlanFinishTime
=
gp
.
Key
;
detail
.
Quantity
=
gp
.
Count
();
detail
.
Details
=
new
List
<
TimelineStatistic
>();
foreach
(
var
item
in
gp
)
{
var
realFinishTime
=
item
.
RealFinishTime
;
if
(
realFinishTime
==
null
)
realFinishTime
=
DateTime
.
Now
;
if
(
item
.
PlanFinishTime
!=
null
&&
realFinishTime
>
item
.
PlanFinishTime
)
{
detail
.
TimeoutQuantity
++;
item
.
TimeoutQuantity
++;
total
.
TimeoutQuantity
++;
}
else
{
detail
.
NormalQuantity
++;
item
.
NormalQuantity
++;
total
.
NormalQuantity
++;
}
detail
.
Details
.
Add
(
item
);
}
total
.
Details
.
Add
(
detail
);
}
rtns
.
Results
.
Add
(
total
);
}
}
else
//按照节点Group
{
var
group
=
results
.
GroupBy
(
o
=>
new
{
o
.
PolicyNodeKvid
,
o
.
ReportDeadDate
,
o
.
Title
});
foreach
(
var
kv
in
group
)
{
var
total
=
new
TimelineStatistic
();
total
.
PolicyNodeKvid
=
kv
.
Key
.
PolicyNodeKvid
;
total
.
ReportDeadDate
=
kv
.
Key
.
ReportDeadDate
;
total
.
Title
=
kv
.
Key
.
Title
;
total
.
Quantity
=
kv
.
Count
();
total
.
Details
=
new
List
<
TimelineStatistic
>();
var
records
=
kv
.
OrderBy
(
o
=>
o
.
PlanFinishTime
).
ToList
();
var
grop
=
records
.
GroupBy
(
o
=>
o
.
PlanFinishTime
);
foreach
(
var
gp
in
grop
)
{
var
detail
=
new
TimelineStatistic
();
detail
.
PlanFinishTime
=
gp
.
Key
;
detail
.
Quantity
=
gp
.
Count
();
detail
.
Details
=
new
List
<
TimelineStatistic
>();
foreach
(
var
item
in
gp
)
{
var
realFinishTime
=
item
.
RealFinishTime
;
if
(
realFinishTime
==
null
)
realFinishTime
=
DateTime
.
Now
;
if
(
item
.
PlanFinishTime
!=
null
&&
realFinishTime
>
item
.
PlanFinishTime
)
{
detail
.
TimeoutQuantity
++;
item
.
TimeoutQuantity
++;
total
.
TimeoutQuantity
++;
}
else
{
detail
.
NormalQuantity
++;
item
.
NormalQuantity
++;
total
.
NormalQuantity
++;
}
detail
.
Details
.
Add
(
item
);
}
total
.
Details
.
Add
(
detail
);
}
rtns
.
Results
.
Add
(
total
);
}
}
}
else
rtns
.
Results
=
results
;
rtns
.
Total
=
rtns
.
Results
.
Count
;
return
rtns
;
}
}
public
enum
TimeFilter
{
Unsupported
=
0
,
...
...
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