“mitao”
2026-01-20 4e5beb844f03daec12f2b039365730b0683f8a9e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.estate.expert.admin.controller.app;
 
import com.estate.expert.admin.domain.business.device.DeviceType;
import com.estate.expert.admin.domain.common.mapper.EntityRefMapper;
import com.estate.expert.admin.service.CheckTaskService;
import com.estate.expert.common.rpc.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
 
@Slf4j
@Api(tags = "个人/任务")
@RequestMapping("/personal/task")
@RestController
@Validated
public class TaskHierarchyController {
 
    @Resource
    private CheckTaskService checkTaskService;
 
    @Resource
    private EntityRefMapper entityRefMapper;
 
    @ApiOperation(value = "获取综合体系")
    @GetMapping("/system/hierarchy")
    public Result getSystemTree(@RequestParam("taskId") Integer taskId) {
        return Result.success(checkTaskService.getSystemTree(taskId));
    }
 
    @ApiOperation(value = "获取设备体系")
    @GetMapping("/device/hierarchy")
    public Result getDeviceTree(@RequestParam("taskId") Integer taskId,
                                @RequestParam("deviceType") DeviceType deviceType) {
        return Result.success(checkTaskService.getDeviceTree(taskId, deviceType));
    }
 
    @ApiOperation(value = "综合问题")
    @GetMapping("/system/problems")
    public Result systemProblems(@RequestParam("taskId") Integer taskId,
                                 @RequestParam("hierarchyPath") String hierarchyPath) {
        return Result.success(entityRefMapper.toReference(checkTaskService.getSystemProblems(taskId, hierarchyPath)));
    }
 
    @ApiOperation(value = "设备问题")
    @GetMapping("/device/problems")
    public Result deviceProblems(@RequestParam("taskId") Integer taskId,
                                 @RequestParam("hierarchyPath") String hierarchyPath) {
        return Result.success(entityRefMapper.toReference(checkTaskService.getDeviceProblems(taskId, hierarchyPath)));
    }
}