From e6b60d7dbeebd75fe14ecef3013f8a19fdcb4b64 Mon Sep 17 00:00:00 2001 From: mengjiao <3338049200@qq,com> Date: Wed, 22 Jan 2025 13:44:21 +0800 Subject: [PATCH] =?UTF-8?q?wms=E6=88=90=E5=93=81=E9=94=80=E5=94=AE?= =?UTF-8?q?=E5=87=BA=E5=BA=93bug3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WmsSellOutEmbryoServiceImpl.java | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsSellOutEmbryoServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsSellOutEmbryoServiceImpl.java index 130951272..b02c25807 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsSellOutEmbryoServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsSellOutEmbryoServiceImpl.java @@ -16,6 +16,7 @@ import com.op.common.core.utils.uuid.IdUtils; import com.op.wms.domain.*; import com.op.wms.mapper.WmsFpStorageNewsSnMapper; import okhttp3.*; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.redis.core.RedisTemplate; @@ -226,24 +227,28 @@ public class WmsSellOutEmbryoServiceImpl implements IWmsSellOutEmbryoService { BigDecimal tem= wmsFpStorageNewsSn.getAmount();//数量 //planQuantity看成总数量 if(planQuantity.compareTo(tem)<=0){ - //生成一个 wmsSellOutEmbryoMapper.updateWmsSellOutEmbryoAddOut(wmsSellOutEmbryo2,planQuantity);//对订单进行修改--添加出库数量 - wmsSellOutEmbryo2.setStockOrder("BH"+stock); - wmsSellOutEmbryo2.setOutQuantity(new BigDecimal("0")); - wmsSellOutEmbryo2.setWaCode(wmsFpStorageNewsSn.getWaCode()); - wmsSellOutEmbryo2.setPlanQuantity(planQuantity); - wmsSellOutEmbryo2.setId(IdUtils.fastSimpleUUID()); - wmsSellOutEmbryoMapper.insertWmsSellOutEmbryoOrder(wmsSellOutEmbryo2); + //生成一个 + WmsSellOutEmbryo wmsSellOutEmbryo3=new WmsSellOutEmbryo(); + BeanUtils.copyProperties(wmsSellOutEmbryo2, wmsSellOutEmbryo3); + wmsSellOutEmbryo3.setStockOrder("BH"+stock); + wmsSellOutEmbryo3.setOutQuantity(new BigDecimal("0")); + wmsSellOutEmbryo3.setWaCode(wmsFpStorageNewsSn.getWaCode()); + wmsSellOutEmbryo3.setPlanQuantity(planQuantity); + wmsSellOutEmbryo3.setId(IdUtils.fastSimpleUUID()); + wmsSellOutEmbryoMapper.insertWmsSellOutEmbryoOrder(wmsSellOutEmbryo3); break ; }else { wmsSellOutEmbryoMapper.updateWmsSellOutEmbryoAddOut(wmsSellOutEmbryo2,tem); - wmsSellOutEmbryo2.setStockOrder("BH"+stock); - wmsSellOutEmbryo2.setOutQuantity(new BigDecimal("0")); + WmsSellOutEmbryo wmsSellOutEmbryo3=new WmsSellOutEmbryo(); + BeanUtils.copyProperties(wmsSellOutEmbryo2, wmsSellOutEmbryo3); + wmsSellOutEmbryo3.setStockOrder("BH"+stock); + wmsSellOutEmbryo3.setOutQuantity(new BigDecimal("0")); planQuantity = planQuantity.subtract(tem); // 用总数量减去tem,更新planQuantity的值 - wmsSellOutEmbryo2.setWaCode(wmsFpStorageNewsSn.getWaCode()); // 设置wmsSellOutEmbryo2的waCode为当前wmsFpStorageNewsSn的waCode - wmsSellOutEmbryo2.setPlanQuantity(tem); // 将tem的值赋给wmsSellOutEmbryo2的planQuantity - wmsSellOutEmbryo2.setId(IdUtils.fastSimpleUUID()); // 生成一个唯一ID并设置到wmsSellOutEmbryo2的ID字段 - wmsSellOutEmbryoMapper.insertWmsSellOutEmbryoOrder(wmsSellOutEmbryo2); // 将wmsSellOutEmbryo2插入到数据库 + wmsSellOutEmbryo3.setWaCode(wmsFpStorageNewsSn.getWaCode()); // 设置wmsSellOutEmbryo2的waCode为当前wmsFpStorageNewsSn的waCode + wmsSellOutEmbryo3.setPlanQuantity(tem); // 将tem的值赋给wmsSellOutEmbryo2的planQuantity + wmsSellOutEmbryo3.setId(IdUtils.fastSimpleUUID()); // 生成一个唯一ID并设置到wmsSellOutEmbryo2的ID字段 + wmsSellOutEmbryoMapper.insertWmsSellOutEmbryoOrder(wmsSellOutEmbryo3); // 将wmsSellOutEmbryo2插入到数据库 } } }