Commit 7b15f709 by 纪旭 韦

预留管理保存

parent 543d34be
...@@ -109,7 +109,8 @@ public bool ModifyBudgetData(List<BudgetResponse> request) ...@@ -109,7 +109,8 @@ public bool ModifyBudgetData(List<BudgetResponse> request)
if (request == null || !request.Any(t => t.Type == 1) || !request.Any(t => t.Type == 2)) if (request == null || !request.Any(t => t.Type == 1) || !request.Any(t => t.Type == 2))
throw new PerformanceException("提交数据中含无效数据"); throw new PerformanceException("提交数据中含无效数据");
var amounts = perbudgetamountRepository.GetEntities(w => request.Where(t => t.Type == 1).Select(t => t.Id).Contains(w.Id)); var requestType1Ids = request.Where(t => t.Type == 1).Select(t => t.Id);
var amounts = perbudgetamountRepository.GetEntities(w => requestType1Ids.Contains(w.Id));
if (amounts != null && amounts.Any()) if (amounts != null && amounts.Any())
{ {
foreach (var item in amounts) foreach (var item in amounts)
...@@ -139,7 +140,9 @@ public bool ModifyBudgetData(List<BudgetResponse> request) ...@@ -139,7 +140,9 @@ public bool ModifyBudgetData(List<BudgetResponse> request)
perbudgetamountRepository.UpdateRange(amounts.ToArray()); perbudgetamountRepository.UpdateRange(amounts.ToArray());
} }
var ratios = perbudgetratioRepository.GetEntities(w => request.Where(t => t.Type == 2).Select(t => t.Id).Contains(w.Id)); var requestType2Ids = request.Where(t => t.Type == 2).Select(t => t.Id);
var ratios = perbudgetratioRepository.GetEntities(w => requestType2Ids.Contains(w.Id));
if (ratios != null && ratios.Any()) if (ratios != null && ratios.Any())
{ {
foreach (var item in ratios) foreach (var item in ratios)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment