From baeae530bc5dfdd23359f34b047f449c1541359f Mon Sep 17 00:00:00 2001 From: guoyuji <guoyujie@ng.com> Date: 星期三, 27 三月 2024 11:23: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 | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 102 insertions(+), 0 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 new file mode 100644 index 0000000..7d8b272 --- /dev/null +++ b/north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialInventoryController.java @@ -0,0 +1,102 @@ +package com.example.erp.controller.mm; + + +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.exception.ServiceException; +import com.example.erp.service.mm.MaterialInventoryService; +import com.example.erp.service.mm.MaterialStoreService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/MaterialInventory") +@Api(value="鐗╂枡搴撳瓨controller",tags={"鐗╂枡搴撳瓨鎿嶄綔鎺ュ彛"}) +public class MaterialInventoryController { + @Autowired + MaterialInventoryService materialInventoryService; + + @ApiOperation("鐗╂枡鍑哄簱鏂板鎺ュ彛") + @PostMapping("/saveMaterialOutbound") + public Result saveMaterialOutbound( @RequestBody Map<String,Object> object){ + if(materialInventoryService.saveMaterialOutbound(object)){ + return Result.seccess(); + }else { + throw new ServiceException(Constants.Code_500,"淇濆瓨澶辫触"); + + } + } + + @ApiOperation("鐗╂枡鏂板鎺ュ彛") + @PostMapping("/saveMaterialInventory") + public Result saveMaterialInventory( @RequestBody Map<String,Object> object){ + if(materialInventoryService.saveMaterialInventory(object)){ + return Result.seccess(); + }else { + throw new ServiceException(Constants.Code_500,"淇濆瓨澶辫触"); + + } + } + + @ApiOperation("鐗╂枡搴撳瓨鍔犳椂闂存煡璇㈡帴鍙�") + @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("鐗╂枡搴撳瓨鏌ヨ鎺ュ彛") + @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("鏉愭枡鍑哄簱鏌ヨ鎺ュ彛") + @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("鏉愭枡鍑哄簱鏌ヨ鎺ュ彛") + @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("鏉愭枡鍑哄簱淇敼鎺ュ彛") + @PostMapping("/updateMaterialOutboundToExamine") + public Result updateMaterialOutboundToExamine( @RequestBody Map<String,Object> object){ + if(materialInventoryService.updateMaterialOutboundToExamine(object)){ + return Result.seccess(); + + }else { + throw new ServiceException(Constants.Code_500,"瀹℃牳澶辫触"); + + } + } + + @ApiOperation("鐗╂枡鍒犻櫎鎺ュ彛") + @PostMapping("/deleteMaterialOutbound") + public Result deleteMaterialOutbound( @RequestBody Map<String,Object> object){ + if(materialInventoryService.deleteMaterialOutbound(object)){ + + return Result.seccess(); + + }else { + throw new ServiceException(Constants.Code_500,"鍒犻櫎澶辫触"); + + } + } + + + + +} -- Gitblit v1.8.0