代码提交
This commit is contained in:
@@ -32,12 +32,21 @@ public class TrialFileTypeData
|
||||
public List<TrialFileTypeView> TrialFileTypeList { get; set; }
|
||||
}
|
||||
|
||||
public class SetAuthorizedViewInDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public bool IsAuthorizedView { get; set; }
|
||||
}
|
||||
|
||||
public class GetTrialFileTypeDataInDto
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public bool IsCheck { get; set; } = false;
|
||||
/// <summary>
|
||||
/// 是否授权
|
||||
/// </summary>
|
||||
public bool IsAuthorizedView { get; set; } = false;
|
||||
}
|
||||
public class CopySystemFileTypeToTrialInDto
|
||||
{
|
||||
@@ -82,6 +91,11 @@ public class TrialFileTypeAddOrEdit
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否授权
|
||||
/// </summary>
|
||||
public bool IsAuthorizedView { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 显示顺序
|
||||
/// </summary>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
using System;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
namespace IRaCIS.Core.Application.ViewModel;
|
||||
|
||||
public class TrialFinalRecordView : TrialFinalRecordAddOrEdit
|
||||
@@ -23,15 +24,15 @@ public class TrialFinalRecordAddOrEdit
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
public Guid HistoryFileRecordId { get; set; }
|
||||
public Guid? HistoryFileRecordId { get; set; }
|
||||
|
||||
public bool IsAuthorizedView { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public Guid PDFFileRecordId { get; set; }
|
||||
public Guid? PDFFileRecordId { get; set; }
|
||||
|
||||
public Guid SignFileRecordId { get; set; }
|
||||
public Guid? SignFileRecordId { get; set; }
|
||||
|
||||
public int State { get; set; }
|
||||
|
||||
@@ -41,8 +42,28 @@ public class TrialFinalRecordAddOrEdit
|
||||
|
||||
public string Version { get; set; }
|
||||
|
||||
public Guid WordFileRecordId { get; set; }
|
||||
}
|
||||
public Guid? WordFileRecordId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 定稿PDF
|
||||
/// </summary>
|
||||
public TrialFile PDFFileRecord { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 定稿Word
|
||||
/// </summary>
|
||||
public TrialFile WordFileRecord { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 签名页
|
||||
/// </summary>
|
||||
public TrialFile SignFileRecord { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 历史记录
|
||||
/// </summary>
|
||||
public TrialFile HistoryFileRecord { get; set; }
|
||||
}
|
||||
|
||||
public class TrialFinalRecordQuery : PageInput
|
||||
{
|
||||
@@ -51,10 +72,7 @@ public class TrialFinalRecordQuery : PageInput
|
||||
public bool? IsAuthorizedView { get; set; }
|
||||
|
||||
public string? Name { get; set; }
|
||||
|
||||
public Guid? PDFFileRecordId { get; set; }
|
||||
|
||||
public Guid? SignFileRecordId { get; set; }
|
||||
|
||||
|
||||
public int? State { get; set; }
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ public class TrialFileTypeService(IRepository<TrialFileType> _trialFileTypeRepos
|
||||
TrialId = inDto.TrialId
|
||||
});
|
||||
var trialFileTypeList = await _trialFileTypeRepository.Where(x=>x.TrialId==inDto.TrialId)
|
||||
.WhereIf(inDto.IsCheck, x => x.IsEnable)
|
||||
.WhereIf(inDto.IsAuthorizedView, x => x.IsAuthorizedView)
|
||||
.OrderBy(x=>x.ShowOrder)
|
||||
.ProjectTo<TrialFileTypeView>(_mapper.ConfigurationProvider)
|
||||
.ToListAsync();
|
||||
@@ -153,6 +153,18 @@ public class TrialFileTypeService(IRepository<TrialFileType> _trialFileTypeRepos
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改授权状态
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> SetAuthorizedView(SetAuthorizedViewInDto inDto)
|
||||
{
|
||||
await _trialFileTypeRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.Id, x => new TrialFileType() { IsAuthorizedView = inDto.IsAuthorizedView }, true);
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,13 +27,16 @@ public class TrialFinalRecordService(IRepository<TrialFinalRecord> _trialFinalRe
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<TrialFinalRecordView>> GetTrialFinalRecordList(TrialFinalRecordQuery inQuery)
|
||||
public async Task<PageOutput<TrialFinalRecordView>> GetTrialFinalRecordList(TrialFinalRecordQuery inDto)
|
||||
{
|
||||
|
||||
var trialFinalRecordQueryable = _trialFinalRecordRepository
|
||||
.ProjectTo<TrialFinalRecordView>(_mapper.ConfigurationProvider);
|
||||
.WhereIf(inDto.Name.IsNotNullOrEmpty(),x=>x.Name.Contains(inDto.Name))
|
||||
.WhereIf(inDto.Version.IsNotNullOrEmpty(), x => x.Version.Contains(inDto.Version))
|
||||
.WhereIf(inDto.IsAuthorizedView!=null, x => x.IsAuthorizedView==inDto.IsAuthorizedView)
|
||||
.ProjectTo<TrialFinalRecordView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var pageList = await trialFinalRecordQueryable.ToPagedListAsync(inQuery);
|
||||
var pageList = await trialFinalRecordQueryable.ToPagedListAsync(inDto);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user