Merge remote-tracking branch 'origin/dev_2307' into dev_2307

dev
shiji 1 year ago
commit 1d7dd2b2b5
  1. 34
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/controller/TaskTypeController.java

@ -1,12 +1,14 @@
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;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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;
@ -25,8 +27,7 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
import java.util.*;
/**
* @Description: 任务类型管理
@ -44,6 +45,35 @@ public class TaskTypeController extends JeecgController<TaskType, ITaskTypeServi
private static final String ADMIN_COLUMN_KEY = "99";
/**
* 查询所有项目类型并根据pid分类
* @return
*/
@GetMapping("/getTypeMap")
public Result<?> getMapType(){
Map<Pair<String, String>, List<Pair<String, String>>> map = new HashMap<>();
List<TaskType> hasChild = taskTypeService.query().eq("has_child", "1").list();
if (hasChild == null || hasChild.size() == 0)
return Result.error("查询任务类型失败");
for (TaskType taskType : hasChild) {
//准备map的key
String typeName = taskType.getTypeName();
String id = taskType.getId();
Pair<String, String> pair = new Pair<>(typeName, id);
//准备map的value
List<TaskType> list = taskTypeService.query().eq("id", id).list();
List<Pair<String, String>> pairList = new ArrayList<>();
for (TaskType type : list)
pairList.add(new Pair<>(type.getTypeName(), type.getId()));
//放入数据到map
map.put(pair, pairList);
}
return Result.OK(map);
}
@ApiOperation(value = "文章栏目-分页列表查询", notes = "文章栏目-分页列表查询")
@GetMapping(value = "/rootList")
public Result<?> rootList(TaskType taskType,

Loading…
Cancel
Save