feat(wms): 添加发货计划明细批量新增功能

- 在 IWmsDeliveryPlanDetailService 中添加 insertBatchByBo 方法
- 在 WmsDeliveryPlanDetailController 中添加 /batch 接口
- 在 WmsDeliveryPlanDetailServiceImpl 中实现批量插入逻辑
- 使用 BeanUtil.copyToList 进行对象转换
- 对每个实体执行前置验证操作
- 通过 baseMapper.insertBatch 完成批量数据库操作
This commit is contained in:
2026-01-29 09:35:25 +08:00
parent 786f1ef7f4
commit 19fd82dd8b
3 changed files with 25 additions and 0 deletions

View File

@@ -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));
}
/**
* 修改发货计划明细
*/

View File

@@ -37,6 +37,11 @@ public interface IWmsDeliveryPlanDetailService {
*/
Boolean insertByBo(WmsDeliveryPlanDetailBo bo);
/**
* 批量新增发货计划明细
*/
Boolean insertBatchByBo(List<WmsDeliveryPlanDetailBo> boList);
/**
* 修改发货计划明细
*/

View File

@@ -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);
}
/**
* 修改发货计划明细
*/