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
1ca73449
Commit
1ca73449
authored
May 17, 2021
by
钟博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
科室人员用户handson数据导入
parent
7ebf9871
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
543 additions
and
3 deletions
+543
-3
performance/Performance.Api/Controllers/AccountController.cs
+16
-2
performance/Performance.Api/Controllers/PersonController.cs
+48
-0
performance/Performance.Api/Properties/PublishProfiles/FolderProfile.pubxml
+2
-1
performance/Performance.Api/wwwroot/Performance.Api.xml
+38
-0
performance/Performance.DtoModels/Response/DeptdicResponse.cs
+16
-0
performance/Performance.DtoModels/Response/UserHandsResponse.cs
+16
-0
performance/Performance.DtoModels/SaveCollectData.cs
+7
-0
performance/Performance.Services/PersonService.cs
+282
-0
performance/Performance.Services/UserService.cs
+118
-0
No files found.
performance/Performance.Api/Controllers/AccountController.cs
View file @
1ca73449
...
@@ -371,15 +371,29 @@ public ApiResponse DeleteUser([CustomizeValidator(RuleSet = "Delete"), FromBody]
...
@@ -371,15 +371,29 @@ 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
(
[
FromBody
]
UserCollectData
data
)
{
{
_userService
.
SaveUserHandsFlat
(
data
);
return
new
ApiResponse
(
ResponseType
.
OK
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
}
}
}
...
...
performance/Performance.Api/Controllers/PersonController.cs
View file @
1ca73449
...
@@ -181,5 +181,53 @@ public ApiResponse DeptIncomeDetail([CustomizeValidator(RuleSet = "Select"), Fro
...
@@ -181,5 +181,53 @@ 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"
)]
public
ApiResponse
GetBatchPersonStructrue
(
int
hospitalId
)
{
var
result
=
personService
.
GetBatchPersonStructrue
(
hospitalId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
/// <summary>
/// 批量添加人员信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"person/BathSavePerson"
)]
public
ApiResponse
BathSavePerson
(
int
allotId
,
int
hospitalId
,
SaveCollectData
request
)
{
personService
.
BathSavePerson
(
allotId
,
hospitalId
,
request
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
/// <summary>
/// 批量科室字典表头
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"dept/GetDeptStructrue"
)]
public
ApiResponse
GetDeptStructrue
(
int
hospitalId
)
{
var
result
=
personService
.
GetDepartmentHands
(
hospitalId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
/// <summary>
/// 批量添加科室信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"dept/SaveDeptHands"
)]
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 @
1ca73449
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<ProjectGuid>
3ae00ff5-f0ba-4d72-a23b-770186309327
</ProjectGuid>
<ProjectGuid>
3ae00ff5-f0ba-4d72-a23b-770186309327
</ProjectGuid>
<SelfContained>
false
</SelfContained>
<SelfContained>
false
</SelfContained>
<_IsPortable>
true
</_IsPortable>
<_IsPortable>
true
</_IsPortable>
<publishUrl>
E:\release\jx.suvalue.com
</publishUrl>
<publishUrl>
D:\publish\jx.suvalue.com2
</publishUrl>
<DeleteExistingFiles>
True
</DeleteExistingFiles>
<DeleteExistingFiles>
True
</DeleteExistingFiles>
</PropertyGroup>
</PropertyGroup>
</Project>
</Project>
\ No newline at end of file
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
1ca73449
...
@@ -137,6 +137,20 @@
...
@@ -137,6 +137,20 @@
<param
name=
"request"
></param>
<param
name=
"request"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<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>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"T:Performance.Api.Controllers.AgainAllotController"
>
<member
name=
"T:Performance.Api.Controllers.AgainAllotController"
>
<summary>
<summary>
科室二次分配
科室二次分配
...
@@ -1107,6 +1121,30 @@
...
@@ -1107,6 +1121,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.DtoModels/Response/DeptdicResponse.cs
View file @
1ca73449
...
@@ -25,4 +25,20 @@ public class Deptdic
...
@@ -25,4 +25,20 @@ public class Deptdic
public
int
Id
{
get
;
set
;
}
public
int
Id
{
get
;
set
;
}
public
string
AccountingUnit
{
get
;
set
;
}
public
string
AccountingUnit
{
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 @
1ca73449
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
Department
{
get
;
set
;
}
public
string
RoleName
{
get
;
set
;
}
public
string
HosName
{
get
;
set
;
}
}
}
performance/Performance.DtoModels/SaveCollectData.cs
View file @
1ca73449
...
@@ -11,4 +11,11 @@ public class SaveCollectData
...
@@ -11,4 +11,11 @@ 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
?
CreateUser
{
get
;
set
;
}
public
string
[]
ColHeaders
{
get
;
set
;
}
public
string
[][]
Data
{
get
;
set
;
}
}
}
}
performance/Performance.Services/PersonService.cs
View file @
1ca73449
...
@@ -588,5 +588,287 @@ private string[] GetUnitType(int userId)
...
@@ -588,5 +588,287 @@ private string[] GetUnitType(int userId)
return
dict
[
role
.
Type
.
Value
];
return
dict
[
role
.
Type
.
Value
];
}
}
public
HandsonTable
GetBatchPersonStructrue
(
int
hospitalId
)
{
var
result
=
new
HandsonTable
((
int
)
SheetType
.
Unidentifiable
,
Person
.
Select
(
t
=>
t
.
Value
).
ToArray
(),
Person
.
Select
(
t
=>
new
collect_permission
{
HeadName
=
t
.
Value
,
Visible
=
1
}).
ToList
());
var
deptdics
=
perdeptdicRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
);
if
(
result
.
Columns
!=
null
&&
result
.
Columns
.
Any
())
{
foreach
(
var
column
in
result
.
Columns
)
{
if
(
column
.
Data
==
"角色"
)
{
column
.
Type
=
"autocomplete"
;
column
.
Source
=
deptdics
?.
Where
(
t
=>
!
new
string
[]
{
UnitType
.
行政后勤
.
ToString
(),
UnitType
.
特殊核算组
.
ToString
()
}.
Contains
(
t
.
UnitType
)).
Select
(
t
=>
t
.
AccountingUnit
).
Distinct
().
ToArray
();
column
.
Strict
=
true
;
}
else
if
(
column
.
Data
==
"分配医院"
)
{
column
.
Type
=
"autocomplete"
;
column
.
Source
=
deptdics
.
Select
(
t
=>
t
.
Department
).
Distinct
().
ToArray
();
column
.
Strict
=
true
;
}
else
if
(
column
.
Data
==
"人员类别"
)
{
column
.
Type
=
"autocomplete"
;
column
.
Source
=
deptdics
?
.
Where
(
t
=>
!
new
string
[]
{
UnitType
.
专家组
.
ToString
()
}.
Contains
(
t
.
UnitType
))
.
Select
(
t
=>
t
.
UnitType
).
Distinct
().
ToArray
();
column
.
Strict
=
true
;
}
}
}
return
result
;
}
public
HandsonTable
GetDepartmentHands
(
int
hospitalId
)
{
HandsonTable
handson
=
new
HandsonTable
((
int
)
SheetType
.
Unidentifiable
,
DeptDic
.
Select
(
c
=>
c
.
Value
).
ToArray
(),
DeptDic
.
Select
(
t
=>
new
collect_permission
{
HeadName
=
t
.
Value
,
Visible
=
1
,
Readnoly
=
0
}).
ToList
());
if
(
handson
.
Columns
!=
null
&&
handson
.
Columns
.
Any
())
{
foreach
(
var
column
in
handson
.
Columns
)
{
if
(
column
.
Data
==
"标准科室"
)
{
column
.
Type
=
"autocomplete"
;
column
.
Source
=
DeptDics
(
hospitalId
,
2
).
Select
(
c
=>
c
.
Value
).
ToArray
();
column
.
Strict
=
true
;
}
else
if
(
column
.
Data
==
"系统科室"
)
{
column
.
Type
=
"autocomplete"
;
column
.
Source
=
DeptDics
(
hospitalId
,
1
).
Select
(
c
=>
c
.
Value
).
ToArray
();
column
.
Strict
=
true
;
}
else
if
(
new
[]
{
"住院·核算单元医生组"
,
"住院·核算单元护理组"
,
"住院·核算单元医技组"
,
"门诊·核算单元医生组"
,
"门诊·核算单元护理组"
,
"门诊·核算单元医技组"
}.
Contains
(
column
.
Data
))
{
column
.
Type
=
"autocomplete"
;
column
.
Source
=
DeptDics
(
hospitalId
,
3
).
Select
(
c
=>
c
.
Value
).
ToArray
();
column
.
Strict
=
true
;
}
else
if
(
column
.
Data
==
"行政后勤"
)
{
column
.
Type
=
"autocomplete"
;
column
.
Source
=
DeptDics
(
hospitalId
,
4
).
Select
(
c
=>
c
.
Value
).
ToArray
();
column
.
Strict
=
true
;
}
else
if
(
column
.
Data
==
"特殊核算组"
)
{
column
.
Type
=
"autocomplete"
;
column
.
Source
=
DeptDics
(
hospitalId
,
5
).
Select
(
c
=>
c
.
Value
).
ToArray
();
column
.
Strict
=
true
;
}
}
}
return
handson
;
}
public
void
BathSavePerson
(
int
AllotId
,
int
HospitalId
,
SaveCollectData
request
)
{
var
dicData
=
CreateDataRow
(
request
,
Person
);
List
<
per_employee
>
employees
=
new
List
<
per_employee
>();
foreach
(
var
item
in
dicData
)
{
var
json
=
JsonHelper
.
Serialize
(
item
);
var
data
=
JsonHelper
.
Deserialize
<
per_employee
>(
json
);
if
(!
string
.
IsNullOrEmpty
(
data
.
Department
)
||
!
string
.
IsNullOrEmpty
(
data
.
AccountingUnit
))
{
data
.
HospitalId
=
HospitalId
;
data
.
AllotId
=
AllotId
;
data
.
CreateTime
=
Convert
.
ToDateTime
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd hh:mm:dd"
));
employees
.
Add
(
data
);
}
peremployeeRepository
.
AddRange
(
employees
.
ToArray
());
}
}
public
void
SaveDeptDicHands
(
int
HospitalId
,
SaveCollectData
request
)
{
var
dicData
=
CreateDataRow
(
request
,
DeptDic
);
List
<
per_dept_dic
>
deptDics
=
new
List
<
per_dept_dic
>();
foreach
(
var
dic
in
dicData
)
{
var
json
=
JsonHelper
.
Serialize
(
dic
);
var
data
=
JsonHelper
.
Deserialize
<
DeptdicHands
>(
json
);
if
(!
string
.
IsNullOrEmpty
(
data
.
Department
)
||
!
string
.
IsNullOrEmpty
(
data
.
HISDeptName
))
{
DeptDicList
(
HospitalId
,
deptDics
,
data
);
}
}
perdeptdicRepository
.
Execute
(
"delete from per_dept_dic where HospitalId = @HospitalId"
,
new
{
HospitalId
});
perdeptdicRepository
.
AddRange
(
deptDics
.
ToArray
());
}
private
void
DeptDicList
(
int
HospitalId
,
List
<
per_dept_dic
>
deptDics
,
DeptdicHands
data
)
{
var
nowTime
=
Convert
.
ToDateTime
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd hh:mm:ss"
));
#
region
住院
if
(
data
.
InpatDoctorAccounting
!=
""
||
data
.
InpatNurseAccounting
!=
""
||
data
.
InpatTechnicAccounting
!=
""
)
{
if
(
data
.
InpatDoctorAccounting
!=
""
)
{
per_dept_dic
deptDic
=
new
per_dept_dic
()
{
Source
=
"住院"
,
HospitalId
=
HospitalId
,
Department
=
data
.
Department
,
HISDeptName
=
data
.
HISDeptName
,
CreateTime
=
nowTime
};
deptDic
.
AccountingUnit
=
data
.
InpatDoctorAccounting
;
deptDic
.
UnitType
=
"医生组"
;
deptDics
.
Add
(
deptDic
);
}
if
(
data
.
InpatNurseAccounting
!=
""
)
{
per_dept_dic
deptDic
=
new
per_dept_dic
()
{
Source
=
"住院"
,
HospitalId
=
HospitalId
,
Department
=
data
.
Department
,
HISDeptName
=
data
.
HISDeptName
,
CreateTime
=
nowTime
};
deptDic
.
AccountingUnit
=
data
.
InpatNurseAccounting
;
deptDic
.
UnitType
=
"护理组"
;
deptDics
.
Add
(
deptDic
);
}
if
(
data
.
InpatTechnicAccounting
!=
""
)
{
per_dept_dic
deptDic
=
new
per_dept_dic
()
{
Source
=
"住院"
,
HospitalId
=
HospitalId
,
Department
=
data
.
Department
,
HISDeptName
=
data
.
HISDeptName
,
CreateTime
=
nowTime
};
deptDic
.
AccountingUnit
=
data
.
InpatTechnicAccounting
;
deptDic
.
UnitType
=
"医技组"
;
deptDics
.
Add
(
deptDic
);
}
}
#
endregion
#
region
门诊
if
(
data
.
OutDoctorAccounting
!=
""
||
data
.
OutNurseAccounting
!=
""
||
data
.
OutTechnicAccounting
!=
""
)
{
if
(
data
.
OutDoctorAccounting
!=
""
)
{
per_dept_dic
deptDic
=
new
per_dept_dic
()
{
Source
=
"门诊"
,
HospitalId
=
HospitalId
,
Department
=
data
.
Department
,
HISDeptName
=
data
.
HISDeptName
,
CreateTime
=
nowTime
};
deptDic
.
AccountingUnit
=
data
.
OutDoctorAccounting
;
deptDic
.
UnitType
=
"医生组"
;
deptDics
.
Add
(
deptDic
);
}
if
(
data
.
OutNurseAccounting
!=
""
)
{
per_dept_dic
deptDic
=
new
per_dept_dic
()
{
Source
=
"门诊"
,
HospitalId
=
HospitalId
,
Department
=
data
.
Department
,
HISDeptName
=
data
.
HISDeptName
,
CreateTime
=
nowTime
};
deptDic
.
AccountingUnit
=
data
.
OutNurseAccounting
;
deptDic
.
UnitType
=
"护理组"
;
deptDics
.
Add
(
deptDic
);
}
if
(
data
.
OutTechnicAccounting
!=
""
)
{
per_dept_dic
deptDic
=
new
per_dept_dic
()
{
Source
=
"门诊"
,
HospitalId
=
HospitalId
,
Department
=
data
.
Department
,
HISDeptName
=
data
.
HISDeptName
,
CreateTime
=
nowTime
};
deptDic
.
AccountingUnit
=
data
.
OutTechnicAccounting
;
deptDic
.
UnitType
=
"医技组"
;
deptDics
.
Add
(
deptDic
);
}
}
#
endregion
if
(
data
.
LogisticsAccounting
!=
""
)
{
per_dept_dic
deptDic
=
new
per_dept_dic
()
{
HospitalId
=
HospitalId
,
Department
=
data
.
Department
,
HISDeptName
=
data
.
HISDeptName
,
CreateTime
=
nowTime
,
AccountingUnit
=
data
.
LogisticsAccounting
,
UnitType
=
"行政后勤"
};
deptDics
.
Add
(
deptDic
);
}
if
(
data
.
SpecialAccounting
!=
""
)
{
per_dept_dic
deptDic
=
new
per_dept_dic
()
{
HospitalId
=
HospitalId
,
Department
=
data
.
Department
,
HISDeptName
=
data
.
HISDeptName
,
CreateTime
=
nowTime
,
AccountingUnit
=
data
.
LogisticsAccounting
,
UnitType
=
"特殊核算组"
};
deptDics
.
Add
(
deptDic
);
}
}
private
List
<
Dictionary
<
string
,
string
>>
CreateDataRow
(
SaveCollectData
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
(
SaveCollectData
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
;
}
public
static
Dictionary
<
string
,
string
>
Person
{
get
;
}
=
new
Dictionary
<
string
,
string
>
{
{
nameof
(
per_employee
.
AccountingUnit
),
"核算单元"
},
{
nameof
(
per_employee
.
Department
),
"科室名称"
},
{
nameof
(
per_employee
.
DoctorName
),
"姓名"
},
{
nameof
(
per_employee
.
PersonnelNumber
),
"员工工号"
},
{
nameof
(
per_employee
.
JobCategory
),
"正式/临聘"
},
{
nameof
(
per_employee
.
Duty
),
"职务"
},
{
nameof
(
per_employee
.
JobTitle
),
"职称"
},
{
nameof
(
per_employee
.
UnitType
),
"人员类别"
},
{
nameof
(
per_employee
.
AttendanceDay
),
"出勤天数"
},
{
nameof
(
per_employee
.
ReservedRatio
),
"预留比例"
},
{
nameof
(
per_employee
.
Remark
),
"备注"
},
};
private
static
Dictionary
<
string
,
string
>
DeptDic
{
get
;
}
=
new
Dictionary
<
string
,
string
>
{
{
nameof
(
DeptdicResponse
.
Department
),
"标准科室"
},
{
nameof
(
DeptdicResponse
.
HISDeptName
),
"系统科室"
},
{
nameof
(
DeptdicResponse
.
OutDoctorAccounting
),
"门诊·核算单元医生组"
},
{
nameof
(
DeptdicResponse
.
OutNurseAccounting
),
"门诊·核算单元护理组"
},
{
nameof
(
DeptdicResponse
.
OutTechnicAccounting
),
"门诊·核算单元医技组"
},
{
nameof
(
DeptdicResponse
.
InpatDoctorAccounting
),
"住院·核算单元医生组"
},
{
nameof
(
DeptdicResponse
.
InpatNurseAccounting
),
"住院·核算单元护理组"
},
{
nameof
(
DeptdicResponse
.
InpatTechnicAccounting
),
"住院·核算单元医技组"
},
{
nameof
(
DeptdicResponse
.
LogisticsAccounting
),
"行政后勤"
},
{
nameof
(
DeptdicResponse
.
SpecialAccounting
),
"特殊核算组"
}
};
}
}
}
}
performance/Performance.Services/UserService.cs
View file @
1ca73449
...
@@ -695,5 +695,122 @@ public ApiResponse DeleteUser(int iD)
...
@@ -695,5 +695,122 @@ 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
void
SaveUserHandsFlat
(
UserCollectData
request
)
{
var
dicData
=
CreateDataRow
(
request
,
Users
);
var
roles
=
_roleRepository
.
GetEntities
();
var
hospitals
=
_hospitalRepository
.
GetEntities
();
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
>();
foreach
(
var
item
in
dicData
)
{
var
json
=
JsonHelper
.
Serialize
(
item
);
var
data
=
JsonHelper
.
Deserialize
<
UserHandsResponse
>(
json
);
if
(!
string
.
IsNullOrEmpty
(
data
.
Login
)
&&
!
string
.
IsNullOrEmpty
(
data
.
RealName
))
{
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
,
States
=
1
};
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
});
_userroleRepository
.
AddRange
(
roleJoin
.
ToArray
());
_userhospitalRepository
.
AddRange
(
hosJoin
.
ToArray
());
}
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_role
.
RoleName
),
"角色"
},
{
nameof
(
sys_user
.
Department
),
"核算单元"
},
{
nameof
(
sys_hospital
.
HosName
),
"分配医院"
},
};
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