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
43238061
Commit
43238061
authored
Apr 25, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
兼容二次分配开始报表数据
parent
913f7556
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
189 additions
and
117 deletions
+189
-117
performance/Performance.Api/Controllers/AttendanceController.cs
+1
-2
performance/Performance.Api/Controllers/PersonController.cs
+1
-1
performance/Performance.Api/wwwroot/Performance.Api.xml
+1
-16
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+19
-34
performance/Performance.EntityModels/Entity/Sys_User.cs
+8
-0
performance/Performance.EntityModels/Entity/ag_secondallot.cs
+15
-5
performance/Performance.EntityModels/Enum.cs
+2
-2
performance/Performance.EntityModels/Other/UserInfoCenter.cs
+2
-0
performance/Performance.Infrastructure/Extensions/Extensions.Enumerable.cs
+16
-0
performance/Performance.Repository/PerforAgsecondallotRepository.cs
+26
-0
performance/Performance.Repository/PerforUserRepository.cs
+3
-0
performance/Performance.Services/AllotCompute/ProcessComputService.cs
+2
-2
performance/Performance.Services/AllotService.cs
+2
-2
performance/Performance.Services/ComputeService.cs
+2
-2
performance/Performance.Services/CostTransfer/CostTransferService.cs
+2
-1
performance/Performance.Services/CustomExtractService.cs
+2
-2
performance/Performance.Services/PerExcelService/SheetDataCompute/PerSheetDataComputeWorkload.cs
+1
-1
performance/Performance.Services/PersonService.cs
+41
-19
performance/Performance.Services/ReportDataService.cs
+1
-8
performance/Performance.Services/SecondAllotService.cs
+40
-15
performance/Performance.Services/UnitTypeUtil.cs
+2
-5
performance/Performance.Services/UserService.cs
+0
-0
No files found.
performance/Performance.Api/Controllers/AttendanceController.cs
View file @
43238061
...
...
@@ -148,9 +148,8 @@ public ApiResponse GetAttendanceVacationHandsonTable(int allotId)
/// 查询考勤记录
/// </summary>
/// <param name="allotId"></param>
/// <param name="hospitalId"></param>
/// <returns></returns>
[
HttpGet
(
"Vacation/{allotId}
,{hospitalId}
"
)]
[
HttpGet
(
"Vacation/{allotId}"
)]
public
ApiResponse
<
List
<
RecordAttendcance
>>
GetAttendanceVacation
(
int
allotId
)
{
return
_attendanceService
.
GetAttendanceVacation
(
allotId
);
...
...
performance/Performance.Api/Controllers/PersonController.cs
View file @
43238061
...
...
@@ -191,7 +191,7 @@ public ApiResponse DeleteDeptDic([FromBody] DeptdicResponse request)
/// <summary>
/// 系统/标准科室字典
/// </summary>
/// <param name="
hospitalId">医院
Id</param>
/// <param name="
allotId">allot
Id</param>
/// <param name="type">1系统科室 2标准科室 3核算单元 4行政后勤 5特殊核算组</param>
/// <returns></returns>
[
Route
(
"deptdic/{allotId}/dict/{type}"
)]
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
43238061
...
...
@@ -128,20 +128,6 @@
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AccountController.HistoryDepartment(System.Int32)"
>
<summary>
用户过往科室
</summary>
<param
name=
"userId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AccountController.DeleteHistoryDepartment(System.Int32)"
>
<summary>
删除用户过往科室
</summary>
<param
name=
"historyId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AllotController.List(Performance.DtoModels.AllotRequest)"
>
<summary>
绩效列表
...
...
@@ -352,7 +338,6 @@
查询考勤记录
</summary>
<param
name=
"allotId"
></param>
<param
name=
"hospitalId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.AttendanceBatch(System.Int32,System.Int32,Performance.DtoModels.SaveCollectData)"
>
...
...
@@ -1752,7 +1737,7 @@
<summary>
系统/标准科室字典
</summary>
<param
name=
"
hospitalId"
>
医院
Id
</param>
<param
name=
"
allotId"
>
allot
Id
</param>
<param
name=
"type"
>
1系统科室 2标准科室 3核算单元 4行政后勤 5特殊核算组
</param>
<returns></returns>
</member>
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
43238061
...
...
@@ -1085,6 +1085,21 @@
科室类型
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_secondallot.Department"
>
<summary>
科室
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_secondallot.NewUnitType"
>
<summary>
变更核算组别
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_secondallot.NewAccountingUnit"
>
<summary>
变更核算单元
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_secondallot.Year"
>
<summary>
年
...
...
@@ -1095,11 +1110,6 @@
月
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_secondallot.Department"
>
<summary>
科室
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_secondallot.RealGiveFee"
>
<summary>
科室实发金额
...
...
@@ -8655,39 +8665,14 @@
父级ID
</summary>
</member>
<member
name=
"
T:Performance.EntityModels.sys_user_history
"
>
<member
name=
"
P:Performance.EntityModels.sys_user.UnitType
"
>
<summary>
用户角色关联表
</summary>
</member>
<member
name=
"P:Performance.EntityModels.sys_user_history.UserID"
>
<summary>
用户ID
</summary>
</member>
<member
name=
"P:Performance.EntityModels.sys_user_history.RoleID"
>
<summary>
角色ID
</summary>
</member>
<member
name=
"P:Performance.EntityModels.sys_user_history.RoleType"
>
<summary>
角色类型
</summary>
</member>
<member
name=
"P:Performance.EntityModels.sys_user_history.RoleName"
>
<summary>
角色名称
</summary>
</member>
<member
name=
"P:Performance.EntityModels.sys_user_history.Department"
>
<summary>
科室名称
核算组别
</summary>
</member>
<member
name=
"P:Performance.EntityModels.sys_user
_history.CreateDat
e"
>
<member
name=
"P:Performance.EntityModels.sys_user
.UnitCod
e"
>
<summary>
核算
单元变更时间
核算
序号
</summary>
</member>
<member
name=
"T:Performance.EntityModels.sys_user_hospital"
>
...
...
performance/Performance.EntityModels/Entity/Sys_User.cs
View file @
43238061
...
...
@@ -75,5 +75,13 @@ public class sys_user
/// 父级ID
/// </summary>
public
Nullable
<
int
>
ParentID
{
get
;
set
;
}
/// <summary>
/// 核算组别
/// </summary>
public
string
UnitType
{
get
;
set
;
}
/// <summary>
/// 核算序号
/// </summary>
public
string
UnitCode
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Entity/ag_secondallot.cs
View file @
43238061
...
...
@@ -34,6 +34,21 @@ public class ag_secondallot
public
string
UnitType
{
get
;
set
;
}
/// <summary>
/// 科室
/// </summary>
public
string
Department
{
get
;
set
;
}
/// <summary>
/// 变更核算组别
/// </summary>
public
string
NewUnitType
{
get
;
set
;
}
/// <summary>
/// 变更核算单元
/// </summary>
public
string
NewAccountingUnit
{
get
;
set
;
}
/// <summary>
/// 年
/// </summary>
public
Nullable
<
int
>
Year
{
get
;
set
;
}
...
...
@@ -44,11 +59,6 @@ public class ag_secondallot
public
Nullable
<
int
>
Month
{
get
;
set
;
}
/// <summary>
/// 科室
/// </summary>
public
string
Department
{
get
;
set
;
}
/// <summary>
/// 科室实发金额
/// </summary>
public
Nullable
<
decimal
>
RealGiveFee
{
get
;
set
;
}
...
...
performance/Performance.EntityModels/Enum.cs
View file @
43238061
...
...
@@ -66,8 +66,8 @@ public enum UnitType
[
Description
(
"医技组"
)]
医技组
=
3
,
[
Description
(
"专家组"
)]
专家组
=
4
,
//
[Description("专家组")]
//
专家组 = 4,
//[Description("其他")]
//其他 = 5,
...
...
performance/Performance.EntityModels/Other/UserInfoCenter.cs
View file @
43238061
...
...
@@ -8,4 +8,6 @@ public class UserInfoCenter
public
sys_role
URole
{
get
;
set
;
}
public
List
<
sys_hospital
>
Hospitals
{
get
;
set
;
}
public
List
<
int
>
HospitalIds
=>
Hospitals
?.
Select
(
w
=>
w
.
ID
).
ToList
()
??
new
List
<
int
>();
public
bool
IsSecondAdmin
{
get
;
set
;
}
}
performance/Performance.Infrastructure/Extensions/Extensions.Enumerable.cs
0 → 100644
View file @
43238061
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
namespace
Performance.Infrastructure
{
public
static
partial
class
UtilExtensions
{
public
static
bool
NotNullOrEmpty
<
T
>(
this
IEnumerable
<
T
>
enumerable
)
{
return
enumerable
!=
null
&&
enumerable
.
Any
();
}
}
}
performance/Performance.Repository/PerforAgsecondallotRepository.cs
View file @
43238061
...
...
@@ -6,6 +6,32 @@ namespace Performance.Repository
{
public
partial
class
PerforAgsecondallotRepository
:
PerforRepository
<
ag_secondallot
>
{
public
IQueryable
<
ag_secondallot
>
GetSeconds
(
int
[]
hospitalIds
,
string
[]
unitType
,
string
accountingUnit
)
{
var
secondallots
=
from
ag
in
context
.
Set
<
ag_secondallot
>()
join
at
in
context
.
Set
<
per_allot
>()
on
ag
.
AllotId
equals
at
.
ID
where
hospitalIds
.
Contains
(
at
.
HospitalId
)
select
ag
;
return
secondallots
.
Where
(
w
=>
(
unitType
.
Contains
(
w
.
UnitType
)
&&
w
.
Department
==
accountingUnit
)
||
unitType
.
Contains
(
w
.
NewUnitType
)
&&
w
.
NewAccountingUnit
==
accountingUnit
);
}
public
IQueryable
<
ag_secondallot
>
Get
(
int
allotId
,
string
[]
unitType
,
string
accountingUnit
,
params
int
[]
status
)
{
var
secondallots
=
from
ag
in
context
.
Set
<
ag_secondallot
>()
where
ag
.
AllotId
==
allotId
select
ag
;
secondallots
=
secondallots
.
Where
(
w
=>
(
unitType
.
Contains
(
w
.
UnitType
)
&&
w
.
Department
==
accountingUnit
)
||
unitType
.
Contains
(
w
.
NewUnitType
)
&&
w
.
NewAccountingUnit
==
accountingUnit
);
if
(
status
.
Any
())
return
secondallots
.
Where
(
w
=>
w
.
Status
.
HasValue
&&
status
.
Contains
(
w
.
Status
.
Value
));
return
secondallots
;
}
/// <summary>
/// 删除已提交的历史记录(ag_compute)
/// </summary>
...
...
performance/Performance.Repository/PerforUserRepository.cs
View file @
43238061
...
...
@@ -29,11 +29,14 @@ public UserInfoCenter GetUser(int userId)
where
uh
.
UserID
==
user
.
ID
select
h
;
var
roleTypes
=
new
int
[]
{
(
int
)
Role
.
科主任
,
(
int
)
Role
.
护士长
,
(
int
)
Role
.
特殊科室
,
(
int
)
Role
.
行政科室
,
};
return
new
UserInfoCenter
{
User
=
user
,
URole
=
roles
.
FirstOrDefault
()
??
new
sys_role
(),
Hospitals
=
hospitals
.
ToList
()
??
new
List
<
sys_hospital
>(),
IsSecondAdmin
=
roleTypes
.
Contains
(
roles
.
FirstOrDefault
()?.
Type
??
0
),
};
}
...
...
performance/Performance.Services/AllotCompute/ProcessComputService.cs
View file @
43238061
...
...
@@ -276,7 +276,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, per_allot
var
pairs
=
new
[]
{
new
{
Name
=
"医生组临床科室单元核算表"
,
Data
=
doctorWorkloadData
,
SheetType
=
SheetType
.
ComputeDoctorAccount
,
UnitTypes
=
new
List
<
UnitType
>
{
UnitType
.
医生组
,
UnitType
.
医技组
,
UnitType
.
专家组
,
UnitType
.
其他医技组
,
UnitType
.
其他医生组
}
},
UnitTypes
=
new
List
<
UnitType
>
{
UnitType
.
医生组
,
UnitType
.
医技组
,
UnitType
.
其他医技组
,
UnitType
.
其他医生组
}
},
new
{
Name
=
"护理组临床科室单元核算表"
,
Data
=
nurseWorkloadData
,
SheetType
=
SheetType
.
ComputeNurseAccount
,
UnitTypes
=
new
List
<
UnitType
>
{
UnitType
.
护理组
,
UnitType
.
其他护理组
}
},
};
...
...
@@ -298,7 +298,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, per_allot
var
econDoctor
=
economicData
?.
FirstOrDefault
(
t
=>
t
.
UnitType
==
unitType
.
ToString
()
&&
t
.
AccountingUnit
==
dept
.
AccountingUnit
);
var
workDoctor
=
info
.
Data
.
FirstOrDefault
(
t
=>
t
.
UnitType
==
unitType
.
ToString
()
&&
t
.
AccountingUnit
==
dept
.
AccountingUnit
);
if
(
UnitType
.
专家组
==
unitType
||
UnitType
.
其他医技组
==
unitType
||
UnitType
.
其他医生组
==
unitType
||
UnitType
.
其他护理组
==
unitType
)
if
(
UnitType
.
其他医技组
==
unitType
||
UnitType
.
其他医生组
==
unitType
||
UnitType
.
其他护理组
==
unitType
)
{
econDoctor
=
economicData
?.
FirstOrDefault
(
t
=>
t
.
AccountingUnit
==
dept
.
AccountingUnit
);
workDoctor
=
info
.
Data
.
FirstOrDefault
(
t
=>
t
.
AccountingUnit
==
dept
.
AccountingUnit
);
...
...
performance/Performance.Services/AllotService.cs
View file @
43238061
...
...
@@ -696,10 +696,10 @@ public List<EmployeeReservedDto> GetReserved(int hospitalId, int year, int useri
if
(
reserveds
!=
null
&&
reserveds
.
Any
())
{
var
unitTpes
=
UnitTypeUtil
.
GetMaps
(
userInfo
?.
URole
.
Type
);
Expression
<
Func
<
EmployeeReservedDto
,
bool
>>
exp
=
w
=>
w
.
AccountingUnit
==
userInfo
.
User
.
Department
;
if
(
userInfo
.
URole
.
Type
.
HasValue
&&
UnitTypeUtil
.
Maps
.
ContainsKey
(
userInfo
.
URole
.
Type
.
Value
))
exp
=
exp
.
And
(
t
=>
UnitTypeUtil
.
Maps
[
userInfo
.
URole
.
Type
.
Value
]
.
Contains
(
t
.
UnitType
));
exp
=
exp
.
And
(
t
=>
unitTpes
.
Contains
(
t
.
UnitType
));
reserveds
=
reserveds
.
Where
(
exp
.
Compile
())?.
ToList
();
}
...
...
performance/Performance.Services/ComputeService.cs
View file @
43238061
...
...
@@ -309,7 +309,7 @@ public List<DeptResponse> GetNursePerformance(int allotId)
/// <returns></returns>
public
List
<
DeptResponse
>
GetOtherPerformance
(
int
allotId
)
{
return
GetGroupPerformance
(
allotId
,
new
List
<
int
>
{
(
int
)
UnitType
.
其他医技组
,
(
int
)
UnitType
.
其他医生组
,
(
int
)
UnitType
.
其他护理组
,
(
int
)
UnitType
.
专家组
});
return
GetGroupPerformance
(
allotId
,
new
List
<
int
>
{
(
int
)
UnitType
.
其他医技组
,
(
int
)
UnitType
.
其他医生组
,
(
int
)
UnitType
.
其他护理组
});
}
public
List
<
DeptResponse
>
GetGroupPerformance
(
int
allotId
,
List
<
int
>
group
)
{
...
...
@@ -1512,7 +1512,7 @@ private UnitType TypeConversion(int? unitType)
{
UnitType
type
=
(
UnitType
)
unitType
.
Value
;
var
docUnitTypes
=
new
List
<
UnitType
>
{
UnitType
.
专家组
,
UnitType
.
其他医生组
,
UnitType
.
其他医技组
};
var
docUnitTypes
=
new
List
<
UnitType
>
{
UnitType
.
其他医生组
,
UnitType
.
其他医技组
};
if
(
docUnitTypes
.
Contains
(
type
))
type
=
UnitType
.
医生组
;
else
if
(
type
==
UnitType
.
其他护理组
)
...
...
performance/Performance.Services/CostTransfer/CostTransferService.cs
View file @
43238061
...
...
@@ -148,10 +148,11 @@ public List<CostTransferResponse> GetAuditList(int allotId, int menuType, int ro
public
cof_accounting
GetAccounting
(
int
allotId
,
int
roleType
,
string
Department
=
null
)
{
var
unitTpes
=
UnitTypeUtil
.
GetMaps
(
roleType
);
Expression
<
Func
<
cof_accounting
,
bool
>>
exp
=
t
=>
t
.
AllotId
==
allotId
&&
t
.
AccountingUnit
==
Department
;
if
(
UnitTypeUtil
.
Maps
.
ContainsKey
(
roleType
))
exp
=
exp
.
And
(
t
=>
UnitTypeUtil
.
Maps
[
roleType
]
.
Contains
(
t
.
UnitType
));
exp
=
exp
.
And
(
t
=>
unitTpes
.
Contains
(
t
.
UnitType
));
var
account
=
cofaccountingRepository
.
GetEntity
(
exp
);
...
...
performance/Performance.Services/CustomExtractService.cs
View file @
43238061
...
...
@@ -139,9 +139,9 @@ private void WriteDataToFile(int userId, per_allot allot, List<cust_script> scri
var
parameters
=
GetParameters
(
allot
);
var
center
=
_userRepository
.
GetUser
(
userId
);
var
isSecondAdmin
=
UnitTypeUtil
.
Maps
.
ContainsKey
(
center
?.
URole
.
Type
??
0
)
;
var
isSecondAdmin
=
center
.
IsSecondAdmin
;
var
department
=
isSecondAdmin
?
(
center
?.
User
.
Department
??
""
)
:
string
.
Empty
;
var
unitType
=
UnitTypeUtil
.
Maps
[
center
?.
URole
.
Type
??
0
]
;
var
unitType
=
UnitTypeUtil
.
GetMaps
(
center
?.
URole
.
Type
??
0
)
;
parameters
.
Add
(
"@department"
,
$"'
{
department
}
'"
);
if
(
unitType
!=
null
&&
unitType
.
Any
())
...
...
performance/Performance.Services/PerExcelService/SheetDataCompute/PerSheetDataComputeWorkload.cs
View file @
43238061
...
...
@@ -145,7 +145,7 @@ public PerSheet OnceCompute(PerSheet sheet, List<CofDrugProp> confs = null)
IEnumerable
<
cof_workitem
>
workitems
,
IEnumerable
<
CofDrugProp
>
medicineProps
,
IEnumerable
<
CofDrugProp
>
cmis
,
IEnumerable
<
CofDrugProp
>
inclines
,
bool
isDoctor
=
false
)
{
var
unittype
=
isDoctor
?
new
List
<
string
>
{
UnitType
.
医生组
.
ToString
(),
UnitType
.
医技组
.
ToString
(),
UnitType
.
专家组
.
ToString
(),
UnitType
.
其他医生组
.
ToString
(),
UnitType
.
其他医技组
.
ToString
(),
UnitType
.
特殊核算组
.
ToString
()
}
?
new
List
<
string
>
{
UnitType
.
医生组
.
ToString
(),
UnitType
.
医技组
.
ToString
(),
UnitType
.
其他医生组
.
ToString
(),
UnitType
.
其他医技组
.
ToString
(),
UnitType
.
特殊核算组
.
ToString
()
}
:
new
List
<
string
>
{
UnitType
.
护理组
.
ToString
(),
UnitType
.
其他护理组
.
ToString
()
};
if
((
medicineProps
==
null
&&
cmis
==
null
&&
inclines
==
null
)
||
workitems
==
null
)
...
...
performance/Performance.Services/PersonService.cs
View file @
43238061
...
...
@@ -191,7 +191,7 @@ public List<per_employee> GetPersons(int allotId, int userId)
var
userInfo
=
perforUserRepository
.
GetUser
(
userId
);
var
dept
=
userInfo
?.
User
.
Department
??
""
;
var
unittype
=
(
userInfo
!=
null
&&
userInfo
.
URole
.
Type
.
HasValue
&&
UnitTypeUtil
.
Maps
.
ContainsKey
(
userInfo
.
URole
.
Type
.
Value
))
?
UnitTypeUtil
.
Maps
[
userInfo
.
URole
.
Type
.
Value
]
?
UnitTypeUtil
.
GetMaps
(
userInfo
.
URole
.
Type
.
Value
)
:
new
string
[
0
];
Expression
<
Func
<
per_employee
,
bool
>>
exp
=
t
=>
t
.
AllotId
==
allotId
;
...
...
@@ -215,7 +215,7 @@ public PageList<per_employee> GetPersons(int allotId, int userId, PersonParamsRe
var
userInfo
=
perforUserRepository
.
GetUser
(
userId
);
var
dept
=
userInfo
?.
User
.
Department
??
""
;
var
unittype
=
(
userInfo
!=
null
&&
userInfo
.
URole
.
Type
.
HasValue
&&
UnitTypeUtil
.
Maps
.
ContainsKey
(
userInfo
.
URole
.
Type
.
Value
))
?
UnitTypeUtil
.
Maps
[
userInfo
.
URole
.
Type
.
Value
]
?
UnitTypeUtil
.
GetMaps
(
userInfo
.
URole
.
Type
.
Value
)
:
new
string
[
0
];
Expression
<
Func
<
per_employee
,
bool
>>
exp
=
t
=>
t
.
AllotId
==
allotId
;
...
...
@@ -647,15 +647,25 @@ public List<TitleValue> DeptDics(int allotId, int type)
/// <returns></returns>
public
object
DeptWorkloadDetail
(
WorkDetailRequest
request
,
int
userId
)
{
var
center
=
perforUserRepository
.
GetUser
(
userId
);
string
[]
unitTypes
=
UnitTypeUtil
.
Maps
[
center
?.
URole
.
Type
??
0
];
if
(
unitTypes
==
null
||
!
unitTypes
.
Any
())
return
new
string
[]
{
};
var
userInfo
=
perforUserRepository
.
GetUser
(
userId
);
if
(
userInfo
?.
User
==
null
)
throw
new
NotImplementedException
(
"当前用户不存在"
);
if
(
userInfo
.
URole
==
null
)
throw
new
NotImplementedException
(
"当前用户暂未分配角色"
);
if
(!
userInfo
.
Hospitals
.
NotNullOrEmpty
())
throw
new
NotImplementedException
(
"当前用户暂未分配医院"
);
var
allot
=
perallotRepository
.
GetEntity
(
w
=>
w
.
ID
==
request
.
AllotId
);
if
(
allot
==
null
)
return
null
;
// 查询当前角色下科室的绩效
UnitTypeUtil
.
Maps
.
TryGetValue
(
userInfo
?.
URole
.
Type
??
0
,
out
string
[]
unitTypes
);
if
(
unitTypes
==
null
||
!
unitTypes
.
Any
())
return
Enumerable
.
Empty
<
DeptIncomeResponse
>()
;
var
data
=
perallotRepository
.
QueryWorkloadData
(
request
.
AllotId
,
request
.
AccountingUnit
,
unitTypes
,
allot
.
HospitalId
);
var
accountingUnit
=
request
.
AccountingUnit
;
var
hospitalId
=
userInfo
.
HospitalIds
.
First
();
if
(
userInfo
.
IsSecondAdmin
)
{
var
secondList
=
agsecondallotRepository
.
Get
(
request
.
AllotId
,
unitTypes
,
userInfo
.
User
.
Department
);
accountingUnit
=
secondList
.
FirstOrDefault
()?.
Department
;
unitTypes
=
new
string
[]
{
secondList
.
FirstOrDefault
()?.
UnitType
};
}
var
data
=
perallotRepository
.
QueryWorkloadData
(
request
.
AllotId
,
accountingUnit
,
unitTypes
,
hospitalId
);
if
(
data
!=
null
&&
data
.
Any
())
{
return
data
.
GroupBy
(
t
=>
new
{
t
.
Department
,
t
.
DoctorName
,
t
.
PersonnelNumber
,
t
.
Category
})
...
...
@@ -677,20 +687,32 @@ public object DeptWorkloadDetail(WorkDetailRequest request, int userId)
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
object
DeptIncomeDetail
(
WorkDetailRequest
request
,
int
userId
)
public
IEnumerable
<
DeptIncomeResponse
>
DeptIncomeDetail
(
WorkDetailRequest
request
,
int
userId
)
{
var
center
=
perforUserRepository
.
GetUser
(
userId
);
string
[]
unitTypes
=
UnitTypeUtil
.
Maps
[
center
?.
URole
.
Type
??
0
];
if
(
unitTypes
==
null
||
!
unitTypes
.
Any
())
return
new
string
[]
{
};
var
userInfo
=
perforUserRepository
.
GetUser
(
userId
);
if
(
userInfo
?.
User
==
null
)
throw
new
NotImplementedException
(
"当前用户不存在"
);
if
(
userInfo
.
URole
==
null
)
throw
new
NotImplementedException
(
"当前用户暂未分配角色"
);
if
(!
userInfo
.
Hospitals
.
NotNullOrEmpty
())
throw
new
NotImplementedException
(
"当前用户暂未分配医院"
);
// 查询当前角色下科室的绩效
UnitTypeUtil
.
Maps
.
TryGetValue
(
userInfo
?.
URole
.
Type
??
0
,
out
string
[]
unitTypes
);
if
(
unitTypes
==
null
||
!
unitTypes
.
Any
())
return
Enumerable
.
Empty
<
DeptIncomeResponse
>();
var
accountingUnit
=
request
.
AccountingUnit
;
var
hospitalId
=
userInfo
.
HospitalIds
.
First
();
if
(
userInfo
.
IsSecondAdmin
)
{
var
secondList
=
agsecondallotRepository
.
Get
(
request
.
AllotId
,
unitTypes
,
userInfo
.
User
.
Department
);
accountingUnit
=
secondList
.
FirstOrDefault
()?.
Department
;
unitTypes
=
new
string
[]
{
secondList
.
FirstOrDefault
()?.
UnitType
};
}
var
allot
=
perallotRepository
.
GetEntity
(
w
=>
w
.
ID
==
request
.
AllotId
);
if
(
allot
==
null
)
return
null
;
var
sources
=
new
[]
{
"门诊"
,
"住院"
};
if
(!
sources
.
Contains
(
request
.
Source
))
throw
new
PerformanceException
(
$"数据来源错误,只支持:
{
string
.
Join
(
";"
,
sources
)}
"
);
var
data
=
perallotRepository
.
QueryIncomeData
(
request
.
AllotId
,
request
.
Source
,
request
.
AccountingUnit
,
unitTypes
,
allot
.
H
ospitalId
);
var
data
=
perallotRepository
.
QueryIncomeData
(
request
.
AllotId
,
request
.
Source
,
accountingUnit
,
unitTypes
,
h
ospitalId
);
if
(
data
!=
null
&&
data
.
Any
())
{
return
data
.
GroupBy
(
t
=>
new
{
t
.
Department
,
t
.
DoctorName
,
t
.
PersonnelNumber
,
t
.
Category
})
...
...
@@ -704,7 +726,7 @@ public object DeptIncomeDetail(WorkDetailRequest request, int userId)
}).
OrderBy
(
t
=>
t
.
PersonnelNumber
).
ThenBy
(
t
=>
t
.
Category
);
}
return
new
string
[]
{
}
;
return
Enumerable
.
Empty
<
DeptIncomeResponse
>()
;
}
...
...
@@ -715,7 +737,7 @@ public HandsonTable GetBatchPersonStructrue(int allotId)
var
result
=
new
HandsonTable
((
int
)
SheetType
.
Unidentifiable
,
cols
,
permissions
);
var
deptdics
=
perdeptdicRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
var
ss
=
deptdics
?.
Where
(
t
=>
!
new
string
[]
{
UnitType
.
专家组
.
ToString
()
}.
Contains
(
t
.
UnitType
));
var
ss
=
deptdics
?.
Where
(
t
=>
!
new
string
[]
{
"专家组"
}.
Contains
(
t
.
UnitType
));
if
(
result
.
Columns
!=
null
&&
result
.
Columns
.
Any
())
{
var
columns
=
new
[]
{
"核算单元"
,
"科室名称"
,
"姓名"
,
"员工工号"
,
"银行卡号"
};
...
...
performance/Performance.Services/ReportDataService.cs
View file @
43238061
...
...
@@ -138,7 +138,7 @@ public List<ReportData> GetReportData(int hospitalId, int groupId, int reportId,
??
new
List
<
rep_selection
>();
var
userInfo
=
userRepository
.
GetUser
(
userId
);
var
isMedical
=
(
userInfo
!=
null
&&
userInfo
.
URole
.
Type
.
HasValue
&&
UnitTypeUtil
.
Maps
.
ContainsKey
(
userInfo
.
URole
.
Type
.
Value
))
;
var
isMedical
=
userInfo
.
IsSecondAdmin
;
var
department
=
userInfo
?.
User
.
Department
??
""
;
List
<
ReportData
>
result
=
new
List
<
ReportData
>();
...
...
@@ -359,13 +359,6 @@ private string ReplacePlaceholder(List<rep_selection> selections, List<Selection
}
return
content
;
}
private
string
GetUserDepartment
(
int
userId
)
{
var
user
=
userRepository
.
GetEntity
(
t
=>
t
.
ID
==
userId
);
return
user
.
Department
;
}
}
...
...
performance/Performance.Services/SecondAllotService.cs
View file @
43238061
...
...
@@ -120,6 +120,22 @@ ComputeService computeService
}
#
region
二次绩效列表与数据保存
//public List<ag_secondallot> GetSeconds(int userId)
//{
// var userInfo = userRepository.GetUser(userId);
// if (userInfo?.User == null) throw new NotImplementedException("当前用户不存在");
// if (userInfo?.URole == null) throw new NotImplementedException("当前用户暂未分配角色");
// if (userInfo?.Hospitals == null) throw new NotImplementedException("当前用户暂未分配医院");
// // 查询当前角色下科室的绩效
// UnitTypeUtil.Maps.TryGetValue(userInfo?.URole.Type ?? 0, out string[] unitType);
// var secondList = agsecondallotRepository.Get(userInfo.HospitalIds.ToArray(), unitType, userInfo.User.Department);
//}
/// <summary>
/// 获取二次绩效列表
...
...
@@ -146,13 +162,10 @@ public List<SecondListResponse> GetSecondList(int userId)
var
secondList
=
agsecondallotRepository
.
GetEntities
(
t
=>
allotListId
.
Contains
(
t
.
AllotId
.
Value
)
&&
unitType
.
Contains
(
t
.
UnitType
)
&&
t
.
Department
==
userInfo
.
User
.
Department
);
// 查询过往科室的绩效
foreach
(
var
item
in
userInfo
.
Historys
)
{
UnitTypeUtil
.
Maps
.
TryGetValue
(
item
.
RoleType
??
0
,
out
string
[]
histroyUnitType
);
var
histroys
=
agsecondallotRepository
.
GetEntities
(
t
=>
allotListId
.
Contains
(
t
.
AllotId
.
Value
)
&&
histroyUnitType
.
Contains
(
t
.
UnitType
)
&&
t
.
Department
==
item
.
Department
);
var
histroys
=
agsecondallotRepository
.
GetEntities
(
t
=>
allotListId
.
Contains
(
t
.
AllotId
.
Value
)
&&
unitType
.
Contains
(
t
.
NewUnitType
)
&&
t
.
NewAccountingUnit
==
userInfo
.
User
.
Department
);
if
(
histroys
!=
null
&&
histroys
.
Any
())
secondList
.
AddRange
(
histroys
.
ToArray
());
}
var
list
=
_mapper
.
Map
<
List
<
SecondListResponse
>>(
secondList
);
// 二次分配只支持单医院
...
...
@@ -866,10 +879,11 @@ public List<SecondTempResponse> GetTemp(int hospitalid, string department, int u
if
(
temps
!=
null
&&
temps
.
Any
())
{
var
userCenter
=
userRepository
.
GetUser
(
userId
);
var
unitType
=
UnitTypeUtil
.
GetMaps
(
userCenter
?.
URole
.
Type
??
0
);
Expression
<
Func
<
ag_usetemp
,
bool
>>
exp
=
t
=>
t
.
HospitalId
==
hospitalid
&&
t
.
Department
==
department
;
if
(
userCenter
?.
URole
!=
null
&&
userCenter
.
URole
.
Type
.
HasValue
)
exp
=
exp
.
And
(
t
=>
UnitTypeUtil
.
Maps
[
userCenter
.
URole
.
Type
.
Value
]
.
Contains
(
t
.
UnitType
));
exp
=
exp
.
And
(
t
=>
unitType
.
Contains
(
t
.
UnitType
));
var
useTemp
=
agusetempRepository
.
GetEntity
(
exp
);
var
secondTemps
=
_mapper
.
Map
<
List
<
SecondTempResponse
>>(
temps
);
...
...
@@ -1581,10 +1595,10 @@ public bool AuditSubmit(ag_secondallot second, int userId)
throw
new
PerformanceException
(
"二次绩效无效!"
);
var
userCenter
=
userRepository
.
GetUser
(
userId
);
var
unitType
=
UnitTypeUtil
.
GetMaps
(
userCenter
?.
URole
.
Type
??
0
);
Expression
<
Func
<
ag_usetemp
,
bool
>>
exp
=
t
=>
t
.
HospitalId
==
allot
.
HospitalId
&&
t
.
Department
==
second
.
Department
;
if
(
userCenter
?.
URole
!=
null
&&
userCenter
.
URole
.
Type
.
HasValue
)
exp
=
exp
.
And
(
t
=>
UnitTypeUtil
.
Maps
[
userCenter
.
URole
.
Type
.
Value
]
.
Contains
(
t
.
UnitType
));
exp
=
exp
.
And
(
t
=>
unitType
.
Contains
(
t
.
UnitType
));
var
temp
=
agusetempRepository
.
GetEntity
(
exp
);
if
(
temp
==
null
)
...
...
@@ -1661,7 +1675,7 @@ bool VerifySubmissioAmount(decimal? leftAmount, decimal? rightAmount)
}
}
}
logger
.
LogCritical
(
"程序虽然抛出异常但是还是执行了后续代码"
);
//
logger.LogCritical("程序虽然抛出异常但是还是执行了后续代码");
}
/// <summary>
...
...
@@ -2418,19 +2432,31 @@ public dynamic Print(int secondId)
public
List
<
DeptDataDetails
>
DeptComputeDetailList
(
int
userId
,
int
allotId
,
out
int
isShowManage
)
{
var
userCenter
=
userRepository
.
GetUser
(
userId
);
if
(
userCenter
?.
User
==
null
)
throw
new
NotImplementedException
(
"当前用户不存在"
);
var
userInfo
=
userRepository
.
GetUser
(
userId
);
if
(
userInfo
?.
User
==
null
)
throw
new
NotImplementedException
(
"当前用户不存在"
);
if
(
userInfo
.
URole
==
null
)
throw
new
NotImplementedException
(
"当前用户暂未分配角色"
);
if
(!
userInfo
.
Hospitals
.
NotNullOrEmpty
())
throw
new
NotImplementedException
(
"当前用户暂未分配医院"
);
var
deptDatas
=
new
List
<
DeptDataDetails
>();
var
allot
=
perallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
isShowManage
=
computeService
.
IsShowManage
(
allotId
);
var
allot
=
perallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
// 未下发或未归档 则不可见
var
status
=
new
int
[]
{
(
int
)
AllotStates
.
绩效下发
,
(
int
)
AllotStates
.
归档
};
if
(!
status
.
Contains
(
allot
.
States
))
return
deptDatas
;
// 查询当前角色下科室的绩效
UnitTypeUtil
.
Maps
.
TryGetValue
(
userInfo
?.
URole
.
Type
??
0
,
out
string
[]
unitTypes
);
if
(
unitTypes
==
null
||
!
unitTypes
.
Any
())
return
deptDatas
;
var
accountingUnit
=
userInfo
.
User
.
Department
;
var
hospitalId
=
userInfo
.
HospitalIds
.
First
();
if
(
userInfo
.
IsSecondAdmin
)
{
var
secondList
=
agsecondallotRepository
.
Get
(
allotId
,
unitTypes
,
userInfo
.
User
.
Department
);
accountingUnit
=
secondList
.
FirstOrDefault
()?.
Department
;
unitTypes
=
new
string
[]
{
secondList
.
FirstOrDefault
()?.
UnitType
};
}
Dictionary
<
int
,
List
<
string
>>
dict
=
new
Dictionary
<
int
,
List
<
string
>>
{
...
...
@@ -2440,9 +2466,8 @@ public List<DeptDataDetails> DeptComputeDetailList(int userId, int allotId, out
{
(
int
)
Role
.
特殊科室
,
new
List
<
string
>
{
AccountUnitType
.
科主任
.
ToString
()
,
AccountUnitType
.
护士长
.
ToString
()
}
},
};
if
(!
dict
.
Keys
.
Contains
(
userCenter
?.
URole
.
Type
??
0
))
return
new
List
<
DeptDataDetails
>();
var
computes
=
rescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
AccountingUnit
==
userCenter
.
User
.
Department
&&
dict
[
userCenter
.
URole
.
Type
.
Value
]
.
Contains
(
t
.
AccountType
));
var
computes
=
rescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
AccountingUnit
==
accountingUnit
&&
unitTypes
.
Contains
(
t
.
AccountType
));
if
(
computes
==
null
||
!
computes
.
Any
())
return
new
List
<
DeptDataDetails
>();
foreach
(
var
item
in
computes
)
{
...
...
performance/Performance.Services/UnitTypeUtil.cs
View file @
43238061
...
...
@@ -23,11 +23,8 @@ public class UnitTypeUtil
{
(
int
)
Role
.
特殊科室
,
new
string
[]{
UnitType
.
特殊核算组
.
ToString
(),
}
},
{
(
int
)
Role
.
行政科室
,
new
string
[]{
UnitType
.
行政后勤
.
ToString
(),
"行政工勤"
}
},
};
public
class
RoleUnitMap
{
public
Role
Role
{
get
;
set
;
}
public
string
[]
UnitType
{
get
;
set
;
}
}
public
static
string
[]
GetMaps
(
int
?
key
)
=>
(
key
.
HasValue
&&
Maps
.
ContainsKey
(
key
.
Value
))
?
Maps
[
key
.
Value
]
:
Array
.
Empty
<
string
>();
/// <summary>
/// 是否是行政后勤/工勤
...
...
performance/Performance.Services/UserService.cs
View file @
43238061
This diff is collapsed.
Click to expand it.
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