liding
2025-05-14 390b4243dff25a50f1d3302228e7dd16e9c2f18a
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
package com.ruoyi.purchase.controller;
 
import java.util.List;
import javax.servlet.http.HttpServletResponse;
 
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.purchase.pojo.InvoicePurchase;
import com.ruoyi.purchase.service.IInvoicePurchaseService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
 
/**
 * 发票信息Controller
 *
 * @author ruoyi
 * @date 2025-05-14
 */
@RestController
@AllArgsConstructor
@RequestMapping("/purchase/invoice")
public class InvoicePurchaseController extends BaseController {
 
    private IInvoicePurchaseService invoicePurchaseService;
 
    /**
     * 查询发票信息列表
     */
    @GetMapping("/list")
    public TableDataInfo list(InvoicePurchase invoicePurchase) {
        startPage();
        List<InvoicePurchase> list = invoicePurchaseService.selectInvoicePurchaseList(invoicePurchase);
        return getDataTable(list);
    }
 
    /**
     * 导出发票信息列表
     */
    @Log(title = "发票信息", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, InvoicePurchase invoicePurchase) {
        List<InvoicePurchase> list = invoicePurchaseService.selectInvoicePurchaseList(invoicePurchase);
        ExcelUtil<InvoicePurchase> util = new ExcelUtil<InvoicePurchase>(InvoicePurchase.class);
        util.exportExcel(response, list, "发票信息数据");
    }
 
    /**
     * 新增修改发票信息
     */
    @Log(title = "发票信息", businessType = BusinessType.INSERT)
    @PostMapping   ("/addOrUpdateInvoice")
    public AjaxResult addOrUpdateInvoice(@RequestBody InvoicePurchase invoicePurchase) {
        return toAjax(invoicePurchaseService.addOrUpdateInvoice(invoicePurchase));
    }
 
    /**
     * 删除发票信息
     */
    @Log(title = "发票信息", businessType = BusinessType.DELETE)
    @DeleteMapping("/delInvoice")
    public AjaxResult remove(@RequestBody Long[] ids) {
        return toAjax(invoicePurchaseService.delInvoice(ids));
    }
}