李林
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
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
136
137
138
139
140
141
142
143
144
145
146
147
/*
 *    Copyright (c) 2018-2025, ztt All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: ztt
 */
 
package com.chinaztt.mes.quality.controller;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chinaztt.mes.common.wrapper.QueryWrapperUtil;
import com.chinaztt.mes.quality.dto.QualityLabelDTO;
import com.chinaztt.mes.quality.dto.QualityLabelInputDTO;
import com.chinaztt.mes.quality.dto.QualityPrintLabelDTO;
import com.chinaztt.mes.quality.entity.QualityLabel;
import com.chinaztt.mes.quality.entity.QualityLabelPrintLog;
import com.chinaztt.mes.quality.service.QualityLabelPrintLogService;
import com.chinaztt.mes.quality.service.QualityLabelService;
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.web.bind.annotation.*;
 
import java.math.BigDecimal;
import java.util.List;
 
 
/**
 * 标签信息
 *
 * @author yy
 * @date 2023-04-12 13:54:42
 */
@RestController
@AllArgsConstructor
@RequestMapping("/qualityLabel" )
@Api(value = "qualityLabel", tags = "标签信息")
public class QualityLabelController {
 
    private QualityLabelService qualityLabelService;
 
 
    /**
     * 通过id获取标签信息
     * @param id
     * @return R
     */
    @ApiOperation(value = "通过id获取标签信息", notes = "通过id获取标签信息")
    @SysLog("通过id获取标签信息" )
    @GetMapping("/{id}" )
    public R getById(@PathVariable Long id) {
        return R.ok(qualityLabelService.getById(id));
    }
 
 
    /**
     * 分页查询
     * @param page 分页对象
     * @param qualityLabel 标签信息
     * @return
     */
    @ApiOperation(value = "分页查询", notes = "分页查询")
    @GetMapping("/page" )
    public R getTaskPage(Page page, QualityLabel qualityLabel) {
        return R.ok(qualityLabelService.page(page, QueryWrapperUtil.gen(qualityLabel)));
    }
 
 
    /**
     * 标签样式
     * @param snList
     * @param labelUniqueCode
     * @param isPrint
     * @return
     */
    @ApiOperation(value = "标签打印", notes = "标签打印")
    @GetMapping("/printLabel")
    public R printLabel(@RequestParam("snList") List<String> snList,@RequestParam("labelUniqueCode")String labelUniqueCode,@RequestParam("isPrint")Boolean isPrint){
        return R.ok(qualityLabelService.printLabel(snList,labelUniqueCode,isPrint));
    }
 
 
 
    /**
     * 密码校验
     * @param idList
     * @param password
     * @return
     */
    @ApiOperation(value = "密码校验", notes = "密码校验")
    @GetMapping("/checkPassword")
    public R checkPassword(@RequestParam("idList") List<Long> idList,@RequestParam("password")String password){
        return R.ok(qualityLabelService.checkPassword(idList,password));
    }
 
 
    /**
     * 补印
     * @param idList
     * @return
     */
    @ApiOperation(value = "补印", notes = "补印")
    @GetMapping("/reprint")
    public R reprint(@RequestParam("idList") List<Long> idList){
        return R.ok(qualityLabelService.reprint(idList));
    }
 
 
 
 
 
    /**
     * 逻辑删除标签
     * @param qualityLabel
     * @return R
     */
    @ApiOperation(value = "逻辑删除标签", notes = "逻辑删除标签")
    @SysLog("逻辑删除标签" )
    @PutMapping
    public R updateLabel(@RequestBody QualityLabel qualityLabel) {
        return R.ok(qualityLabelService.logicDelete(qualityLabel));
    }
 
 
 
 
 
 
 
 
 
 
 
 
}