From c6731159f3adabf8502055152398e2f4c6f5b2df Mon Sep 17 00:00:00 2001 From: luodangjia <luodangjia> Date: 星期五, 27 九月 2024 09:11:19 +0800 Subject: [PATCH] 9.24 --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-) diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java index b3d35ca..5508963 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java @@ -19,6 +19,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; @@ -86,7 +88,7 @@ } @Resource private SysUserClient sysUserClient; - @PostMapping("/getShoppingOrderInfoById") + @GetMapping("/getShoppingOrderInfoById") @ApiOperation(value = "根据订单id查看订单详情", tags = {"管理后台-购物订单"}) public AjaxResult<TShoppingOrder> getShoppingOrderList(String id) { TShoppingOrder byId = shoppingOrderService.getById(id); @@ -108,6 +110,17 @@ byId.setReceivingName(data.getName()+"-"+data.getPhone()); 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); } @@ -144,6 +157,9 @@ // todo 部署到线上之后写回调地址 // wxPaymentRefundModel.setNotify_url(""); String string = byId.getPaymentAmount().multiply(new BigDecimal("100")).toString(); + if (string.contains(".")){ + string = string.substring(0,string.indexOf(".")); + } int i = Integer.parseInt(string); WxPaymentRefundModel.RefundAmount refundAmount = new WxPaymentRefundModel.RefundAmount(); refundAmount.setTotal(i); @@ -277,6 +293,7 @@ @PostMapping("/create") public R<TShoppingOrder> shopCreate(@RequestBody ExchangeDto exchangeDto){ TShoppingOrder shoppingOrder = new TShoppingOrder(); + shoppingOrder.setTitle(exchangeDto.getTitle()); shoppingOrder.setCode(OrderCodeUtil.getOrderCode("GW")); shoppingOrder.setAppUserId(exchangeDto.getUserId()); shoppingOrder.setOrderType(exchangeDto.getGoodType()); @@ -299,6 +316,7 @@ shoppingOrder.setPaymentType(exchangeDto.getPayMethod()); shoppingOrder.setRemark(exchangeDto.getRemark()); shoppingOrder.setStatus(1); + shoppingOrder.setPhone(exchangeDto.getPhone()); shoppingOrder.setCreateTime(LocalDateTime.now()); shoppingOrder.setDelFlag(false); shoppingOrderService.save(shoppingOrder); -- Gitblit v1.7.1