From b56b2ca525b4b87a3ac207f38fa78e90bcdf7678 Mon Sep 17 00:00:00 2001 From: hanyong <1334742946@qq.com> Date: Mon, 10 Oct 2022 10:23:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=91=8A=E6=A8=A1=E6=9D=BF=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{DictDTO.java => EventReportDictDTO.java} | 4 ++-- .../vo/{DictVO.java => EventReportDictVO.java} | 4 ++-- .../system/controller/EventDictController.java | 6 +++--- .../com/njcn/system/mapper/EventDictMapper.java | 4 ++-- .../system/mapper/mapping/EventDictMapper.xml | 2 +- .../njcn/system/service/IEventDictService.java | 4 ++-- .../service/impl/EventDictServiceImpl.java | 16 ++++++++-------- 7 files changed, 20 insertions(+), 20 deletions(-) rename pqs-system/system-api/src/main/java/com/njcn/system/pojo/dto/{DictDTO.java => EventReportDictDTO.java} (85%) rename pqs-system/system-api/src/main/java/com/njcn/system/pojo/vo/{DictVO.java => EventReportDictVO.java} (85%) diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/dto/DictDTO.java b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/dto/EventReportDictDTO.java similarity index 85% rename from pqs-system/system-api/src/main/java/com/njcn/system/pojo/dto/DictDTO.java rename to pqs-system/system-api/src/main/java/com/njcn/system/pojo/dto/EventReportDictDTO.java index 29923b453..ad7797fe4 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/dto/DictDTO.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/dto/EventReportDictDTO.java @@ -7,7 +7,7 @@ import java.io.Serializable; import java.util.List; @Data -public class DictDTO implements Serializable { +public class EventReportDictDTO implements Serializable { @ApiModelProperty("组件Id") private String id; @@ -28,5 +28,5 @@ public class DictDTO implements Serializable { private Integer sort; @ApiModelProperty("子级") - List children; + List children; } diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/vo/DictVO.java b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/vo/EventReportDictVO.java similarity index 85% rename from pqs-system/system-api/src/main/java/com/njcn/system/pojo/vo/DictVO.java rename to pqs-system/system-api/src/main/java/com/njcn/system/pojo/vo/EventReportDictVO.java index 50ff08aee..ec05fc94d 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/vo/DictVO.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/vo/EventReportDictVO.java @@ -7,7 +7,7 @@ import java.io.Serializable; import java.util.List; @Data -public class DictVO implements Serializable { +public class EventReportDictVO implements Serializable { @ApiModelProperty("Id") private String id; @@ -28,6 +28,6 @@ public class DictVO implements Serializable { private Integer sort; @ApiModelProperty("子级") - List children; + List children; } diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EventDictController.java b/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EventDictController.java index 1a5e0101e..2bcf92061 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EventDictController.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/controller/EventDictController.java @@ -10,7 +10,7 @@ import com.njcn.common.utils.HttpResultUtil; import com.njcn.common.utils.LogUtil; import com.njcn.system.pojo.param.EventDictParam; import com.njcn.system.pojo.po.ReportDict; -import com.njcn.system.pojo.vo.DictVO; +import com.njcn.system.pojo.vo.EventReportDictVO; import com.njcn.system.service.IEventDictService; import com.njcn.web.controller.BaseController; import io.swagger.annotations.Api; @@ -133,9 +133,9 @@ public class EventDictController extends BaseController { @OperateInfo @GetMapping("/DictTree") @ApiOperation("字典树") - public HttpResult> getDictTree(){ + public HttpResult> getDictTree(){ String methodDescribe = getMethodDescribe("getDictTree"); - List list = iEventDictService.getDictTree(); + List list = iEventDictService.getDictTree(); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,list,methodDescribe); } } diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/EventDictMapper.java b/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/EventDictMapper.java index 43a816106..317969ded 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/EventDictMapper.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/EventDictMapper.java @@ -1,12 +1,12 @@ package com.njcn.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.njcn.system.pojo.dto.DictDTO; +import com.njcn.system.pojo.dto.EventReportDictDTO; import com.njcn.system.pojo.po.ReportDict; import java.util.List; public interface EventDictMapper extends BaseMapper { - List getAllDict(); + List getAllDict(); } diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/mapping/EventDictMapper.xml b/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/mapping/EventDictMapper.xml index b0c3aba9f..a90acfa11 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/mapping/EventDictMapper.xml +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/mapping/EventDictMapper.xml @@ -2,7 +2,7 @@ - SELECT * from report_dict WHERE State = 1 diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEventDictService.java b/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEventDictService.java index d824d75ac..7d133905f 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEventDictService.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/service/IEventDictService.java @@ -3,7 +3,7 @@ package com.njcn.system.service; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.njcn.system.pojo.param.EventDictParam; import com.njcn.system.pojo.po.ReportDict; -import com.njcn.system.pojo.vo.DictVO; +import com.njcn.system.pojo.vo.EventReportDictVO; import java.util.List; @@ -51,5 +51,5 @@ public interface IEventDictService { * 获取字典树 * @return */ - List getDictTree(); + List getDictTree(); } diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EventDictServiceImpl.java b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EventDictServiceImpl.java index 603c7f5a4..6a6a7f4ef 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EventDictServiceImpl.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/service/impl/EventDictServiceImpl.java @@ -14,10 +14,10 @@ import com.njcn.db.constant.DbConstant; import com.njcn.system.enums.EventResponseEnum; import com.njcn.system.enums.TemplateTreeEnum; import com.njcn.system.mapper.EventDictMapper; -import com.njcn.system.pojo.dto.DictDTO; +import com.njcn.system.pojo.dto.EventReportDictDTO; import com.njcn.system.pojo.param.EventDictParam; import com.njcn.system.pojo.po.ReportDict; -import com.njcn.system.pojo.vo.DictVO; +import com.njcn.system.pojo.vo.EventReportDictVO; import com.njcn.system.service.IEventDictService; import com.njcn.web.factory.PageFactory; import lombok.AllArgsConstructor; @@ -25,7 +25,6 @@ import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; @@ -74,6 +73,7 @@ public class EventDictServiceImpl extends ServiceImpl getDictTree() { - List list = new ArrayList<>(); - List dictList = eventDictMapper.getAllDict(); + public List getDictTree() { + List list = new ArrayList<>(); + List dictList = eventDictMapper.getAllDict(); dictList.forEach(item -> { - DictVO dictVO = new DictVO(); + EventReportDictVO dictVO = new EventReportDictVO(); BeanUtil.copyProperties(item, dictVO); list.add(dictVO); }); @@ -156,7 +156,7 @@ public class EventDictServiceImpl extends ServiceImpl getChildList(DictVO dictMenu, List categories) { + private List getChildList(EventReportDictVO dictMenu, List categories) { return categories.stream().filter(o -> Objects.equals(o.getPid(), dictMenu.getId())) .peek(o -> o.setChildren(getChildList(o, categories))) .collect(Collectors.toList());