修改文档bug
continuous-integration/drone/push Build is passing Details

IRC_NewDev
hang 2024-09-14 10:24:17 +08:00
parent 86864ae575
commit d50091ed6b
4 changed files with 9 additions and 6 deletions

View File

@ -105,7 +105,7 @@ namespace IRaCIS.Core.Application.Contracts
public class SystemDocumentQuery : PageInput
{
public bool? IsDeleted { get; set; }
public Guid? SystemDocumentId { get; set; }
public Guid? FileTypeId { get; set; }

View File

@ -36,7 +36,8 @@ namespace IRaCIS.Core.Application.Services
var systemDocumentQueryable = _systemDocumentRepository.AsQueryable(true)
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
.ProjectTo<SystemDocumentView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.Id });
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
.ProjectTo<SystemDocumentView>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us, userId = _userInfo.Id });
return await systemDocumentQueryable.ToPagedListAsync(inQuery);
}

View File

@ -224,7 +224,7 @@ namespace IRaCIS.Core.Application.Services
var trialInfo = await ( _trialRepository.Where(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
//系统文档查询
var systemDocumentQueryable = from needConfirmedUserType in _systemDocNeedConfirmedUserTypeRepository.Where(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)
var systemDocumentQueryable = from needConfirmedUserType in _systemDocNeedConfirmedUserTypeRepository.Where(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId,ignoreQueryFilters:true)
.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
.WhereIf(!_userInfo.IsAdmin, t => t.SystemDocument.IsDeleted == false || (t.SystemDocument.IsDeleted == true && t.SystemDocument.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
@ -464,7 +464,7 @@ namespace IRaCIS.Core.Application.Services
FullFilePath = needConfirmEdUserType.SystemDocument.Path
};
var unionQuery = trialDocQuery.Union(systemDocQuery)
var unionQuery = trialDocQuery.Union(systemDocQuery).IgnoreQueryFilters().Where(t=>!(t.IsDeleted == true && t.ConfirmUserId == null))
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
.WhereIf(inQuery.IsConfirmed == true, t => t.ConfirmTime != null)

View File

@ -4,6 +4,8 @@ using IRaCIS.Application.Contracts;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share;
using System.Globalization;
namespace IRaCIS.Core.Application.Service
{
@ -13,10 +15,10 @@ namespace IRaCIS.Core.Application.Service
{
var userId = Guid.Empty;
var token = string.Empty;
var isEn_Us = false;
CreateMap<SystemDocument, SystemDocumentView>()
.ForMember(d => d.FileType, u => u.MapFrom(s => s.FileType.Value))
.ForMember(d => d.FileType, u => u.MapFrom(s => isEn_Us ? s.FileType.Value: s.FileType.ValueCN))
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path));
CreateMap<TrialDocument, TrialDocumentView>()