Bladeren bron

新增志愿者,志愿者上报

qinchaoyue 4 maanden geleden
bovenliggende
commit
21781e7d12

+ 10 - 1
src/Hotline.Api/Controllers/Snapshot/SnapshotController.cs

@@ -240,5 +240,14 @@ public class SnapshotController : BaseController
     /// <returns></returns>
     [HttpGet("practitioner")]
     public async Task<IList<PractitionerItemOutDto>> GetPractitionerDetailAsync(PractitionerItemInDto dto)
-        => await _snapshotApplication.GetPractitionerItemsAsync(dto, CancellationToken.None);
+        => await _snapshotApplication.GetPractitionerItemsAsync(dto, HttpContext.RequestAborted);
+
+    /// <summary>
+    /// 志愿者上报
+    /// </summary>
+    /// <param name="dto"></param>
+    /// <returns></returns>
+    public async Task<AddVolunteerReportOutDto> AddVolunteerReportAsync([FromBody] AddVolunteerReportInDto dto)
+        => await _snapshotApplication.AddVolunteerReportAsync(dto, HttpContext.RequestAborted);
+
 }

+ 7 - 1
src/Hotline.Application.Tests/Application/SnapshotApplicationMockTest.cs

@@ -39,6 +39,8 @@ namespace Hotline.Application.Tests.Snapshot
         private readonly Mock<IRepository<WorkflowTrace>> _workflowTraceRepositoryMock;
         private readonly Mock<IPractitionerRepository> _practitionerRepositoryMock;
         private readonly Mock<IRepository<SystemArea>> _systemAreaRepositoryMock;
+        private readonly Mock<IVolunteerRepository> _volunteerRepositoryMock;
+        private readonly Mock<IVolunteerReportRepository> _volunteerReportRepositoryMock;
 
         private readonly DefaultSnapshotApplication _snapshotApplication;
 
@@ -60,6 +62,8 @@ namespace Hotline.Application.Tests.Snapshot
             _workflowTraceRepositoryMock = new Mock<IRepository<WorkflowTrace>>();
             _practitionerRepositoryMock = new Mock<IPractitionerRepository>();
             _systemAreaRepositoryMock = new Mock<IRepository<SystemArea>>();
+            _volunteerRepositoryMock = new Mock<IVolunteerRepository>();
+            _volunteerReportRepositoryMock = new Mock<IVolunteerReportRepository>();
 
             _snapshotApplication = new DefaultSnapshotApplication(
                 _thirdLoginServiceMock.Object,
@@ -77,7 +81,9 @@ namespace Hotline.Application.Tests.Snapshot
                 _snapshotOrderPublishRepositoryMock.Object,
                 _workflowTraceRepositoryMock.Object,
                 _practitionerRepositoryMock.Object,
-                _systemAreaRepositoryMock.Object
+                _systemAreaRepositoryMock.Object,
+                _volunteerRepositoryMock.Object,
+                _volunteerReportRepositoryMock.Object
             );
         }
 

+ 15 - 1
src/Hotline.Application.Tests/Application/SnapshotApplicationTest.cs

@@ -1,4 +1,5 @@
-using DocumentFormat.OpenXml.Wordprocessing;
+using AutoFixture;
+using DocumentFormat.OpenXml.Wordprocessing;
 using Hotline.Api.Controllers;
 using Hotline.Application.Identity;
 using Hotline.Application.Snapshot;
@@ -224,6 +225,19 @@ public class SnapshotApplicationTest : TestBase
         amount.ShouldNotBe("0");
     }
 
+    [Fact]
+    public async Task AddVolunteerReport_Test()
+    {
+        var inDto = _fixture.Create<AddVolunteerReportInDto>();
+        foreach (var item in inDto.Files)
+        {
+            item.FileName = DateTime.Now.ToShortTimeString() + "文件.doc";
+        }
+
+        var result = await _snapshotApplication.AddVolunteerReportAsync(inDto, CancellationToken.None);
+        result.Id.ShouldNotBeNull();
+    }
+
     [Fact]
     public async Task GetPractitionerItems_Test()
     {

+ 7 - 2
src/Hotline.Application/Identity/IdentityAppService.cs

@@ -24,6 +24,7 @@ using IdentityModel;
 using Mapster;
 using Microsoft.AspNetCore.Identity;
 using Microsoft.Extensions.Options;
+using SqlSugar;
 using XF.Domain.Authentications;
 using XF.Domain.Cache;
 using XF.Domain.Dependency;
@@ -50,6 +51,7 @@ public class IdentityAppService : IIdentityAppService, IScopeDependency
     private readonly IThirdIdentiyService _thirdIdentiyService;
     private readonly IThirdAccountRepository _thirdAccountRepository;
     private readonly IRepository<GuiderInfo> _guiderInfoRepository;
+    private readonly IVolunteerRepository _volunteerRepository;
 
     public IdentityAppService(
         IAccountRepository accountRepository,
@@ -66,7 +68,8 @@ public class IdentityAppService : IIdentityAppService, IScopeDependency
         IThirdAccountRepository thirdAccountRepository,
         ISessionContext sessionContext,
         IRepository<Citizen> citizenRepository,
-        IRepository<GuiderInfo> guiderInfoRepository)
+        IRepository<GuiderInfo> guiderInfoRepository,
+        IVolunteerRepository volunteerRepository)
     {
         _accountRepository = accountRepository;
         _accountDomainService = accountDomainService;
@@ -83,6 +86,7 @@ public class IdentityAppService : IIdentityAppService, IScopeDependency
         _sessionContext = sessionContext;
         _citizenRepository = citizenRepository;
         _guiderInfoRepository = guiderInfoRepository;
+        _volunteerRepository = volunteerRepository;
     }
 
     public async Task<string> OldToNewLoginAsync(HotlineLoginOldToNewDto dto, CancellationToken cancellationToken)
@@ -340,6 +344,7 @@ public class IdentityAppService : IIdentityAppService, IScopeDependency
         var expiredSeconds = jwtOptions.Expired <= 0 ? 3600 : jwtOptions.Expired;
         await _cacheAudience.SetAsync(audience.Id, audience, TimeSpan.FromSeconds(expiredSeconds));
         var token = _jwtSecurity.EncodeJwtToken(claims, audience.Ticket);
-        return new TokenOutDto(thirdAccount.CitizenType, token);
+        var isVolunteer = await _volunteerRepository.IsVolunteerAsync(thirdAccount.PhoneNumber);
+        return new TokenOutDto(thirdAccount.CitizenType, token, isVolunteer);
     }
   }

+ 1 - 1
src/Hotline.Application/Snapshot/DefaultSnapshotApplication.cs

@@ -23,7 +23,7 @@ namespace Hotline.Application.Snapshot;
 public class DefaultSnapshotApplication : SnapshotApplicationBase
     , ISnapshotApplication, IScopeDependency
 {
-    public DefaultSnapshotApplication(IThirdIdentiyService thirdLoginService, IRepository<Industry> industryRepository, ISnapshotBulletinRepository bulletinRepository, ISessionContext sessionContext, IRepository<RedPackRecord> redPackRecordRepository, IRepository<Order> orderRepository, IThirdAccountRepository thirdAccountRepository, IRepository<OrderSnapshot> orderSnapshotRepository, ISystemSettingCacheManager systemSettingCacheManager, ISystemAreaDomainService systemAreaDomainService, IFileRepository fileRepository, ISystemDicDataCacheManager systemDicDataCacheManager, ISnapshotOrderPublishRepository snapshotOrderPublishRepository, IRepository<WorkflowTrace> workflowTraceRepository,  IPractitionerRepository practitionerRepository, IRepository<SystemArea> systemAreaRepository) : base(thirdLoginService, industryRepository, bulletinRepository, sessionContext, redPackRecordRepository, orderRepository, thirdAccountRepository, orderSnapshotRepository, systemSettingCacheManager, systemAreaDomainService, fileRepository, systemDicDataCacheManager, snapshotOrderPublishRepository, workflowTraceRepository, practitionerRepository,  systemAreaRepository)
+    public DefaultSnapshotApplication(IThirdIdentiyService thirdLoginService, IRepository<Industry> industryRepository, ISnapshotBulletinRepository bulletinRepository, ISessionContext sessionContext, IRepository<RedPackRecord> redPackRecordRepository, IRepository<Order> orderRepository, IThirdAccountRepository thirdAccountRepository, IRepository<OrderSnapshot> orderSnapshotRepository, ISystemSettingCacheManager systemSettingCacheManager, ISystemAreaDomainService systemAreaDomainService, IFileRepository fileRepository, ISystemDicDataCacheManager systemDicDataCacheManager, ISnapshotOrderPublishRepository snapshotOrderPublishRepository, IRepository<WorkflowTrace> workflowTraceRepository,  IPractitionerRepository practitionerRepository, IRepository<SystemArea> systemAreaRepository, IVolunteerRepository volunteerRepository, IVolunteerReportRepository volunteerReportRepository) : base(thirdLoginService, industryRepository, bulletinRepository, sessionContext, redPackRecordRepository, orderRepository, thirdAccountRepository, orderSnapshotRepository, systemSettingCacheManager, systemAreaDomainService, fileRepository, systemDicDataCacheManager, snapshotOrderPublishRepository, workflowTraceRepository, practitionerRepository,  systemAreaRepository, volunteerRepository, volunteerReportRepository)
     {
     }
 }

+ 8 - 0
src/Hotline.Application/Snapshot/ISnapshotApplication.cs

@@ -138,4 +138,12 @@ public interface ISnapshotApplication
     /// <param name="dtos"></param>
     /// <returns></returns>
     Task AddPractitionerAsync(IList<AddPractitionerInDto> dtos);
+
+    /// <summary>
+    /// 志愿者上报
+    /// </summary>
+    /// <param name="dto"></param>
+    /// <param name="requestAborted"></param>
+    /// <returns></returns>
+    Task<AddVolunteerReportOutDto> AddVolunteerReportAsync(AddVolunteerReportInDto dto, CancellationToken requestAborted);
 }

+ 27 - 1
src/Hotline.Application/Snapshot/SnapshotApplicationBase.cs

@@ -57,8 +57,10 @@ public abstract class SnapshotApplicationBase
     private readonly ISnapshotOrderPublishRepository _snapshotOrderPublishRepository;
     private readonly IRepository<WorkflowTrace> _workflowTraceRepository;
     private readonly IPractitionerRepository _practitionerRepository;
+    private readonly IVolunteerRepository _volunteerRepository;
+    private readonly IVolunteerReportRepository _volunteerReportRepository;
 
-    public SnapshotApplicationBase(IThirdIdentiyService thirdLoginService, IRepository<Industry> industryRepository, ISnapshotBulletinRepository bulletinRepository, ISessionContext sessionContext, IRepository<RedPackRecord> redPackRecordRepository, IRepository<Order> orderRepository, IThirdAccountRepository thirdAccountRepository, IRepository<OrderSnapshot> orderSnapshotRepository, ISystemSettingCacheManager systemSettingCacheManager, ISystemAreaDomainService systemAreaDomainService, IFileRepository fileRepository, ISystemDicDataCacheManager systemDicDataCacheManager, ISnapshotOrderPublishRepository snapshotOrderPublishRepository, IRepository<WorkflowTrace> workflowTraceRepository, IPractitionerRepository practitionerRepository, IRepository<SystemArea> systemAreaRepository)
+    public SnapshotApplicationBase(IThirdIdentiyService thirdLoginService, IRepository<Industry> industryRepository, ISnapshotBulletinRepository bulletinRepository, ISessionContext sessionContext, IRepository<RedPackRecord> redPackRecordRepository, IRepository<Order> orderRepository, IThirdAccountRepository thirdAccountRepository, IRepository<OrderSnapshot> orderSnapshotRepository, ISystemSettingCacheManager systemSettingCacheManager, ISystemAreaDomainService systemAreaDomainService, IFileRepository fileRepository, ISystemDicDataCacheManager systemDicDataCacheManager, ISnapshotOrderPublishRepository snapshotOrderPublishRepository, IRepository<WorkflowTrace> workflowTraceRepository, IPractitionerRepository practitionerRepository, IRepository<SystemArea> systemAreaRepository, IVolunteerRepository volunteerRepository, IVolunteerReportRepository volunteerReportRepository)
     {
         _thirdLoginService = thirdLoginService;
         _industryRepository = industryRepository;
@@ -76,6 +78,8 @@ public abstract class SnapshotApplicationBase
         _workflowTraceRepository = workflowTraceRepository;
         _practitionerRepository = practitionerRepository;
         _systemAreaRepository = systemAreaRepository;
+        _volunteerRepository = volunteerRepository;
+        _volunteerReportRepository = volunteerReportRepository;
     }
 
     /// <summary>
@@ -526,4 +530,26 @@ public abstract class SnapshotApplicationBase
         return item.Adapt<PractitionerDetailOutDto>();
     }
     #endregion
+
+    #region 志愿者
+    /// <summary>
+    /// 志愿者上报
+    /// </summary>
+    /// <param name="dto"></param>
+    /// <param name="requestAborted"></param>
+    /// <returns></returns>
+    public async Task<AddVolunteerReportOutDto> AddVolunteerReportAsync(AddVolunteerReportInDto dto, CancellationToken requestAborted)
+    {
+        var volunteer = await _volunteerRepository.GetByPhoneAsync(_sessionContext.Phone)
+                ?? throw UserFriendlyException.SameMessage("提交失败!您不是志愿者.");
+
+        var entity = dto.Adapt<VolunteerReport>();
+        entity.Volunteer = volunteer.Name;
+        entity.VolunteerPhone = volunteer.PhoneNumber;
+
+        entity.Id = await _volunteerReportRepository.AddAsync(entity, requestAborted);
+        await _fileRepository.AddFileAsync(dto.Files, entity.Id , requestAborted);
+        return entity.Adapt<AddVolunteerReportOutDto>();
+    }
+    #endregion
 }

+ 1 - 1
src/Hotline.Application/Snapshot/ZiGongSnapshotApplication.cs

@@ -22,7 +22,7 @@ namespace Hotline.Application.Snapshot;
 [Injection(AppScopes = EAppScope.ZiGong)]
 public class ZiGongSnapshotApplication : SnapshotApplicationBase, ISnapshotApplication, IScopeDependency
 {
-    public ZiGongSnapshotApplication(IThirdIdentiyService thirdLoginService, IRepository<Industry> industryRepository, ISnapshotBulletinRepository bulletinRepository, ISessionContext sessionContext, IRepository<RedPackRecord> redPackRecordRepository, IRepository<Order> orderRepository, IThirdAccountRepository thirdAccountRepository, IRepository<OrderSnapshot> orderSnapshotRepository, ISystemSettingCacheManager systemSettingCacheManager, ISystemAreaDomainService systemAreaDomainService, IFileRepository fileRepository, ISystemDicDataCacheManager systemDicDataCacheManager, ISnapshotOrderPublishRepository snapshotOrderPublishRepository, IRepository<WorkflowTrace> workflowTraceRepository, IPractitionerRepository practitionerRepository, IRepository<SystemArea> systemAreaRepository) : base(thirdLoginService, industryRepository, bulletinRepository, sessionContext, redPackRecordRepository, orderRepository, thirdAccountRepository, orderSnapshotRepository, systemSettingCacheManager, systemAreaDomainService, fileRepository, systemDicDataCacheManager, snapshotOrderPublishRepository, workflowTraceRepository, practitionerRepository, systemAreaRepository)
+    public ZiGongSnapshotApplication(IThirdIdentiyService thirdLoginService, IRepository<Industry> industryRepository, ISnapshotBulletinRepository bulletinRepository, ISessionContext sessionContext, IRepository<RedPackRecord> redPackRecordRepository, IRepository<Order> orderRepository, IThirdAccountRepository thirdAccountRepository, IRepository<OrderSnapshot> orderSnapshotRepository, ISystemSettingCacheManager systemSettingCacheManager, ISystemAreaDomainService systemAreaDomainService, IFileRepository fileRepository, ISystemDicDataCacheManager systemDicDataCacheManager, ISnapshotOrderPublishRepository snapshotOrderPublishRepository, IRepository<WorkflowTrace> workflowTraceRepository, IPractitionerRepository practitionerRepository, IRepository<SystemArea> systemAreaRepository, IVolunteerRepository volunteerRepository, IVolunteerReportRepository volunteerReportRepository) : base(thirdLoginService, industryRepository, bulletinRepository, sessionContext, redPackRecordRepository, orderRepository, thirdAccountRepository, orderSnapshotRepository, systemSettingCacheManager, systemAreaDomainService, fileRepository, systemDicDataCacheManager, snapshotOrderPublishRepository, workflowTraceRepository, practitionerRepository, systemAreaRepository, volunteerRepository, volunteerReportRepository)
     {
     }
 }

+ 1 - 1
src/Hotline.Repository.SqlSugar/File/FileRepository.cs

@@ -27,7 +27,7 @@ namespace Hotline.Repository.SqlSugar.File
 			_mapper = mapper;
 		}
 
-        public async Task<List<FileJson>> AddFileAsync(IList<IndustryFileInDto> files, string id, CancellationToken requestAborted)
+        public async Task<List<FileJson>> AddFileAsync(IList<SnapshotFileInDto> files, string id, CancellationToken requestAborted)
         {
 			var entities = files.Adapt<List<Hotline.File.File>>();
 			foreach (var file in entities)

+ 18 - 0
src/Hotline.Repository.SqlSugar/Snapshot/VolunteerReportRepository.cs

@@ -0,0 +1,18 @@
+using Hotline.Repository.SqlSugar.DataPermissions;
+using Hotline.Snapshot;
+using Hotline.Snapshot.Interfaces;
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using XF.Domain.Dependency;
+
+namespace Hotline.Repository.SqlSugar.Snapshot;
+public class VolunteerReportRepository : BaseRepository<VolunteerReport>, IVolunteerReportRepository, IScopeDependency
+{
+    public VolunteerReportRepository(ISugarUnitOfWork<HotlineDbContext> uow, IDataPermissionFilterBuilder dataPermissionFilterBuilder) : base(uow, dataPermissionFilterBuilder)
+    {
+    }
+}

+ 32 - 0
src/Hotline.Repository.SqlSugar/Snapshot/VolunteerRepository.cs

@@ -0,0 +1,32 @@
+using Hotline.Repository.SqlSugar.DataPermissions;
+using Hotline.Share.Dtos.FlowEngine.Workflow;
+using Hotline.Share.Tools;
+using Hotline.Snapshot;
+using Hotline.Snapshot.Interfaces;
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using XF.Domain.Dependency;
+
+namespace Hotline.Repository.SqlSugar.Snapshot;
+public class VolunteerRepository : BaseRepository<Volunteer>, IVolunteerRepository, IScopeDependency
+{
+    public VolunteerRepository(ISugarUnitOfWork<HotlineDbContext> uow, IDataPermissionFilterBuilder dataPermissionFilterBuilder) : base(uow, dataPermissionFilterBuilder)
+    {
+    }
+
+    public async Task<Volunteer> GetByPhoneAsync(string? phone)
+    {
+        if (phone.IsNullOrEmpty()) return null;
+        return await Queryable().Where(m => m.PhoneNumber == phone.Trim()).FirstAsync();
+    }
+
+    public async Task<bool> IsVolunteerAsync(string? phoneNumber)
+    {
+        if (phoneNumber.IsNullOrEmpty()) return false;
+        return await Queryable().Where(m => m.PhoneNumber == phoneNumber.Trim()).AnyAsync();
+    }
+}

+ 1 - 1
src/Hotline.Share/Dtos/Snapshot/IndustryFileDto.cs

@@ -40,7 +40,7 @@ public class IndustryFileDto
 /// <summary>
 /// 随手拍上报接口附件入参
 /// </summary>
-public class IndustryFileInDto
+public class SnapshotFileInDto
 {
     /// <summary>
     /// 文件名称(有后缀)

+ 1 - 1
src/Hotline.Share/Dtos/Snapshot/OrderDto.cs

@@ -147,7 +147,7 @@ public class AddSnapshotOrderInDto : Position
     /// <summary>
     /// 附件信息
     /// </summary>
-    public IList<IndustryFileInDto> Files { get; set; }
+    public IList<SnapshotFileInDto> Files { get; set; }
 
     /// <summary>
     /// 事件描述

+ 7 - 1
src/Hotline.Share/Dtos/Snapshot/ThirdTokenDto.cs

@@ -5,8 +5,9 @@ namespace Hotline.Share.Dtos.Snapshot;
 
 public class TokenOutDto
 {
-    public TokenOutDto(EReadPackUserType citizenType, string token)
+    public TokenOutDto(EReadPackUserType citizenType, string token, bool isVolunteer)
     {
+        IsVolunteer = isVolunteer;
         UserType = citizenType;
         Token = token;
     }
@@ -20,6 +21,11 @@ public class TokenOutDto
     /// 登录token
     /// </summary>
     public string Token { get; set; }
+
+    /// <summary>
+    /// 是否自愿者
+    /// </summary>
+    public bool IsVolunteer { get; set; }
 }
 
 public class ThirdTokenInDto

+ 37 - 0
src/Hotline.Share/Dtos/Snapshot/VolunteerDto.cs

@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Hotline.Share.Dtos.Snapshot;
+public class AddVolunteerInDto
+{
+    /// <summary>
+    /// 姓名
+    /// </summary>
+    [Required]
+    public string Name { get; set; }
+
+    /// <summary>
+    /// 电话
+    /// </summary>
+    [Required]
+    public string PhoneNumber { get; set; }
+}
+
+public class VolunteerListOutDto
+{
+    public string Id { get; set; }
+
+    /// <summary>
+    /// 姓名
+    /// </summary>
+    public string Name { get; set; }
+
+    /// <summary>
+    /// 电话
+    /// </summary>
+    public string PhoneNumber { get; set; }
+}

+ 77 - 0
src/Hotline.Share/Dtos/Snapshot/VolunteerReportDto.cs

@@ -0,0 +1,77 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Hotline.Share.Dtos.Snapshot;
+public class AddVolunteerReportInDto : Position
+{
+    /// <summary>
+    /// 作业类型
+    /// </summary>
+    public string JobType { get; set; }
+
+    /// <summary>
+    /// 上报人联系方式
+    /// </summary>
+    public string PhoneNumber { get; set; }
+
+    /// <summary>
+    /// 上报人姓名
+    /// </summary>
+    public string Name { get; set; }
+
+    /// <summary>
+    /// 是否已经申报
+    /// </summary>
+    public bool IsDeclare { get; set; }
+
+    /// <summary>
+    /// 生产经营单位内部是否按规定办理审批手续
+    /// </summary>
+    public bool IsApprovalProcess { get; set; }
+
+    /// <summary>
+    /// 电气焊作业人员是否取得职业资格证书
+    /// </summary>
+    public bool IsProfessionalCertificate { get; set; }
+
+    /// <summary>
+    /// 是否落实作业现场监护人员
+    /// </summary>
+    public bool IsSiteMonitoring { get; set; }
+
+    /// <summary>
+    /// 是否在人员密集场所营业期间动火作业
+    /// </summary>
+    public bool IsFireWork { get; set; }
+
+    /// <summary>
+    /// 是否清除作业现场及周围易燃物品或落实有效安全防范措施
+    /// </summary>
+    public bool IsClearSafety { get; set; }
+
+    /// <summary>
+    /// 作业现场是否配备能满足现场灭火应急需求消防器材
+    /// </summary>
+    public bool HasFireEquipment { get; set; }
+
+    /// <summary>
+    /// 作业现场使用的工器具是否进行安全检查
+    /// </summary>
+    public bool IsToolSafety { get; set; }
+
+    /// <summary>
+    /// 附件信息
+    /// </summary>
+    public IList<SnapshotFileInDto> Files { get; set; }
+}
+
+public class AddVolunteerReportOutDto
+{
+    /// <summary>
+    /// Id
+    /// </summary>
+    public string Id { get; set; }
+}

+ 1 - 1
src/Hotline/File/IFileRepository.cs

@@ -17,6 +17,6 @@ namespace Hotline.File
 		Task<List<FileDto>> GetFilesAsync(List<string> ids, CancellationToken cancellationToken);
 		Task<List<WorkflowTraceDto>> WorkflowTraceRecursion(List<WorkflowTraceDto> dto, CancellationToken cancellationToken);
 		Task<List<Hotline.File.File>> GetByKeyAsync(string key, CancellationToken cancellationToken);
-        Task<List<FileJson>> AddFileAsync(IList<IndustryFileInDto> files, string id, CancellationToken requestAborted);
+        Task<List<FileJson>> AddFileAsync(IList<SnapshotFileInDto> files, string id, CancellationToken requestAborted);
     }
 }

+ 11 - 0
src/Hotline/Snapshot/Interfaces/IVolunteerReportRepository.cs

@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using XF.Domain.Repository;
+
+namespace Hotline.Snapshot.Interfaces;
+public interface IVolunteerReportRepository : IRepository<VolunteerReport>
+{
+}

+ 24 - 0
src/Hotline/Snapshot/Interfaces/IVolunteerRepository.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using XF.Domain.Repository;
+
+namespace Hotline.Snapshot.Interfaces;
+public interface IVolunteerRepository : IRepository<Volunteer>
+{
+    /// <summary>
+    /// 根据电话获取志愿者信息
+    /// </summary>
+    /// <param name="phone"></param>
+    /// <returns></returns>
+    Task<Volunteer> GetByPhoneAsync(string? phone);
+
+    /// <summary>
+    /// 是否志愿者
+    /// </summary>
+    /// <param name="phoneNumber"></param>
+    /// <returns></returns>
+    Task<bool> IsVolunteerAsync(string? phoneNumber);
+}

+ 29 - 0
src/Hotline/Snapshot/Volunteer.cs

@@ -0,0 +1,29 @@
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using XF.Domain.Repository;
+
+namespace Hotline.Snapshot;
+
+/// <summary>
+/// 志愿者
+/// </summary>
+[Description("志愿者")]
+public class Volunteer : FullStateEntity
+{
+    /// <summary>
+    /// 姓名
+    /// </summary>
+    [SugarColumn(ColumnDescription ="姓名")]
+    public string Name { get; set; }
+
+    /// <summary>
+    /// 电话
+    /// </summary>
+    [SugarColumn(ColumnDescription = "电话")]
+    public string PhoneNumber { get; set; }
+}

+ 160 - 0
src/Hotline/Snapshot/VolunteerReport.cs

@@ -0,0 +1,160 @@
+using Hotline.Share.Dtos;
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using XF.Domain.Repository;
+
+namespace Hotline.Snapshot;
+
+/// <summary>
+/// 志愿者上报
+/// </summary>
+[Description("志愿者上报")]
+public class VolunteerReport : FullStateEntity
+{
+    /// <summary>
+    /// 作业类型
+    /// </summary>
+    [SugarColumn(ColumnDescription = "作业类型")]
+    public string JobType { get; set; }
+
+    /// <summary>
+    /// 上报人联系方式
+    /// </summary>
+    [SugarColumn(ColumnDescription = "上报人联系方式")]
+    public string PhoneNumber { get; set; }
+
+    /// <summary>
+    /// 上报人姓名
+    /// </summary>
+    [SugarColumn(ColumnDescription = "上报人姓名")]
+    public string Name { get; set; }
+
+    /// <summary>
+    /// 志愿者姓名
+    /// </summary>
+    [SugarColumn(ColumnDescription = "志愿者姓名")]
+    public string Volunteer { get; set; }
+
+    /// <summary>
+    /// 志愿者电话
+    /// </summary>
+    [SugarColumn(ColumnDescription = "志愿者电话")]
+    public string VolunteerPhone { get; set; }
+
+    /// <summary>
+    /// 是否已经申报
+    /// </summary>
+    [SugarColumn(ColumnDescription = "是否已经申报")]
+    public bool IsDeclare { get; set; }
+
+    /// <summary>
+    /// 生产经营单位内部是否按规定办理审批手续
+    /// </summary>
+    [SugarColumn(ColumnDescription = "生产经营单位内部是否按规定办理审批手续")]
+    public bool IsApprovalProcess { get; set; }
+
+    /// <summary>
+    /// 电气焊作业人员是否取得职业资格证书
+    /// </summary>
+    [SugarColumn(ColumnDescription = "电气焊作业人员是否取得职业资格证书")]
+    public bool IsProfessionalCertificate { get; set; }
+
+    /// <summary>
+    /// 是否落实作业现场监护人员
+    /// </summary>
+    [SugarColumn(ColumnDescription = "是否落实作业现场监护人员")]
+    public bool IsSiteMonitoring { get; set; }
+
+    /// <summary>
+    /// 是否在人员密集场所营业期间动火作业
+    /// </summary>
+    [SugarColumn(ColumnDescription = "是否在人员密集场所营业期间动火作业")]
+    public bool IsFireWork { get; set; }
+
+    /// <summary>
+    /// 是否清除作业现场及周围易燃物品或落实有效安全防范措施
+    /// </summary>
+    [SugarColumn(ColumnDescription = "是否清除作业现场及周围易燃物品或落实有效安全防范措施")]
+    public bool IsClearSafety { get; set; }
+
+    /// <summary>
+    /// 作业现场是否配备能满足现场灭火应急需求消防器材
+    /// </summary>
+    [SugarColumn(ColumnDescription = "作业现场是否配备能满足现场灭火应急需求消防器材")]
+    public bool HasFireEquipment { get; set; }
+
+    /// <summary>
+    /// 作业现场使用的工器具是否进行安全检查
+    /// </summary>
+    [SugarColumn(ColumnDescription = "作业现场使用的工器具是否进行安全检查")]
+    public bool IsToolSafety { get; set; }
+
+    #region 地址信息
+    /// <summary>
+    /// 经度
+    /// </summary>
+    [SugarColumn(ColumnDescription = "经度")]
+    public double? Longitude { get; set; }
+
+    /// <summary>
+    /// 维度
+    /// </summary>
+    [SugarColumn(ColumnDescription = "维度")]
+    public double? Latitude { get; set; }
+
+    /// <summary>
+    /// 行政区划编码;
+    /// Area对象的Id;
+    /// </summary>
+    [SugarColumn(ColumnDescription = "行政区编码")]
+    public string? AreaCode { get; set; }
+
+    /// <summary>
+    /// 省
+    /// </summary>
+    [SugarColumn(ColumnDescription = "省")]
+    public string? Province { get; set; }
+
+    /// <summary>
+    /// 市
+    /// </summary>
+    [SugarColumn(ColumnDescription = "市")]
+    public string? City { get; set; }
+
+    /// <summary>
+    /// 区/县
+    /// </summary>
+    [SugarColumn(ColumnDescription = "区县")]
+    public string? County { get; set; }
+
+    /// <summary>
+    /// 乡镇(4级行政区划)
+    /// </summary>
+    [SugarColumn(ColumnDescription = "4级行政区划")]
+    public string? Town { get; set; }
+
+    /// <summary>
+    /// 详细街道
+    /// </summary>
+    [SugarColumn(ColumnDescription = "详细街道")]
+    public string? Street { get; set; }
+
+    /// <summary>
+    /// 行政区划地址
+    /// </summary>
+    [SugarColumn(ColumnDescription = "行政区划地址")]
+    public string? Address { get; set; }
+
+    /// <summary>
+    /// 完整地址
+    /// </summary>
+    [SugarColumn(ColumnDescription = "完整地址")]
+    public string? FullAddress { get; set; }
+
+    #endregion
+}