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
5bbc5a35
Commit
5bbc5a35
authored
Aug 01, 2019
by
799284587@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
d286df15
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
7 deletions
+26
-7
performance/Performance.Api/Controllers/AllotController.cs
+11
-1
performance/Performance.Api/wwwroot/Performance.Api.xml
+2
-0
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+0
-0
performance/Performance.DtoModels/Enum.cs
+3
-0
performance/Performance.Services/AllotService.cs
+9
-5
performance/Performance.Services/ComputeService.cs
+1
-1
No files found.
performance/Performance.Api/Controllers/AllotController.cs
View file @
5bbc5a35
...
...
@@ -156,8 +156,18 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody]Al
if
(
null
==
allot
||
string
.
IsNullOrEmpty
(
allot
.
Path
))
throw
new
PerformanceException
(
"当前绩效记录不存在或没有上传数据文件"
);
var
email
=
_claim
.
GetUserClaim
(
JwtClaimTypes
.
Mail
);
if
(
allot
.
States
==
(
int
)
AllotStates
.
Wait
)
return
new
ApiResponse
(
ResponseType
.
OK
,
"当前绩效正在等待生成"
);
if
(
_evn
.
IsEnvironment
(
"Localhost"
))
_allotService
.
Generate
(
allot
,
email
);
//BackgroundJob.Enqueue(() => _allotService.Generate(allot, email));
else
BackgroundJob
.
Enqueue
(()
=>
_allotService
.
Generate
(
allot
,
email
));
_allotService
.
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
Wait
,
EnumHelper
.
GetDescription
(
AllotStates
.
Wait
));
//_allotService.Generate(allot, email);
////BackgroundJob.Enqueue(() => _allotService.Generate(allot, email));
return
new
ApiResponse
(
ResponseType
.
OK
);
}
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
5bbc5a35
...
...
@@ -582,6 +582,8 @@
保存提取文件
</summary>
<param
name=
"form"
></param>
<param
name=
"allotId"
></param>
<param
name=
"hospitalId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.ClaimService.GetUserId"
>
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
5bbc5a35
This diff is collapsed.
Click to expand it.
performance/Performance.DtoModels/Enum.cs
View file @
5bbc5a35
...
...
@@ -52,5 +52,8 @@ public enum AllotStates
/// <summary> 归档 </summary>
[
Description
(
"归档"
)]
Archive
=
8
,
/// <summary> 归档 </summary>
[
Description
(
"等待"
)]
Wait
=
9
,
}
}
performance/Performance.Services/AllotService.cs
View file @
5bbc5a35
...
...
@@ -193,6 +193,10 @@ public bool Update(per_allot allot)
}
#
endregion
public
void
UpdateAllotStates
(
int
allotId
,
int
states
,
string
remark
)
{
_allotRepository
.
UpdateAllotStates
(
allotId
,
states
,
remark
);
}
/// <summary>
/// 生成绩效
/// </summary>
...
...
@@ -205,17 +209,17 @@ public void Generate(per_allot allot, string mail)
{
logdbug
.
Add
(
allot
.
ID
,
"绩效开始执行"
,
JsonHelper
.
Serialize
(
allot
));
configService
.
Clear
(
allot
.
ID
);
_allotRepository
.
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
InCheckData
,
EnumHelper
.
GetDescription
(
AllotStates
.
InCheckData
));
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
InCheckData
,
EnumHelper
.
GetDescription
(
AllotStates
.
InCheckData
));
// 导出数据
var
excel
=
importDataService
.
ReadDataAndSave
(
allot
);
if
(!
checkDataService
.
Check
(
excel
,
allot
))
{
_allotRepository
.
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
CheckFail
,
EnumHelper
.
GetDescription
(
AllotStates
.
CheckFail
));
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
CheckFail
,
EnumHelper
.
GetDescription
(
AllotStates
.
CheckFail
));
SendEmail
(
allot
,
mail
,
3
,
time
);
logdbug
.
Add
(
allot
.
ID
,
"绩效数据校验失败"
,
JsonHelper
.
Serialize
(
allot
));
return
;
}
_allotRepository
.
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
InGenerate
,
EnumHelper
.
GetDescription
(
AllotStates
.
InGenerate
));
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
InGenerate
,
EnumHelper
.
GetDescription
(
AllotStates
.
InGenerate
));
// 计算合并数据
logdbug
.
Add
(
allot
.
ID
,
"计算合并数据"
,
JsonHelper
.
Serialize
(
allot
));
List
<
PerSheet
>
list
=
processComputService
.
MergeAndSave
(
excel
,
allot
);
...
...
@@ -227,14 +231,14 @@ public void Generate(per_allot allot, string mail)
var
baiscnormList
=
resultComputeService
.
Compute
(
allot
,
excel
,
list
);
resultComputeService
.
SpecialUnitCompute
(
excel
,
allot
,
baiscnormList
);
_allotRepository
.
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
GenerateSucceed
,
EnumHelper
.
GetDescription
(
AllotStates
.
GenerateSucceed
));
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
GenerateSucceed
,
EnumHelper
.
GetDescription
(
AllotStates
.
GenerateSucceed
));
//发送邮件
SendEmail
(
allot
,
mail
,
1
,
time
);
logdbug
.
Add
(
allot
.
ID
,
"绩效开始执行"
,
"绩效生成成功"
);
}
catch
(
Exception
ex
)
{
_allotRepository
.
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
GenerateFail
,
EnumHelper
.
GetDescription
(
AllotStates
.
GenerateFail
));
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
GenerateFail
,
EnumHelper
.
GetDescription
(
AllotStates
.
GenerateFail
));
SendEmail
(
allot
,
mail
,
2
,
time
);
logdbug
.
Add
(
allot
.
ID
,
"绩效开始执行"
,
ex
.
ToString
());
//throw ex;
...
...
performance/Performance.Services/ComputeService.cs
View file @
5bbc5a35
...
...
@@ -301,7 +301,7 @@ public res_compute UpdateRealfee(ComputerRequest request, int userId, string rea
/// <returns></returns>
public
List
<
res_baiscnorm
>
GetBaiscnorm
(
int
allotId
)
{
return
perforResbaiscnormRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
return
perforResbaiscnormRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)
.
OrderBy
(
t
=>
t
.
PositionName
).
ToList
()
;
}
}
}
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