Uat_Study
			
			
		
		
							parent
							
								
									bed17af3b2
								
							
						
					
					
						commit
						c984a9116b
					
				| 
						 | 
				
			
			@ -97,6 +97,7 @@ namespace IRaCIS.Application.Contracts
 | 
			
		|||
    }
 | 
			
		||||
    public class GetCriterionDictionaryListOutDto
 | 
			
		||||
    {
 | 
			
		||||
        public Guid Id { get; set; }
 | 
			
		||||
        public string Code { get; set; } = string.Empty;
 | 
			
		||||
 | 
			
		||||
        public string Description { get; set; } = string.Empty;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -238,16 +238,21 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
        /// <returns></returns>
 | 
			
		||||
        public async Task<List<GetCriterionDictionaryListOutDto>> GetCriterionDictionaryList(GetCriterionDictionaryListInDto inDto)
 | 
			
		||||
        {
 | 
			
		||||
            var codes = await _systemCriterionDictionaryCodeRepository.Where(x => x.SystemCriterionId == inDto.SystemCriterionId).Select(x => x.Code).ToListAsync();
 | 
			
		||||
           var criterionCodes=  await _systemCriterionDictionaryCodeRepository.Where(x => x.SystemCriterionId == inDto.SystemCriterionId).ToListAsync();
 | 
			
		||||
            var codes = criterionCodes.Select(x=>x.Code).ToList();
 | 
			
		||||
            
 | 
			
		||||
            var dictionaryList = await _dicRepository.Where(x => codes.Contains(x.Code))
 | 
			
		||||
                .OrderBy(x => x.ShowOrder).Select(x => new GetCriterionDictionaryListOutDto()
 | 
			
		||||
                {
 | 
			
		||||
                    Code = x.Code,
 | 
			
		||||
                    Description = x.Description
 | 
			
		||||
 | 
			
		||||
                }).ToListAsync();
 | 
			
		||||
 | 
			
		||||
            dictionaryList.ForEach(x => {
 | 
			
		||||
 | 
			
		||||
                x.Id = criterionCodes.Where(y => y.Code == x.Code).Select(x => x.Id).FirstOrDefault();
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            return dictionaryList;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue