选煤厂生产管理平台后台代码
dongyukun
2024-12-11 e16f4e463a6a090798c189a78a4a8f08295d31a6
提交 | 用户 | 时间
532d0b 1 package com.iailab.module.pms.production.work.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.work.enity.DutyInfoEntity;
7 import com.iailab.module.pms.production.work.service.DutyInfoService;
8 import com.iailab.module.pms.production.work.vo.DutyInfoPageReqVO;
9 import io.swagger.v3.oas.annotations.Operation;
10 import io.swagger.v3.oas.annotations.Parameter;
11 import lombok.extern.slf4j.Slf4j;
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 /**
20  * 当班信息
21  *
22  * @author DongYuKun
23  * @Description
24  * @createTime 2023年04月27日 14:55:00
25  */
26 @Slf4j
27 @RestController
e16f4e 28 @RequestMapping("/xmcpms/prod/work/onDutyInfo")
532d0b 29 public class DutyInfoController {
D 30
31     @Resource
32     private DutyInfoService dutyInfoService;
33
34     @PostMapping("/create")
35     @Operation(summary = "新增")
36     public CommonResult<String> createDutyInfo(@Valid @RequestBody DutyInfoEntity createEntity) {
37         return success(dutyInfoService.create(createEntity));
38     }
39
40     @PutMapping("/update")
41     @Operation(summary = "更新")
42     public CommonResult<Boolean> updateDutyInfo(@Valid @RequestBody DutyInfoEntity updateEntity) {
43         dutyInfoService.update(updateEntity);
44         return success(true);
45     }
46
47     @DeleteMapping("/delete")
48     @Operation(summary = "删除")
49     @Parameter(name = "id", description = "ID", required = true, example = "1024")
50     public CommonResult<Boolean> deleteDutyInfo(@RequestParam("id") String id) {
51         dutyInfoService.delete(id);
52         return success(true);
53     }
54
55     @GetMapping("/get")
56     @Operation(summary = "详情")
57     @Parameter(name = "id", description = "ID", required = true, example = "1024")
58     public CommonResult<DutyInfoEntity> getDutyInfo(@RequestParam("id") String id) {
59         DutyInfoEntity data = dutyInfoService.getInfo(id);
60         return success(BeanUtils.toBean(data, DutyInfoEntity.class));
61     }
62
63     @GetMapping("/page")
64     @Operation(summary = "分页")
65     public CommonResult<PageResult<DutyInfoEntity>> getDutyInfoPage(@Valid DutyInfoPageReqVO pageVO) {
66         PageResult<DutyInfoEntity> pageResult = dutyInfoService.getPage(pageVO);
67         return success(BeanUtils.toBean(pageResult, DutyInfoEntity.class));
68     }
69 }