wlzboy
2025-11-11 310633feef20e9b77d44fd25e0b41778e033b33b
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
package com.ruoyi.web.controller.sqlserver;
 
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.system.domain.OrderClassDTO;
import com.ruoyi.system.service.IOrderClassDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
/**
 * SQL Server 字典数据查询 Controller
 * 
 * 专门用于从 SQL Server 数据库查询字典数据
 * 
 * @author ruoyi
 * @date 2025-10-19
 */
@RestController
@RequestMapping("/sqlserver/dictionary")
@DataSource(DataSourceType.SQLSERVER)
public class SqlServerDictionaryController extends BaseController
{
    @Autowired
    private IOrderClassDataService orderClassDataService;
 
    /**
     * 查询单据类型列表(ServiceOrdAreaType)
     * 
     * 数据源:SQL Server (dictionary表)
     * SQL: SELECT vID, vtext FROM dictionary WHERE vtitle='ServiceOrdAreaType' AND vType=1 ORDER BY vOrder
     * 
     * @return 单据类型列表
     */
    @GetMapping("/serviceOrdAreaTypes")
    public AjaxResult getServiceOrdAreaTypes()
    {
        try
        {
            List<OrderClassDTO> list = orderClassDataService.getServiceOrdAreaTypes();
            return AjaxResult.success("查询成功", list);
        }
        catch (Exception e)
        {
            logger.error("查询单据类型数据失败", e);
            return AjaxResult.error("查询单据类型数据失败:" + e.getMessage());
        }
    }
 
    /**
     * 查询服务单编码列表
     * 
     * 数据源:SQL Server (dictionary表)
     * 
     * @return 服务单编码列表
     */
    @GetMapping("/serviceOrderClass")
    public AjaxResult getServiceOrderClass()
    {
        try
        {
            List<OrderClassDTO> list = orderClassDataService.getServiceOrderClass();
            return AjaxResult.success("查询成功", list);
        }
        catch (Exception e)
        {
            logger.error("查询服务单编码数据失败", e);
            return AjaxResult.error("查询服务单编码数据失败:" + e.getMessage());
        }
    }
 
    /**
     * 查询调度单编码列表
     * 
     * 数据源:SQL Server (dictionary表)
     * 
     * @return 调度单编码列表
     */
    @GetMapping("/dispatchOrderClass")
    public AjaxResult getDispatchOrderClass()
    {
        try
        {
            List<OrderClassDTO> list = orderClassDataService.getDispatchOrderClass();
            return AjaxResult.success("查询成功", list);
        }
        catch (Exception e)
        {
            logger.error("查询调度单编码数据失败", e);
            return AjaxResult.error("查询调度单编码数据失败:" + e.getMessage());
        }
    }
 
    /**
     * 查询服务订单类型列表(ServiceOrderType)
     * 
     * 数据源:SQL Server (dictionary表)
     * SQL: SELECT vID, vtext FROM dictionary WHERE vtitle='ServiceOrderType' AND vType>=1 ORDER BY vOrder
     * 
     * @return 服务订单类型列表
     */
    @GetMapping("/serviceOrderTypes")
    public AjaxResult getServiceOrderTypes()
    {
        try
        {
            List<OrderClassDTO> list = orderClassDataService.getServiceOrderTypes();
            return AjaxResult.success("查询成功", list);
        }
        catch (Exception e)
        {
            logger.error("查询服务订单类型数据失败", e);
            return AjaxResult.error("查询服务订单类型数据失败:" + e.getMessage());
        }
    }
 
    /**
     * 查询医院科室列表(HospitalDepartment)
     * 
     * 数据源:SQL Server (dictionary表)
     * SQL: SELECT vID, vtext FROM dictionary WHERE vtitle='HospitalDepartment' AND vType=1 ORDER BY vOrder
     * 
     * @return 医院科室列表
     */
    @GetMapping("/hospitalDepartments")
    public AjaxResult getHospitalDepartments()
    {
        try
        {
            List<OrderClassDTO> list = orderClassDataService.getHospitalDepartments();
            return AjaxResult.success("查询成功", list);
        }
        catch (Exception e)
        {
            logger.error("查询医院科室数据失败", e);
            return AjaxResult.error("查询医院科室数据失败:" + e.getMessage());
        }
    }
}