选煤厂生产管理平台后台代码
dongyukun
2024-12-11 e16f4e463a6a090798c189a78a4a8f08295d31a6
提交 | 用户 | 时间
532d0b 1 package com.iailab.module.pms.production.wash.controller.admin;
D 2
3 import com.iailab.framework.common.pojo.CommonResult;
4 import com.iailab.framework.common.pojo.PageResult;
5 import com.iailab.framework.common.util.object.BeanUtils;
6 import com.iailab.module.pms.production.wash.vo.TransferInPageReqVO;
7 import com.iailab.module.pms.production.wash.entity.TransferInEntity;
8 import com.iailab.module.pms.production.wash.service.TransferInService;
9 import io.swagger.v3.oas.annotations.Operation;
10 import io.swagger.v3.oas.annotations.Parameter;
11 import io.swagger.v3.oas.annotations.tags.Tag;
12 import org.springframework.web.bind.annotation.*;
13
14 import javax.annotation.Resource;
15 import javax.validation.Valid;
16
17 import static com.iailab.framework.common.pojo.CommonResult.success;
18
19 @Tag(name = "调入量")
20 @RestController
e16f4e 21 @RequestMapping("/xmcpms/prod/wash/transferIn")
532d0b 22 public class TransferInController {
D 23
24     @Resource
25     private TransferInService transferInService;
26
27     @PostMapping("/create")
28     @Operation(summary = "新增")
29     public CommonResult<String> createTransferIn(@Valid @RequestBody TransferInEntity createEntity) {
30         return success(transferInService.create(createEntity));
31     }
32
33     @PutMapping("/update")
34     @Operation(summary = "更新")
35     public CommonResult<Boolean> updateTransferIn(@Valid @RequestBody TransferInEntity updateEntity) {
36         transferInService.update(updateEntity);
37         return success(true);
38     }
39
40     @DeleteMapping("/delete")
41     @Operation(summary = "删除")
42     @Parameter(name = "id", description = "ID", required = true, example = "1024")
43     public CommonResult<Boolean> deleteTransferIn(@RequestParam("id") String id) {
44         transferInService.delete(id);
45         return success(true);
46     }
47
48     @GetMapping("/get")
49     @Operation(summary = "详情")
50     @Parameter(name = "id", description = "ID", required = true, example = "1024")
51     public CommonResult<TransferInEntity> getTransferIn(@RequestParam("id") String id) {
52         TransferInEntity data = transferInService.getInfo(id);
53         return success(BeanUtils.toBean(data, TransferInEntity.class));
54     }
55
56     @GetMapping("/page")
57     @Operation(summary = "分页")
58     public CommonResult<PageResult<TransferInEntity>> getTransferInPage(@Valid TransferInPageReqVO pageVO) {
59         PageResult<TransferInEntity> pageResult = transferInService.getPage(pageVO);
60         return success(BeanUtils.toBean(pageResult, TransferInEntity.class));
61     }
62 }