package com.klp.controller; import com.klp.common.annotation.Log; import com.klp.common.annotation.RepeatSubmit; 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.page.TableDataInfo; 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.bo.WmsReportSummaryBo; import com.klp.domain.vo.WmsReportSummaryVo; import com.klp.service.IWmsReportSummaryService; import lombok.RequiredArgsConstructor; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.Arrays; import java.util.List; /** * 设计项目汇报概述 * * @author cpy * @date 2025-05-13 */ @Validated @RequiredArgsConstructor @RestController @RequestMapping("/wms/reportSummary") public class WmsReportSummaryController extends BaseController { private final IWmsReportSummaryService IWmsReportSummaryService; /** * 查询设计项目汇报概述列表 */ @GetMapping("/list") public TableDataInfo list(WmsReportSummaryBo bo, PageQuery pageQuery) { return IWmsReportSummaryService.queryPageList(bo, pageQuery); } /** * 导出设计项目汇报概述列表 */ @Log(title = "设计项目汇报概述", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(WmsReportSummaryBo bo, HttpServletResponse response) { List list = IWmsReportSummaryService.queryList(bo); ExcelUtil.exportExcel(list, "设计项目汇报概述", WmsReportSummaryVo.class, response); } /** * 获取设计项目汇报概述详细信息 * * @param id 主键 */ @GetMapping("/{id}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) { return R.ok(IWmsReportSummaryService.queryById(id)); } /** * 新增设计项目汇报概述 */ @Log(title = "设计项目汇报概述", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() public R add(@Validated(AddGroup.class) @RequestBody WmsReportSummaryBo bo) { return toAjax(IWmsReportSummaryService.insertByBo(bo)); } /** * 修改设计项目汇报概述 */ @Log(title = "设计项目汇报概述", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() public R edit(@Validated(EditGroup.class) @RequestBody WmsReportSummaryBo bo) { return toAjax(IWmsReportSummaryService.updateByBo(bo)); } /** * 删除设计项目汇报概述 * * @param ids 主键串 */ @Log(title = "设计项目汇报概述", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public R remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] ids) { return toAjax(IWmsReportSummaryService.deleteWithValidByIds(Arrays.asList(ids), true)); } }