fei.wang
2024-05-13 b9b58b9ef261cb290d93465f88a2cbd814b576f0
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
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
 
package com.flow.controller;
 
import com.flow.pojo.Company;
import com.flow.pojo.Invoices;
import com.flow.service.CompanyService;
import com.flow.service.InvoicesSevice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
@RestController
@RequestMapping({"/hxzk"})
public class InvoicesController {
    @Autowired
    InvoicesSevice invoicesSevice;
    @Autowired
    CompanyService companyService;
 
    public InvoicesController() {
    }
 
    @PostMapping({"Invoices"})
    public Invoices findInvoices(Invoices invoices) throws Exception {
        return this.invoicesSevice.findInvoices(invoices);
    }
 
    @PostMapping({"Invoicess"})
    public Company findInvoicess(Invoices invoices) throws Exception {
        return this.companyService.findC(invoices.getCompany());
    }
 
    @PostMapping({"InvoicesAdd"})
    public int findInvoicesAdd(Invoices invoices) {
        int exis = this.invoicesSevice.findInvoicesChong(invoices);
        int shu;
        if (exis == 0) {
            shu = this.invoicesSevice.findInvoicesAdd(invoices);
        } else {
            shu = this.invoicesSevice.updateInvoices(invoices);
        }
 
        return shu;
    }
}