Pu Zhibing
2025-05-15 7a4f9541331bef779a506b38a27ed5c3373c0bec
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TExchangeOrderServiceImpl.java
@@ -4,8 +4,11 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.account.api.feignClient.AppUserAddressClient;
import com.ruoyi.account.api.feignClient.AppUserClient;
import com.ruoyi.account.api.feignClient.AppUserIntegralChangeClient;
import com.ruoyi.account.api.model.TAppUser;
import com.ruoyi.account.api.model.TAppUserAddress;
import com.ruoyi.account.api.model.TAppUserIntegralChange;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.order.api.model.TExchangeOrder;
@@ -57,6 +60,9 @@
   @Resource
   private AppUserClient appUserClient;
   
   @Resource
   private AppUserIntegralChangeClient appUserIntegralChangeClient;
   
   
   
@@ -75,7 +81,8 @@
         wrapper.eq(TExchangeOrder::getStatus, query.getStatus());
      }
      long count = this.count(wrapper);
      List<TExchangeOrder> list = this.list(wrapper.orderByDesc(TExchangeOrder::getCreateTime).last(" limit " + query.getPageCurr() + "," + query.getPageSize()));
      Integer pageCurr = (query.getPageCurr() - 1) * query.getPageSize();
      List<TExchangeOrder> list = this.list(wrapper.orderByDesc(TExchangeOrder::getCreateTime).last(" limit " + pageCurr + "," + query.getPageSize()));
      List<MyExchangeOrderList> pageList = new ArrayList<>();
      for (TExchangeOrder tExchangeOrder : list) {
         MyExchangeOrderList exchangeOrderList = new MyExchangeOrderList();
@@ -89,12 +96,16 @@
         String imgUrl = "";
         if(tExchangeOrder.getOrderType() == 1){
            TGoods goods = goodsClient.getGoodsById(tExchangeOrder.getGoodsId()).getData();
            name = goods.getName();
            imgUrl = goods.getCoverPicture();
            if(null != goods){
               name = goods.getName();
               imgUrl = goods.getCoverPicture();
            }
         }else{
            TCoupon coupon = couponClient.getCouponById1(tExchangeOrder.getCouponId()).getData();
            name = coupon.getName();
            imgUrl = coupon.getCoverPicture();
            if(null != coupon){
               name = coupon.getName();
               imgUrl = coupon.getCoverPicture();
            }
         }
         exchangeOrderList.setName(name);
         exchangeOrderList.setImgUrl(imgUrl);
@@ -130,15 +141,19 @@
      String imgUrl = "";
      if(exchangeOrder.getOrderType() == 1){
         TGoods goods = goodsClient.getGoodsById(exchangeOrder.getGoodsId()).getData();
         name = goods.getName();
         imgUrl = goods.getCoverPicture();
         if(null != goods){
            name = goods.getName();
            imgUrl = goods.getCoverPicture();
         }
      }else{
         TCoupon coupon = couponClient.getCouponById1(exchangeOrder.getCouponId()).getData();
         info.setCouponType(coupon.getType());
         info.setDays(coupon.getDays());
         info.setEndTime(coupon.getEndTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
         name = coupon.getName();
         imgUrl = coupon.getCoverPicture();
         if(null != coupon){
            info.setCouponType(coupon.getType());
            info.setDays(coupon.getDays());
            info.setEndTime(coupon.getEndTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
            name = coupon.getName();
            imgUrl = coupon.getCoverPicture();
         }
      }
      info.setName(name);
      info.setImgUrl(imgUrl);
@@ -196,4 +211,5 @@
      pageInfo.setRecords(list);
      return pageInfo;
    }
}