危化品全生命周期管理后端
heheng
2025-02-26 996c091a4913ac768324b7ea69a8494ba9d6ece0
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
package com.gkhy.hazmat.admin.controller.system;
 
import com.gkhy.hazmat.common.api.CommonResult;
import com.gkhy.hazmat.system.domain.SysConfig;
import com.gkhy.hazmat.system.domain.TaBooComparison;
import com.gkhy.hazmat.system.service.SysConfigService;
import com.gkhy.hazmat.system.service.TaBooComparisonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
@Api(tags = "系统配置前端控制器")
@RestController
@RequestMapping("/system/tabooComparison")
public class TabooComparisonController {
    @Autowired
    private TaBooComparisonService taBooComparisonService;
 
    @PreAuthorize("hasAnyAuthority('hazmat:manage:system')")
    @ApiOperation(value = "禁忌属性列表")
    @GetMapping("/list")
    public CommonResult list(TaBooComparison taBooComparison){
        return CommonResult.success(taBooComparisonService.selectTaBooComparisonList(taBooComparison));
    }
 
    @PreAuthorize("hasAnyAuthority('hazmat:manage:system')")
    @ApiOperation(value = "新增禁忌属性")
    @PostMapping
    public CommonResult add(@Validated @RequestBody TaBooComparison taBooComparison){
        return CommonResult.success(taBooComparisonService.insertTaBooComparison(taBooComparison));
    }
 
    @PreAuthorize("hasAnyAuthority('hazmat:manage:system')")
    @ApiOperation(value = "更新禁忌属性")
    @PutMapping
    public CommonResult edit(@Validated @RequestBody TaBooComparison taBooComparison){
        return CommonResult.success(taBooComparisonService.insertTaBooComparison(taBooComparison));
    }
 
    @PreAuthorize("hasAnyAuthority('hazmat:manage:system')")
    @ApiOperation(value = "删除禁忌属性")
    @DeleteMapping(value = "/{taBooComparisonId}")
    public CommonResult remove(@PathVariable Long taBooComparisonId){
        taBooComparisonService.deleteTaBooComparisonById(taBooComparisonId);
        return CommonResult.success();
    }
 
    @PreAuthorize("hasAnyAuthority('hazmat:manage:company','hazmat:manage:common')")
    @ApiOperation(value = "查询当前用户公司配置")
    @GetMapping(value = "/loadingTaBooCache")
    public CommonResult loadingTaBooCache(){
        taBooComparisonService.loadingTaBooCache();
        return CommonResult.success();
    }
}