车间能级提升-智能设备管理系统
朱桂飞
2025-01-15 d5dff36d38fc7a211b34916796bbc37f17e7a2d0
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
package org.dromara.eims.controller;
 
import java.util.List;
 
import org.dromara.eims.domain.bo.EimsEquBo;
import org.dromara.eims.domain.vo.EimsEquVo;
import org.dromara.eims.service.IEimsEquService;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
 
 
import org.dromara.common.mybatis.core.page.TableDataInfo;
 
/**
 * 【设备台账】
 *
 * @author zhuguifei
 * @date 2025-01-04
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/eims/equ")
public class EimsEquController extends BaseController {
 
    private final IEimsEquService eimsEquipmentService;
 
    /**
     * 查询【设备台账】列表
     */
    @SaCheckPermission("eims:equ:list")
    @GetMapping("/list")
    public TableDataInfo<EimsEquVo> list(EimsEquBo bo, PageQuery pageQuery) {
        return eimsEquipmentService.queryPageList(bo, pageQuery);
    }
 
    /**
     * 导出【设备台账】列表
     */
    @SaCheckPermission("eims:equ:export")
    @Log(title = "【设备台账】", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(EimsEquBo bo, HttpServletResponse response) {
        List<EimsEquVo> list = eimsEquipmentService.queryList(bo);
        ExcelUtil.exportExcel(list, "【设备台账】", EimsEquVo.class, response);
    }
 
    /**
     * 获取【设备台账】详细信息
     *
     * @param equId 主键
     */
    @SaCheckPermission("eims:equ:query")
    @GetMapping("/{equId}")
    public R<EimsEquVo> getInfo(@NotNull(message = "主键不能为空")
                                     @PathVariable Long equId) {
        return R.ok(eimsEquipmentService.queryById(equId));
    }
 
    /**
     * 新增【设备台账】
     */
    @SaCheckPermission("eims:equ:add")
    @Log(title = "【设备台账】", businessType = BusinessType.INSERT)
    @RepeatSubmit()
    @PostMapping()
    public R<Void> add(@Validated(AddGroup.class) @RequestBody EimsEquBo bo) {
        return toAjax(eimsEquipmentService.insertByBo(bo));
    }
 
    /**
     * 修改【设备台账】
     */
    @SaCheckPermission("eims:equ:edit")
    @Log(title = "【设备台账】", businessType = BusinessType.UPDATE)
    @RepeatSubmit()
    @PutMapping()
    public R<Void> edit(@Validated(EditGroup.class) @RequestBody EimsEquBo bo) {
        return toAjax(eimsEquipmentService.updateByBo(bo));
    }
 
    /**
     * 删除【设备台账】
     *
     * @param equIds 主键串
     */
    @SaCheckPermission("eims:equ:remove")
    @Log(title = "【设备台账】", businessType = BusinessType.DELETE)
    @DeleteMapping("/{equIds}")
    public R<Void> remove(@NotEmpty(message = "主键不能为空")
                          @PathVariable Long[] equIds) {
        return toAjax(eimsEquipmentService.deleteWithValidByIds(List.of(equIds), true));
    }
}