|
@@ -1,16 +1,15 @@
|
|
|
package com.kym.admin.controller;
|
|
package com.kym.admin.controller;
|
|
|
|
|
|
|
|
import com.kym.common.R;
|
|
import com.kym.common.R;
|
|
|
-import com.kym.entity.queryParams.SplitRecordQueryParams;
|
|
|
|
|
-import com.kym.entity.queryParams.StationQueryParam;
|
|
|
|
|
-import com.kym.entity.queryParams.WithdrawnQueryParam;
|
|
|
|
|
|
|
+import com.kym.common.annotation.SysLog;
|
|
|
|
|
+import com.kym.entity.queryParams.*;
|
|
|
|
|
+import com.kym.service.RefundLogService;
|
|
|
import com.kym.service.SplitRecordService;
|
|
import com.kym.service.SplitRecordService;
|
|
|
import com.kym.service.StationAccountService;
|
|
import com.kym.service.StationAccountService;
|
|
|
import com.kym.service.WithdrawnRecordService;
|
|
import com.kym.service.WithdrawnRecordService;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
+import com.kym.service.wechat.WxPayService;
|
|
|
|
|
+import jakarta.validation.Valid;
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 财务
|
|
* 财务
|
|
@@ -26,10 +25,17 @@ public class FinanceController {
|
|
|
private final StationAccountService stationAccountService;
|
|
private final StationAccountService stationAccountService;
|
|
|
private final WithdrawnRecordService withdrawnRecordService;
|
|
private final WithdrawnRecordService withdrawnRecordService;
|
|
|
|
|
|
|
|
- public FinanceController(SplitRecordService splitRecordService, StationAccountService stationAccountService, WithdrawnRecordService withdrawnRecordService) {
|
|
|
|
|
|
|
+ private final WxPayService wxPayService;
|
|
|
|
|
+
|
|
|
|
|
+ private final RefundLogService refundLogService;
|
|
|
|
|
+
|
|
|
|
|
+ public FinanceController(SplitRecordService splitRecordService, StationAccountService stationAccountService,
|
|
|
|
|
+ WithdrawnRecordService withdrawnRecordService, WxPayService wxPayService, RefundLogService refundLogService) {
|
|
|
this.splitRecordService = splitRecordService;
|
|
this.splitRecordService = splitRecordService;
|
|
|
this.stationAccountService = stationAccountService;
|
|
this.stationAccountService = stationAccountService;
|
|
|
this.withdrawnRecordService = withdrawnRecordService;
|
|
this.withdrawnRecordService = withdrawnRecordService;
|
|
|
|
|
+ this.wxPayService = wxPayService;
|
|
|
|
|
+ this.refundLogService = refundLogService;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -102,4 +108,45 @@ public class FinanceController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理用户退款
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param refundLogId
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @SysLog("处理用户微信退款")
|
|
|
|
|
+ @GetMapping("/customWxRefund/{refundLogId}")
|
|
|
|
|
+ R<?> customWxRefund(@PathVariable("refundLogId") long refundLogId) {
|
|
|
|
|
+ wxPayService.wxRefund(refundLogId);
|
|
|
|
|
+ return R.success();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 退款记录列表
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param params
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @SysLog("退款记录列表")
|
|
|
|
|
+ @GetMapping("/listRefundLog")
|
|
|
|
|
+ public R<?> listRefundLog(@ModelAttribute CommonQueryParam params) {
|
|
|
|
|
+ return R.success(refundLogService.listRefundLog(params));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理用户退款
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param param
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @SysLog("用户退款申请")
|
|
|
|
|
+ @PostMapping("/applyRefund")
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ R<?> wxAppRefund(@Valid @RequestBody RefundParam param) {
|
|
|
|
|
+ wxPayService.applyWxRefund(param.getUserId(), param.getReason());
|
|
|
|
|
+ return R.success();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|