diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsAllocateOrderDetailController.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsAllocateOrderDetailController.java index 72a0f2f6..b836a5ef 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsAllocateOrderDetailController.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsAllocateOrderDetailController.java @@ -76,7 +76,7 @@ public class WmsAllocateOrderDetailController extends BaseController { @Log(title = "调拨子", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() - public R add(@Validated(AddGroup.class) @RequestBody WmsAllocateOrderDetailBo bo) { + public R add( @RequestBody List bo) { return toAjax(wmsAllocateOrderDetailService.insertByBo(bo)); } diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsAllocateOrderDetailService.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsAllocateOrderDetailService.java index f99f4b71..5317ae63 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsAllocateOrderDetailService.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsAllocateOrderDetailService.java @@ -47,7 +47,7 @@ public interface IWmsAllocateOrderDetailService { * @param bo 调拨子 * @return 是否新增成功 */ - Boolean insertByBo(WmsAllocateOrderDetailBo bo); + Boolean insertByBo(List bo); /** * 修改调拨子 diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsAllocateOrderDetailServiceImpl.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsAllocateOrderDetailServiceImpl.java index aef3bb38..0e3a5635 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsAllocateOrderDetailServiceImpl.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsAllocateOrderDetailServiceImpl.java @@ -15,9 +15,7 @@ import org.dromara.wms.mapper.WmsAllocateOrderDetailMapper; import org.dromara.wms.service.IWmsAllocateOrderDetailService; import org.springframework.stereotype.Service; -import java.util.List; -import java.util.Map; -import java.util.Collection; +import java.util.*; /** * 调拨子Service业务层处理 @@ -88,13 +86,17 @@ public class WmsAllocateOrderDetailServiceImpl implements IWmsAllocateOrderDetai * @return 是否新增成功 */ @Override - public Boolean insertByBo(WmsAllocateOrderDetailBo bo) { - WmsAllocateOrderDetail add = MapstructUtils.convert(bo, WmsAllocateOrderDetail.class); - validEntityBeforeSave(add); - boolean flag = baseMapper.insert(add) > 0; - if (flag) { - bo.setAoDId(add.getAoDId()); + public Boolean insertByBo(List bo) { + ArrayList list = new ArrayList<>(); + for (WmsAllocateOrderDetailBo detailBo : bo) { + WmsAllocateOrderDetail add = MapstructUtils.convert(detailBo, WmsAllocateOrderDetail.class); + list.add(add); } + + boolean flag = baseMapper.insertBatch(list); +// if (flag) { +// bo.setAoDId(add.getAoDId()); +// } return flag; }