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
4d1f04c4
Commit
4d1f04c4
authored
May 31, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生成完,下发完,归档完统计每月汇报表数据
parent
541d4589
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
21 deletions
+80
-21
performance/Performance.Api/Controllers/AllotController.cs
+4
-0
performance/Performance.Api/Job/BackgroundJob.cs
+46
-1
performance/Performance.Api/wwwroot/Performance.Api.xml
+14
-7
performance/Performance.DtoModels/Enum.cs
+1
-0
performance/Performance.Services/AllotService.cs
+15
-13
No files found.
performance/Performance.Api/Controllers/AllotController.cs
View file @
4d1f04c4
...
...
@@ -385,6 +385,7 @@ public ApiResponse Pigeonhole([CustomizeValidator(RuleSet = "Delete"), FromBody]
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在或没有上传数据文件"
);
_allotService
.
Pigeonhole
(
allot
);
_taskService
.
Add
(
Background
.
JobType
.
每日汇报表汇总
,
allot
.
ID
.
ToString
());
return
new
ApiResponse
(
ResponseType
.
OK
);
}
...
...
@@ -458,6 +459,9 @@ public ApiResponse Issued([FromBody] AllotRequest request)
{
_allotService
.
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
绩效下发
,
EnumHelper
.
GetDescription
(
AllotStates
.
绩效下发
));
costTransferService
.
RejectedApplicat
(
allot
.
ID
);
_taskService
.
Add
(
Background
.
JobType
.
每日汇报表汇总
,
allot
.
ID
.
ToString
());
return
new
ApiResponse
(
ResponseType
.
OK
,
"下发成功"
);
}
else
...
...
performance/Performance.Api/Job/BackgroundJob.cs
View file @
4d1f04c4
...
...
@@ -93,6 +93,9 @@ public void Execute()
case
(
int
)
Background
.
JobType
.
自定义抽取
:
Execute_Allot_CustomExtract
(
service
,
task
);
break
;
case
(
int
)
Background
.
JobType
.
每日汇报表汇总
:
Execute_Allot_Statistics
(
service
,
task
);
break
;
default
:
service
.
Update
(
task
.
ID
,
Background
.
Status
.
无效
);
break
;
...
...
@@ -102,6 +105,33 @@ public void Execute()
}
/// <summary>
/// 每日汇报表汇总
/// </summary>
/// <param name="service"></param>
/// <param name="task"></param>
private
void
Execute_Allot_Statistics
(
TaskService
service
,
bg_task
task
)
{
using
(
var
scope
=
_serviceScopeFactory
.
CreateScope
())
{
var
allotService
=
scope
.
ServiceProvider
.
GetService
<
AllotService
>();
try
{
if
(
int
.
TryParse
(
task
.
Argument
,
out
int
allotId
))
{
service
.
Update
(
task
.
ID
,
Background
.
Status
.
执行中
);
Stopwatch
stopwatch
=
Stopwatch
.
StartNew
();
allotService
.
GenerateReportStatistics
(
allotId
);
stopwatch
.
Stop
();
service
.
Update
(
task
.
ID
,
Background
.
Status
.
完成
,
seconds
:
stopwatch
.
Elapsed
.
TotalSeconds
);
}
}
catch
(
Exception
ex
)
{
service
.
Update
(
task
.
ID
,
Background
.
Status
.
失败
,
ex
.
ToString
());
}
}
}
/// <summary>
/// 生成测算表
/// </summary>
/// <param name="service"></param>
...
...
@@ -134,7 +164,22 @@ private void Execute_Allot_Generate(TaskService service, bg_task task)
{
service
.
Update
(
task
.
ID
,
Background
.
Status
.
失败
,
ex
.
ToString
());
}
allotService
.
GenerateReport
(
allot
);
try
{
allotService
.
GenerateReport
(
allot
);
}
catch
(
Exception
)
{
}
try
{
allotService
.
GenerateReportStatistics
(
allotId
);
}
catch
(
Exception
)
{
}
}
}
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
4d1f04c4
...
...
@@ -2353,13 +2353,13 @@
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.StatisticsController.DeleteSelectionRecord(System.Int32)"
>
<summary>
删除报表查询记录
</summary>
<param
name=
"id"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.StatisticsController.DeleteSelectionRecord(System.Int32)"
>
<summary>
删除报表查询记录
</summary>
<param
name=
"id"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.StatisticsController.Search(Performance.DtoModels.StatisticsQuery)"
>
<summary>
查询报表结果
...
...
@@ -2433,6 +2433,13 @@
<param
name=
"query"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.BackgroundJob.Execute_Allot_Statistics(Performance.Services.TaskService,Performance.EntityModels.bg_task)"
>
<summary>
每日汇报表汇总
</summary>
<param
name=
"service"
></param>
<param
name=
"task"
></param>
</member>
<member
name=
"M:Performance.Api.BackgroundJob.Execute_Allot_Generate(Performance.Services.TaskService,Performance.EntityModels.bg_task)"
>
<summary>
生成测算表
...
...
performance/Performance.DtoModels/Enum.cs
View file @
4d1f04c4
...
...
@@ -91,6 +91,7 @@ public enum JobType
提取数据
=
2
,
报表
=
3
,
自定义抽取
=
4
,
每日汇报表汇总
=
5
,
}
public
enum
Status
{
...
...
performance/Performance.Services/AllotService.cs
View file @
4d1f04c4
...
...
@@ -493,6 +493,21 @@ public void GenerateReport(per_allot allot)
}
/// <summary>
/// 绩效生成报表
/// </summary>
/// <param name="allot"></param>
public
void
GenerateReportStatistics
(
int
allotId
)
{
try
{
reportService
.
ExecProc
(
"call proc_report_statistics(@allotId);"
,
new
{
allotId
});
}
catch
(
Exception
ex
)
{
_logger
.
LogError
(
$"每月汇报表生成失败。 allotid:
{
allotId
}
。"
+
ex
.
Message
);
}
}
/// <summary>
/// 验证科室核算单元、工号
/// </summary>
/// <param name="allot"></param>
...
...
@@ -586,19 +601,6 @@ public void Pigeonhole(per_allot allot)
allot
.
PigeonholeDate
=
DateTime
.
Now
;
allot
.
Remark
=
"归档"
;
_allotRepository
.
Update
(
allot
);
//if (_allotRepository.Update(allot))
//{
// var again = _againallotRepository.GetEntities(t => t.AllotID == allot.ID);
// if (again != null && again.Count > 0)
// {
// foreach (var item in again)
// {
// item.Remark = $"原状态:{item.States},归档更改状态";
// item.States = 5;
// _againallotRepository.Update(item);
// }
// }
//}
}
/// <summary>
...
...
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