修改一版
parent
3c7c3795b7
commit
42e0e62b4b
|
@ -530,7 +530,6 @@ namespace IRaCIS.Core.Application.Services
|
|||
/// <summary>
|
||||
/// 用户 签名某个文档
|
||||
/// </summary>
|
||||
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> UserConfirm(UserConfirmCommand userConfirmCommand)
|
||||
{
|
||||
|
@ -546,7 +545,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
return ResponseOutput.NotOk("文件已删除或者废除,签署失败!");
|
||||
}
|
||||
|
||||
await _systemDocConfirmedUserRepository.AddAsync(new SystemDocConfirmedUser() { ConfirmTime = DateTime.Now, ConfirmUserId = _userInfo.Id, SystemDocumentId = userConfirmCommand.DocumentId },true);
|
||||
await _systemDocConfirmedUserRepository.AddAsync(new SystemDocConfirmedUser() { ConfirmTime = DateTime.Now, ConfirmUserId = _userInfo.Id, IsDeleted=false, SystemDocumentId = userConfirmCommand.DocumentId },true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -560,7 +559,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
return ResponseOutput.NotOk("文件已删除或者废除,签署失败!");
|
||||
}
|
||||
|
||||
await _trialDocUserTypeConfirmedUserRepository.AddAsync(new TrialDocUserTypeConfirmedUser() { ConfirmTime = DateTime.Now, ConfirmUserId = _userInfo.Id, TrialDocumentId = userConfirmCommand.DocumentId },true);
|
||||
await _trialDocUserTypeConfirmedUserRepository.AddAsync(new TrialDocUserTypeConfirmedUser() { ConfirmTime = DateTime.Now, ConfirmUserId = _userInfo.Id,IsDeleted=false, TrialDocumentId = userConfirmCommand.DocumentId },true);
|
||||
}
|
||||
|
||||
await _repository.SaveChangesAsync();
|
||||
|
@ -580,13 +579,20 @@ namespace IRaCIS.Core.Application.Services
|
|||
{
|
||||
if (isSystemDoc)
|
||||
{
|
||||
await _systemDocumentRepository.UpdatePartialFromQueryAsync(documentId, u => new SystemDocument() { IsDeleted = true },true);
|
||||
await _systemDocumentRepository.UpdatePartialFromQueryAsync(documentId, u => new SystemDocument() { IsDeleted = true });
|
||||
await _systemDocConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.SystemDocumentId == documentId, x => new SystemDocConfirmedUser()
|
||||
{
|
||||
IsDeleted = true
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
await _trialDocumentRepository.UpdatePartialFromQueryAsync(documentId, u => new TrialDocument() { IsDeleted = true }, true);
|
||||
await _trialDocumentRepository.UpdatePartialFromQueryAsync(documentId, u => new TrialDocument() { IsDeleted = true });
|
||||
await _trialDocUserTypeConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.TrialDocumentId == documentId, x => new TrialDocUserTypeConfirmedUser()
|
||||
{
|
||||
IsDeleted = true
|
||||
});
|
||||
}
|
||||
|
||||
await _systemDocumentRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
|
|
@ -44,6 +44,12 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public string SignText { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 是否废除
|
||||
/// </summary>
|
||||
public bool? IsDeleted { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,6 +47,13 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public string SignText { get; set; } = string.Empty;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否废除
|
||||
/// </summary>
|
||||
public bool? IsDeleted { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -202,21 +202,41 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
// 系统文件签署
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SystemDocConfirmedUser)))
|
||||
{
|
||||
var entity = item.Entity as SystemDocConfirmedUser;
|
||||
var systemDocument= await _dbContext.SystemDocument.Where(x => x.Id == entity.SystemDocumentId).FirstOrDefaultAsync();
|
||||
await InsertInspection<SystemDocConfirmedUser>(item, type, x => new DataInspection()
|
||||
{
|
||||
GeneralId = x.Id,
|
||||
});
|
||||
},new {
|
||||
|
||||
FileTypeId= systemDocument.FileTypeId,
|
||||
Name = systemDocument.Name,
|
||||
CreateTime=systemDocument.CreateTime,
|
||||
IsSigned="是",// 是否签署 添加了就是签署了
|
||||
}, null, "UserSigned");
|
||||
}
|
||||
|
||||
// 项目文件签署
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialDocUserTypeConfirmedUser)))
|
||||
{
|
||||
var entity = item.Entity as TrialDocUserTypeConfirmedUser;
|
||||
var trialDocument = await _dbContext.TrialDocument.Where(x => x.Id == entity.TrialDocumentId).FirstOrDefaultAsync();
|
||||
|
||||
var trialid = trialDocument.TrialId;
|
||||
await InsertInspection<TrialDocUserTypeConfirmedUser>(item, type, x => new DataInspection()
|
||||
{
|
||||
TrialId= trialid,
|
||||
GeneralId = x.Id,
|
||||
});
|
||||
},new {
|
||||
FileTypeId = trialDocument.FileTypeId,
|
||||
Name = trialDocument.Name,
|
||||
CreateTime = trialDocument.CreateTime,
|
||||
IsSigned = "是",// 是否签署 添加了就是签署了
|
||||
},null, "UserSigned");
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 项目中心
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialSite)))
|
||||
{
|
||||
|
@ -792,8 +812,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
/// <param name="type">类型</param>
|
||||
/// <param name="expression">表达式</param>
|
||||
/// <param name="entityData">实体对象</param>
|
||||
/// <param name="entityTypeName">实体名称</param>
|
||||
/// <returns></returns>
|
||||
public async Task InsertInspection<T>(EntityEntry data, string type, Expression<Func<T, DataInspection>> expression = null,object otherItem=null,T entityData=null) where T:class
|
||||
public async Task InsertInspection<T>(EntityEntry data, string type, Expression<Func<T, DataInspection>> expression = null,object otherItem=null,T entityData=null, string? entityTypeName=null) where T:class
|
||||
{
|
||||
object entityobj = entityData == null ? data.Entity : entityData;
|
||||
DataInspection inspection = new DataInspection();
|
||||
|
@ -803,7 +824,15 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
var entity = entityobj as T;
|
||||
inspection = f(entity);
|
||||
}
|
||||
inspection.Identification = $"{_userInfo.RequestUrl}/{ entityobj.GetType().Name}/{type}";
|
||||
if (entityTypeName == null)
|
||||
{
|
||||
entityTypeName = entityobj.GetType().Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
entityTypeName = "New/" + entityTypeName;
|
||||
}
|
||||
inspection.Identification = $"{_userInfo.RequestUrl}/{ entityTypeName}/{type}";
|
||||
//if (data != null)
|
||||
//{
|
||||
// var originaldata = data.OriginalValues.ToObject();
|
||||
|
@ -821,6 +850,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取URl参数
|
||||
/// </summary>
|
||||
|
|
|
@ -779,7 +779,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
try
|
||||
{
|
||||
|
||||
if (!JsonData.ContainsKey(item.Key))
|
||||
if (!JsonData.ContainsKey(item.Key) || JsonData[item.Key]==null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue