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
c13e3e29
Commit
c13e3e29
authored
Apr 02, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/分批发放' into develop
parents
70ae6d36
86b9e285
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
129 additions
and
12 deletions
+129
-12
performance/Performance.Api/Controllers/ComputeController.cs
+13
-2
performance/Performance.Api/wwwroot/Performance.Api.xml
+7
-0
performance/Performance.DtoModels/Request/BatchRequest.cs
+13
-1
performance/Performance.EntityModels/Entity/per_batch.cs
+1
-0
performance/Performance.Services/ComputeService.cs
+95
-9
No files found.
performance/Performance.Api/Controllers/ComputeController.cs
View file @
c13e3e29
...
...
@@ -435,8 +435,19 @@ public ApiResponse CustomColumnHeaders([FromBody] ComputerAliasRequest request)
[
HttpPost
]
public
ApiResponse
Batch
([
FromBody
]
BatchRequest
request
)
{
var
result
=
_computeService
.
Batch
(
request
);
return
result
?
new
ApiResponse
(
ResponseType
.
OK
,
"操作成功"
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"操作失败"
);
return
_computeService
.
Batch
(
request
);
}
/// <summary>
/// 取消全院绩效进行批次标记
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"allcompute/batch/cancel"
)]
[
HttpPost
]
public
ApiResponse
BatchCancel
([
FromBody
]
BatchCancelRequest
request
)
{
return
_computeService
.
BatchCancel
(
request
);
}
#
region
发放表下载
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
c13e3e29
...
...
@@ -649,6 +649,13 @@
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.BatchCancel(Performance.DtoModels.Request.BatchCancelRequest)"
>
<summary>
取消全院绩效进行批次标记
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.GetAdminPerDownload(System.Int32)"
>
<summary>
下载院领导、中层、工勤组绩效
...
...
performance/Performance.DtoModels/Request/BatchRequest.cs
View file @
c13e3e29
using
System.Collections.Generic
;
using
System
;
using
System.Collections.Generic
;
namespace
Performance.DtoModels.Request
{
public
class
BatchCancelRequest
{
public
int
HospitalId
{
get
;
set
;
}
public
int
AllotId
{
get
;
set
;
}
public
List
<
BatchDetail
>
Details
{
get
;
set
;
}
}
public
class
BatchRequest
{
public
int
HospitalId
{
get
;
set
;
}
public
int
AllotId
{
get
;
set
;
}
public
string
Batch
{
get
;
set
;
}
public
DateTime
?
BatchDate
{
get
;
set
;
}
public
string
BankName
{
get
;
set
;
}
public
List
<
BatchDetail
>
Details
{
get
;
set
;
}
}
...
...
performance/Performance.EntityModels/Entity/per_batch.cs
View file @
c13e3e29
...
...
@@ -40,6 +40,7 @@ public class per_batch
/// 批次日期
/// </summary>
public
DateTime
BatchDate
{
get
;
set
;
}
public
string
BankName
{
get
;
set
;
}
/// <summary>
/// 核算单元分类
...
...
performance/Performance.Services/ComputeService.cs
View file @
c13e3e29
...
...
@@ -2139,29 +2139,115 @@ public List<cof_alias> CustomColumnHeaders(int hospitalId, string route, params
return
init
?.
OrderBy
(
t
=>
t
.
Sort
).
ToList
();
}
public
bool
Batch
(
BatchRequest
request
)
#
region
标记批次号
/// <summary>
/// 标记批次号
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
/// <exception cref="PerformanceException"></exception>
public
ApiResponse
Batch
(
BatchRequest
request
)
{
if
(
request
==
null
||
request
.
Details
==
null
||
!
request
.
Details
.
Any
())
throw
new
PerformanceException
(
"参数错误"
);
throw
new
PerformanceException
(
"提交了空白的人员信息,当前操作已拒绝"
);
if
(
string
.
IsNullOrEmpty
(
request
.
Batch
))
throw
new
PerformanceException
(
"“批次信息”空白,当前操作已拒绝"
);
var
batchs
=
perforPerbatchRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
request
.
AllotId
)
??
new
List
<
per_batch
>();
List
<
Dictionary
<
string
,
string
>>
error
=
new
List
<
Dictionary
<
string
,
string
>>();
foreach
(
var
item
in
request
.
Details
)
{
var
bt
=
batchs
.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
Batch
)
&&
w
.
UnitType
==
item
.
UnitType
&&
w
.
AccountingUnit
==
item
.
AccountingUnit
&&
w
.
PersonnelNumber
==
item
.
JobNumber
);
if
(
bt
!=
null
)
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"核算组别"
,
item
.
UnitType
??
""
},
{
"核算单元"
,
item
.
AccountingUnit
??
""
},
{
"人员工号"
,
item
.
JobNumber
??
""
},
{
"姓名"
,
item
.
EmployeeName
??
""
},
{
"错误原因"
,
$"已经标记;请取消标记后重试;批次“
{
bt
.
Batch
}
”"
},
});
}
if
(
string
.
IsNullOrEmpty
(
item
.
UnitType
)
||
string
.
IsNullOrEmpty
(
item
.
AccountingUnit
)
||
string
.
IsNullOrEmpty
(
item
.
JobNumber
))
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"核算组别"
,
item
.
UnitType
??
""
},
{
"核算单元"
,
item
.
AccountingUnit
??
""
},
{
"人员工号"
,
item
.
JobNumber
??
""
},
{
"姓名"
,
item
.
EmployeeName
??
""
},
{
"错误原因"
,
$"关键信息缺失"
},
});
}
}
if
(
request
.
Details
.
Any
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
Batch
))
)
throw
new
PerformanceException
(
"包含已标记数据"
);
if
(
error
.
Count
>
0
)
return
new
ApiResponse
(
ResponseType
.
WarningTable
,
"验证不通过,当前操作已拒绝"
,
error
);
DateTime
dateTime
=
DateTime
.
Now
;
string
batch
=
DateTime
.
Now
.
ToString
(
"yyyyMMddfff"
);
var
data
=
request
.
Details
.
Select
(
t
=>
new
per_batch
{
HospitalId
=
request
.
HospitalId
,
AllotId
=
request
.
AllotId
,
Batch
=
batch
,
BatchDate
=
dateTime
,
Batch
=
request
.
Batch
,
BatchDate
=
request
.
BatchDate
??
DateTime
.
Now
,
BankName
=
request
.
BankName
,
UnitType
=
t
.
UnitType
,
AccountingUnit
=
t
.
AccountingUnit
,
PersonnelNumber
=
t
.
JobNumber
,
PersonnelName
=
t
.
EmployeeName
});
return
perforPerbatchRepository
.
AddRange
(
data
.
ToArray
());
perforPerbatchRepository
.
AddRange
(
data
.
ToArray
());
return
new
ApiResponse
(
ResponseType
.
OK
,
"标记成功"
);
}
/// <summary>
/// 取消标记
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
/// <exception cref="PerformanceException"></exception>
public
ApiResponse
BatchCancel
(
BatchCancelRequest
request
)
{
if
(
request
==
null
||
request
.
Details
==
null
||
!
request
.
Details
.
Any
())
throw
new
PerformanceException
(
"提交了空白的人员信息,当前操作已拒绝"
);
List
<
Dictionary
<
string
,
string
>>
error
=
new
List
<
Dictionary
<
string
,
string
>>();
var
batchs
=
perforPerbatchRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
request
.
AllotId
)
??
new
List
<
per_batch
>();
var
deletes
=
new
List
<
per_batch
>();
foreach
(
var
item
in
request
.
Details
)
{
if
(
string
.
IsNullOrEmpty
(
item
.
UnitType
)
||
string
.
IsNullOrEmpty
(
item
.
AccountingUnit
)
||
string
.
IsNullOrEmpty
(
item
.
JobNumber
))
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"核算组别"
,
item
.
UnitType
??
""
},
{
"核算单元"
,
item
.
AccountingUnit
??
""
},
{
"人员工号"
,
item
.
JobNumber
??
""
},
{
"姓名"
,
item
.
EmployeeName
??
""
},
{
"错误原因"
,
$"关键信息缺失"
},
});
}
var
bt
=
batchs
.
FirstOrDefault
(
w
=>
w
.
UnitType
==
item
.
UnitType
&&
w
.
AccountingUnit
==
item
.
AccountingUnit
&&
w
.
PersonnelNumber
==
item
.
JobNumber
);
if
(
bt
!=
null
)
{
deletes
.
Add
(
bt
);
}
}
if
(
error
.
Count
>
0
)
return
new
ApiResponse
(
ResponseType
.
WarningTable
,
"验证不通过,当前操作已拒绝"
,
error
);
if
(
deletes
.
Count
>
0
)
perforPerbatchRepository
.
RemoveRange
(
deletes
.
ToArray
());
return
new
ApiResponse
(
ResponseType
.
OK
,
"取消标记操作成功"
);
}
#
endregion
public
List
<
dynamic
>
GetAllComputeView
(
int
hospitalId
,
int
AllotId
,
string
viewName
)
{
...
...
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