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/shelfrack/controller/ShelfRackController.java | 40 ++++++++++++++++++++++++++-------------- 1 files changed, 26 insertions(+), 14 deletions(-) diff --git a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/shelfrack/controller/ShelfRackController.java b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/shelfrack/controller/ShelfRackController.java index 9d6c6dd..91ad4a7 100644 --- a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/shelfrack/controller/ShelfRackController.java +++ b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/shelfrack/controller/ShelfRackController.java @@ -1,5 +1,7 @@ package com.mes.shelfrack.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; @@ -14,6 +16,7 @@ import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.GetMapping; import java.util.List; +import java.util.Map; /** * @@ -38,9 +41,9 @@ @ApiOperation(value = "鍒楄〃鏌ヨ",notes = "鍒楄〃鏌ヨ",produces = "application/json") @ApiResponses({@ApiResponse(code = 200, message = "鏌ヨ鎴愬姛")}) @PostMapping("/findList") - public ResponseEntity<List<ShelfRack>> findList(@RequestBody ShelfRack params) { + public Result findList(@RequestBody ShelfRack params) { List<ShelfRack> result = shelfRackService.findList(params); - return ResponseEntity.ok(result); + return Result.success(result); } /** @@ -52,9 +55,9 @@ @ApiOperation(value = "鏌ヨ", notes = "鏌ヨ璇︽儏") @ApiResponses({@ApiResponse(code = 200, message = "鏌ヨ鎴愬姛")}) @GetMapping("/{id}") - public ResponseEntity<ShelfRack> findById(@PathVariable("id") Long id) { - ShelfRack shelfRack = shelfRackService.findById(id); - return ResponseEntity.ok(shelfRack); + public Result findById(@PathVariable("id") Long id) { + ShelfRack shelfRack = shelfRackService.getBaseMapper().selectById(id); + return Result.success(shelfRack); } /** @@ -66,9 +69,9 @@ @ApiOperation(value = "鏂板", notes = "鏂板鏁版嵁") @ApiResponses({@ApiResponse(code = 200, message = "鎿嶄綔鎴愬姛")}) @PostMapping - public ResponseEntity<Boolean> insert( @RequestBody ShelfRack shelfRack) { - boolean result = shelfRackService.insert(shelfRack); - return ResponseEntity.ok(result); + public Result insert( @RequestBody ShelfRack shelfRack) { + boolean result = shelfRackService.save(shelfRack); + return Result.success(result); } /** @@ -80,9 +83,9 @@ @ApiOperation(value = "淇敼", notes = "淇敼鏁版嵁") @ApiResponses({@ApiResponse(code = 200, message = "鎿嶄綔鎴愬姛")}) @PutMapping - public ResponseEntity<Boolean> update( @RequestBody ShelfRack shelfRack) { - boolean result = shelfRackService.update(shelfRack); - return ResponseEntity.ok(result); + public Result update( @RequestBody ShelfRack shelfRack) { + boolean result = shelfRackService.updateById(shelfRack); + return Result.success(result); } /** @@ -93,9 +96,18 @@ */ @ApiOperation(value = "鍒犻櫎", notes = "鍒犻櫎鏁版嵁") @DeleteMapping("/{id}") - public ResponseEntity<Integer> delete(@PathVariable("id") Long id) { - int result = shelfRackService.delete(id); - return ResponseEntity.ok(result); + public Result delete(@PathVariable("id") Long id) { + int result = shelfRackService.getBaseMapper().deleteById(id); + return Result.success(result); + } + + + @ApiOperation(value = "鏋跺瓙琛ㄦ牸鏌ヨ",notes = "鏋跺瓙琛ㄦ牸鏌ヨ",produces = "application/json") + @ApiResponses({@ApiResponse(code = 200, message = "鏌ヨ鎴愬姛")}) + @GetMapping("/findshelfrack") + public Result findshelfrack() { + List<RawUsageAndShelfRack> result = shelfRackService.selectshelf_rack(); + return Result.success(result); } } \ No newline at end of file -- Gitblit v1.8.0