From 8aa2b92fa6d658e053218e50d4afaf5ee9e1bb0a Mon Sep 17 00:00:00 2001 From: wangy Date: Thu, 21 May 2026 17:20:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(sip):bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/OmsPurchaseOrderServiceImpl.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OmsPurchaseOrderServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OmsPurchaseOrderServiceImpl.java index d804f33b..b2270038 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OmsPurchaseOrderServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OmsPurchaseOrderServiceImpl.java @@ -613,6 +613,11 @@ public class OmsPurchaseOrderServiceImpl implements IOmsPurchaseOrderService, To @Override public AddToNexRes addToNex(AddToNexReq addToNexReq) { SysUser sysUser = getSysUser(); + log.info("通过BOM编码查询产品信息"); + ProductInfo productInfo = productInfoMapper.selectProductInfoByBomCode(addToNexReq.getProductCode()); + if (productInfo == null) { + throw new ServiceException("未找到BOM编码对应的产品信息: " + addToNexReq.getProductCode()); + } // 新增采购 OmsPurchaseOrder omsPurchaseOrder = new OmsPurchaseOrder(); // 设置采购订单基本信息 @@ -620,7 +625,7 @@ public class OmsPurchaseOrderServiceImpl implements IOmsPurchaseOrderService, To omsPurchaseOrder.setBuyerAddress("重庆市两江新区云杉南路6号涉外商务区B6栋7楼"); omsPurchaseOrder.setRemark("nex授权申请流程"); // 查询制造商id, 制造商编码P008 - VendorInfo vendorInfo = vendorInfoMapper.selectVendorInfoByVendorCode(nexVendorCode); + VendorInfo vendorInfo = vendorInfoMapper.selectVendorInfoByVendorCode(productInfo.getVendorCode()==null?nexVendorCode:productInfo.getVendorCode()); omsPurchaseOrder.setVendorId(vendorInfo == null ? null :vendorInfo.getVendorId()); omsPurchaseOrder.setCurrency("RMB"); // 采购员:userName=徐心钰 @@ -648,11 +653,7 @@ public class OmsPurchaseOrderServiceImpl implements IOmsPurchaseOrderService, To orderItem.setQuantity(new BigDecimal(addToNexReq.getQuantity())); // 根据BOM编码查询产品信息,折扣,单价和税率都从产品信息读 - log.info("通过BOM编码查询产品信息"); - ProductInfo productInfo = productInfoMapper.selectProductInfoByBomCode(addToNexReq.getProductCode()); - if (productInfo == null) { - throw new ServiceException("未找到BOM编码对应的产品信息: " + addToNexReq.getProductCode()); - } + log.info("通过BOM编码查询产品信息"); // 将String类型转换为BigDecimal BigDecimal price = new BigDecimal(productInfo.getCataloguePrice() != null ? productInfo.getCataloguePrice() : "0");