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();
|
}
|
}
|