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
8a2a9a7f
Commit
8a2a9a7f
authored
Dec 23, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下发功能重做
parent
4645cddc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
258 additions
and
200 deletions
+258
-200
performance/Performance.Api/Controllers/AllotController.cs
+27
-9
performance/Performance.Api/wwwroot/Performance.Api.xml
+10
-2
performance/Performance.Services/AllotCompute/ResultComputeService.cs
+209
-186
performance/Performance.Services/AllotService.cs
+2
-3
performance/Performance.Services/UnitTypeUtil.cs
+10
-0
No files found.
performance/Performance.Api/Controllers/AllotController.cs
View file @
8a2a9a7f
...
...
@@ -425,18 +425,36 @@ public ApiResponse Issued([FromBody] AllotRequest request)
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
// 科室下发
bool
isIssued
=
false
;
var
result
=
_resultComputeService
.
IssuedPrompt
(
allot
,
request
,
ref
isIssued
);
//绩效状态修改;绩效划拨,下发驳回
if
(
request
.
isIssued
==
1
&&
isIssued
)
var
seconds
=
_resultComputeService
.
GetSeconds
(
allot
);
if
(
request
.
isIssued
==
1
)
{
_allotService
.
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
GenerateSucceed
,
EnumHelper
.
GetDescription
(
AllotStates
.
GenerateSucceed
));
costTransferService
.
RejectedApplicat
(
allot
.
ID
);
// 确认下发
var
isIssued
=
_resultComputeService
.
IssuedChangeSecond
(
allot
,
seconds
);
if
(
isIssued
)
{
_allotService
.
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
GenerateSucceed
,
EnumHelper
.
GetDescription
(
AllotStates
.
GenerateSucceed
));
costTransferService
.
RejectedApplicat
(
allot
.
ID
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"下发成功"
);
}
else
{
return
new
ApiResponse
(
ResponseType
.
Fail
,
"下发失败"
);
}
}
else
{
// 获取二次分配差异数据
var
orgChangeSecond
=
_resultComputeService
.
GetChangeSecond
(
seconds
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
if
(!
string
.
IsNullOrEmpty
(
request
.
SearchQuery
))
orgChangeSecond
=
orgChangeSecond
?.
Where
(
t
=>
t
.
Department
.
Contains
(
request
.
SearchQuery
)).
ToList
()
??
new
List
<
IssuedPromptResponse
>();
if
(!
string
.
IsNullOrEmpty
(
request
.
QueryStatus
.
ToString
()))
orgChangeSecond
=
orgChangeSecond
?.
Where
(
t
=>
t
.
IssueStatus
==
request
.
QueryStatus
).
ToList
()
??
new
List
<
IssuedPromptResponse
>();
orgChangeSecond
.
ForEach
(
item
=>
item
.
UnitType
=
UnitTypeUtil
.
GetOffice
(
item
.
UnitType
));
orgChangeSecond
=
orgChangeSecond
?.
OrderBy
(
t
=>
t
.
IssueStatus
).
ToList
();
return
new
ApiResponse
(
ResponseType
.
OK
,
orgChangeSecond
);
}
}
/// <summary>
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
8a2a9a7f
...
...
@@ -1199,7 +1199,7 @@
</member>
<member
name=
"M:Performance.Api.Controllers.EmployeeController.GetGatherHands(System.Int32,Performance.DtoModels.GatherRequest)"
>
<summary>
手工录入
手工录入
- 录入界面
</summary>
<param
name=
"allotId"
></param>
<param
name=
"request"
></param>
...
...
@@ -1215,7 +1215,15 @@
</member>
<member
name=
"M:Performance.Api.Controllers.EmployeeController.GetGather(System.Int32,Performance.DtoModels.PersonParamsRequest)"
>
<summary>
手工录入列表
手工录入列表 - 明细
</summary>
<param
name=
"allotId"
></param>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.EmployeeController.GetGatherTotal(System.Int32,Performance.DtoModels.PersonParamsRequest)"
>
<summary>
手工录入列表 - 汇总
</summary>
<param
name=
"allotId"
></param>
<param
name=
"request"
></param>
...
...
performance/Performance.Services/AllotCompute/ResultComputeService.cs
View file @
8a2a9a7f
...
...
@@ -520,159 +520,222 @@ private IEnumerable<PerDataSpecialUnit> CalculateSpecialUnit(PerSheet specialUni
#
endregion
预留金额
///// <summary>
///// 创建科室二次分配
///// </summary>
///// <param name="allot"></param>
//public void GenerateSecondAllot(per_allot allot)
//{
// List<ag_secondallot> tempSecond = new List<ag_secondallot>();
// List<ag_secondallot> insSecond = new List<ag_secondallot>();
// List<ag_secondallot> updSecond = new List<ag_secondallot>();
// List<ag_secondallot> delSecond = new List<ag_secondallot>();
// var types = new List<int> { (int)UnitType.行政高层, (int)UnitType.行政中层, (int)UnitType.行政后勤 };
// //// 获取医院是否开启后勤二次分配
// //var hospital = hospitalRepository.GetEntity(w => w.ID == allot.HospitalId);
// //if (hospital?.IsOpenLogisticsSecondAllot != 1)
// // types.Add((int)UnitType.行政后勤);
// var accountUnit = perforResaccountRepository.GetEntities(t => t.AllotID == allot.ID && !types.Contains(t.UnitType.Value));
// // 查询需要进行二次分配的行政后勤科室
// var xzAccountUnit = perforResaccountRepository.GetEntities(t => t.AllotID == allot.ID && t.UnitType.Value == (int)UnitType.行政后勤 && t.NeedSecondAllot == "是");
// if (xzAccountUnit != null && xzAccountUnit.Count > 0)
// (accountUnit ?? new List<res_account>()).AddRange(xzAccountUnit);
// var specialList = perforResspecialunitRepository.GetEntities(t => t.AllotID == allot.ID);
// if (accountUnit != null)
// {
// foreach (var item in accountUnit)
// {
// if (!tempSecond.Any(f => f.UnitType == ((UnitType)item.UnitType).ToString() && f.Department == item.AccountingUnit))
// {
// tempSecond.Add(new ag_secondallot
// {
// AllotId = allot.ID,
// Year = allot.Year,
// Month = allot.Month,
// UnitType = ((UnitType)item.UnitType).ToString(),
// Department = item.AccountingUnit,
// NightShiftWorkPerforFee = item.NightShiftWorkPerforFee,
// PreRealGiveFee = item.RealGiveFee,
// });
// }
// }
// }
// if (specialList != null)
// {
// foreach (var item in specialList.Select(w => new { w.AccountingUnit, w.NightShiftWorkPerforFee, w.RealGiveFee }).Distinct())
// {
// if (!tempSecond.Any(f => f.UnitType == UnitType.特殊核算组.ToString() && f.Department == item.AccountingUnit))
// {
// tempSecond.Add(new ag_secondallot
// {
// AllotId = allot.ID,
// Year = allot.Year,
// Month = allot.Month,
// UnitType = UnitType.特殊核算组.ToString(),
// Department = item.AccountingUnit,
// NightShiftWorkPerforFee = item.NightShiftWorkPerforFee,
// PreRealGiveFee = item.RealGiveFee,
// });
// }
// }
// }
// var secondList = perforAgsecondallotRepository.GetEntities(t => t.AllotId == allot.ID && t.Year == allot.Year && t.Month == allot.Month);
// foreach (var item in tempSecond)
// {
// var second = secondList?.FirstOrDefault(f => f.UnitType == item.UnitType && f.Department == item.Department);
// if (second == null)
// {
// insSecond.Add(new ag_secondallot
// {
// AllotId = allot.ID,
// Year = allot.Year,
// Month = allot.Month,
// UnitType = item.UnitType,
// Department = item.Department,
// PreRealGiveFee = item.PreRealGiveFee,
// NightShiftWorkPerforFee = item.NightShiftWorkPerforFee,
// Status = 1,
// NursingDeptStatus = 1,
// });
// }
// else
// {
// /*
// var backResult = Math.Abs((second.PreRealGiveFee ?? 0) - (item.RealGiveFee ?? 0)) >= 0.5m
// || Math.Abs((second.NightShiftWorkPerforFee ?? 0) - (item.NightShiftWorkPerforFee ?? 0)) >= 0.5m;
// if (backResult && second.Status > 1)
// {
// second.Status = 4;
// second.Remark = "科室绩效结果发生变更,需要重新提交";
// second.NursingDeptStatus = 4;
// second.NursingDeptRemark = "科室绩效结果发生变更,需要重新提交";
// }
// */
// second.PreRealGiveFee = item.PreRealGiveFee;
// second.NightShiftWorkPerforFee = item.NightShiftWorkPerforFee;
// updSecond.Add(second);
// }
// }
// if (secondList != null && secondList.Any())
// {
// foreach (var item in secondList)
// {
// var second = tempSecond?.FirstOrDefault(f => f.UnitType == item.UnitType && f.Department == item.Department);
// if (second == null)
// {
// item.PreRealGiveFee = 0;
// delSecond.Add(item);
// }
// }
// }
// if (insSecond.Any())
// perforAgsecondallotRepository.AddRange(insSecond.ToArray());
// if (updSecond.Any())
// {
// perforAgsecondallotRepository.UpdateRange(updSecond.ToArray());
// /*
// foreach (var item in updSecond.Where(w => w.Status == 4))
// {
// // 自动驳回,需要清空该科室历史数据
// perforAgsecondallotRepository.DeleteComputeHistory(item.Id);
// }
// */
// }
// if (delSecond.Any())
// perforAgsecondallotRepository.UpdateRange(delSecond.ToArray());
//}
/// <summary>
///
创建科室二次分配
///
获取所有二次分配记录
/// </summary>
/// <param name="allot"></param>
public
void
GenerateSecondAllot
(
per_allot
allot
)
/// <returns></returns>
public
List
<
ag_secondallot
>
GetSeconds
(
per_allot
allot
)
{
List
<
ag_secondallot
>
tempSecond
=
new
List
<
ag_secondallot
>();
List
<
ag_secondallot
>
insSecond
=
new
List
<
ag_secondallot
>();
List
<
ag_secondallot
>
updSecond
=
new
List
<
ag_secondallot
>();
List
<
ag_secondallot
>
delSecond
=
new
List
<
ag_secondallot
>();
var
types
=
new
List
<
int
>
{
(
int
)
UnitType
.
行政高层
,
(
int
)
UnitType
.
行政中层
,
(
int
)
UnitType
.
行政后勤
};
//// 获取医院是否开启后勤二次分配
//var hospital = hospitalRepository.GetEntity(w => w.ID == allot.HospitalId);
//if (hospital?.IsOpenLogisticsSecondAllot != 1)
// types.Add((int)UnitType.行政后勤);
var
accountUnit
=
perforResaccountRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
&&
!
types
.
Contains
(
t
.
UnitType
.
Value
));
// 查询需要进行二次分配的行政后勤科室
var
xzAccountUnit
=
perforResaccountRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
&&
t
.
UnitType
.
Value
==
(
int
)
UnitType
.
行政后勤
&&
t
.
NeedSecondAllot
==
"是"
);
if
(
xzAccountUnit
!=
null
&&
xzAccountUnit
.
Count
>
0
)
(
accountUnit
??
new
List
<
res_account
>()).
AddRange
(
xzAccountUnit
);
var
specialList
=
perforResspecialunitRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
accountUnit
!=
null
)
{
foreach
(
var
item
in
accountUnit
)
{
if
(!
tempSecond
.
Any
(
f
=>
f
.
UnitType
==
((
UnitType
)
item
.
UnitType
).
ToString
()
&&
f
.
Department
==
item
.
AccountingUnit
))
{
tempSecond
.
Add
(
new
ag_secondallot
{
AllotId
=
allot
.
ID
,
Year
=
allot
.
Year
,
Month
=
allot
.
Month
,
UnitType
=
((
UnitType
)
item
.
UnitType
).
ToString
(),
Department
=
item
.
AccountingUnit
,
NightShiftWorkPerforFee
=
item
.
NightShiftWorkPerforFee
,
PreRealGiveFee
=
item
.
RealGiveFee
,
});
}
}
}
if
(
specialList
!=
null
)
return
perforAgsecondallotRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allot
.
ID
&&
t
.
Year
==
allot
.
Year
&&
t
.
Month
==
allot
.
Month
);
}
/// <summary>
/// 确认下发
/// </summary>
/// <param name="allot"></param>
/// <param name="secondList"></param>
/// <returns></returns>
public
bool
IssuedChangeSecond
(
per_allot
allot
,
List
<
ag_secondallot
>
secondList
)
{
try
{
foreach
(
var
item
in
specialList
.
Select
(
w
=>
new
{
w
.
AccountingUnit
,
w
.
NightShiftWorkPerforFee
,
w
.
RealGiveFee
}).
Distinct
())
{
if
(!
tempSecond
.
Any
(
f
=>
f
.
UnitType
==
UnitType
.
特殊核算组
.
ToString
()
&&
f
.
Department
==
item
.
AccountingUnit
))
{
tempSecond
.
Add
(
new
ag_secondallot
{
AllotId
=
allot
.
ID
,
Year
=
allot
.
Year
,
Month
=
allot
.
Month
,
UnitType
=
UnitType
.
特殊核算组
.
ToString
(),
Department
=
item
.
AccountingUnit
,
NightShiftWorkPerforFee
=
item
.
NightShiftWorkPerforFee
,
PreRealGiveFee
=
item
.
RealGiveFee
,
});
}
}
}
var
promptSeconds
=
GetChangeSecond
(
secondList
);
var
secondList
=
perforAgsecondallotRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allot
.
ID
&&
t
.
Year
==
allot
.
Year
&&
t
.
Month
==
allot
.
Month
);
var
hospital
=
hospitalRepository
.
GetEntity
(
t
=>
t
.
ID
==
allot
.
HospitalId
);
foreach
(
var
item
in
tempSecond
)
{
var
second
=
secondList
?.
FirstOrDefault
(
f
=>
f
.
UnitType
==
item
.
UnitType
&&
f
.
Department
==
item
.
Department
);
if
(
second
==
null
)
{
insSecond
.
Add
(
new
ag_secondallot
{
AllotId
=
allot
.
ID
,
Year
=
allot
.
Year
,
Month
=
allot
.
Month
,
UnitType
=
item
.
UnitType
,
Department
=
item
.
Department
,
PreRealGiveFee
=
item
.
PreRealGiveFee
,
NightShiftWorkPerforFee
=
item
.
NightShiftWorkPerforFee
,
Status
=
1
,
NursingDeptStatus
=
1
,
});
}
else
if
(
secondList
==
null
||
secondList
.
Count
()
==
0
)
return
true
;
if
(
promptSeconds
.
Any
(
t
=>
t
.
IssueStatus
!=
1
))
{
/*
var
backResult = Math.Abs((second.PreRealGiveFee ?? 0) - (item.RealGiveFee ?? 0)) >= 0.5m
|| Math.Abs((second.NightShiftWorkPerforFee ?? 0) - (item.NightShiftWorkPerforFee ?? 0)) >= 0.5m;
if (backResult && second.Status > 1
)
var
updSecondQuery
=
promptSeconds
.
Where
(
t
=>
t
.
IssueStatus
!=
1
);
var
updSeconds
=
secondList
.
Where
(
w
=>
updSecondQuery
.
Select
(
t
=>
t
.
Id
).
Contains
(
w
.
Id
))
??
new
List
<
ag_secondallot
>();
foreach
(
var
item
in
updSecondQuery
)
{
second.Status = 4;
second.Remark = "科室绩效结果发生变更,需要重新提交";
second.NursingDeptStatus = 4;
second.NursingDeptRemark = "科室绩效结果发生变更,需要重新提交";
var
second
=
secondList
.
FirstOrDefault
(
c
=>
c
.
Id
==
item
.
Id
);
second
.
RealGiveFee
=
second
.
PreRealGiveFee
??
0
;
if
(
item
.
IssueStatus
==
2
)
{
second
.
Status
=
4
;
second
.
Remark
=
"科室绩效结果发生变更,需要重新提交"
;
if
(
hospital
.
IsOpenNursingDeptAudit
==
1
)
{
second
.
NursingDeptStatus
=
4
;
second
.
NursingDeptRemark
=
"科室绩效结果发生变更,需要重新提交"
;
}
}
}
*/
second
.
PreRealGiveFee
=
item
.
PreRealGiveFee
;
second
.
NightShiftWorkPerforFee
=
item
.
NightShiftWorkPerforFee
;
updSecond
.
Add
(
second
);
perforAgsecondallotRepository
.
UpdateRange
(
updSeconds
.
ToArray
());
}
}
if
(
secondList
!=
null
&&
secondList
.
Any
())
{
foreach
(
var
item
in
secondList
)
if
(
promptSeconds
.
Any
(
t
=>
t
.
IssueStatus
==
1
))
{
var
second
=
tempSecond
?.
FirstOrDefault
(
f
=>
f
.
UnitType
==
item
.
UnitType
&&
f
.
Department
==
item
.
Department
);
if
(
second
==
null
)
{
item
.
PreRealGiveFee
=
0
;
delSecond
.
Add
(
item
);
}
//删除
var
delSecondQuery
=
promptSeconds
.
Where
(
t
=>
t
.
IssueStatus
==
1
);
var
delSecond
=
secondList
.
Where
(
w
=>
delSecondQuery
.
Select
(
t
=>
t
.
Id
).
Contains
(
w
.
Id
))
??
new
List
<
ag_secondallot
>();
perforAgsecondallotRepository
.
RemoveRange
(
delSecond
.
ToArray
());
}
}
if
(
insSecond
.
Any
())
perforAgsecondallotRepository
.
AddRange
(
insSecond
.
ToArray
());
if
(
updSecond
.
Any
())
return
true
;
}
catch
(
Exception
)
{
perforAgsecondallotRepository
.
UpdateRange
(
updSecond
.
ToArray
());
/*
foreach (var item in updSecond.Where(w => w.Status == 4))
{
// 自动驳回,需要清空该科室历史数据
perforAgsecondallotRepository.DeleteComputeHistory(item.Id);
}
*/
return
false
;
}
if
(
delSecond
.
Any
())
perforAgsecondallotRepository
.
UpdateRange
(
delSecond
.
ToArray
());
}
public
List
<
IssuedPromptResponse
>
IssuedPrompt
(
per_allot
allot
,
AllotRequest
request
,
ref
bool
isIssued
)
/// <summary>
/// 获取二次分配差异数据
/// </summary>
/// <param name="secondList"></param>
/// <returns></returns>
public
List
<
IssuedPromptResponse
>
GetChangeSecond
(
List
<
ag_secondallot
>
secondList
)
{
List
<
ag_secondallot
>
tempSecond
=
new
List
<
ag_secondallot
>();
var
promptSeconds
=
new
List
<
IssuedPromptResponse
>();
var
secondList
=
perforAgsecondallotRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allot
.
ID
&&
t
.
Year
==
allot
.
Year
&&
t
.
Month
==
allot
.
Month
);
if
(
secondList
==
null
||
!
secondList
.
Any
())
if
(
secondList
==
null
||
secondList
.
Count
()
==
0
)
return
new
List
<
IssuedPromptResponse
>();
var
IsOpen
=
hospitalRepository
.
GetEntity
(
t
=>
t
.
ID
==
allot
.
HospitalId
).
IsOpenNursingDeptAudit
==
1
;
var
promptSeconds
=
new
List
<
IssuedPromptResponse
>()
;
var
status
=
new
[]
{
2
,
3
};
foreach
(
var
item
in
secondList
)
{
var
second
=
secondList
?.
FirstOrDefault
(
f
=>
f
.
UnitType
==
item
.
UnitType
&&
f
.
Department
==
item
.
Department
);
var
isDiffer
=
(
item
.
RealGiveFee
??
0
)
!=
(
item
.
PreRealGiveFee
??
0
);
if
((
item
.
RealGiveFee
??
0
)
==
0
&&
(
item
.
PreRealGiveFee
??
0
)
>
0
)
...
...
@@ -683,76 +746,36 @@ public List<IssuedPromptResponse> IssuedPrompt(per_allot allot, AllotRequest req
promptSecond
.
IssueStatus
=
4
;
promptSeconds
.
Add
(
promptSecond
);
}
else
if
(
isDiffer
&&
!
status
.
Contains
(
item
.
Status
.
Value
)
&&
(
IsOpen
==
true
?
!
status
.
Contains
(
item
.
NursingDeptStatus
.
Value
)
:
true
)
)
else
if
(
isDiffer
)
{
var
promptSecond
=
_mapper
.
Map
<
IssuedPromptResponse
>(
item
);
promptSecond
.
StatusRemake
=
$@"未提交科室实发绩效变更,原金额:
{
item
.
RealGiveFee
??
0
}
"
;
promptSecond
.
IssueStatus
=
3
;
promptSecond
.
RealGiveFee
=
item
.
PreRealGiveFee
;
promptSeconds
.
Add
(
promptSecond
);
}
else
if
(
isDiffer
&&
status
.
Contains
(
item
.
Status
.
Value
)
&&
(
IsOpen
==
true
?
status
.
Contains
(
item
.
NursingDeptStatus
.
Value
)
:
true
))
{
var
promptSecond
=
_mapper
.
Map
<
IssuedPromptResponse
>(
item
);
promptSecond
.
StatusRemake
=
$@"已提交或已审核科室实发绩效变更驳回,原金额:
{
item
.
RealGiveFee
??
0
}
"
;
promptSecond
.
IssueStatus
=
2
;
promptSecond
.
RealGiveFee
=
item
.
PreRealGiveFee
;
if
(
status
.
Contains
(
item
.
Status
.
Value
))
{
var
promptSecond
=
_mapper
.
Map
<
IssuedPromptResponse
>(
item
);
promptSecond
.
StatusRemake
=
$@"已提交或已审核科室实发绩效变更驳回,原金额:
{
item
.
RealGiveFee
??
0
:
0.
##
}
"
;
promptSecond
.
IssueStatus
=
2
;
promptSecond
.
RealGiveFee
=
item
.
PreRealGiveFee
;
promptSecond
.
Status
=
4
;
promptSecond
.
Remark
=
"科室绩效结果发生变更,需要重新提交"
;
if
(
IsOpen
)
promptSeconds
.
Add
(
promptSecond
)
;
}
else
{
promptSecond
.
NursingDeptStatus
=
4
;
promptSecond
.
NursingDeptRemark
=
"科室绩效结果发生变更,需要重新提交"
;
var
promptSecond
=
_mapper
.
Map
<
IssuedPromptResponse
>(
item
);
promptSecond
.
StatusRemake
=
$@"未提交科室实发绩效变更,原金额:
{
item
.
RealGiveFee
??
0
:
0.
##
}
"
;
promptSecond
.
IssueStatus
=
3
;
promptSecond
.
RealGiveFee
=
item
.
PreRealGiveFee
;
promptSeconds
.
Add
(
promptSecond
);
}
promptSeconds
.
Add
(
promptSecond
);
}
else
if
((
item
.
PreRealGiveFee
??
0
)
==
0
)
{
var
promptSecond
=
_mapper
.
Map
<
IssuedPromptResponse
>(
item
);
promptSecond
.
StatusRemake
=
"
"
;
promptSecond
.
StatusRemake
=
$"科室下发金额:
{
item
.
PreRealGiveFee
??
0
:
0.
##
}
,原金额:
{
item
.
RealGiveFee
??
0
:
0.
##
}
"
;
promptSecond
.
IssueStatus
=
1
;
promptSeconds
.
Add
(
promptSecond
);
}
}
if
(!
string
.
IsNullOrEmpty
(
request
.
SearchQuery
))
promptSeconds
=
promptSeconds
?.
FindAll
(
t
=>
t
.
Department
.
Contains
(
request
.
SearchQuery
));
if
(!
string
.
IsNullOrEmpty
(
request
.
QueryStatus
.
ToString
()))
promptSeconds
=
promptSeconds
?.
FindAll
(
t
=>
t
.
IssueStatus
==
request
.
QueryStatus
);
if
(
request
.
isIssued
==
1
)
{
if
(
promptSeconds
.
Any
(
t
=>
t
.
IssueStatus
!=
1
))
{
var
updSecondQuery
=
promptSeconds
.
Where
(
t
=>
t
.
IssueStatus
!=
1
);
var
updSeconds
=
secondList
.
Where
(
w
=>
updSecondQuery
.
Select
(
t
=>
t
.
Id
).
Contains
(
w
.
Id
))
??
new
List
<
ag_secondallot
>();
updSeconds
.
ToList
().
ForEach
(
t
=>
{
var
second
=
updSecondQuery
.
FirstOrDefault
(
c
=>
c
.
Id
==
t
.
Id
);
t
.
RealGiveFee
=
t
.
PreRealGiveFee
;
t
.
Status
=
second
.
Status
;
t
.
Remark
=
second
.
Remark
;
t
.
NursingDeptStatus
=
second
.
NursingDeptStatus
;
t
.
NursingDeptRemark
=
second
.
NursingDeptRemark
;
});
perforAgsecondallotRepository
.
UpdateRange
(
updSeconds
.
ToArray
());
}
if
(
promptSeconds
.
Any
(
t
=>
t
.
IssueStatus
==
1
))
{
//删除
var
delSecondQuery
=
promptSeconds
.
Where
(
t
=>
t
.
IssueStatus
==
1
);
var
delSecond
=
secondList
.
Where
(
w
=>
delSecondQuery
.
Select
(
t
=>
t
.
Id
).
Contains
(
w
.
Id
))
??
new
List
<
ag_secondallot
>();
//delSecond.ToList().ForEach(t => t.RealGiveFee = t.PreRealGiveFee);
perforAgsecondallotRepository
.
RemoveRange
(
delSecond
.
ToArray
());
}
isIssued
=
true
;
}
return
promptSeconds
.
OrderBy
(
t
=>
t
.
IssueStatus
).
ToList
();
return
promptSeconds
;
}
}
}
performance/Performance.Services/AllotService.cs
View file @
8a2a9a7f
...
...
@@ -450,8 +450,8 @@ public void Generate(per_allot allot)
//logManageService.WriteMsg("正在生成绩效", "保存预留绩效金额", 1, allot.ID, "ReceiveMessage", true);
//resultComputeService.SaveReserved(allot, allot.HospitalId);
// 科室下发
resultComputeService
.
GenerateSecondAllot
(
allot
);
//
//
科室下发
//
resultComputeService.GenerateSecondAllot(allot);
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
GenerateAccomplish
,
EnumHelper
.
GetDescription
(
AllotStates
.
GenerateAccomplish
),
generate
);
perforCofdirectorRepository
.
SupplementaryData
(
allot
.
ID
);
...
...
@@ -465,7 +465,6 @@ public void Generate(per_allot allot)
//logManageService.WriteMsg("正在生成报表数据", $"报表数据生成完成;受影响:{res}行", 1, allot.ID, "ReceiveMessage", true);
//reportService.ExecProc("call proc_report_performance(@hospitalid, @year, @month);", new { allot.HospitalId, allot.Year, allot.Month });
////发送邮件
//logManageService.WriteMsg("正在发送邮件", "正在发送邮件", 1, allot.ID, "ReceiveMessage", true);
//SendEmail(allot, mail, 1, time);
...
...
performance/Performance.Services/UnitTypeUtil.cs
View file @
8a2a9a7f
...
...
@@ -31,6 +31,16 @@ public static bool IsOffice(string unit)
}
/// <summary>
/// 获得标准名 行政后勤/工勤
/// </summary>
/// <param name="unit"></param>
/// <returns></returns>
public
static
string
GetOffice
(
string
unit
)
{
return
string
.
IsNullOrEmpty
(
unit
)
?
""
:
unit
.
Replace
(
"行政后勤"
,
"行政工勤"
);
}
/// <summary>
/// 核算单元类型是否相同
/// </summary>
/// <param name="left"></param>
...
...
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