| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.purchase.dto.InvoicePurchaseDto; |
| | | import com.ruoyi.purchase.pojo.InvoicePurchase; |
| | | import com.ruoyi.purchase.service.IInvoicePurchaseService; |
| | | import com.ruoyi.sales.service.ICommonFileService; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | |
| | | */ |
| | | @Log(title = "发票信息", businessType = BusinessType.INSERT) |
| | | @PostMapping("/addOrUpdateInvoice") |
| | | public AjaxResult addOrUpdateInvoice(@RequestBody InvoicePurchaseDto invoicePurchaseDto) throws IOException { |
| | | return toAjax(invoicePurchaseService.addOrUpdateInvoice(invoicePurchaseDto)); |
| | | public R<?> addOrUpdateInvoice(@RequestBody InvoicePurchaseDto invoicePurchaseDto) throws IOException { |
| | | invoicePurchaseService.addOrUpdateInvoice(invoicePurchaseDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Log(title = "发票信息", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/delInvoice") |
| | | public AjaxResult remove(@RequestBody Long[] ids) { |
| | | return toAjax(invoicePurchaseService.delInvoice(ids)); |
| | | public R<?> remove(@RequestBody Long[] ids) { |
| | | invoicePurchaseService.delInvoice(ids); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/upload") |
| | | public AjaxResult uploadFile(MultipartFile file, Long id, Integer type) { |
| | | try { |
| | | return AjaxResult.success(commonFileService.uploadFile(file, id, type)); |
| | | } catch (Exception e) { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | } |