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.WmsReceivePlanVo; import com.klp.domain.bo.WmsReceivePlanBo; import com.klp.service.IWmsReceivePlanService; import com.klp.common.core.page.TableDataInfo; /** * 应收货物计划 * * @author klp * @date 2026-05-10 */ @Validated @RequiredArgsConstructor @RestController @RequestMapping("/wms/receivePlan") public class WmsReceivePlanController extends BaseController { private final IWmsReceivePlanService iWmsReceivePlanService; /** * 查询应收货物计划列表 */ @GetMapping("/list") public TableDataInfo list(WmsReceivePlanBo bo, PageQuery pageQuery) { return iWmsReceivePlanService.queryPageList(bo, pageQuery); } /** * 导出应收货物计划列表 */ @Log(title = "应收货物计划", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(WmsReceivePlanBo bo, HttpServletResponse response) { List list = iWmsReceivePlanService.queryList(bo); ExcelUtil.exportExcel(list, "应收货物计划", WmsReceivePlanVo.class, response); } /** * 获取应收货物计划详细信息 * * @param receiveId 主键 */ @GetMapping("/{receiveId}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable Long receiveId) { return R.ok(iWmsReceivePlanService.queryById(receiveId)); } /** * 新增应收货物计划 */ @Log(title = "应收货物计划", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() public R add(@Validated(AddGroup.class) @RequestBody WmsReceivePlanBo bo) { return R.ok(iWmsReceivePlanService.insertByBo(bo)); } /** * 修改应收货物计划 */ @Log(title = "应收货物计划", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() public R edit(@Validated(EditGroup.class) @RequestBody WmsReceivePlanBo bo) { return toAjax(iWmsReceivePlanService.updateByBo(bo)); } /** * 删除应收货物计划 * * @param receiveIds 主键串 */ @Log(title = "应收货物计划", businessType = BusinessType.DELETE) @DeleteMapping("/{receiveIds}") public R remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] receiveIds) { return toAjax(iWmsReceivePlanService.deleteWithValidByIds(Arrays.asList(receiveIds), true)); } }