Bläddra i källkod

商城商品关联管乐迷

zouxuan 2 år sedan
förälder
incheckning
beb5a8797f

+ 10 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -1380,15 +1380,17 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
                             for (int i = 0; i < goodsOrderItemVOS.size(); i++) {
                                 GoodsOrderItemVO goodsVo = goodsOrderItemVOS.get(i);
                                 Goods goods = goodsSnMap.get(goodsVo.getProductSn());
-                                StudentPaymentOrderDetail detail = new StudentPaymentOrderDetail();
-                                detail.setType(OrderDetailTypeEnum.valueOf(goods.getType() == GoodsType.INSTRUMENT?"MUSICAL":goods.getType().getCode()));
-                                detail.setGoodsIdList(goods.getId().toString());
-                                BigDecimal totalAmount = goodsVo.getRealAmount().multiply(new BigDecimal(goodsVo.getProductQuantity()));
-                                detail.setPrice(totalAmount);
-                                detail.setRemitFee(BigDecimal.ZERO);
-                                detail.setPaymentOrderId(paymentOrderId);
-                                orderDetails.add(detail);
+                                for (int j = 0; j < goodsVo.getProductQuantity(); j++) {
+                                    StudentPaymentOrderDetail detail = new StudentPaymentOrderDetail();
+                                    detail.setType(OrderDetailTypeEnum.valueOf(goods.getType() == GoodsType.INSTRUMENT?"MUSICAL":goods.getType().getCode()));
+                                    detail.setGoodsIdList(goods.getId().toString());
+                                    detail.setPrice(goodsVo.getRealAmount());
+                                    detail.setRemitFee(BigDecimal.ZERO);
+                                    detail.setPaymentOrderId(paymentOrderId);
+                                    orderDetails.add(detail);
+                                }
 
+                                BigDecimal totalAmount = goodsVo.getRealAmount().multiply(new BigDecimal(goodsVo.getProductQuantity()));
                                 SellOrder sellOrder = new SellOrder();
                                 sellOrder.setOrganId(organId);
                                 sellOrder.setTransNo(transNo);