From 5663a3f74cfdca483c01b063b3bc79ada7e9cea7 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 9 Sep 2022 09:28:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A8=BD=E6=9F=A5=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/DTO/FrontAuditConfigViewModel.cs | 13 + .../Inspection/FrontAuditConfigService.cs | 23 +- .../Service/Inspection/_MapConfig.cs | 4 +- IRaCIS.Core.Domain/Common/FrontAuditConfig.cs | 314 ++++++++++-------- 4 files changed, 202 insertions(+), 152 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs index 04b1d5db5..e51ea5c26 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs @@ -129,6 +129,14 @@ namespace IRaCIS.Core.Application.ViewModel } + + + public class FrontAuditConfigDTO: FrontAuditConfigAddOrEdit + { + + } + + /// FrontAuditConfigAddOrEdit 列表查询参数模型 public class FrontAuditConfigAddOrEdit { @@ -272,6 +280,11 @@ namespace IRaCIS.Core.Application.ViewModel public string InterfaceName { get; set; } = string.Empty; + public string TableConfigJsonStr { get; set; } + + + public List TableConfigList { get; set; } = new List(); + } diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index 1493425d9..b8fbb1bde 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -893,11 +893,20 @@ namespace IRaCIS.Core.Application.Service /// /// [HttpGet] - public async Task> GetAuditConfigChildList(Guid frontAuditConfigId) + public async Task> GetAuditConfigChildList(Guid frontAuditConfigId) { - var list = await (from data in _repository.GetQueryable().Where(x => x.Id == frontAuditConfigId) - join childrenType in _repository.GetQueryable() on data.Id equals childrenType.ParentId - select childrenType).OrderBy(x => x.Sort).ToListAsync(); + //var list = await (from data in _repository.GetQueryable().Where(x => x.Id == frontAuditConfigId) + // join childrenType in _repository.GetQueryable() on data.Id equals childrenType.ParentId + // select childrenType).OrderBy(x => x.Sort).ToListAsync(); + //return list; + + var list = await _frontAuditConfigRepository.Where(t => t.ParentId == frontAuditConfigId).OrderBy(x => x.Sort).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + + foreach (var item in list) + { + item.TableConfigList = JsonConvert.DeserializeObject>(item.TableConfigJsonStr) ?? new List(); + } + return list; } @@ -1020,8 +1029,8 @@ namespace IRaCIS.Core.Application.Service [HttpGet] public async Task> GetModuleTypeDescriptionList(Guid moduleTypeId) { - var result = await _frontAuditConfigRepository.Where(x => x.ModuleTypeId == moduleTypeId && x.ObjectTypeId != null && x.OptTypeId != null && x.Description.Length>0).Select(x => new { x.Description,x.Sort } ).OrderBy(t=>t.Sort).ToListAsync(); - return result.Select(t=>t.Description).Distinct().ToList(); + var result = await _frontAuditConfigRepository.Where(x => x.ModuleTypeId == moduleTypeId && x.ObjectTypeId != null && x.OptTypeId != null && x.Description.Length > 0).Select(x => new { x.Description, x.Sort }).OrderBy(t => t.Sort).ToListAsync(); + return result.Select(t => t.Description).Distinct().ToList(); } /// @@ -1147,6 +1156,8 @@ namespace IRaCIS.Core.Application.Service addOrEditFrontAuditConfig.Description = ""; } + addOrEditFrontAuditConfig.TableConfigJsonStr = JsonConvert.SerializeObject(addOrEditFrontAuditConfig.TableConfigList); + var entity = await _frontAuditConfigRepository.InsertOrUpdateAsync(addOrEditFrontAuditConfig, true); return ResponseOutput.Ok(entity.Id.ToString()); diff --git a/IRaCIS.Core.Application/Service/Inspection/_MapConfig.cs b/IRaCIS.Core.Application/Service/Inspection/_MapConfig.cs index 3a3777235..efa0b9bb9 100644 --- a/IRaCIS.Core.Application/Service/Inspection/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Inspection/_MapConfig.cs @@ -19,7 +19,9 @@ namespace IRaCIS.Core.Application.Service CreateMap(); - + CreateMap(); + + diff --git a/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs b/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs index d861dc7a9..2150b2650 100644 --- a/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs +++ b/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs @@ -9,209 +9,233 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace IRaCIS.Core.Domain.Models { - /// - ///FrontAuditConfig - /// - [Table("FrontAuditConfig")] - public class FrontAuditConfig : Entity, IAuditUpdate, IAuditAdd - { - /// - /// Value - /// + /// + ///FrontAuditConfig + /// + [Table("FrontAuditConfig")] + public class FrontAuditConfig : Entity, IAuditUpdate, IAuditAdd + { + /// + /// Value + /// - public string Value { get; set; } = String.Empty; - - /// + public string Value { get; set; } = String.Empty; + + /// /// ValueCN /// - public string ValueCN { get; set; } = String.Empty; + public string ValueCN { get; set; } = String.Empty; - /// - /// Description - /// + /// + /// Description + /// - public string Description { get; set; } = String.Empty; + public string Description { get; set; } = String.Empty; - /// - /// CreateTime - /// + /// + /// CreateTime + /// - public DateTime CreateTime { get; set; } + public DateTime CreateTime { get; set; } - /// - /// CreateUserId - /// + /// + /// CreateUserId + /// - public Guid CreateUserId { get; set; } - - /// + public Guid CreateUserId { get; set; } + + /// /// UpdateTime /// - public DateTime UpdateTime { get; set; } - - /// + public DateTime UpdateTime { get; set; } + + /// /// UpdateUserId /// - - public Guid UpdateUserId { get; set; } - - /// + + public Guid UpdateUserId { get; set; } + + /// /// Code /// - - public string Code { get; set; } = String.Empty; - /// - /// ParentId - /// - public Guid? ParentId { get; set; } - - /// + public string Code { get; set; } = String.Empty; + + /// + /// ParentId + /// + public Guid? ParentId { get; set; } + + /// /// IsEnable /// - public bool IsEnable { get; set; } - - /// + public bool IsEnable { get; set; } + + /// /// IsConfig /// - public bool IsConfig { get; set; } + public bool IsConfig { get; set; } - /// - /// ModuleTypeId - /// - public Guid? ModuleTypeId { get; set; } + /// + /// ModuleTypeId + /// + public Guid? ModuleTypeId { get; set; } - /// - /// OptTypeId - /// - public Guid? OptTypeId { get; set; } + /// + /// OptTypeId + /// + public Guid? OptTypeId { get; set; } - /// - /// ChildrenTypeId - /// - public Guid? ChildrenTypeId { get; set; } + /// + /// ChildrenTypeId + /// + public Guid? ChildrenTypeId { get; set; } - public int IsShowParent { get; set; } + public int IsShowParent { get; set; } - public string ConfigType { get; set; } = String.Empty; + public string ConfigType { get; set; } = String.Empty; - public int Sort { get; set; } + public int Sort { get; set; } - public string DictionaryKey { get; set; } + public string DictionaryKey { get; set; } - public string EnumType { get; set; } + public string EnumType { get; set; } - public Guid? ObjectTypeId { get; set; } + public Guid? ObjectTypeId { get; set; } - public bool IsShowByTrialConfig { get; set; } + public bool IsShowByTrialConfig { get; set; } - public string TrialConfigRelyFieldName { get; set; } - - - - /// - /// 标识 - /// - public string Identification { get; set; } + public string TrialConfigRelyFieldName { get; set; } - /// - /// 是否有签名 - /// - public bool IsHaveSign { get; set; } - /// - /// 是否有原因 - /// - public bool IsHaveReason { get; set; } - - /// - /// 是否完成 - /// - public bool IsFinish { get; set; } - - /// - /// 是否加入计划 - /// - public bool IsJoinPlan { get; set; } - - /// - /// 数据类型 - /// - - public string DataType { get; set; } - - /// - /// 子数据Lable - /// - - public string ChildDataLabel { get; set; } - - /// - /// 子数据Value - /// - - public string ChildDataValue { get; set; } - - /// - /// 是否为特殊类型 - /// - public bool IsSpecialType { get; set; } + /// + /// 标识 + /// + public string Identification { get; set; } - /// - /// 日期类型 - /// + /// + /// 是否有签名 + /// + public bool IsHaveSign { get; set; } - public string DateType { get; set; } = String.Empty; + /// + /// 是否有原因 + /// + public bool IsHaveReason { get; set; } - /// - /// 字典Code - /// + /// + /// 是否完成 + /// + public bool IsFinish { get; set; } - public string DictionaryCode { get; set; } = String.Empty; + /// + /// 是否加入计划 + /// + public bool IsJoinPlan { get; set; } - /// - /// 字典Type - /// + /// + /// 数据类型 + /// - public string DictionaryType { get; set; } = String.Empty; + public string DataType { get; set; } - /// - /// 字典表 - /// + /// + /// 子数据Lable + /// - public string ForeignKeyTableName { get; set; } = String.Empty; + public string ChildDataLabel { get; set; } - /// - /// 字典Value - /// + /// + /// 子数据Value + /// - public string ForeignKeyValue { get; set; } = String.Empty; + public string ChildDataValue { get; set; } - /// - /// 字典 - /// - - public string ForeignKeyText { get; set; } = String.Empty; + /// + /// 是否为特殊类型 + /// + public bool IsSpecialType { get; set; } - /// - /// 接口名 - /// + /// + /// 日期类型 + /// - public string InterfaceName { get; set; } = String.Empty; + public string DateType { get; set; } = String.Empty; + + /// + /// 字典Code + /// + + public string DictionaryCode { get; set; } = String.Empty; + + /// + /// 字典Type + /// + + public string DictionaryType { get; set; } = String.Empty; + + /// + /// 字典表 + /// + + public string ForeignKeyTableName { get; set; } = String.Empty; + + /// + /// 字典Value + /// + + public string ForeignKeyValue { get; set; } = String.Empty; + + /// + /// 字典 + /// + + public string ForeignKeyText { get; set; } = String.Empty; - } + /// + /// 接口名 + /// -} + public string InterfaceName { get; set; } = String.Empty; + + + + public string TableConfigJsonStr { get; set; } + + + + } + + public class TableConfig + { + public bool IsList { get; set; } + public string ListName { get; set; } = String.Empty; + public bool IsFixedColumn { get; set; } + + public string FixedColumnName { get; set; } = String.Empty; + + public string ColumnName { get; set; } = String.Empty; + + public string ColumnValue { get; set; } = String.Empty; + + public bool IsMerge { get; set; } + + public string MergeColumnName { get; set; } = String.Empty; + + + } + +}