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
da43572f
Commit
da43572f
authored
Jul 09, 2021
by
lcx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/hrp' into release/v20210709功能分支合并
parents
97a18f72
d396c003
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
22 deletions
+87
-22
performance/Performance.Api/Controllers/ConfigController.cs
+25
-9
performance/Performance.EntityModels/Entity/per_employee.cs
+13
-8
performance/Performance.Services/ExtractExcelService/DictionaryService.cs
+49
-5
No files found.
performance/Performance.Api/Controllers/ConfigController.cs
View file @
da43572f
using
FluentValidation.AspNetCore
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.Extensions.Caching.Memory
;
using
Microsoft.Extensions.Options
;
using
Newtonsoft.Json.Linq
;
using
Performance.DtoModels
;
using
Performance.DtoModels.AppSettings
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Services
;
using
Performance.Services.ExtractExcelService
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
namespace
Performance.Api.Controllers
{
[
Route
(
"api/[controller]"
)]
public
class
ConfigController
:
Controller
{
private
ConfigService
_configService
;
private
AllotService
_allotService
;
public
ConfigController
(
ConfigService
configService
,
AllotService
allotService
)
private
readonly
ConfigService
_configService
;
private
readonly
AllotService
_allotService
;
private
readonly
DictionaryService
_dictionaryService
;
public
ConfigController
(
ConfigService
configService
,
AllotService
allotService
,
DictionaryService
dictionaryService
)
{
_configService
=
configService
;
_allotService
=
allotService
;
_dictionaryService
=
dictionaryService
;
}
#
region
弃用
...
...
@@ -673,6 +671,7 @@ public ApiResponse BatchAccountingStructrue([FromRoute] int allotId)
/// 核算单元及组别批量添加
/// </summary>
/// <param name="allotId"></param>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"BatchSaveAccounting/{allotId}"
)]
[
HttpPost
]
...
...
@@ -725,7 +724,9 @@ public ApiResponse GetHrpDeptHands([FromRoute] int hospitalId, int allotId)
/// <summary>
/// 保存HRP人员科室
/// </summary>
/// <param name=""></param>
/// <param name="hospitalId"></param>
/// <param name="allotId"></param>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"savehrpdept/{hospitalId}/allot/{allotId}"
)]
[
HttpPost
]
...
...
@@ -738,6 +739,21 @@ public ApiResponse SaveHrpDept(int hospitalId, int allotId, [FromBody] SaveColle
_configService
.
SaveDepttypeHands
(
hospitalId
,
allotId
,
request
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
/// <summary>
/// 校正HRP人员的科室信息
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[
Route
(
"standardhrpdept/{allotId}"
)]
[
HttpPost
]
public
ApiResponse
StandardHrpDept
(
int
allotId
)
{
if
(
allotId
<=
0
)
return
new
ApiResponse
(
ResponseType
.
Fail
,
"参数错误"
,
"allotid无效"
);
_dictionaryService
.
CorrectionHRPDepartment
(
allotId
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
#
endregion
#
region
二次分配别名配置
...
...
performance/Performance.EntityModels/Entity/per_employee.cs
View file @
da43572f
...
...
@@ -127,23 +127,28 @@ public class per_employee
public
string
Remark
{
get
;
set
;
}
/// <summary>
///
///
0 未通过验证 1 通过验证
/// </summary>
public
Nullable
<
DateTime
>
CreateTime
{
get
;
set
;
}
public
int
?
IsVerify
{
get
;
set
;
}
/// <summary>
///
///
验证失败描述
/// </summary>
public
Nullable
<
int
>
CreateUser
{
get
;
set
;
}
public
string
VerifyMessage
{
get
;
set
;
}
/// <summary>
///
0 未通过验证 1 通过验证
///
是否是hrp人员 0 不是 1 是
/// </summary>
public
int
?
IsVerify
{
get
;
set
;
}
public
Nullable
<
int
>
IsHrpEmployee
{
get
;
set
;
}
/// <summary>
///
验证失败描述
///
/// </summary>
public
string
VerifyMessage
{
get
;
set
;
}
public
Nullable
<
DateTime
>
CreateTime
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
Nullable
<
int
>
CreateUser
{
get
;
set
;
}
}
}
performance/Performance.Services/ExtractExcelService/DictionaryService.cs
View file @
da43572f
...
...
@@ -16,6 +16,7 @@ public class DictionaryService : IAutoInjection
private
readonly
ILogger
<
DictionaryService
>
logger
;
private
readonly
QueryService
queryService
;
private
readonly
LogManageService
logService
;
private
readonly
PerforCofhrpdepartmentRepository
cofhrpdepartmentRepository
;
private
readonly
PerforPeremployeeRepository
peremployeeRepository
;
private
readonly
PerforHospitalconfigRepository
hospitalconfigRepository
;
private
readonly
PerforExtypeRepository
extypeRepository
;
...
...
@@ -27,6 +28,7 @@ public class DictionaryService : IAutoInjection
ILogger
<
DictionaryService
>
logger
,
QueryService
queryService
,
LogManageService
logService
,
PerforCofhrpdepartmentRepository
cofhrpdepartmentRepository
,
PerforPeremployeeRepository
peremployeeRepository
,
PerforHospitalconfigRepository
hospitalconfigRepository
,
PerforExtypeRepository
extypeRepository
,
...
...
@@ -38,6 +40,7 @@ PerforHisscriptRepository hisscriptRepository
this
.
logger
=
logger
;
this
.
queryService
=
queryService
;
this
.
logService
=
logService
;
this
.
cofhrpdepartmentRepository
=
cofhrpdepartmentRepository
;
this
.
peremployeeRepository
=
peremployeeRepository
;
this
.
hospitalconfigRepository
=
hospitalconfigRepository
;
this
.
extypeRepository
=
extypeRepository
;
...
...
@@ -94,17 +97,29 @@ private void Employee(per_allot allot, sys_hospitalconfig config, string sql)
var
data
=
queryService
.
QueryData
<
per_employee
>(
config
,
allot
,
sql
);
if
(
data
==
null
||
!
data
.
Any
())
return
;
var
employees
=
peremployeeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allot
.
ID
);
if
(
employees
!=
null
&&
employees
.
Any
())
{
peremployeeRepository
.
RemoveRange
(
employees
.
ToArray
());
}
//
var employees = peremployeeRepository.GetEntities(t => t.AllotId == allot.ID);
//
if (employees != null && employees.Any())
//
{
//
peremployeeRepository.RemoveRange(employees.ToArray());
//
}
data
.
ToList
().
ForEach
(
t
=>
{
t
.
AllotId
=
allot
.
ID
;
t
.
HospitalId
=
allot
.
HospitalId
;
t
.
IsHrpEmployee
=
1
;
});
var
hrpDepartments
=
cofhrpdepartmentRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allot
.
ID
);
if
(
hrpDepartments
!=
null
&&
hrpDepartments
.
Any
())
{
data
=
data
.
GroupJoin
(
hrpDepartments
,
outer
=>
new
{
department
=
outer
.
Department
},
inner
=>
new
{
department
=
inner
.
HRPDepartment
},
(
outer
,
inner
)
=>
new
{
outer
,
inner
}).
Select
(
t
=>
{
t
.
outer
.
AccountingUnit
=
t
.
inner
?.
FirstOrDefault
()?.
AccountingUnit
;
return
t
.
outer
;
});
}
peremployeeRepository
.
AddRange
(
data
.
ToArray
());
}
catch
(
Exception
ex
)
...
...
@@ -162,5 +177,34 @@ private string GetSaveValue(params string[] arr)
return
value
;
return
arr
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
));
}
/// <summary>
/// 校正HRP人员的科室信息
/// </summary>
/// <param name="allotId"></param>
public
void
CorrectionHRPDepartment
(
int
allotId
)
{
try
{
var
employees
=
peremployeeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
(
t
.
IsHrpEmployee
??
0
)
==
1
);
if
(
employees
==
null
||
!
employees
.
Any
())
return
;
var
hrpDepartments
=
cofhrpdepartmentRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
if
(
hrpDepartments
!=
null
&&
hrpDepartments
.
Any
())
{
employees
=
employees
.
GroupJoin
(
hrpDepartments
,
outer
=>
new
{
department
=
outer
.
Department
},
inner
=>
new
{
department
=
inner
.
HRPDepartment
},
(
outer
,
inner
)
=>
new
{
outer
,
inner
}).
Select
(
t
=>
{
t
.
outer
.
AccountingUnit
=
t
.
inner
?.
FirstOrDefault
()?.
AccountingUnit
;
return
t
.
outer
;
}).
ToList
();
peremployeeRepository
.
UpdateRange
(
employees
.
ToArray
());
}
}
catch
(
Exception
ex
)
{
logger
.
LogError
(
$"修改HRP人员科室时发生异常:
{
ex
}
"
);
}
}
}
}
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