feat(wms): 添加发货计划明细批量新增功能
- 在 IWmsDeliveryPlanDetailService 中添加 insertBatchByBo 方法 - 在 WmsDeliveryPlanDetailController 中添加 /batch 接口 - 在 WmsDeliveryPlanDetailServiceImpl 中实现批量插入逻辑 - 使用 BeanUtil.copyToList 进行对象转换 - 对每个实体执行前置验证操作 - 通过 baseMapper.insertBatch 完成批量数据库操作
This commit is contained in:
@@ -75,6 +75,16 @@ public class WmsDeliveryPlanDetailController extends BaseController {
|
||||
return toAjax(iWmsDeliveryPlanDetailService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增发货计划明细
|
||||
*/
|
||||
@Log(title = "发货计划明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/batch")
|
||||
public R<Void> batchAdd(@Validated(AddGroup.class) @RequestBody List<WmsDeliveryPlanDetailBo> boList) {
|
||||
return toAjax(iWmsDeliveryPlanDetailService.insertBatchByBo(boList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发货计划明细
|
||||
*/
|
||||
|
||||
@@ -37,6 +37,11 @@ public interface IWmsDeliveryPlanDetailService {
|
||||
*/
|
||||
Boolean insertByBo(WmsDeliveryPlanDetailBo bo);
|
||||
|
||||
/**
|
||||
* 批量新增发货计划明细
|
||||
*/
|
||||
Boolean insertBatchByBo(List<WmsDeliveryPlanDetailBo> boList);
|
||||
|
||||
/**
|
||||
* 修改发货计划明细
|
||||
*/
|
||||
|
||||
@@ -84,6 +84,16 @@ public class WmsDeliveryPlanDetailServiceImpl implements IWmsDeliveryPlanDetailS
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增发货计划明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertBatchByBo(List<WmsDeliveryPlanDetailBo> boList) {
|
||||
List<WmsDeliveryPlanDetail> list = BeanUtil.copyToList(boList, WmsDeliveryPlanDetail.class);
|
||||
list.forEach(this::validEntityBeforeSave);
|
||||
return baseMapper.insertBatch(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发货计划明细
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user