/* * 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 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 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 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)); } }