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
87d8d98c
Commit
87d8d98c
authored
Aug 19, 2021
by
钟博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绩效查询用户添加,查询
parent
2fcf5b0b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
12 deletions
+56
-12
performance/Performance.Api/Controllers/AccountController.cs
+2
-2
performance/Performance.Api/wwwroot/Performance.Api.xml
+1
-1
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+5
-0
performance/Performance.DtoModels/SaveCollectData.cs
+2
-1
performance/Performance.Services/PersonService.cs
+33
-7
performance/Performance.Services/UserService.cs
+13
-1
No files found.
performance/Performance.Api/Controllers/AccountController.cs
View file @
87d8d98c
...
@@ -147,9 +147,9 @@ public ApiResponse<UserResponse> UpdateSelf([CustomizeValidator(RuleSet = "Self"
...
@@ -147,9 +147,9 @@ public ApiResponse<UserResponse> UpdateSelf([CustomizeValidator(RuleSet = "Self"
/// <returns></returns>
/// <returns></returns>
[
Route
(
"list"
)]
[
Route
(
"list"
)]
[
HttpPost
]
[
HttpPost
]
public
ApiResponse
<
List
<
UserResponse
>>
List
()
public
ApiResponse
<
List
<
UserResponse
>>
List
(
[
FromBody
]
UserRequest
request
)
{
{
var
userList
=
_userService
.
GetUserList
(
_claim
.
GetUserId
());
var
userList
=
_userService
.
GetUserList
(
_claim
.
GetUserId
()
,
request
.
Role
);
return
new
ApiResponse
<
List
<
UserResponse
>>(
ResponseType
.
OK
,
"ok"
,
userList
);
return
new
ApiResponse
<
List
<
UserResponse
>>(
ResponseType
.
OK
,
"ok"
,
userList
);
}
}
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
87d8d98c
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
<param
name=
"request"
></param>
<param
name=
"request"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.AccountController.List"
>
<member
name=
"M:Performance.Api.Controllers.AccountController.List
(Performance.DtoModels.UserRequest)
"
>
<summary>
<summary>
用户列表
用户列表
</summary>
</summary>
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
87d8d98c
...
@@ -7281,6 +7281,11 @@
...
@@ -7281,6 +7281,11 @@
行政后勤是否显示管理绩效按钮 1 是 2 否
行政后勤是否显示管理绩效按钮 1 是 2 否
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.sys_hospital.IsOwnerQuery"
>
<summary>
是否开启个人绩效查询账号创建 1 是 2 否
</summary>
</member>
<member
name=
"T:Performance.EntityModels.sys_hospitalconfig"
>
<member
name=
"T:Performance.EntityModels.sys_hospitalconfig"
>
<summary>
<summary>
...
...
performance/Performance.DtoModels/SaveCollectData.cs
View file @
87d8d98c
...
@@ -9,6 +9,7 @@ public class SaveCollectData
...
@@ -9,6 +9,7 @@ public class SaveCollectData
{
{
public
int
SheetType
{
get
;
set
;
}
public
int
SheetType
{
get
;
set
;
}
public
string
SheetName
{
get
;
set
;
}
public
string
SheetName
{
get
;
set
;
}
public
int
?
CreateUser
{
get
;
set
;
}
public
string
[]
ColHeaders
{
get
;
set
;
}
public
string
[]
ColHeaders
{
get
;
set
;
}
public
string
[][]
Data
{
get
;
set
;
}
public
string
[][]
Data
{
get
;
set
;
}
}
}
...
@@ -18,7 +19,7 @@ public class UserCollectData
...
@@ -18,7 +19,7 @@ public class UserCollectData
public
int
HospitalId
{
get
;
set
;
}
public
int
HospitalId
{
get
;
set
;
}
public
int
?
CreateUser
{
get
;
set
;
}
public
int
?
CreateUser
{
get
;
set
;
}
public
string
[]
ColHeaders
{
get
;
set
;
}
public
string
[]
ColHeaders
{
get
;
set
;
}
public
string
[][]
Data
{
get
;
set
;
}
public
new
string
[][]
Data
{
get
;
set
;
}
}
}
...
...
performance/Performance.Services/PersonService.cs
View file @
87d8d98c
...
@@ -33,6 +33,7 @@ public class PersonService : IAutoInjection
...
@@ -33,6 +33,7 @@ public class PersonService : IAutoInjection
private
readonly
PerforRoleRepository
perforRoleRepository
;
private
readonly
PerforRoleRepository
perforRoleRepository
;
private
readonly
PerforAgsecondallotRepository
agsecondallotRepository
;
private
readonly
PerforAgsecondallotRepository
agsecondallotRepository
;
private
readonly
PerforHospitalRepository
perforHospitalRepository
;
private
readonly
PerforHospitalRepository
perforHospitalRepository
;
private
readonly
UserService
userService
;
private
readonly
Application
application
;
private
readonly
Application
application
;
private
readonly
IHostingEnvironment
evn
;
private
readonly
IHostingEnvironment
evn
;
...
@@ -57,6 +58,7 @@ public class PersonService : IAutoInjection
...
@@ -57,6 +58,7 @@ public class PersonService : IAutoInjection
PerforRoleRepository
perforRoleRepository
,
PerforRoleRepository
perforRoleRepository
,
PerforAgsecondallotRepository
agsecondallotRepository
,
PerforAgsecondallotRepository
agsecondallotRepository
,
PerforHospitalRepository
perforHospitalRepository
,
PerforHospitalRepository
perforHospitalRepository
,
UserService
userService
,
IOptions
<
Application
>
application
,
IOptions
<
Application
>
application
,
IHostingEnvironment
evn
IHostingEnvironment
evn
)
)
...
@@ -70,6 +72,7 @@ IHostingEnvironment evn
...
@@ -70,6 +72,7 @@ IHostingEnvironment evn
this
.
perforRoleRepository
=
perforRoleRepository
;
this
.
perforRoleRepository
=
perforRoleRepository
;
this
.
agsecondallotRepository
=
agsecondallotRepository
;
this
.
agsecondallotRepository
=
agsecondallotRepository
;
this
.
perforHospitalRepository
=
perforHospitalRepository
;
this
.
perforHospitalRepository
=
perforHospitalRepository
;
this
.
userService
=
userService
;
this
.
application
=
application
.
Value
;
this
.
application
=
application
.
Value
;
this
.
evn
=
evn
;
this
.
evn
=
evn
;
}
}
...
@@ -719,20 +722,36 @@ public HandsonTable GetDepartmentHands(int hospitalId)
...
@@ -719,20 +722,36 @@ public HandsonTable GetDepartmentHands(int hospitalId)
public
bool
BathSavePerson
(
int
AllotId
,
int
HospitalId
,
SaveCollectData
request
)
public
bool
BathSavePerson
(
int
AllotId
,
int
HospitalId
,
SaveCollectData
request
)
{
{
var
dict
=
new
Dictionary
<
string
,
string
>();
var
dict
=
new
Dictionary
<
string
,
string
>();
P
erson
.
ForEach
(
t
=>
dict
.
Add
(
t
.
Item1
,
t
.
Item2
));
P
onsePassword
.
ForEach
(
t
=>
dict
.
Add
(
t
.
Item1
,
t
.
Item2
));
var
dicData
=
CreateDataRow
(
request
,
dict
);
var
dicData
=
CreateDataRow
(
request
,
dict
);
List
<
per_employee
>
employees
=
new
List
<
per_employee
>();
List
<
per_employee
>
employees
=
new
List
<
per_employee
>();
var
persons
=
peremployeeRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
HospitalId
&&
t
.
AllotId
==
AllotId
);
var
persons
=
peremployeeRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
HospitalId
&&
t
.
AllotId
==
AllotId
);
var
hospital
=
perforHospitalRepository
.
GetEntity
(
t
=>
t
.
ID
==
HospitalId
);
var
hospital
=
perforHospitalRepository
.
GetEntity
(
t
=>
t
.
ID
==
HospitalId
);
//var newRole = perforRoleRepository.GetEntity(t => t.RoleName == "绩效查询");
//==绩效查询角色
var
usercollor
=
new
UserCollectData
{
HospitalId
=
HospitalId
,
CreateUser
=
request
.
CreateUser
,
ColHeaders
=
new
[]
{
"姓名"
,
"登录名"
,
"密码"
,
"手机号码"
,
"邮箱"
,
"角色"
,
"分配医院"
,
"核算单元"
},
};
var
role
=
perforRoleRepository
.
GetEntity
(
t
=>
t
.
RoleName
==
"绩效查询"
);
var
userRole
=
perforUserroleRepository
.
GetEntities
(
t
=>
t
.
RoleID
==
role
.
ID
).
Select
(
t
=>
t
.
UserID
);
var
users
=
perforUserRepository
.
GetEntities
(
t
=>
userRole
.
Contains
(
t
.
ID
));
//==
var
newUsers
=
new
List
<
string
[
]>
();
var
delPersonsNum
=
new
List
<
string
>();
var
delPersonsNum
=
new
List
<
string
>();
foreach
(
var
item
in
dicData
)
foreach
(
var
item
in
dicData
)
{
{
//==绩效查询角色
var
isNewRole
=
!
string
.
IsNullOrEmpty
(
item
[
"PersonnelNumber"
])
&&
!
string
.
IsNullOrEmpty
(
item
[
"Password"
]);
var
isNewRole
=
!
string
.
IsNullOrEmpty
(
item
[
"PersonnelNumber"
])
&&
!
string
.
IsNullOrEmpty
(
item
[
"Password"
]);
if
(
hospital
.
IsOwnerQuery
==
1
&&
isNewRole
)
var
isRepeat
=
users
.
Any
(
t
=>
t
.
RealName
==
item
[
"DoctorName"
]
&&
t
.
Login
==
item
[
"PersonnelNumber"
]);
if
(
hospital
.
IsOwnerQuery
==
1
&&
isNewRole
&&
!
isRepeat
)
{
{
newUsers
.
Add
(
new
[]
{
$"
{
item
[
"DoctorName"
]}
"
,
$"
{
item
[
"PersonnelNumber"
]}
"
,
$"
{
item
[
"Password"
]}
"
,
""
,
""
,
"绩效查询"
,
$"
{
hospital
.
HosName
}
"
,
$"
{
item
[
"AccountingUnit"
]}
"
});
}
}
//==
if
(!
string
.
IsNullOrEmpty
(
item
[
"AttendanceDay"
])
&&
!
string
.
IsNullOrEmpty
(
item
[
"ReservedRatio"
]))
if
(!
string
.
IsNullOrEmpty
(
item
[
"AttendanceDay"
])
&&
!
string
.
IsNullOrEmpty
(
item
[
"ReservedRatio"
]))
{
{
...
@@ -759,6 +778,13 @@ public bool BathSavePerson(int AllotId, int HospitalId, SaveCollectData request)
...
@@ -759,6 +778,13 @@ public bool BathSavePerson(int AllotId, int HospitalId, SaveCollectData request)
employees
.
Add
(
data
);
employees
.
Add
(
data
);
}
}
}
}
if
(
newUsers
.
Count
>
0
)
{
usercollor
.
Data
=
newUsers
.
ToArray
();
userService
.
SaveUserHandsFlat
(
usercollor
);
}
var
delPerson
=
persons
?.
Where
(
t
=>
delPersonsNum
.
Contains
(
t
.
PersonnelNumber
));
var
delPerson
=
persons
?.
Where
(
t
=>
delPersonsNum
.
Contains
(
t
.
PersonnelNumber
));
if
(
delPerson
!=
null
&&
delPerson
.
Any
())
if
(
delPerson
!=
null
&&
delPerson
.
Any
())
peremployeeRepository
.
RemoveRange
(
delPerson
.
ToArray
());
peremployeeRepository
.
RemoveRange
(
delPerson
.
ToArray
());
...
@@ -1032,11 +1058,11 @@ public string GetPersonDictFile(int allotId, int userId)
...
@@ -1032,11 +1058,11 @@ public string GetPersonDictFile(int allotId, int userId)
public
bool
ReloadPersonnel
(
int
hospitalId
,
int
allotId
)
public
bool
ReloadPersonnel
(
int
hospitalId
,
int
allotId
)
{
{
var
allotList
=
perallotRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
hospitalId
)?.
OrderBy
(
s
=>
s
.
Year
).
ThenBy
(
s
=>
s
.
Month
).
ToList
();
var
allotList
=
perallotRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
hospitalId
)?.
OrderBy
(
s
=>
s
.
Year
).
ThenBy
(
s
=>
s
.
Month
).
ToList
();
if
(
allotList
==
null
||
!
allotList
.
Any
())
if
(
allotList
==
null
||
!
allotList
.
Any
())
throw
new
PerformanceException
(
"加载失败,绩效记录不存在!"
);
throw
new
PerformanceException
(
"加载失败,绩效记录不存在!"
);
var
allot
=
allotList
.
FirstOrDefault
(
w
=>
w
.
ID
==
allotId
);
var
allot
=
allotList
.
FirstOrDefault
(
w
=>
w
.
ID
==
allotId
);
if
(
allot
==
null
)
if
(
allot
==
null
)
throw
new
PerformanceException
(
"加载失败,绩效记录不存在!"
);
throw
new
PerformanceException
(
"加载失败,绩效记录不存在!"
);
var
index
=
allotList
.
IndexOf
(
allot
);
var
index
=
allotList
.
IndexOf
(
allot
);
...
@@ -1047,11 +1073,11 @@ public bool ReloadPersonnel(int hospitalId, int allotId)
...
@@ -1047,11 +1073,11 @@ public bool ReloadPersonnel(int hospitalId, int allotId)
if
(
prevAllot
==
null
)
prevAllot
.
ID
=
-
1
;
if
(
prevAllot
==
null
)
prevAllot
.
ID
=
-
1
;
var
persons
=
peremployeeRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
AllotId
==
prevAllot
.
ID
);
var
persons
=
peremployeeRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
AllotId
==
prevAllot
.
ID
);
if
(
persons
==
null
||
!
persons
.
Any
())
if
(
persons
==
null
||
!
persons
.
Any
())
throw
new
PerformanceException
(
"加载失败,未查询到上月人员信息!"
);
throw
new
PerformanceException
(
"加载失败,未查询到上月人员信息!"
);
var
i
=
peremployeeRepository
.
Execute
(
$@"DELETE FROM per_employee WHERE HospitalId=@HospitalId and AllotId=@AllotId;"
,
new
{
hospitalId
,
allotId
});
var
i
=
peremployeeRepository
.
Execute
(
$@"DELETE FROM per_employee WHERE HospitalId=@HospitalId and AllotId=@AllotId;"
,
new
{
hospitalId
,
allotId
});
if
(
i
<=
0
)
if
(
i
<=
0
)
throw
new
PerformanceException
(
"加载失败,人员信息重置失败!"
);
throw
new
PerformanceException
(
"加载失败,人员信息重置失败!"
);
int
day
=
DateTime
.
DaysInMonth
(
allot
.
Year
,
allot
.
Month
);
int
day
=
DateTime
.
DaysInMonth
(
allot
.
Year
,
allot
.
Month
);
...
...
performance/Performance.Services/UserService.cs
View file @
87d8d98c
...
@@ -134,7 +134,7 @@ public sys_role GetUserFirstRole(int userId)
...
@@ -134,7 +134,7 @@ public sys_role GetUserFirstRole(int userId)
/// </summary>
/// </summary>
/// <param name="userID"></param>
/// <param name="userID"></param>
/// <returns></returns>
/// <returns></returns>
public
List
<
UserResponse
>
GetUserList
(
int
userID
)
public
List
<
UserResponse
>
GetUserList
(
int
userID
,
int
roleType
=
1
)
{
{
var
userRoles
=
_userroleRepository
.
GetEntities
();
var
userRoles
=
_userroleRepository
.
GetEntities
();
var
userHospitals
=
_userhospitalRepository
.
GetEntities
();
var
userHospitals
=
_userhospitalRepository
.
GetEntities
();
...
@@ -143,6 +143,18 @@ public List<UserResponse> GetUserList(int userID)
...
@@ -143,6 +143,18 @@ public List<UserResponse> GetUserList(int userID)
var
roles
=
_roleRepository
.
GetEntities
();
var
roles
=
_roleRepository
.
GetEntities
();
var
userrole
=
userRoles
?.
FirstOrDefault
(
t
=>
t
.
UserID
==
userID
);
var
userrole
=
userRoles
?.
FirstOrDefault
(
t
=>
t
.
UserID
==
userID
);
if
(
roleType
==
12
)
{
var
jxQuery
=
userRoles
.
Where
(
t
=>
t
.
RoleID
==
roles
?.
FirstOrDefault
(
c
=>
c
.
RoleName
==
"绩效查询"
)?.
ID
).
Select
(
t
=>
t
.
UserID
);
users
=
users
.
Where
(
t
=>
jxQuery
.
Contains
(
t
.
ID
)).
ToList
();
}
else
{
var
jxQuery
=
userRoles
.
Where
(
t
=>
roles
.
Where
(
c
=>
c
.
RoleName
!=
"绩效查询"
).
Select
(
c
=>
c
.
ID
).
Contains
(
t
.
RoleID
)).
Select
(
t
=>
t
.
UserID
);
users
=
users
.
Where
(
t
=>
jxQuery
.
Contains
(
t
.
ID
)).
ToList
();
}
if
(
userrole
==
null
)
if
(
userrole
==
null
)
throw
new
PerformanceException
(
"用户未配置角色"
);
throw
new
PerformanceException
(
"用户未配置角色"
);
var
role
=
roles
?.
FirstOrDefault
(
t
=>
t
.
ID
==
userrole
.
RoleID
);
var
role
=
roles
?.
FirstOrDefault
(
t
=>
t
.
ID
==
userrole
.
RoleID
);
...
...
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