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.WmsReportDetailBo; import com.klp.domain.vo.WmsReportDetailVo; import com.klp.service.IWmsReportDetailService; 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 ruoyi * @date 2025-05-13 */ @Validated @RequiredArgsConstructor @RestController @RequestMapping("/wms/reportDetail") public class WmsReportDetailController extends BaseController { private final IWmsReportDetailService IWmsReportDetailService; /** * 查询设计项目汇报详情列表 */ @GetMapping("/list") public TableDataInfo list(WmsReportDetailBo bo, PageQuery pageQuery) { return IWmsReportDetailService.queryPageList(bo, pageQuery); } /** * 导出设计项目汇报详情列表 */ @Log(title = "设计项目汇报详情", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(WmsReportDetailBo bo, HttpServletResponse response) { List list = IWmsReportDetailService.queryList(bo); ExcelUtil.exportExcel(list, "设计项目汇报详情", WmsReportDetailVo.class, response); } /** * 获取设计项目汇报详情详细信息 * * @param id 主键 */ @GetMapping("/{id}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) { return R.ok(IWmsReportDetailService.queryById(id)); } // /** // * 获取设计项目汇报详情详细信息 // * // * @param projectId 主键 // */ // @GetMapping("/project/{projectId}") // public R> listReportDetailByProjectId(@NotNull(message = "主键不能为空") // @PathVariable Long projectId) { // return R.ok(IWmsReportDetailService.queryByProjectId(projectId)); // } /** * 新增设计项目汇报详情 */ @Log(title = "设计项目汇报详情", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() public R add(@Validated(AddGroup.class) @RequestBody WmsReportDetailBo bo) { return toAjax(IWmsReportDetailService.insertByBo(bo)); } /** * 修改设计项目汇报详情 */ @Log(title = "设计项目汇报详情", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() public R edit(@Validated(EditGroup.class) @RequestBody WmsReportDetailBo bo) { return toAjax(IWmsReportDetailService.updateByBo(bo)); } /** * 删除设计项目汇报详情 * * @param ids 主键串 */ @DeleteMapping("/{ids}") public R remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] ids) { return toAjax(IWmsReportDetailService.deleteWithValidByIds(Arrays.asList(ids), true)); } }