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
05a00395
Commit
05a00395
authored
May 24, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release/v20210521jixiao.suvalue.com'
parents
2b44bef5
8ac3238c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
619 additions
and
39 deletions
+619
-39
performance/Performance.Api/Controllers/AccountController.cs
+22
-3
performance/Performance.Api/Controllers/AllotController.cs
+58
-2
performance/Performance.Api/Controllers/ConfigController.cs
+23
-4
performance/Performance.Api/Controllers/PersonController.cs
+51
-0
performance/Performance.Api/Properties/PublishProfiles/FolderProfile.pubxml
+11
-8
performance/Performance.Api/wwwroot/Performance.Api.xml
+62
-4
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+20
-0
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+30
-0
performance/Performance.DtoModels/Request/PerEmployeeRquest.cs
+21
-0
performance/Performance.DtoModels/Response/DeptdicResponse.cs
+19
-0
performance/Performance.DtoModels/Response/UserHandsResponse.cs
+18
-0
performance/Performance.DtoModels/SaveCollectData.cs
+12
-1
performance/Performance.EntityModels/Entity/per_apr_amount.cs
+10
-0
performance/Performance.EntityModels/Entity/per_dept_dic.cs
+10
-0
performance/Performance.EntityModels/Entity/per_employee.cs
+10
-0
performance/Performance.Repository/PerforCofdirectorRepository.cs
+0
-6
performance/Performance.Services/AllotService.cs
+11
-0
performance/Performance.Services/ConfigService.cs
+55
-9
performance/Performance.Services/EmployeeService.cs
+1
-1
performance/Performance.Services/PersonService.cs
+0
-0
performance/Performance.Services/UserService.cs
+175
-1
No files found.
performance/Performance.Api/Controllers/AccountController.cs
View file @
05a00395
...
@@ -315,7 +315,7 @@ public ApiResponse SelfInfos([FromBody] UserRequest request)
...
@@ -315,7 +315,7 @@ public ApiResponse SelfInfos([FromBody] UserRequest request)
if
(
request
.
Role
<=
0
)
if
(
request
.
Role
<=
0
)
user
.
IsAgainAdmin
=
user
.
Role
!=
null
?
roleArray
.
Contains
(
user
.
Role
.
First
().
Type
??
0
)
:
false
;
user
.
IsAgainAdmin
=
user
.
Role
!=
null
?
roleArray
.
Contains
(
user
.
Role
.
First
().
Type
??
0
)
:
false
;
else
else
user
.
IsAgainAdmin
=
user
.
Role
!=
null
?
roleArray
.
Contains
(
user
.
Role
.
First
(
t
=>
t
.
RoleID
==
request
.
Role
).
Type
??
0
)
:
false
;
user
.
IsAgainAdmin
=
user
.
Role
!=
null
?
roleArray
.
Contains
(
user
.
Role
.
First
(
t
=>
t
.
RoleID
==
request
.
Role
).
Type
??
0
)
:
false
;
return
new
ApiResponse
(
ResponseType
.
OK
,
user
);
return
new
ApiResponse
(
ResponseType
.
OK
,
user
);
}
}
...
@@ -371,16 +371,34 @@ public ApiResponse DeleteUser([CustomizeValidator(RuleSet = "Delete"), FromBody]
...
@@ -371,16 +371,34 @@ public ApiResponse DeleteUser([CustomizeValidator(RuleSet = "Delete"), FromBody]
#
endregion
#
endregion
/// <summary>
/// <summary>
/// 批量新增用户表头
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"GetBatchUserStructrue"
)]
[
HttpPost
]
public
ApiResponse
GetBatchUserStructrue
()
{
var
result
=
_userService
.
GetUserHandsFlat
();
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
/// <summary>
/// 批量新增用户
/// 批量新增用户
/// </summary>
/// </summary>
/// <param name="request"></param>
/// <param name="request"></param>
/// <returns></returns>
/// <returns></returns>
[
Route
(
"BatchSaveUser"
)]
[
Route
(
"BatchSaveUser"
)]
[
HttpPost
]
[
HttpPost
]
public
ApiResponse
BatchSaveUser
()
public
ApiResponse
BatchSaveUser
(
[
CustomizeValidator
(
RuleSet
=
"Insert"
),
FromBody
]
UserCollectData
data
)
{
{
var
result
=
_userService
.
SaveUserHandsFlat
(
data
);
if
(
result
==
""
)
return
new
ApiResponse
(
ResponseType
.
OK
);
return
new
ApiResponse
(
ResponseType
.
OK
);
else
return
new
ApiResponse
(
ResponseType
.
Error
,
result
);
}
}
}
}
}
}
\ No newline at end of file
performance/Performance.Api/Controllers/AllotController.cs
View file @
05a00395
using
FluentValidation.AspNetCore
;
using
FluentValidation.AspNetCore
;
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Http.Internal
;
using
Microsoft.AspNetCore.Http.Internal
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.StaticFiles
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Logging
;
using
Performance.DtoModels
;
using
Performance.DtoModels
;
...
@@ -16,6 +18,7 @@
...
@@ -16,6 +18,7 @@
using
System.IO
;
using
System.IO
;
using
System.Linq
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
System.Web
;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
...
@@ -88,7 +91,7 @@ public ApiResponse Success([FromBody] AllotRequest request)
...
@@ -88,7 +91,7 @@ public ApiResponse Success([FromBody] AllotRequest request)
/// <returns></returns>
/// <returns></returns>
[
Route
(
"insert"
)]
[
Route
(
"insert"
)]
[
HttpPost
]
[
HttpPost
]
public
ApiResponse
Insert
([
CustomizeValidator
(
RuleSet
=
"Insert"
),
FromBody
]
AllotRequest
request
)
public
ApiResponse
Insert
([
FromBody
]
AllotRequest
request
)
{
{
var
userId
=
_claim
.
GetUserId
();
var
userId
=
_claim
.
GetUserId
();
var
result
=
_allotService
.
InsertAllot
(
request
,
userId
);
var
result
=
_allotService
.
InsertAllot
(
request
,
userId
);
...
@@ -298,7 +301,28 @@ public ApiResponse GenerateReport([CustomizeValidator(RuleSet = "Delete"), FromB
...
@@ -298,7 +301,28 @@ public ApiResponse GenerateReport([CustomizeValidator(RuleSet = "Delete"), FromB
await
Task
.
Delay
(
TimeSpan
.
FromSeconds
(
5
),
token
);
await
Task
.
Delay
(
TimeSpan
.
FromSeconds
(
5
),
token
);
}
}
});
});
return
new
ApiResponse
(
ResponseType
.
OK
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"统计报表数据任务开始"
);
}
/// <summary>
/// 验证科室核算单元、工号
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[
Route
(
"accounting/verify/{allotId}"
)]
[
HttpPost
]
public
ApiResponse
AccountingVerify
([
FromRoute
]
int
allotId
)
{
_backgroundTaskQueue
.
QueueBackgroundWorkItem
(
async
token
=>
{
using
(
var
scope
=
_serviceScopeFactory
.
CreateScope
())
{
var
scopedServices
=
scope
.
ServiceProvider
.
GetRequiredService
<
AllotService
>();
scopedServices
.
AccoungtingVerify
(
allotId
);
await
Task
.
Delay
(
TimeSpan
.
FromSeconds
(
5
),
token
);
}
});
return
new
ApiResponse
(
ResponseType
.
OK
,
"核算单元及组别数据验证任务开始"
);
}
}
/*
/*
...
@@ -500,5 +524,37 @@ public ApiResponse Reserved([FromBody] ReservedRequest request)
...
@@ -500,5 +524,37 @@ public ApiResponse Reserved([FromBody] ReservedRequest request)
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
}
/// <summary>
/// 下载当前测算表
/// </summary>
/// <param name="allotid"></param>
/// <returns></returns>
[
Route
(
"current/download/{allotid}"
)]
[
HttpGet
]
[
AllowAnonymous
]
public
IActionResult
DownloadCurrentCalculationTable
(
int
allotid
)
{
var
allot
=
_allotService
.
GetAllot
(
allotid
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前测算表不存在"
);
if
(
string
.
IsNullOrEmpty
(
allot
.
Path
))
throw
new
PerformanceException
(
"尚未提交测算表"
);
if
(!
FileHelper
.
IsExistFile
(
allot
.
Path
))
throw
new
PerformanceException
(
"测算表文件路径无效"
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
allot
.
Path
,
FileMode
.
Open
))
{
stream
.
CopyToAsync
(
memoryStream
).
Wait
();
}
memoryStream
.
Seek
(
0
,
SeekOrigin
.
Begin
);
var
provider
=
new
FileExtensionContentTypeProvider
();
FileInfo
fileInfo
=
new
FileInfo
(
allot
.
Path
);
var
memi
=
provider
.
Mappings
[
".xlsx"
];
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
fileInfo
.
Name
));
}
}
}
}
}
performance/Performance.Api/Controllers/ConfigController.cs
View file @
05a00395
...
@@ -595,18 +595,37 @@ public ApiResponse AccountingDelete([FromRoute] int accountingId)
...
@@ -595,18 +595,37 @@ public ApiResponse AccountingDelete([FromRoute] int accountingId)
return
new
ApiResponse
(
ResponseType
.
OK
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
}
/// <summary>
/// <summary>
/// 核算单元及组别
数据验证
/// 核算单元及组别
批量表头
/// </summary>
/// </summary>
/// <param name="allotId"></param>
/// <param name="allotId"></param>
/// <returns></returns>
/// <returns></returns>
[
Route
(
"
accountingverify
/{allotId}"
)]
[
Route
(
"
BatchAccountingStructrue
/{allotId}"
)]
[
HttpPost
]
[
HttpPost
]
public
ApiResponse
AccountingVerify
([
FromRoute
]
int
allotId
)
public
ApiResponse
BatchAccountingStructrue
([
FromRoute
]
int
allotId
)
{
{
_configService
.
AccoungtingVerify
(
allotId
);
var
request
=
_configService
.
GetBatchAccountingStructrue
(
allotId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
request
);
}
/// <summary>
/// 核算单元及组别批量添加
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[
Route
(
"BatchSaveAccounting/{allotId}"
)]
[
HttpPost
]
public
ApiResponse
BatchSaveAccounting
(
int
allotId
,
[
FromBody
]
SaveCollectData
request
)
{
var
result
=
_configService
.
BatchSaveAccounting
(
allotId
,
request
);
if
(
result
)
return
new
ApiResponse
(
ResponseType
.
OK
);
return
new
ApiResponse
(
ResponseType
.
OK
);
else
return
new
ApiResponse
(
ResponseType
.
Error
,
"请选择正确的核算组别"
);
}
}
#
endregion
#
endregion
/// <summary>
/// <summary>
...
...
performance/Performance.Api/Controllers/PersonController.cs
View file @
05a00395
...
@@ -181,5 +181,56 @@ public ApiResponse DeptIncomeDetail([CustomizeValidator(RuleSet = "Select"), Fro
...
@@ -181,5 +181,56 @@ public ApiResponse DeptIncomeDetail([CustomizeValidator(RuleSet = "Select"), Fro
var
data
=
personService
.
DeptIncomeDetail
(
request
,
claimService
.
GetUserId
());
var
data
=
personService
.
DeptIncomeDetail
(
request
,
claimService
.
GetUserId
());
return
new
ApiResponse
(
ResponseType
.
OK
,
data
);
return
new
ApiResponse
(
ResponseType
.
OK
,
data
);
}
}
/// <summary>
/// 批量人员字典表头
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"person/GetBatchPersonStructrue/{hospitalId}"
)]
public
ApiResponse
GetBatchPersonStructrue
(
int
hospitalId
)
{
var
result
=
personService
.
GetBatchPersonStructrue
(
hospitalId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
/// <summary>
/// 批量添加人员信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"person/{allotId}/BathSavePerson/{hospitalId}"
)]
public
ApiResponse
BathSavePerson
(
int
allotId
,
int
hospitalId
,
SaveCollectData
request
)
{
var
result
=
personService
.
BathSavePerson
(
allotId
,
hospitalId
,
request
);
if
(
result
)
return
new
ApiResponse
(
ResponseType
.
OK
);
else
return
new
ApiResponse
(
ResponseType
.
Error
,
"出勤天数或预留比例格式错误"
);
}
/// <summary>
/// 批量科室字典表头
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"dept/GetDeptStructrue/{hospitalId}"
)]
public
ApiResponse
GetDeptStructrue
(
int
hospitalId
)
{
var
result
=
personService
.
GetDepartmentHands
(
hospitalId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
/// <summary>
/// 批量添加科室信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"dept/SaveDeptHands/{hospitalId}"
)]
public
ApiResponse
SaveDeptHands
(
int
hospitalId
,
SaveCollectData
request
)
{
personService
.
SaveDeptDicHands
(
hospitalId
,
request
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
}
}
}
}
performance/Performance.Api/Properties/PublishProfiles/FolderProfile.pubxml
View file @
05a00395
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
此文件由 Web 项目的发布/打包过程使用。可以通过编辑此 MSBuild 文件
自定义此过程的行为。为了解与此相关的更多内容,请访问 https://go.microsoft.com/fwlink/?LinkID=208121。
-->
-->
<Project
ToolsVersion=
"4.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<Project
ToolsVersion=
"4.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<PropertyGroup>
<DeleteExistingFiles>True</DeleteExistingFiles>
<WebPublishMethod>
FileSystem
</WebPublishMethod>
<ExcludeApp_Data>False</ExcludeApp_Data>
<PublishProvider>
FileSystem
</PublishProvider>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>
Release
</LastUsedBuildConfiguration>
<LastUsedBuildConfiguration>
Release
</LastUsedBuildConfiguration>
<LastUsedPlatform>
Any CPU
</LastUsedPlatform>
<LastUsedPlatform>
Any CPU
</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>bin\Release\netcoreapp2.2\publish\</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<SiteUrlToLaunchAfterPublish
/>
<SiteUrlToLaunchAfterPublish
/>
<LaunchSiteAfterPublish>
True
</LaunchSiteAfterPublish>
<ExcludeApp_Data>
False
</ExcludeApp_Data>
<TargetFramework>
netcoreapp2.2
</TargetFramework>
<TargetFramework>
netcoreapp2.2
</TargetFramework>
<ProjectGuid>
3ae00ff5-f0ba-4d72-a23b-770186309327
</ProjectGuid>
<ProjectGuid>
3ae00ff5-f0ba-4d72-a23b-770186309327
</ProjectGuid>
<SelfContained>
false
</SelfContained>
<SelfContained>
false
</SelfContained>
<_IsPortable>
true
</_IsPortable>
<publishUrl>
D:\publish\jx.suvalue.com2
</publishUrl>
<DeleteExistingFiles>
True
</DeleteExistingFiles>
</PropertyGroup>
</PropertyGroup>
</Project>
</Project>
\ No newline at end of file
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
05a00395
...
@@ -137,7 +137,14 @@
...
@@ -137,7 +137,14 @@
<param
name=
"request"
></param>
<param
name=
"request"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.AccountController.BatchSaveUser"
>
<member
name=
"M:Performance.Api.Controllers.AccountController.GetBatchUserStructrue"
>
<summary>
批量新增用户表头
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AccountController.BatchSaveUser(Performance.DtoModels.UserCollectData)"
>
<summary>
<summary>
批量新增用户
批量新增用户
</summary>
</summary>
...
@@ -232,6 +239,13 @@
...
@@ -232,6 +239,13 @@
<param
name=
"request"
></param>
<param
name=
"request"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.AllotController.AccountingVerify(System.Int32)"
>
<summary>
验证科室核算单元、工号
</summary>
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AllotController.Recalculation(Performance.DtoModels.RecalculationRequest)"
>
<member
name=
"M:Performance.Api.Controllers.AllotController.Recalculation(Performance.DtoModels.RecalculationRequest)"
>
<summary>
<summary>
重新计算院领导绩效
重新计算院领导绩效
...
@@ -287,6 +301,13 @@
...
@@ -287,6 +301,13 @@
</summary>
</summary>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.AllotController.DownloadCurrentCalculationTable(System.Int32)"
>
<summary>
下载当前测算表
</summary>
<param
name=
"allotid"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.BudgetController.Query(Performance.DtoModels.Request.BudgetRequest)"
>
<member
name=
"M:Performance.Api.Controllers.BudgetController.Query(Performance.DtoModels.Request.BudgetRequest)"
>
<summary>
<summary>
预算管理查询(包含金额、占比)
预算管理查询(包含金额、占比)
...
@@ -607,12 +628,11 @@
...
@@ -607,12 +628,11 @@
<param
name=
"request"
></param>
<param
name=
"request"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.GetAccountingList(
System.Int32,System.Int32
)"
>
<member
name=
"M:Performance.Api.Controllers.ConfigController.GetAccountingList(
Performance.DtoModels.AccoungingRequest
)"
>
<summary>
<summary>
获取cof_accounting列表
获取cof_accounting列表
</summary>
</summary>
<param
name=
"allotId"
></param>
<param
name=
"request"
></param>
<param
name=
"type"
>
1 返回accounting列表 2 返回核算单元类型 3 返回核算单元
</param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.AccountingInsert(Performance.EntityModels.cof_accounting)"
>
<member
name=
"M:Performance.Api.Controllers.ConfigController.AccountingInsert(Performance.EntityModels.cof_accounting)"
>
...
@@ -636,6 +656,20 @@
...
@@ -636,6 +656,20 @@
<param
name=
"accountingId"
></param>
<param
name=
"accountingId"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.BatchAccountingStructrue(System.Int32)"
>
<summary>
核算单元及组别批量表头
</summary>
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.BatchSaveAccounting(System.Int32,Performance.DtoModels.SaveCollectData)"
>
<summary>
核算单元及组别批量添加
</summary>
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.WorkHeader(Performance.DtoModels.WorkItemRequest)"
>
<member
name=
"M:Performance.Api.Controllers.ConfigController.WorkHeader(Performance.DtoModels.WorkItemRequest)"
>
<summary>
<summary>
获取工作量绩效列头
获取工作量绩效列头
...
@@ -1143,6 +1177,30 @@
...
@@ -1143,6 +1177,30 @@
</summary>
</summary>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.PersonController.GetBatchPersonStructrue(System.Int32)"
>
<summary>
批量人员字典表头
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.PersonController.BathSavePerson(System.Int32,System.Int32,Performance.DtoModels.SaveCollectData)"
>
<summary>
批量添加人员信息
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.PersonController.GetDeptStructrue(System.Int32)"
>
<summary>
批量科室字典表头
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.PersonController.SaveDeptHands(System.Int32,Performance.DtoModels.SaveCollectData)"
>
<summary>
批量添加科室信息
</summary>
<returns></returns>
</member>
<member
name=
"T:Performance.Api.Controllers.ReportController"
>
<member
name=
"T:Performance.Api.Controllers.ReportController"
>
<summary>
<summary>
报表
报表
...
...
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
05a00395
...
@@ -1149,6 +1149,11 @@
...
@@ -1149,6 +1149,11 @@
岗位系数
岗位系数
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.DtoModels.PerDataAccountBaisc.GiveFee"
>
<summary>
考核后绩效
</summary>
</member>
<member
name=
"P:Performance.DtoModels.PerDataClinicEmployee.UnitType"
>
<member
name=
"P:Performance.DtoModels.PerDataClinicEmployee.UnitType"
>
<summary>
<summary>
核算单元分类
核算单元分类
...
@@ -1819,6 +1824,21 @@
...
@@ -1819,6 +1824,21 @@
比率
比率
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.DtoModels.AccoungingRequest.AllotId"
>
<summary>
绩效Id
</summary>
</member>
<member
name=
"P:Performance.DtoModels.AccoungingRequest.Type"
>
<summary>
1 返回accounting列表 2 返回核算单元类型 3 返回核算单元
</summary>
</member>
<member
name=
"P:Performance.DtoModels.AccoungingRequest.UnitType"
>
<summary>
核算单元类型、核算组别
</summary>
</member>
<member
name=
"T:Performance.DtoModels.AgainAllotRequest"
>
<member
name=
"T:Performance.DtoModels.AgainAllotRequest"
>
<summary>
<summary>
二次分配请求
二次分配请求
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
05a00395
...
@@ -4396,6 +4396,16 @@
...
@@ -4396,6 +4396,16 @@
备注
备注
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.per_apr_amount.IsVerify"
>
<summary>
0 未通过验证 1 通过验证
</summary>
</member>
<member
name=
"P:Performance.EntityModels.per_apr_amount.VerifyMessage"
>
<summary>
验证失败描述
</summary>
</member>
<member
name=
"T:Performance.EntityModels.per_budget_amount"
>
<member
name=
"T:Performance.EntityModels.per_budget_amount"
>
<summary>
<summary>
预算管理金额
预算管理金额
...
@@ -4856,6 +4866,16 @@
...
@@ -4856,6 +4866,16 @@
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.per_dept_dic.IsVerify"
>
<summary>
0 未通过验证 1 通过验证
</summary>
</member>
<member
name=
"P:Performance.EntityModels.per_dept_dic.VerifyMessage"
>
<summary>
验证失败描述
</summary>
</member>
<member
name=
"T:Performance.EntityModels.per_employee"
>
<member
name=
"T:Performance.EntityModels.per_employee"
>
<summary>
<summary>
绩效人员表
绩效人员表
...
@@ -4976,6 +4996,16 @@
...
@@ -4976,6 +4996,16 @@
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.per_employee.IsVerify"
>
<summary>
0 未通过验证 1 通过验证
</summary>
</member>
<member
name=
"P:Performance.EntityModels.per_employee.VerifyMessage"
>
<summary>
验证失败描述
</summary>
</member>
<member
name=
"T:Performance.EntityModels.per_first"
>
<member
name=
"T:Performance.EntityModels.per_first"
>
<summary>
<summary>
首次上传文件地址(当医院存在标准库时,首次上传用户提交固定格式的excel,开发人员配置SQL脚本)
首次上传文件地址(当医院存在标准库时,首次上传用户提交固定格式的excel,开发人员配置SQL脚本)
...
...
performance/Performance.DtoModels/Request/PerEmployeeRquest.cs
0 → 100644
View file @
05a00395
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.DtoModels
{
public
class
PerEmployeeRquest
{
public
string
AccountingUnit
{
get
;
set
;
}
public
string
Department
{
get
;
set
;
}
public
string
DoctorName
{
get
;
set
;
}
public
string
PersonnelNumber
{
get
;
set
;
}
public
string
JobCategory
{
get
;
set
;
}
public
string
Duty
{
get
;
set
;
}
public
string
JobTitle
{
get
;
set
;
}
public
string
UnitType
{
get
;
set
;
}
public
int
?
AttendanceDay
{
get
;
set
;
}
public
decimal
?
ReservedRatio
{
get
;
set
;
}
public
string
Remark
{
get
;
set
;
}
}
}
performance/Performance.DtoModels/Response/DeptdicResponse.cs
View file @
05a00395
...
@@ -18,11 +18,30 @@ public class DeptdicResponse
...
@@ -18,11 +18,30 @@ public class DeptdicResponse
public
Deptdic
LogisticsAccounting
{
get
;
set
;
}
public
Deptdic
LogisticsAccounting
{
get
;
set
;
}
public
Deptdic
SpecialAccounting
{
get
;
set
;
}
public
Deptdic
SpecialAccounting
{
get
;
set
;
}
public
DateTime
?
CreateTime
{
get
;
set
;
}
public
DateTime
?
CreateTime
{
get
;
set
;
}
public
int
IsVerify
{
get
;
set
;
}
}
}
public
class
Deptdic
public
class
Deptdic
{
{
public
int
Id
{
get
;
set
;
}
public
int
Id
{
get
;
set
;
}
public
string
AccountingUnit
{
get
;
set
;
}
public
string
AccountingUnit
{
get
;
set
;
}
public
int
IsVerify
{
get
;
set
;
}
public
string
VerifyMessage
{
get
;
set
;
}
}
public
class
DeptdicHands
{
public
int
HospitalId
{
get
;
set
;
}
public
string
HISDeptName
{
get
;
set
;
}
public
string
Department
{
get
;
set
;
}
public
string
OutDoctorAccounting
{
get
;
set
;
}
public
string
OutNurseAccounting
{
get
;
set
;
}
public
string
OutTechnicAccounting
{
get
;
set
;
}
public
string
InpatDoctorAccounting
{
get
;
set
;
}
public
string
InpatNurseAccounting
{
get
;
set
;
}
public
string
InpatTechnicAccounting
{
get
;
set
;
}
public
string
LogisticsAccounting
{
get
;
set
;
}
public
string
SpecialAccounting
{
get
;
set
;
}
public
DateTime
?
CreateTime
{
get
;
set
;
}
}
}
}
}
performance/Performance.DtoModels/Response/UserHandsResponse.cs
0 → 100644
View file @
05a00395
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.DtoModels
{
public
class
UserHandsResponse
{
public
string
RealName
{
get
;
set
;
}
public
string
Login
{
get
;
set
;
}
public
string
Password
{
get
;
set
;
}
public
string
Mobile
{
get
;
set
;
}
public
string
Mail
{
get
;
set
;
}
public
string
Department
{
get
;
set
;
}
public
string
RoleName
{
get
;
set
;
}
public
string
HosName
{
get
;
set
;
}
}
}
performance/Performance.DtoModels/SaveCollectData.cs
View file @
05a00395
using
System
;
using
FluentValidation
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Text
;
...
@@ -11,4 +12,14 @@ public class SaveCollectData
...
@@ -11,4 +12,14 @@ public class SaveCollectData
public
string
[]
ColHeaders
{
get
;
set
;
}
public
string
[]
ColHeaders
{
get
;
set
;
}
public
string
[][]
Data
{
get
;
set
;
}
public
string
[][]
Data
{
get
;
set
;
}
}
}
public
class
UserCollectData
{
public
int
HospitalId
{
get
;
set
;
}
public
int
?
CreateUser
{
get
;
set
;
}
public
string
[]
ColHeaders
{
get
;
set
;
}
public
string
[][]
Data
{
get
;
set
;
}
}
}
}
performance/Performance.EntityModels/Entity/per_apr_amount.cs
View file @
05a00395
...
@@ -85,5 +85,15 @@ public class per_apr_amount
...
@@ -85,5 +85,15 @@ public class per_apr_amount
/// 备注
/// 备注
/// </summary>
/// </summary>
public
string
Remark
{
get
;
set
;
}
public
string
Remark
{
get
;
set
;
}
/// <summary>
/// 0 未通过验证 1 通过验证
/// </summary>
public
int
?
IsVerify
{
get
;
set
;
}
/// <summary>
/// 验证失败描述
/// </summary>
public
string
VerifyMessage
{
get
;
set
;
}
}
}
}
}
performance/Performance.EntityModels/Entity/per_dept_dic.cs
View file @
05a00395
...
@@ -60,5 +60,15 @@ public class per_dept_dic
...
@@ -60,5 +60,15 @@ public class per_dept_dic
///
///
/// </summary>
/// </summary>
public
Nullable
<
int
>
CreateUser
{
get
;
set
;
}
public
Nullable
<
int
>
CreateUser
{
get
;
set
;
}
/// <summary>
/// 0 未通过验证 1 通过验证
/// </summary>
public
int
?
IsVerify
{
get
;
set
;
}
/// <summary>
/// 验证失败描述
/// </summary>
public
string
VerifyMessage
{
get
;
set
;
}
}
}
}
}
performance/Performance.EntityModels/Entity/per_employee.cs
View file @
05a00395
...
@@ -130,5 +130,15 @@ public class per_employee
...
@@ -130,5 +130,15 @@ public class per_employee
///
///
/// </summary>
/// </summary>
public
Nullable
<
int
>
CreateUser
{
get
;
set
;
}
public
Nullable
<
int
>
CreateUser
{
get
;
set
;
}
/// <summary>
/// 0 未通过验证 1 通过验证
/// </summary>
public
int
?
IsVerify
{
get
;
set
;
}
/// <summary>
/// 验证失败描述
/// </summary>
public
string
VerifyMessage
{
get
;
set
;
}
}
}
}
}
performance/Performance.Repository/PerforCofdirectorRepository.cs
View file @
05a00395
...
@@ -219,11 +219,5 @@ union all
...
@@ -219,11 +219,5 @@ union all
return
flag
;
return
flag
;
}
}
}
}
public
int
VerifyAccountingAndUnittype
(
int
allotId
)
{
return
Execute
(
"call proc_verify_accoungingunit_unittype(@allotId);"
,
new
{
allotId
});
}
}
}
}
}
performance/Performance.Services/AllotService.cs
View file @
05a00395
...
@@ -440,6 +440,8 @@ public void Generate(per_allot allot)
...
@@ -440,6 +440,8 @@ public void Generate(per_allot allot)
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
GenerateAccomplish
,
EnumHelper
.
GetDescription
(
AllotStates
.
GenerateAccomplish
),
generate
);
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
GenerateAccomplish
,
EnumHelper
.
GetDescription
(
AllotStates
.
GenerateAccomplish
),
generate
);
perforCofdirectorRepository
.
SupplementaryData
(
allot
.
ID
);
perforCofdirectorRepository
.
SupplementaryData
(
allot
.
ID
);
// 验证科室核算单元、工号
AccoungtingVerify
(
allot
.
ID
);
//logManageService.WriteMsg("正在生成报表数据", "正在生成报表数据", 1, allot.ID, "ReceiveMessage", true);
//logManageService.WriteMsg("正在生成报表数据", "正在生成报表数据", 1, allot.ID, "ReceiveMessage", true);
//var res = reportService.ImportData(allot);
//var res = reportService.ImportData(allot);
...
@@ -474,6 +476,15 @@ public void GenerateReport(per_allot allot)
...
@@ -474,6 +476,15 @@ public void GenerateReport(per_allot allot)
}
}
/// <summary>
/// <summary>
/// 验证科室核算单元、工号
/// </summary>
/// <param name="allot"></param>
public
void
AccoungtingVerify
(
int
allotId
)
{
reportService
.
ExecProc
(
"call proc_verify_accoungingunit_unittype(@allotId);"
,
new
{
allotId
});
}
/// <summary>
/// 重新计算院领导绩效
/// 重新计算院领导绩效
/// </summary>
/// </summary>
/// <param name="allotId"></param>
/// <param name="allotId"></param>
...
...
performance/Performance.Services/ConfigService.cs
View file @
05a00395
...
@@ -648,9 +648,9 @@ public List<cof_accounting> GetAccountingList(AccoungingRequest request)
...
@@ -648,9 +648,9 @@ public List<cof_accounting> GetAccountingList(AccoungingRequest request)
case
1
:
//返回accounting列表
case
1
:
//返回accounting列表
case
2
:
//返回核算单元类型
case
2
:
//返回核算单元类型
default
:
default
:
return
cofaccountingRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
request
.
AllotId
);
return
cofaccountingRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
request
.
AllotId
)
?.
OrderBy
(
t
=>
t
.
AccountingUnit
).
ThenBy
(
t
=>
t
.
UnitType
).
ToList
()
;
case
3
:
//返回核算单元
case
3
:
//返回核算单元
return
cofaccountingRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
request
.
AllotId
&&
t
.
UnitType
==
request
.
UnitType
);
return
cofaccountingRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
request
.
AllotId
&&
t
.
UnitType
==
request
.
UnitType
)
?.
OrderBy
(
t
=>
t
.
AccountingUnit
).
ThenBy
(
t
=>
t
.
UnitType
).
ToList
()
;
}
}
}
}
...
@@ -706,17 +706,63 @@ public bool AccountingDelete(int accountingId)
...
@@ -706,17 +706,63 @@ public bool AccountingDelete(int accountingId)
return
cofaccountingRepository
.
Remove
(
entity
);
return
cofaccountingRepository
.
Remove
(
entity
);
}
}
public
HandsonTable
GetBatchAccountingStructrue
(
int
AllotId
)
{
var
result
=
new
HandsonTable
((
int
)
SheetType
.
Unidentifiable
,
Accounting
.
Select
(
t
=>
t
.
Value
).
ToArray
(),
Accounting
.
Select
(
t
=>
new
collect_permission
{
HeadName
=
t
.
Value
,
Visible
=
1
}).
ToList
());
/// <summary>
if
(
result
.
Columns
!=
null
&&
result
.
Columns
.
Any
())
/// 删除数据
{
/// </summary>
foreach
(
var
column
in
result
.
Columns
)
/// <param name="accountingId"></param>
{
/// <returns></returns>
public
void
AccoungtingVerify
(
int
allotId
)
if
(
column
.
Data
==
"核算组别"
)
{
column
.
Type
=
"autocomplete"
;
column
.
Source
=
EnumHelper
.
GetItems
<
UnitType
>().
Select
(
w
=>
w
.
Description
.
Replace
(
"行政后勤"
,
"行政工勤"
)).
ToArray
();
column
.
Strict
=
true
;
}
}
}
return
result
;
}
public
bool
BatchSaveAccounting
(
int
allotId
,
SaveCollectData
request
)
{
var
dicData
=
CreateDataRow
(
0
,
allotId
,
request
,
Accounting
);
var
getAccounts
=
cofaccountingRepository
.
GetEntities
();
var
unitType
=
EnumHelper
.
GetItems
<
UnitType
>().
Select
(
w
=>
w
.
Description
.
Replace
(
"行政后勤"
,
"行政工勤"
)).
ToArray
();
List
<
cof_accounting
>
accounts
=
new
List
<
cof_accounting
>();
foreach
(
var
item
in
dicData
)
{
var
json
=
JsonHelper
.
Serialize
(
item
);
var
data
=
JsonHelper
.
Deserialize
<
cof_accounting
>(
json
);
if
(!
unitType
.
Contains
(
data
?.
UnitType
)
&&
!
string
.
IsNullOrEmpty
(
data
?.
UnitType
))
return
false
;
if
(
getAccounts
!=
null
)
if
(
getAccounts
.
Any
(
t
=>
t
.
AccountingUnit
==
data
?.
AccountingUnit
&&
t
.
UnitType
==
data
?.
UnitType
))
continue
;
var
any
=
accounts
.
Any
(
t
=>
t
.
AccountingUnit
==
data
?.
AccountingUnit
&&
t
.
UnitType
==
data
?.
UnitType
);
if
(!
string
.
IsNullOrEmpty
(
data
.
AccountingUnit
)
&&
!
string
.
IsNullOrEmpty
(
data
.
UnitType
)
&&
!
any
)
{
{
_directorRepository
.
VerifyAccountingAndUnittype
(
allotId
);
accounts
.
Add
(
data
);
}
}
if
(
accounts
.
Any
())
cofaccountingRepository
.
AddRange
(
accounts
.
ToArray
());
return
true
;
}
}
public
static
Dictionary
<
string
,
string
>
Accounting
{
get
;
}
=
new
Dictionary
<
string
,
string
>
{
{
nameof
(
cof_accounting
.
AccountingUnit
),
"核算单元"
},
{
nameof
(
cof_accounting
.
UnitType
),
"核算组别"
},
};
#
endregion
#
endregion
#
region
Copy
#
region
Copy
...
...
performance/Performance.Services/EmployeeService.cs
View file @
05a00395
...
@@ -397,7 +397,7 @@ public List<per_apr_amount> GetAprList(int allotId, int userId)
...
@@ -397,7 +397,7 @@ public List<per_apr_amount> GetAprList(int allotId, int userId)
else
else
list
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
(
t
.
Amount
??
0
)
!=
0
&&
t
.
CreateUser
==
userId
);
list
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
(
t
.
Amount
??
0
)
!=
0
&&
t
.
CreateUser
==
userId
);
if
(
list
!=
null
&&
list
.
Any
())
if
(
list
!=
null
&&
list
.
Any
())
list
=
list
.
OrderBy
(
t
=>
t
.
DoctorName
).
ToList
();
list
=
list
.
OrderBy
(
w
=>
w
.
IsVerify
).
ThenBy
(
t
=>
t
.
DoctorName
).
ToList
();
return
list
;
return
list
;
}
}
...
...
performance/Performance.Services/PersonService.cs
View file @
05a00395
This diff is collapsed.
Click to expand it.
performance/Performance.Services/UserService.cs
View file @
05a00395
...
@@ -30,6 +30,7 @@ public class UserService : IAutoInjection
...
@@ -30,6 +30,7 @@ public class UserService : IAutoInjection
private
PerforResaccountRepository
_resaccountRepository
;
private
PerforResaccountRepository
_resaccountRepository
;
private
PerforPerallotRepository
_perallotRepository
;
private
PerforPerallotRepository
_perallotRepository
;
private
PerforPerdeptdicRepository
_perdeptdicRepository
;
private
PerforPerdeptdicRepository
_perdeptdicRepository
;
private
readonly
PerforCofaccountingRepository
perforCofaccountingRepository
;
public
UserService
(
IOptions
<
Application
>
application
,
public
UserService
(
IOptions
<
Application
>
application
,
PerforSmsRepository
smsRepository
,
PerforSmsRepository
smsRepository
,
...
@@ -44,7 +45,8 @@ public class UserService : IAutoInjection
...
@@ -44,7 +45,8 @@ public class UserService : IAutoInjection
PerforImspecialunitRepository
imspecialunitRepository
,
PerforImspecialunitRepository
imspecialunitRepository
,
PerforResaccountRepository
resaccountRepository
,
PerforResaccountRepository
resaccountRepository
,
PerforPerallotRepository
perallotRepository
,
PerforPerallotRepository
perallotRepository
,
PerforPerdeptdicRepository
perdeptdicRepository
)
PerforPerdeptdicRepository
perdeptdicRepository
,
PerforCofaccountingRepository
perforCofaccountingRepository
)
{
{
this
.
application
=
application
.
Value
;
this
.
application
=
application
.
Value
;
this
.
_userRepository
=
userRepository
;
this
.
_userRepository
=
userRepository
;
...
@@ -60,6 +62,7 @@ public class UserService : IAutoInjection
...
@@ -60,6 +62,7 @@ public class UserService : IAutoInjection
this
.
_resaccountRepository
=
resaccountRepository
;
this
.
_resaccountRepository
=
resaccountRepository
;
this
.
_perallotRepository
=
perallotRepository
;
this
.
_perallotRepository
=
perallotRepository
;
this
.
_perdeptdicRepository
=
perdeptdicRepository
;
this
.
_perdeptdicRepository
=
perdeptdicRepository
;
this
.
perforCofaccountingRepository
=
perforCofaccountingRepository
;
}
}
/// <summary>
/// <summary>
...
@@ -695,5 +698,175 @@ public ApiResponse DeleteUser(int iD)
...
@@ -695,5 +698,175 @@ public ApiResponse DeleteUser(int iD)
}
}
#
endregion
#
endregion
public
HandsonTable
GetUserHandsFlat
()
{
var
result
=
new
HandsonTable
((
int
)
SheetType
.
Unidentifiable
,
Users
.
Select
(
t
=>
t
.
Value
).
ToArray
(),
Users
.
Select
(
t
=>
new
collect_permission
{
HeadName
=
t
.
Value
,
Visible
=
1
}).
ToList
());
if
(
result
.
Columns
!=
null
&&
result
.
Columns
.
Any
())
{
foreach
(
var
column
in
result
.
Columns
)
{
if
(
column
.
Data
==
"角色"
)
{
column
.
Type
=
"autocomplete"
;
column
.
Source
=
_roleRepository
.
GetEntities
().
Select
(
t
=>
t
.
RoleName
).
ToArray
();
column
.
Strict
=
true
;
}
else
if
(
column
.
Data
==
"分配医院"
)
{
column
.
Type
=
"autocomplete"
;
column
.
Source
=
_hospitalRepository
.
GetEntities
().
Select
(
t
=>
t
.
HosName
).
ToArray
();
column
.
Strict
=
true
;
}
}
}
return
result
;
}
public
string
SaveUserHandsFlat
(
UserCollectData
request
)
{
try
{
var
dicData
=
CreateDataRow
(
request
,
Users
);
var
getUsers
=
_userRepository
.
GetEntities
();
var
roles
=
_roleRepository
.
GetEntities
();
var
hospitals
=
_hospitalRepository
.
GetEntities
();
//hack:后续修改为accounting中的数据
var
accounts
=
perforCofaccountingRepository
.
GetEntities
();
//var allot = _perallotRepository.GetEntities(t => t.HospitalId == request.HospitalId);
//var res = accounts?.Join(allot, t => t.AllotId, w => w.ID, (t, w) => new cof_accounting { AccountingUnit = t.AccountingUnit }).Distinct();
List
<
sys_user
>
users
=
new
List
<
sys_user
>();
List
<
sys_user_role
>
userRoles
=
new
List
<
sys_user_role
>();
List
<
sys_user_hospital
>
userHoss
=
new
List
<
sys_user_hospital
>();
var
roleArr
=
new
[]
{
"护士长"
,
"科主任"
,
"特殊科室"
,
"行政科室"
};
var
allDataList
=
dicData
.
Select
(
item
=>
JsonHelper
.
Deserialize
<
UserHandsResponse
>(
JsonHelper
.
Serialize
(
item
)));
var
names
=
allDataList
?.
Select
(
w
=>
w
?.
HosName
).
Distinct
();
Dictionary
<
string
,
List
<
string
>>
res
=
new
Dictionary
<
string
,
List
<
string
>>();
foreach
(
var
item
in
names
)
{
if
(
item
==
null
)
return
"必填项为空"
;
var
HospitalId
=
hospitals
.
FirstOrDefault
(
w
=>
w
.
HosName
==
item
)?.
ID
;
var
allot
=
_perallotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
HospitalId
);
var
accountingUnits
=
accounts
?.
Join
(
allot
,
t
=>
t
.
AllotId
,
w
=>
w
.
ID
,
(
t
,
w
)
=>
t
.
AccountingUnit
).
Distinct
().
ToList
();
res
.
Add
(
item
,
accountingUnits
);
}
foreach
(
var
data
in
allDataList
)
{
if
(
string
.
IsNullOrEmpty
(
data
.
Login
)
||
string
.
IsNullOrEmpty
(
data
.
RealName
)
||
string
.
IsNullOrEmpty
(
data
.
RoleName
)
||
string
.
IsNullOrEmpty
(
data
.
HosName
))
return
"必填项为空"
;
if
(
roleArr
.
Contains
(
data
.
RoleName
)
&&
res
==
null
)
return
"科室字典为空"
;
if
(
users
.
Any
(
c
=>
c
.
Login
==
data
?.
Login
)
&&
!
string
.
IsNullOrEmpty
(
data
.
Login
)
||
getUsers
.
Any
(
c
=>
c
.
Login
==
data
?.
Login
))
return
"登录名重复"
;
if
(
roleArr
.
Contains
(
data
.
RoleName
)
&&
res
[
data
.
HosName
]
!=
null
&&
!
res
[
data
.
HosName
].
Any
(
t
=>
t
==
data
.
Department
))
return
"核算单元填写错误"
;
var
user
=
new
sys_user
{
RealName
=
data
.
RealName
,
CreateDate
=
Convert
.
ToDateTime
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd hh:mm:dd"
)),
CreateUser
=
request
.
CreateUser
,
Department
=
data
?.
Department
??
""
,
IsDelete
=
1
,
Login
=
data
.
Login
,
Password
=
data
?.
Password
??
"123456"
,
States
=
1
,
Mobile
=
data
?.
Mobile
??
""
,
Mail
=
data
?.
Mail
??
""
};
users
.
Add
(
user
);
//var userRole = new sys_user_role
//{
// RoleID = (int)roles.FirstOrDefault(t => t.RoleName == data.RoleName)?.Type,
//};
//userRoles.Add(userRole);
//var userHos = new sys_user_hospital
//{
// HospitalID = hospitals.FirstOrDefault(t => t.HosName == data.HosName)?.ID
//};
//userHoss.Add(userHos);
}
_userRepository
.
AddRange
(
users
.
ToArray
());
//var roleJoin = userRoles.Join(users, t => new { }, w => new { }, (t, w) => new sys_user_role { RoleID = t.RoleID, UserID = w.ID });
//var hosJoin = userHoss.Join(users, t => new { }, w => new { }, (t, w) => new sys_user_hospital { HospitalID = t.HospitalID, UserID = w.ID });
var
joinData
=
users
.
Join
(
allDataList
,
outer
=>
new
{
outer
.
Login
,
outer
.
RealName
,
Department
=
outer
.
Department
??
""
},
inner
=>
new
{
inner
.
Login
,
inner
.
RealName
,
Department
=
inner
.
Department
??
""
},
(
outer
,
inner
)
=>
new
{
outer
,
inner
});
var
roleJoin
=
joinData
.
Select
(
t
=>
new
sys_user_role
{
UserID
=
t
.
outer
.
ID
,
RoleID
=
(
int
)
roles
.
FirstOrDefault
(
r
=>
r
.
RoleName
==
t
.
inner
.
RoleName
)?.
Type
});
_userroleRepository
.
AddRange
(
roleJoin
.
ToArray
());
var
hosJoin
=
joinData
.
Select
(
t
=>
new
sys_user_hospital
{
UserID
=
t
.
outer
.
ID
,
HospitalID
=
hospitals
.
FirstOrDefault
(
h
=>
h
.
HosName
==
t
.
inner
.
HosName
)?.
ID
});
_userhospitalRepository
.
AddRange
(
hosJoin
.
ToArray
());
return
""
;
}
catch
(
Exception
e
)
{
throw
e
;
}
}
public
static
Dictionary
<
string
,
string
>
Users
{
get
;
}
=
new
Dictionary
<
string
,
string
>
{
{
nameof
(
sys_user
.
RealName
),
"姓名"
},
{
nameof
(
sys_user
.
Login
),
"登录名"
},
{
nameof
(
sys_user
.
Password
),
"密码"
},
{
nameof
(
sys_user
.
Mobile
),
"手机号码"
},
{
nameof
(
sys_user
.
Mail
),
"邮箱"
},
{
nameof
(
sys_role
.
RoleName
),
"角色"
},
{
nameof
(
sys_hospital
.
HosName
),
"分配医院"
},
{
nameof
(
sys_user
.
Department
),
"核算单元"
},
};
private
List
<
Dictionary
<
string
,
string
>>
CreateDataRow
(
UserCollectData
request
,
Dictionary
<
string
,
string
>
config
)
{
List
<
Dictionary
<
string
,
string
>>
allData
=
new
List
<
Dictionary
<
string
,
string
>>();
for
(
int
r
=
0
;
r
<
request
.
Data
.
Length
;
r
++)
{
// 创建固定数据列
Dictionary
<
string
,
string
>
baseData
=
CreateBaseData
(
request
,
config
,
r
);
allData
.
Add
(
baseData
);
}
return
allData
;
}
private
Dictionary
<
string
,
string
>
CreateBaseData
(
UserCollectData
request
,
Dictionary
<
string
,
string
>
config
,
int
rownumber
)
{
Dictionary
<
string
,
string
>
result
=
new
Dictionary
<
string
,
string
>();
for
(
int
c
=
0
;
c
<
request
.
ColHeaders
.
Length
;
c
++)
{
var
header
=
request
.
ColHeaders
[
c
];
var
first
=
config
.
FirstOrDefault
(
w
=>
w
.
Value
==
header
);
if
(!
default
(
KeyValuePair
<
string
,
string
>).
Equals
(
first
)
&&
!
result
.
ContainsKey
(
header
)
&&
request
.
Data
[
rownumber
].
Length
>
c
)
{
result
.
Add
(
first
.
Key
,
request
.
Data
[
rownumber
][
c
]);
}
}
return
result
;
}
}
}
}
}
\ No newline at end of file
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