package com.klp.flow.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.flow.domain.vo.SchSaleScheduleRelVo; import com.klp.flow.domain.bo.SchSaleScheduleRelBo; import com.klp.flow.service.ISchSaleScheduleRelService; import com.klp.common.core.page.TableDataInfo; /** * 销售订单-排产单多对多关联 * * @author klp * @date 2026-06-23 */ @Validated @RequiredArgsConstructor @RestController @RequestMapping("/flow/saleScheduleRel") public class SchSaleScheduleRelController extends BaseController { private final ISchSaleScheduleRelService iSchSaleScheduleRelService; /** * 查询销售订单-排产单多对多关联列表 */ @GetMapping("/list") public TableDataInfo list(SchSaleScheduleRelBo bo, PageQuery pageQuery) { return iSchSaleScheduleRelService.queryPageList(bo, pageQuery); } /** * 导出销售订单-排产单多对多关联列表 */ @Log(title = "销售订单-排产单多对多关联", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(SchSaleScheduleRelBo bo, HttpServletResponse response) { List list = iSchSaleScheduleRelService.queryList(bo); ExcelUtil.exportExcel(list, "销售订单-排产单多对多关联", SchSaleScheduleRelVo.class, response); } /** * 获取销售订单-排产单多对多关联详细信息 * * @param relId 主键 */ @GetMapping("/{relId}") public R getInfo(@NotNull(message = "主键不能为空") @PathVariable Long relId) { return R.ok(iSchSaleScheduleRelService.queryById(relId)); } /** * 新增销售订单-排产单多对多关联 */ @Log(title = "销售订单-排产单多对多关联", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() public R add(@Validated(AddGroup.class) @RequestBody SchSaleScheduleRelBo bo) { return toAjax(iSchSaleScheduleRelService.insertByBo(bo)); } /** * 修改销售订单-排产单多对多关联 */ @Log(title = "销售订单-排产单多对多关联", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() public R edit(@Validated(EditGroup.class) @RequestBody SchSaleScheduleRelBo bo) { return toAjax(iSchSaleScheduleRelService.updateByBo(bo)); } /** * 删除销售订单-排产单多对多关联 * * @param relIds 主键串 */ @Log(title = "销售订单-排产单多对多关联", businessType = BusinessType.DELETE) @DeleteMapping("/{relIds}") public R remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] relIds) { return toAjax(iSchSaleScheduleRelService.deleteWithValidByIds(Arrays.asList(relIds), true)); } }