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
31bd7330
Commit
31bd7330
authored
Nov 29, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二次绩效删除时添加至日志表,删除绩效时删除其数据
parent
e5d1d461
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
341 additions
and
17 deletions
+341
-17
performance/Performance.Api/Controllers/SecondAllotController.cs
+1
-1
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+88
-0
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
+0
-0
performance/Performance.EntityModels/Entity/ag_fixatitem.cs
+10
-0
performance/Performance.EntityModels/Entity/ag_fixatitem_log.cs
+89
-0
performance/Performance.Repository/PerforCofdirectorRepository.cs
+40
-2
performance/Performance.Repository/Repository/PerforAgfixatitemlogRepository.cs
+20
-0
performance/Performance.Services/AllotCompute/ProcessComputService.cs
+7
-6
performance/Performance.Services/AllotService.cs
+9
-3
performance/Performance.Services/ConfigService.cs
+27
-1
performance/Performance.Services/SecondAllotService.cs
+50
-4
No files found.
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
31bd7330
...
...
@@ -80,7 +80,7 @@ public ApiResponse SaveValue(int secondid, [FromBody] List<ag_fixatitem> request
if
(
repetition
.
Any
())
throw
new
PerformanceException
(
string
.
Join
(
";"
,
repetition
.
Select
(
t
=>
$"行
{
t
.
Key
.
RowNumber
}
项‘
{
t
.
Key
.
ItemName
}
’重复录入"
)));
var
result
=
secondAllotService
.
SaveValue
(
request
);
var
result
=
secondAllotService
.
SaveValue
(
request
,
claimService
.
GetUserId
()
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
31bd7330
...
...
@@ -19,6 +19,9 @@
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.ag_fixatitem"
>
<summary>
二次绩效固定项
</summary>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.ag_fixatitem_log"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.ag_header"
>
<summary>
二次分配不固定列头数据
</summary>
</member>
...
...
@@ -613,6 +616,91 @@
1 value相加值为1
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_fixatitem.CreateDate"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_fixatitem.UpdateDate"
>
<summary>
</summary>
</member>
<member
name=
"T:Performance.EntityModels.ag_fixatitem_log"
>
<summary>
二次绩效固定项
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_fixatitem_log.ID"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_fixatitem_log.AllotId"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_fixatitem_log.SecondId"
>
<summary>
二次绩效ID
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_fixatitem_log.UnitType"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_fixatitem_log.RowNumber"
>
<summary>
行号
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_fixatitem_log.ItemName"
>
<summary>
项目名
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_fixatitem_log.ItemValue"
>
<summary>
值
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_fixatitem_log.FactorValue"
>
<summary>
系数
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_fixatitem_log.Sort"
>
<summary>
排序
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_fixatitem_log.Type"
>
<summary>
字段类型 1 顶部概况 2 表格固定 3 工作量
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_fixatitem_log.SourceType"
>
<summary>
1 自动带出 2 计算得出
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_fixatitem_log.SpecialAttr"
>
<summary>
1 value相加值为1
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_fixatitem_log.DeleteDate"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_fixatitem_log.DeleteUser"
>
<summary>
</summary>
</member>
<member
name=
"T:Performance.EntityModels.ag_header"
>
<summary>
二次分配不固定列头数据
...
...
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
View file @
31bd7330
This diff is collapsed.
Click to expand it.
performance/Performance.EntityModels/Entity/ag_fixatitem.cs
View file @
31bd7330
...
...
@@ -75,5 +75,15 @@ public class ag_fixatitem
/// 1 value相加值为1
/// </summary>
public
Nullable
<
int
>
SpecialAttr
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
Nullable
<
DateTime
>
CreateDate
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
Nullable
<
DateTime
>
UpdateDate
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Entity/ag_fixatitem_log.cs
0 → 100644
View file @
31bd7330
//-----------------------------------------------------------------------
// <copyright file=" ag_fixatitem_log.cs">
// * FileName:
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations.Schema
;
namespace
Performance.EntityModels
{
/// <summary>
/// 二次绩效固定项
/// </summary>
[
Table
(
"ag_fixatitem_log"
)]
public
class
ag_fixatitem_log
{
/// <summary>
///
/// </summary>
[
Key
]
public
int
ID
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
Nullable
<
int
>
AllotId
{
get
;
set
;
}
/// <summary>
/// 二次绩效ID
/// </summary>
public
Nullable
<
int
>
SecondId
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
string
UnitType
{
get
;
set
;
}
/// <summary>
/// 行号
/// </summary>
public
Nullable
<
int
>
RowNumber
{
get
;
set
;
}
/// <summary>
/// 项目名
/// </summary>
public
string
ItemName
{
get
;
set
;
}
/// <summary>
/// 值
/// </summary>
public
string
ItemValue
{
get
;
set
;
}
/// <summary>
/// 系数
/// </summary>
public
Nullable
<
decimal
>
FactorValue
{
get
;
set
;
}
/// <summary>
/// 排序
/// </summary>
public
Nullable
<
decimal
>
Sort
{
get
;
set
;
}
/// <summary>
/// 字段类型 1 顶部概况 2 表格固定 3 工作量
/// </summary>
public
Nullable
<
int
>
Type
{
get
;
set
;
}
/// <summary>
/// 1 自动带出 2 计算得出
/// </summary>
public
Nullable
<
int
>
SourceType
{
get
;
set
;
}
/// <summary>
/// 1 value相加值为1
/// </summary>
public
Nullable
<
int
>
SpecialAttr
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
Nullable
<
DateTime
>
DeleteDate
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
Nullable
<
int
>
DeleteUser
{
get
;
set
;
}
}
}
performance/Performance.Repository/PerforCofdirectorRepository.cs
View file @
31bd7330
...
...
@@ -44,6 +44,45 @@ public int DeleteData(int allotId)
return
Execute
(
sql
,
new
{
allotId
});
}
public
int
DeleteAllotData
(
int
allotId
)
{
List
<
string
>
tableArray
=
new
List
<
string
>
{
"cof_again"
,
"cof_check"
,
"cof_cmi"
,
"cof_depttype"
,
"cof_director"
,
"cof_drugprop"
,
"cof_drugtype"
,
"cof_guarantee"
,
"cof_income"
,
"cof_singlefactor"
,
"cof_workitem"
,
"cof_workyear"
,
"im_accountbasic"
,
"im_data"
,
"im_employee"
,
"im_employee_clinic"
,
"im_employee_logistics"
,
"im_header"
,
"im_specialunit"
,
"per_sheet"
,
"res_account"
,
"res_accountdoctor"
,
"res_accountnurse"
,
"res_baiscnorm"
,
"res_compute"
,
"res_specialunit"
,
"log_check"
,
};
string
sql
=
""
;
tableArray
.
ForEach
(
t
=>
sql
+=
$"delete from
{
t
}
where allotid=@allotId;"
);
sql
+=
"delete from log_dbug where allotid=@allotId and type=1;"
;
return
Execute
(
sql
,
new
{
allotId
});
}
public
int
DeleteResData
(
int
allotId
)
{
List
<
string
>
tableArray
=
new
List
<
string
>
...
...
@@ -107,7 +146,7 @@ public int SupplementaryData(int allotid)
//where sheet.allotid = @allotid and sheet.sheettype = 9 and im.department not in
// (select charge from cof_depttype where allotid = @allotid);";
#
endregion
#
endregion
MyRegion
List
<
string
>
sqls
=
new
List
<
string
>
{
...
...
@@ -151,7 +190,6 @@ union all
}
catch
(
Exception
)
{
}
}
return
flag
;
...
...
performance/Performance.Repository/Repository/PerforAgfixatitemlogRepository.cs
0 → 100644
View file @
31bd7330
//-----------------------------------------------------------------------
// <copyright file=" ag_fixatitem_log.cs">
// * FileName: ag_fixatitem_log.cs
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
Performance.EntityModels
;
namespace
Performance.Repository
{
/// <summary>
/// ag_fixatitem_log Repository
/// </summary>
public
partial
class
PerforAgfixatitemlogRepository
:
PerforRepository
<
ag_fixatitem_log
>
{
public
PerforAgfixatitemlogRepository
(
PerformanceDbContext
context
)
:
base
(
context
)
{
}
}
}
performance/Performance.Services/AllotCompute/ProcessComputService.cs
View file @
31bd7330
...
...
@@ -87,6 +87,7 @@ public class ProcessComputService : IAutoInjection
//}
#
region
save
/// <summary>
/// 保存计算后的绩效
/// </summary>
...
...
@@ -110,7 +111,6 @@ private void SaveComputeAccount(PerSheet sheet, int allotId)
perforResaccountRepository
.
AddRange
(
addList
.
ToArray
());
}
/// <summary>
/// 保存通用格式
/// </summary>
...
...
@@ -175,9 +175,11 @@ public void Save(List<PerSheet> perSheets, int allotId)
}
}
}
#
endregion
#
endregion
save
#
region
compute
/// <summary>
/// 合并计算
/// </summary>
...
...
@@ -252,13 +254,13 @@ public void Save(List<PerSheet> perSheets, int allotId)
return
(
perSheet
,
mergeSheets
);
}
/// <summary>
/// 计算科室绩效
/// </summary>
/// <param name="excel"></param>
/// <param name="perSheet"></param>
/// <returns></returns>
///
public
List
<
PerSheet
>
Compute
(
PerExcel
excel
,
List
<
PerSheet
>
perSheet
)
{
var
accountList
=
excel
.
PerSheet
.
FirstOrDefault
(
t
=>
t
.
SheetType
==
SheetType
.
AccountBasic
)?.
PerData
?.
Select
(
t
=>
(
PerDataAccountBaisc
)
t
);
...
...
@@ -468,7 +470,6 @@ public IEnumerable<AccountUnitTotal> GetAccountScoreAverage(PerExcel excel, Shee
?.
Select
(
t
=>
new
AccountUnitTotal
{
UnitType
=
t
.
Key
.
UnitType
,
AccountingUnit
=
t
.
Key
.
AccountingUnit
,
TotelValue
=
t
.
Sum
(
g
=>
g
.
CellValue
)
});
}
///// <summary>
///// 计算保底绩效参考标准
///// </summary>
...
...
@@ -547,7 +548,6 @@ public IEnumerable<AccountUnitTotal> GetAccountScoreAverage(PerExcel excel, Shee
// var doctorWorkloadData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeDoctorWorkload)?.PerData.Select(t => (PerData)t);
// var nurseWorkloadData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeNurseWorkload)?.PerData.Select(t => (PerData)t);
// var basicRuleList = new[]
// {
// new { Data = doctorWorkloadData, UnitType = UnitType.医生组 },
...
...
@@ -647,6 +647,7 @@ private List<CofDrugProp> GetDrugConfig(PerExcel excel, int allotid)
}
return
cofs
;
}
#
endregion
#
endregion
compute
}
}
performance/Performance.Services/AllotService.cs
View file @
31bd7330
...
...
@@ -43,6 +43,7 @@ public class AllotService : IAutoInjection
//private readonly IHubContext<AllotLogHub> hubContext;
private
readonly
LogManageService
logManageService
;
private
readonly
ReportService
reportService
;
private
readonly
QueryDataService
queryDataService
;
...
...
@@ -99,6 +100,7 @@ public class AllotService : IAutoInjection
}
#
region
基础功能
/// <summary>
/// 绩效记录
/// </summary>
...
...
@@ -222,6 +224,8 @@ public bool DeleteAllot(int iD)
FileHelper
.
Move
(
allot
.
Path
,
path
);
allot
.
Path
=
path
;
_allotRepository
.
Remove
(
allot
);
configService
.
ClearAllotData
(
allot
.
ID
);
}
catch
(
Exception
ex
)
{
...
...
@@ -254,7 +258,8 @@ public bool Update(per_allot allot)
{
return
_allotRepository
.
Update
(
allot
);
}
#
endregion
#
endregion
基础功能
public
void
UpdateAllotStates
(
int
allotId
,
int
states
,
string
remark
,
int
generate
=
0
)
{
...
...
@@ -318,13 +323,13 @@ public void Generate(per_allot allot, string mail)
//第二次计算包含(保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效、保底工勤人均绩效)得出科室业绩绩效;
//根据当前业绩绩效核算出最终绩效结果
//科室经济核算汇总、工作量汇总
logManageService
.
WriteMsg
(
"科室业绩汇总"
,
"正在生成科室收入支出汇总、工作量汇总"
,
1
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
var
(
list
,
mergeSheets
)
=
processComputService
.
MergeCompute
(
excel
,
allot
.
ID
);
processComputService
.
Save
(
list
,
allot
.
ID
);
#
region
注释
////计算保底绩效参考标准(保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效)
//logManageService.WriteMsg("计算保底绩效参考标准值", "正在保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效", 1, allot.ID, "ReceiveMessage", true);
//var minimumBaiscnorm = processComputService.ComputeMinimum(excel, mergeSheets, allot.ID);
...
...
@@ -371,7 +376,8 @@ public void Generate(per_allot allot, string mail)
////科室材料考核
//logManageService.WriteMsg("正在生成绩效", "科室奖罚汇总", 1, allot.ID, "ReceiveMessage", true);
//var accountExtras = processComputService.GetAccountExtra(excel);
#
endregion
#
endregion
注释
//重新计算科室业绩(含所有提供保底金额)
logManageService
.
WriteMsg
(
"正在生成绩效"
,
"计算科室业绩分"
,
1
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
...
...
performance/Performance.Services/ConfigService.cs
View file @
31bd7330
...
...
@@ -63,6 +63,7 @@ public class ConfigService : IAutoInjection
this
.
logManageService
=
logManageService
;
this
.
logger
=
logger
;
}
#
endregion
#
region
弃用
...
...
@@ -247,6 +248,7 @@ public class ConfigService : IAutoInjection
#
endregion
#
region
cof_drugprop
药占比系数配置
/// <summary>
/// 获取cof_drugprop列表
/// </summary>
...
...
@@ -303,9 +305,11 @@ public bool DrugDelete(DrugpropRequest request)
return
_drugpropRepository
.
Remove
(
drugprop
);
}
#
endregion
#
region
cof_drugtype
药占比类别配置
/// <summary>
/// 获取cof_drugprop列表
/// </summary>
...
...
@@ -366,9 +370,11 @@ public bool DrugtypeDelete(DrugpropRequest request)
return
_drugtypeRepository
.
Remove
(
entity
);
}
#
endregion
#
region
cof_workitem
工作量绩效
/// <summary>
/// 获取cof_workitem列表
/// </summary>
...
...
@@ -423,9 +429,11 @@ public bool WorkItemkDelete(WorkItemRequest request)
return
_workitemRepository
.
Remove
(
workyear
);
}
#
endregion
#
region
cof_depttype
科室别配置
/// <summary>
/// 获取cof_drugprop列表
/// </summary>
...
...
@@ -486,9 +494,11 @@ public bool DepttypeDelete(DrugpropRequest request)
return
perforCofdepttypeRepository
.
Remove
(
entity
);
}
#
endregion
#
region
cof_cmi
cmi
/// <summary>
/// 获取 CMI配置
/// </summary>
...
...
@@ -544,9 +554,11 @@ public bool HosCMIDelete(cof_cmi request)
return
perforCofcmiRepository
.
Remove
(
entity
);
}
#
endregion
#
region
cof_again
/// <summary>
/// 获取cof_drugprop列表
/// </summary>
...
...
@@ -604,9 +616,11 @@ public bool AgainDelete(CofAgainRequest request)
return
_againRepository
.
Remove
(
again
);
}
#
endregion
#
region
Copy
/// <summary>
/// 复制报表基础配置
/// </summary>
...
...
@@ -664,7 +678,6 @@ public void Copy(per_allot allot)
#
endregion
logger
.
LogInformation
(
$"orgDurgprop"
);
var
orgDurgprop
=
_drugpropRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allot
.
ID
);
if
(
orgDurgprop
==
null
||
orgDurgprop
.
Count
==
0
)
...
...
@@ -720,9 +733,11 @@ public void Copy(per_allot allot)
_againRepository
.
AddRange
(
newAgains
.
ToArray
());
}
}
#
endregion
#
region
清楚无效数据
Clear
/// <summary>
/// 清楚无效数据
/// </summary>
...
...
@@ -734,6 +749,16 @@ public void Clear(int allotId)
}
/// <summary>
/// 删除绩效相关数据
/// </summary>
/// <param name="allotId"></param>
public
void
ClearAllotData
(
int
allotId
)
{
var
count
=
_directorRepository
.
DeleteAllotData
(
allotId
);
logManageService
.
WriteMsg
(
"清理无效数据"
,
$"清理无效数据,受影响行数:
{
count
}
"
,
1
,
allotId
,
"ReceiveMessage"
,
true
);
}
/// <summary>
/// 清除核算数据
/// </summary>
/// <param name="allotId"></param>
...
...
@@ -752,6 +777,7 @@ public void ClearAgain(int againId)
var
count
=
_directorRepository
.
DelAgain
(
againId
);
logManageService
.
WriteMsg
(
"清理无效数据"
,
$"清除二次绩效中无效数据,受影响行数:
{
count
}
"
,
1
,
againId
,
"ReceiveMessage"
,
true
);
}
#
endregion
/// <summary>
...
...
performance/Performance.Services/SecondAllotService.cs
View file @
31bd7330
...
...
@@ -28,6 +28,7 @@ public class SecondAllotService : IAutoInjection
private
readonly
PerforAgtempRepository
perforAgtempRepository
;
private
readonly
PerforAgtempitemRepository
perforAgtempitemRepository
;
private
readonly
PerforAgfixatitemRepository
perforAgfixatitemRepository
;
private
readonly
PerforAgfixatitemlogRepository
perforAgfixatitemlogRepository
;
private
readonly
PerforAgusetempRepository
perforAgusetempRepository
;
private
readonly
PerforAgcomputeRepository
perforAgcomputeRepository
;
private
readonly
PerforCofagainRepository
perforCofagainRepository
;
...
...
@@ -55,6 +56,7 @@ public class SecondAllotService : IAutoInjection
PerforAgtempRepository
perforAgtempRepository
,
PerforAgtempitemRepository
perforAgtempitemRepository
,
PerforAgfixatitemRepository
perforAgfixatitemRepository
,
PerforAgfixatitemlogRepository
perforAgfixatitemlogRepository
,
PerforAgusetempRepository
perforAgusetempRepository
,
PerforAgcomputeRepository
perforAgcomputeRepository
,
PerforCofagainRepository
perforCofagainRepository
,
...
...
@@ -81,6 +83,7 @@ public class SecondAllotService : IAutoInjection
this
.
perforAgtempRepository
=
perforAgtempRepository
;
this
.
perforAgtempitemRepository
=
perforAgtempitemRepository
;
this
.
perforAgfixatitemRepository
=
perforAgfixatitemRepository
;
this
.
perforAgfixatitemlogRepository
=
perforAgfixatitemlogRepository
;
this
.
perforAgusetempRepository
=
perforAgusetempRepository
;
this
.
perforAgcomputeRepository
=
perforAgcomputeRepository
;
this
.
perforCofagainRepository
=
perforCofagainRepository
;
...
...
@@ -678,7 +681,7 @@ private void SupplyHeaderByWorkItem(UseTempRequest request, SecondResponse resul
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
bool
SaveValue
(
List
<
ag_fixatitem
>
request
)
public
bool
SaveValue
(
List
<
ag_fixatitem
>
request
,
int
userId
)
{
var
secondId
=
request
.
First
().
SecondId
;
var
second
=
perforAgsecondallotRepository
.
GetEntity
(
t
=>
t
.
Id
==
secondId
);
...
...
@@ -686,7 +689,7 @@ public bool SaveValue(List<ag_fixatitem> request)
throw
new
PerformanceException
(
"二次绩效ID不存在"
);
var
fixatitems
=
perforAgfixatitemRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
secondId
);
var
result
=
DelValue
(
fixatitems
,
request
);
var
result
=
DelValue
(
fixatitems
,
request
,
userId
);
List
<
ag_fixatitem
>
update
=
new
List
<
ag_fixatitem
>(),
insert
=
new
List
<
ag_fixatitem
>();
if
(
fixatitems
!=
null
&&
fixatitems
.
Any
())
{
...
...
@@ -701,10 +704,12 @@ public bool SaveValue(List<ag_fixatitem> request)
cellItem
.
Type
=
item
.
Type
;
cellItem
.
UnitType
=
item
.
UnitType
;
cellItem
.
SpecialAttr
=
item
.
SpecialAttr
;
cellItem
.
UpdateDate
=
DateTime
.
Now
;
update
.
Add
(
cellItem
);
}
else
{
item
.
CreateDate
=
DateTime
.
Now
;
insert
.
Add
(
item
);
}
}
...
...
@@ -722,7 +727,7 @@ public bool SaveValue(List<ag_fixatitem> request)
/// <param name="fixatlist">数据库中查询到的值</param>
/// <param name="fixatitems">需要保存的数据</param>
/// <returns></returns>
public
bool
DelValue
(
List
<
ag_fixatitem
>
fixatlist
,
List
<
ag_fixatitem
>
fixatitems
)
public
bool
DelValue
(
List
<
ag_fixatitem
>
fixatlist
,
List
<
ag_fixatitem
>
fixatitems
,
int
userId
)
{
var
result
=
true
;
// 提交数据为空时,删除所有数据
...
...
@@ -747,6 +752,25 @@ public bool DelValue(List<ag_fixatitem> fixatlist, List<ag_fixatitem> fixatitems
{
var
delData
=
fixatlist
.
Where
(
t
=>
!
groupData
.
Select
(
w
=>
w
.
Id
).
Contains
(
t
.
ID
));
int
flag
=
fixatlist
.
RemoveAll
(
t
=>
!
groupData
.
Select
(
w
=>
w
.
Id
).
Contains
(
t
.
ID
));
var
logData
=
delData
.
Select
(
t
=>
new
ag_fixatitem_log
()
{
AllotId
=
t
.
AllotId
,
SecondId
=
t
.
SecondId
,
UnitType
=
t
.
UnitType
,
RowNumber
=
t
.
RowNumber
,
ItemName
=
t
.
ItemName
,
ItemValue
=
t
.
ItemValue
,
FactorValue
=
t
.
FactorValue
,
Sort
=
t
.
Sort
,
Type
=
t
.
Type
,
SourceType
=
t
.
SourceType
,
SpecialAttr
=
t
.
SpecialAttr
,
DeleteDate
=
DateTime
.
Now
,
DeleteUser
=
userId
});
perforAgfixatitemlogRepository
.
AddRange
(
logData
.
ToArray
());
result
=
perforAgfixatitemRepository
.
RemoveRange
(
delData
.
ToArray
());
}
...
...
@@ -754,7 +778,29 @@ public bool DelValue(List<ag_fixatitem> fixatlist, List<ag_fixatitem> fixatitems
var
saveRows
=
fixatitems
.
Select
(
t
=>
t
.
RowNumber
).
Distinct
();
var
delRows
=
fixatlist
.
Select
(
t
=>
t
.
RowNumber
).
Distinct
().
Except
(
saveRows
);
if
(
delRows
!=
null
&&
delRows
.
Count
()
>
0
)
result
=
perforAgfixatitemRepository
.
RemoveRange
(
fixatlist
.
Where
(
t
=>
delRows
.
Contains
(
t
.
RowNumber
)).
ToArray
());
{
var
delData
=
fixatlist
.
Where
(
t
=>
delRows
.
Contains
(
t
.
RowNumber
));
var
logData
=
delData
.
Select
(
t
=>
new
ag_fixatitem_log
()
{
AllotId
=
t
.
AllotId
,
SecondId
=
t
.
SecondId
,
UnitType
=
t
.
UnitType
,
RowNumber
=
t
.
RowNumber
,
ItemName
=
t
.
ItemName
,
ItemValue
=
t
.
ItemValue
,
FactorValue
=
t
.
FactorValue
,
Sort
=
t
.
Sort
,
Type
=
t
.
Type
,
SourceType
=
t
.
SourceType
,
SpecialAttr
=
t
.
SpecialAttr
,
DeleteDate
=
DateTime
.
Now
,
DeleteUser
=
userId
});
perforAgfixatitemlogRepository
.
AddRange
(
logData
.
ToArray
());
result
=
perforAgfixatitemRepository
.
RemoveRange
(
delData
.
ToArray
());
}
}
return
result
;
...
...
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