From d5d0d1c7a84b996b9bbcebfaf2c2c95f1a5a3678 Mon Sep 17 00:00:00 2001 From: zhoushihao <zsh19950802@163.com> Date: 星期五, 11 十月 2024 08:39:15 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/rawusage/controller/RawUsageController.java | 52 +++++++++++++++++++++++++++++++++++----------------- 1 files changed, 35 insertions(+), 17 deletions(-) diff --git a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/rawusage/controller/RawUsageController.java b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/rawusage/controller/RawUsageController.java index 8c9238e..1518f75 100644 --- a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/rawusage/controller/RawUsageController.java +++ b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/rawusage/controller/RawUsageController.java @@ -1,5 +1,7 @@ package com.mes.rawusage.controller; +import com.mes.shelfrack.entity.request.RawUsageAndShelfRack; +import com.mes.utils.Result; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import io.swagger.annotations.ApiOperation; @@ -38,9 +40,9 @@ @ApiOperation(value = "鍒楄〃鏌ヨ",notes = "鍒楄〃鏌ヨ",produces = "application/json") @ApiResponses({@ApiResponse(code = 200, message = "鏌ヨ鎴愬姛")}) @PostMapping("/findList") - public ResponseEntity<List<RawUsage>> findList(@RequestBody RawUsage params) { + public Result findList(@RequestBody RawUsage params) { List<RawUsage> result = rawUsageService.findList(params); - return ResponseEntity.ok(result); + return Result.success(result); } /** @@ -52,9 +54,9 @@ @ApiOperation(value = "鏌ヨ", notes = "鏌ヨ璇︽儏") @ApiResponses({@ApiResponse(code = 200, message = "鏌ヨ鎴愬姛")}) @GetMapping("/{id}") - public ResponseEntity<RawUsage> findById(@PathVariable("id") Long id) { - RawUsage rawUsage = rawUsageService.findById(id); - return ResponseEntity.ok(rawUsage); + public Result findById(@PathVariable("id") Long id) { + RawUsage rawUsage = rawUsageService.getById(id); + return Result.success(rawUsage); } /** @@ -66,9 +68,9 @@ @ApiOperation(value = "鏂板", notes = "鏂板鏁版嵁") @ApiResponses({@ApiResponse(code = 200, message = "鎿嶄綔鎴愬姛")}) @PostMapping - public ResponseEntity<Boolean> insert( @RequestBody RawUsage rawUsage) { - boolean result = rawUsageService.insert(rawUsage); - return ResponseEntity.ok(result); + public Result insert( @RequestBody RawUsage rawUsage) { + boolean result = rawUsageService.save(rawUsage); + return Result.success(result); } /** @@ -79,23 +81,39 @@ */ @ApiOperation(value = "淇敼", notes = "淇敼鏁版嵁") @ApiResponses({@ApiResponse(code = 200, message = "鎿嶄綔鎴愬姛")}) - @PutMapping - public ResponseEntity<Boolean> update( @RequestBody RawUsage rawUsage) { - boolean result = rawUsageService.update(rawUsage); - return ResponseEntity.ok(result); + @PostMapping("/updaterawUsage") + public Result updaterawUsage(@RequestBody RawUsage rawUsage) { + boolean result = rawUsageService.updateById(rawUsage); + return Result.success(result); } /** * 鍒犻櫎 * - * @param id + * @param * @return */ @ApiOperation(value = "鍒犻櫎", notes = "鍒犻櫎鏁版嵁") - @DeleteMapping("/{id}") - public ResponseEntity<Integer> delete(@PathVariable("id") Long id) { - int result = rawUsageService.delete(id); - return ResponseEntity.ok(result); + @PostMapping("/id") + public Result delete(@RequestBody RawUsage rawUsage) { + rawUsageService.updateRawPackageAndStorageRack(rawUsage); + return Result.success(); } + @ApiOperation(value = "鍏ュ簱", notes = "鍏ュ簱") + @PostMapping("/inStorage") + public Result inStorage(@RequestBody RawUsageAndShelfRack rawUsage) { + rawUsageService.inStorage(rawUsage); + return Result.success(); + } + + @ApiOperation(value = "鍑哄簱", notes = "鍑哄簱") + @PostMapping("/outStorage") + public Result outStorage(@RequestBody RawUsageAndShelfRack rawUsage) { + rawUsageService.outStorage(rawUsage); + return Result.success(); + } + + + } \ No newline at end of file -- Gitblit v1.8.0