package com.klp.controller; import java.util.List; import java.util.Arrays; import lombok.RequiredArgsConstructor; import javax.servlet.http.HttpServletResponse; import javax.validation.constraints.*; import org.springframework.web.bind.annotation.*; import org.springframework.validation.annotation.Validated; import com.klp.common.annotation.RepeatSubmit; import com.klp.common.annotation.Log; import com.klp.common.core.controller.BaseController; import com.klp.common.core.domain.PageQuery; import com.klp.common.core.domain.R; import com.klp.common.core.validate.AddGroup; import com.klp.common.core.validate.EditGroup; import com.klp.common.enums.BusinessType; import com.klp.common.utils.poi.ExcelUtil; import com.klp.domain.vo.WmsMaterialWarningVo; import com.klp.domain.bo.WmsMaterialWarningBo; import com.klp.service.IWmsMaterialWarningService; import com.klp.common.core.page.TableDataInfo; /** * 钢卷通用维度告警(长度/厚度/宽度) * * @author klp * @date 2026-06-06 */ @Validated @RequiredArgsConstructor @RestController @RequestMapping("/wms/materialWarning") public class WmsMaterialWarningController extends BaseController { private final IWmsMaterialWarningService iWmsMaterialWarningService; /** * 查询钢卷通用维度告警(长度/厚度/宽度)列表 */ @GetMapping("/list") public TableDataInfo list(WmsMaterialWarningBo bo, PageQuery pageQuery) { return iWmsMaterialWarningService.queryPageList(bo, pageQuery); } /** * 导出钢卷通用维度告警(长度/厚度/宽度)列表 */ @Log(title = "钢卷通用维度告警(长度/厚度/宽度)", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(WmsMaterialWarningBo bo, HttpServletResponse response) { List list = iWmsMaterialWarningService.queryList(bo); ExcelUtil.exportExcel(list, "钢卷通用维度告警(长度/厚度/宽度)", WmsMaterialWarningVo.class, response); } /** * 获取钢卷通用维度告警(长度/厚度/宽度)详细信息 * * @param warningId 主键 */ @GetMapping("/{warningId}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable Long warningId) { return R.ok(iWmsMaterialWarningService.queryById(warningId)); } /** * 新增钢卷通用维度告警(长度/厚度/宽度) */ @Log(title = "钢卷通用维度告警(长度/厚度/宽度)", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() public R add(@Validated(AddGroup.class) @RequestBody WmsMaterialWarningBo bo) { return toAjax(iWmsMaterialWarningService.insertByBo(bo)); } /** * 修改钢卷通用维度告警(长度/厚度/宽度) */ @Log(title = "钢卷通用维度告警(长度/厚度/宽度)", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() public R edit(@Validated(EditGroup.class) @RequestBody WmsMaterialWarningBo bo) { return toAjax(iWmsMaterialWarningService.updateByBo(bo)); } /** * 删除钢卷通用维度告警(长度/厚度/宽度) * * @param warningIds 主键串 */ @Log(title = "钢卷通用维度告警(长度/厚度/宽度)", businessType = BusinessType.DELETE) @DeleteMapping("/{warningIds}") public R remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] warningIds) { return toAjax(iWmsMaterialWarningService.deleteWithValidByIds(Arrays.asList(warningIds), true)); } }