feat(aps/plan): 新增批量新增排产单明细接口
1. 在ApsPlanDetailController中新增batchAdd接口,支持批量新增排产单明细 2. 在ApsPlanDetailServiceImpl中实现insertBatchByBo方法,批量插入前进行实体校验 3. 在IApsPlanDetailService中声明批量新增接口方法
This commit is contained in:
@@ -76,6 +76,16 @@ public class ApsPlanDetailController extends BaseController {
|
|||||||
return toAjax(iApsPlanDetailService.insertByBo(bo));
|
return toAjax(iApsPlanDetailService.insertByBo(bo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增排产单明细
|
||||||
|
*/
|
||||||
|
@Log(title = "排产单明细", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public R<Void> batchAdd(@Validated(AddGroup.class) @RequestBody List<ApsPlanDetailBo> boList) {
|
||||||
|
return toAjax(iApsPlanDetailService.insertBatchByBo(boList));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改排产单明细
|
* 修改排产单明细
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -43,6 +43,11 @@ public interface IApsPlanDetailService {
|
|||||||
*/
|
*/
|
||||||
Boolean insertByBo(ApsPlanDetailBo bo);
|
Boolean insertByBo(ApsPlanDetailBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增排产单明细
|
||||||
|
*/
|
||||||
|
Boolean insertBatchByBo(List<ApsPlanDetailBo> boList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改排产单明细
|
* 修改排产单明细
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -185,6 +185,16 @@ public class ApsPlanDetailServiceImpl implements IApsPlanDetailService {
|
|||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增排产单明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertBatchByBo(List<ApsPlanDetailBo> boList) {
|
||||||
|
List<ApsPlanDetail> list = BeanUtil.copyToList(boList, ApsPlanDetail.class);
|
||||||
|
list.forEach(this::validEntityBeforeSave);
|
||||||
|
return baseMapper.insertBatch(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改排产单明细
|
* 修改排产单明细
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user