fei.wang
2024-05-13 19fe5a3d816184549e8ffa011c39f218734da8d5
src/main/java/com/flow/controller/InvoicesController.java
对比新文件
@@ -0,0 +1,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;
    }
}