| | |
| | | wrapper.orderByAsc(AuctionBidRecord::getLastBidTime); |
| | | auctionBidRecordList = auctionBidRecordMapper.selectList(wrapper); |
| | | Map<Long, String> orderIdMap = new HashMap<>(); |
| | | if(auctionBidRecordList.size()>0){ |
| | | if (auctionBidRecordList.size() > 0) { |
| | | //判断 |
| | | if (auctionBidRecordList.size() >= auctionSalesroomGoods.getSalesroomStock()) { |
| | | if (auctionBidRecordList.size() >= auctionSalesroomGoods.getBidNum()) { |
| | | for (int i = 0; i < auctionSalesroomGoods.getSalesroomStock(); i++) { |
| | | AuctionBidRecord auctionBidRecord = auctionBidRecordList.get(i); |
| | | auctionBidRecord.setStatus(BidStatusEnum.SUCCESSFUL); |
| | | Long orderId = AddOrder(auctionBidRecord.getTargetId(), |
| | | auctionBidRecord.getMemberId(), |
| | | auctionBidRecord.getLastBidAmount(), auctionSalesroom.getBond()); |
| | | auctionBidRecord.getLastBidAmount() |
| | | .multiply(new BigDecimal( |
| | | auctionSalesroomGoods.getDealQuantity())), |
| | | auctionSalesroom.getBond(), |
| | | auctionSalesroomGoods.getDealQuantity()); |
| | | if (Objects.nonNull(orderId)) { |
| | | orderIdMap.put(auctionBidRecord.getMemberId(), orderId.toString()); |
| | | auctionBidRecord.setOrderId(orderId); |
| | |
| | | auctionBidRecord.setStatus(BidStatusEnum.SUCCESSFUL); |
| | | Long orderId = AddOrder(auctionBidRecord.getTargetId(), |
| | | auctionBidRecord.getMemberId(), |
| | | auctionBidRecord.getLastBidAmount(), auctionSalesroom.getBond()); |
| | | auctionBidRecord.getLastBidAmount(), auctionSalesroom.getBond(), 1); |
| | | if (Objects.nonNull(orderId)) { |
| | | orderIdMap.put(auctionBidRecord.getMemberId(), orderId.toString()); |
| | | auctionBidRecord.setOrderId(orderId); |
| | |
| | | |
| | | |
| | | public Long AddOrder(Long goodsSkuId, Long memberId, BigDecimal lastBidAmount, |
| | | BigDecimal bound) { |
| | | BigDecimal bound, Integer goodsQuantity) { |
| | | OrderDTO order=new OrderDTO(); |
| | | order.setGoodsSkuId(goodsSkuId); |
| | | order.setOrderTime(LocalDateTime.now()); |
| | |
| | | order.setMemberId(memberId); |
| | | AuctionSalesroomGoods auctionSalesroomGoods = this.getById(goodsSkuId); |
| | | |
| | | order.setGoodsQuantity(1); |
| | | order.setGoodsQuantity(goodsQuantity); |
| | | order.setTotalAmount(lastBidAmount); |
| | | order.setAuctionSalesroomId(auctionSalesroomGoods.getAuctionSalesroomId()); |
| | | |