Browse Source

完成添加随手拍工单接口

qinchaoyue 4 months ago
parent
commit
4927505cf5

+ 45 - 2
src/Hotline.Api/Controllers/Snapshot/SnapshotController.cs

@@ -1,15 +1,24 @@
-using Hotline.Application.Snapshot;
+using Hotline.Application.Orders;
+using Hotline.Application.Snapshot;
+using Hotline.File;
 using Hotline.Orders;
 using Hotline.Settings;
 using Hotline.Share.Dtos;
 using Hotline.Share.Dtos.Article;
+using Hotline.Share.Dtos.Order;
 using Hotline.Share.Dtos.Settings;
 using Hotline.Share.Dtos.Snapshot;
+using Hotline.Share.Enums.Order;
+using Hotline.Share.Enums.Snapshot;
+using Hotline.Share.Tools;
+using Hotline.Snapshot;
+using Hotline.Tools;
 using Mapster;
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Mvc;
 using System.ComponentModel.DataAnnotations;
 using System.Reflection;
+using XF.Domain.Exceptions;
 using XF.Domain.Repository;
 
 namespace Hotline.Api.Controllers.Snapshot;
@@ -22,12 +31,18 @@ public class SnapshotController : BaseController
     private readonly IRepository<Order> _orderRepository;
     private readonly ISnapshotApplication _snapshotApplication;
     private readonly ISystemAreaDomainService _systemAreaDomainService;
+    private readonly IIndustryRepository _industryRepository;
+    private readonly IOrderDomainService _orderDomainService;
+    private readonly IFileRepository _fileRepository;
 
-    public SnapshotController(IRepository<Order> orderRepository, ISnapshotApplication snapshotApplication, ISystemAreaDomainService systemAreaDomainService)
+    public SnapshotController(IRepository<Order> orderRepository, ISnapshotApplication snapshotApplication, ISystemAreaDomainService systemAreaDomainService, IIndustryRepository industryRepository, IOrderDomainService orderDomainService, IFileRepository fileRepository)
     {
         _orderRepository = orderRepository;
         _snapshotApplication = snapshotApplication;
         _systemAreaDomainService = systemAreaDomainService;
+        _industryRepository = industryRepository;
+        _orderDomainService = orderDomainService;
+        _fileRepository = fileRepository;
     }
 
     /// <summary>
@@ -50,6 +65,34 @@ public class SnapshotController : BaseController
     public async Task<IndustryBaseOutDto> GetIndustryBaseAsync(string id)
         => await _snapshotApplication.GetIndustryBaseAsync(id, HttpContext.RequestAborted);
 
+    /// <summary>
+    /// 添加工单
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("order")]
+    public async Task<AddSnapshotOrderOutDto> AddOrderAsync([FromBody] AddSnapshotOrderInDto dto)
+    {
+        var order = dto.Adapt<Order>();
+        dto.ValidateObject();
+        var industry = await _industryRepository.GetAsync(dto.IndustryId, HttpContext.RequestAborted)
+            ?? throw UserFriendlyException.SameMessage("行业不存在:" + dto.IndustryId); ;
+        order.AcceptTypeCode = industry.AcceptTypeCode;
+        order.AcceptType = industry.AcceptType;
+        order.FromGender = EGender.Unknown;
+        if (industry.IndustryType == EIndustryType.Declare)
+        {
+            order.Title = dto.GetTitle(industry.IndustryType, industry.AcceptType);
+            order.Content = dto.GetContent(industry.IndustryType);
+        }
+        order.InitId();
+        await _orderDomainService.AddAsync(order);
+        if (dto.Files.NotNullOrEmpty())
+            order.FileJson = await _fileRepository.AddFileAsync(dto.Files, order.Id, HttpContext.RequestAborted);
+
+
+        return order.Adapt<AddSnapshotOrderOutDto>();
+    }
+
     /// <summary>
     /// 获取小程序公告列表
     /// </summary>

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

@@ -214,7 +214,7 @@ public class SnapshotApplicationTest : TestBase
                 file.Key.ShouldBe(industryId);
             }
             pageDto.Workplace.ShouldNotBeNull();
-            pageDto.WorkArea.ShouldNotBeNull();
+            pageDto.WorkplaceName.ShouldNotBeNull();
         }
         catch (Exception e)
         {

+ 3 - 2
src/Hotline.Application.Tests/Application/SystemSettingCacheManagerTest.cs

@@ -52,12 +52,13 @@ public class SystemSettingCacheManagerTest : TestBase
         _systemSettingCacheManager.AutomaticPublishOrder.ShouldBe(true);
         _systemSettingCacheManager.CancelPublishOrderEnabled.ShouldBe(true);
 
+        _systemDicDataCacheManager.RemoveSysDicDataCache(SysDicTypeConsts.Workplace);
         var workplace = _systemDicDataCacheManager.Workplace;
         workplace.ShouldNotBeNull();
         workplace.Count.ShouldNotBe(0);
 
-        _systemDicDataCacheManager.RemoveSysDicDataCache(SysDicTypeConsts.WorkArea);
-        var workArea = _systemDicDataCacheManager.WorkArea;
+        _systemDicDataCacheManager.RemoveSysDicDataCache(SysDicTypeConsts.WorkplaceName);
+        var workArea = _systemDicDataCacheManager.WorkplaceName;
         workArea.ShouldNotBeNull();
         workArea.Count.ShouldNotBe(0);
     }

+ 7 - 1
src/Hotline.Application/Mappers/SnapshotMapperConfigs.cs

@@ -1,4 +1,5 @@
-using Hotline.Share.Dtos.Snapshot;
+using Hotline.Orders;
+using Hotline.Share.Dtos.Snapshot;
 using Hotline.Snapshot;
 using Mapster;
 using System;
@@ -18,5 +19,10 @@ public class SnapshotMapperConfigs : IRegister
 
         config.ForType<IndustryFileDto, Hotline.File.File>()
             .Map(m => m.Additions, n => n.AdditionId);
+
+        config.ForType<AddSnapshotOrderInDto, Order>()
+            .Map(m => m.Contact, n => n.PhoneNumber)
+            .Map(m => m.FromName, n => n.Name)
+            .Map(m => m.FromPhone, n => n.PhoneNumber);
     }
 }

+ 12 - 3
src/Hotline.Application/Snapshot/SnapshotApplicationBase.cs

@@ -21,6 +21,7 @@ using XF.Domain.Exceptions;
 using Hotline.Settings;
 using Hotline.Share.Dtos.Settings;
 using Hotline.File;
+using Hotline.Share.Enums.Article;
 
 namespace Hotline.Application.Snapshot;
 
@@ -106,17 +107,25 @@ public abstract class SnapshotApplicationBase
         var indurstry = await _industryRepository.GetAsync(id, requestAborted)
             ?? throw UserFriendlyException.SameMessage("行业不存在:" + id);
 
+        var bulletinId = await _bulletinRepository.Queryable()
+            .Where(m => m.BulletinTypeId == indurstry.BulletinTypeGuideId && m.BulletinState == EBulletinState.ReviewPass && m.IsArrive == true)
+            .OrderByDescending(m => m.CreationTime)
+            .Select(m => m.Id)
+            .FirstAsync(requestAborted);
         var outDto = new IndustryBaseOutDto
         {
             Industry = indurstry.Adapt<IndustryOutDto>()
         };
+        outDto.Industry.BulletinId = bulletinId;
         if (indurstry.IndustryType == EIndustryType.Declare)
         {
             outDto.AreaTree = (await _systemAreaDomainService.GetAreaTree(parentId: "510300")).Adapt<List<SystemAreaOutDto>>();
             outDto.Files = (await _fileRepository.GetByKeyAsync(indurstry.Id, requestAborted)).Adapt<List<IndustryFileDto>>();
             outDto.Files.ToList().ForEach(m => m.Url = fileDownloadApi + m.AdditionId);
-            outDto.WorkArea = _systemDicDataCacheManager.WorkArea.Adapt<List<SystemDicDataOutDto>>();
-            outDto.Workplace = _systemDicDataCacheManager.Workplace.Adapt<List<SystemDicDataOutDto>>();
+            outDto.WorkplaceName = _systemDicDataCacheManager.WorkplaceName;
+            outDto.Workplace = _systemDicDataCacheManager.Workplace;
+            outDto.JobType = _systemDicDataCacheManager.JobType;
+            outDto.BusinessUnitType = _systemDicDataCacheManager.BusinessUnitType;
         }
         return outDto;
     }
@@ -128,7 +137,7 @@ public abstract class SnapshotApplicationBase
     public async Task<IReadOnlyList<BulletinOutDto>> GetBulletinsAsync(BulletinInDto dto)
     {
         var items = await _bulletinRepository.Queryable()
-            .Where(m => m.BulletinState == Share.Enums.Article.EBulletinState.ReviewPass)
+            .Where(m => m.BulletinState == EBulletinState.ReviewPass)
             .LeftJoin<Industry>((bulletin, industry) => bulletin.BulletinTypeId == industry.BulletinTypePublicityId)
             .Where((bulletin, industry) => industry.Id == dto.IndustryId)
             .ToPageListAsync(dto.PageIndex, dto.PageSize);

+ 24 - 3
src/Hotline.Repository.SqlSugar/File/FileRepository.cs

@@ -3,6 +3,8 @@ using Hotline.Orders;
 using Hotline.Repository.SqlSugar.DataPermissions;
 using Hotline.Share.Dtos.File;
 using Hotline.Share.Dtos.FlowEngine.Workflow;
+using Hotline.Share.Dtos.Snapshot;
+using Mapster;
 using MapsterMapper;
 using Microsoft.AspNetCore.Http;
 using Newtonsoft.Json;
@@ -15,7 +17,7 @@ using XF.Domain.Repository;
 
 namespace Hotline.Repository.SqlSugar.File
 {
-	public class FileRepository : BaseRepository<Hotline.File.File>, IFileRepository, IScopeDependency
+    public class FileRepository : BaseRepository<Hotline.File.File>, IFileRepository, IScopeDependency
 	{
 		private readonly ISessionContext _sessionContext;
 		private readonly IMapper _mapper;
@@ -25,7 +27,25 @@ namespace Hotline.Repository.SqlSugar.File
 			_mapper = mapper;
 		}
 
-		public async Task<List<FileJson>> AddFileAsync(List<FileDto> files, string id, string flowId = "", CancellationToken cancellationToken = default) 
+        public async Task<List<FileJson>> AddFileAsync(IList<IndustryFileInDto> files, string id, CancellationToken requestAborted)
+        {
+			var entities = files.Adapt<List<Hotline.File.File>>();
+			foreach (var file in entities)
+			{
+				var names = file.FileName.Split(".");
+                file.Name = names[0];
+                file.Type = names[1];
+				file.Key = id;
+                file.OrgName = _sessionContext.OrgName;
+                file.OrgId = _sessionContext.OrgId;
+                file.UserId = _sessionContext.UserId;
+                file.UserName = _sessionContext.UserName;
+            }
+            await AddRangeAsync(entities, requestAborted);
+            return entities.Select(x => new FileJson { Id = x.Id, FileId = x.Additions, Path = x.Path, FileName = x.Name, FileType = x.Type }).ToList();
+        }
+
+        public async Task<List<FileJson>> AddFileAsync(List<FileDto> files, string id, string flowId = "", CancellationToken cancellationToken = default) 
 		{
 			List<Hotline.File.File> newFiles =  new List<Hotline.File.File>();
 			var classify = files[0].Classify;
@@ -79,5 +99,6 @@ namespace Hotline.Repository.SqlSugar.File
 			}
 			return dto;
 		}
-	}
+
+    }
 }

+ 2 - 1
src/Hotline.Share/Dtos/Position.cs

@@ -13,7 +13,8 @@ public class Position
     public double? Latitude { get; set; }
 
     /// <summary>
-    /// 行政区划编码
+    /// 行政区划编码;
+    /// Area对象的Id;
     /// </summary>
     public string? AreaCode { get; set; }
 

+ 6 - 0
src/Hotline.Share/Dtos/Settings/SystemDicDataDto.cs

@@ -1,5 +1,8 @@
 namespace Hotline.Share.Dtos.Settings
 {
+    /// <summary>
+    /// 系统字典数据输出Dto 
+    /// </summary>
     public class SystemDicDataOutDto
     {
         /// <summary>
@@ -17,6 +20,9 @@
         /// </summary>
         public string DicDataValue { get; set; }
 
+        /// <summary>
+        /// 子集集合
+        /// </summary>
         public IList<SystemDicDataOutDto> Children { get; set; }
     }
 }

+ 23 - 4
src/Hotline.Share/Dtos/Snapshot/HomePageDto.cs

@@ -109,6 +109,11 @@ public class IndustryOutDto
     /// 帮助引导用语
     /// </summary>
     public string? TxtHelpRemarks { get; set; }
+
+    /// <summary>
+    /// 通知公告Id
+    /// </summary>
+    public string? BulletinId { get; set; }
 }
 
 public class IndustryBaseOutDto
@@ -119,7 +124,7 @@ public class IndustryBaseOutDto
     public IndustryOutDto Industry { get; set; }
 
     /// <summary>
-    /// 区域集合
+    /// 作业区域集合
     /// </summary>
     public IList<SystemAreaOutDto> AreaTree { get; set; } = [];
 
@@ -129,8 +134,22 @@ public class IndustryBaseOutDto
     public IList<IndustryFileDto> Files { get; set; } = [];
 
     /// <summary>
-    /// 作业场所
+    /// 作业场所集合
+    /// </summary>
+    public IReadOnlyList<SystemDicDataOutDto> Workplace { get; set; }
+
+    /// <summary>
+    /// 场所名称集合
+    /// </summary>
+    public IReadOnlyList<SystemDicDataOutDto> WorkplaceName { get; set; }
+
+    /// <summary>
+    /// 作业类型集合
+    /// </summary>
+    public IReadOnlyList<SystemDicDataOutDto> JobType { get; set; }
+
+    /// <summary>
+    /// 经营单位类别集合
     /// </summary>
-    public IList<SystemDicDataOutDto> Workplace { get; set; }
-    public IList<SystemDicDataOutDto> WorkArea { get; set; }
+    public IReadOnlyList<SystemDicDataOutDto> BusinessUnitType { get; set; }
 }

+ 22 - 0
src/Hotline.Share/Dtos/Snapshot/IndustryFileDto.cs

@@ -37,3 +37,25 @@ public class IndustryFileDto
     public string Url { get; set; }
 }
 
+/// <summary>
+/// 随手拍上报接口附件入参
+/// </summary>
+public class IndustryFileInDto
+{
+    /// <summary>
+    /// 文件名称(有后缀)
+    /// </summary>
+    public string FileName { get; set; }
+
+    /// <summary>
+    /// 附件路径
+    /// </summary>
+    public string Path { get; set; }
+
+    /// <summary>
+    /// 上传接口返回数据中的Id字段
+    /// 附件系统中附件的Id
+    /// </summary>
+    public string AdditionId { get; set; }
+}
+

+ 104 - 4
src/Hotline.Share/Dtos/Snapshot/OrderDto.cs

@@ -1,6 +1,8 @@
 using Hotline.Share.Enums;
 using Hotline.Share.Enums.Order;
+using Hotline.Share.Enums.Snapshot;
 using Hotline.Share.Requests;
+using System.ComponentModel.DataAnnotations;
 using XF.Utility.EnumExtensions;
 
 namespace Hotline.Share.Dtos.Snapshot;
@@ -15,15 +17,15 @@ public record OrderInDto : PagedRequest
     /// <summary>
     /// 工单状态
     /// </summary>
-    public EOrderQueryStatus Status {get;set;}
+    public EOrderQueryStatus Status { get; set; }
 }
 
 public class OrderDetailOutDto : OrderOutDto
-{ 
+{
 }
 
 public class OrderOutDto
-{ 
+{
     public string Id { get; set; }
 
     /// <summary>
@@ -66,6 +68,104 @@ public class OrderOutDto
     /// </summary>
     public string Area { get; set; }
 }
-public class OrderDto 
+public class OrderDto
+{
+}
+
+public class AddSnapshotOrderOutDto
+{
+    public string Id { get; set; }
+    public string No { get; set; }
+    public string Password { get; set; }
+}
+
+public class AddSnapshotOrderInDto : Position
 {
+    /// <summary>
+    /// 行业Id
+    /// </summary>
+    [Required(ErrorMessage = "行业Id不能为空")]
+    public string IndustryId { get; set; }
+
+    /// <summary>
+    /// 作业类型
+    /// </summary>
+    public string? JobType { get; set; }
+
+    /// <summary>
+    /// 经营单位类别
+    /// </summary>
+    public string? BusinessUnitType { get; set; }
+
+    /// <summary>
+    /// 作业场所
+    /// </summary>
+    public string? Workplace { get; set; }
+
+    /// <summary>
+    /// 场所名称(多个场所使用 - 连接)
+    /// </summary>
+    public string? WorkplaceName { get; set; }
+
+    /// <summary>
+    /// 作业时间
+    /// </summary>
+    public DateTime? StartWorkTime { get; set; }
+
+    /// <summary>
+    /// 作业结束时间
+    /// </summary>
+    public DateTime? EndWorkTime { get; set; }
+
+    /// <summary>
+    /// 姓名
+    /// </summary>
+    [Required(ErrorMessage = "姓名不能为空")]
+    public string Name { get; set; }
+
+    /// <summary>
+    /// 联系方式
+    /// </summary>
+    [Required(ErrorMessage = "联系方式不能为空")]
+    public string PhoneNumber { get; set; }
+
+    /// <summary>
+    /// 是否保密
+    /// </summary>
+    public bool? IsSecret { get; set; }
+
+    /// <summary>
+    /// 附件信息
+    /// </summary>
+    public IList<IndustryFileInDto> Files { get; set; }
+
+    /// <summary>
+    /// 事件描述
+    /// </summary>
+    public string? Description { get; set; }
+
+    public string GetContent(EIndustryType industryType)
+    {
+        if (industryType == EIndustryType.Declare)
+        {
+            return $"经营单位类别: {this.BusinessUnitType}\r\n" + // 个人
+                    $"作业场所:{this.Workplace}\r\n" + // 化工、民爆物品生产经营企业
+                    $"场所名称:{this.WorkplaceName}\r\n" + // 多业态混合经营场所 - 存储多种功能的劳动密集型企业
+                    $"作业区域: {this.County + this.Town}\r\n" + // 自流井区舒坪街道
+                    $"作业类型: {this.JobType}\r\n" + // 电焊
+                    $"作业时间:{this.StartWorkTime.Value.ToString("yyyy-MM-dd hh:mm")}~{this.EndWorkTime.Value.ToString("yyyy-MM-dd hh:mm")}\r\n" +
+                    $"作业地点: {this.Town}({this.County})({this.Street})"; // 舒平(自流井区)(油库)"
+        }
+        return Description;
+    }
+
+    public string GetTitle(EIndustryType industryType, string acceptType)
+    {
+        if (industryType == EIndustryType.Declare)
+        {
+            return $"【随手拍】关于{Town}({County})的申报";
+        }
+
+        return $"【随手拍】关于{Town}({County})的" + acceptType;
+    }
 }

+ 6 - 0
src/Hotline.Share/Enums/Snapshot/EIndustryType.cs

@@ -6,6 +6,12 @@ using System.Text;
 using System.Threading.Tasks;
 
 namespace Hotline.Share.Enums.Snapshot;
+
+/// <summary>
+/// 行业类型;
+/// 0: 作业申报;
+/// 1: 线索上报;
+/// </summary>
 public enum EIndustryType
 {
     /// <summary>

+ 2 - 2
src/Hotline.Share/Enums/Snapshot/EReadPackUserType.cs

@@ -2,9 +2,9 @@
 namespace Hotline.Share.Enums.Snapshot;
 
 /// <summary>
-/// 红包领取人类型
+/// 红包领取人类型;
 /// 0: 市民;
-/// 1: 网格员
+/// 1: 网格员;
 /// </summary>
 public enum EReadPackUserType
 {

+ 15 - 4
src/Hotline/Caching/Interfaces/ISysDicDataCacheManager.cs

@@ -1,4 +1,5 @@
 using Hotline.Settings;
+using Hotline.Share.Dtos.Settings;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -16,13 +17,23 @@ namespace Hotline.Caching.Interfaces
         IReadOnlyList<SystemDicData> LeaderSMS { get; }
 
         /// <summary>
-        /// 作场所
+        /// 作场所
         /// </summary>
-        public IReadOnlyList<SystemDicData> Workplace { get; }
+        IReadOnlyList<SystemDicDataOutDto> Workplace { get; }
 
         /// <summary>
-        /// 作业区域
+        /// 作业场所名称
         /// </summary>
-        public IReadOnlyList<SystemDicData> WorkArea { get; }
+        IReadOnlyList<SystemDicDataOutDto> WorkplaceName { get; }
+
+        /// <summary>
+        /// 作业类型
+        /// </summary>
+        IReadOnlyList<SystemDicDataOutDto> JobType { get; }
+
+        /// <summary>
+        /// 经营单位类型
+        /// </summary>
+        IReadOnlyList<SystemDicDataOutDto> BusinessUnitType { get; }
     }
 }

+ 18 - 6
src/Hotline/Caching/Services/SysDicDataCacheManager.cs

@@ -1,7 +1,9 @@
 using Hotline.Caching.Interfaces;
 using Hotline.SeedData;
 using Hotline.Settings;
+using Hotline.Share.Dtos.Settings;
 using Hotline.Share.Tools;
+using Mapster;
 using XF.Domain.Cache;
 using XF.Domain.Dependency;
 using XF.Domain.Repository;
@@ -31,13 +33,13 @@ namespace Hotline.Caching.Services
             return sysDicDataList;
         }
 
-        public IReadOnlyList<SystemDicData> GetOrAdd(string code)
+        public IReadOnlyList<SystemDicDataOutDto> GetOrAdd(string code)
         {
             var items = GetSysDicDataCache(code);
-            if (items.NotNullOrEmpty()) return items;
+            if (items.NotNullOrEmpty()) return items.Adapt<IReadOnlyList<SystemDicDataOutDto>>();
 
             var any = _sysDicDataRepository.Queryable().Where(m => m.DicTypeCode == code).Any();
-            if (any) return new List<SystemDicData>();
+            if (any) return [];
 
             var sysDicType = _systemDicTypeRepository.Get(x => x.DicTypeCode == code);
             var seedData = new SystemDicDataSeedData();
@@ -50,7 +52,7 @@ namespace Hotline.Caching.Services
             AssignChilderDicType(sysDicDatas.ToList(), code, sysDicType.Id);
 
             RemoveSysDicDataCache(code);
-            return GetSysDicDataCache(code);
+            return GetSysDicDataCache(code).Adapt<IReadOnlyList<SystemDicDataOutDto>>();
         }
 
         private void AssignChilderDicType(IList<SystemDicData> sysDicDatas, string code, string dicTypeId, string parentId = "")
@@ -76,12 +78,22 @@ namespace Hotline.Caching.Services
         /// <summary>
         /// 工作场所
         /// </summary>
-        public IReadOnlyList<SystemDicData> Workplace => GetOrAdd(SysDicTypeConsts.Workplace);
+        public IReadOnlyList<SystemDicDataOutDto> Workplace => GetOrAdd(SysDicTypeConsts.Workplace);
 
         /// <summary>
         /// 作业区域
         /// </summary>
-        public IReadOnlyList<SystemDicData> WorkArea => GetOrAdd(SysDicTypeConsts.WorkArea);
+        public IReadOnlyList<SystemDicDataOutDto> WorkplaceName => GetOrAdd(SysDicTypeConsts.WorkplaceName);
+
+        /// <summary>
+        /// 作业类型
+        /// </summary>
+        public IReadOnlyList<SystemDicDataOutDto> JobType => GetOrAdd(SysDicTypeConsts.JobType);
+
+        /// <summary>
+        /// 经营单位类别
+        /// </summary>
+        public IReadOnlyList<SystemDicDataOutDto> BusinessUnitType => GetOrAdd(SysDicTypeConsts.BusinessUnitType);
 
         public void RemoveSysDicDataCache(string code)
         {

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

@@ -1,6 +1,7 @@
 using Hotline.Orders;
 using Hotline.Share.Dtos.File;
 using Hotline.Share.Dtos.FlowEngine.Workflow;
+using Hotline.Share.Dtos.Snapshot;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -16,5 +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);
+    }
 }

+ 34 - 15
src/Hotline/SeedData/SystemDicDataSeedData.cs

@@ -1,4 +1,5 @@
 using Hotline.Settings;
+using MediatR;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -36,7 +37,7 @@ public class SystemDicDataSeedData : ISeedData<SystemDicData>
                 new() {Id = "08dc39be-bcf8-4f2d-8495-98f3648309e7", DicDataValue = "水、电、气生产、管网维修,污水处理场所", DicTypeCode = SysDicTypeConsts.Workplace, DicDataName = "水、电、气生产、管网维修,污水处理场所", IsShow =  true, DicTypeId = "08dc39be-d203-460c-868e-46b7132e35b5", ParentId = ""},
             ];
         }
-        if (dicTypeCode == SysDicTypeConsts.WorkArea)
+        if (dicTypeCode == SysDicTypeConsts.WorkplaceName)
         {
             return
             [
@@ -83,30 +84,48 @@ public class SystemDicDataSeedData : ISeedData<SystemDicData>
                             ] }
                  ];
         }
+        if (dicTypeCode == SysDicTypeConsts.JobType)
+        {
+            return [
+                new() { Id = "08dc3c1e-470f-4a7d-8433-3fed9bb59c95", DicDataValue = "dianhan", DicDataName = "电焊"},
+                new() { Id = "08dc3cc4-aa8b-41ad-8807-ba1571e00628", DicDataValue = "qige", DicDataName = "气割"},
+                ];
+        }
+        if (dicTypeCode == SysDicTypeConsts.BusinessUnitType)
+        {
+            return [
+                new() { Id = "08dc39c1-c682-465e-8fae-9c8aa24d6c1f", DicDataValue = "qiye", DicDataName = "企业"},
+                new() { Id = "08dc39c1-f1f8-4717-8b03-9d562884c8f9", DicDataValue = "geren", DicDataName = "个人" }
+                ];
+        }
 
         throw new NotImplementedException();
     }
 
     public SystemDicType GetType(string dicTypeCode)
     {
+        var dicType = new string[2];
         if (dicTypeCode == SysDicTypeConsts.Workplace)
         {
-            return new SystemDicType
-            {
-                Id = "08dc39be-d203-460c-868e-46b7132e35b5",
-                DicTypeCode = SysDicTypeConsts.Workplace,
-                DicTypeName = "工作场所",
-            };
+            dicType = ["08dc39be-d203-460c-868e-46b7132e35b5", "作业场所"];
         }
-        if (dicTypeCode == SysDicTypeConsts.WorkArea)
+        if (dicTypeCode == SysDicTypeConsts.WorkplaceName)
         {
-            return new SystemDicType
-            {
-                Id = "08dc3bf7-e134-47d6-8784-0bdbbc0e67df",
-                DicTypeCode = SysDicTypeConsts.WorkArea,
-                DicTypeName = "工作区域",
-            };
+            dicType = ["08dc3bf7-e134-47d6-8784-0bdbbc0e67df", "场所名称"];
         }
-        throw new NotImplementedException();
+        if (dicTypeCode == SysDicTypeConsts.JobType)
+        {
+            dicType = ["08dc39c1-a6db-46a9-8e08-9f284f827857", "作业类型"];
+        }
+        if (dicTypeCode == SysDicTypeConsts.BusinessUnitType)
+        {
+            dicType = ["08dc39c1-b8bd-412d-8ad3-293c035bd14d", "经营单位类别"];
+        }
+        return new SystemDicType
+        {
+            Id = dicType[0],
+            DicTypeCode = dicTypeCode,
+            DicTypeName = dicType[1]
+        };
     }
 }

+ 13 - 3
src/Hotline/Settings/SysDicTypeConsts.cs

@@ -263,12 +263,22 @@ public class SysDicTypeConsts
     public const string KnowledgeBaseTags = "KnowledgeBaseTags";
 
     /// <summary>
-    /// 作场所
+    /// 作场所
     /// </summary>
     public const string Workplace = "Workplace";
 
     /// <summary>
-    /// 作业区域
+    /// 场所名称
     /// </summary>
-    public const string WorkArea = "WorkArea";
+    public const string WorkplaceName = "WorkplaceName";
+
+    /// <summary>
+    /// 作业类型
+    /// </summary>
+    public const string JobType = "JobType";
+
+    /// <summary>
+    /// 经营单位类别
+    /// </summary>
+    public const string BusinessUnitType = "BusinessUnitType";
 }

+ 6 - 8
src/Hotline/Snapshot/OrderSnapshot.cs

@@ -37,7 +37,7 @@ public class OrderSnapshot : CreationSoftDeleteEntity
     /// <inheritdoc cref="CommunityInfo"/> 表的Id
     /// </summary>
     [SugarColumn(ColumnDescription = "社区Id")]
-    public string CommunityId { get; set; }
+    public string? CommunityId { get; set; }
 
     #region 网格员回复
 
@@ -45,7 +45,7 @@ public class OrderSnapshot : CreationSoftDeleteEntity
     /// 网格员是否办理
     /// </summary>
     [SugarColumn(ColumnDescription = "网格员是否办理")]
-    public bool IsDeal { get; set; }
+    public bool? IsDeal { get; set; }
 
     /// <summary>
     /// 网格E通编号
@@ -57,26 +57,24 @@ public class OrderSnapshot : CreationSoftDeleteEntity
     /// 是否属实
     /// </summary>
     [SugarColumn(ColumnDescription = "是否属实")]
-    public bool IsTruth { get; set; }
+    public bool? IsTruth { get; set; }
 
     /// <summary>
     /// 是否重复
     /// </summary>
     [SugarColumn(ColumnDescription = "是否重复")]
-    public bool IsRepetition { get; set; }
+    public bool? IsRepetition { get; set; }
 
     /// <summary>
     /// 是否隐患
     /// </summary>
     [SugarColumn(ColumnDescription = "是否隐患")]
-    public bool IsDanger { get; set; }
+    public bool? IsDanger { get; set; }
 
     /// <summary>
     /// 网格员回复内容
     /// </summary>
     [SugarColumn(ColumnDescription = "网格员回复内容")]
-    public string NetworkRemark { get; set; }
-
-
+    public string? NetworkRemark { get; set; }
     #endregion
 }