修改打单托寄物、备注

This commit is contained in:
wuchunlei
2025-08-06 10:27:38 +08:00
parent b9e9f9b9f9
commit dda5ebc2e3

View File

@@ -528,7 +528,6 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
BigDecimal totalWeight = new BigDecimal(0); BigDecimal totalWeight = new BigDecimal(0);
List<ExpressCommodity> commodityList = new ArrayList<>(); List<ExpressCommodity> commodityList = new ArrayList<>();
List<Integer> buyOrderIdList = new ArrayList<>(); List<Integer> buyOrderIdList = new ArrayList<>();
Integer ln = 0;
String remark =""; String remark ="";
for (BuyOrderProduct buyOrderProduct : buyOrderProductList) { for (BuyOrderProduct buyOrderProduct : buyOrderProductList) {
buyOrderIdList.add(buyOrderProduct.getOrderId()); buyOrderIdList.add(buyOrderProduct.getOrderId());
@@ -536,18 +535,25 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
ShopProduct product = shopProductService.getById(productId); ShopProduct product = shopProductService.getById(productId);
//定义快递商品 //定义快递商品
ExpressCommodity commodity = new ExpressCommodity(); 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.setGoodsquantity(buyOrderProduct.getQuantity());
commodity.setGoodsWeight((product.getWeight().doubleValue())/1000); commodity.setGoodsWeight((product.getWeight().doubleValue())/1000);
commodity.setGoodsPrice(product.getPrice().doubleValue()); commodity.setGoodsPrice(product.getPrice().doubleValue());
totalWeight = totalWeight.add( totalWeight = totalWeight.add(
BigDecimal.valueOf(product.getWeight().doubleValue()).multiply(new BigDecimal(buyOrderProduct.getQuantity())).divide(BigDecimal.valueOf(1000),2,RoundingMode.HALF_UP) 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); commodityList.add(commodity);
ln++;
} }
// 获取用户地址 // 获取用户地址
Integer orderId = buyOrderProductList.get(0).getOrderId(); Integer orderId = buyOrderProductList.get(0).getOrderId();