提交 | 用户 | 时间
|
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.HourVolumePageReqVO; |
|
7 |
import com.iailab.module.pms.production.wash.entity.HourVolumeEntity; |
|
8 |
import com.iailab.module.pms.production.wash.service.HourVolumeService; |
|
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/hourVolume") |
532d0b
|
22 |
public class HourVolumeController { |
D |
23 |
|
|
24 |
@Resource |
|
25 |
private HourVolumeService hourVolumeService; |
|
26 |
|
|
27 |
@PostMapping("/create") |
|
28 |
@Operation(summary = "新增") |
|
29 |
public CommonResult<String> createHourVolume(@Valid @RequestBody HourVolumeEntity createEntity) { |
|
30 |
return success(hourVolumeService.create(createEntity)); |
|
31 |
} |
|
32 |
|
|
33 |
@PutMapping("/update") |
|
34 |
@Operation(summary = "更新") |
|
35 |
public CommonResult<Boolean> updateHourVolume(@Valid @RequestBody HourVolumeEntity updateEntity) { |
|
36 |
hourVolumeService.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> deleteHourVolume(@RequestParam("id") String id) { |
|
44 |
hourVolumeService.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<HourVolumeEntity> getHourVolume(@RequestParam("id") String id) { |
|
52 |
HourVolumeEntity data = hourVolumeService.getInfo(id); |
|
53 |
return success(BeanUtils.toBean(data, HourVolumeEntity.class)); |
|
54 |
} |
|
55 |
|
|
56 |
@GetMapping("/page") |
|
57 |
@Operation(summary = "分页") |
|
58 |
public CommonResult<PageResult<HourVolumeEntity>> getHourVolumePage(@Valid HourVolumePageReqVO pageVO) { |
|
59 |
PageResult<HourVolumeEntity> pageResult = hourVolumeService.getPage(pageVO); |
|
60 |
return success(BeanUtils.toBean(pageResult, HourVolumeEntity.class)); |
|
61 |
} |
|
62 |
} |