修改稽查配置
This commit is contained in:
@@ -893,11 +893,20 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <param name="frontAuditConfigId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<List<FrontAuditConfig>> GetAuditConfigChildList(Guid frontAuditConfigId)
|
||||
public async Task<List<FrontAuditConfigDTO>> GetAuditConfigChildList(Guid frontAuditConfigId)
|
||||
{
|
||||
var list = await (from data in _repository.GetQueryable<FrontAuditConfig>().Where(x => x.Id == frontAuditConfigId)
|
||||
join childrenType in _repository.GetQueryable<FrontAuditConfig>() on data.Id equals childrenType.ParentId
|
||||
select childrenType).OrderBy(x => x.Sort).ToListAsync();
|
||||
//var list = await (from data in _repository.GetQueryable<FrontAuditConfig>().Where(x => x.Id == frontAuditConfigId)
|
||||
// join childrenType in _repository.GetQueryable<FrontAuditConfig>() on data.Id equals childrenType.ParentId
|
||||
// select childrenType).OrderBy(x => x.Sort).ToListAsync();
|
||||
//return list;
|
||||
|
||||
var list = await _frontAuditConfigRepository.Where(t => t.ParentId == frontAuditConfigId).OrderBy(x => x.Sort).ProjectTo<FrontAuditConfigDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
item.TableConfigList = JsonConvert.DeserializeObject<List<TableConfig>>(item.TableConfigJsonStr) ?? new List<TableConfig>();
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -1020,8 +1029,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
[HttpGet]
|
||||
public async Task<List<string>> GetModuleTypeDescriptionList(Guid moduleTypeId)
|
||||
{
|
||||
var result = await _frontAuditConfigRepository.Where(x => x.ModuleTypeId == moduleTypeId && x.ObjectTypeId != null && x.OptTypeId != null && x.Description.Length>0).Select(x => new { x.Description,x.Sort } ).OrderBy(t=>t.Sort).ToListAsync();
|
||||
return result.Select(t=>t.Description).Distinct().ToList();
|
||||
var result = await _frontAuditConfigRepository.Where(x => x.ModuleTypeId == moduleTypeId && x.ObjectTypeId != null && x.OptTypeId != null && x.Description.Length > 0).Select(x => new { x.Description, x.Sort }).OrderBy(t => t.Sort).ToListAsync();
|
||||
return result.Select(t => t.Description).Distinct().ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1147,6 +1156,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
addOrEditFrontAuditConfig.Description = "";
|
||||
}
|
||||
|
||||
addOrEditFrontAuditConfig.TableConfigJsonStr = JsonConvert.SerializeObject(addOrEditFrontAuditConfig.TableConfigList);
|
||||
|
||||
var entity = await _frontAuditConfigRepository.InsertOrUpdateAsync(addOrEditFrontAuditConfig, true);
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
@@ -19,7 +19,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
CreateMap<DataInspectionAddDTO, DataInspection>();
|
||||
|
||||
|
||||
CreateMap<FrontAuditConfig, FrontAuditConfigDTO>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user