1
13693261870
2022-09-16 762f2fb45db004618ba099aa3c0bd89dba1eb843
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
package com.landtool.lanbase.modules.org.controller;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
 
import java.util.List;
import java.util.Map;
 
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import com.landtool.lanbase.modules.org.entity.OrgUnitRegion;
import com.landtool.lanbase.modules.org.service.OrgUnitRegionService;
import com.landtool.lanbase.modules.sys.controller.AbstractController;
import com.landtool.lanbase.common.annotation.LogAction;
import com.landtool.lanbase.common.annotation.SysLog;
import com.landtool.lanbase.common.utils.PageUtils;
import com.landtool.lanbase.common.utils.Query;
import com.landtool.lanbase.common.utils.Result;
 
/**
 * @author lanbase
 * @Description: TODO(单位管辖范围,对应行政区划表,单位管辖范围变化时,修改单位时间戳信息)  作废
 * @date 2018-01-16 09:26:18
 */
@RestController
@RequestMapping("/org/unitregion")
@Api(value = "", tags = {"用户单位与行政区划对应关系"})
public class OrgUnitRegionController extends AbstractController{
 
    @Autowired
    private OrgUnitRegionService unitregionService;
    
    /**
     * 所有单位管辖范围列表
     */
    @RequestMapping(value ="/list", method ={RequestMethod.POST, RequestMethod.GET})
//    @RequiresPermissions("org:unit:list")
    @RequiresPermissions(value = {"org:unit:list","org:unit:edit"}, logical = Logical.OR)
    @ApiOperation(
            value = "单位管辖范围列表",
            notes = "所有单位管辖范围列表"
            )
//    @LogAction("查询")
    public Result list(@ApiParam(name="params",value="单位管辖范围集合",required=true)@RequestParam Map<String, Object> params){
        //查询列表数据
        Query query = new Query(params);
 
        List<OrgUnitRegion> unitxzqhList = unitregionService.queryList(query);
        int total = unitregionService.queryTotal(query);
        
        PageUtils pageUtil = new PageUtils(unitxzqhList, total, query.getLimit(), query.getPage());
        
        return Result.ok().put("page", pageUtil);
    }
    
    
    /**
     * 单位管辖范围信息
     */
    @GetMapping("/info/{qhid}")
//    @RequiresPermissions("org:unit:list")
    @RequiresPermissions(value = {"org:unit:list","org:unit:edit"}, logical = Logical.OR)
    @ApiOperation(
            value = "单位管辖范围信息信息",
            notes = ""
            )
    public Result info(@ApiParam(name="qhid",value="单位管辖范围Id",required=true)@PathVariable("qhid") String qhid){
        OrgUnitRegion unitxzqh = unitregionService.queryObject(qhid);
        
        return Result.ok().put("unitxzqh", unitxzqh);
    }
    
    /**
     * 保存
     */
//    @LogAction("保存")
    @SysLog("保存单位管辖范围")
    @PostMapping("/save")
    @RequiresPermissions("org:unit:edit")
    @ApiOperation(
            value = "保存单位管辖范围",
            notes = ""
            )
    public Result save(@ApiParam(name="单位管辖范围对象",value="传入json格式",required=true)@RequestBody OrgUnitRegion unitxzqh){
        unitregionService.save(unitxzqh);
        
        return Result.ok();
    }
    
    /**
     * 修改
     */
//    @LogAction("修改")
    @SysLog("修改单位管辖范围")
    @PostMapping("/update")
    @RequiresPermissions("org:unit:edit")
    @ApiOperation(
            value = "修改单位管辖范围",
            notes = ""
            )
    public Result update(@ApiParam(name="单位管辖范围对象",value="传入json格式",required=true)@RequestBody OrgUnitRegion unitxzqh){
        unitregionService.update(unitxzqh);
        
        return Result.ok();
    }
    
    /**
     * 删除
     */
//    @LogAction("删除")
    @SysLog("删除单位管辖范围")
    @PostMapping("/delete")
    @RequiresPermissions("org:unit:edit")
    @ApiOperation(
            value = "删除单位管辖范围",
            notes = ""
            )
    public Result delete(@ApiParam(name="qhids",value="单位管辖范围Id",required=true)@RequestBody String[] qhids){
        unitregionService.deleteBatch(qhids);
        
        return Result.ok();
    }
    
}