| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.sales.dto.InvoiceLedgerDto; |
| | | import com.ruoyi.sales.dto.InvoiceRegistrationProductDto; |
| | | import com.ruoyi.sales.mapper.InvoiceLedgerFileMapper; |
| | | import com.ruoyi.sales.mapper.InvoiceRegistrationProductMapper; |
| | | import com.ruoyi.sales.pojo.InvoiceRegistrationProduct; |
| | | import com.ruoyi.sales.service.InvoiceLedgerService; |
| | | import io.jsonwebtoken.lang.Collections; |
| | | 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.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | |
| | | |
| | | @Autowired |
| | | private InvoiceRegistrationProductMapper invoiceRegistrationProductMapper; |
| | | |
| | | @Autowired |
| | | private InvoiceLedgerFileMapper invoiceLedgerFileMapper; |
| | | |
| | | /** |
| | | * 开票台账新增 |
| | |
| | | public AjaxResult invoiceLedgerFileList(Integer invoiceLedgerId) { |
| | | return AjaxResult.success(invoiceLedgerService.invoiceLedgerFileList(invoiceLedgerId)); |
| | | } |
| | | |
| | | /** |
| | | * 开票台账文件删除 |
| | | */ |
| | | @DeleteMapping("/delFile") |
| | | @Log(title = "开票台账", businessType = BusinessType.DELETE) |
| | | public AjaxResult invoiceLedgerDelFile(@RequestBody List<Integer> ids) { |
| | | if(Collections.isEmpty(ids)) return AjaxResult.error("请选择要删除的文件"); |
| | | invoiceLedgerFileMapper.deleteBatchIds(ids); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 开票台账文件上传 |
| | |
| | | */ |
| | | @GetMapping("/registrationProductPage") |
| | | public AjaxResult registrationProductPage(Page page, InvoiceRegistrationProductDto registrationProductDto) { |
| | | |
| | | return AjaxResult.success(invoiceLedgerService.registrationProductPage(page,registrationProductDto)); |
| | | } |
| | | |
| | |
| | | return AjaxResult.success(invoiceLedgerService.invoiceLedgerProductDetail(id)); |
| | | } |
| | | |
| | | /** |
| | | * 开票台账删除 |
| | | * @param invoiceRegistrationProductId |
| | | * @return |
| | | */ |
| | | @DeleteMapping("delInvoiceLedger/{invoiceRegistrationProductId}") |
| | | public AjaxResult delInvoiceLedger(@PathVariable Integer invoiceRegistrationProductId) { |
| | | try { |
| | | invoiceLedgerService.delInvoiceLedger(invoiceRegistrationProductId); |
| | | return AjaxResult.success(); |
| | | }catch (Exception e) { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | } |