| | |
| | | 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.PurchaseLedgerDto; |
| | | import com.ruoyi.purchase.mapper.PurchaseLedgerTemplateMapper; |
| | |
| | | @Log(title = "导入采购台账", businessType = BusinessType.INSERT) |
| | | @PostMapping("/import") |
| | | @Operation(summary = "导入采购台账") |
| | | public AjaxResult importData(@RequestParam("file") |
| | | public R<?> importData(@RequestParam("file") |
| | | @ApiParam(value = "Excel文件", required = true) |
| | | MultipartFile file) { |
| | | return purchaseLedgerService.importData(file); |
| | |
| | | */ |
| | | @Log(title = "采购台账", businessType = BusinessType.INSERT) |
| | | @PostMapping("/addOrEditPurchase") |
| | | public AjaxResult addOrEditPurchase(@RequestBody PurchaseLedgerDto purchaseLedgerDto) throws Exception { |
| | | return toAjax(purchaseLedgerService.addOrEditPurchase(purchaseLedgerDto)); |
| | | public R<?> addOrEditPurchase(@RequestBody PurchaseLedgerDto purchaseLedgerDto) throws Exception { |
| | | purchaseLedgerService.addOrEditPurchase(purchaseLedgerDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Operation(summary = "/查询采购模板") |
| | | @GetMapping("/getPurchaseTemplateList") |
| | | public AjaxResult getPurchaseTemplateList() { |
| | | public R<?> getPurchaseTemplateList() { |
| | | List<PurchaseLedgerTemplate> purchaseLedgers = purchaseLedgerTemplateMapper.selectList(null); |
| | | purchaseLedgers.forEach(purchaseLedgerDto1 -> { |
| | | LambdaQueryWrapper<SalesLedgerProductTemplate> queryWrapper = new LambdaQueryWrapper<>(); |
| | |
| | | purchaseLedgerDto1.setProductList(list); |
| | | } |
| | | }); |
| | | return AjaxResult.success(purchaseLedgers); |
| | | return R.ok(purchaseLedgers); |
| | | } |
| | | /** |
| | | * 修改采购台账审批状态 |
| | | */ |
| | | @PostMapping("/updateApprovalStatus") |
| | | public AjaxResult addOrEditPurchase(@RequestBody PurchaseLedger purchaseLedger){ |
| | | return toAjax(purchaseLedgerService.updateById(purchaseLedger)); |
| | | public R<?> addOrEditPurchase(@RequestBody PurchaseLedger purchaseLedger){ |
| | | purchaseLedgerService.updateById(purchaseLedger); |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 查询采购台账和产品父子列表 |
| | |
| | | */ |
| | | @Log(title = "采购台账", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/delPurchase") |
| | | public AjaxResult remove(@RequestBody Long[] ids) { |
| | | return toAjax(purchaseLedgerService.deletePurchaseLedgerByIds(ids)); |
| | | public R<?> remove(@RequestBody Long[] ids) { |
| | | purchaseLedgerService.deletePurchaseLedgerByIds(ids); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 根据销售合同查询产品信息 |
| | | */ |
| | | @GetMapping("/getProductBySalesNo") |
| | | public AjaxResult getProductBySalesNo(Long id) { |
| | | return AjaxResult.success(purchaseLedgerService.getProductBySalesNo(id)); |
| | | public R<?> getProductBySalesNo(Long id) { |
| | | return R.ok(purchaseLedgerService.getProductBySalesNo(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 根据id查询采购合同号 |
| | | */ |
| | | @GetMapping("/getPurchaseNoById") |
| | | public AjaxResult getPurchaseNoById(Long id) { |
| | | return AjaxResult.success(purchaseLedgerService.getPurchaseNoById(id)); |
| | | public R<?> getPurchaseNoById(Long id) { |
| | | return R.ok(purchaseLedgerService.getPurchaseNoById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 根据采购合同号查询产品 |
| | | */ |
| | | @GetMapping("/getInfo") |
| | | public AjaxResult getInfo(PurchaseLedgerDto purchaseLedgerDto) { |
| | | return AjaxResult.success(purchaseLedgerService.getInfo(purchaseLedgerDto)); |
| | | public R<?> getInfo(PurchaseLedgerDto purchaseLedgerDto) { |
| | | return R.ok(purchaseLedgerService.getInfo(purchaseLedgerDto)); |
| | | } |
| | | |
| | | /** |
| | | * 查询采购台账列表 |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page page, PurchaseLedgerDto purchaseLedger) { |
| | | return AjaxResult.success(purchaseLedgerService.selectPurchaseLedgerListPage(page, purchaseLedger)); |
| | | public R<?> listPage(Page page, PurchaseLedgerDto purchaseLedger) { |
| | | return R.ok(purchaseLedgerService.selectPurchaseLedgerListPage(page, purchaseLedger)); |
| | | } |
| | | |
| | | @Operation(summary = "生成采购序列号") |
| | | @GetMapping("/createPurchaseNo") |
| | | @Log(title = "生成采购序列号", businessType = BusinessType.OTHER) |
| | | public AjaxResult createPurchaseNo() { |
| | | return AjaxResult.success("生成成功",purchaseLedgerService.getPurchaseNo()); |
| | | public R<?> createPurchaseNo() { |
| | | return R.ok(purchaseLedgerService.getPurchaseNo(), "生成成功"); |
| | | } |
| | | } |