wu
2024-08-02 928fa3682fcd0bcb59e3ca3da8770ecbb06cf315
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);
    }
}