cup 2 年之前
父節點
當前提交
fab059ce41
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      mp-admin/src/main/java/com/qs/mp/web/controller/api/user/UserTicketController.java

+ 2 - 2
mp-admin/src/main/java/com/qs/mp/web/controller/api/user/UserTicketController.java

@@ -135,9 +135,9 @@ public class UserTicketController extends BaseApiController {
       Integer num = ticketAwardsService.groupSumQuantityByQueryWrapper(queryWrapper);
       if (Objects.isNull(num) || num == 0) {
         ticketAwardsLabelVO.setHitRate(new BigDecimal(0));
+      }else {
+        ticketAwardsLabelVO.setHitRate(new BigDecimal(num).divide(new BigDecimal(quantity), 1, RoundingMode.HALF_UP));
       }
-      ticketAwardsLabelVO.setHitRate(new BigDecimal(num).divide(new BigDecimal(quantity),1,RoundingMode.HALF_UP));
-
       ticketAwardsLabelVOS.add(ticketAwardsLabelVO);
     }
     ticketBoxVO.setTicketAwardsLabelList(ticketAwardsLabelVOS);