diff --git a/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs index c8ac2b641..722135d24 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs @@ -50,6 +50,10 @@ namespace IRaCIS.Core.Application.ViewModel public string ObjectTypeId { get; set; } = string.Empty; + public string ObjectTypeValue { get; set; } = string.Empty; + + public string ObjectTypeValueCN { get; set; } = string.Empty; + public bool? IsShowByTrialConfig { get; set; } public string ByTrialConfig { get; set; } = string.Empty; diff --git a/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs index f93714b4a..bbc58468e 100644 --- a/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Common/FrontAuditConfigService.cs @@ -43,7 +43,9 @@ namespace IRaCIS.Core.Application.Service from leftModuleType in ModuleTypetemp.DefaultIfEmpty() join OptTypeId in _repository.GetQueryable() on data.OptTypeId equals OptTypeId.Id.ToString() into OptTypeIdtemp from leftOptTypeId in OptTypeIdtemp.DefaultIfEmpty() - select new FrontAuditConfigView() + join ObjectTypeId in _repository.GetQueryable() on data.ObjectTypeId equals ObjectTypeId.Id.ToString() into ObjectTypeIdtemp + from leftObjectTypeIdtemp in ObjectTypeIdtemp.DefaultIfEmpty() + select new FrontAuditConfigView() { IsShowParent = data.IsShowParent, @@ -74,7 +76,9 @@ namespace IRaCIS.Core.Application.Service DictionaryKey=data.DictionaryKey, EnumType=data.EnumType, ObjectTypeId=data.ObjectTypeId, - IsShowByTrialConfig=data.IsShowByTrialConfig, + ObjectTypeValue = leftObjectTypeIdtemp.Value, + ObjectTypeValueCN = leftObjectTypeIdtemp.ValueCN, + IsShowByTrialConfig =data.IsShowByTrialConfig, ByTrialConfig=data.ByTrialConfig, }; diff --git a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs index d6e4b301f..303959648 100644 --- a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs +++ b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs @@ -204,7 +204,10 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO public string UserFirstName { get; set; } = string.Empty; public string UserLastName { get; set; } = string.Empty; - public string SubjectCode { get; set; } = string.Empty; + + + + public string Description { get; set; } = string.Empty; diff --git a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs index 0979f0a8a..5ae7c6f3e 100644 --- a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs @@ -43,12 +43,36 @@ namespace IRaCIS.Core.Application.Service.Inspection join moduleTyped in _repository.GetQueryable().Where(x => x.Code == "ModuleType") on 1 equals 1 - join moduleTypec in _repository.GetQueryable() on new { ParentId = moduleTyped.Id, ModuleType=data.ModuleType } equals new { ParentId=moduleTypec.ParentId.Value, ModuleType= moduleTypec.Value } into moduleTypectemp + join moduleTypec in _repository.GetQueryable() on new { ParentId = moduleTyped.Id, ModuleType = data.ModuleType } equals new { ParentId = moduleTypec.ParentId.Value, ModuleType = moduleTypec.Value } into moduleTypectemp from leftmoduleTypec in moduleTypectemp.DefaultIfEmpty() + join childrenTyped in _repository.GetQueryable().Where(x => x.Code == "ChildrenType") on 1 equals 1 + join childrenTypec in _repository.GetQueryable() on new { ParentId = childrenTyped.Id, ModuleType = data.ChildrenType } equals new { ParentId = childrenTypec.ParentId.Value, ModuleType = childrenTypec.Value } into childrenTypectemp + from leftchildrenTypec in childrenTypectemp.DefaultIfEmpty() + join ObjectTyped in _repository.GetQueryable().Where(x => x.Code == "ObjectType") on 1 equals 1 + join ObjectTypec in _repository.GetQueryable() on new { ParentId = ObjectTyped.Id, ModuleType = data.ObjectType } equals new { ParentId = ObjectTypec.ParentId.Value, ModuleType = ObjectTypec.Value } into objectTypetemp + from leftObjectType in objectTypetemp.DefaultIfEmpty() + join OptTyped in _repository.GetQueryable().Where(x => x.Code == "OptType") on 1 equals 1 + join OptTypec in _repository.GetQueryable() on new { ParentId = OptTyped.Id, ModuleType = data.OptType } equals new { ParentId = OptTypec.ParentId.Value, ModuleType = OptTypec.Value } into optTypetemp + from leftOptType in optTypetemp.DefaultIfEmpty() + join frontAuditConfig in _repository.GetQueryable().Where(x=>x.ObjectTypeId!=null) on new + { + ModuleTypeId = leftmoduleTypec.Id.ToString(), + ChildrenTypeId = leftchildrenTypec.Id.ToString(), + ObjectTypeId = leftObjectType.Id.ToString(), + OptTypeId = leftOptType.Id.ToString(), + } equals new + { + frontAuditConfig.ModuleTypeId, + frontAuditConfig.ChildrenTypeId, + frontAuditConfig.ObjectTypeId, + frontAuditConfig.OptTypeId, + + } into frontAuditConfigtemp + from leftfrontAuditConfig in frontAuditConfigtemp.DefaultIfEmpty() select new GetDataInspectionOutDto() { CreateTime = data.CreateTime, @@ -86,6 +110,7 @@ namespace IRaCIS.Core.Application.Service.Inspection SiteCode=data.SiteCode, ResearchProgramNo=data.ResearchProgramNo, ObjectType=data.ObjectType, + Description=leftfrontAuditConfig.Description, }; query = query.WhereIf(!dto.BlindName.IsNullOrEmpty(), x => x.BlindName == dto.BlindName)