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
7f51942a
Commit
7f51942a
authored
Feb 05, 2020
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
额外收入、二次绩效
parent
796c7a54
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
279 additions
and
3 deletions
+279
-3
performance/Performance.Api/Controllers/SecondAllotController.cs
+27
-0
performance/Performance.Api/wwwroot/Performance.Api.xml
+12
-0
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+46
-0
performance/Performance.DtoModels/Request/AgOtherRequest.cs
+14
-0
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
+3
-0
performance/Performance.EntityModels/Entity/ag_othersource.cs
+54
-0
performance/Performance.EntityModels/Entity/im_accountbasic.cs
+0
-0
performance/Performance.EntityModels/Entity/res_specialunit.cs
+0
-0
performance/Performance.Repository/Repository/PerforAgothersourceRepository.cs
+20
-0
performance/Performance.Services/NewExtractService.cs
+62
-2
performance/Performance.Services/SecondAllotService.cs
+41
-1
No files found.
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
7f51942a
...
@@ -252,5 +252,31 @@ public ApiResponse AuditResult([FromBody] SecondAuditRequest request)
...
@@ -252,5 +252,31 @@ public ApiResponse AuditResult([FromBody] SecondAuditRequest request)
return
result
?
new
ApiResponse
(
ResponseType
.
OK
,
"操作成功"
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"操作失败"
);
return
result
?
new
ApiResponse
(
ResponseType
.
OK
,
"操作成功"
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"操作失败"
);
}
}
#
endregion
#
endregion
#
region
二次绩效其他绩效
/// <summary>
/// 二次绩效其他绩效详情
/// </summary>
/// <returns></returns>
[
Route
(
"api/second/other/list"
)]
[
HttpPost
]
public
ApiResponse
OtherList
([
FromBody
]
AgOtherRequest
request
)
{
var
result
=
secondAllotService
.
OtherList
(
request
.
SecondId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
/// <summary>
/// 二次绩效其他绩效保存
/// </summary>
/// <returns></returns>
[
Route
(
"api/second/other/save"
)]
[
HttpPost
]
public
ApiResponse
OtherSave
([
FromBody
]
AgOtherRequest
request
)
{
var
result
=
secondAllotService
.
OtherSave
(
request
.
SecondId
,
request
.
Othersources
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
#
endregion
}
}
}
}
\ No newline at end of file
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
7f51942a
...
@@ -852,6 +852,18 @@
...
@@ -852,6 +852,18 @@
</summary>
</summary>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.SecondAllotController.OtherDetail(Performance.DtoModels.AgOtherRequest)"
>
<summary>
二次绩效其他绩效详情
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.SecondAllotController.OtherSave(Performance.DtoModels.AgOtherRequest)"
>
<summary>
二次绩效其他绩效保存
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.SheetController.SheetList(Performance.DtoModels.SheetRequest)"
>
<member
name=
"M:Performance.Api.Controllers.SheetController.SheetList(Performance.DtoModels.SheetRequest)"
>
<summary>
<summary>
sheet 列表
sheet 列表
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
7f51942a
...
@@ -25,6 +25,9 @@
...
@@ -25,6 +25,9 @@
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.ag_itemvalue"
>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.ag_itemvalue"
>
<summary>
科室二次绩效录入内容
</summary>
<summary>
科室二次绩效录入内容
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.ag_othersource"
>
<summary>
二次绩效其他绩效来源
</summary>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.ag_secondallot"
>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.ag_secondallot"
>
<summary>
二次绩效列表
</summary>
<summary>
二次绩效列表
</summary>
</member>
</member>
...
@@ -97,6 +100,9 @@
...
@@ -97,6 +100,9 @@
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.im_employee"
>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.im_employee"
>
<summary>
</summary>
<summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.im_employee_clinic"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.im_header"
>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.im_header"
>
<summary>
</summary>
<summary>
</summary>
</member>
</member>
...
@@ -609,6 +615,46 @@
...
@@ -609,6 +615,46 @@
值
值
</summary>
</summary>
</member>
</member>
<member
name=
"T:Performance.EntityModels.ag_othersource"
>
<summary>
二次绩效其他绩效来源
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_othersource.Id"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_othersource.SecondId"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_othersource.WorkNumber"
>
<summary>
工号
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_othersource.Name"
>
<summary>
姓名
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_othersource.Department"
>
<summary>
科室
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_othersource.WorkPost"
>
<summary>
职称
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_othersource.Amount"
>
<summary>
金额
</summary>
</member>
<member
name=
"T:Performance.EntityModels.ag_secondallot"
>
<member
name=
"T:Performance.EntityModels.ag_secondallot"
>
<summary>
<summary>
二次绩效列表
二次绩效列表
...
...
performance/Performance.DtoModels/Request/AgOtherRequest.cs
0 → 100644
View file @
7f51942a
using
Performance.EntityModels
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.DtoModels
{
public
class
AgOtherRequest
{
public
int
SecondId
{
get
;
set
;
}
public
List
<
ag_othersource
>
Othersources
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
View file @
7f51942a
...
@@ -26,6 +26,8 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
...
@@ -26,6 +26,8 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
public
virtual
DbSet
<
ag_header
>
ag_header
{
get
;
set
;
}
public
virtual
DbSet
<
ag_header
>
ag_header
{
get
;
set
;
}
/// <summary> 科室二次绩效录入内容 </summary>
/// <summary> 科室二次绩效录入内容 </summary>
public
virtual
DbSet
<
ag_itemvalue
>
ag_itemvalue
{
get
;
set
;
}
public
virtual
DbSet
<
ag_itemvalue
>
ag_itemvalue
{
get
;
set
;
}
/// <summary> 二次绩效其他绩效来源 </summary>
public
virtual
DbSet
<
ag_othersource
>
ag_othersource
{
get
;
set
;
}
/// <summary> 二次绩效列表 </summary>
/// <summary> 二次绩效列表 </summary>
public
virtual
DbSet
<
ag_secondallot
>
ag_secondallot
{
get
;
set
;
}
public
virtual
DbSet
<
ag_secondallot
>
ag_secondallot
{
get
;
set
;
}
/// <summary> 二次绩效模板 </summary>
/// <summary> 二次绩效模板 </summary>
...
@@ -74,6 +76,7 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
...
@@ -74,6 +76,7 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
public
virtual
DbSet
<
im_data
>
im_data
{
get
;
set
;
}
public
virtual
DbSet
<
im_data
>
im_data
{
get
;
set
;
}
/// <summary> </summary>
/// <summary> </summary>
public
virtual
DbSet
<
im_employee
>
im_employee
{
get
;
set
;
}
public
virtual
DbSet
<
im_employee
>
im_employee
{
get
;
set
;
}
/// <summary> </summary>
public
virtual
DbSet
<
im_employee_clinic
>
im_employee_clinic
{
get
;
set
;
}
public
virtual
DbSet
<
im_employee_clinic
>
im_employee_clinic
{
get
;
set
;
}
/// <summary> </summary>
/// <summary> </summary>
public
virtual
DbSet
<
im_header
>
im_header
{
get
;
set
;
}
public
virtual
DbSet
<
im_header
>
im_header
{
get
;
set
;
}
...
...
performance/Performance.EntityModels/Entity/ag_othersource.cs
0 → 100644
View file @
7f51942a
//-----------------------------------------------------------------------
// <copyright file=" ag_othersource.cs">
// * FileName: 二次绩效其他绩效来源.cs
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations.Schema
;
namespace
Performance.EntityModels
{
/// <summary>
/// 二次绩效其他绩效来源
/// </summary>
[
Table
(
"ag_othersource"
)]
public
class
ag_othersource
{
/// <summary>
///
/// </summary>
[
Key
]
public
int
Id
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
Nullable
<
int
>
SecondId
{
get
;
set
;
}
/// <summary>
/// 工号
/// </summary>
public
string
WorkNumber
{
get
;
set
;
}
/// <summary>
/// 姓名
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
/// 科室
/// </summary>
public
string
Department
{
get
;
set
;
}
/// <summary>
/// 职称
/// </summary>
public
string
WorkPost
{
get
;
set
;
}
/// <summary>
/// 金额
/// </summary>
public
Nullable
<
decimal
>
Amount
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Entity/im_accountbasic.cs
View file @
7f51942a
performance/Performance.EntityModels/Entity/res_specialunit.cs
View file @
7f51942a
performance/Performance.Repository/Repository/PerforAgothersourceRepository.cs
0 → 100644
View file @
7f51942a
//-----------------------------------------------------------------------
// <copyright file=" ag_othersource.cs">
// * FileName: ag_othersource.cs
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
Performance.EntityModels
;
namespace
Performance.Repository
{
/// <summary>
/// ag_othersource Repository
/// </summary>
public
partial
class
PerforAgothersourceRepository
:
PerforRepository
<
ag_othersource
>
{
public
PerforAgothersourceRepository
(
PerformanceDbContext
context
)
:
base
(
context
)
{
}
}
}
performance/Performance.Services/NewExtractService.cs
View file @
7f51942a
...
@@ -150,7 +150,7 @@ public string ExtractData(int allotId, string email, int hospitalId)
...
@@ -150,7 +150,7 @@ public string ExtractData(int allotId, string email, int hospitalId)
WriteIncome
(
sheet
,
hospital
.
ID
,
unitList
,
sheetRead
,
allot
,
modulesList
,
hospitalConfigList
);
WriteIncome
(
sheet
,
hospital
.
ID
,
unitList
,
sheetRead
,
allot
,
modulesList
,
hospitalConfigList
);
break
;
break
;
case
SheetType
.
OtherIncome
:
case
SheetType
.
OtherIncome
:
WriteOtherIncome
(
sheet
,
hospital
.
ID
,
sheetRead
);
WriteOtherIncome
(
sheet
,
hospital
.
ID
,
unitList
,
sheetRead
,
allot
,
modulesList
,
hospitalConfigList
);
break
;
break
;
case
SheetType
.
Expend
:
case
SheetType
.
Expend
:
WriteExpend
(
sheet
,
hospital
.
ID
,
sheetRead
);
WriteExpend
(
sheet
,
hospital
.
ID
,
sheetRead
);
...
@@ -215,7 +215,7 @@ private static void CreateNotExistSheet(List<mod_module> modulesList, IWorkbook
...
@@ -215,7 +215,7 @@ private static void CreateNotExistSheet(List<mod_module> modulesList, IWorkbook
}
}
}
}
private
void
WriteOtherIncome
(
ISheet
sheet
,
int
hospitalId
,
IPerSheetDataRead
sheetRead
)
private
void
WriteOtherIncome
(
ISheet
sheet
,
int
hospitalId
,
List
<
AccountUnitEntity
>
unitList
,
IPerSheetDataRead
sheetRead
,
per_allot
allot
,
List
<
mod_module
>
moduleList
,
List
<
sys_hospitalconfig
>
hospitalConfigList
)
{
{
var
module
=
perforModmoduleRepository
.
GetEntity
(
t
=>
t
.
SheetType
==
(
int
)
SheetType
.
OtherIncome
&&
t
.
HospitalId
==
hospitalId
);
var
module
=
perforModmoduleRepository
.
GetEntity
(
t
=>
t
.
SheetType
==
(
int
)
SheetType
.
OtherIncome
&&
t
.
HospitalId
==
hospitalId
);
var
itemList
=
perforModitemRepository
.
GetEntities
(
t
=>
t
.
ModuleId
==
module
.
Id
);
var
itemList
=
perforModitemRepository
.
GetEntities
(
t
=>
t
.
ModuleId
==
module
.
Id
);
...
@@ -250,6 +250,66 @@ private void WriteOtherIncome(ISheet sheet, int hospitalId, IPerSheetDataRead sh
...
@@ -250,6 +250,66 @@ private void WriteOtherIncome(ISheet sheet, int hospitalId, IPerSheetDataRead sh
techniciancell
.
CellStyle
=
CellStyle
.
CreateCellStyle
(
workbook
,
StyleType
.
系数
,
CellFormat
.
百分比
);
techniciancell
.
CellStyle
=
CellStyle
.
CreateCellStyle
(
workbook
,
StyleType
.
系数
,
CellFormat
.
百分比
);
cellStartIndex
++;
cellStartIndex
++;
}
}
//查询数据
var
extractList
=
perforModextractRepository
.
GetEntities
(
t
=>
module
.
ExtractId
==
t
.
Id
);
if
(
extractList
==
null
||
extractList
.
Count
==
0
)
return
;
List
<
ExtractDto
>
allExtract
=
new
List
<
ExtractDto
>();
foreach
(
var
item
in
extractList
)
{
logManageService
.
WriteMsg
(
"提取绩效数据"
,
$"执行SQL脚本获取数据 --
{
module
.
ModuleName
}
"
,
1
,
AllotId
,
"ReceiveMessage"
);
LogHelper
.
Information
(
$"执行SQL脚本获取数据 --
{
module
.
ModuleName
}
"
,
"提取绩效数据"
);
var
result
=
QueryDatabase
(
hospitalConfigList
,
item
,
allot
);
if
(
result
!=
null
)
allExtract
.
AddRange
(
result
);
}
logManageService
.
WriteMsg
(
"提取绩效数据"
,
$"填充数据 --
{
module
.
ModuleName
}
"
,
1
,
AllotId
,
"ReceiveMessage"
);
LogHelper
.
Information
(
$"填充数据 --
{
module
.
ModuleName
}
"
,
"提取绩效数据"
);
//写入数据
var
rowIndex
=
sheetRead
.
Point
.
HeaderFirstRowNum
.
Value
+
1
;
foreach
(
var
department
in
allExtract
.
Select
(
t
=>
t
.
Department
).
Distinct
())
{
var
row
=
sheet
.
CreateRow
(
rowIndex
);
for
(
int
i
=
head
.
FirstCellNum
;
i
<
head
.
LastCellNum
;
i
++)
{
var
headName
=
head
.
GetCell
(
i
).
StringCellValue
;
var
newCell
=
row
.
CreateCell
(
i
);
if
(
headName
.
Replace
(
"\n"
,
""
)
==
"核算单元(医生组)"
)
{
var
dept
=
unitList
.
FirstOrDefault
(
t
=>
t
.
SheetName
==
sheet
.
SheetName
&&
t
.
Department
==
department
&&
t
.
UnitType
==
1
)?.
AccountingUnit
;
newCell
.
SetCellValue
(
dept
??
""
);
newCell
.
CellStyle
=
CellStyle
.
CreateCellStyle
(
workbook
,
StyleType
.
默认
);
}
else
if
(
headName
.
Replace
(
"\n"
,
""
)
==
"核算单元(护理组)"
)
{
var
dept
=
unitList
.
FirstOrDefault
(
t
=>
t
.
SheetName
==
sheet
.
SheetName
&&
t
.
Department
==
department
&&
t
.
UnitType
==
2
)?.
AccountingUnit
;
newCell
.
SetCellValue
(
dept
??
""
);
newCell
.
CellStyle
=
CellStyle
.
CreateCellStyle
(
workbook
,
StyleType
.
默认
);
}
else
if
(
headName
.
Replace
(
"\n"
,
""
)
==
"核算单元(医技组)"
)
{
var
dept
=
unitList
.
FirstOrDefault
(
t
=>
t
.
SheetName
==
sheet
.
SheetName
&&
t
.
Department
==
department
&&
t
.
UnitType
==
3
)?.
AccountingUnit
;
newCell
.
SetCellValue
(
dept
??
""
);
newCell
.
CellStyle
=
CellStyle
.
CreateCellStyle
(
workbook
,
StyleType
.
默认
);
}
else
if
(
headName
==
"科室名称"
)
{
newCell
.
SetCellValue
(
department
??
""
);
newCell
.
CellStyle
=
CellStyle
.
CreateCellStyle
(
workbook
,
StyleType
.
默认
);
}
else
{
var
value
=
allExtract
.
FirstOrDefault
(
t
=>
t
.
Department
==
department
&&
t
.
Category
==
headName
)?.
Value
;
value
=
value
==
0
?
null
:
value
;
OutToExcelCell
(
newCell
,
value
);
//newCell.SetCellValue(value == null || value == 0 ? "" : value.ToString());
newCell
.
CellStyle
=
style
;
}
}
rowIndex
++;
}
}
}
private
void
WriteIncome
(
ISheet
sheet
,
int
hospitalId
,
List
<
AccountUnitEntity
>
unitList
,
IPerSheetDataRead
sheetRead
,
per_allot
allot
,
List
<
mod_module
>
moduleList
,
List
<
sys_hospitalconfig
>
hospitalConfigList
)
private
void
WriteIncome
(
ISheet
sheet
,
int
hospitalId
,
List
<
AccountUnitEntity
>
unitList
,
IPerSheetDataRead
sheetRead
,
per_allot
allot
,
List
<
mod_module
>
moduleList
,
List
<
sys_hospitalconfig
>
hospitalConfigList
)
...
...
performance/Performance.Services/SecondAllotService.cs
View file @
7f51942a
...
@@ -28,6 +28,7 @@ public class SecondAllotService : IAutoInjection
...
@@ -28,6 +28,7 @@ public class SecondAllotService : IAutoInjection
private
readonly
PerforAgusetempRepository
perforAgusetempRepository
;
private
readonly
PerforAgusetempRepository
perforAgusetempRepository
;
private
readonly
PerforAgcomputeRepository
perforAgcomputeRepository
;
private
readonly
PerforAgcomputeRepository
perforAgcomputeRepository
;
private
readonly
PerforCofagainRepository
perforCofagainRepository
;
private
readonly
PerforCofagainRepository
perforCofagainRepository
;
private
readonly
PerforAgothersourceRepository
perforAgothersourceRepository
;
public
SecondAllotService
(
IOptions
<
Application
>
application
,
public
SecondAllotService
(
IOptions
<
Application
>
application
,
PerforUserRepository
perforUserRepository
,
PerforUserRepository
perforUserRepository
,
...
@@ -42,7 +43,8 @@ public class SecondAllotService : IAutoInjection
...
@@ -42,7 +43,8 @@ public class SecondAllotService : IAutoInjection
PerforAgfixatitemRepository
perforAgfixatitemRepository
,
PerforAgfixatitemRepository
perforAgfixatitemRepository
,
PerforAgusetempRepository
perforAgusetempRepository
,
PerforAgusetempRepository
perforAgusetempRepository
,
PerforAgcomputeRepository
perforAgcomputeRepository
,
PerforAgcomputeRepository
perforAgcomputeRepository
,
PerforCofagainRepository
perforCofagainRepository
)
PerforCofagainRepository
perforCofagainRepository
,
PerforAgothersourceRepository
perforAgothersourceRepository
)
{
{
this
.
application
=
application
.
Value
;
this
.
application
=
application
.
Value
;
this
.
perforUserRepository
=
perforUserRepository
;
this
.
perforUserRepository
=
perforUserRepository
;
...
@@ -58,6 +60,7 @@ public class SecondAllotService : IAutoInjection
...
@@ -58,6 +60,7 @@ public class SecondAllotService : IAutoInjection
this
.
perforAgusetempRepository
=
perforAgusetempRepository
;
this
.
perforAgusetempRepository
=
perforAgusetempRepository
;
this
.
perforAgcomputeRepository
=
perforAgcomputeRepository
;
this
.
perforAgcomputeRepository
=
perforAgcomputeRepository
;
this
.
perforCofagainRepository
=
perforCofagainRepository
;
this
.
perforCofagainRepository
=
perforCofagainRepository
;
this
.
perforAgothersourceRepository
=
perforAgothersourceRepository
;
}
}
#
region
二次绩效列表与数据保存
#
region
二次绩效列表与数据保存
/// <summary>
/// <summary>
...
@@ -671,5 +674,42 @@ public List<BodyItem> GetBodyItems(List<HeadItem> headItems, int source, List<co
...
@@ -671,5 +674,42 @@ public List<BodyItem> GetBodyItems(List<HeadItem> headItems, int source, List<co
return
bodyItems
;
return
bodyItems
;
}
}
#
endregion
#
endregion
#
region
二次绩效其他来源
public
List
<
ag_othersource
>
OtherList
(
int
secondId
)
{
var
otherSecondList
=
perforAgothersourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
secondId
);
return
otherSecondList
?.
OrderBy
(
t
=>
t
.
Id
).
ToList
();
}
public
List
<
ag_othersource
>
OtherSave
(
int
secondId
,
List
<
ag_othersource
>
request
)
{
var
existEntities
=
perforAgothersourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
secondId
);
if
(
existEntities
!=
null
&&
existEntities
.
Any
())
{
foreach
(
var
item
in
request
.
Where
(
t
=>
t
.
Id
!=
0
))
{
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
WorkNumber
=
item
.
WorkNumber
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
Name
=
item
.
Name
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
Department
=
item
.
Department
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
WorkPost
=
item
.
WorkPost
;
existEntities
.
First
(
t
=>
t
.
Id
==
item
.
Id
).
Amount
=
item
.
Amount
;
}
perforAgothersourceRepository
.
UpdateRange
(
existEntities
.
ToArray
());
var
delIds
=
existEntities
.
Select
(
t
=>
t
.
Id
).
Except
(
request
.
Select
(
t
=>
t
.
Id
));
if
(
delIds
!=
null
)
perforAgothersourceRepository
.
RemoveRange
(
existEntities
.
Where
(
t
=>
delIds
.
Contains
(
t
.
Id
)).
ToArray
());
}
var
addEntities
=
request
.
Where
(
t
=>
t
.
Id
==
0
).
ToList
();
if
(
addEntities
!=
null
&&
addEntities
.
Any
())
{
addEntities
.
ForEach
(
t
=>
t
.
SecondId
=
secondId
);
perforAgothersourceRepository
.
AddRange
(
addEntities
.
ToArray
());
}
return
perforAgothersourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
secondId
);
}
#
endregion
}
}
}
}
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