@@ -1450,7 +1450,7 @@
|
||||
<param name="_userInfo"></param>
|
||||
<param name="_localizer"></param>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialFileTypeService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialFileType},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialFileTypeService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialFileType},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SysFileType},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<summary>
|
||||
项目文件类型
|
||||
</summary>
|
||||
|
||||
@@ -33,7 +33,7 @@ public class SysFileTypeAddOrEdit
|
||||
|
||||
public string NameCN { get; set; }
|
||||
|
||||
public int SubIdentification { get; set; }
|
||||
public SubIdentification SubIdentificationEnum { get; set; }
|
||||
}
|
||||
|
||||
public class SysFileTypeQuery : PageInput
|
||||
@@ -48,7 +48,7 @@ public class SysFileTypeQuery : PageInput
|
||||
|
||||
public string? NameCN { get; set; }
|
||||
|
||||
public int? SubIdentification { get; set; }
|
||||
public SubIdentification? SubIdentificationEnum { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,6 +20,10 @@ public class TrialFileTypeView : TrialFileTypeAddOrEdit
|
||||
|
||||
}
|
||||
|
||||
public class CopySystemFileTypeToTrialInDto
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
}
|
||||
|
||||
public class TrialFileTypeSelectView
|
||||
{
|
||||
@@ -52,9 +56,9 @@ public class TrialFileTypeAddOrEdit
|
||||
public string Name { get; set; }
|
||||
|
||||
public string NameCN { get; set; }
|
||||
|
||||
public int SubIdentification { get; set; }
|
||||
|
||||
|
||||
public SubIdentification SubIdentificationEnum { get; set; }
|
||||
|
||||
public Guid? SysFileTypeId { get; set; }
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
@@ -75,9 +79,8 @@ public class TrialFileTypeQuery : PageInput
|
||||
public string? Name { get; set; }
|
||||
|
||||
public string? NameCN { get; set; }
|
||||
|
||||
public int? SubIdentification { get; set; }
|
||||
|
||||
|
||||
public SubIdentification? SubIdentificationEnum { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
@@ -34,7 +34,7 @@ public class SysFileTypeService(IRepository<SysFileType> _sysFileTypeRepository,
|
||||
var sysFileTypeQueryable = _sysFileTypeRepository
|
||||
.WhereIf(inQuery.ArchiveTypeEnum != null, t => t.ArchiveTypeEnum == inQuery.ArchiveTypeEnum)
|
||||
.WhereIf(inQuery.IsConfirmRecord != null, t => t.IsConfirmRecord == inQuery.IsConfirmRecord)
|
||||
.WhereIf(inQuery.SubIdentification != null, t => t.SubIdentification == inQuery.SubIdentification)
|
||||
.WhereIf(inQuery.SubIdentificationEnum != null, t => t.SubIdentificationEnum == inQuery.SubIdentificationEnum)
|
||||
.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable)
|
||||
.WhereIf(inQuery.Name.IsNotNullOrEmpty(), t => t.Name.Contains(inQuery.Name))
|
||||
.WhereIf(inQuery.NameCN.IsNotNullOrEmpty(), t => t.NameCN.Contains(inQuery.NameCN))
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace IRaCIS.Core.Application.Service;
|
||||
/// <param name="_localizer"></param>
|
||||
[ApiExplorerSettings(GroupName = "FileRecord")]
|
||||
public class TrialFileTypeService(IRepository<TrialFileType> _trialFileTypeRepository,
|
||||
IRepository<SysFileType> _sysFileTypeRepository,
|
||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITrialFileTypeService
|
||||
{
|
||||
|
||||
@@ -35,7 +36,7 @@ public class TrialFileTypeService(IRepository<TrialFileType> _trialFileTypeRepos
|
||||
|
||||
.WhereIf(inQuery.ArchiveTypeEnum != null, t => t.ArchiveTypeEnum == inQuery.ArchiveTypeEnum)
|
||||
.WhereIf(inQuery.IsConfirmRecord != null, t => t.IsConfirmRecord == inQuery.IsConfirmRecord)
|
||||
.WhereIf(inQuery.SubIdentification != null, t => t.SubIdentification == inQuery.SubIdentification)
|
||||
.WhereIf(inQuery.SubIdentificationEnum != null, t => t.SubIdentificationEnum == inQuery.SubIdentificationEnum)
|
||||
.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable)
|
||||
.WhereIf(inQuery.Name.IsNotNullOrEmpty(), t => t.Name.Contains(inQuery.Name))
|
||||
.WhereIf(inQuery.NameCN.IsNotNullOrEmpty(), t => t.NameCN.Contains(inQuery.NameCN))
|
||||
@@ -103,6 +104,27 @@ public class TrialFileTypeService(IRepository<TrialFileType> _trialFileTypeRepos
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 复制系统数据到项目
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> CopySystemFileTypeToTrial(CopySystemFileTypeToTrialInDto inDto)
|
||||
{
|
||||
if (!(await _trialFileTypeRepository.AnyAsync(x => x.TrialId == inDto.TrialId)))
|
||||
{
|
||||
var trialFileTypeList = await _sysFileTypeRepository
|
||||
.ProjectTo<TrialFileType>(_mapper.ConfigurationProvider)
|
||||
.ToListAsync();
|
||||
|
||||
trialFileTypeList.ForEach(x => x.TrialId = inDto.TrialId);
|
||||
|
||||
await _trialFileTypeRepository.AddRangeAsync(trialFileTypeList, true);
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -18,6 +18,12 @@ namespace IRaCIS.Core.Application.Service
|
||||
.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<SysFileType, TrialFileType>()
|
||||
.ForMember(d => d.SysFileTypeId, u => u.MapFrom(s => s.Id))
|
||||
.ForMember(d => d.IsSelfDefine, u => u.MapFrom(s => false))
|
||||
.ForMember(dest => dest.CreateUserRole, opt => opt.Ignore());
|
||||
|
||||
CreateMap<TrialDocument, TrialDocumentView>()
|
||||
.ForMember(d => d.FileType, u => u.MapFrom(s => isEn_Us ? s.FileType.Value : s.FileType.ValueCN))
|
||||
.ForMember(d => d.IsSomeUserSigned, u => u.MapFrom(s => s.TrialDocConfirmedUserList.Any(t => t.ConfirmTime != null)))
|
||||
|
||||
Reference in New Issue
Block a user