From c821ec50514deb8d3a07203205ce593f8f75dbd4 Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Tue, 11 Mar 2025 18:21:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E9=87=8F=E8=A3=85=E5=A4=87=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/service/impl/DevInfoServiceImpl.java | 2 +- .../material/order/service/impl/OrderServiceImpl.java | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java index c41476b..cadaf0f 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java @@ -399,7 +399,7 @@ public class DevInfoServiceImpl implements DevInfoService { } devInfo.setCode(code); devInfo.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString()); - devInfo.setDeviceCount(1); + devInfo.setDeviceCount(devInfo.getDeviceCount()); devInfo.setIdentifyCode(devInfo.getTableList().get(i).getIdentifyCode()); if (devInfoMapper.insertDevInfo(devInfo) == 0) { return AjaxResult.error("设备信息SQL保存失败,请修改后重试"); diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/service/impl/OrderServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/service/impl/OrderServiceImpl.java index 0a93db3..d533daf 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/service/impl/OrderServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/order/service/impl/OrderServiceImpl.java @@ -88,14 +88,18 @@ public class OrderServiceImpl implements OrderService { @Transactional public Integer submitOrderInfo(List orderInfoDtos) { int j = 0; + orderInfoDtos.removeIf(Objects::isNull); for (OrderInfoDto orderInfoDto : orderInfoDtos) { // 首先判断库存是否足够 List orderDetailDtos = orderInfoDto.getDetailsList(); - orderDetailDtos.removeIf(Objects::isNull); - if (orderDetailDtos.isEmpty()) { + if(orderDetailDtos == null){ continue; -// throw new RuntimeException("请正确添加设备"); } +// orderDetailDtos.removeIf(Objects::isNull); +// if (orderDetailDtos.isEmpty()) { +// continue; +//// throw new RuntimeException("请正确添加设备"); +// } //生成订单信息 String code = "D" + System.currentTimeMillis(); orderInfoDto.setCode(code);