无关风月
2024-09-27 f27f3a1da27ff11e3c12dc1841094a0419a4279a
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java
@@ -1,4 +1,5 @@
package com.ruoyi.order.controller;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@@ -19,6 +20,8 @@
import com.ruoyi.order.api.query.ShoppingOrderQuery;
import com.ruoyi.order.dto.*;
import com.ruoyi.order.service.TShoppingOrderService;
import com.ruoyi.other.api.domain.TCoupon;
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;
@@ -60,6 +63,16 @@
   private GoodsClient goodsClient;
   @Resource
   private CouponClient couponClient;
   @Resource
   private TokenService tokenService;
   @Resource
   private AliPaymentClient aliPaymentClient;
   @Resource
   private WxPaymentClient wxPaymentClient;
   @Resource
   private AppCouponClient appCouponClient;
   @Resource
   private SysUserClient sysUserClient;
   @PostMapping("/getShoppingOrderList")
@@ -84,8 +97,7 @@
      PageInfo<TShoppingOrder> res = shoppingOrderService.pageList(query);
      return AjaxResult.success(res);
   }
   @Resource
   private SysUserClient sysUserClient;
   @GetMapping("/getShoppingOrderInfoById")
   @ApiOperation(value = "根据订单id查看订单详情", tags = {"管理后台-购物订单"})
   public AjaxResult<TShoppingOrder> getShoppingOrderList(String id) {
@@ -109,22 +121,27 @@
            byId.setReceivingAddress(data.getAddress());
         }
      }
      if (byId.getOrderType()==1){
         TGoods data = goodsClient.getGoodsById(byId.getGoodsId()).getData();
         if (data!=null){
            byId.setName(data.getName());
         }
      }else {
       TCoupon data = couponClient.getCouponById1(byId.getCouponId()).getData();
       if (data!=null){
          byId.setName(data.getName());
       }
      }
      return AjaxResult.success(byId);
   }
   @GetMapping("/deleteShoppingOrder")
   @ApiOperation(value = "批量删除订单", tags = {"管理后台-购物订单"})
   public AjaxResult<TShoppingOrder> deleteShoppingOrder(String ids) {
      shoppingOrderService.removeBatchByIds(Arrays.asList(ids.split(",")));
      return AjaxResult.success();
   }
   @Resource
   private TokenService tokenService;
   @Resource
   private AliPaymentClient aliPaymentClient;
   @Resource
   private WxPaymentClient wxPaymentClient;
   @Resource
   private AppCouponClient appCouponClient;
   @GetMapping("/cancelShoppingOrder")
   @ApiOperation(value = "取消订单", tags = {"管理后台-购物订单"})
   public AjaxResult cancelShoppingOrder(String id) {
@@ -179,6 +196,7 @@
      shoppingOrderService.updateById(byId);
      return AjaxResult.success();
   }
   @GetMapping("/consignerShoppingOrder")
   @ApiOperation(value = "发货", tags = {"管理后台-购物订单"})
   public AjaxResult consignerShoppingOrder(String id,String companyName,String code) {
@@ -192,6 +210,7 @@
      shoppingOrderService.updateById(byId);
      return AjaxResult.success();
   }
   @GetMapping("/getMyShoppingOrderList")
   @ApiOperation(value = "获取购买订单列表", tags = {"小程序-商城购买订单"})
   public AjaxResult<Map<String, Object>> getMyShoppingOrderList(GetMyShoppingOrderList query){
@@ -217,14 +236,12 @@
   }
   
   @GetMapping("/getMyShoppingOrderInfo/{id}")
   @ApiOperation(value = "获取购买订单详情", tags = {"小程序-商城购买订单","管理后台-支付订单-订单信息"})
   public AjaxResult<MyShoppingOrderInfo> getMyShoppingOrderInfo(@PathVariable String id){
      MyShoppingOrderInfo info = shoppingOrderService.getMyShoppingOrderInfo(id);
      return AjaxResult.success(info);
   }
   
   
   @PutMapping("/confirmReceipt/{id}")
@@ -266,7 +283,6 @@
         shoppingOrderService.cancelShoppingOrderWxRefund(out_refund_no, refund_id, tradeState, success_time);
      }
   }
   
   
   @ResponseBody