| | |
| | | import com.google.common.collect.Lists; |
| | | import com.google.gson.Gson; |
| | | import com.ruoyi.common.core.constant.CacheConstants; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.enums.UserStatus; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.utils.CodeFactoryUtil; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.goods.api.domain.LotteryEvent; |
| | | import com.ruoyi.goods.api.service.LotteryEventClient; |
| | | import com.ruoyi.order.config.WxPayConfiguration; |
| | | import com.ruoyi.order.domain.dto.*; |
| | | import com.ruoyi.order.domain.pojo.account.OrderPayment; |
| | |
| | | import lombok.extern.log4j.Log4j2; |
| | | import org.redisson.api.RLock; |
| | | import org.redisson.api.RedissonClient; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.NumberFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | |
| | | |
| | | @Resource |
| | | private OrderPaymentService orderPaymentService; |
| | | |
| | | |
| | | @Resource |
| | | private ProfitSharingService profitSharingService; |
| | | |
| | | |
| | | @Resource |
| | | private OrderRefundService orderRefundService; |
| | | |
| | | |
| | | @Value("${wx.pay.callbackPath}") |
| | | private String callbackPath; |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private LotteryEventClient lotteryEventClient; |
| | | |
| | | |
| | | /** |
| | | * @description: buyGoods |
| | | * @param: appSureOrderDto |
| | |
| | | appPlaceOrderVo.setPaySign(payArr[5]); |
| | | appPlaceOrderVo.setPrepayId(orderPayment.getPrepayId()); |
| | | // 返回AppPlaceOrderVo对象 |
| | | List<LotteryEvent> data = lotteryEventClient.getLotteryEventList(2).getData(); |
| | | if (data.size() > 0) { |
| | | long count = data.stream().filter(s -> s.getPayMoney().compareTo(order.getPayMoney()) >= 0).count(); |
| | | appPlaceOrderVo.setLotteryDraw(count > 0); |
| | | } else { |
| | | appPlaceOrderVo.setLotteryDraw(false); |
| | | } |
| | | return appPlaceOrderVo; |
| | | } |
| | | |