zss
7 天以前 83abd7b427e84f6813e1a017912cf61676103316
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
package com.ruoyi.account.controller.sales;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.account.bean.dto.sales.AccountSalesInvoiceDto;
import com.ruoyi.account.bean.vo.sales.AccountSalesInvoiceVo;
import com.ruoyi.account.pojo.sales.AccountSalesInvoice;
import com.ruoyi.account.service.sales.AccountSalesInvoiceService;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.domain.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
 
import java.util.Arrays;
 
/**
 * <p>
 * 财务管理--销项发票 前端控制器
 * </p>
 *
 * @author 芯导软件(江苏)有限公司
 * @since 2026-05-18 03:10:20
 */
@RestController
@RequestMapping("/accountSalesInvoice")
@Tag(name = "财务管理--销项发票")
@RequiredArgsConstructor
public class AccountSalesInvoiceController {
 
    private final AccountSalesInvoiceService accountSalesInvoiceService;
 
    @GetMapping("/listPageAccountSalesInvoice")
    @Log(title = "销项发票台账", businessType = BusinessType.OTHER)
    @Operation(summary = "财务管理--销项发票台账")
    public R<IPage<AccountSalesInvoiceVo>> listPageAccountSalesInvoice(Page page, AccountSalesInvoiceDto accountSalesInvoiceDto) {
        IPage<AccountSalesInvoiceVo> listPage = accountSalesInvoiceService.listPageAccountSalesInvoice(page,accountSalesInvoiceDto);
        return R.ok(listPage);
    }
 
    @PostMapping("/addAccountSalesInvoice")
    @Log(title = "新增销项发票", businessType = BusinessType.INSERT)
    @Operation(summary = "财务管理--新增销项发票")
    public R addAccountSalesInvoice(@RequestBody AccountSalesInvoice accountSalesInvoice) {
        return R.ok(accountSalesInvoiceService.save(accountSalesInvoice));
    }
 
    @PutMapping("/cancelAccountSalesInvoice")
    @Log(title = "作废销项发票", businessType = BusinessType.INSERT)
    @Operation(summary = "财务管理--作废销项发票")
    public R cancelAccountSalesInvoice(@RequestBody AccountSalesInvoice accountSalesInvoice) {
        return R.ok(accountSalesInvoiceService.updateById(accountSalesInvoice));
    }
 
    @DeleteMapping("/deleteAccountSalesInvoice")
    @Log(title = "删除销项发票", businessType = BusinessType.DELETE)
    @Operation(summary = "财务管理--删除销项发票")
    public R deleteAccountSalesInvoice(@RequestParam("ids") Long[] ids) {
        return R.ok(accountSalesInvoiceService.deleteAccountSalesInvoice(Arrays.asList(ids)));
    }
 
    @PostMapping("/exportAccountSalesInvoice")
    @Operation(summary = "导出销项发票文件")
    @Log(title = "导出销项发票文件", businessType = BusinessType.EXPORT)
    public void exportAccountSalesInvoice(HttpServletResponse response, AccountSalesInvoiceDto accountSalesInvoiceDto) {
        accountSalesInvoiceService.exportAccountSalesInvoice(response,accountSalesInvoiceDto);
    }
 
}