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();