From 73aa06584385f1119d08be95f2d0dafdd2f4fe95 Mon Sep 17 00:00:00 2001 From: "maxw@mesnac.com" Date: Mon, 13 Jan 2025 11:20:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B0=83=E6=8B=A8=E5=8D=95?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=B7=BB=E5=8A=A0=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WmsAllocateOrderDetailController.java | 2 +- .../IWmsAllocateOrderDetailService.java | 2 +- .../WmsAllocateOrderDetailServiceImpl.java | 20 ++++++++++--------- 3 files changed, 13 insertions(+), 11 deletions(-) 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; }