| | |
| | | package com.ruoyi.purchase.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | 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.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.purchase.dto.PurchaseLedgerDto; |
| | | import com.ruoyi.purchase.mapper.PurchaseLedgerMapper; |
| | | import com.ruoyi.purchase.pojo.PurchaseLedger; |
| | | import com.ruoyi.purchase.service.IPurchaseLedgerService; |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import com.ruoyi.sales.service.ISalesLedgerService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | List<PurchaseLedger> list = purchaseLedgerService.selectPurchaseLedgerList(purchaseLedger); |
| | | ExcelUtil<PurchaseLedger> util = new ExcelUtil<PurchaseLedger>(PurchaseLedger.class); |
| | | util.exportExcel(response, list, "【请填写功能名称】数据"); |
| | | } |
| | | |
| | | /** |
| | | * 导出来票登记列表 |
| | | */ |
| | | @Log(title = "导出来票登记列表", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportOne") |
| | | public void exportOne(HttpServletResponse response, PurchaseLedger purchaseLedger) { |
| | | Page page = new Page(); |
| | | page.setCurrent(-1); |
| | | page.setSize(-1); |
| | | IPage<PurchaseLedgerDto> purchaseLedgerDtoIPage = purchaseLedgerService.selectPurchaseLedgerListPage(page, new PurchaseLedgerDto()); |
| | | ExcelUtil<PurchaseLedgerDto> util = new ExcelUtil<PurchaseLedgerDto>(PurchaseLedgerDto.class); |
| | | util.exportExcel(response, purchaseLedgerDtoIPage.getRecords(), "导出来票登记列表"); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 查询采购台账列表 |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public IPage<PurchaseLedger> listPage(Page page, PurchaseLedger purchaseLedger) { |
| | | return purchaseLedgerService.selectPurchaseLedgerListPage(page ,purchaseLedger); |
| | | public AjaxResult listPage(Page page, PurchaseLedgerDto purchaseLedger) { |
| | | return AjaxResult.success(purchaseLedgerService.selectPurchaseLedgerListPage(page ,purchaseLedger)); |
| | | } |
| | | |
| | | @ApiOperation("生成采购序列号") |
| | | @GetMapping("/createPurchaseNo") |
| | | @Log(title = "生成采购序列号", businessType = BusinessType.OTHER) |
| | | public String createPurchaseNo() { |
| | | return purchaseLedgerService.getPurchaseNo(); |
| | | public AjaxResult createPurchaseNo() { |
| | | return AjaxResult.success("生成成功",purchaseLedgerService.getPurchaseNo()); |
| | | } |
| | | |
| | | /** |
| | | * 根据采购合同号查询详情 |
| | | */ |
| | | @GetMapping("/getPurchaseByCode") |
| | | public AjaxResult getPurchaseByCode(PurchaseLedgerDto purchaseLedgerDto) { |
| | | return AjaxResult.success(purchaseLedgerService.getPurchaseByCode(purchaseLedgerDto)); |
| | | } |
| | | |
| | | } |