jinshihui 3 dni temu
rodzic
commit
a43bbaac03

+ 14 - 4
nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/AfterSaleOrderController.java

@@ -44,8 +44,13 @@ public class AfterSaleOrderController {
     @Log(title = "发起售后", businessType = BusinessType.INSERT)
     @PostMapping
     public R add(@Validated @RequestBody AfterSaleOrderDTO dto) {
-        this.afterSaleOrderService.add(dto);
-        return R.ok();
+        try {
+            afterSaleOrderService.add(dto);
+            return R.ok();
+        } catch (Exception e) {
+            log.error("发起售后失败", e);
+            return R.fail("发起售后失败");
+        }
     }
 
     /**
@@ -102,8 +107,13 @@ public class AfterSaleOrderController {
     @Log(title = "同意退款", businessType = BusinessType.UPDATE)
     @PutMapping("/agree/refund/{orderId}")
     public R agreeRefund(@PathVariable Long orderId) {
-        this.afterSaleOrderService.agreeRefund(orderId);
-        return R.ok();
+        try {
+            this.afterSaleOrderService.agreeRefund(orderId);
+            return R.ok();
+        } catch (Exception e) {
+            log.error("同意退款申请失败", e);
+            return R.fail("同意退款申请失败", e.getMessage());
+        }
     }
 
     @ApiOperation("商家确认收货")

+ 6 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/domain/vo/ProductInfoVo.java

@@ -3,6 +3,7 @@ package com.ylx.massage.domain.vo;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * 商品信息VO
@@ -36,4 +37,9 @@ public class ProductInfoVo implements Serializable {
      * 商品的付款类型(1:积分 2:金额 3:积分+金额)
      */
     private Integer paymentType;
+
+    /**
+     * 商品的服务承诺
+     */
+    private List<String> servicePromise;
 }

+ 1 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/service/impl/AfterSaleOrderServiceImpl.java

@@ -328,6 +328,7 @@ public class AfterSaleOrderServiceImpl extends ServiceImpl<AfterSaleOrderMapper,
         }
         // TODO 5.退款
 
+
         // 6. 更新售后单数据
         afterSaleOrder.setAfterSaleStatus(AfterSaleStatusEnum.REFUND_COMPLETED.getCode());
         afterSaleOrder.setUpdateTime(LocalDateTime.now());

+ 1 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/service/impl/ProductOrderInfoServiceImpl.java

@@ -382,6 +382,7 @@ public class ProductOrderInfoServiceImpl extends ServiceImpl<ProductOrderInfoMap
         if (product != null) {
             productInfo.setPaymentType(product.getPaymentType());
         }
+        productInfo.setServicePromise(product.getServicePromise());
         return productInfo;
     }