|
|
|
@@ -24,13 +24,15 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
private readonly IWebHostEnvironment _hostEnvironment;
|
|
|
|
|
private readonly IRepository<TrialDocument> _trialDocumentRepository;
|
|
|
|
|
private readonly IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository;
|
|
|
|
|
private readonly IRepository<SystemDocument> _systemDocumentRepository;
|
|
|
|
|
|
|
|
|
|
public TrialDocumentService(IWebHostEnvironment hostEnvironment, IRepository<TrialDocument> trialDocumentRepository
|
|
|
|
|
, IRepository<SystemDocConfirmedUser> systemDocConfirmedUserRepository)
|
|
|
|
|
, IRepository<SystemDocConfirmedUser> systemDocConfirmedUserRepository,IRepository<SystemDocument> systemDocumentRepository)
|
|
|
|
|
{
|
|
|
|
|
_hostEnvironment = hostEnvironment;
|
|
|
|
|
this._trialDocumentRepository = trialDocumentRepository;
|
|
|
|
|
this._systemDocConfirmedUserRepository = systemDocConfirmedUserRepository;
|
|
|
|
|
_trialDocumentRepository = trialDocumentRepository;
|
|
|
|
|
_systemDocConfirmedUserRepository = systemDocConfirmedUserRepository;
|
|
|
|
|
_systemDocumentRepository = systemDocumentRepository;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@@ -42,9 +44,9 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
public async Task<PageOutput<TrialDocumentView>> GetTrialDocumentList(TrialDocumentQuery queryTrialDocument)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var trialDocumentQueryable = _trialDocumentRepository.Where(t => t.TrialId == queryTrialDocument.TrialId)
|
|
|
|
|
var trialDocumentQueryable = _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == queryTrialDocument.TrialId)
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(queryTrialDocument.Name), t => t.Name.Contains(queryTrialDocument.Name))
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(queryTrialDocument.Type), t => t.Type.Contains(queryTrialDocument.Type))
|
|
|
|
|
.WhereIf(queryTrialDocument.FileTypeId!=null, t => t.FileTypeId==queryTrialDocument.FileTypeId)
|
|
|
|
|
.ProjectTo<TrialDocumentView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken });
|
|
|
|
|
|
|
|
|
|
return await trialDocumentQueryable.ToPagedListAsync(queryTrialDocument.PageIndex, queryTrialDocument.PageSize, queryTrialDocument.SortField, queryTrialDocument.Asc);
|
|
|
|
@@ -126,7 +128,7 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
var systemDocumentQueryable = from needConfirmedUserType in _repository.Where<SystemDocNeedConfirmedUserType>(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)
|
|
|
|
|
//.Where(u => u.UserTypeRole.UserList.SelectMany(cc => cc.UserTrials.Where(t => t.TrialId == querySystemDocument.TrialId)).Any(e => e.Trial.TrialFinishedTime < u.SystemDocument.CreateTime))
|
|
|
|
|
.WhereIf(trialFininshedTime != null, u => u.SystemDocument.CreateTime < trialFininshedTime)
|
|
|
|
|
.WhereIf(!_userInfo.IsAdmin, t => t.SystemDocument.IsAbandon == false || (t.SystemDocument.IsAbandon == true && t.SystemDocument.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
|
|
|
|
.WhereIf(!_userInfo.IsAdmin, t => t.SystemDocument.IsDeleted == false || (t.SystemDocument.IsDeleted == true && t.SystemDocument.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
|
|
|
|
|
|
|
|
|
join trialUser in _repository.Where<TrialUser>(t => t.TrialId == querySystemDocument.TrialId && t.UserId == _userInfo.Id)
|
|
|
|
|
on needConfirmedUserType.NeedConfirmUserTypeId equals trialUser.User.UserTypeId
|
|
|
|
@@ -138,11 +140,11 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
|
|
|
|
|
Id = needConfirmedUserType.SystemDocument.Id,
|
|
|
|
|
CreateTime = needConfirmedUserType.SystemDocument.CreateTime,
|
|
|
|
|
IsAbandon = needConfirmedUserType.SystemDocument.IsAbandon,
|
|
|
|
|
IsDeleted = needConfirmedUserType.SystemDocument.IsDeleted,
|
|
|
|
|
SignViewMinimumMinutes = needConfirmedUserType.SystemDocument.SignViewMinimumMinutes,
|
|
|
|
|
Name = needConfirmedUserType.SystemDocument.Name,
|
|
|
|
|
Path = needConfirmedUserType.SystemDocument.Path,
|
|
|
|
|
Type = needConfirmedUserType.SystemDocument.Type,
|
|
|
|
|
FileType = needConfirmedUserType.SystemDocument.FileType.Value,
|
|
|
|
|
UpdateTime = needConfirmedUserType.SystemDocument.UpdateTime,
|
|
|
|
|
|
|
|
|
|
FullFilePath = needConfirmedUserType.SystemDocument.Path + "?access_token=" + _userInfo.UserToken,
|
|
|
|
@@ -155,9 +157,9 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//项目文档查询
|
|
|
|
|
var trialDocQueryable = from trialDoc in _trialDocumentRepository.Where(t => t.TrialId == querySystemDocument.TrialId)
|
|
|
|
|
var trialDocQueryable = from trialDoc in _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == querySystemDocument.TrialId)
|
|
|
|
|
.WhereIf(!_userInfo.IsAdmin, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
|
|
|
|
.WhereIf(!_userInfo.IsAdmin, t => t.IsAbandon == false || (t.IsAbandon == true && t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
|
|
|
|
.WhereIf(!_userInfo.IsAdmin, t => t.IsDeleted == false || (t.IsDeleted == true && t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
|
|
|
|
|
|
|
|
|
join trialUser in _repository.Where<TrialUser>(t => t.TrialId == querySystemDocument.TrialId && t.UserId == _userInfo.Id) on trialDoc.TrialId equals trialUser.TrialId
|
|
|
|
|
join confirm in _repository.Where<TrialDocUserTypeConfirmedUser>(t => t.TrialDocument.TrialId == querySystemDocument.TrialId) on
|
|
|
|
@@ -169,10 +171,10 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
IsSystemDoc = false,
|
|
|
|
|
CreateTime = trialDoc.CreateTime,
|
|
|
|
|
FullFilePath = trialDoc.Path + "?access_token=" + _userInfo.UserToken,
|
|
|
|
|
IsAbandon = trialDoc.IsAbandon,
|
|
|
|
|
IsDeleted = trialDoc.IsDeleted,
|
|
|
|
|
Name = trialDoc.Name,
|
|
|
|
|
Path = trialDoc.Path,
|
|
|
|
|
Type = trialDoc.Type,
|
|
|
|
|
FileType = trialDoc.FileType.Value,
|
|
|
|
|
UpdateTime = trialDoc.UpdateTime,
|
|
|
|
|
SignViewMinimumMinutes = trialDoc.SignViewMinimumMinutes,
|
|
|
|
|
|
|
|
|
@@ -188,7 +190,7 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
|
|
|
|
|
var unionQuery = systemDocumentQueryable.Union(trialDocQueryable)
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name))
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Type), t => t.Type.Contains(querySystemDocument.Type));
|
|
|
|
|
.WhereIf(querySystemDocument.FileTypeId!=null, t => t.FileTypeId==querySystemDocument.FileTypeId);
|
|
|
|
|
|
|
|
|
|
return await unionQuery.ToPagedListAsync(querySystemDocument.PageIndex, querySystemDocument.PageSize, querySystemDocument.SortField, querySystemDocument.Asc);
|
|
|
|
|
}
|
|
|
|
@@ -208,7 +210,7 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
var systemDocumentQueryable = from needConfirmedUserType in _repository.Where<SystemDocNeedConfirmedUserType>(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)
|
|
|
|
|
//.Where(u => u.UserTypeRole.UserList.SelectMany(cc => cc.UserTrials.Where(t => t.TrialId == querySystemDocument.TrialId)).Any(e => e.Trial.TrialFinishedTime < u.SystemDocument.CreateTime))
|
|
|
|
|
.WhereIf(trialFininshedTime != null, u => u.SystemDocument.CreateTime < trialFininshedTime)
|
|
|
|
|
.WhereIf(!_userInfo.IsAdmin, t => t.SystemDocument.IsAbandon == false || (t.SystemDocument.IsAbandon == true && t.SystemDocument.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
|
|
|
|
.WhereIf(!_userInfo.IsAdmin, t => t.SystemDocument.IsDeleted == false || (t.SystemDocument.IsDeleted == true && t.SystemDocument.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
|
|
|
|
|
|
|
|
|
join trialUser in _repository.Where<TrialUser>(t => t.TrialId == trialId && t.UserId == _userInfo.Id)
|
|
|
|
|
on needConfirmedUserType.NeedConfirmUserTypeId equals trialUser.User.UserTypeId
|
|
|
|
@@ -223,7 +225,7 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
//项目文档查询
|
|
|
|
|
var trialDocQueryable = from trialDoc in _trialDocumentRepository.Where(t => t.TrialId == trialId)
|
|
|
|
|
.WhereIf(!_userInfo.IsAdmin, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
|
|
|
|
.WhereIf(!_userInfo.IsAdmin, t => t.IsAbandon == false || (t.IsAbandon == true && t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
|
|
|
|
.WhereIf(!_userInfo.IsAdmin, t => t.IsDeleted == false || (t.IsDeleted == true && t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
|
|
|
|
|
|
|
|
|
join trialUser in _repository.Where<TrialUser>(t => t.TrialId == trialId && t.UserId == _userInfo.Id) on trialDoc.TrialId equals trialUser.TrialId
|
|
|
|
|
join confirm in _repository.Where<TrialDocUserTypeConfirmedUser>(t => t.TrialDocument.TrialId == trialId) on
|
|
|
|
@@ -303,11 +305,11 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
|
|
|
|
|
Id = trialDocumentNeedConfirmedUserType.TrialDocument.Id,
|
|
|
|
|
CreateTime = trialDocumentNeedConfirmedUserType.TrialDocument.CreateTime,
|
|
|
|
|
IsAbandon = trialDocumentNeedConfirmedUserType.TrialDocument.IsAbandon,
|
|
|
|
|
IsDeleted = trialDocumentNeedConfirmedUserType.TrialDocument.IsDeleted,
|
|
|
|
|
SignViewMinimumMinutes = trialDocumentNeedConfirmedUserType.TrialDocument.SignViewMinimumMinutes,
|
|
|
|
|
Name = trialDocumentNeedConfirmedUserType.TrialDocument.Name,
|
|
|
|
|
Path = trialDocumentNeedConfirmedUserType.TrialDocument.Path,
|
|
|
|
|
Type = trialDocumentNeedConfirmedUserType.TrialDocument.Type,
|
|
|
|
|
FileType = trialDocumentNeedConfirmedUserType.TrialDocument.FileType.Value,
|
|
|
|
|
UpdateTime = trialDocumentNeedConfirmedUserType.TrialDocument.UpdateTime,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -336,11 +338,11 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
|
|
|
|
|
Id = needConfirmEdUserType.SystemDocument.Id,
|
|
|
|
|
CreateTime = needConfirmEdUserType.SystemDocument.CreateTime,
|
|
|
|
|
IsAbandon = needConfirmEdUserType.SystemDocument.IsAbandon,
|
|
|
|
|
IsDeleted = needConfirmEdUserType.SystemDocument.IsDeleted,
|
|
|
|
|
SignViewMinimumMinutes = needConfirmEdUserType.SystemDocument.SignViewMinimumMinutes,
|
|
|
|
|
Name = needConfirmEdUserType.SystemDocument.Name,
|
|
|
|
|
Path = needConfirmEdUserType.SystemDocument.Path,
|
|
|
|
|
Type = needConfirmEdUserType.SystemDocument.Type,
|
|
|
|
|
FileType = needConfirmEdUserType.SystemDocument.FileType.Value,
|
|
|
|
|
UpdateTime = needConfirmEdUserType.SystemDocument.UpdateTime,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -355,7 +357,7 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
|
|
|
|
|
var unionQuery = trialDocQuery.Union(systemDocQuery)
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name))
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Type), t => t.Type.Contains(querySystemDocument.Type));
|
|
|
|
|
.WhereIf(querySystemDocument.FileTypeId!=null, t => t.FileTypeId==querySystemDocument.FileTypeId);
|
|
|
|
|
|
|
|
|
|
return await unionQuery.ToPagedListAsync(querySystemDocument.PageIndex, querySystemDocument.PageSize, querySystemDocument.SortField, querySystemDocument.Asc);
|
|
|
|
|
}
|
|
|
|
@@ -383,8 +385,8 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
[HttpGet("{trialId:guid}")]
|
|
|
|
|
public async Task<List<string>> GetTrialDocAndSystemDocType(Guid trialId)
|
|
|
|
|
{
|
|
|
|
|
return await _trialDocumentRepository.Where(t => t.TrialId == trialId).Select(t => t.Type)
|
|
|
|
|
.Union(_repository.GetQueryable<SystemDocument>().Select(t => t.Type)).Distinct()
|
|
|
|
|
return await _trialDocumentRepository.Where(t => t.TrialId == trialId).Select(t => t.FileType.Value)
|
|
|
|
|
.Union(_repository.GetQueryable<SystemDocument>().Select(t => t.FileType.Value)).Distinct()
|
|
|
|
|
.ToListAsync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -395,7 +397,7 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
var entity = _mapper.Map<TrialDocument>(addOrEditTrialDocument);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (await _trialDocumentRepository.AnyAsync(t => t.Type == addOrEditTrialDocument.Type && t.Name == addOrEditTrialDocument.Name && t.TrialId == addOrEditTrialDocument.TrialId))
|
|
|
|
|
if (await _trialDocumentRepository.AnyAsync(t => t.FileTypeId == addOrEditTrialDocument.FileTypeId && t.Name == addOrEditTrialDocument.Name && t.TrialId == addOrEditTrialDocument.TrialId,true))
|
|
|
|
|
{
|
|
|
|
|
return ResponseOutput.NotOk("同类型已存在该文件名");
|
|
|
|
|
}
|
|
|
|
@@ -405,7 +407,7 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (await _trialDocumentRepository.AnyAsync(t => t.Type == addOrEditTrialDocument.Type && t.Name == addOrEditTrialDocument.Name && t.Id != addOrEditTrialDocument.Id && t.TrialId == addOrEditTrialDocument.TrialId))
|
|
|
|
|
if (await _trialDocumentRepository.AnyAsync(t => t.FileTypeId == addOrEditTrialDocument.FileTypeId && t.Name == addOrEditTrialDocument.Name && t.Id != addOrEditTrialDocument.Id && t.TrialId == addOrEditTrialDocument.TrialId,true))
|
|
|
|
|
{
|
|
|
|
|
return ResponseOutput.NotOk("同类型已存在该文件名");
|
|
|
|
|
}
|
|
|
|
@@ -414,18 +416,18 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
|
|
|
|
|
if (document == null) return Null404NotFound(document);
|
|
|
|
|
|
|
|
|
|
var dbDocumentType = document.Type;
|
|
|
|
|
//var dbDocumentType = document.Type;
|
|
|
|
|
|
|
|
|
|
_mapper.Map(addOrEditTrialDocument, document);
|
|
|
|
|
|
|
|
|
|
if (dbDocumentType != addOrEditTrialDocument.Type)
|
|
|
|
|
if (document.FileTypeId != addOrEditTrialDocument.FileTypeId)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).IfNullThrowException().FullName;
|
|
|
|
|
var beforeFilePath = Path.Combine(rootPath, document.Path);
|
|
|
|
|
|
|
|
|
|
document.Path = document.Path.Replace(dbDocumentType, addOrEditTrialDocument.Type);
|
|
|
|
|
document.Path = document.Path.Replace(document.FileTypeId.ToString(), addOrEditTrialDocument.FileTypeId.ToString());
|
|
|
|
|
|
|
|
|
|
var nowPath = Path.Combine(rootPath, document.Path);
|
|
|
|
|
|
|
|
|
@@ -453,7 +455,7 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
[HttpDelete("{trialId:guid}/{trialDocumentId:guid}")]
|
|
|
|
|
public async Task<IResponseOutput> DeleteTrialDocument(Guid trialDocumentId, Guid trialId)
|
|
|
|
|
{
|
|
|
|
|
if (await _trialDocumentRepository.Where(t => t.Id == trialDocumentId).AnyAsync(t => t.TrialDocConfirmedUserList.Any()))
|
|
|
|
|
if (await _trialDocumentRepository.AsQueryable(true).Where(t => t.Id == trialDocumentId).AnyAsync(t => t.TrialDocConfirmedUserList.Any()))
|
|
|
|
|
{
|
|
|
|
|
return ResponseOutput.NotOk("该文档,已有用户签名 不允许删除");
|
|
|
|
|
}
|
|
|
|
@@ -479,14 +481,12 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
if (isSystemDoc)
|
|
|
|
|
{
|
|
|
|
|
await _repository.AddAsync(new SystemDocConfirmedUser() { SystemDocumentId = documentId, SignFirstViewTime = DateTime.Now });
|
|
|
|
|
//success = await _repository.UpdateFromQueryAsync<SystemDocConfirmedUser>(t => t.Id == documentId, d => new SystemDocConfirmedUser() { SignFirstViewTime = DateTime.Now });
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
await _repository.AddAsync(new TrialDocUserTypeConfirmedUser() { TrialDocumentId = documentId, SignFirstViewTime = DateTime.Now });
|
|
|
|
|
|
|
|
|
|
//success = await _repository.UpdateFromQueryAsync<TrialDocUserTypeConfirmedUser>(t => t.Id == documentId , d => new TrialDocUserTypeConfirmedUser() { SignFirstViewTime = DateTime.Now });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
success= await _repository.SaveChangesAsync();
|
|
|
|
@@ -519,7 +519,7 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
{
|
|
|
|
|
return ResponseOutput.NotOk("该文档已经签名");
|
|
|
|
|
}
|
|
|
|
|
if (!await _repository.AnyAsync<SystemDocument>(t => t.Id == userConfirmCommand.DocumentId) || await _trialDocumentRepository.AnyAsync(t => t.Id == userConfirmCommand.DocumentId && t.IsAbandon))
|
|
|
|
|
if (!await _systemDocumentRepository.AnyAsync(t => t.Id == userConfirmCommand.DocumentId) || await _trialDocumentRepository.AnyAsync(t => t.Id == userConfirmCommand.DocumentId && t.IsDeleted,true))
|
|
|
|
|
{
|
|
|
|
|
return ResponseOutput.NotOk("文件已删除或者废除,签署失败!");
|
|
|
|
|
}
|
|
|
|
@@ -533,7 +533,7 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
return ResponseOutput.NotOk("该文档已经签名");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!await _trialDocumentRepository.AnyAsync(t => t.Id == userConfirmCommand.DocumentId) || await _repository.AnyAsync<TrialDocument>(t => t.Id == userConfirmCommand.DocumentId && t.IsAbandon))
|
|
|
|
|
if (!await _trialDocumentRepository.AnyAsync(t => t.Id == userConfirmCommand.DocumentId) || await _repository.AnyAsync<TrialDocument>(t => t.Id == userConfirmCommand.DocumentId && t.IsDeleted,true))
|
|
|
|
|
{
|
|
|
|
|
return ResponseOutput.NotOk("文件已删除或者废除,签署失败!");
|
|
|
|
|
}
|
|
|
|
@@ -558,11 +558,11 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
{
|
|
|
|
|
if (isSystemDoc)
|
|
|
|
|
{
|
|
|
|
|
await _repository.UpdateFromQueryAsync<SystemDocument>(t => t.Id == documentId, u => new SystemDocument() { IsAbandon = true });
|
|
|
|
|
await _repository.UpdateFromQueryAsync<SystemDocument>(t => t.Id == documentId, u => new SystemDocument() { IsDeleted = true });
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
await _trialDocumentRepository.UpdateFromQueryAsync(t => t.Id == documentId, u => new TrialDocument() { IsAbandon = true });
|
|
|
|
|
await _trialDocumentRepository.UpdateFromQueryAsync(t => t.Id == documentId, u => new TrialDocument() { IsDeleted = true });
|
|
|
|
|
}
|
|
|
|
|
return ResponseOutput.Ok();
|
|
|
|
|
}
|
|
|
|
@@ -606,17 +606,17 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
public PageOutput<DocumentUnionWithUserStatView> GetTrialSystemDocumentList(DocumentTrialUnionQuery querySystemDocument)
|
|
|
|
|
{
|
|
|
|
|
var systemDocumentQueryable = _repository
|
|
|
|
|
.WhereIf<SystemDocument>(!_userInfo.IsAdmin, t => t.IsAbandon == false)
|
|
|
|
|
.WhereIf<SystemDocument>(!_userInfo.IsAdmin, t => t.IsDeleted == false)
|
|
|
|
|
.Select(t => new DocumentUnionWithUserStatView()
|
|
|
|
|
{
|
|
|
|
|
Id = t.Id,
|
|
|
|
|
IsSystemDoc = true,
|
|
|
|
|
CreateTime = t.CreateTime,
|
|
|
|
|
FullFilePath = t.Path + "?access_token=" + _userInfo.UserToken,
|
|
|
|
|
IsAbandon = t.IsAbandon,
|
|
|
|
|
IsDeleted = t.IsDeleted,
|
|
|
|
|
Name = t.Name,
|
|
|
|
|
Path = t.Path,
|
|
|
|
|
Type = t.Type,
|
|
|
|
|
FileType = t.FileType.Value,
|
|
|
|
|
UpdateTime = t.UpdateTime,
|
|
|
|
|
SignViewMinimumMinutes = t.SignViewMinimumMinutes,
|
|
|
|
|
DocumentConfirmedUserCount = t.SystemDocConfirmedUserList.Count(),
|
|
|
|
@@ -631,10 +631,10 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
IsSystemDoc = false,
|
|
|
|
|
CreateTime = t.CreateTime,
|
|
|
|
|
FullFilePath = t.Path + "?access_token=" + _userInfo.UserToken,
|
|
|
|
|
IsAbandon = t.IsAbandon,
|
|
|
|
|
IsDeleted = t.IsDeleted,
|
|
|
|
|
Name = t.Name,
|
|
|
|
|
Path = t.Path,
|
|
|
|
|
Type = t.Type,
|
|
|
|
|
FileType = t.FileType.Value,
|
|
|
|
|
UpdateTime = t.UpdateTime,
|
|
|
|
|
SignViewMinimumMinutes = t.SignViewMinimumMinutes,
|
|
|
|
|
|
|
|
|
@@ -645,7 +645,7 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
|
|
|
|
|
var unionQuery = systemDocumentQueryable.Union(trialDocQueryable)
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name))
|
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Type), t => t.Type.Contains(querySystemDocument.Type));
|
|
|
|
|
.WhereIf(querySystemDocument.FileTypeId!=null, t => t.FileTypeId==querySystemDocument.FileTypeId);
|
|
|
|
|
|
|
|
|
|
return unionQuery.ToPagedList(querySystemDocument.PageIndex, querySystemDocument.PageSize, querySystemDocument.SortField, querySystemDocument.Asc);
|
|
|
|
|
}
|
|
|
|
|