diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index 7469c70c1..69ddb8a82 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -509,6 +509,24 @@
SystemAnonymizationAddOrEdit 列表查询参数模型
+
+ SystemNoticeView 列表视图模型
+
+
+ SystemNoticeQuery 列表查询参数模型
+
+
+ NoticeContent
+
+
+ FileName
+
+
+ Path
+
+
+ SystemNoticeAddOrEdit 列表查询参数模型
+
TrialExternalUserView 列表视图模型
@@ -1002,6 +1020,11 @@
ISystemAnonymizationService
+
+
+ ISystemNoticeService
+
+
ITrialExternalUserService
diff --git a/IRaCIS.Core.Application/Service/Management/DTO/SystemNoticeViewModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/SystemNoticeViewModel.cs
new file mode 100644
index 000000000..5f1031888
--- /dev/null
+++ b/IRaCIS.Core.Application/Service/Management/DTO/SystemNoticeViewModel.cs
@@ -0,0 +1,75 @@
+//--------------------------------------------------------------------
+// 此代码由T4模板自动生成 byzhouhang 20210918
+// 生成时间 2022-04-25 09:46:34
+// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
+//--------------------------------------------------------------------
+using System;
+using IRaCIS.Core.Domain.Share;
+using System.Collections.Generic;
+namespace IRaCIS.Core.Application.ViewModel
+{
+ /// SystemNoticeView 列表视图模型
+ public class SystemNoticeView
+ {
+ public Guid Id { get; set; }
+ public int NoticeLevelEnum { get; set; }
+ public string NoticeContent { get; set; }
+ public DateTime CreateTime { get; set; }
+ public Guid CreateUserId { get; set; }
+ public DateTime UpdateTime { get; set; }
+ public Guid UpdateUserId { get; set; }
+ public int ApplicableProjectEnum { get; set; }
+ public int NoticeMode { get; set; }
+ public int NoticeStateEnum { get; set; }
+ public DateTime? StartDate { get; set; }
+ public DateTime? EndDate { get; set; }
+ public string FileName { get; set; }
+ public string Path { get; set; }
+ }
+
+ ///SystemNoticeQuery 列表查询参数模型
+ public class SystemNoticeQuery
+ {
+ /// NoticeContent
+ public string NoticeContent { get; set; }
+
+ /// FileName
+ public string FileName { get; set; }
+
+ /// Path
+ public string Path { get; set; }
+
+ }
+
+ /// SystemNoticeAddOrEdit 列表查询参数模型
+ public class SystemNoticeAddOrEdit
+ {
+ public Guid Id { get; set; }
+ public int NoticeLevelEnum { get; set; }
+ public string NoticeContent { get; set; }
+ public DateTime CreateTime { get; set; }
+ public Guid CreateUserId { get; set; }
+ public DateTime UpdateTime { get; set; }
+ public Guid UpdateUserId { get; set; }
+ public int ApplicableProjectEnum { get; set; }
+ public int NoticeMode { get; set; }
+ public int NoticeStateEnum { get; set; }
+ public DateTime? StartDate { get; set; }
+ public DateTime? EndDate { get; set; }
+ public string FileName { get; set; }
+ public string Path { get; set; }
+ }
+
+ public class SystemNoticeUserTypeView
+ {
+ public Guid Id { get; set; }
+ public Guid SystemNoticeId { get; set; }
+ public DateTime CreateTime { get; set; }
+ public Guid CreateUserId { get; set; }
+ public Guid UserTypeId { get; set; }
+ }
+
+
+}
+
+
diff --git a/IRaCIS.Core.Application/Service/Management/Interface/ISystemNoticeService.cs b/IRaCIS.Core.Application/Service/Management/Interface/ISystemNoticeService.cs
new file mode 100644
index 000000000..6b7b701fe
--- /dev/null
+++ b/IRaCIS.Core.Application/Service/Management/Interface/ISystemNoticeService.cs
@@ -0,0 +1,25 @@
+//--------------------------------------------------------------------
+// 此代码由T4模板自动生成 byzhouhang 20210918
+// 生成时间 2022-04-25 09:46:39
+// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
+//--------------------------------------------------------------------
+
+using IRaCIS.Core.Application.ViewModel;
+namespace IRaCIS.Core.Application.Interfaces
+{
+ ///
+ /// ISystemNoticeService
+ ///
+ public interface ISystemNoticeService
+ {
+
+
+ Task> GetSystemNoticeList(SystemNoticeQuery querySystemNotice);
+
+ Task AddOrUpdateSystemNotice(SystemNoticeAddOrEdit addOrEditSystemNotice);
+
+ Task DeleteSystemNotice(Guid systemNoticeId);
+
+
+ }
+}
diff --git a/IRaCIS.Core.Application/Service/Management/SystemNoticeService.cs b/IRaCIS.Core.Application/Service/Management/SystemNoticeService.cs
new file mode 100644
index 000000000..54735d18a
--- /dev/null
+++ b/IRaCIS.Core.Application/Service/Management/SystemNoticeService.cs
@@ -0,0 +1,64 @@
+////--------------------------------------------------------------------
+//// 此代码由T4模板自动生成 byzhouhang 20210918
+//// 生成时间 2022-04-25 09:46:43
+//// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
+////--------------------------------------------------------------------
+
+//using IRaCIS.Core.Domain.Models;
+//using Microsoft.AspNetCore.Mvc;
+//using IRaCIS.Core.Application.Interfaces;
+//using IRaCIS.Core.Application.ViewModel;
+//namespace IRaCIS.Core.Application.Service
+//{
+// ///
+// /// SystemNoticeService
+// ///
+// [ ApiExplorerSettings(GroupName = "Test")]
+// public class SystemNoticeService: BaseService, ISystemNoticeService
+// {
+
+// private readonly IRepository _systemNoticeRepository;
+
+// public SystemNoticeService(IRepository systemNoticeRepository)
+// {
+// _systemNoticeRepository = systemNoticeRepository;
+// }
+
+
+// public async Task> GetSystemNoticeList(SystemNoticeQuery querySystemNotice)
+// {
+
+
+// var systemNoticeQueryable = _repository.GetQueryable()
+// .ProjectTo(_mapper.ConfigurationProvider);
+
+// return await systemNoticeQueryable.ToListAsync();
+// }
+
+
+// public async Task AddOrUpdateSystemNotice(SystemNoticeAddOrEdit addOrEditSystemNotice)
+// {
+// // 在此处拷贝automapper 映射
+
+
+// //CreateMap();
+// // CreateMap< SystemNotice,SystemNoticeAddOrEdit>().ReverseMap();
+
+
+// var entity = await _repository.InsertOrUpdateAsync(addOrEditSystemNotice, true);
+
+// return ResponseOutput.Ok(entity.Id.ToString());
+
+// }
+
+
+// [HttpDelete("{systemNoticeId:guid}")]
+// public async Task DeleteSystemNotice(Guid systemNoticeId)
+// {
+// var success = await _repository.BatchDeleteAsync()(t => t.Id == systemNoticeId);
+// return ResponseOutput.Result(success);
+// }
+
+
+// }
+//}
diff --git a/IRaCIS.Core.Domain.Share/IRaCIS.Core.Domain.Share.csproj b/IRaCIS.Core.Domain.Share/IRaCIS.Core.Domain.Share.csproj
index 78fa3b6cf..f4492c127 100644
--- a/IRaCIS.Core.Domain.Share/IRaCIS.Core.Domain.Share.csproj
+++ b/IRaCIS.Core.Domain.Share/IRaCIS.Core.Domain.Share.csproj
@@ -15,4 +15,8 @@
+
+
+
+
diff --git a/IRaCIS.Core.Domain/Management/Notice/SystemNotice.cs b/IRaCIS.Core.Domain/Management/Notice/SystemNotice.cs
new file mode 100644
index 000000000..e7285e240
--- /dev/null
+++ b/IRaCIS.Core.Domain/Management/Notice/SystemNotice.cs
@@ -0,0 +1,97 @@
+
+//--------------------------------------------------------------------
+// 此代码由T4模板自动生成 byzhouhang 20210918
+// 生成时间 2022-04-25 09:46:09
+// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
+using System;
+using IRaCIS.Core.Domain.Share;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+namespace IRaCIS.Core.Domain.Models
+{
+ ///
+ ///SystemNotice
+ ///
+ [Table("SystemNotice")]
+ public class SystemNotice : Entity, IAuditUpdate, IAuditAdd
+ {
+
+ ///
+ /// NoticeLevelEnum
+ ///
+ [Required]
+ public int NoticeLevelEnum { get; set; }
+
+ ///
+ /// NoticeContent
+ ///
+ [Required]
+ public string NoticeContent { get; set; }
+
+ ///
+ /// CreateTime
+ ///
+ [Required]
+ public DateTime CreateTime { get; set; }
+
+ ///
+ /// CreateUserId
+ ///
+ [Required]
+ public Guid CreateUserId { get; set; }
+
+ ///
+ /// UpdateTime
+ ///
+ [Required]
+ public DateTime UpdateTime { get; set; }
+
+ ///
+ /// UpdateUserId
+ ///
+ [Required]
+ public Guid UpdateUserId { get; set; }
+
+ ///
+ /// ApplicableProjectEnum
+ ///
+ [Required]
+ public int ApplicableProjectEnum { get; set; }
+
+ ///
+ /// NoticeMode
+ ///
+ [Required]
+ public int NoticeMode { get; set; }
+
+ ///
+ /// NoticeStateEnum
+ ///
+ [Required]
+ public int NoticeStateEnum { get; set; }
+
+ ///
+ /// StartDate
+ ///
+ public DateTime? StartDate { get; set; }
+
+ ///
+ /// EndDate
+ ///
+ public DateTime? EndDate { get; set; }
+
+ ///
+ /// FileName
+ ///
+ [Required]
+ public string FileName { get; set; }
+
+ ///
+ /// Path
+ ///
+ [Required]
+ public string Path { get; set; }
+
+ }
+
+}
diff --git a/IRaCIS.Core.Domain/Management/Notice/SystemNoticeUserRead.cs b/IRaCIS.Core.Domain/Management/Notice/SystemNoticeUserRead.cs
new file mode 100644
index 000000000..59d3d5a38
--- /dev/null
+++ b/IRaCIS.Core.Domain/Management/Notice/SystemNoticeUserRead.cs
@@ -0,0 +1,41 @@
+
+//--------------------------------------------------------------------
+// 此代码由T4模板自动生成 byzhouhang 20210918
+// 生成时间 2022-04-25 09:46:09
+// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
+using System;
+using IRaCIS.Core.Domain.Share;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+namespace IRaCIS.Core.Domain.Models
+{
+ ///
+ ///SystemNoticeUserRead
+ ///
+ [Table("SystemNoticeUserRead")]
+ public class SystemNoticeUserRead : Entity, IAuditAdd
+ {
+
+
+
+ ///
+ /// SystemNoticeId
+ ///
+ [Required]
+ public Guid SystemNoticeId { get; set; }
+
+ ///
+ /// CreateTime
+ ///
+ [Required]
+ public DateTime CreateTime { get; set; }
+
+ ///
+ /// CreateUserId
+ ///
+ [Required]
+ public Guid CreateUserId { get; set; }
+
+ }
+
+}
diff --git a/IRaCIS.Core.Domain/Management/Notice/SystemNoticeUserType.cs b/IRaCIS.Core.Domain/Management/Notice/SystemNoticeUserType.cs
new file mode 100644
index 000000000..14fc0a0c0
--- /dev/null
+++ b/IRaCIS.Core.Domain/Management/Notice/SystemNoticeUserType.cs
@@ -0,0 +1,47 @@
+
+//--------------------------------------------------------------------
+// 此代码由T4模板自动生成 byzhouhang 20210918
+// 生成时间 2022-04-25 09:46:09
+// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
+using System;
+using IRaCIS.Core.Domain.Share;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+namespace IRaCIS.Core.Domain.Models
+{
+ ///
+ ///SystemNoticeUserType
+ ///
+ [Table("SystemNoticeUserType")]
+ public class SystemNoticeUserType : Entity, IAuditAdd
+ {
+
+
+
+ ///
+ /// SystemNoticeId
+ ///
+ [Required]
+ public Guid SystemNoticeId { get; set; }
+
+ ///
+ /// CreateTime
+ ///
+ [Required]
+ public DateTime CreateTime { get; set; }
+
+ ///
+ /// CreateUserId
+ ///
+ [Required]
+ public Guid CreateUserId { get; set; }
+
+ ///
+ /// UserTypeId
+ ///
+ [Required]
+ public Guid UserTypeId { get; set; }
+
+ }
+
+}
diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs
index 252428a79..295a15307 100644
--- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs
+++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs
@@ -314,6 +314,13 @@ namespace IRaCIS.Core.Infra.EFCore
public virtual DbSet CommonDocument { get; set; }
+ public virtual DbSet SystemNotice { get; set; }
+
+ public virtual DbSet SystemNoticeUserRead { get; set; }
+
+ public virtual DbSet SystemNoticeUserType { get; set; }
+
+
#region 废弃
diff --git a/IRaCIS.Core.Infra.EFCore/Context/Triggers/AuditAddTrigger.cs b/IRaCIS.Core.Infra.EFCore/Context/Triggers/AuditAddTrigger.cs
index bff32b4d4..3d1a09b8c 100644
--- a/IRaCIS.Core.Infra.EFCore/Context/Triggers/AuditAddTrigger.cs
+++ b/IRaCIS.Core.Infra.EFCore/Context/Triggers/AuditAddTrigger.cs
@@ -21,7 +21,12 @@ namespace IRaCIS.Core.Application.Triggers
if (context.ChangeType == ChangeType.Added)
{
context.Entity.CreateUserId = _userInfo.Id;
- context.Entity.CreateTime = DateTime.UtcNow.AddHours(8);
+
+ if (context.Entity.CreateTime == default(DateTime))
+ {
+ context.Entity.CreateTime = DateTime.UtcNow.AddHours(8);
+
+ }
}
diff --git a/IRaCIS.Core.Test/DbHelper.ttinclude b/IRaCIS.Core.Test/DbHelper.ttinclude
index aefde2e0f..ca50af026 100644
--- a/IRaCIS.Core.Test/DbHelper.ttinclude
+++ b/IRaCIS.Core.Test/DbHelper.ttinclude
@@ -4,7 +4,7 @@
public static readonly string ConnectionString = "Server=123.56.181.144,14333\\MSSQLExpress14;Database=IRaCIS_New;User ID=sa;Password=dev123456DEV;";
public static readonly string DbDatabase = "IRaCIS_New";
//ַ,ƴ
- public static readonly string TableName = "CommonDocument";
+ public static readonly string TableName = "SystemNotice,SystemNoticeUserRead,SystemNoticeUserType";
//ļ service Ƿҳ
}
#>