|
|
|
@ -5,6 +5,8 @@ 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 com.fasterxml.jackson.core.JsonProcessingException; |
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import javafx.util.Pair; |
|
|
|
@ -42,6 +44,9 @@ public class TaskTypeController extends JeecgController<TaskType, ITaskTypeServi |
|
|
|
|
@Autowired |
|
|
|
|
private ITaskTypeService taskTypeService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private ObjectMapper objectMapper; |
|
|
|
|
|
|
|
|
|
private static final String ADMIN_COLUMN_KEY = "99"; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -50,7 +55,7 @@ public class TaskTypeController extends JeecgController<TaskType, ITaskTypeServi |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/getTypeMap") |
|
|
|
|
public Result<?> getMapType(){ |
|
|
|
|
Map<TypeDto, List<TypeDto>> listMap = new HashMap<>(); |
|
|
|
|
Map<String, List<TypeDto>> listMap = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
List<TaskType> hasChild = taskTypeService.query().eq("has_child", "1").list(); |
|
|
|
|
if (hasChild == null || hasChild.size() == 0) |
|
|
|
@ -68,7 +73,15 @@ public class TaskTypeController extends JeecgController<TaskType, ITaskTypeServi |
|
|
|
|
for (TaskType type : list) |
|
|
|
|
typeDtoList.add(new TypeDto(type.getId(), type.getTypeName())); |
|
|
|
|
//放入数据到map
|
|
|
|
|
listMap.put(typeDto, typeDtoList); |
|
|
|
|
|
|
|
|
|
String key = null; |
|
|
|
|
try { |
|
|
|
|
key = objectMapper.writeValueAsString(typeDto); |
|
|
|
|
} catch (JsonProcessingException e) { |
|
|
|
|
throw new RuntimeException(e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
listMap.put(key, typeDtoList); |
|
|
|
|
} |
|
|
|
|
return Result.OK(listMap); |
|
|
|
|
} |
|
|
|
|