package com.klp.aps.controller; import java.util.List; import java.util.Arrays; import com.klp.aps.domain.dto.ApsPlanSheetQueryReq; import com.klp.aps.domain.dto.ApsQuickSheetQueryReq; 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.aps.domain.vo.ApsPlanSheetVo; import com.klp.aps.domain.bo.ApsPlanSheetBo; import com.klp.aps.service.IApsPlanSheetService; import com.klp.common.core.page.TableDataInfo; /** * 排产单主 * * @author klp * @date 2026-03-26 */ @Validated @RequiredArgsConstructor @RestController @RequestMapping("/aps/planSheet") public class ApsPlanSheetController extends BaseController { private final IApsPlanSheetService iApsPlanSheetService; /** * 查询排产单主列表 */ @GetMapping("/list") public TableDataInfo list(ApsPlanSheetBo bo, PageQuery pageQuery) { return iApsPlanSheetService.queryPageList(bo, pageQuery); } /** * 导出排产单主列表 */ @Log(title = "排产单主", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(ApsPlanSheetBo bo, HttpServletResponse response) { List list = iApsPlanSheetService.queryList(bo); ExcelUtil.exportExcel(list, "排产单主", ApsPlanSheetVo.class, response); } @GetMapping("/exportAll") public void export(@Validated ApsPlanSheetQueryReq req, javax.servlet.http.HttpServletResponse response) { iApsPlanSheetService.exportExcel(req, response); } /** * 获取排产单主详细信息 * * @param planSheetId 主键 */ @GetMapping("/{planSheetId}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable Long planSheetId) { return R.ok(iApsPlanSheetService.queryById(planSheetId)); } /** * 新增排产单主 */ @Log(title = "排产单主", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() public R add(@Validated(AddGroup.class) @RequestBody ApsPlanSheetBo bo) { return toAjax(iApsPlanSheetService.insertByBo(bo)); } /** * 修改排产单主 */ @Log(title = "排产单主", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() public R edit(@Validated(EditGroup.class) @RequestBody ApsPlanSheetBo bo) { return toAjax(iApsPlanSheetService.updateByBo(bo)); } /** * 删除排产单主 * * @param planSheetIds 主键串 */ @Log(title = "排产单主", businessType = BusinessType.DELETE) @DeleteMapping("/{planSheetIds}") public R remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] planSheetIds) { return toAjax(iApsPlanSheetService.deleteWithValidByIds(Arrays.asList(planSheetIds), true)); } }