From ad9e0208f35a0a1846683f90ba56c7c14da586c3 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Wed, 17 Aug 2022 10:40:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Inspection/FrontAuditConfigService.cs | 17 ++++---- .../Management/SystemNotice.cs | 43 ++++++++++++++++++- 2 files changed, 51 insertions(+), 9 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index c6bb0ea5e..b8ee7760b 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -14,6 +14,7 @@ using Microsoft.Data.SqlClient; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Domain.Share.Management; namespace IRaCIS.Core.Application.Service { @@ -278,12 +279,12 @@ namespace IRaCIS.Core.Application.Service { try { - if (datefirst.DateType == "Date") + if (datefirst.DateType == FrontAuditDateType.Date.GetDescription()) { jsonDataDic[item] = DateTime.Parse(jsonDataDic[item].ToString()).ToString("yyyy-MM-dd"); } - if (datefirst.DateType == "DateTime") + if (datefirst.DateType == FrontAuditDateType.DateTime.GetDescription()) { jsonDataDic[item] = DateTime.Parse(jsonDataDic[item].ToString()).ToString("yyyy-MM-dd HH:mm:ss"); } @@ -425,7 +426,7 @@ namespace IRaCIS.Core.Application.Service if (value.GetType() == typeof(JArray)) { JArray arrays = (JArray)value; - if (item.Type.ToLower() == "id".ToLower()) + if (item.Type.ToLower() == FrontAudit.Id.GetDescription().ToLower()) { List guids = new List(); arrays.ForEach(x => @@ -434,7 +435,7 @@ namespace IRaCIS.Core.Application.Service }); jsonDataDic[item.Key] = string.Join(',', await _dictionaryRepository.Where(x => guids.Contains(x.Id)).Select(x => x.ValueCN).ToListAsync()); } - else if (item.Type.ToLower() == "ChildGroup".ToLower()) + else if (item.Type.ToLower() == FrontAudit.ChildGroup.GetDescription().ToLower()) { List guids = new List(); arrays.ForEach(x => @@ -473,12 +474,12 @@ namespace IRaCIS.Core.Application.Service } else { - if (item.Type.ToLower() == "id".ToLower()) + if (item.Type.ToLower() == FrontAudit.Id.GetDescription().ToLower()) { Guid guid = Guid.Parse(value.ToString()); jsonDataDic[item.Key] = await _dictionaryRepository.Where(x => guid == x.Id).Select(x => x.ValueCN).FirstOrDefaultAsync(); } - else if (item.Type.ToLower() == "ChildGroup".ToLower()) + else if (item.Type.ToLower() == FrontAudit.ChildGroup.GetDescription().ToLower()) { jsonDataDic[item.Key] = await _dictionaryRepository.Where(x => x.Code == item.Code).Join(_dictionaryRepository.Where(x => x.ChildGroup == value.ToString()), a => a.Id, b => b.ParentId, (a, b) => new { @@ -528,12 +529,12 @@ namespace IRaCIS.Core.Application.Service { try { - if (datefirst.DateType == "Date") + if (datefirst.DateType == FrontAuditDateType.Date.GetDescription()) { JsonData[item] = DateTime.Parse(JsonData[item].ToString()).ToString("yyyy-MM-dd"); } - if (datefirst.DateType == "DateTime") + if (datefirst.DateType == FrontAuditDateType.DateTime.GetDescription()) { JsonData[item] = DateTime.Parse(JsonData[item].ToString()).ToString("yyyy-MM-dd HH:mm:ss"); } diff --git a/IRaCIS.Core.Domain.Share/Management/SystemNotice.cs b/IRaCIS.Core.Domain.Share/Management/SystemNotice.cs index 58a4017ac..d708e66cf 100644 --- a/IRaCIS.Core.Domain.Share/Management/SystemNotice.cs +++ b/IRaCIS.Core.Domain.Share/Management/SystemNotice.cs @@ -1,4 +1,6 @@ -namespace IRaCIS.Core.Domain.Share.Management +using System.ComponentModel.DataAnnotations; + +namespace IRaCIS.Core.Domain.Share.Management { public enum SystemNotice_NoticeModeEnum { @@ -49,4 +51,43 @@ } + public enum FrontAudit + { + /// + ///id + /// + [DisplayAttribute(Name = "id")] + Id = 0, + + /// + ///ChildGroup + /// + [DisplayAttribute(Name = "ChildGroup")] + ChildGroup = 0, + + /// + ///id + /// + [DisplayAttribute(Name = "Code")] + Code = 0, + } + + + + public enum FrontAuditDateType + { + /// + ///Date + /// + [DisplayAttribute(Name = "Date")] + Date = 0, + + /// + ///DateTime + /// + [DisplayAttribute(Name = "DateTime")] + DateTime = 0, + + + } } \ No newline at end of file