修改
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using IRaCIS.Application.Contracts;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
@@ -134,12 +135,45 @@ namespace IRaCIS.Application.Services
|
||||
return searchList;
|
||||
}
|
||||
|
||||
|
||||
public async Task<BasicDicView> GetBasicDataTranslateItem(string parentCode, string childCode)
|
||||
/// <summary>
|
||||
/// 获取是和否
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetBoolValueState(bool value)
|
||||
{
|
||||
return (await _dicRepository.Where(t => t.Parent.Code == parentCode && t.Code == childCode)
|
||||
.ProjectTo<BasicDicView>(_mapper.ConfigurationProvider).FirstOrDefaultAsync())
|
||||
.IfNullThrowConvertException();
|
||||
return await _dicRepository.Where(t => t.Parent.Code == "YesOrNo" && t.Code == value.ToString()).Select(x => x.ValueCN).FirstOrDefaultAsync() ?? string.Empty;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取审核状态
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="trial"></param>
|
||||
/// <param name="childCode"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetAuditState<T>(Guid trial, T childCode)
|
||||
{
|
||||
var QCProcessEnum = _trialRepository.Where(x=>x.Id==trial).Select(x => x.QCProcessEnum).FirstOrDefault();
|
||||
switch (QCProcessEnum)
|
||||
{
|
||||
|
||||
|
||||
case TrialQCProcess.SingleAudit:
|
||||
return await _dicRepository.Where(t => t.Parent.Code == "AuditStatePE" && t.Code == Convert.ToInt32(childCode).ToString()).Select(x => x.ValueCN).FirstOrDefaultAsync() ?? string.Empty;
|
||||
|
||||
case TrialQCProcess.DoubleAudit:
|
||||
return await _dicRepository.Where(t => t.Parent.Code == "AuditStateRC" && t.Code == Convert.ToInt32(childCode).ToString()).Select(x => x.ValueCN).FirstOrDefaultAsync() ?? string.Empty;
|
||||
default:
|
||||
return string.Empty;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<string> GetBasicDataTranslateItem<T>(string parentCode, T childCode)
|
||||
{
|
||||
return await _dicRepository.Where(t => t.Parent.Code == parentCode && t.Code == Convert.ToInt32(childCode).ToString() ).Select(x => x.ValueCN).FirstOrDefaultAsync()??string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,7 +8,31 @@ namespace IRaCIS.Application.Interfaces
|
||||
{
|
||||
public interface IDictionaryService
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取是和否
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
Task<string> GetBoolValueState(bool value);
|
||||
|
||||
/// <summary>
|
||||
/// 获取审核状态
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="trial"></param>
|
||||
/// <param name="childCode"></param>
|
||||
/// <returns></returns>
|
||||
Task<string> GetAuditState<T>(Guid trial, T childCode);
|
||||
|
||||
/// <summary>
|
||||
/// 获取枚举翻译
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="parentCode"></param>
|
||||
/// <param name="childCode"></param>
|
||||
/// <returns></returns>
|
||||
Task<string> GetBasicDataTranslateItem<T>(string parentCode, T childCode);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user