Uat_Study
parent
d54193031e
commit
9180fd38df
|
@ -33,9 +33,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<string>> SetDictionaryValue(SetDictionaryValueDto dto)
|
||||
public async Task<List<string>> SetInspectionEnumValue(SetInspectionEnumValueDto dto)
|
||||
{
|
||||
return await _frontAuditConfigRepository.SetDictionaryValue(dto);
|
||||
return await _frontAuditConfigRepository.SetInspectionEnumValue(dto);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -253,6 +253,10 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
|||
public bool obtaionOrCancel { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 稽查泛型Dto
|
||||
/// </summary>
|
||||
/// <typeparam name="T">泛型</typeparam>
|
||||
public class DataInspectionDto<T> : IInspectionDTO, ISignDTO
|
||||
{
|
||||
|
||||
|
@ -267,9 +271,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
|||
{
|
||||
if (auditInfo.JsonDetail.IsNullOrEmpty())
|
||||
{
|
||||
IsoDateTimeConverter timeFormat = new IsoDateTimeConverter();
|
||||
timeFormat.DateTimeFormat = "yyyy-MM-dd";
|
||||
auditInfo.JsonDetail = JsonConvert.SerializeObject(OptCommand, Newtonsoft.Json.Formatting.Indented, timeFormat);
|
||||
auditInfo.JsonDetail = JsonConvert.SerializeObject(OptCommand);
|
||||
}
|
||||
|
||||
return auditInfo;
|
||||
|
|
|
@ -922,6 +922,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
}
|
||||
|
||||
// 移动不进去
|
||||
await _trialRepository.AddListInspectionRecordAsync(datas);
|
||||
await _repository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok();
|
||||
|
@ -2051,6 +2052,8 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
data.JsonDetail = JsonConvert.SerializeObject(keyValuePairs);
|
||||
datas.Add(data);
|
||||
}
|
||||
|
||||
// 这里使用的是批量更新
|
||||
await _subjectVisitRepository.AddListInspectionRecordAsync(datas);
|
||||
|
||||
await _subjectVisitRepository.SaveChangesAsync();
|
||||
|
|
|
@ -296,38 +296,38 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
|
||||
|
||||
foreach (var changedItem in changedList)
|
||||
{
|
||||
//foreach (var changedItem in changedList)
|
||||
//{
|
||||
|
||||
var list = await _subjectVisitRepository.Where(t => t.TrialId == trialId && t.VisitStageId == changedItem.Id).ToListAsync();
|
||||
list.ForEach(x =>
|
||||
{
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
BlindName = x.BlindName,
|
||||
IsSign = false,
|
||||
SiteId = x.SiteId,
|
||||
SubjectId = x.SubjectId,
|
||||
SubjectVisitId = x.Id,
|
||||
CreateTime = createtime,
|
||||
SubjectVisitName = x.VisitName,
|
||||
TrialId = x.TrialId,
|
||||
Reason = "确认访视修改状态",
|
||||
JsonDetail = JsonConvert.SerializeObject(new
|
||||
{
|
||||
IsBaseLine = changedItem.IsBaseLine,
|
||||
VisitName = changedItem.VisitName,
|
||||
VisitNum = changedItem.VisitNum,
|
||||
VisitDay = changedItem.VisitDay,
|
||||
SubmitState = x.SubmitState,
|
||||
VisitWindowLeft = changedItem.VisitWindowLeft,
|
||||
VisitWindowRight = changedItem.VisitWindowRight
|
||||
}),
|
||||
Identification = "Edit|Visit|Info|Visit-Image Upload"
|
||||
});
|
||||
});
|
||||
// var list = await _subjectVisitRepository.Where(t => t.TrialId == trialId && t.VisitStageId == changedItem.Id).ToListAsync();
|
||||
// list.ForEach(x =>
|
||||
// {
|
||||
// datas.Add(new DataInspection()
|
||||
// {
|
||||
// BlindName = x.BlindName,
|
||||
// IsSign = false,
|
||||
// SiteId = x.SiteId,
|
||||
// SubjectId = x.SubjectId,
|
||||
// SubjectVisitId = x.Id,
|
||||
// CreateTime = createtime,
|
||||
// SubjectVisitName = x.VisitName,
|
||||
// TrialId = x.TrialId,
|
||||
// Reason = "确认访视修改状态",
|
||||
// JsonDetail = JsonConvert.SerializeObject(new
|
||||
// {
|
||||
// IsBaseLine = changedItem.IsBaseLine,
|
||||
// VisitName = changedItem.VisitName,
|
||||
// VisitNum = changedItem.VisitNum,
|
||||
// VisitDay = changedItem.VisitDay,
|
||||
// SubmitState = x.SubmitState,
|
||||
// VisitWindowLeft = changedItem.VisitWindowLeft,
|
||||
// VisitWindowRight = changedItem.VisitWindowRight
|
||||
// }),
|
||||
// Identification = "Edit|Visit|Info|Visit-Image Upload"
|
||||
// });
|
||||
// });
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
var subjectsids = _repository.GetQueryable<Subject>().Where(x => x.TrialId == trialId).Select(x => new
|
||||
{
|
||||
|
|
|
@ -86,6 +86,7 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
JsonDetail = subjectvisit.ToJcJson(),
|
||||
});
|
||||
|
||||
// 这里是触发器的位置
|
||||
await _subjectVisitRepository.AddListInspectionRecordAsync(datas);
|
||||
|
||||
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == subjectVisitId && t.SubmitState == SubmitStateEnum.ToSubmit,
|
||||
|
|
|
@ -6,15 +6,15 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Dto
|
||||
{
|
||||
public class SetDictionaryValueDto
|
||||
public class SetInspectionEnumValueDto
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public List<SetDictionaryDto> Items { get; set; }
|
||||
public List<SetInspectionEnum> Items { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class SetDictionaryDto
|
||||
public class SetInspectionEnum
|
||||
{
|
||||
public string Identification { get; set; }
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
/// <param name="ForeignKeyText">要查询的外键值</param>
|
||||
/// <param name="value">传入的纸</param>
|
||||
/// <returns></returns>
|
||||
Task<string> GetDictionaryValue(string Identification, string json);
|
||||
Task<string> GetInspectionEnumValue(string Identification, string json);
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
@ -67,7 +67,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
/// </summary>
|
||||
/// <param name="dto">传入Dto</param>
|
||||
/// <returns></returns>
|
||||
Task<List<string>> SetDictionaryValue(SetDictionaryValueDto dto);
|
||||
Task<List<string>> SetInspectionEnumValue(SetInspectionEnumValueDto dto);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -569,12 +569,11 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
/// </summary>
|
||||
/// <param name="dto">传入Dto</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<string>> SetDictionaryValue(SetDictionaryValueDto dto)
|
||||
public async Task<List<string>> SetInspectionEnumValue(SetInspectionEnumValueDto dto)
|
||||
{
|
||||
|
||||
foreach (var item in dto.Items)
|
||||
{
|
||||
item.Json = await GetDictionaryValue(item.Identification,item.Json);
|
||||
item.Json = await GetInspectionEnumValue(item.Identification,item.Json);
|
||||
item.Json = await SetEnum(dto.TrialId, item.Identification, item.Json);
|
||||
}
|
||||
|
||||
|
@ -590,9 +589,9 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
/// <param name="ForeignKeyText">要查询的外键值</param>
|
||||
/// <param name="value">传入的纸</param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetDictionaryValue(string Identification, string json)
|
||||
public async Task<string> GetInspectionEnumValue(string identification, string json)
|
||||
{
|
||||
var list = await (from u in _dbContext.FrontAuditConfig.Where(x => x.Identification == Identification)
|
||||
var list = await (from u in _dbContext.FrontAuditConfig.Where(x => x.Identification == identification)
|
||||
join p in _dbContext.FrontAuditConfig.Where(x => x.EnumType == "Foreign") on u.Id equals p.ParentId
|
||||
select new
|
||||
{
|
||||
|
@ -645,9 +644,9 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
/// <param name="json">Json对象</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||
public async Task<string> SetEnum(Guid trilaid, string Identification, string json)
|
||||
public async Task<string> SetEnum(Guid trilaid, string identification, string json)
|
||||
{
|
||||
var list = await (from u in _dbContext.FrontAuditConfig.Where(x => x.Identification == Identification)
|
||||
var list = await (from u in _dbContext.FrontAuditConfig.Where(x => x.Identification == identification)
|
||||
join p in _dbContext.FrontAuditConfig.Where(x => x.Code != "AuditState" && (x.DictionaryCode != null && x.DictionaryCode != string.Empty && x.DictionaryType != null && x.DictionaryType != string.Empty)) on u.Id equals p.ParentId
|
||||
select new
|
||||
{
|
||||
|
@ -767,6 +766,12 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加稽查记录
|
||||
/// </summary>
|
||||
/// <param name="entity">实体</param>
|
||||
/// <param name="isSaveAudit"></param>
|
||||
/// <returns></returns>
|
||||
private async Task AddInspectionAsync(TEntity entity, bool isSaveAudit = false)
|
||||
{
|
||||
List<DataInspection> datas = new List<DataInspection>();
|
||||
|
@ -800,7 +805,6 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
SiteId = data.SiteId,
|
||||
SubjectId = data.Id,
|
||||
SubjectCode = data.Code,
|
||||
|
||||
IsSign = false,
|
||||
CreateTime = createtime,
|
||||
Identification = "Init|Subject|Status|Subject", // 初始化受试者信息
|
||||
|
@ -935,7 +939,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
/// <summary>
|
||||
/// 格式化日期和时间
|
||||
/// </summary>
|
||||
/// <param name="Data"></param>
|
||||
/// <param name="Data">稽查数据</param>
|
||||
/// <returns></returns>
|
||||
public async Task<DataInspection> SetDataInspectionDateType(DataInspection Data)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue