Browse Source

Merge branch 'mp-server-test' into 'master'

Mp server test

See merge request quanshu/mp-server!911
zhong chunping 2 years ago
parent
commit
bfaeb39710

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

@@ -292,14 +292,14 @@ public class TicketBoxServiceImpl extends ServiceImpl<TicketBoxMapper, TicketBox
 
             // 如果新的奖品id为空,则清除原来的所有奖品
             if (CollectionUtils.isEmpty(prizeIdList)) {
-                if (TicketTypeEnum.ONLINE.equals(ticketBox.getType())) {
-                    int cashedCount = ticketAwardsPrizeService.count(new LambdaQueryWrapper<TicketAwardsPrize>()
-                        .eq(TicketAwardsPrize::getAwardsId, ticketAwardsParam.getAwardsId())
-                        .ne(TicketAwardsPrize::getCashedQty, 0));
-                    if (cashedCount != 0) {
-                        throw new ServiceException("包含已兑奖记录的奖品不能从奖级中删除");
-                    }
-                }
+//                if (TicketTypeEnum.ONLINE.equals(ticketBox.getType())) {
+//                    int cashedCount = ticketAwardsPrizeService.count(new LambdaQueryWrapper<TicketAwardsPrize>()
+//                        .eq(TicketAwardsPrize::getAwardsId, ticketAwardsParam.getAwardsId())
+//                        .ne(TicketAwardsPrize::getCashedQty, 0));
+//                    if (cashedCount != 0) {
+//                        throw new ServiceException("包含已兑奖记录的奖品不能从奖级中删除");
+//                    }
+//                }
 
                 ticketAwardsPrizeService.update(
                     new LambdaUpdateWrapper<TicketAwardsPrize>().set(TicketAwardsPrize::getIsDeleted, 1)
@@ -321,14 +321,14 @@ public class TicketBoxServiceImpl extends ServiceImpl<TicketBoxMapper, TicketBox
                 oldPrizeIdList.removeAll(prizeIdList);
 
                 if (CollectionUtils.isNotEmpty(oldPrizeIdList)) {
-                    if (TicketTypeEnum.ONLINE.equals(ticketBox.getType())) {
-                        int cashedCount = ticketAwardsPrizeService.count(new LambdaQueryWrapper<TicketAwardsPrize>()
-                            .in(TicketAwardsPrize::getPrizeId, oldPrizeIdList)
-                            .ne(TicketAwardsPrize::getCashedQty, 0));
-                        if (cashedCount != 0) {
-                            throw new ServiceException("包含已兑奖记录的奖品不能从奖级中删除");
-                        }
-                    }
+//                    if (TicketTypeEnum.ONLINE.equals(ticketBox.getType())) {
+//                        int cashedCount = ticketAwardsPrizeService.count(new LambdaQueryWrapper<TicketAwardsPrize>()
+//                            .in(TicketAwardsPrize::getPrizeId, oldPrizeIdList)
+//                            .ne(TicketAwardsPrize::getCashedQty, 0));
+//                        if (cashedCount != 0) {
+//                            throw new ServiceException("包含已兑奖记录的奖品不能从奖级中删除");
+//                        }
+//                    }
 
                     // 删除原来的奖品信息
                     ticketAwardsPrizeService.update(