diff --git a/src/main/java/com/cm/population/service/dispute/impl/DisputeServiceImpl.java b/src/main/java/com/cm/population/service/dispute/impl/DisputeServiceImpl.java index 18aa689..d510402 100644 --- a/src/main/java/com/cm/population/service/dispute/impl/DisputeServiceImpl.java +++ b/src/main/java/com/cm/population/service/dispute/impl/DisputeServiceImpl.java @@ -147,25 +147,54 @@ public class DisputeServiceImpl extends AbstractService implements IDisputeServi @Override public List list(Map params) { List list = disputeDao.list(params); + // 修改于2023年11月14日09:50:18 + // 以后不能在循环中进行SQL查询 + List castType = dataDictionaryService.listDictionaryByParentId("698e0684-b245-403b-9df9-c10eee1b465b"); // 事件类型 + List caseScale = dataDictionaryService.listDictionaryByParentId("075f2815-4e7d-478c-837d-a826810e7383"); // 事件规模 + List caseEstimate = dataDictionaryService.listDictionaryByParentId("e1b8a4cf-90be-4597-a45d-cd520f6b37ee"); // 案件评估 for(DisputeDTO dto : list) { - buiderData(dto); + buiderData(castType, caseScale, caseEstimate, dto); } return list; } - private void buiderData(DisputeDTO dto) { + private void buiderData(List castType, List caseScale, List caseEstimate, DisputeDTO dto) { if (!StringUtils.isEmpty(dto.getCaseType())) { - DataDictionaryDTO data = dataDictionaryService.getDictionaryById(dto.getCaseType()); - if(data != null) dto.setCaseTypeName(data.getDictionaryName()); + for(DataDictionaryDTO data : castType) { + if (data.getDictionaryId().equals(dto.getCaseType())) { + dto.setCaseTypeName(data.getDictionaryName()); + break; + } + } } if (!StringUtils.isEmpty(dto.getCaseScale())) { - DataDictionaryDTO data = dataDictionaryService.getDictionaryById(dto.getCaseScale()); - if(data != null) dto.setCaseScaleName(data.getDictionaryName()); + for(DataDictionaryDTO data : caseScale) { + if (data.getDictionaryId().equals(dto.getCaseScale())) { + dto.setCaseScaleName(data.getDictionaryName()); + break; + } + } } if (!StringUtils.isEmpty(dto.getCaseEstimate())) { - DataDictionaryDTO data = dataDictionaryService.getDictionaryById(dto.getCaseEstimate()); - if(data != null) dto.setCaseEstimateName(data.getDictionaryName()); + for(DataDictionaryDTO data : caseEstimate) { + if (data.getDictionaryId().equals(dto.getCaseEstimate())) { + dto.setCaseEstimateName(data.getDictionaryName()); + break; + } + } } +// if (!StringUtils.isEmpty(dto.getCaseType())) { +// DataDictionaryDTO data = dataDictionaryService.getDictionaryById(dto.getCaseType()); +// if(data != null) dto.setCaseTypeName(data.getDictionaryName()); +// } +// if (!StringUtils.isEmpty(dto.getCaseScale())) { +// DataDictionaryDTO data = dataDictionaryService.getDictionaryById(dto.getCaseScale()); +// if(data != null) dto.setCaseScaleName(data.getDictionaryName()); +// } +// if (!StringUtils.isEmpty(dto.getCaseEstimate())) { +// DataDictionaryDTO data = dataDictionaryService.getDictionaryById(dto.getCaseEstimate()); +// if(data != null) dto.setCaseEstimateName(data.getDictionaryName()); +// } } @Override