|
@@ -2,13 +2,16 @@ package com.etotem.cfc.controller.admin;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.etotem.cfc.common.Result;
|
|
import com.etotem.cfc.common.Result;
|
|
|
|
|
+import com.etotem.cfc.entity.PendingRefund;
|
|
|
import com.etotem.cfc.entity.Product;
|
|
import com.etotem.cfc.entity.Product;
|
|
|
import com.etotem.cfc.entity.WithdrawalRequest;
|
|
import com.etotem.cfc.entity.WithdrawalRequest;
|
|
|
import com.etotem.cfc.mapper.ProductMapper;
|
|
import com.etotem.cfc.mapper.ProductMapper;
|
|
|
|
|
+import com.etotem.cfc.service.PendingRefundService;
|
|
|
import com.etotem.cfc.service.WithdrawalService;
|
|
import com.etotem.cfc.service.WithdrawalService;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
@@ -18,6 +21,9 @@ public class AdminCommissionController {
|
|
|
@Resource
|
|
@Resource
|
|
|
private WithdrawalService withdrawalService;
|
|
private WithdrawalService withdrawalService;
|
|
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private PendingRefundService pendingRefundService;
|
|
|
|
|
+
|
|
|
@Resource
|
|
@Resource
|
|
|
private ProductMapper productMapper;
|
|
private ProductMapper productMapper;
|
|
|
|
|
|
|
@@ -71,4 +77,19 @@ public class AdminCommissionController {
|
|
|
productMapper.updateById(product);
|
|
productMapper.updateById(product);
|
|
|
return Result.success("设置成功");
|
|
return Result.success("设置成功");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping("/refunds/pending")
|
|
|
|
|
+ public Result<Page<PendingRefund>> pendingRefunds(@RequestBody Map<String, Object> params) {
|
|
|
|
|
+ String status = (String) params.get("status");
|
|
|
|
|
+ int page = params.get("page") != null ? ((Number) params.get("page")).intValue() : 1;
|
|
|
|
|
+ int size = params.get("size") != null ? ((Number) params.get("size")).intValue() : 20;
|
|
|
|
|
+ return Result.success(pendingRefundService.getAllPendingRefunds(status, page, size));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping("/refunds/summary")
|
|
|
|
|
+ public Result<Map<String, Object>> refundSummary() {
|
|
|
|
|
+ Map<String, Object> summary = new HashMap<>();
|
|
|
|
|
+ summary.put("totalPendingAmount", pendingRefundService.getTotalPendingAmount());
|
|
|
|
|
+ return Result.success(summary);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|