From d5bb894f9be2e0a3b62d475b60b44f2ab138528c Mon Sep 17 00:00:00 2001 From: guoyujie <guoyujie@ng.com> Date: 星期四, 12 六月 2025 16:48:35 +0800 Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override --- north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialInventoryController.java | 165 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 134 insertions(+), 31 deletions(-) diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialInventoryController.java b/north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialInventoryController.java index 7d8b272..02ccdce 100644 --- a/north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialInventoryController.java +++ b/north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialInventoryController.java @@ -1,102 +1,205 @@ package com.example.erp.controller.mm; +import cn.dev33.satoken.annotation.SaCheckPermission; import com.example.erp.common.Constants; import com.example.erp.common.Result; -import com.example.erp.entity.mm.MaterialInventory; -import com.example.erp.entity.mm.MaterialOutbound; -import com.example.erp.entity.mm.MaterialOutboundDetail; -import com.example.erp.entity.mm.MaterialStore; +import com.example.erp.dto.mm.FinishedOperateLogDTO; +import com.example.erp.entity.mm.*; +import com.example.erp.entity.pp.OptimizeUse; import com.example.erp.exception.ServiceException; import com.example.erp.service.mm.MaterialInventoryService; import com.example.erp.service.mm.MaterialStoreService; +import com.example.erp.tools.DownExcel; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.time.LocalDate; import java.util.List; import java.util.Map; @RestController -@RequestMapping("/MaterialInventory") +@RequestMapping("/materialInventory") @Api(value="鐗╂枡搴撳瓨controller",tags={"鐗╂枡搴撳瓨鎿嶄綔鎺ュ彛"}) public class MaterialInventoryController { @Autowired MaterialInventoryService materialInventoryService; @ApiOperation("鐗╂枡鍑哄簱鏂板鎺ュ彛") + @SaCheckPermission("createOutbound.add") @PostMapping("/saveMaterialOutbound") public Result saveMaterialOutbound( @RequestBody Map<String,Object> object){ - if(materialInventoryService.saveMaterialOutbound(object)){ - return Result.seccess(); - }else { - throw new ServiceException(Constants.Code_500,"淇濆瓨澶辫触"); - } + return Result.seccess(materialInventoryService.saveMaterialOutbound(object)); + } @ApiOperation("鐗╂枡鏂板鎺ュ彛") + @SaCheckPermission("selectIngredientsStock.add") @PostMapping("/saveMaterialInventory") public Result saveMaterialInventory( @RequestBody Map<String,Object> object){ - if(materialInventoryService.saveMaterialInventory(object)){ - return Result.seccess(); - }else { - throw new ServiceException(Constants.Code_500,"淇濆瓨澶辫触"); - - } + return Result.seccess(materialInventoryService.saveMaterialInventory(object)); } @ApiOperation("鐗╂枡搴撳瓨鍔犳椂闂存煡璇㈡帴鍙�") + @SaCheckPermission("selectIngredientsStock.search") @PostMapping("/getSelectMaterialInventoryDate/{pageNum}/{pageSize}/{selectDate}") public Result getSelectMaterialInventoryDate(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> selectDate, @RequestBody MaterialInventory materialInventory){ return Result.seccess(materialInventoryService.getSelectMaterialInventoryDate(pageNum,pageSize,selectDate,materialInventory)); } + @ApiOperation("鐗╂枡搴撳瓨宸ョ▼鍔犳椂闂存煡璇㈡帴鍙�") + @SaCheckPermission("selectIngredientsStock.search") + @PostMapping("/getSelectMaterialInventoryEngineeringDate/{pageNum}/{pageSize}/{selectDate}") + public Result getSelectMaterialInventoryEngineeringDate(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> selectDate, @RequestBody MaterialInventory materialInventory){ + return Result.seccess(materialInventoryService.getSelectMaterialInventoryEngineeringDate(pageNum,pageSize,selectDate,materialInventory)); + } + @ApiOperation("鐗╂枡搴撳瓨鏌ヨ鎺ュ彛") + @SaCheckPermission("createOutbound.search") @PostMapping("/getSelectMaterialInventory/{pageNum}/{pageSize}") public Result getSelectMaterialInventory(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody MaterialInventory materialInventory){ return Result.seccess(materialInventoryService.getSelectMaterialInventory(pageNum,pageSize,materialInventory)); } - @ApiOperation("鏉愭枡鍑哄簱鏌ヨ鎺ュ彛") + @ApiOperation("鐗╂枡搴撳瓨宸ョ▼鏌ヨ鎺ュ彛") + @SaCheckPermission("selectIngredientsStock.search") + @PostMapping("/getSelectMaterialInventoryEngineering/{pageNum}/{pageSize}") + public Result getSelectMaterialInventoryEngineering(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody OptimizeUse optimizeUse){ + return Result.seccess(materialInventoryService.getSelectMaterialInventoryEngineering(pageNum,pageSize,optimizeUse)); + } + + @ApiOperation("鏉愭枡鍑哄簱鍔犳椂闂存煡璇㈡帴鍙�") + @SaCheckPermission("materialOutbound.search") @PostMapping("/getSelectMaterialOutboundDate/{pageNum}/{pageSize}/{selectDate}") public Result getSelectMaterialOutboundDate(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> selectDate, @RequestBody MaterialOutbound materialOutbound){ return Result.seccess(materialInventoryService.getSelectMaterialOutboundDate(pageNum,pageSize,selectDate, materialOutbound)); } @ApiOperation("鏉愭枡鍑哄簱鏌ヨ鎺ュ彛") + @SaCheckPermission("createOutbound.search") @PostMapping("/getSelectMaterialOutbound/{pageNum}/{pageSize}") public Result getSelectMaterialOutbound(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody MaterialOutboundDetail materialOutboundDetail){ return Result.seccess(materialInventoryService.getSelectMaterialOutbound(pageNum,pageSize,materialOutboundDetail)); } - @ApiOperation("鏉愭枡鍑哄簱淇敼鎺ュ彛") + + @ApiOperation("鏉愭枡鍑哄簱瀹℃牳鎺ュ彛") + @SaCheckPermission("createOutbound.review") @PostMapping("/updateMaterialOutboundToExamine") public Result updateMaterialOutboundToExamine( @RequestBody Map<String,Object> object){ - if(materialInventoryService.updateMaterialOutboundToExamine(object)){ - return Result.seccess(); - - }else { - throw new ServiceException(Constants.Code_500,"瀹℃牳澶辫触"); - - } + return Result.seccess(materialInventoryService.updateMaterialOutboundToExamine(object)); } - @ApiOperation("鐗╂枡鍒犻櫎鎺ュ彛") + @ApiOperation("鏉愭枡鍑哄簱鍒犻櫎鎺ュ彛") + @SaCheckPermission("materialOutbound.delete") @PostMapping("/deleteMaterialOutbound") public Result deleteMaterialOutbound( @RequestBody Map<String,Object> object){ - if(materialInventoryService.deleteMaterialOutbound(object)){ + return Result.seccess(materialInventoryService.deleteMaterialOutbound(object)); + } - return Result.seccess(); + @ApiOperation("鐗╂枡杩斿簱鏂板鎺ュ彛") + @SaCheckPermission("returnToStorageCreate.add") + @PostMapping("/saveReturningWarehouse") + public Result saveReturningWarehouse( @RequestBody Map<String,Object> object){ + return Result.seccess(materialInventoryService.saveReturningWarehouse(object)); + } - }else { - throw new ServiceException(Constants.Code_500,"鍒犻櫎澶辫触"); + @ApiOperation("鐗╂枡杩斿簱鏂板鏌ヨ鎺ュ彛") + @SaCheckPermission("returnToStorageCreate.search") + @PostMapping("/getSelectReturningWarehouse/{pageNum}/{pageSize}") + public Result getSelectReturningWarehouse(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody ReturningWarehouseDetail returningWarehouseDetail){ + return Result.seccess(materialInventoryService.getSelectReturningWarehouse(pageNum,pageSize,returningWarehouseDetail)); + } - } + @ApiOperation("鐗╂枡杩斿簱鍒犻櫎鎺ュ彛") + @SaCheckPermission("returnToStorageCreate.delete") + @PostMapping("/deleteReturnToStorage") + public Result deleteReturnToStorage( @RequestBody Map<String,Object> object){ + return Result.seccess(materialInventoryService.deleteReturnToStorage(object)); + } + + @ApiOperation("鐗╂枡杩斿簱瀹℃牳鎺ュ彛") + @SaCheckPermission("returnToStorageCreate.review") + @PostMapping("/updateReturningWarehouseToExamine") + public Result updateReturningWarehouseToExamine( @RequestBody Map<String,Object> object){ + return Result.seccess(materialInventoryService.updateReturningWarehouseToExamine(object)); } + @ApiOperation("鐗╂枡杩斿簱鏌ヨ鎺ュ彛") + @SaCheckPermission("returnToStorage.search") + @PostMapping("/getSelectReturningWarehouseDate/{pageNum}/{pageSize}/{selectDate}") + public Result getSelectReturningWarehouseDate(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> selectDate, @RequestBody ReturningWarehouse returningWarehouse){ + return Result.seccess(materialInventoryService.getSelectReturningWarehouseDate(pageNum,pageSize,selectDate, returningWarehouse)); + } + + + @ApiOperation("浣欐枡搴撳瓨鏌ヨ鎺ュ彛") + @SaCheckPermission("selectIngredientsStock.search") + @PostMapping("/getSelectSurplusMaterialsDate/{pageNum}/{pageSize}/{selectDate}") + public Result getSelectSurplusMaterialsDate(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> selectDate, @RequestBody SurplusMaterials surplusMaterials){ + return Result.seccess(materialInventoryService.getSelectSurplusMaterialsDate(pageNum,pageSize,selectDate,surplusMaterials)); + } + + @ApiOperation("浣欐枡鏂板鎺ュ彛") + @SaCheckPermission("selectIngredientsStock.search") + @PostMapping("/addSelectSurplusMaterialsDate") + public Result addSelectSurplusMaterialsDate( @RequestBody Map<String,Object> object){ + return Result.seccess(materialInventoryService.addSelectSurplusMaterialsDate(object)); + } + + @ApiOperation("鐗╂枡鍑哄簱鎵撳嵃鎺ュ彛") + @SaCheckPermission("selectIngredientsStock.search") + @GetMapping ("/printCreateOutbound/{materialOutboundId}") + public Result printCreateOutbound(@PathVariable String materialOutboundId) { + return Result.seccess(materialInventoryService.printCreateOutbound(materialOutboundId)); + } + + @ApiOperation("鐗╂枡搴撳瓨璁板綍鏌ヨ鎺ュ彛") + @SaCheckPermission("warehouseReport.search") + @PostMapping("/getMaterialLogReport/{type}/{pageNum}/{pageSize}/{selectDate}") + public Result getMaterialLogReport(@PathVariable String type,@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate, @RequestBody MaterialLog materialLog){ + return Result.seccess(materialInventoryService.getMaterialLogReport(type,pageNum,pageSize,selectDate,materialLog)); + } + + @ApiOperation("鐗╂枡搴撳瓨鍒犻櫎") + @SaCheckPermission("createOutbound.search") + @PostMapping("/deleteMaterialInventory") + public Result deleteMaterialInventory(@RequestBody Map<String,Object> object){ + return Result.seccess(materialInventoryService.deleteMaterialInventory(object)); + } + + @ApiOperation("鐗╂枡鎶ヨ〃瀵煎嚭") + @PostMapping("/exportMaterialLogReport/{type}") + public void exportMaterialLogReport(@PathVariable String type, HttpServletResponse response, @RequestBody List<LocalDate> dates) throws IOException, IllegalAccessException, InstantiationException { + //鍙傛暟锛氱浉搴旂殑鏁版嵁锛屽疄浣撶被淇℃伅锛岀浉搴旂殑鏂规硶锛堟暟鎹幏鍙栵級锛岀敓鎴愮殑excel鍚嶅瓧 + DownExcel.download(response, MaterialLog.class, materialInventoryService.exportMaterialLogReport(dates,type),"orderReport"); + } + + + @ApiOperation("mes鍒囧壊鎶ュ伐") + @PostMapping ("/mesMaterialOutbound") + public Result mesMaterialOutbound(@RequestBody Map<String,Object> reportingWork) { + return Result.seccess(materialInventoryService.mesMaterialOutbound(reportingWork)); + } + + @ApiOperation("鐗╂枡鏂板杩斿洖鎺ュ彛") + @PostMapping("/cancelMaterialAdditionRecord") + public Result cancelMaterialAdditionRecord( @RequestBody Map<String,Object> object){ + return Result.seccess(materialInventoryService.cancelMaterialAdditionRecord(object)); + } + + @ApiOperation("浼樺寲鐗╂枡搴撳瓨璁板綍鏌ヨ鎺ュ彛") + @SaCheckPermission("warehouseReport.search") + @PostMapping("/getOptimizeOutboundReport/{type}/{pageNum}/{pageSize}/{selectDate}") + public Result getOptimizeOutboundReport(@PathVariable String type,@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate, @RequestBody MaterialLog materialLog){ + return Result.seccess(materialInventoryService.getOptimizeOutboundReport(type,pageNum,pageSize,selectDate,materialLog)); + } } -- Gitblit v1.8.0