| | |
| | | package com.ruoyi.procurementrecord.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | |
| | | private ProcurementRecordService procurementRecordService; |
| | | |
| | | |
| | | /** |
| | | * 通过销售产品id获取入库数量 |
| | | * @param salesProductId |
| | | * @return |
| | | */ |
| | | @GetMapping("/getProcurementAmount") |
| | | @ApiOperation(value = "通过销售产品id获取入库数量") |
| | | public AjaxResult getProcurementAmount(@RequestParam("salesProductId") Long salesProductId) { |
| | | return AjaxResult.success(procurementRecordService.getProcurementAmount(salesProductId)); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/productlist") |
| | | @Log(title = "采购入库-入库管理-新增入库查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult list(ProcurementDto procurementDto) { |
| | |
| | | return procurementRecordService.updateCustom(customStorage); |
| | | } |
| | | |
| | | @DeleteMapping("/deleteCustom") |
| | | @Delete("/delteCustom") |
| | | @Log(title = "自定义入库-入库管理-删除入库", businessType = BusinessType.DELETE) |
| | | @Transactional |
| | | public AjaxResult deleteCustom(@RequestBody List<Long> ids) { |
| | |
| | | return AjaxResult.success(procurementRecordService.updateManagement(procurementDto)); |
| | | } |
| | | |
| | | @PostMapping("/updateManagementByCustom") |
| | | @Log(title = "自定义入库-库存台账-修改", businessType = BusinessType.UPDATE) |
| | | @Transactional |
| | | public AjaxResult updateManagementByCustom(@RequestBody ProcurementManagementUpdateDto procurementDto) { |
| | | return AjaxResult.success(procurementRecordService.updateManagementByCustom(procurementDto)); |
| | | } |
| | | |
| | | @GetMapping("/detailManagementByCustom") |
| | | @ApiOperation(value = "自定义入库-详情") |
| | | public AjaxResult detailManagementByCustom(ProcurementManagementUpdateDto procurementDto) { |
| | | return AjaxResult.success(procurementRecordService.detailManagementByCustom(procurementDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "采购入库-详情") |
| | | @GetMapping("/detail") |
| | | public AjaxResult detail(ProcurementUpdateDto procurementDto) { |
| | | return AjaxResult.success(procurementRecordService.detail(procurementDto)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/del") |
| | |
| | | IPage<ProcurementPageDto> result = procurementRecordService.listPage(page, procurementDto); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @GetMapping("/listReport") |
| | | @ApiOperation(value = "查询库存图表数据") |
| | | public AjaxResult listReport() { |
| | | return AjaxResult.success(procurementRecordService.getReportList()); |
| | | } |
| | | @GetMapping("/listPageByProduction") |
| | | @Log(title = "生产入库-入库管理-入库查询", businessType = BusinessType.OTHER) |
| | | @ApiOperation(value = "入库查询") |
| | | public AjaxResult listPageByProduction(Page page, ProcurementPageDto procurementDto) { |
| | | IPage<ProcurementPageDto> result = procurementRecordService.listPageByProduction(page, procurementDto); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @GetMapping("/listPageByProductProduction") |
| | | @Log(title = "生产入库-入库管理-生产入库查询", businessType = BusinessType.OTHER) |
| | | @ApiOperation(value = "入库查询") |
| | | public AjaxResult listPageByProductProduction(Page page, ProcurementPageDto procurementDto) { |
| | | IPage<ProcurementPageDto> result = procurementRecordService.listPageByProductProduction(page, procurementDto); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | |
| | | * @param response |
| | | */ |
| | | @PostMapping("/exportTwo") |
| | | public void exportTwo(HttpServletResponse response,@RequestBody List<CustomStorage> customStorage) { |
| | | if(CollectionUtils.isEmpty(customStorage)){ |
| | | customStorage = customStorageMapper.selectList(null); |
| | | } |
| | | for (CustomStorage storage : customStorage) { |
| | | // nginx 前端访问图片 |
| | | storage.setUrl("http://114.132.189.42:9044"+storage.getUrl()); |
| | | } |
| | | public void exportTwo(HttpServletResponse response) { |
| | | List<CustomStorage> customStorages = customStorageMapper.selectList(null); |
| | | ExcelUtil<CustomStorage> util = new ExcelUtil<CustomStorage>(CustomStorage.class); |
| | | util.exportExcel(response, customStorage, "入库台账"); |
| | | util.exportExcel(response, customStorages, "入库台账"); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/listPageProductionStock") |
| | | @Log(title = "库存管理-成品库存", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPageProductionStock(Page page) { |
| | | IPage<ProductModel> result = procurementRecordService.listPageProductionStock(page); |
| | | return AjaxResult.success(result); |
| | | } |
| | | } |