From 0140a30ff56f8bb7f6428604e041be609ae8593d Mon Sep 17 00:00:00 2001 From: chengyufei <1932574737@qq.com> Date: Thu, 13 Jul 2023 17:12:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BB=BB=E5=8A=A1=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B3.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TaskTypeController.java | 17 +++++++------ .../modules/taskType/entity/dto/TypeDto.java | 24 +++++++++++++++++++ 2 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/entity/dto/TypeDto.java diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/controller/TaskTypeController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/controller/TaskTypeController.java index 5048c1f..6e0c99c 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/controller/TaskTypeController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/controller/TaskTypeController.java @@ -1,7 +1,6 @@ package org.jeecg.modules.taskType.controller; -import cn.hutool.core.map.MapWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -10,7 +9,6 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import javafx.util.Pair; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; import org.apache.shiro.SecurityUtils; import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; @@ -20,6 +18,7 @@ import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.util.oConvertUtils; import org.jeecg.modules.taskType.entity.TaskType; +import org.jeecg.modules.taskType.entity.dto.TypeDto; import org.jeecg.modules.taskType.service.ITaskTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -51,7 +50,8 @@ public class TaskTypeController extends JeecgController getMapType(){ - Map, List>> map = new HashMap<>(); + Map> listMap = new HashMap<>(); + List hasChild = taskTypeService.query().eq("has_child", "1").list(); if (hasChild == null || hasChild.size() == 0) return Result.error("查询任务类型失败"); @@ -60,18 +60,17 @@ public class TaskTypeController extends JeecgController pair = new Pair<>(id, typeName); + TypeDto typeDto = new TypeDto(id, typeName); //准备map的value List list = taskTypeService.query().eq("pid", id).list(); - List> pairList = new ArrayList<>(); + List typeDtoList = new ArrayList<>(list.size()); for (TaskType type : list) - pairList.add(new Pair<>(type.getId(), type.getTypeName())); - + typeDtoList.add(new TypeDto(type.getId(), type.getTypeName())); //放入数据到map - map.put(pair, pairList); + listMap.put(typeDto, typeDtoList); } - return Result.OK(map); + return Result.OK(listMap); } @ApiOperation(value = "文章栏目-分页列表查询", notes = "文章栏目-分页列表查询") diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/entity/dto/TypeDto.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/entity/dto/TypeDto.java new file mode 100644 index 0000000..d6bc076 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/entity/dto/TypeDto.java @@ -0,0 +1,24 @@ +package org.jeecg.modules.taskType.entity.dto; + +import lombok.Data; + +/** + * @Author shkstart + * @create 2023-05-13-17:05 + */ +@Data +public class TypeDto { + + public TypeDto(){ + + } + + public TypeDto(String id, String type_Name) { + this.id = id; + this.type_Name = type_Name; + } + + private String id; + + private String type_Name; +}