liuxiaolong
2019-05-06 f99bc8c6a1d10610373738edd7d0aa0181c81d99
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
146
147
148
149
package com.cloud.user.controller;
 
import com.cloud.model.sys.GloDict;
import com.cloud.user.service.GolDictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
import java.util.Map;
 
/**
 *全局字典控制层
 */
@Slf4j
@Api(value = "GolDictController", description = "学校组织机构全局字典控制层")
@RequestMapping("data/api-u")
@RestController
public class GolDictController {
 
    @Autowired
    private GolDictService golDictService;
 
    /**
     * 获取组织机构下的教师合同种类
     * @param params
     * @return
     */
    @ApiOperation(value = "获取组织机构下的教师合同种类",response = Map.class, responseContainer = "Map", notes = "获取组织机构下的教师合同种类", httpMethod = "GET", produces = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "orgId", value = "学校orgId", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "type", value = "字典类型", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "id", value = "字典id", required = false, dataType = "String", paramType = "query")
    })
    @RequestMapping("/glo/getTeacherPact")
    public List<Map<String,Object>> getTeacherPact(@RequestParam Map<String,Object> params){
 
        return golDictService.getTeacherPact(params);
    }
 
    /**
     * 获取组织机构下的人员类型
     * @param params
     * @return
     */
    @ApiOperation(value = "获取组织机构下的人员类型", notes = "获取组织机构下的人员类型", httpMethod = "GET", produces = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "orgId", value = "学校id或登录人orgId", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "type", value = "字典类型", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "id", value = "字典id", required = false, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "module", value = "模块类型", required = false, dataType = "String", paramType = "query")
    })
    @RequestMapping("/glo/getPeoType")
    public Map<String,Object> getPeoType(@RequestParam Map<String,Object> params){
 
        return golDictService.getPeoType(params);
    }
 
    /**
     * 获取全局学校组织类型字典
     * @param
     * @return
     */
    @ApiOperation(value = "获取全局学校组织类型字典", notes = "获取全局学校组织类型字典", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @RequestMapping("/glo/getOrgType")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "字典id", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "type", value = "字典类型", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "module", value = "模块类型", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "value", value = "值", required = true, dataType = "String", paramType = "query")
    })
    public Map<String,Object> getOrgType(@RequestParam Map<String,Object> params){
 
        return golDictService.getOrgType(params);
    }
 
 
    /**
     * 查询全局字典集合
     * @param params
     * @return
     */
    @ApiOperation(value = "查询全局字典集合", notes = "查询全局字典集合", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "orgId", value = "组织orgId", required = false, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "id", value = "字典id", required = false, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "type", value = "字典类型(行为规则:ACTION)", required = true, dataType = "String", paramType = "query"),
    })
    @RequestMapping("/glo/getGloDicts")
    public Map<String,Object> getGloDicts(@RequestParam Map<String,Object> params){
 
        return golDictService.getGloDicts(params);
    }
 
    /**
     * 全局字典集合添加
     * @param params
     * @return
     */
    @ApiOperation(value = "全局字典集合添加", notes = "全局字典集合添加", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "orgId", value = "学校orgId", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "id", value = "字典id", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "type", value = "字典类型", required = true, dataType = "String", paramType = "query")
    })
    @PostMapping("/glo/GloDicts/save")
    public Map<String,Object> saveGloDict(@RequestBody Map<String,Object> params){
 
        return golDictService.saveGloDicts(params);
    }
 
    /**
     * 全局字典修改
     * @param params
     * @return
     */
    @ApiOperation(value = "全局字典修改", notes = "全局字典修改", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "orgId", value = "学校orgId", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "id", value = "字典id", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "type", value = "字典类型", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "module", value = "字典所属模块", required = true, dataType = "String", paramType = "query")
    })
    @PostMapping("/glo/GloDicts/update")
    public Map<String,Object> updateGloDict(@RequestBody Map<String,Object> params){
 
        return golDictService.updateGloDicts(params);
    }
 
    /**
     * 全局字典删除
     * @param id
     * @return
     */
    @ApiOperation(value = "全局字典删除", notes = "全局字典删除", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "字典id", required = true, dataType = "String", paramType = "query"),
    })
    @GetMapping("/glo/GloDicts/delete")
    public Map<String,Object> deleteGloDict(@RequestParam("id") Integer id){
 
        return golDictService.deleteGloDicts(id);
    }
}