| | |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | | import com.ruoyi.order.api.model.TShoppingOrder; |
| | | import com.ruoyi.order.api.query.ShoppingOrderQuery; |
| | | import com.ruoyi.order.api.query.TActivityStatisticsQuery; |
| | | import com.ruoyi.order.api.vo.ChargingOrderVO; |
| | | import com.ruoyi.order.api.vo.TActivityStatisticslVO; |
| | | import com.ruoyi.order.api.vo.TActivityVO; |
| | | import com.ruoyi.order.dto.*; |
| | |
| | | import com.ruoyi.other.api.domain.TGoods; |
| | | import com.ruoyi.other.api.feignClient.CouponClient; |
| | | import com.ruoyi.other.api.feignClient.GoodsClient; |
| | | import com.ruoyi.payment.api.feignClient.AliPaymentClient; |
| | | import com.ruoyi.payment.api.feignClient.WxPaymentClient; |
| | | import com.ruoyi.payment.api.vo.NotifyV3PayDecodeRespBody; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | |
| | | private AppUserAddressClient appUserAddressClient; |
| | | @Resource |
| | | private AppCouponClient appCouponClient; |
| | | |
| | | @Resource |
| | | private WxPaymentClient wxPaymentClient; |
| | | |
| | | @Resource |
| | | private AliPaymentClient aliPaymentClient; |
| | | |
| | | |
| | | |
| | |
| | | //支付方式(1=微信,2=支付宝) todo 待完善 |
| | | Integer paymentType = shoppingOrder.getPaymentType(); |
| | | if(1 == paymentType){ |
| | | |
| | | NotifyV3PayDecodeRespBody data = wxPaymentClient.queryOrderInfo(shoppingOrder.getCode()).getData(); |
| | | String trade_state = data.getTrade_state(); |
| | | if("NOTPAY".equals(trade_state) || "REVOKED".equals(trade_state) || "PAYERROR".equals(trade_state)){ |
| | | return AjaxResult.error("订单还未支付,不能操作退款"); |
| | | } |
| | | if("CLOSED".equals(trade_state)){ |
| | | return AjaxResult.error("订单支付已关闭,不能操作退款"); |
| | | } |
| | | if("USERPAYING".equals(trade_state)){ |
| | | return AjaxResult.error("订单正在支付中,不能操作退款"); |
| | | } |
| | | if("REFUND".equals(trade_state)){ |
| | | return AjaxResult.error("订单已退款,不能操作退款"); |
| | | } |
| | | } |
| | | if(2 == paymentType){ |
| | | |
| | |
| | | appCouponClient.grantCoupon(grantCouponDto); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<TShoppingOrder> pageList(ShoppingOrderQuery query) { |
| | | String startTime1 = null; |
| | | String startTime2 = null; |
| | | |
| | | |
| | | if (StringUtils.hasLength(query.getStartTime())){ |
| | | String[] split = query.getStartTime().split(" - "); |
| | | startTime1 = split[0]; |
| | | startTime2 = split[1]; |
| | | } |
| | | PageInfo<TShoppingOrder> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize()); |
| | | List<TShoppingOrder> list = this.baseMapper.pageList(pageInfo,query,startTime1,startTime2); |
| | | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |