MissingCaseAppealHandler.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using Microsoft.EntityFrameworkCore;
  2. using Quartz;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Threading.Tasks;
  7. using wispro.sp.api.Job;
  8. using wispro.sp.share;
  9. namespace wispro.sp.api.AppealHandler
  10. {
  11. public class MissingCaseAppealHandler : IDoAppealObject
  12. {
  13. public void DoAppeal(AppealObject appeal, int appealRecordid, DbContext spContext)
  14. {
  15. var trigger = TriggerBuilder.Create()
  16. .WithDescription("获取案件信息")
  17. .WithSimpleSchedule(x => x.WithIntervalInSeconds(5).WithRepeatCount(0))
  18. .Build();
  19. var job = JobBuilder.Create(typeof(GetPerformanceItemJob))
  20. .WithIdentity("获取案件任务")
  21. .Build();
  22. foreach (var iv in appeal.inputFieldValues)
  23. {
  24. if(iv.InputField == null)
  25. {
  26. iv.InputField = ((spDbContext)spContext).InputFields.FirstOrDefault(s=>s.Id == iv.InputFieldId);
  27. }
  28. if(iv.InputField.FieldName == "我方文号")
  29. {
  30. job.JobDataMap.Put("CaseNo", iv.Value);
  31. continue;
  32. }
  33. if(iv.InputField.FieldName =="处理事项")
  34. {
  35. job.JobDataMap.Put("DoItem", iv.Value);
  36. continue;
  37. }
  38. if (iv.InputField.FieldName == "案件阶段")
  39. {
  40. job.JobDataMap.Put("CaseStage", iv.Value);
  41. continue;
  42. }
  43. }
  44. _ = QuartzUtil.Add(job, trigger);
  45. }
  46. }
  47. }