| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.dto.TBillDto; |
| | | import com.ruoyi.system.model.TBill; |
| | | import com.ruoyi.system.model.TInvoice; |
| | | import com.ruoyi.system.query.TInvoiceQuery; |
| | | import com.ruoyi.system.service.TBillService; |
| | | import com.ruoyi.system.service.TInvoiceService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/t-invoice") |
| | | public class TInvoiceController { |
| | | @Autowired |
| | | private TInvoiceService invoiceService; |
| | | @Autowired |
| | | TBillService tBillService; |
| | | @PreAuthorize("@ss.hasPermi('system:invoice:list')") |
| | | @ApiOperation(value = "获取开票列表") |
| | | @PostMapping("/list") |
| | | public R<PageInfo<TInvoice>> list(@RequestBody TInvoiceQuery query) { |
| | | return R.ok(invoiceService.pageList(query)); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:invoice:delete')") |
| | | @Log(title = "开票信息-删除开票", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除开票") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public R<Boolean> deleteById(@RequestParam String id) { |
| | | return R.ok(invoiceService.removeById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "关联账单信息") |
| | | @GetMapping(value = "/getBillByInvoiceId/{invoiceId}") |
| | | public R<PageInfo<TBillDto>> getBillByInvoiceId(@PathVariable String invoiceId){ |
| | | return R.ok(tBillService.getBillByInvoiceId(invoiceId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "上传开票凭证") |
| | | @PostMapping("/uploadVoucher") |
| | | public R<Boolean> uploadVoucher(@RequestBody TInvoiceQuery query) { |
| | | TInvoice tInvoice = new TInvoice(); |
| | | tInvoice.setId(query.getId()); |
| | | tInvoice.setInvoiceVoucher(query.getInvoiceVoucher()); |
| | | tInvoice.setInvoiceVoucherName(query.getInvoiceVoucherName()); |
| | | tInvoice.setInvoiceTime(query.getInvoiceTime()); |
| | | tInvoice.setStatus(2); |
| | | return R.ok(invoiceService.updateById(tInvoice)); |
| | | } |
| | | } |
| | | |