选煤厂生产管理平台后台代码
dongyukun
2024-12-11 3c46415ec95e8a542ab98ba686c4d9666c8776c1
提交 | 用户 | 时间
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.DispatchLogEntity;
7 import com.iailab.module.pms.production.work.service.DispatchLogService;
8 import com.iailab.module.pms.production.work.vo.DispatchLogPageReqVO;
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日 11:02:00
25  */
26 @Slf4j
27 @RestController
e16f4e 28 @RequestMapping("/xmcpms/prod/work/dispatchLog")
532d0b 29 public class DispatchLogController {
D 30
31     @Resource
32     private DispatchLogService dispatchLogService;
33
34     @PostMapping("/create")
35     @Operation(summary = "新增")
36     public CommonResult<String> createDispatchLog(@Valid @RequestBody DispatchLogEntity createEntity) {
37         return success(dispatchLogService.create(createEntity));
38     }
39
40     @PutMapping("/update")
41     @Operation(summary = "更新")
42     public CommonResult<Boolean> updateDispatchLog(@Valid @RequestBody DispatchLogEntity updateEntity) {
43         dispatchLogService.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> deleteDispatchLog(@RequestParam("id") String id) {
51         dispatchLogService.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<DispatchLogEntity> getDispatchLog(@RequestParam("id") String id) {
59         DispatchLogEntity data = dispatchLogService.getInfo(id);
60         return success(BeanUtils.toBean(data, DispatchLogEntity.class));
61     }
62
63     @GetMapping("/page")
64     @Operation(summary = "分页")
65     public CommonResult<PageResult<DispatchLogEntity>> getDispatchLogPage(@Valid DispatchLogPageReqVO pageVO) {
66         PageResult<DispatchLogEntity> pageResult = dispatchLogService.getPage(pageVO);
67         return success(BeanUtils.toBean(pageResult, DispatchLogEntity.class));
68     }
69 }