liujie
2026-01-21 b7fd316f22e51db06a105e824daabe7692e28d01
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
package com.estate.expert.admin.controller.admin.option;
 
import com.estate.expert.admin.domain.business.archive.ArchiveType;
import com.estate.expert.admin.domain.business.client.ClientType;
import com.estate.expert.admin.domain.business.contract.ContractState;
import com.estate.expert.admin.domain.business.device.DeviceType;
import com.estate.expert.admin.domain.business.sign.work.WorkTimePeriod;
import com.estate.expert.admin.domain.business.sign.work.WorkType;
import com.estate.expert.admin.domain.common.option.SelectOptionVo;
import com.estate.expert.admin.domain.exam.task.check.CheckTaskState;
import com.estate.expert.admin.domain.plan.PlanState;
import com.estate.expert.admin.domain.plan.PlanType;
import com.estate.expert.admin.domain.project.enums.ProjectType;
import com.estate.expert.admin.domain.project.info.ProjectDangerousType;
import com.estate.expert.admin.domain.project.info.ProjectSuperDangerousType;
import com.estate.expert.admin.domain.report.ReportTemplateType;
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.*;
 
@Api(tags = "管理后台/选项/类型选项")
@Slf4j
@CrossOrigin
@RequestMapping("/admin/type")
@RestController
@Validated
public class OptionTypeController {
 
    @ApiOperation(value = "档案文件类型")
    @GetMapping("/archiveTypes")
    public Result archiveTypeOptions(@RequestParam(value = "title", required = false) String title){
        return Result.success(SelectOptionVo.buildOptions(title, ArchiveType.values()));
    }
 
    @ApiOperation(value = "委托方类型")
    @GetMapping("/clientTypes")
    public Result clientTypeOptions(@RequestParam(value = "title", required = false) String title) {
        return Result.success(SelectOptionVo.buildOptions(title, ClientType.values()));
    }
 
    @ApiOperation(value = "合同状态")
    @GetMapping("/contractStates")
    public Result contractStateOptions(@RequestParam(value = "title", required = false) String title) {
        return Result.success(SelectOptionVo.buildOptions(title, ContractState.values()));
    }
 
    @ApiOperation(value = "设备类型")
    @GetMapping("/deviceTypes")
    public Result deviceTypeOptions(@RequestParam(value = "title", required = false) String title) {
        return Result.success(SelectOptionVo.buildOptions(title, DeviceType.values()));
    }
 
    @ApiOperation(value = "计划类型")
    @GetMapping("/planTypes")
    public Result planTypeOptions(@RequestParam(value = "title", required = false) String title) {
        return Result.success(SelectOptionVo.buildOptions(title, PlanType.values()));
    }
 
    @ApiOperation(value = "计划状态")
    @GetMapping("/planStates")
    public Result planStatusOptions(@RequestParam(value = "title", required = false) String title) {
        return Result.success(SelectOptionVo.buildOptions(title, PlanState.values()));
    }
 
    @ApiOperation(value = "检查任务状态")
    @GetMapping("/checkTaskStates")
    public Result checkTaskStateOptions(@RequestParam(value = "title", required = false) String title) {
        return Result.success(SelectOptionVo.buildOptions(title, CheckTaskState.values()));
    }
 
    @ApiOperation(value = "项目类型")
    @GetMapping("/projectTypes")
    public Result projectTypeOptions(@RequestParam(value = "title", required = false) String title) {
        return Result.success(SelectOptionVo.buildOptions(title, ProjectType.values()));
    }
 
    @ApiOperation(value = "项目用途类型")
    @GetMapping("/projectUsageTypes")
    public Result useTypeOptions(@RequestParam("projectType") ProjectType projectType,
                                 @RequestParam(value = "title", required = false) String title) {
        return Result.success(SelectOptionVo.buildOptions(title, projectType.getProjectUsageTypes()));
    }
 
    @ApiOperation(value = "危大工程类型")
    @GetMapping("/dangerousProjectTypes")
    public Result dangerousProjectOptions() {
        return Result.success(SelectOptionVo.buildOptions(null, ProjectDangerousType.values()));
    }
 
    @ApiOperation(value = "超危大工程类型")
    @GetMapping("/superDangerousProjectTypes")
    public Result superDangerousProjectOptions() {
        return Result.success(SelectOptionVo.buildOptions(null, ProjectSuperDangerousType.values()));
    }
 
    @ApiOperation(value = "工作类型")
    @GetMapping("/workTypes")
    public Result workTypeOptions(@RequestParam(value = "title", required = false) String title) {
        return Result.success(SelectOptionVo.buildOptions(title, WorkType.values()));
    }
 
    @ApiOperation(value = "工作时间段")
    @GetMapping("/workTimePeriods")
    public Result workTimePeriodOptions(@RequestParam(value = "title", required = false) String title) {
        return Result.success(SelectOptionVo.buildOptions(title, WorkTimePeriod.values()));
    }
 
    @ApiOperation(value = "报告模板类型")
    @GetMapping("/reportTemplateTypes")
    public Result reportTemplateTypeOptions(@RequestParam(value = "title", required = false) String title) {
        return Result.success(SelectOptionVo.buildOptions(title, ReportTemplateType.values()));
    }
 
}