| | |
| | | import com.ruoyi.system.api.domain.AuctionGoods; |
| | | import com.ruoyi.system.api.domain.AuctionSalesroom; |
| | | import com.ruoyi.system.api.domain.OrderAuctionBond; |
| | | import com.ruoyi.system.api.domain.dto.BondReturnDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomBondDTO; |
| | | import com.ruoyi.system.api.domain.dto.OrderAuctionBondDTO; |
| | | import com.ruoyi.system.api.domain.dto.RefundDTO; |
| | | import com.ruoyi.system.api.domain.vo.PayInfoVO; |
| | | import com.ruoyi.system.api.feignClient.AuctionClient; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.Set; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import java.util.stream.Collectors; |
| | |
| | | public R<T> getOrderAuctionBond(OrderAuctionBondDTO orderAuctionBondDTO) { |
| | | |
| | | LambdaQueryWrapper<OrderAuctionBond> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.in(OrderAuctionBond::getMemberId, orderAuctionBondDTO.getUserList()); |
| | | if (orderAuctionBondDTO.getUserList().size()>0){ |
| | | wrapper.notIn(OrderAuctionBond::getMemberId, orderAuctionBondDTO.getUserList()); |
| | | } |
| | | wrapper.eq(OrderAuctionBond::getDelFlag, 0); |
| | | wrapper.eq(OrderAuctionBond::getAuctionSalesroomId, orderAuctionBondDTO.getAuctionSalesroomId()); |
| | | List<OrderAuctionBond> orderAuctionBondList = this.list(wrapper); |
| | | |
| | | for (OrderAuctionBond orderAuctionBond : orderAuctionBondList) { |
| | | LambdaQueryWrapper<Paylog> wrapper1 = Wrappers.lambdaQuery(); |
| | | wrapper1.eq(Paylog::getOutTradeNo, orderAuctionBond.getOrderNo()); |
| | |
| | | return R.fail("微信退款失败!"); |
| | | } |
| | | } |
| | | |
| | | orderAuctionBond.setBoundStatus(BondStatusEnum.REFUNDED); |
| | | } |
| | | this.updateBatchById(orderAuctionBondList); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (memberAuctionSalesroomBondDTO.getBondType() == 1) { |
| | | AuctionGoods data = auctionClient.getauctionGoodsOne(memberAuctionSalesroomBondDTO, SecurityConstants.INNER).getData(); |
| | | |
| | | if (data.getEndTime().isAfter(LocalDateTime.now())){ |
| | | throw new ServiceException("商品拍卖已结束"); |
| | | } |
| | | if (data.getListingStatus().getCode()==1){ |
| | | throw new ServiceException("商品拍卖下线"); |
| | | } |
| | |
| | | orderAuctionBond.setMemberId(memberAuctionSalesroomBondDTO.getMemberId()); |
| | | orderAuctionBond.setBond(data.getBond()); |
| | | orderAuctionBond.setBoundStatus(BondStatusEnum.PAID); |
| | | orderAuctionBond.setBoundStatus(BondStatusEnum.TO_PLAY); |
| | | orderAuctionBond.setBondType(AuctionOrderTypeEnum.REGULAR_ITEMS); |
| | | this.save(orderAuctionBond); |
| | | payInfoVO.setOrderNO(orderAuctionBond.getOrderNo()); |
| | | payInfoVO.setType(0); |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW) |
| | | public void returnBondByAuctionGoodsId(Long id) { |
| | | public void returnBondByAuctionGoodsId(BondReturnDTO bondReturnDTO) { |
| | | Long id = bondReturnDTO.getId(); |
| | | List<OrderAuctionBond> list = this.lambdaQuery().eq(OrderAuctionBond::getAuctionGoodsId, id) |
| | | .eq(OrderAuctionBond::getBoundStatus, BondStatusEnum.PAID).list(); |
| | | Set<String> orderNoSet = list.stream().map(OrderAuctionBond::getOrderNo) |
| | | .collect(Collectors.toSet()); |
| | | List<RefundDTO> refundDTOList = list.stream().map(item -> { |
| | | List<Long> memberIdList = bondReturnDTO.getMemberIdList(); |
| | | List<RefundDTO> refundDTOList = list.stream() |
| | | .filter(r -> !memberIdList.contains(r.getMemberId())).map(item -> { |
| | | RefundDTO refundDTO = new RefundDTO(); |
| | | refundDTO.setAmount(item.getBond()); |
| | | refundDTO.setOrderNo(item.getOrderNo()); |