From d8828959064d1339d1cb47fc6b6f997275c0f4ab Mon Sep 17 00:00:00 2001
From: zhibing.pu <393733352@qq.com>
Date: 星期六, 31 八月 2024 17:40:31 +0800
Subject: [PATCH] 完善功能

---
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TShoppingOrderServiceImpl.java |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TShoppingOrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TShoppingOrderServiceImpl.java
index 2f91c70..fc68e82 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TShoppingOrderServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TShoppingOrderServiceImpl.java
@@ -6,6 +6,8 @@
 import com.ruoyi.account.api.dto.GrantCouponDto;
 import com.ruoyi.account.api.feignClient.AppCouponClient;
 import com.ruoyi.account.api.feignClient.AppUserAddressClient;
+import com.ruoyi.account.api.feignClient.AppUserClient;
+import com.ruoyi.account.api.model.TAppUser;
 import com.ruoyi.account.api.model.TAppUserAddress;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.web.domain.AjaxResult;
@@ -66,6 +68,8 @@
     
     @Resource
     private CouponClient couponClient;
+    @Resource
+    private AppUserClient appUserClient;
     
     @Resource
     private AppUserAddressClient appUserAddressClient;
@@ -401,6 +405,7 @@
     public AjaxResult cancelShoppingOrderWxRefund(String out_refund_no, String refund_id, String refund_status, String success_time) {
         if("SUCCESS".equals(refund_status)){
             TShoppingOrderRefund one = shoppingOrderRefundService.getOne(new LambdaQueryWrapper<TShoppingOrderRefund>().eq(TShoppingOrderRefund::getRefundCode, out_refund_no));
+            one.setRefundStatus(2);
             one.setRefundSerialNumber(refund_id);
             one.setRefundTime(LocalDateTime.parse(success_time, DateTimeFormatter.ofPattern("yyyy-MM-DDTHH:mm:ss+TIMEZONE")));
             shoppingOrderRefundService.updateById(one);
@@ -502,7 +507,30 @@
         }
         PageInfo<TShoppingOrder> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize());
         List<TShoppingOrder> list = this.baseMapper.pageList(pageInfo,query,startTime1,startTime2);
+        for (TShoppingOrder tShoppingOrder : list) {
+            tShoppingOrder.setUid(tShoppingOrder.getId().toString());
+            switch (tShoppingOrder.getOrderType()){
+                case 1:
+                    TGoods data = goodsClient.getGoodsById(tShoppingOrder.getGoodsId()).getData();
+                    if (data!=null){
+                        tShoppingOrder.setName(data.getName());
+                    }
+                    break;
+                case 2:
+                    TCoupon data1 = couponClient.getCouponById1(tShoppingOrder.getCouponId()).getData();
+                    if (data1!=null){
+                        tShoppingOrder.setName(data1.getName());
+                    }
+                    break;
+            }
+            if (tShoppingOrder.getAppUserId() != null){
+                TAppUser data = appUserClient.getUserById(tShoppingOrder.getAppUserId()).getData();
+                if (data!=null){
+                    tShoppingOrder.setPhone(data.getPhone());
+                }
+            }
 
+        }
         pageInfo.setRecords(list);
         return pageInfo;
     }

--
Gitblit v1.7.1