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
e7a7edb4
Commit
e7a7edb4
authored
Mar 03, 2022
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
根据人员字典添加用户代码修改
parent
ce2a169e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
52 deletions
+70
-52
performance/Performance.Api/Controllers/ReportGlobalController.cs
+5
-5
performance/Performance.Api/wwwroot/Performance.Api.xml
+8
-2
performance/Performance.Services/PersonService.cs
+4
-8
performance/Performance.Services/ReportGlobalService.cs
+41
-12
performance/Performance.Services/UserService.cs
+12
-25
No files found.
performance/Performance.Api/Controllers/ReportGlobalController.cs
View file @
e7a7edb4
...
...
@@ -19,16 +19,19 @@ public class ReportGlobalController : Controller
private
readonly
IWebHostEnvironment
env
;
private
readonly
AllotService
allotService
;
private
readonly
ReportGlobalService
reportGlobalService
;
private
readonly
ClaimService
claimService
;
public
ReportGlobalController
(
IWebHostEnvironment
env
,
AllotService
allotService
,
ReportGlobalService
reportGlobalService
ReportGlobalService
reportGlobalService
,
ClaimService
claimService
)
{
this
.
env
=
env
;
this
.
allotService
=
allotService
;
this
.
reportGlobalService
=
reportGlobalService
;
this
.
claimService
=
claimService
;
}
/// <summary>
...
...
@@ -157,10 +160,7 @@ public ApiResponse SaveReportPersonTag(int hospitalId, int allotId, [FromBody] S
{
return
new
ApiResponse
(
ResponseType
.
Fail
,
"参数错误"
,
"hospitalId无效"
);
}
var
result
=
reportGlobalService
.
SaveReportPersonTag
(
hospitalId
,
allotId
,
request
);
if
(
result
!=
null
&&
result
.
Any
())
return
new
ApiResponse
(
ResponseType
.
Fail
,
$"保存失败:工号
{
string
.
Join
(
", "
,
result
)}
不存在"
);
return
new
ApiResponse
(
ResponseType
.
OK
);
return
reportGlobalService
.
SaveReportPersonTag
(
hospitalId
,
allotId
,
claimService
.
GetUserId
(),
request
);
}
/// <summary>
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
e7a7edb4
...
...
@@ -804,12 +804,11 @@
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.BatchCheckAccounting(System.Int32
,Performance.DtoModels.SaveCollectData
)"
>
<member
name=
"M:Performance.Api.Controllers.ConfigController.BatchCheckAccounting(System.Int32)"
>
<summary>
核算单元及组别批量添加
</summary>
<param
name=
"allotId"
></param>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.BatchSaveAccounting(System.Int32,Performance.DtoModels.SaveCollectData)"
>
...
...
@@ -1602,6 +1601,13 @@
<param
name=
"employeeId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.PersonController.DeleteAllPerson(System.Int32)"
>
<summary>
删除所有员工
</summary>
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.PersonController.DownloadCurrentCalculationTable(System.Int32)"
>
<summary>
下载当前测算表
...
...
performance/Performance.Services/PersonService.cs
View file @
e7a7edb4
...
...
@@ -1253,23 +1253,19 @@ public bool ReloadPersonnel(int hospitalId, int allotId)
/// <summary>
/// 保存绩效查询角色的用户细信息信息
/// </summary>
public
void
SaveQueryRole
(
int
hospitalId
,
SaveCollectData
request
)
public
void
SaveQueryRole
(
int
hospitalId
,
int
userId
,
List
<
Dictionary
<
string
,
string
>>
dicData
)
{
var
dict
=
new
Dictionary
<
string
,
string
>();
if
(!
PersonPassword
.
Any
(
t
=>
t
.
Item1
==
nameof
(
PersonePassword
.
Password
)))
PersonPassword
.
Add
((
nameof
(
PersonePassword
.
Password
),
"密码"
,
t
=>
t
.
Password
));
PersonPassword
.
ForEach
(
t
=>
dict
.
Add
(
t
.
Item1
,
t
.
Item2
));
var
hospital
=
perforHospitalRepository
.
GetEntity
(
t
=>
t
.
ID
==
hospitalId
);
if
(
hospital
.
IsOwnerQuery
!=
1
)
return
;
var
dicData
=
CreateDataRow
(
request
,
dict
);
var
usercollor
=
new
UserCollectData
{
HospitalId
=
hospital
.
ID
,
CreateUser
=
request
.
CreateUser
,
ColHeaders
=
UserService
.
Users
.
Values
.
ToArray
(),
CreateUser
=
userId
,
ColHeaders
=
UserService
.
Users
.
Values
.
ToArray
()
};
var
role
=
perforRoleRepository
.
GetEntity
(
t
=>
t
.
RoleName
==
"绩效查询"
);
if
(
role
==
null
)
return
;
var
userRole
=
perforUserroleRepository
.
GetEntities
(
t
=>
t
.
RoleID
==
role
.
ID
)?.
Select
(
t
=>
t
.
UserID
);
...
...
performance/Performance.Services/ReportGlobalService.cs
View file @
e7a7edb4
...
...
@@ -624,7 +624,7 @@ select new
return
result
;
}
public
List
<
string
>
SaveReportPersonTag
(
int
hospitalId
,
int
allot
Id
,
SaveCollectData
request
)
public
ApiResponse
SaveReportPersonTag
(
int
hospitalId
,
int
allotId
,
int
user
Id
,
SaveCollectData
request
)
{
var
employees
=
perforPeremployeeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
if
(
employees
==
null
||
!
employees
.
Any
())
throw
new
PerformanceException
(
"人员字典中未保存数据"
);
...
...
@@ -632,29 +632,55 @@ public List<string> SaveReportPersonTag(int hospitalId, int allotId, SaveCollect
var
dicData
=
CreateDataRow
(
hospitalId
,
request
,
PersonTag
);
var
tags
=
reportperformancepersontagsRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
);
//工号不存在
List
<
string
>
personnelNumber
=
dicData
.
Select
(
item
=>
item
[
"PersonnelNumber"
])?.
ToList
();
var
notIn
=
personnelNumber
.
Except
(
employees
.
Select
(
t
=>
t
.
PersonnelNumber
).
ToList
())?.
ToList
();
if
(
notIn
!=
null
&&
notIn
.
Count
>
0
)
return
notIn
;
var
upEmployees
=
new
List
<
per_employee
>();
var
newTags
=
new
List
<
report_performance_person_tags
>();
var
upTags
=
new
List
<
report_performance_person_tags
>();
List
<
Dictionary
<
string
,
string
>>
error
=
new
List
<
Dictionary
<
string
,
string
>>();
int
index
=
0
;
foreach
(
var
item
in
dicData
)
{
index
++;
if
(!
item
.
ContainsKey
(
"PersonnelNumber"
)
||
string
.
IsNullOrEmpty
(
item
[
"PersonnelNumber"
]))
continue
;
var
employee
=
employees
.
FirstOrDefault
(
t
=>
t
.
PersonnelNumber
==
item
[
"PersonnelNumber"
]);
if
(
employee
==
null
)
continue
;
if
(
employee
==
null
)
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"行号"
,
$"第
{
index
}
行"
},
{
"人员工号"
,
item
[
"PersonnelNumber"
]
},
{
"姓名"
,
item
[
"DoctorName"
]
},
{
"来源"
,
"人员标签配置"
},
{
"错误原因"
,
"“人员工号不存在”请删除"
},
});
continue
;
}
else
if
(
item
[
"DoctorName"
]
!=
employee
.
DoctorName
)
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"行号"
,
$"第
{
index
}
行"
},
{
"人员工号"
,
item
[
"PersonnelNumber"
]
},
{
"姓名"
,
item
[
"DoctorName"
]
},
{
"来源"
,
"人员标签配置"
},
{
"错误原因"
,
"“姓名与字典不一致”请修改"
},
});
continue
;
}
if
(!
item
.
ContainsKey
(
nameof
(
per_employee
.
AccountingUnit
)))
item
.
Add
(
nameof
(
per_employee
.
AccountingUnit
),
employee
.
AccountingUnit
);
else
item
[
nameof
(
per_employee
.
AccountingUnit
)]
=
employee
.
AccountingUnit
;
var
json
=
JsonHelper
.
Serialize
(
item
);
#
region
人员字典表
var
pdata
=
JsonHelper
.
Deserialize
<
per_employee
>(
json
);
employee
.
PersonnelNumber
=
pdata
.
PersonnelNumber
;
employee
.
DoctorName
=
pdata
.
DoctorName
;
//
employee.PersonnelNumber = pdata.PersonnelNumber;
//
employee.DoctorName = pdata.DoctorName;
employee
.
JobCategory
=
pdata
.
JobCategory
;
employee
.
Duty
=
pdata
.
Duty
;
employee
.
JobTitle
=
pdata
.
JobTitle
;
...
...
@@ -691,6 +717,9 @@ public List<string> SaveReportPersonTag(int hospitalId, int allotId, SaveCollect
#
endregion
}
if
(
error
.
Count
>
0
)
return
new
ApiResponse
(
ResponseType
.
WarningTable
,
"验证不通过,当前操作已拒绝"
,
error
);
if
(
upEmployees
!=
null
&&
upEmployees
.
Any
())
perforPeremployeeRepository
.
UpdateRange
(
upEmployees
.
ToArray
());
if
(
newTags
!=
null
&&
newTags
.
Any
())
...
...
@@ -698,8 +727,8 @@ public List<string> SaveReportPersonTag(int hospitalId, int allotId, SaveCollect
if
(
upTags
!=
null
&&
upTags
.
Any
())
reportperformancepersontagsRepository
.
UpdateRange
(
upTags
.
ToArray
());
//个人绩效查询用户添加
personService
.
SaveQueryRole
(
hospitalId
,
request
);
return
new
List
<
string
>(
);
personService
.
SaveQueryRole
(
hospitalId
,
userId
,
dicData
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
public
HandsonTable
GetReportTag
(
int
hospitalId
)
...
...
performance/Performance.Services/UserService.cs
View file @
e7a7edb4
...
...
@@ -764,10 +764,7 @@ public string SaveUserHandsFlat(UserCollectData request)
var
getUsers
=
_userRepository
.
GetEntities
();
var
roles
=
_roleRepository
.
GetEntities
();
var
hospitals
=
_hospitalRepository
.
GetEntities
();
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
>();
...
...
@@ -780,7 +777,7 @@ public string SaveUserHandsFlat(UserCollectData request)
Dictionary
<
string
,
List
<
string
>>
res
=
new
Dictionary
<
string
,
List
<
string
>>();
foreach
(
var
item
in
names
)
{
if
(
item
==
null
)
return
"必填项为空"
;
if
(
string
.
IsNullOrEmpty
(
item
)
)
return
"必填项为空"
;
var
HospitalId
=
hospitals
.
FirstOrDefault
(
w
=>
w
.
HosName
==
item
)?.
ID
;
if
(
HospitalId
==
null
)
return
"未找到分配医院"
;
...
...
@@ -792,14 +789,16 @@ public string SaveUserHandsFlat(UserCollectData request)
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
(
string
.
IsNullOrEmpty
(
data
.
Login
)
||
string
.
IsNullOrEmpty
(
data
.
RealName
)
||
string
.
IsNullOrEmpty
(
data
.
RoleName
)
||
string
.
IsNullOrEmpty
(
data
.
HosName
))
return
"必填项为空"
;
if
(
roleArr
.
Contains
(
data
.
RoleName
)
&&
res
[
data
.
HosName
]
!=
null
&&
!
res
[
data
.
HosName
].
Any
(
t
=>
t
==
data
.
Department
))
if
(
roleArr
.
Contains
(
data
.
RoleName
)
&&
res
!=
null
&&
res
[
data
.
HosName
]
!=
null
&&
!
res
[
data
.
HosName
].
Any
(
t
=>
t
==
data
.
Department
))
return
"核算单元填写错误"
;
if
(
users
.
Any
(
c
=>
c
.
Login
==
data
?.
Login
)
&&
!
string
.
IsNullOrEmpty
(
data
.
Login
)
||
getUsers
.
Any
(
c
=>
c
.
Login
==
data
?.
Login
))
continue
;
var
user
=
new
sys_user
{
RealName
=
data
.
RealName
,
...
...
@@ -814,25 +813,13 @@ public string SaveUserHandsFlat(UserCollectData request)
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
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
...
...
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