yangys
2024-04-02 6bed83e92f67954cd2135071133329f2205efe4f
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
package com.qianwen.smartman.modules.andon.controller;
 
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.validation.Valid;
import com.qianwen.smartman.common.cache.RegionCache;
import com.qianwen.core.boot.ctrl.BladeController;
import com.qianwen.core.scanner.modular.annotation.DeleteResource;
import com.qianwen.core.scanner.modular.annotation.GetResource;
import com.qianwen.core.scanner.modular.annotation.PostResource;
import com.qianwen.core.scanner.modular.annotation.PutResource;
import com.qianwen.core.scanner.modular.stereotype.ApiResource;
import com.qianwen.core.secure.annotation.PreAuth;
import com.qianwen.core.tool.api.R;
import com.qianwen.core.tool.utils.Func;
import com.qianwen.smartman.modules.andon.service.IAndonTypeService;
import com.qianwen.smartman.modules.andon.vo.AndonTypeDetailVO;
import com.qianwen.smartman.modules.andon.vo.AndonTypeSaveVO;
import com.qianwen.smartman.modules.andon.vo.AndonTypeUpdateVO;
import com.qianwen.smartman.modules.andon.vo.AndonTypeVO;
import com.qianwen.smartman.modules.andon.vo.BindingDeviceTypeVO;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
@Api(value = "安灯类型", tags = {"安灯类型"})
@ApiResource({"blade-andon/andon-type"})
@RestController
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/andon/controller/AndonTypeController.class */
public class AndonTypeController extends BladeController {
    private final IAndonTypeService typeService;
 
    public AndonTypeController(final IAndonTypeService typeService) {
        this.typeService = typeService;
    }
 
    @ApiOperationSupport(order = 1)
    @PostResource({""})
    @ApiOperation("新增安灯类型")
    @PreAuth
    public R<AndonTypeVO> saveAndonType(@Valid @RequestBody AndonTypeSaveVO vo) {
        return R.data(this.typeService.saveAndonType(vo));
    }
 
    @ApiOperationSupport(order = 2)
    @PutResource({""})
    @ApiOperation("修改安灯类型")
    @PreAuth
    public R<Boolean> updateAndonType(@RequestBody AndonTypeUpdateVO vo) {
        return R.data(this.typeService.updateAndonType(vo));
    }
 
    @ApiOperationSupport(order = 3)
    @ApiOperation("删除安灯类型")
    @PreAuth
    @DeleteResource({""})
    public R<Boolean> removeAndonType(@RequestParam("typeId") String typeId) {
        return R.data(this.typeService.removeAndonType(Long.valueOf(Func.toLong(typeId))));
    }
 
    @ApiOperationSupport(order = 4)
    @GetResource({""})
    @ApiOperation("安灯类型列表")
    public R<List<AndonTypeVO>> andonTypeList(@RequestParam("keyword") String keyword) {
        return R.data(this.typeService.andonTypeList(keyword));
    }
 
    @ApiOperationSupport(order = RegionCache.VILLAGE_LEVEL)
    @GetResource({"/detail"})
    @ApiOperation("安灯类型详情")
    public R<AndonTypeDetailVO> detail(@RequestParam("typeId") String typeId) {
        return R.data(this.typeService.detail(Long.valueOf(Func.toLong(typeId))));
    }
 
    @ApiOperationSupport(order = 6)
    @GetResource({"/all-device-types"})
    @ApiOperation("查看当前类型绑定的机器类型")
    public R<List<BindingDeviceTypeVO>> allDeviceTypes(@RequestParam("typeId") String typeId) {
        return R.data(this.typeService.allDeviceTypes(typeId));
    }
 
    @ApiOperationSupport(order = 7)
    @GetResource({"/work-banding"})
    @ApiOperation("查看当前工位绑定的机器类型")
    public R<List<AndonTypeVO>> workBanding(@RequestParam("workstationId") String workstationId) {
        return R.data(this.typeService.workBanding(Long.valueOf(Func.toLong(workstationId))));
    }
}