同步审核通过数据

parent 765e1e6f
......@@ -1760,21 +1760,7 @@ public void AddCategoryToConfig(int allotId)
public void SyncDataToResult(int allotId)
{
var sheets = perforPersheetRepository.GetEntities(t => t.AllotID == allotId && new[] { 3, 4, 7 }.Contains(t.SheetType.Value));
if (sheets == null || !sheets.Any()) return;
var data = exresultgatherRepository.GetEntities(w => w.AllotId == allotId && w.States == (int)EnumResult.AuditGather.已通过);
if (data == null || !data.Any()) return;
exresultRepository.DeleteFromQuery(w => w.AllotId == allotId && w.FromSource == (int)EnumResult.FromSource.录入);
var syncData = _mapper.Map<List<ex_result>>(data);
syncData.ForEach(x =>
{
x.Id = 0;
x.FromSource = (int)EnumResult.FromSource.录入;
x.Source = sheets.FirstOrDefault(t => t.SheetName.Contains(x.Source))?.SheetName ?? x.Source;
});
exresultRepository.AddRange(syncData.ToArray());
perforPerallotRepository.Execute($"call proc_sync_datatoresult({allotId})", new { }, 60 * 60 * 5);
}
public void AuditGather(List<Gather> gather)
......
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