Uat_Study
parent
d5ae752fd7
commit
9721a67708
|
@ -60,7 +60,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
|
||||
public class GetDescriptionByModuleTypeDto
|
||||
{
|
||||
public string ModuleType { get; set; } = string.Empty;
|
||||
public Guid? ModuleType { get; set; }
|
||||
}
|
||||
|
||||
///<summary>FrontAuditConfigQuery 列表查询参数模型</summary>
|
||||
|
@ -79,14 +79,14 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
public string Code { get; set; } = string.Empty;
|
||||
|
||||
///<summary> OptTypeId </summary>
|
||||
public string OptTypeId { get; set; } = string.Empty;
|
||||
public Guid? OptTypeId { get; set; }
|
||||
|
||||
///<summary> ChildrenTypeId</summary>
|
||||
public string ChildrenTypeId { get; set; } = string.Empty;
|
||||
public Guid? ChildrenTypeId { get; set; }
|
||||
|
||||
public string ModuleTypeId { get; set; } = string.Empty;
|
||||
public Guid? ModuleTypeId { get; set; }
|
||||
|
||||
public string ObjectTypeId { get; set; } = string.Empty;
|
||||
public Guid? ObjectTypeId { get; set; }
|
||||
|
||||
public string ConfigType { get; set; } = string.Empty;
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ using IRaCIS.Core.Application.Interfaces;
|
|||
using IRaCIS.Core.Application.ViewModel;
|
||||
using Castle.Core.Internal;
|
||||
using IRaCIS.Core.Infra.EFCore.Dto;
|
||||
using MassTransit;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
|
@ -47,6 +48,35 @@ namespace IRaCIS.Core.Application.Service
|
|||
return await _frontAuditConfigRepository._dbContext.GetTableColumn(tableName).ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public async Task CopyFrontAuditConfigItem(CopyFrontAuditConfigItemDto input)
|
||||
{
|
||||
var id = NewId.NextGuid();
|
||||
List<FrontAuditConfig> frontAudits= new List<FrontAuditConfig>();
|
||||
|
||||
var frontAuditConfig = (await _frontAuditConfigRepository.FirstOrDefaultAsync(x => x.Id == input.ChildId)).Clone();
|
||||
var fronts = await _frontAuditConfigRepository.Where(x => x.ParentId == frontAuditConfig.Id).ToListAsync();
|
||||
|
||||
fronts.ForEach(x =>
|
||||
{
|
||||
x.Id = NewId.NextGuid();
|
||||
x.ParentId = id;
|
||||
});
|
||||
frontAuditConfig.ParentId = input.ParentId;
|
||||
frontAuditConfig.Id = id;
|
||||
|
||||
frontAudits.Add(frontAuditConfig);
|
||||
frontAudits.AddRange(fronts);
|
||||
|
||||
await _frontAuditConfigRepository.AddRangeAsync(frontAudits);
|
||||
await _frontAuditConfigRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量添加字段
|
||||
|
@ -200,13 +230,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
|
||||
var query = from data in _repository.GetQueryable<FrontAuditConfig>()
|
||||
join childrenType in _repository.GetQueryable<Dictionary>() on data.ChildrenTypeId equals childrenType.Id.ToString() into childrenTypetemp
|
||||
join childrenType in _repository.GetQueryable<Dictionary>() on data.ChildrenTypeId equals childrenType.Id into childrenTypetemp
|
||||
from leftchildrenType in childrenTypetemp.DefaultIfEmpty()
|
||||
join ModuleType in _repository.GetQueryable<Dictionary>() on data.ModuleTypeId equals ModuleType.Id.ToString() into ModuleTypetemp
|
||||
join ModuleType in _repository.GetQueryable<Dictionary>() on data.ModuleTypeId equals ModuleType.Id into ModuleTypetemp
|
||||
from leftModuleType in ModuleTypetemp.DefaultIfEmpty()
|
||||
join OptTypeId in _repository.GetQueryable<Dictionary>() on data.OptTypeId equals OptTypeId.Id.ToString() into OptTypeIdtemp
|
||||
join OptTypeId in _repository.GetQueryable<Dictionary>() on data.OptTypeId equals OptTypeId.Id into OptTypeIdtemp
|
||||
from leftOptTypeId in OptTypeIdtemp.DefaultIfEmpty()
|
||||
join ObjectTypeId in _repository.GetQueryable<Dictionary>() on data.ObjectTypeId equals ObjectTypeId.Id.ToString() into ObjectTypeIdtemp
|
||||
join ObjectTypeId in _repository.GetQueryable<Dictionary>() on data.ObjectTypeId equals ObjectTypeId.Id into ObjectTypeIdtemp
|
||||
from leftObjectTypeIdtemp in ObjectTypeIdtemp.DefaultIfEmpty()
|
||||
select new FrontAuditConfigView()
|
||||
{
|
||||
|
@ -263,11 +293,11 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(!iq.Value.IsNullOrEmpty(), x => x.Value == iq.Value)
|
||||
.WhereIf(!iq.ValueCN.IsNullOrEmpty(), x => x.ValueCN == iq.ValueCN)
|
||||
.WhereIf(!iq.Description.IsNullOrEmpty(), x => x.Description == iq.Description)
|
||||
.WhereIf(!iq.OptTypeId.IsNullOrEmpty(), x => x.OptTypeId == iq.OptTypeId)
|
||||
.WhereIf(iq.OptTypeId!=null, x => x.OptTypeId == iq.OptTypeId)
|
||||
.WhereIf(!iq.Code.IsNullOrEmpty(), x => x.Code == iq.Code)
|
||||
.WhereIf(!iq.ChildrenTypeId.IsNullOrEmpty(), x => x.ChildrenTypeId == iq.ChildrenTypeId)
|
||||
.WhereIf(!iq.ModuleTypeId.IsNullOrEmpty(), x => x.ModuleTypeId == iq.ModuleTypeId)
|
||||
.WhereIf(!iq.ObjectTypeId.IsNullOrEmpty(), x => x.ObjectTypeId == iq.ObjectTypeId)
|
||||
.WhereIf(iq.ChildrenTypeId != null, x => x.ChildrenTypeId == iq.ChildrenTypeId)
|
||||
.WhereIf(iq.ModuleTypeId != null, x => x.ModuleTypeId == iq.ModuleTypeId)
|
||||
.WhereIf(iq.ObjectTypeId != null, x => x.ObjectTypeId == iq.ObjectTypeId)
|
||||
.WhereIf(!iq.ConfigType.IsNullOrEmpty(), x => x.ConfigType == iq.ConfigType);
|
||||
|
||||
return await query.OrderBy(x=>x.Sort).ToListAsync();
|
||||
|
|
|
@ -86,76 +86,6 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
await _repository.SaveChangesAsync();
|
||||
|
||||
|
||||
var createtime = DateTime.Now.AddSeconds(1);
|
||||
// 添加稽查记录
|
||||
if (isadd)
|
||||
{
|
||||
List<DataInspection> datas = new List<DataInspection>();
|
||||
|
||||
// 移到仓储了
|
||||
|
||||
//datas.Add(new DataInspection()
|
||||
//{
|
||||
// TrialId = subjectCommand.TrialId,
|
||||
// SiteId = subjectCommand.SiteId,
|
||||
// SubjectId = mapedSubject.Id,
|
||||
// SubjectCode = subjectCommand.Code,
|
||||
// IsSign=false,
|
||||
// CreateTime = createtime,
|
||||
// Identification = "Init|Subject|Status|Subject",
|
||||
// JsonDetail= JsonConvert.SerializeObject(new {
|
||||
// Status= "新增",
|
||||
// })
|
||||
//});
|
||||
|
||||
|
||||
JsonSerializerSettings settings = new JsonSerializerSettings();
|
||||
settings.PreserveReferencesHandling = PreserveReferencesHandling.Objects;
|
||||
settings.ReferenceLoopHandling = ReferenceLoopHandling.Serialize;
|
||||
//var jsonData = JsonConvert.SerializeObject(info, settings);
|
||||
|
||||
var visittime = createtime.AddSeconds(1);
|
||||
foreach (var item in svlist)
|
||||
{
|
||||
// 添加访视
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
TrialId = subjectCommand.TrialId,
|
||||
SiteId = subjectCommand.SiteId,
|
||||
SubjectId = mapedSubject.Id,
|
||||
SubjectCode = subjectCommand.Code,
|
||||
SubjectVisitId = item.Id,
|
||||
SubjectVisitName = item.VisitName,
|
||||
BlindName = item.BlindName,
|
||||
IsSign = false,
|
||||
CreateTime = visittime,
|
||||
Identification = "Add|Visit|Info|Visit-Image Upload",
|
||||
JsonDetail = item.ToJcJson()
|
||||
});
|
||||
|
||||
// 初始化访视
|
||||
datas.Add(new DataInspection()
|
||||
{
|
||||
TrialId = subjectCommand.TrialId,
|
||||
SiteId = subjectCommand.SiteId,
|
||||
SubjectId = mapedSubject.Id,
|
||||
SubjectCode = subjectCommand.Code,
|
||||
SubjectVisitId = item.Id,
|
||||
|
||||
BlindName = item.BlindName,
|
||||
SubjectVisitName = item.VisitName,
|
||||
IsSign = false,
|
||||
CreateTime = visittime.AddSeconds(1),
|
||||
Identification = "Init|Visit|Status|Visit-Image Upload",
|
||||
JsonDetail = item.ToJcJson()
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
await _inspectionService.AddListInspectionRecordAsync(datas);
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok(mapedSubject.Id.ToString());
|
||||
|
||||
}
|
||||
|
|
|
@ -79,21 +79,21 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// </summary>
|
||||
|
||||
public bool? IsConfig { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ModuleTypeId
|
||||
/// </summary>
|
||||
public string ModuleTypeId { get; set; }
|
||||
|
||||
/// ModuleTypeId
|
||||
/// </summary>
|
||||
public Guid? ModuleTypeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// OptTypeId
|
||||
/// </summary>
|
||||
public string OptTypeId { get; set; }
|
||||
|
||||
/// OptTypeId
|
||||
/// </summary>
|
||||
public Guid? OptTypeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ChildrenTypeId
|
||||
/// </summary>
|
||||
public string ChildrenTypeId { get; set; }
|
||||
/// ChildrenTypeId
|
||||
/// </summary>
|
||||
public Guid? ChildrenTypeId { get; set; }
|
||||
|
||||
public bool? IsShowParent { get; set; }
|
||||
|
||||
|
@ -109,7 +109,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public string EnumType { get; set; }
|
||||
|
||||
|
||||
public string ObjectTypeId { get; set; }
|
||||
public Guid? ObjectTypeId { get; set; }
|
||||
|
||||
|
||||
public bool? IsShowByTrialConfig { get; set; }
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// <summary>
|
||||
/// 功能模块
|
||||
/// </summary>
|
||||
public string ModuleType { get; set; }
|
||||
public Guid? ModuleType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 盲态访视名
|
||||
|
@ -59,7 +59,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// <summary>
|
||||
/// 操作类型
|
||||
/// </summary>
|
||||
public string OptType { get; set; }
|
||||
public Guid? OptType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// IP地址
|
||||
|
@ -91,7 +91,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// <summary>
|
||||
/// 子类
|
||||
/// </summary>
|
||||
public string ChildrenType { get; set; }
|
||||
public Guid? ChildrenType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Json 对象
|
||||
|
@ -142,7 +142,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// <summary>
|
||||
/// 对象名称
|
||||
/// </summary>
|
||||
public string ObjectType { get; set; }
|
||||
public Guid? ObjectType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标识
|
||||
|
|
|
@ -96,7 +96,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
{
|
||||
await InsertInspection<SubjectVisit>(item, type, x => new DataInspection()
|
||||
{
|
||||
SubjectId = x.Id
|
||||
SubjectVisitId = x.Id
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
|
|
@ -17,6 +17,17 @@ namespace IRaCIS.Core.Infra.EFCore.Dto
|
|||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 复制
|
||||
/// </summary>
|
||||
public class CopyFrontAuditConfigItemDto
|
||||
{
|
||||
public Guid ParentId { get; set; }
|
||||
|
||||
public Guid ChildId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 稽查数据
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue