李林
2023-10-07 658d4927d468c47208fd012d9128b09249c07eff
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
package com.chinaztt.mes.quality.controller;
 
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chinaztt.mes.common.wrapper.QueryWrapperUtil;
import com.chinaztt.mes.quality.dto.ZxWeightLabelDTO;
import com.chinaztt.mes.quality.entity.ZxWeightLabel;
import com.chinaztt.mes.quality.service.ZxWeightLabelService;
import com.chinaztt.ztt.common.core.util.R;
import com.chinaztt.ztt.common.log.annotation.SysLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
 
import javax.script.ScriptException;
import java.util.List;
 
/**
 * @Description : 中兴称重标签
 * @ClassName : ZxWeightLabelController
 * @Author : sll
 * @Date: 2022-12-01  23:09
 */
@RestController
@AllArgsConstructor
@RequestMapping("/zxweightlabel")
@Api(value = "zxweightlabel", tags = "中兴称重标签")
public class ZxWeightLabelController{
    private ZxWeightLabelService zxWeightLabelService;
 
    @ApiOperation(value = "新增中兴称重标签", notes = "新增中兴称重标签")
    @SysLog("新增中兴称重标签")
    @PostMapping
    @PreAuthorize("@pms.hasPermission('quality_zx_weight_label_add')" )
    public R addWeightLabel(@RequestBody ZxWeightLabelDTO zxWeightLabelDTO) throws Exception{
        return R.ok(zxWeightLabelService.addWeightLabel(zxWeightLabelDTO));
    }
 
    @ApiOperation(value = "删除中兴称重标签", notes = "删除中兴称重标签")
    @SysLog("删除中兴称重标签")
    @DeleteMapping
    @PreAuthorize("@pms.hasPermission('quality_zx_weight_label_del')" )
    public R delWeightLabel(@RequestBody List<Long> ids){
        return R.ok(zxWeightLabelService.removeByIds(ids));
    }
 
    @ApiOperation(value = "分页查询", notes = "分页查询")
    @GetMapping("/page")
    public R qryWeightLabelPage(Page page, ZxWeightLabel zxWeightLabel){
        return R.ok(zxWeightLabelService.page(page, QueryWrapperUtil.gen(zxWeightLabel)));
    }
 
    @ApiOperation(value = "称重", notes = "称重")
    @GetMapping("/weighing")
    public R weighing() throws Exception{
        return R.ok(zxWeightLabelService.weighing());
    }
 
}