| | |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.common.core.utils.page.CollUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.system.api.constants.ConfigEnum; |
| | | import com.ruoyi.system.api.constants.NotificationTypeConstant; |
| | |
| | | auctionGoodsOrg.setSharePic(dto.getSharePic()); |
| | | this.updateById(auctionGoodsOrg); |
| | | } |
| | | auctionAsyncMethodService.auctionGoodsScheduleTask(Lists.newArrayList(auctionGoods)); |
| | | if (auctionGoods.getEndTime().isBefore(LocalDateTime.now())) { |
| | | // 退回剩余库存 |
| | | GoodsStockUpdDTO goodsStockUpdDTO = new GoodsStockUpdDTO(); |
| | | goodsStockUpdDTO.setAuctionStock(auctionGoods.getAuctionStock()); |
| | | goodsStockUpdDTO.setGoodsSkuId(auctionGoods.getGoodsSkuId()); |
| | | goodsSkuClient.updGoodsStock(Lists.newArrayList(goodsStockUpdDTO), |
| | | SecurityConstants.INNER); |
| | | auctionGoods.setStartStatus(AuctionStartStatusEnum.ENDED); |
| | | this.updateById(auctionGoods); |
| | | } else { |
| | | auctionAsyncMethodService.auctionGoodsScheduleTask(Lists.newArrayList(auctionGoods)); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | for (OrderAuctionBond orderAuctionBond : auctionBondList) { |
| | | |
| | | // 已中标需在订单完成后退保证金 |
| | | if (unRefundMemberIdList.contains(orderAuctionBond.getMemberId())) { |
| | | if (unRefundMemberIdList.contains(orderAuctionBond.getMemberId()) |
| | | || Objects.isNull(orderAuctionBond.getBond())) { |
| | | continue; |
| | | } |
| | | RefundDTO refundDTO = new RefundDTO(); |
| | |
| | | // 远程调用订单服务进行退款 |
| | | Map<String, Object> data = orderClient.refund(refundDTOList, |
| | | SecurityConstants.INNER).getData(); |
| | | if (CollUtils.isNotEmpty(data)) { |
| | | // 处理退款返回结果 |
| | | List<String> successfulOrders = new ArrayList<>(); |
| | | List<String> failedOrders = new ArrayList<>(); |
| | | |
| | | data.forEach((key, value) -> { |
| | | if ((boolean) value) { |
| | | successfulOrders.add(key); |
| | |
| | | } |
| | | return null; |
| | | }).filter(Objects::nonNull).collect(Collectors.toList()); |
| | | |
| | | // 远程调用订单服务修改订单状态 |
| | | orderClient.updateOrderAuctionBondStatus(ids, BondStatusEnum.REFUNDED, |
| | | SecurityConstants.INNER); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | this.updateById(auctionGoods); |
| | | } |
| | | |
| | | /** |
| | | * 根据商品id获取正在进行的拍卖商品 |
| | | * |
| | | * @param id 商品id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<AuctionGoods> getAuctionGoodsBySkuId(Long id) { |
| | | return this.list(new LambdaQueryWrapper<AuctionGoods>().eq(AuctionGoods::getGoodsSkuId, |
| | | id).eq(AuctionGoods::getListingStatus, ListingStatusEnum.ON_SHELVES) |
| | | .eq(AuctionGoods::getStartStatus, AuctionStartStatusEnum.IN_AUCTION)); |
| | | } |
| | | |
| | | public static void main(String[] args) throws JsonProcessingException { |
| | | Map<String, Object> map = new ConcurrentHashMap<>(); |
| | | map.put("notification_type", NotificationTypeConstant.AUCTION_GOODS); |
| | |
| | | String msg = objectMapper.writeValueAsString(map); |
| | | System.out.println(msg); |
| | | } |
| | | |
| | | } |