From 14857a20b20a636a952375e064cf72f88296911d Mon Sep 17 00:00:00 2001 From: 廖井涛 <2265517004@qq.com> Date: 星期五, 01 三月 2024 15:20:44 +0800 Subject: [PATCH] 返工修改 --- north-glass-erp/src/main/java/com/example/erp/controller/pp/ReworkController.java | 58 +++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 49 insertions(+), 9 deletions(-) diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/pp/ReworkController.java b/north-glass-erp/src/main/java/com/example/erp/controller/pp/ReworkController.java index f7a4d0d..dd9ff1e 100644 --- a/north-glass-erp/src/main/java/com/example/erp/controller/pp/ReworkController.java +++ b/north-glass-erp/src/main/java/com/example/erp/controller/pp/ReworkController.java @@ -1,12 +1,18 @@ package com.example.erp.controller.pp; +import com.example.erp.common.Constants; import com.example.erp.common.Result; +import com.example.erp.entity.pp.Rework; +import com.example.erp.entity.sd.Delivery; +import com.example.erp.entity.sd.OrderDetail; +import com.example.erp.exception.ServiceException; import com.example.erp.service.pp.ReworkService; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; @RestController @RequestMapping("/rework") @@ -15,11 +21,45 @@ @Autowired ReworkService reworkService; - @PostMapping("/query/{pageNum}/{pageSize}/{startTime}/{endTime}") - public Result queryRework(@PathVariable Integer pageNum, @PathVariable Integer pageSize, - @PathVariable String startTime,@PathVariable String endTime - ){ - return Result.seccess(reworkService.queryRework(pageNum,pageSize,startTime,endTime,null)); + + /*鍙戣揣璁㈠崟鏌ヨ*/ + @ApiOperation("鍙戣揣璁㈠崟鏌ヨ鎺ュ彛") + @PostMapping("/getSelectRework/{pageNum}/{pageSize}") + public Result getSelectRework(@PathVariable Integer pageNum, @PathVariable Integer pageSize){ + return Result.seccess(reworkService.getSelectRework(pageNum,pageSize)); + } + + @ApiOperation("鍙戣揣璁㈠崟鏌ヨ鎺ュ彛") + @PostMapping("/SelectRework/{pageNum}/{pageSize}/{selectDate}") + public Result SelectRework(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate,@RequestBody Rework rework){ + return Result.seccess(reworkService.SelectRework(pageNum,pageSize,selectDate,rework)); + } + + + @ApiOperation("璁㈠崟璋冩嫧鎺ュ彛") + @PostMapping("/saveRework") + public Result updateFinishedGoodsInventoryAllocate( @RequestBody Map<String,Object> object){ + if(reworkService.saveRework(object)){ + + return Result.seccess(); + + }else { + throw new ServiceException(Constants.Code_500,"杩斿伐澶辫触"); + + } + } + + @ApiOperation("璁㈠崟璋冩嫧鎺ュ彛") + @PostMapping("/updateRework") + public Result updateRework( @RequestBody Map<String,Object> object){ + if(reworkService.updateRework(object)){ + + return Result.seccess(); + + }else { + throw new ServiceException(Constants.Code_500,"瀹℃牳澶辫触"); + + } } } -- Gitblit v1.8.0