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 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()); } }