feat(aps): 添加排产单和排产明细功能模块
- 创建排产单主实体类 ApsPlanSheet 和业务对象 ApsPlanSheetBo - 创建排产单明细实体类 ApsPlanDetail 和业务对象 ApsPlanDetailBo - 实现排产单主和明细的控制器、服务层和数据访问层 - 添加排产单主和明细的查询、新增、修改、删除和导出功能 - 配置 MyBatis Plus 映射和 XML 结果映射 - 实现分页查询和条件筛选功能 - 添加数据校验和业务逻辑处理
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
package com.klp.aps.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.aps.domain.vo.ApsPlanDetailVo;
|
||||
import com.klp.aps.domain.bo.ApsPlanDetailBo;
|
||||
import com.klp.aps.service.IApsPlanDetailService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 排产单明细
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/aps/planDetail")
|
||||
public class ApsPlanDetailController extends BaseController {
|
||||
|
||||
private final IApsPlanDetailService iApsPlanDetailService;
|
||||
|
||||
/**
|
||||
* 查询排产单明细列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ApsPlanDetailVo> list(ApsPlanDetailBo bo, PageQuery pageQuery) {
|
||||
return iApsPlanDetailService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出排产单明细列表
|
||||
*/
|
||||
@Log(title = "排产单明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ApsPlanDetailBo bo, HttpServletResponse response) {
|
||||
List<ApsPlanDetailVo> list = iApsPlanDetailService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "排产单明细", ApsPlanDetailVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排产单明细详细信息
|
||||
*
|
||||
* @param planDetailId 主键
|
||||
*/
|
||||
@GetMapping("/{planDetailId}")
|
||||
public R<ApsPlanDetailVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long planDetailId) {
|
||||
return R.ok(iApsPlanDetailService.queryById(planDetailId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增排产单明细
|
||||
*/
|
||||
@Log(title = "排产单明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ApsPlanDetailBo bo) {
|
||||
return toAjax(iApsPlanDetailService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改排产单明细
|
||||
*/
|
||||
@Log(title = "排产单明细", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ApsPlanDetailBo bo) {
|
||||
return toAjax(iApsPlanDetailService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除排产单明细
|
||||
*
|
||||
* @param planDetailIds 主键串
|
||||
*/
|
||||
@Log(title = "排产单明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{planDetailIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] planDetailIds) {
|
||||
return toAjax(iApsPlanDetailService.deleteWithValidByIds(Arrays.asList(planDetailIds), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.klp.aps.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.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<ApsPlanSheetVo> 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<ApsPlanSheetVo> list = iApsPlanSheetService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "排产单主", ApsPlanSheetVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排产单主详细信息
|
||||
*
|
||||
* @param planSheetId 主键
|
||||
*/
|
||||
@GetMapping("/{planSheetId}")
|
||||
public R<ApsPlanSheetVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long planSheetId) {
|
||||
return R.ok(iApsPlanSheetService.queryById(planSheetId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增排产单主
|
||||
*/
|
||||
@Log(title = "排产单主", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ApsPlanSheetBo bo) {
|
||||
return toAjax(iApsPlanSheetService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改排产单主
|
||||
*/
|
||||
@Log(title = "排产单主", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ApsPlanSheetBo bo) {
|
||||
return toAjax(iApsPlanSheetService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除排产单主
|
||||
*
|
||||
* @param planSheetIds 主键串
|
||||
*/
|
||||
@Log(title = "排产单主", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{planSheetIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] planSheetIds) {
|
||||
return toAjax(iApsPlanSheetService.deleteWithValidByIds(Arrays.asList(planSheetIds), true));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user