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
d37d2479
Commit
d37d2479
authored
Oct 12, 2021
by
钟博
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '发放表下载' into develop1012
parents
57f31197
d8237d45
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
210 additions
and
39 deletions
+210
-39
performance/Performance.Api/Controllers/ComputeController.cs
+105
-34
performance/Performance.Api/wwwroot/Performance.Api.xml
+21
-0
performance/Performance.Services/ComputeService.cs
+40
-0
performance/Performance.Services/DownloadService.cs
+0
-0
performance/Performance.Services/EmployeeService.cs
+5
-5
performance/Performance.Services/PersonService.cs
+3
-0
performance/Performance.Services/SecondAllot/SecondAllotService.cs
+36
-0
No files found.
performance/Performance.Api/Controllers/ComputeController.cs
View file @
d37d2479
...
...
@@ -14,6 +14,8 @@
using
System.Text.RegularExpressions
;
using
System.Threading.Tasks
;
using
Performance.DtoModels.Request
;
using
System.IO
;
using
Microsoft.AspNetCore.StaticFiles
;
namespace
Performance.Api.Controllers
{
...
...
@@ -24,14 +26,18 @@ public class ComputeController : Controller
private
AllotService
_allotService
;
private
ClaimService
_claim
;
private
EmployeeService
_employeeService
;
private
readonly
DownloadService
downloadService
;
public
ComputeController
(
AllotService
allotService
,
ComputeService
computeService
,
EmployeeService
employeeService
,
DownloadService
downloadService
,
ClaimService
claim
)
{
_allotService
=
allotService
;
_computeService
=
computeService
;
_employeeService
=
employeeService
;
this
.
downloadService
=
downloadService
;
_claim
=
claim
;
}
...
...
@@ -147,6 +153,7 @@ public ApiResponse<List<DeptResponse>> GetAdminPerformance([FromBody] ComputerRe
return
new
ApiResponse
<
List
<
DeptResponse
>>(
ResponseType
.
OK
,
"ok"
,
list
);
}
/// <summary>
/// 科室绩效详情
/// </summary>
...
...
@@ -215,6 +222,7 @@ public ApiResponse AllCompute([FromBody] ComputerRequest request)
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
list
);
}
/// <summary>
/// 获取全院绩效平均
/// </summary>
...
...
@@ -294,43 +302,12 @@ public ApiResponse AllComputeByPM([FromBody] ComputerRequest request)
if
(
list
==
null
||
!
list
.
Any
())
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
list
);
var
result
=
list
.
GroupBy
(
t
=>
new
{
t
.
AccountingUnit
,
t
.
UnitType
,
t
.
EmployeeName
,
t
.
JobNumber
}).
Select
(
t
=>
new
ComputeResponse
{
JobNumber
=
t
.
Key
.
JobNumber
,
EmployeeName
=
t
.
Key
.
EmployeeName
,
AccountingUnit
=
t
.
Key
.
AccountingUnit
,
UnitType
=
t
.
Key
.
UnitType
,
PerforSumFee
=
t
.
Sum
(
s
=>
s
.
PerforSumFee
),
PerforManagementFee
=
t
.
Sum
(
s
=>
s
.
PerforManagementFee
),
AdjustLaterOtherFee
=
t
.
Sum
(
s
=>
s
.
AdjustLaterOtherFee
),
ShouldGiveFee
=
t
.
Sum
(
s
=>
s
.
ShouldGiveFee
),
OthePerfor
=
t
.
Sum
(
s
=>
s
.
OthePerfor
),
HideOtherPerfor
=
t
.
Sum
(
s
=>
s
.
HideOtherPerfor
),
NightWorkPerfor
=
t
.
Sum
(
s
=>
s
.
NightWorkPerfor
),
RealGiveFee
=
t
.
Sum
(
s
=>
s
.
RealGiveFee
),
ReservedRatio
=
t
.
Sum
(
s
=>
s
.
ReservedRatio
),
ReservedRatioFee
=
t
.
Sum
(
s
=>
s
.
ReservedRatioFee
),
BankCard
=
t
.
FirstOrDefault
(
s
=>
s
.
JobNumber
==
t
.
Key
.
JobNumber
)?.
BankCard
,
JobCategory
=
t
.
FirstOrDefault
(
s
=>
s
.
JobNumber
==
t
.
Key
.
JobNumber
)?.
JobCategory
,
Duty
=
t
.
FirstOrDefault
(
s
=>
s
.
JobNumber
==
t
.
Key
.
JobNumber
)?.
Duty
,
TitlePosition
=
t
.
FirstOrDefault
(
s
=>
s
.
JobNumber
==
t
.
Key
.
JobNumber
)?.
TitlePosition
}).
OrderBy
(
t
=>
{
string
value
=
t
.
JobNumber
;
switch
(
value
)
{
case
string
val
when
string
.
IsNullOrEmpty
(
val
):
break
;
case
string
val
when
Regex
.
IsMatch
(
val
,
@"^[+-]?\d*$"
):
value
=
value
.
PadLeft
(
20
,
'0'
);
break
;
}
return
value
;
});
var
result
=
_computeService
.
ComputerGroupBy
(
list
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
result
);
}
/// <summary>
/// 修改实发绩效
/// </summary>
...
...
@@ -425,5 +402,98 @@ public ApiResponse Batch([FromBody] BatchRequest request)
var
result
=
_computeService
.
Batch
(
request
);
return
result
?
new
ApiResponse
(
ResponseType
.
OK
,
"操作成功"
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"操作失败"
);
}
#
region
发放表下载
/// <summary>
/// 下载院领导、中层、工勤组绩效
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[
Route
(
"gethosdata/download/{allotId}"
)]
[
HttpPost
]
public
IActionResult
GetAdminPerDownload
(
int
allotId
)
{
var
allot
=
_allotService
.
GetAllot
(
allotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
list
=
_computeService
.
GetAdminPerformance
(
allotId
);
var
filepath
=
downloadService
.
DeptReport
(
allotId
,
list
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
{
stream
.
CopyToAsync
(
memoryStream
).
Wait
();
}
memoryStream
.
Seek
(
0
,
SeekOrigin
.
Begin
);
var
provider
=
new
FileExtensionContentTypeProvider
();
FileInfo
fileInfo
=
new
FileInfo
(
filepath
);
var
memi
=
provider
.
Mappings
[
".xlsx"
];
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
fileInfo
.
Name
));
}
/// <summary>
/// 下载全院绩效列表
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[
Route
(
"allcompute/download/{allotId}"
)]
[
HttpPost
]
public
IActionResult
AllComputeDownload
(
int
allotId
)
{
var
allot
=
_allotService
.
GetAllot
(
allotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
isShowManage
=
_computeService
.
IsShowManage
(
allotId
);
var
list
=
_computeService
.
AllCompute
(
allotId
,
allot
.
HospitalId
,
isShowManage
);
var
filepath
=
downloadService
.
AllComputerReport
(
allotId
,
list
,
true
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
{
stream
.
CopyToAsync
(
memoryStream
).
Wait
();
}
memoryStream
.
Seek
(
0
,
SeekOrigin
.
Begin
);
var
provider
=
new
FileExtensionContentTypeProvider
();
FileInfo
fileInfo
=
new
FileInfo
(
filepath
);
var
memi
=
provider
.
Mappings
[
".xlsx"
];
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
fileInfo
.
Name
));
}
/// <summary>
/// 下载全院绩效列表(人事科)
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[
Route
(
"allcompute/personnel/download/{allotId}"
)]
[
HttpPost
]
public
IActionResult
AllComputeByPMDownLoad
(
int
allotId
)
{
var
allot
=
_allotService
.
GetAllot
(
allotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
isShowManage
=
_computeService
.
IsShowManage
(
allotId
);
var
list
=
_computeService
.
AllCompute
(
allotId
,
allot
.
HospitalId
,
isShowManage
,
true
);
var
result
=
_computeService
.
ComputerGroupBy
(
list
);
var
filepath
=
downloadService
.
AllComputerReport
(
allotId
,
result
,
false
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
{
stream
.
CopyToAsync
(
memoryStream
).
Wait
();
}
memoryStream
.
Seek
(
0
,
SeekOrigin
.
Begin
);
var
provider
=
new
FileExtensionContentTypeProvider
();
FileInfo
fileInfo
=
new
FileInfo
(
filepath
);
var
memi
=
provider
.
Mappings
[
".xlsx"
];
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
fileInfo
.
Name
));
}
#
endregion
}
}
\ No newline at end of file
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
d37d2479
...
...
@@ -554,6 +554,27 @@
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.GetAdminPerDownload(System.Int32)"
>
<summary>
下载院领导、中层、工勤组绩效
</summary>
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.AllComputeDownload(System.Int32)"
>
<summary>
下载全院绩效列表
</summary>
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.AllComputeByPMDownLoad(System.Int32)"
>
<summary>
下载全院绩效列表(人事科)
</summary>
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ConfigController.GetDrugtypeList(Performance.DtoModels.DrugpropRequest)"
>
<summary>
获取 药占比类型信息列表
...
...
performance/Performance.Services/ComputeService.cs
View file @
d37d2479
...
...
@@ -941,6 +941,46 @@ public List<ComputeResponse> AllCompute(int allotId, int hospitalId, int isShowM
return
response
?.
OrderBy
(
t
=>
AccountTypes
.
FirstOrDefault
(
a
=>
a
.
Name
==
t
.
UnitType
)?.
Value
).
ThenByDescending
(
t
=>
t
.
AccountingUnit
).
ToList
();
}
public
List
<
ComputeResponse
>
ComputerGroupBy
(
List
<
ComputeResponse
>
list
)
{
var
result
=
list
?.
GroupBy
(
t
=>
new
{
t
.
AccountingUnit
,
t
.
UnitType
,
t
.
EmployeeName
,
t
.
JobNumber
}).
Select
(
t
=>
new
ComputeResponse
{
JobNumber
=
t
.
Key
.
JobNumber
,
EmployeeName
=
t
.
Key
.
EmployeeName
,
AccountingUnit
=
t
.
Key
.
AccountingUnit
,
UnitType
=
t
.
Key
.
UnitType
,
PerforSumFee
=
t
.
Sum
(
s
=>
s
.
PerforSumFee
),
PerforManagementFee
=
t
.
Sum
(
s
=>
s
.
PerforManagementFee
),
AdjustLaterOtherFee
=
t
.
Sum
(
s
=>
s
.
AdjustLaterOtherFee
),
ShouldGiveFee
=
t
.
Sum
(
s
=>
s
.
ShouldGiveFee
),
OthePerfor
=
t
.
Sum
(
s
=>
s
.
OthePerfor
),
HideOtherPerfor
=
t
.
Sum
(
s
=>
s
.
HideOtherPerfor
),
NightWorkPerfor
=
t
.
Sum
(
s
=>
s
.
NightWorkPerfor
),
RealGiveFee
=
t
.
Sum
(
s
=>
s
.
RealGiveFee
),
ReservedRatio
=
t
.
Sum
(
s
=>
s
.
ReservedRatio
),
ReservedRatioFee
=
t
.
Sum
(
s
=>
s
.
ReservedRatioFee
),
BankCard
=
t
.
FirstOrDefault
(
s
=>
s
.
JobNumber
==
t
.
Key
.
JobNumber
)?.
BankCard
,
JobCategory
=
t
.
FirstOrDefault
(
s
=>
s
.
JobNumber
==
t
.
Key
.
JobNumber
)?.
JobCategory
,
Duty
=
t
.
FirstOrDefault
(
s
=>
s
.
JobNumber
==
t
.
Key
.
JobNumber
)?.
Duty
,
TitlePosition
=
t
.
FirstOrDefault
(
s
=>
s
.
JobNumber
==
t
.
Key
.
JobNumber
)?.
TitlePosition
}).
OrderBy
(
t
=>
{
string
value
=
t
.
JobNumber
;
switch
(
value
)
{
case
string
val
when
string
.
IsNullOrEmpty
(
val
):
break
;
case
string
val
when
Regex
.
IsMatch
(
val
,
@"^[+-]?\d*$"
):
value
=
value
.
PadLeft
(
20
,
'0'
);
break
;
}
return
value
;
});
return
result
.
ToList
();
}
///// <summary>
///// 合并医院其他绩效、不公示其他绩效
///// </summary>
...
...
performance/Performance.Services/DownloadService.cs
0 → 100644
View file @
d37d2479
This diff is collapsed.
Click to expand it.
performance/Performance.Services/EmployeeService.cs
View file @
d37d2479
...
...
@@ -619,11 +619,11 @@ public string ImpoerAprEmployees(int allotid, string path, int userid)
entities
.
Add
(
entity
);
}
var
numbers
=
entities
.
Select
(
t
=>
t
.
PersonnelNumber
).
Except
(
employees
.
Select
(
w
=>
w
.
PersonnelNumber
));
if
(
numbers
?.
Count
()
>
0
&&
numbers
?.
Count
()
<=
5
)
return
$@"以下工号在字典中不存在:
{
JsonHelper
.
Serialize
(
numbers
.
ToArray
())}
"
;
else
if
(
numbers
?.
Count
()
>
5
)
return
$@"以下工号在字典中不存在:
{
JsonHelper
.
Serialize
(
numbers
.
Take
(
5
)).
Replace
(
"]"
,
",...]"
)}
"
;
//
var numbers = entities.Select(t => t.PersonnelNumber).Except(employees.Select(w => w.PersonnelNumber));
//
if (numbers?.Count() > 0 && numbers?.Count() <= 5)
//
return $@"以下工号在字典中不存在:{JsonHelper.Serialize(numbers.ToArray())}";
//
else if (numbers?.Count() > 5)
//
return $@"以下工号在字典中不存在:{JsonHelper.Serialize(numbers.Take(5)).Replace("]", ",...]")}";
// 补充核算单元
...
...
performance/Performance.Services/PersonService.cs
View file @
d37d2479
...
...
@@ -1116,6 +1116,9 @@ public void SaveQueryRole(int hospitalId, SaveCollectData request)
var
dict
=
new
Dictionary
<
string
,
string
>();
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
{
...
...
performance/Performance.Services/SecondAllot/SecondAllotService.cs
View file @
d37d2479
...
...
@@ -8,6 +8,7 @@
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text.RegularExpressions
;
namespace
Performance.Services
{
...
...
@@ -511,8 +512,43 @@ public void SaveSecondAllotHeadData(int secondId, string json)
List
<
ag_worktype_source
>
insertData
=
new
List
<
ag_worktype_source
>();
var
worktypeSources
=
agworktypesourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
secondId
);
if
(
worktypeSources
==
null
||
!
worktypeSources
.
Any
())
{
var
workTypes
=
agworkloadtypeRepository
.
GetEntities
();
var
workValue
=
new
List
<
int
>();
foreach
(
var
item
in
keys
)
{
var
value
=
item
.
Replace
(
"workload_ratio_"
,
""
).
Replace
(
"workload_amount_"
,
""
);
if
(!
Regex
.
IsMatch
(
value
,
@"^\d"
))
continue
;
workValue
.
Add
(
Convert
.
ToInt32
(
value
));
}
if
(
workValue
==
null
||
!
workValue
.
Any
())
return
;
foreach
(
var
value
in
workValue
)
{
for
(
int
i
=
0
;
i
<
prefix
.
Length
;
i
++)
{
var
fieldId
=
prefix
[
i
]
+
$"
{
value
}
"
;
var
typeName
=
workTypes
?.
FirstOrDefault
(
t
=>
t
.
Id
==
value
)?.
TypeName
;
var
source
=
new
ag_worktype_source
{
WorkTypeId
=
value
,
SecondId
=
secondId
,
FieldId
=
fieldId
,
FieldName
=
i
==
0
?
typeName
+
"占比"
:
typeName
+
"金额"
,
Value
=
prefix
[
i
].
StartsWith
(
prefix
[
0
])
?
(
decimal
?)
Convert
.
ToDecimal
(
dict
[
fieldId
.
ToLower
()])
:
null
,
};
insertData
.
Add
(
source
);
}
}
agworktypesourceRepository
.
AddRange
(
insertData
.
ToArray
());
}
worktypeSources
=
agworktypesourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
secondId
);
foreach
(
var
key
in
keys
)
{
var
update
=
worktypeSources
.
FirstOrDefault
(
t
=>
t
.
FieldId
.
EqualsIgnoreCase
(
key
));
...
...
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