yeg
2026-09-16 3a024caa497b8923635c02e0c8c0df07f2918f81
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.talentcard.server.business.admin;
 
import java.util.Map;
 
import com.talentcard.server.business.PageResult;
import com.talentcard.server.common.ApiResponse;
import com.talentcard.server.service.MerchantSettlementStatisticsService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
@Tag(name = "后台-商户对账统计", description = "后台按商户查询日/月交易额、政府补贴额和应结算额")
@RestController
@RequestMapping("/api/admin/merchant-settlement-statistics")
public class MerchantSettlementStatisticsAdminController {
    private final MerchantSettlementStatisticsService service;
 
    public MerchantSettlementStatisticsAdminController(MerchantSettlementStatisticsService service) {
        this.service = service;
    }
 
    @Operation(summary = "查询商户对账汇总列表", description = "按日或月、按商户汇总已支付且已核销订单;补贴额仅统计政府承担补贴")
    @GetMapping("/summaries")
    public ApiResponse<PageResult<Map<String, Object>>> summaries(
            @Parameter(description = "商户ID") @RequestParam(required = false) Long merchantId,
            @Parameter(description = "商户类型") @RequestParam(required = false) String merchantType,
            @Parameter(description = "统计周期:DAY日汇总,MONTH月汇总") @RequestParam(defaultValue = "DAY") String periodType,
            @Parameter(description = "开始日期,支持yyyy-MM-dd或yyyy-MM") @RequestParam(required = false) String startDate,
            @Parameter(description = "结束日期,支持yyyy-MM-dd或yyyy-MM") @RequestParam(required = false) String endDate,
            @Parameter(description = "页码") @RequestParam(defaultValue = "1") int page,
            @Parameter(description = "每页条数") @RequestParam(defaultValue = "10") int size
    ) {
        return ApiResponse.success(service.summaries(merchantId, merchantType, periodType, startDate, endDate, page, size));
    }
 
    @Operation(summary = "查询商户对账总览", description = "按筛选条件汇总每个商户的交易额、政府补贴额和应结算额")
    @GetMapping("/overview")
    public ApiResponse<Map<String, Object>> overview(
            @Parameter(description = "商户ID") @RequestParam(required = false) Long merchantId,
            @Parameter(description = "商户类型") @RequestParam(required = false) String merchantType,
            @Parameter(description = "开始日期,支持yyyy-MM-dd或yyyy-MM") @RequestParam(required = false) String startDate,
            @Parameter(description = "结束日期,支持yyyy-MM-dd或yyyy-MM") @RequestParam(required = false) String endDate
    ) {
        return ApiResponse.success(service.overview(merchantId, merchantType, startDate, endDate));
    }
}