chenrui
2025-05-13 fe1845ba21d8e9908077ab0bb5a9a8137942a50b
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
package com.ruoyi.sales.controller;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.basic.dto.SupplierManageDto;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.sales.dto.InvoiceLedgerDto;
import com.ruoyi.sales.service.InvoiceLedgerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
 
import javax.servlet.http.HttpServletResponse;
import java.util.List;
 
@RestController
@RequestMapping("/invoiceLedger")
public class InvoiceLedgerController {
 
    @Autowired
    private InvoiceLedgerService invoiceLedgerService;
 
    /**
     * 开票台账新增
     * @param invoiceLedgerDto
     * @return
     */
    @PostMapping("/saveOrUpdate")
    public AjaxResult invoiceLedgerSaveOrUpdate(@RequestBody InvoiceLedgerDto invoiceLedgerDto) {
        invoiceLedgerService.invoiceLedgerSaveOrUpdate(invoiceLedgerDto);
        return AjaxResult.success();
    }
 
    /**
     * 开票台账删除
     * @param ids
     * @return
     */
    @DeleteMapping("/del")
    public AjaxResult invoiceLedgerDel(@RequestBody List<Integer> ids) {
        invoiceLedgerService.invoiceLedgerDel(ids);
        return AjaxResult.success();
    }
 
    /**
     * 开票台账分页查询
     * @param page
     * @param invoiceLedgerDto
     * @return
     */
    @GetMapping("/page")
    public AjaxResult invoiceLedgerPage(Page page, InvoiceLedgerDto invoiceLedgerDto) {
        return AjaxResult.success(invoiceLedgerService.invoiceLedgerPage(page, invoiceLedgerDto));
    }
 
    /**
     * 开票台账文件查询
     * @param invoiceLedgerId
     * @return
     */
    @GetMapping("/fileList")
    public AjaxResult invoiceLedgerFileList(Integer invoiceLedgerId) {
        return AjaxResult.success(invoiceLedgerService.invoiceLedgerFileList(invoiceLedgerId));
    }
 
    /**
     * 开票台账文件上传
     * @param file
     * @return
     */
    @PostMapping("/uploadFile")
    public AjaxResult invoiceLedgerUploadFile(MultipartFile file) {
        try {
            return AjaxResult.success(invoiceLedgerService.invoiceLedgerUploadFile(file));
        }catch (Exception e) {
            return AjaxResult.error(e.getMessage());
        }
    }
 
    /**
     * 开票台账导出
     * @param response
     * @param invoiceLedgerDto
     * @return
     */
    @PostMapping("/export")
    public void invoiceLedgerExport(HttpServletResponse response, InvoiceLedgerDto invoiceLedgerDto) {
        invoiceLedgerService.invoiceLedgerExport(response, invoiceLedgerDto);
    }
 
    /**
     * 开票台账详情
     * @param id
     * @return
     */
    @GetMapping("/info")
    public AjaxResult invoiceLedgerInfo(Integer id) {
        return AjaxResult.success(invoiceLedgerService.invoiceLedgerDetail(id));
    }
 
    /**
     * 文件提交
     * @param invoiceLedgerDto
     * @return
     */
    @PostMapping("/commitFile")
    public AjaxResult invoiceLedgerCommitFile(@RequestBody InvoiceLedgerDto invoiceLedgerDto) {
        try {
            invoiceLedgerService.invoiceLedgerCommitFile(invoiceLedgerDto);
            return AjaxResult.success();
        }catch (Exception e) {
            return AjaxResult.error(e.getMessage());
        }
    }
}