chenrui
2 天以前 3e03f3d957c44ff2e4909b9fb4fff8621d466d10
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
package com.ruoyi.sales.controller;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.purchase.dto.InvoicePurchaseDto;
import com.ruoyi.sales.dto.ReceiptPaymentDto;
import com.ruoyi.sales.pojo.ReceiptPayment;
import com.ruoyi.sales.service.ReceiptPaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.math.BigDecimal;
import java.util.List;
 
@RestController
@RequestMapping("/receiptPayment")
public class ReceiptPaymentController extends BaseController {
 
    @Autowired
    private ReceiptPaymentService receiptPaymentService;
 
    /**
     * 回款登记新增
     * @param receiptPayment
     * @return
     */
    @PostMapping("/saveOrUpdate")
    public AjaxResult receiptPaymentSaveOrUpdate (@RequestBody ReceiptPayment receiptPayment) {
        receiptPaymentService.receiptPaymentSaveOrUpdate(receiptPayment);
        return AjaxResult.success();
    }
 
    /**
     * 回款登记修改
     * @param receiptPayment
     * @return
     */
    @PostMapping("/update")
    public AjaxResult receiptPaymentUpdate (@RequestBody ReceiptPayment receiptPayment) {
        return AjaxResult.success(receiptPaymentService.receiptPaymentUpdate(receiptPayment));
    }
 
    /**
     * 回款登记删除
     * @param ids
     * @return
     */
    @DeleteMapping("/del")
    public AjaxResult receiptPaymentDel (@RequestBody List<Integer> ids) {
        return AjaxResult.success(receiptPaymentService.receiptPaymentDel(ids));
    }
 
    /**
     * 回款登记分页查询
     * @param page
     * @param receiptPaymentDto
     * @return
     */
    @GetMapping("/listPage")
    public AjaxResult receiptPaymentListPage (Page page, ReceiptPaymentDto receiptPaymentDto) {
        return AjaxResult.success(receiptPaymentService.receiptPaymentListPage(page,receiptPaymentDto));
    }
 
    /**
     * 回款登记详情
     * @param id
     * @return
     */
    @GetMapping("/info")
    public AjaxResult receiptPaymentInfo (Integer id) {
        return AjaxResult.success(receiptPaymentService.receiptPaymentInfo(id));
    }
 
    /**
     * 本月回款金额
     */
    @GetMapping("/getReceiptAmount")
    public AjaxResult getReceiptAmount() {
        try {
            BigDecimal receiptAmount = receiptPaymentService.getReceiptAmount();
            return AjaxResult.success(receiptAmount != null ? receiptAmount : BigDecimal.ZERO);
        } catch (Exception e) {
            return AjaxResult.error("获取回款金额失败:" + e.getMessage());
        }
    }
 
    /**
     * 查询已经绑定发票的开票台账
     * @param page
     * @param receiptPaymentDto
     * @return
     */
    @GetMapping("/bindInvoiceNoRegPage")
    public AjaxResult bindInvoiceNoRegPage(Page page, ReceiptPaymentDto receiptPaymentDto) {
        return AjaxResult.success(receiptPaymentService.bindInvoiceNoRegPage(page,receiptPaymentDto));
    }
 
    /**
     * 开票台账详情
     * @param id
     * @return
     */
    @GetMapping("/invoiceInfo")
    public AjaxResult invoiceInfo (Integer id) {
        return AjaxResult.success(receiptPaymentService.invoiceInfo(id));
    }
 
    /**
     * 本月应收,回款金额
     */
    @GetMapping("/getAmountMouth")
    public AjaxResult getAmountMouth() {
        return  AjaxResult.success(receiptPaymentService.getAmountMouth());
    }
 
    /**
     * 查询回款记录
     */
    @GetMapping("/receiptPaymentHistoryList")
    public TableDataInfo receiptPaymentHistoryList(ReceiptPaymentDto receiptPaymentDto) {
        startPage();
        List<ReceiptPaymentDto> list = receiptPaymentService.receiptPaymentHistoryList(receiptPaymentDto);
        return getDataTable(list);
    }
 
    /**
     * 查询回款记录
     */
    @GetMapping("/receiptPaymentHistoryListPage")
    public IPage<ReceiptPaymentDto> receiptPaymentHistoryListPage(Page page, ReceiptPaymentDto receiptPaymentDto) {
        return receiptPaymentService.receiptPaymentHistoryListPage(page,receiptPaymentDto);
    }
}