Commit 54317eef by 李承祥

保底配置修改

parent 50ad63fe
...@@ -106,7 +106,7 @@ public List<cof_guarantee> GuarantUpdate(GuaranteeRequest request) ...@@ -106,7 +106,7 @@ public List<cof_guarantee> GuarantUpdate(GuaranteeRequest request)
if (guaranteeList == null) if (guaranteeList == null)
throw new PerformanceException("提交数据无效"); throw new PerformanceException("提交数据无效");
var filterList = perforCofguaranteeRepository.GetEntities(t => t.AllotId == guarantee.AllotId && t.UnitType == request.UnitType && t.Target == request.Target); var filterList = perforCofguaranteeRepository.GetEntities(t => t.AllotId == guarantee.AllotId && t.UnitType == request.UnitType && t.Target == request.Target);
if (request.UnitType != guarantee.UnitType && filterList != null && filterList.Count > 0) if ((filterList != null && filterList.Count > 0) && (request.UnitType != guarantee.UnitType || request.Target != guarantee.Target))
throw new PerformanceException($"[{((UnitType)request.UnitType).ToString()}]已存在\"{request.Target}\",请重新选择"); throw new PerformanceException($"[{((UnitType)request.UnitType).ToString()}]已存在\"{request.Target}\",请重新选择");
#region 修改优先级 #region 修改优先级
...@@ -167,7 +167,7 @@ public List<cof_guarantee> GuarantUpdate(GuaranteeRequest request) ...@@ -167,7 +167,7 @@ public List<cof_guarantee> GuarantUpdate(GuaranteeRequest request)
var exist = request.Source.Where(t => t.GId.HasValue && t.GId != 0).Select(t => t.GId); var exist = request.Source.Where(t => t.GId.HasValue && t.GId != 0).Select(t => t.GId);
guaranteeList.ForEach(t => guaranteeList.ForEach(t =>
{ {
if (exist.Contains(t.Id) && !filterList.Select(s => s.Source).Contains(t.Source)) if (exist.Contains(t.Id))
t.Source = request.Source.FirstOrDefault(s => s.GId == t.Id).GValue; t.Source = request.Source.FirstOrDefault(s => s.GId == t.Id).GValue;
else else
delItem.Add(t.Id); delItem.Add(t.Id);
......
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