Browse Source

Merge branch 'dev' of maopiao/mp-server into mp-server-test

盲票 1 year ago
parent
commit
60c2f1a61e

+ 17 - 3
mp-admin/src/main/java/com/qs/mp/web/controller/api/admin/TicketBoxMgrController.java

@@ -77,6 +77,9 @@ public class TicketBoxMgrController extends BaseApiController {
     @Autowired
     @Autowired
     private ITicketBoxGoodsService ticketBoxGoodsService;
     private ITicketBoxGoodsService ticketBoxGoodsService;
 
 
+    @Autowired
+    private ITicketPackageService ticketPackageService;
+
     @Value("${mp.exportUrl}")
     @Value("${mp.exportUrl}")
     private String exportUrl;
     private String exportUrl;
 
 
@@ -488,13 +491,24 @@ public class TicketBoxMgrController extends BaseApiController {
             return AjaxResult.error("参数缺失");
             return AjaxResult.error("参数缺失");
         }
         }
         TicketBox ticketBox = ticketBoxService.getById(param.getBoxId());
         TicketBox ticketBox = ticketBoxService.getById(param.getBoxId());
-        Ticket ticket = ticketService.getRandOne(param.getBoxId());
+        //更新盲票列表的状态
+        List<Ticket> ticketList = ticketService
+            .list(new LambdaQueryWrapper<Ticket>().eq(Ticket::getBoxId, ticketBox.getBoxId()));
+        //更新盲票包的状态
+        List<TicketPackage> ticketPackageList = ticketPackageService.list(new LambdaQueryWrapper<TicketPackage>()
+            .eq(TicketPackage::getBoxId, ticketBox.getBoxId()));
         if((ticketBox.getStatus() == TicketBoxStatusEnum.PUT_ON || ticketBox.getStatus() == TicketBoxStatusEnum.PUT_OFF) && ticketBox.getType() == TicketTypeEnum.OFFLINE){
         if((ticketBox.getStatus() == TicketBoxStatusEnum.PUT_ON || ticketBox.getStatus() == TicketBoxStatusEnum.PUT_OFF) && ticketBox.getType() == TicketTypeEnum.OFFLINE){
             ticketBoxService.update(new LambdaUpdateWrapper<TicketBox>()
             ticketBoxService.update(new LambdaUpdateWrapper<TicketBox>()
                 .set(TicketBox::getStatus, TicketBoxStatusEnum.STOP)
                 .set(TicketBox::getStatus, TicketBoxStatusEnum.STOP)
                 .eq(TicketBox::getBoxId, ticketBox.getBoxId()));
                 .eq(TicketBox::getBoxId, ticketBox.getBoxId()));
-            ticket.setStatus(TicketStatusEnum.STOP);
-            ticketService.saveOrUpdate(ticket);
+            for(Ticket ticket : ticketList){
+                ticket.setStatus(TicketStatusEnum.STOP);
+                ticketService.saveOrUpdate(ticket);
+            }
+            for(TicketPackage ticketPackage : ticketPackageList){
+                ticketPackage.setStatus(TicketPkgStatusEnum.STOP);
+                ticketPackageService.saveOrUpdate(ticketPackage);
+            }
         }else {
         }else {
             return AjaxResult.error("当前不是已上架的线下盲票,不能进行停售操作");
             return AjaxResult.error("当前不是已上架的线下盲票,不能进行停售操作");
         }
         }