feat(wms): 添加钢卷通用告警功能
- 创建 WmsMaterialWarning 实体类定义告警数据结构 - 实现 IWmsMaterialWarningService 接口提供告警业务方法 - 开发 WmsMaterialWarningController 控制器支持增删改查操作 - 设计 WmsMaterialWarningBo 和 WmsMaterialWarningVo 数据传输对象 - 配置 WmsMaterialWarningMapper 数据访问层和 XML 映射文件 - 实现 WmsMaterialWarningServiceImpl 业务逻辑处理类 - 添加告警类型、级别、状态等字段支持长度/厚度/宽度维度监控 - 集成 Excel 导出功能便于告警数据统计分析
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
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<WmsMaterialWarningVo> 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<WmsMaterialWarningVo> list = iWmsMaterialWarningService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "钢卷通用维度告警(长度/厚度/宽度)", WmsMaterialWarningVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取钢卷通用维度告警(长度/厚度/宽度)详细信息
|
||||
*
|
||||
* @param warningId 主键
|
||||
*/
|
||||
@GetMapping("/{warningId}")
|
||||
public R<WmsMaterialWarningVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long warningId) {
|
||||
return R.ok(iWmsMaterialWarningService.queryById(warningId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增钢卷通用维度告警(长度/厚度/宽度)
|
||||
*/
|
||||
@Log(title = "钢卷通用维度告警(长度/厚度/宽度)", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsMaterialWarningBo bo) {
|
||||
return toAjax(iWmsMaterialWarningService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改钢卷通用维度告警(长度/厚度/宽度)
|
||||
*/
|
||||
@Log(title = "钢卷通用维度告警(长度/厚度/宽度)", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsMaterialWarningBo bo) {
|
||||
return toAjax(iWmsMaterialWarningService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除钢卷通用维度告警(长度/厚度/宽度)
|
||||
*
|
||||
* @param warningIds 主键串
|
||||
*/
|
||||
@Log(title = "钢卷通用维度告警(长度/厚度/宽度)", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{warningIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] warningIds) {
|
||||
return toAjax(iWmsMaterialWarningService.deleteWithValidByIds(Arrays.asList(warningIds), true));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user