mitao
2024-07-20 1f3e9dc85399290910cde7149806323305544e0d
ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomServiceImpl.java
@@ -884,7 +884,7 @@
    public String getQrCode(Long id) throws Exception {
        AuctionSalesroom auctionSalesroom = this.getById(id);
        String auctionSalesroomNo = auctionSalesroom.getAuctionSalesroomNo();
        return CreateQrCode.createQRCode(auctionSalesroomNo);
        return auctionSalesroom.getQrCode();
    }
    @Override
@@ -1483,11 +1483,10 @@
        if (lastBidAmount.intValue() > 0) {
            BigDecimal divide = lastBidAmount.divide(
                    BigDecimal.valueOf(Long.parseLong(memberPointsMoney.getConfigValue())), 0,
                    new BigDecimal(memberPointsMoney.getConfigValue()), 0,
                    RoundingMode.DOWN);
            int points = divide.multiply(
                    BigDecimal.valueOf(
                            Long.parseLong((memberPointsPoints.getConfigValue())))).intValue();
                    new BigDecimal(memberPointsPoints.getConfigValue())).intValue();
            order.setPoints(points);
        } else {
            order.setPoints(0);
@@ -1630,10 +1629,14 @@
            List<GoodsStockUpdDTO> dtoList = new ArrayList<>();
            for (AuctionSalesroomGoods salesroomGoods : auctionSalesroomGoods) {
                salesroomGoods.setStatus(AuctionGoodsStatusEnum.ENDED);
                GoodsStockUpdDTO goodsStockUpdDTO = new GoodsStockUpdDTO();
                goodsStockUpdDTO.setGoodsSkuId(salesroomGoods.getGoodsSkuId());
                goodsStockUpdDTO.setAuctionStock(salesroomGoods.getSalesroomStock());
                dtoList.add(goodsStockUpdDTO);
                // 等待中的商品退库存
                if (salesroomGoods.getStatus().equals(AuctionGoodsStatusEnum.WAITING)) {
                    GoodsStockUpdDTO goodsStockUpdDTO = new GoodsStockUpdDTO();
                    goodsStockUpdDTO.setGoodsSkuId(salesroomGoods.getGoodsSkuId());
                    goodsStockUpdDTO.setAuctionStock(salesroomGoods.getSalesroomStock());
                    dtoList.add(goodsStockUpdDTO);
                }
            }
            // 批量更新商品库存
            auctionSalesroomGoodsMapper.updateBatchById(auctionSalesroomGoods);
@@ -1643,15 +1646,16 @@
        List<AuctionBidRecord> auctionBidRecordList = auctionBidRecordMapper.selectList(
                Wrappers.<AuctionBidRecord>lambdaQuery()
                        .eq(AuctionBidRecord::getAuctionSalesroomId, auctionSalesroomId)
                        .eq(AuctionBidRecord::getStatus, BidStatusEnum.ELIMINATE));
        Set<Long> memberIdlist = auctionBidRecordList.stream().map(AuctionBidRecord::getMemberId)
                .collect(Collectors.toSet());
        if (StringUtils.isNotEmpty(memberIdlist)) {
            OrderAuctionBondDTO orderAuctionBondDTO = new OrderAuctionBondDTO();
            orderAuctionBondDTO.setAuctionSalesroomId(auctionSalesroom.getId());
            orderAuctionBondDTO.setUserList(memberIdlist);
            orderClient.getOrderAuctionBond(orderAuctionBondDTO, SecurityConstants.INNER);
                        .ne(AuctionBidRecord::getStatus, BidStatusEnum.SUCCESSFUL));
        Set<Long> memberIdList = new HashSet<>();
        if (CollUtils.isNotEmpty(auctionBidRecordList)) {
            memberIdList = auctionBidRecordList.stream().map(AuctionBidRecord::getMemberId)
                    .collect(Collectors.toSet());
        }
        OrderAuctionBondDTO orderAuctionBondDTO = new OrderAuctionBondDTO();
        orderAuctionBondDTO.setAuctionSalesroomId(auctionSalesroom.getId());
        orderAuctionBondDTO.setUserList(memberIdList);
        orderClient.getOrderAuctionBond(orderAuctionBondDTO, SecurityConstants.INNER);
        Map<String, Object> map = new ConcurrentHashMap<>();
        map.put("notification_type", NotificationTypeConstant.AUCTION_SALESROOM);
        map.put("auctionSalesroomId", auctionSalesroom.getId().toString());