修改问题
parent
fa33be9718
commit
ee0ead7017
|
@ -286,7 +286,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> QCPassedOrFailed(DataInspectionDto<QCPassedOrFailedDto> opt)
|
||||
{
|
||||
var fun = await _qCOperationService.QCPassedOrFailed(opt.OptCommand.trialId, opt.OptCommand.subjectVisitId, opt.OptCommand.signId, opt.OptCommand.auditState);
|
||||
var fun = await _qCOperationService.QCPassedOrFailed(opt.OptCommand.trialId, opt.OptCommand.subjectVisitId, opt.OptCommand.auditState);
|
||||
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, null, fun);
|
||||
}
|
||||
|
||||
|
@ -385,7 +385,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||
{
|
||||
return ResponseOutput.NotOk(fun.ErrorMessage);
|
||||
}
|
||||
|
||||
opt.AuditInfo.NeedSava = false;
|
||||
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo,null, fun);
|
||||
}
|
||||
|
||||
|
|
|
@ -485,6 +485,11 @@
|
|||
是否为特殊类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.ViewModel.FrontAuditConfigAddOrEdit.DateType">
|
||||
<summary>
|
||||
日期类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.ViewModel.SystemAnonymizationView">
|
||||
<summary> SystemAnonymizationView 列表视图模型 </summary>
|
||||
</member>
|
||||
|
@ -1508,7 +1513,7 @@
|
|||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Image.QA.QCOperationService.QCPassedOrFailed(System.Guid,System.Guid,System.Guid,IRaCIS.Core.Domain.Share.AuditStateEnum)">
|
||||
<member name="M:IRaCIS.Core.Application.Image.QA.QCOperationService.QCPassedOrFailed(System.Guid,System.Guid,IRaCIS.Core.Domain.Share.AuditStateEnum)">
|
||||
<summary>
|
||||
设置QC 通过或者不通过 7:QC failed 8:QC passed
|
||||
</summary>
|
||||
|
|
|
@ -192,6 +192,13 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
public bool? IsSpecialType { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 日期类型
|
||||
/// </summary>
|
||||
|
||||
public string DateType { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -78,6 +78,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
ModuleTypeId = additem?.ModuleTypeId,
|
||||
ObjectTypeId = additem?.ObjectTypeId,
|
||||
OptTypeId = additem?.OptTypeId,
|
||||
DateType = lst.Select(x => x.DateType).FirstOrDefault(),
|
||||
Id =Guid.NewGuid(),
|
||||
}).ToList();
|
||||
|
||||
|
@ -188,6 +189,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
ChildDataLabel=data.ChildDataLabel,
|
||||
ChildDataValue=data.ChildDataValue,
|
||||
IsSpecialType=data.IsSpecialType,
|
||||
DateType=data.DataType,
|
||||
};
|
||||
|
||||
query = query
|
||||
|
|
|
@ -112,6 +112,8 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
|||
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
public bool NeedSava { get; set; } = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -187,7 +189,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
|||
{
|
||||
public Guid trialId { get; set; }
|
||||
public Guid subjectVisitId { get; set; }
|
||||
public Guid signId { get; set; }
|
||||
|
||||
public AuditStateEnum auditState { get; set; }
|
||||
}
|
||||
|
||||
|
|
|
@ -216,7 +216,11 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
|||
}
|
||||
|
||||
// 判断是否需要前面
|
||||
await AddInspectionRecordAsync(AuditInfo, signId);
|
||||
if (AuditInfo.NeedSava)
|
||||
{
|
||||
await AddInspectionRecordAsync(AuditInfo, signId);
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
@ -282,7 +286,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
|||
/// <param name="addDto">添加对象</param>
|
||||
/// <param name="signId">签名Id</param>
|
||||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> AddInspectionRecordAsync(DataInspectionAddDTO addDto, Guid? signId=null)
|
||||
public async Task<IResponseOutput> AddInspectionRecordAsync(DataInspectionAddDTO addDto, Guid? signId = null)
|
||||
{
|
||||
if (addDto == new DataInspectionAddDTO())
|
||||
{
|
||||
|
@ -292,15 +296,19 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
|||
var add = _mapper.Map<DataInspection>(addDto);
|
||||
await SetInspectionNameValue(add);
|
||||
Guid? parentId = null;
|
||||
parentId = (await _repository.GetQueryable<DataInspection>().Where( x => x.TrialId == add.TrialId && x.SubjectVisitId == add.SubjectVisitId && x.SubjectId == add.SubjectId && x.SiteId == add.SiteId&&x.ChildrenType==add.ChildrenType && x.ObjectType==add.ObjectType&&x.VisitStageId==add.VisitStageId&&x.GeneralId==add.GeneralId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
|
||||
parentId = (await _repository.GetQueryable<DataInspection>().Where(x => x.TrialId == add.TrialId && x.SubjectVisitId == add.SubjectVisitId && x.SubjectId == add.SubjectId && x.SiteId == add.SiteId && x.ChildrenType == add.ChildrenType && x.ObjectType == add.ObjectType && x.VisitStageId == add.VisitStageId && x.GeneralId == add.GeneralId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
|
||||
add.ParentId = parentId;
|
||||
add.CreateTime = DateTime.Now;
|
||||
add.CreateUserId = _userInfo.Id;
|
||||
add.SignId = signId;
|
||||
add.IP = _userInfo.IP;
|
||||
|
||||
|
||||
|
||||
add =await _dataInspectionRepository.SetDataInspectionDateType(add);
|
||||
|
||||
|
||||
await _repository.AddAsync(add);
|
||||
|
||||
|
||||
|
||||
var success = await _repository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok(success);
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
{
|
||||
Task<IResponseOutput> CheckBack(Guid subjectVisitId);
|
||||
Task<IResponseOutput> SetNeedReupload(Guid trialId, Guid qcChallengeId);
|
||||
Task<IResponseOutput> QCPassedOrFailed(Guid trialId, Guid subjectVisitId, Guid signId, [FromRoute] AuditStateEnum auditState);
|
||||
Task<IResponseOutput> QCPassedOrFailed(Guid trialId, Guid subjectVisitId, [FromRoute] AuditStateEnum auditState);
|
||||
Task<IResponseOutput> SetCheckPass(Guid subjectVisitId);
|
||||
|
||||
|
||||
|
|
|
@ -1382,7 +1382,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
[HttpPost("{trialId:guid}/{subjectVisitId:guid}/{signId:guid}/{auditState:int}")]
|
||||
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
public async Task<IResponseOutput> QCPassedOrFailed(Guid trialId, Guid subjectVisitId, Guid signId, [FromRoute] AuditStateEnum auditState)
|
||||
public async Task<IResponseOutput> QCPassedOrFailed(Guid trialId, Guid subjectVisitId, [FromRoute] AuditStateEnum auditState)
|
||||
{
|
||||
|
||||
if (!await _repository.AnyAsync<TrialUser>(t => t.TrialId == trialId && t.UserId == _userInfo.Id))
|
||||
|
@ -1546,9 +1546,9 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
await _repository.SaveChangesAsync();
|
||||
|
||||
var success = await _repository.BatchUpdateAsync<TrialSign>(t => t.Id == signId, u => new TrialSign() { IsCompleted = true });
|
||||
//var success = await _repository.BatchUpdateAsync<TrialSign>(t => t.Id == signId, u => new TrialSign() { IsCompleted = true });
|
||||
|
||||
return ResponseOutput.Result(success);
|
||||
return ResponseOutput.Result(true);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -27,3 +27,5 @@ public class SignDTO
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -174,6 +174,13 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public bool? IsSpecialType { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 日期类型
|
||||
/// </summary>
|
||||
|
||||
public string DateType { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Dto
|
||||
{
|
||||
public class DateDto
|
||||
{
|
||||
public string Code { get; set; }
|
||||
|
||||
public string DateType { get; set; }
|
||||
}
|
||||
|
||||
}
|
|
@ -31,6 +31,14 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
/// <param name="datas"></param>
|
||||
/// <returns></returns>
|
||||
Task AddListInspectionRecordAsync(List<DataInspection> datas);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 格式化日期和时间
|
||||
/// </summary>
|
||||
/// <param name="Data"></param>
|
||||
/// <returns></returns>
|
||||
Task<DataInspection> SetDataInspectionDateType(DataInspection Data);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ using IRaCIS.Core.Infrastructure;
|
|||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Newtonsoft.Json;
|
||||
using IRaCIS.Core.Infra.EFCore.Dto;
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore
|
||||
{
|
||||
|
@ -183,6 +184,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
add.CreateTime = DateTime.Now;
|
||||
}
|
||||
add.JsonDetail = JsonConvert.SerializeObject(JsonData);
|
||||
await SetDataInspectionDateType(add);
|
||||
}
|
||||
|
||||
await _dbContext.DataInspection.AddRangeAsync(datas);
|
||||
|
@ -207,6 +209,55 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 格式化日期和时间
|
||||
/// </summary>
|
||||
/// <param name="Data"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<DataInspection> SetDataInspectionDateType(DataInspection Data)
|
||||
{
|
||||
var list = await (from parent in _dbContext.FrontAuditConfig.AsQueryable().Where(x => x.Identification == Data.Identification)
|
||||
join child in _dbContext.FrontAuditConfig.AsQueryable().Where(x => x.DateType != null && x.DateType != string.Empty) on parent.Id equals child.ParentId
|
||||
select new DateDto()
|
||||
{
|
||||
Code= child.Code,
|
||||
DateType= child.DateType,
|
||||
}).ToListAsync();
|
||||
|
||||
var JsonData = JsonConvert.DeserializeObject<IDictionary<string, object>>(Data.JsonDetail);
|
||||
|
||||
foreach (var item in JsonData.Keys)
|
||||
{
|
||||
var datefirst = list.FirstOrDefault(x => x.Code.ToLower() == item.ToLower());
|
||||
if (datefirst != null&& !IsNullOrEmpty(JsonData[item]))
|
||||
{
|
||||
try
|
||||
{
|
||||
if (datefirst.DateType == "Date")
|
||||
{
|
||||
JsonData[item] = DateTime.Parse(JsonData[item].ToString()).ToString("yyyy-MM-dd");
|
||||
}
|
||||
|
||||
if (datefirst.DateType == "DateTime")
|
||||
{
|
||||
JsonData[item] = DateTime.Parse(JsonData[item].ToString()).ToString("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Data.JsonDetail = JsonConvert.SerializeObject(JsonData);
|
||||
|
||||
return Data;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue