From 192577d01a98cd19b048386115e5c7af48844fe6 Mon Sep 17 00:00:00 2001 From: wangxy <1481820854@qq.com> Date: Wed, 25 Sep 2024 14:13:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=9F=A5=E8=AF=A2=E5=AD=90=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manager/CheckReportManager.java | 34 +++++++++++-------- .../system/check/CheckReportController.java | 15 +++++++- .../system/domain/check/dto/CheckTypeDTO.java | 5 --- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/CheckReportManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/CheckReportManager.java index 0fdacbf..4977a23 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/CheckReportManager.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/CheckReportManager.java @@ -77,27 +77,33 @@ public class CheckReportManager { return checkTypeService.saveBatch(list); } - public List getCheckTypeDTO(String type) { + public List getCheckTypeDTO(String checkType,String typeName) { + List checkTypeItemDTOList =new ArrayList<>(); + SysDictData dictData = new SysDictData(); + dictData.setDictType(checkType); + List dataList = dictDataService.selectDictDataList(dictData); + dataList.forEach(sysDictData2 -> checkTypeItemDTOList.add(CheckTypeItemDTO.builder() + .typeName(typeName) + .checkType(checkType) + .checkItems(sysDictData2.getDictLabel()) + .itemsType(sysDictData2.getDictCode()) + .typeContent(sysDictData2.getDictValue()) + .score(sysDictData2.getCssClass()) + .deductionCriteria(sysDictData2.getRemark()) + .build())); + + return checkTypeItemDTOList; + } + + public List getCheckTypeDTOParent(String type) { List checkTypeDtoS = new ArrayList<>(); SysDictData sysDictData =new SysDictData(); sysDictData.setDictType(type); List list = dictDataService.selectDictDataList(sysDictData); list.forEach(sysDictData1 -> { - List checkTypeItemDTOList =new ArrayList<>(); checkTypeDtoS.add(CheckTypeDTO.builder() .typeName(sysDictData1.getDictLabel()) - .checkType(sysDictData1.getDictValue()).checkTypeItemDTOList(checkTypeItemDTOList).build()); - SysDictData dictData = new SysDictData(); - dictData.setDictType(sysDictData1.getDictValue()); - List dataList = dictDataService.selectDictDataList(dictData); - dataList.forEach(sysDictData2 -> checkTypeItemDTOList.add(CheckTypeItemDTO.builder().typeName(sysDictData1.getDictLabel()) - .checkType(sysDictData1.getDictValue()) - .checkItems(sysDictData2.getDictLabel()) - .itemsType(sysDictData2.getDictCode()) - .typeContent(sysDictData2.getDictValue()) - .score(sysDictData2.getCssClass()) - .deductionCriteria(sysDictData2.getRemark()) - .build())); + .checkType(sysDictData1.getDictValue()).build()); }); return checkTypeDtoS; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/check/CheckReportController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/check/CheckReportController.java index 06206cf..259e6ea 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/check/CheckReportController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/check/CheckReportController.java @@ -146,7 +146,20 @@ public class CheckReportController extends BaseController { @GetMapping("/checkView/{type}") @ResponseBody public AjaxResult checkView(@PathVariable("type") String type) { - return AjaxResult.success(checkReportManager.getCheckTypeDTO(type)); + return AjaxResult.success(checkReportManager.getCheckTypeDTOParent(type)); + } + + /** + * 查询子项 + * @param checkType 自查类 + * @param typeName 自查类名称 + * @return + */ + @GetMapping("/checkView/{checkType}/{typeName}") + @ResponseBody + public AjaxResult checkView(@PathVariable("checkType") String checkType, + @PathVariable("typeName") String typeName) { + return AjaxResult.success(checkReportManager.getCheckTypeDTO(checkType,typeName)); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/CheckTypeDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/CheckTypeDTO.java index 845c814..6d292b5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/CheckTypeDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/CheckTypeDTO.java @@ -28,11 +28,6 @@ public class CheckTypeDTO implements Serializable { private String typeName; - /** - * 检查类型 - */ - private List checkTypeItemDTOList; - @TableField(exist = false) private static final long serialVersionUID = 1L;