| | |
| | | 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;
|
| | |
| | | @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);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | @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);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | @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);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | */
|
| | | @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();
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | } |