Commit 58138c57 by lcx

其他来源数据修改

parent eb1dd67f
...@@ -112,7 +112,8 @@ public List<SecondListResponse> GetSecondList(int userId) ...@@ -112,7 +112,8 @@ public List<SecondListResponse> GetSecondList(int userId)
Month = allot.Month, Month = allot.Month,
Department = user.Department, Department = user.Department,
UnitType = ((UnitType)account.UnitType).ToString(), UnitType = ((UnitType)account.UnitType).ToString(),
RealGiveFee = account.RealGiveFee RealGiveFee = account.RealGiveFee,
Status = 1
}; };
newSecond.Add(second); newSecond.Add(second);
} }
...@@ -291,7 +292,7 @@ public SecondResponse GetSecondDetail(UseTempRequest request) ...@@ -291,7 +292,7 @@ public SecondResponse GetSecondDetail(UseTempRequest request)
{ {
HeadItems = result.HeadItems.OrderBy(t => t.Type).ThenBy(t => t.Sort).ThenBy(t => t.FiledName).ToList(), HeadItems = result.HeadItems.OrderBy(t => t.Type).ThenBy(t => t.Sort).ThenBy(t => t.FiledName).ToList(),
BodyItems = result.BodyItems.OrderBy(t => t.RowNumber).ThenBy(t => t.Type).ThenBy(t => t.Sort).ToList(), BodyItems = result.BodyItems.OrderBy(t => t.RowNumber).ThenBy(t => t.Type).ThenBy(t => t.Sort).ToList(),
}; ; };
} }
/// <summary> /// <summary>
...@@ -539,7 +540,8 @@ public bool UseTemp(UseTempRequest request) ...@@ -539,7 +540,8 @@ public bool UseTemp(UseTempRequest request)
var addList = new List<ag_fixatitem>(); var addList = new List<ag_fixatitem>();
var allotList = perforPerallotRepository.GetEntities(t => t.HospitalId == request.HospitalId); var allotList = perforPerallotRepository.GetEntities(t => t.HospitalId == request.HospitalId);
var secondList = Mapper.Map<List<SecondListResponse>>(perforAgsecondallotRepository.GetEntities(t => allotList.Select(a => a.ID).Contains(t.AllotId.Value) && new List<int> { 1, 4 }.Contains(t.Status ?? 1))); var seconds = perforAgsecondallotRepository.GetEntities(t => allotList.Select(a => a.ID).Contains(t.AllotId.Value) && new List<int> { 1, 4 }.Contains(t.Status ?? 1));
var secondList = Mapper.Map<List<SecondListResponse>>(seconds);
secondList?.ForEach(t => t.IsArchive = allotList.FirstOrDefault(a => a.ID == t.AllotId).States == 8 ? 1 : 0); secondList?.ForEach(t => t.IsArchive = allotList.FirstOrDefault(a => a.ID == t.AllotId).States == 8 ? 1 : 0);
//获取未归档 未提交 驳回 的二次绩效 //获取未归档 未提交 驳回 的二次绩效
...@@ -550,12 +552,17 @@ public bool UseTemp(UseTempRequest request) ...@@ -550,12 +552,17 @@ public bool UseTemp(UseTempRequest request)
var fixatList = perforAgfixatitemRepository.GetEntities(t => secondId.Contains(t.SecondId.Value)); var fixatList = perforAgfixatitemRepository.GetEntities(t => secondId.Contains(t.SecondId.Value));
#region 获取需要添加的数据 无需操作的数据 #region 获取需要添加的数据 无需操作的数据
var update_second_usetemps = new List<ag_secondallot>();
foreach (var second in secondList) foreach (var second in secondList)
{ {
foreach (var head in headItems) foreach (var head in headItems)
{ {
if (second.IsArchive == 0 && new List<int> { 1, 4 }.Contains(second.Status ?? 1)) if (second.IsArchive == 0 && new List<int> { 1, 4 }.Contains(second.Status ?? 1))
{ {
var update_second_usetemp = seconds.FirstOrDefault(t => t.Id == second.Id);
update_second_usetemp.UseTempId = request.TempId;
update_second_usetemps.Add(update_second_usetemp);
var exist = fixatList?.Where(t => t.ItemName == head.FiledName && t.Type == head.Type && t.SecondId == second.Id); var exist = fixatList?.Where(t => t.ItemName == head.FiledName && t.Type == head.Type && t.SecondId == second.Id);
if (exist != null && exist.Count() > 0) if (exist != null && exist.Count() > 0)
list.AddRange(exist); list.AddRange(exist);
...@@ -582,6 +589,7 @@ public bool UseTemp(UseTempRequest request) ...@@ -582,6 +589,7 @@ public bool UseTemp(UseTempRequest request)
} }
} }
#endregion #endregion
perforAgsecondallotRepository.UpdateRange(update_second_usetemps.ToArray());
if (list != null && list.Count > 0) if (list != null && list.Count > 0)
{ {
var delList = fixatList.Except(list); var delList = fixatList.Except(list);
......
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