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