cup 2 years ago
parent
commit
ea02dcc04f

+ 8 - 0
mp-service/src/main/java/com/qs/mp/admin/service/impl/TicketBoxServiceImpl.java

@@ -134,6 +134,10 @@ public class TicketBoxServiceImpl extends ServiceImpl<TicketBoxMapper, TicketBox
 
     // 关联商品
     if (CollectionUtils.isNotEmpty(param.getGoodsList())) {
+      // 设置boxId
+      for (TicketBoxGoods ticketBoxGoods : param.getGoodsList()) {
+        ticketBoxGoods.setBoxId(ticketBox.getBoxId());
+      }
       ticketBoxGoodsService.saveBatch(param.getGoodsList());
     }
 
@@ -338,6 +342,10 @@ public class TicketBoxServiceImpl extends ServiceImpl<TicketBoxMapper, TicketBox
 
     // 关联商品
     if (CollectionUtils.isNotEmpty(param.getGoodsList())) {
+      // 设置boxId
+      for (TicketBoxGoods ticketBoxGoods : param.getGoodsList()) {
+        ticketBoxGoods.setBoxId(ticketBox.getBoxId());
+      }
       ticketBoxGoodsService.saveBatch(param.getGoodsList());
     }