igl 2 months ago
parent
commit
e6debb6a5e

+ 15 - 4
src/main/java/com/chelvc/cloud/maintain/controller/AssetController.java

@@ -2,6 +2,7 @@ package com.chelvc.cloud.maintain.controller;
 
 import com.chelvc.cloud.vehicle.client.AssetClient;
 import com.chelvc.cloud.vehicle.client.dto.MerchantAssetDTO;
+import com.chelvc.cloud.vehicle.client.param.SxyNotifyParam;
 import com.chelvc.cloud.vehicle.client.param.TransferNotifyParam;
 import com.chelvc.cloud.vehicle.client.param.WithdrawNotifyParam;
 import com.chelvc.cloud.vehicle.client.param.WithdrawParam;
@@ -13,6 +14,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
+
 /**
  * 资产管理
  *
@@ -43,8 +46,8 @@ public class AssetController {
      * @param param
      */
     @PutMapping("/asset/withdraw")
-    public void withdraw(@RequestBody WithdrawParam param) {
-        this.assetClient.withdraw(param);
+    public void withdrawApply(@RequestBody WithdrawParam param) {
+        this.assetClient.withdrawApply(param);
     }
 
     /**
@@ -53,7 +56,11 @@ public class AssetController {
      */
     @PostMapping("/asset/withdraw/notify")
     @Authorize(enabled = false)
-    public void withdrawNotify(@RequestBody WithdrawNotifyParam param) {
+    public void withdrawNotify(HttpServletRequest request, @RequestBody SxyNotifyParam param) {
+        String merchantId = request.getHeader("merchantId");
+        String encryptKey = request.getHeader("encryptKey");
+        param.setMerchantId(merchantId);
+        param.setEncryptKey(encryptKey);
         this.assetClient.withdrawNotify(param);
     }
 
@@ -63,7 +70,11 @@ public class AssetController {
      */
     @PostMapping("/asset/transfer/notify")
     @Authorize(enabled = false)
-    public void transferNotify(@RequestBody TransferNotifyParam param) {
+    public void transferNotify(HttpServletRequest request, @RequestBody SxyNotifyParam param) {
+        String merchantId = request.getHeader("merchantId");
+        String encryptKey = request.getHeader("encryptKey");
+        param.setMerchantId(merchantId);
+        param.setEncryptKey(encryptKey);
         this.assetClient.transferNotify(param);
     }
 }

+ 24 - 0
src/main/java/com/chelvc/cloud/maintain/controller/OmsOrderController.java

@@ -8,6 +8,7 @@ import com.chelvc.cloud.vehicle.client.dto.OmsOrderDetailDTO;
 import com.chelvc.cloud.vehicle.client.dto.OmsOrderReturnApplyDTO;
 import com.chelvc.cloud.vehicle.client.param.OmsOrderModifyParam;
 import com.chelvc.cloud.vehicle.client.param.OrderPagingParam;
+import com.chelvc.cloud.vehicle.client.param.OrderRefundParam;
 import com.chelvc.cloud.vehicle.client.param.SxyNotifyParam;
 import com.chelvc.framework.base.annotation.ResponseWrapping;
 import com.chelvc.framework.common.model.Pagination;
@@ -215,4 +216,27 @@ public class OmsOrderController {
         param.setEncryptKey(encryptKey);
         this.omsOrderClient.orderNotify(param);
     }
+
+    /**
+     * 退款申请
+     * @param param 参数
+     * @return
+     */
+    @PostMapping("/order/refund")
+    public void orderRefund(@RequestBody OrderRefundParam param) {
+         this.omsOrderClient.orderRefund(param);
+    }
+
+    /**
+     * 退款申请回调
+     * @return
+     */
+    @PostMapping("/order/refund/notify")
+    public void orderRefundNotify(HttpServletRequest request, @RequestBody SxyNotifyParam param) {
+        String merchantId = request.getHeader("merchantId");
+        String encryptKey = request.getHeader("encryptKey");
+        param.setMerchantId(merchantId);
+        param.setEncryptKey(encryptKey);
+        this.omsOrderClient.orderRefundNotify(param);
+    }
 }