VolunteerReportApplication.cs 957 B

1234567891011121314151617181920212223242526272829
  1. using Hotline.Snapshot;
  2. using Mapster;
  3. using SnapshotWinFormsApp.Application.Dtos;
  4. using SnapshotWinFormsApp.Application.Interfaces;
  5. using SnapshotWinFormsApp.Entities.OldHotline;
  6. using SnapshotWinFormsApp.Repository.Interfaces;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.ComponentModel;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. namespace SnapshotWinFormsApp.Application;
  14. [Description("志愿者上报")]
  15. public class VolunteerReportApplication : ImportApplicationBase<SSP_Volunteer, VolunteerReport>, IImportApplication
  16. {
  17. public VolunteerReportApplication(CreateInstanceInDto inDto) : base(inDto)
  18. {
  19. }
  20. public override async Task<VolunteerReport> GetTargetAsync(SSP_Volunteer source, CancellationToken token)
  21. {
  22. var target = source.Adapt<VolunteerReport>();
  23. target.JobType = JobType.FirstOrDefault(m => m.DicDataName == target.JobType)?.Id;
  24. return target;
  25. }
  26. }