zhangwencui
2026-10-29 b2f8320707dc72b2429bfb4fe0b317c11b1e5b7f
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package com.ruoyi.basic.controller;
 
import com.ruoyi.basic.pojo.CustomerFinancialReport;
import com.ruoyi.basic.service.CustomerFinancialReportService;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.domain.AjaxResult;
import io.swagger.v3.oas.annotations.Operation;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
 
/**
 * 客户近3年财务报表
 */
@RestController
@RequestMapping("/basic/customerFinancialReport")
@AllArgsConstructor
public class CustomerFinancialReportController {
    private final CustomerFinancialReportService customerFinancialReportService;
 
    /**
     * 后台按客户查询近3年财务报表
     */
    @Operation(summary = "查询客户近3年财务报表")
    @PreAuthorize("@ss.hasPermi('basic:customer:report')")
    @GetMapping("/list")
    public AjaxResult list(Long customerId) {
        return AjaxResult.success(customerFinancialReportService.listByCustomer(customerId));
    }
 
    /**
     * 客户账号查询自己的近3年财务报表
     */
    @Operation(summary = "查询我的财务报表")
    @PreAuthorize("@ss.hasPermi('customer:report:mine')")
    @GetMapping("/mine")
    public AjaxResult mine() {
        return AjaxResult.success(customerFinancialReportService.listMine());
    }
 
    /**
     * 上传/修改财务报表
     */
    @Operation(summary = "上传财务报表")
    @Log(title = "客户财务报表", businessType = BusinessType.UPDATE)
    @PreAuthorize("@ss.hasPermi('basic:customer:report') or @ss.hasPermi('customer:report:mine')")
    @PostMapping("/save")
    public AjaxResult save(@RequestBody CustomerFinancialReport report) {
        return AjaxResult.success(customerFinancialReportService.saveReport(report));
    }
 
    /**
     * 申报审批列表(内部人员查看所有客户的提交情况)
     */
    @Operation(summary = "申报审批列表")
    @PreAuthorize("@ss.hasPermi('sales:report:audit')")
    @GetMapping("/auditList")
    public AjaxResult auditList(String customerName, Integer reportYear, Integer auditStatus) {
        return AjaxResult.success(customerFinancialReportService.auditList(customerName, reportYear, auditStatus));
    }
 
    /**
     * 审批财务报表(1通过 2退回)
     */
    @Operation(summary = "审批财务报表")
    @Log(title = "客户财务报表", businessType = BusinessType.UPDATE)
    @PreAuthorize("@ss.hasPermi('sales:report:audit')")
    @PostMapping("/audit")
    public AjaxResult audit(@RequestBody CustomerFinancialReport report) {
        return AjaxResult.success(customerFinancialReportService.auditReport(
                report.getId(), report.getAuditStatus(), report.getAuditRemark()));
    }
 
    /**
     * 删除财务报表(客户账号不可删除)
     */
    @Operation(summary = "删除财务报表")
    @Log(title = "客户财务报表", businessType = BusinessType.DELETE)
    @PreAuthorize("@ss.hasPermi('basic:customer:report')")
    @DeleteMapping("/{id}")
    public AjaxResult remove(@PathVariable Long id) {
        customerFinancialReportService.deleteReport(id);
        return AjaxResult.success();
    }
}