瀏覽代碼

志愿者上报集合

qinchaoyue 4 月之前
父節點
當前提交
a41f9c7eb2

+ 10 - 0
src/Hotline.Api/Controllers/Snapshot/IndustryController.cs

@@ -11,6 +11,7 @@ using Hotline.Snapshot;
 using Hotline.Snapshot.Interfaces;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Options;
+using SqlSugar;
 
 namespace Hotline.Api.Controllers.Snapshot;
 
@@ -280,5 +281,14 @@ public class IndustryController : BaseController
     [HttpPut("volunteer")]
     public async Task UpdateVolunteerAsync(UpdateVolunteerInDto dto)
         => await _industryApplication.UpdateVolunteerAsync(dto);
+
+    /// <summary>
+    /// 志愿者上报集合
+    /// </summary>
+    /// <param name="dto"></param>
+    /// <returns></returns>
+    [HttpGet("volunteer/report")]
+    public async Task<PagedDto<VolunteerReportItemsOutDto>> GetVolunteerReportItemsAsync(VolunteerReportItemsInDto dto)
+        => (await _industryApplication.GetVolunteerReportItemsAsync(dto).ToPagedListAsync(dto)).ToPaged();
     #endregion
 }

+ 7 - 0
src/Hotline.Application/Snapshot/IIndustryApplication.cs

@@ -163,4 +163,11 @@ public interface IIndustryApplication
     /// <param name="dto"></param>
     /// <returns></returns>
     Task UpdateVolunteerAsync(UpdateVolunteerInDto dto);
+
+    /// <summary>
+    /// 志愿者上报集合
+    /// </summary>
+    /// <param name="dto"></param>
+    /// <returns></returns>
+    ISugarQueryable<VolunteerReportItemsOutDto> GetVolunteerReportItemsAsync(VolunteerReportItemsInDto dto);
 }

+ 18 - 1
src/Hotline.Application/Snapshot/IndustryApplication.cs

@@ -29,8 +29,9 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
     private readonly ISnapshotSMSTemplateRepository _snapshotSMSTemplateRepository;
     private readonly IPractitionerRepository _practitionerRepository;
     private readonly IVolunteerRepository _volunteerRepository;
+    private readonly IVolunteerReportRepository _volunteerReportRepository;
 
-    public IndustryApplication(IIndustryRepository industryRepository, IFileRepository fileRepository, ISystemSettingCacheManager sysSetting, IIndustryCaseRepository industryCaseRepository, ISnapshotSMSTemplateRepository snapshotSMSTemplateRepository, IPractitionerRepository practitionerRepository, IVolunteerRepository volunteerRepository)
+    public IndustryApplication(IIndustryRepository industryRepository, IFileRepository fileRepository, ISystemSettingCacheManager sysSetting, IIndustryCaseRepository industryCaseRepository, ISnapshotSMSTemplateRepository snapshotSMSTemplateRepository, IPractitionerRepository practitionerRepository, IVolunteerRepository volunteerRepository, IVolunteerReportRepository volunteerReportRepository)
     {
         _industryRepository = industryRepository;
         _fileRepository = fileRepository;
@@ -39,6 +40,7 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
         _snapshotSMSTemplateRepository = snapshotSMSTemplateRepository;
         _practitionerRepository = practitionerRepository;
         _volunteerRepository = volunteerRepository;
+        _volunteerReportRepository = volunteerReportRepository;
     }
     /// <summary>
     /// 新增行业
@@ -357,5 +359,20 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
         dto.Adapt(entity);
         await _volunteerRepository.UpdateAsync(entity);
     }
+
+    /// <summary>
+    /// 志愿者上报集合
+    /// </summary>
+    /// <param name="dto"></param>
+    /// <returns></returns>
+    public ISugarQueryable<VolunteerReportItemsOutDto> GetVolunteerReportItemsAsync(VolunteerReportItemsInDto dto)
+    {
+        var query = _volunteerReportRepository.Queryable()
+            .WhereIF(dto.Name.NotNullOrEmpty(), m => m.Name.Contains(dto.Name))
+            .WhereIF(dto.PhoneNumber.NotNullOrEmpty(), m => m.PhoneNumber.Contains(dto.PhoneNumber))
+            .OrderByDescending(m => m.CreationTime)
+            .Select<VolunteerReportItemsOutDto>();
+        return query;
+    }
     #endregion
 }

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

@@ -429,7 +429,7 @@ public class SnapshotSMSTemplateItemsOutDto : AddSnapshotSMSTemplateInDto
     public string IndustryName { get; set; }
 }
 
-public class UpdateSnapshotSMSTemplateInDto
+public class UpdateSnapshotSMSTemplateInDto : AddSnapshotSMSTemplateInDto
 {
     /// <summary>
     /// Id

+ 72 - 1
src/Hotline.Share/Dtos/Snapshot/VolunteerReportDto.cs

@@ -1,4 +1,5 @@
-using System;
+using Hotline.Share.Requests;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -75,3 +76,73 @@ public class AddVolunteerReportOutDto
     /// </summary>
     public string Id { get; set; }
 }
+
+/// <summary>
+/// 入参
+/// </summary>
+/// <param name="Name">名字</param>
+/// <param name="PhoneNumber">电话</param>
+public record VolunteerReportItemsInDto(string? Name , string? PhoneNumber) : PagedRequest;
+
+public class VolunteerReportItemsOutDto
+{
+    /// <summary>
+    /// Id
+    /// </summary>
+    public string Id { get; set; }
+
+    /// <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; }
+}