From dda5ebc2e3401d21a3b681c6cbf3686326a55e61 Mon Sep 17 00:00:00 2001 From: wuchunlei Date: Wed, 6 Aug 2025 10:27:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=93=E5=8D=95=E6=89=98?= =?UTF-8?q?=E5=AF=84=E7=89=A9=E3=80=81=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../book/service/impl/BuyOrderServiceImpl.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/peanut/modules/book/service/impl/BuyOrderServiceImpl.java b/src/main/java/com/peanut/modules/book/service/impl/BuyOrderServiceImpl.java index 1785f0cc..735aa6ea 100644 --- a/src/main/java/com/peanut/modules/book/service/impl/BuyOrderServiceImpl.java +++ b/src/main/java/com/peanut/modules/book/service/impl/BuyOrderServiceImpl.java @@ -528,7 +528,6 @@ public class BuyOrderServiceImpl extends ServiceImpl impl BigDecimal totalWeight = new BigDecimal(0); List commodityList = new ArrayList<>(); List buyOrderIdList = new ArrayList<>(); - Integer ln = 0; String remark =""; for (BuyOrderProduct buyOrderProduct : buyOrderProductList) { buyOrderIdList.add(buyOrderProduct.getOrderId()); @@ -536,18 +535,25 @@ public class BuyOrderServiceImpl extends ServiceImpl impl ShopProduct product = shopProductService.getById(productId); //定义快递商品 ExpressCommodity commodity = new ExpressCommodity(); - commodity.setGoodsName(product.getProductName()+" ×"+buyOrderProduct.getQuantity()); + String productName = product.getProductName()+" ×"+buyOrderProduct.getQuantity()+";"; + remark += productName; + //商品类型01挂图02书籍03预售书04仪器05课程06小店商品 + if ("02".equals(product.getGoodsType())||"03".equals(product.getGoodsType())){ + commodity.setGoodsName("书籍"); + }else if ("01".equals(product.getGoodsType())){ + commodity.setGoodsName("挂图"); + }else if ("04".equals(product.getGoodsType())){ + commodity.setGoodsName("仪器"); + }else { + commodity.setGoodsName("商品"); + } commodity.setGoodsquantity(buyOrderProduct.getQuantity()); commodity.setGoodsWeight((product.getWeight().doubleValue())/1000); commodity.setGoodsPrice(product.getPrice().doubleValue()); totalWeight = totalWeight.add( BigDecimal.valueOf(product.getWeight().doubleValue()).multiply(new BigDecimal(buyOrderProduct.getQuantity())).divide(BigDecimal.valueOf(1000),2,RoundingMode.HALF_UP) ); - if(ln>0){ - remark += commodity.getGoodsName(); - } commodityList.add(commodity); - ln++; } // 获取用户地址 Integer orderId = buyOrderProductList.get(0).getOrderId();