101 lines
3.4 KiB
Java
101 lines
3.4 KiB
Java
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 cn.dev33.satoken.annotation.SaCheckPermission;
|
|
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.WmsSchedulePlanDetailVo;
|
|
import com.klp.domain.bo.WmsSchedulePlanDetailBo;
|
|
import com.klp.service.IWmsSchedulePlanDetailService;
|
|
import com.klp.common.core.page.TableDataInfo;
|
|
|
|
/**
|
|
* 排产计划明细
|
|
*
|
|
* @author JR
|
|
* @date 2025-07-18
|
|
*/
|
|
@Validated
|
|
@RequiredArgsConstructor
|
|
@RestController
|
|
@RequestMapping("/wms/schedulePlanDetail")
|
|
public class WmsSchedulePlanDetailController extends BaseController {
|
|
|
|
private final IWmsSchedulePlanDetailService iWmsSchedulePlanDetailService;
|
|
|
|
/**
|
|
* 查询排产计划明细列表
|
|
*/
|
|
@GetMapping("/list")
|
|
public TableDataInfo<WmsSchedulePlanDetailVo> list(WmsSchedulePlanDetailBo bo, PageQuery pageQuery) {
|
|
return iWmsSchedulePlanDetailService.queryPageList(bo, pageQuery);
|
|
}
|
|
|
|
/**
|
|
* 导出排产计划明细列表
|
|
*/
|
|
@Log(title = "排产计划明细", businessType = BusinessType.EXPORT)
|
|
@PostMapping("/export")
|
|
public void export(WmsSchedulePlanDetailBo bo, HttpServletResponse response) {
|
|
List<WmsSchedulePlanDetailVo> list = iWmsSchedulePlanDetailService.queryList(bo);
|
|
ExcelUtil.exportExcel(list, "排产计划明细", WmsSchedulePlanDetailVo.class, response);
|
|
}
|
|
|
|
/**
|
|
* 获取排产计划明细详细信息
|
|
*
|
|
* @param detailId 主键
|
|
*/
|
|
@GetMapping("/{detailId}")
|
|
public R<WmsSchedulePlanDetailVo> getInfo(@NotNull(message = "主键不能为空")
|
|
@PathVariable Long detailId) {
|
|
return R.ok(iWmsSchedulePlanDetailService.queryById(detailId));
|
|
}
|
|
|
|
/**
|
|
* 新增排产计划明细
|
|
*/
|
|
@Log(title = "排产计划明细", businessType = BusinessType.INSERT)
|
|
@RepeatSubmit()
|
|
@PostMapping()
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsSchedulePlanDetailBo bo) {
|
|
return toAjax(iWmsSchedulePlanDetailService.insertByBo(bo));
|
|
}
|
|
|
|
/**
|
|
* 修改排产计划明细
|
|
*/
|
|
@Log(title = "排产计划明细", businessType = BusinessType.UPDATE)
|
|
@RepeatSubmit()
|
|
@PutMapping()
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsSchedulePlanDetailBo bo) {
|
|
return toAjax(iWmsSchedulePlanDetailService.updateByBo(bo));
|
|
}
|
|
|
|
/**
|
|
* 删除排产计划明细
|
|
*
|
|
* @param detailIds 主键串
|
|
*/
|
|
@Log(title = "排产计划明细", businessType = BusinessType.DELETE)
|
|
@DeleteMapping("/{detailIds}")
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
@PathVariable Long[] detailIds) {
|
|
return toAjax(iWmsSchedulePlanDetailService.deleteWithValidByIds(Arrays.asList(detailIds), true));
|
|
}
|
|
}
|