提交 | 用户 | 时间
|
1d02b4
|
1 |
package com.iailab.module.data.ind.value.controller.admin; |
2a6f08
|
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.data.ind.item.vo.IndItemRespVO; |
1d02b4
|
7 |
import com.iailab.module.data.ind.item.vo.IndItemValueVO; |
2a6f08
|
8 |
import com.iailab.module.data.ind.value.entity.IndItemValueEntity; |
潘 |
9 |
import com.iailab.module.data.ind.value.service.IndItemValueService; |
|
10 |
import com.iailab.module.data.ind.value.vo.IndItemValuePageReqVO; |
|
11 |
import com.iailab.module.data.ind.value.vo.IndItemValueSaveReqVO; |
|
12 |
import io.swagger.v3.oas.annotations.Operation; |
|
13 |
import io.swagger.v3.oas.annotations.Parameter; |
|
14 |
import io.swagger.v3.oas.annotations.tags.Tag; |
|
15 |
import org.springframework.beans.factory.annotation.Autowired; |
|
16 |
import org.springframework.security.access.prepost.PreAuthorize; |
|
17 |
import org.springframework.validation.annotation.Validated; |
|
18 |
import org.springframework.web.bind.annotation.*; |
|
19 |
|
|
20 |
import javax.validation.Valid; |
1d02b4
|
21 |
|
J |
22 |
import java.util.List; |
2a6f08
|
23 |
|
潘 |
24 |
import static com.iailab.framework.common.pojo.CommonResult.success; |
|
25 |
|
|
26 |
/** |
|
27 |
* @author PanZhibao |
|
28 |
* @Description |
|
29 |
* @createTime 2024年09月11日 |
|
30 |
*/ |
|
31 |
@Tag(name = "数据平台 - 指标项") |
|
32 |
@RestController |
|
33 |
@RequestMapping("/data/ind-item-value") |
|
34 |
@Validated |
|
35 |
public class IndItemValueController { |
|
36 |
|
|
37 |
@Autowired |
|
38 |
private IndItemValueService indItemValueService; |
|
39 |
|
|
40 |
@GetMapping("/page") |
|
41 |
@Operation(summary = "获取指标项列表", description = "用于【指标项】界面") |
|
42 |
@PreAuthorize("@ss.hasPermission('data:ind-item-value:query')") |
|
43 |
public CommonResult<PageResult<IndItemRespVO>> page(IndItemValuePageReqVO reqVO) { |
|
44 |
PageResult<IndItemValueEntity> page = indItemValueService.page(reqVO); |
|
45 |
return success(BeanUtils.toBean(page, IndItemRespVO.class)); |
|
46 |
} |
|
47 |
|
|
48 |
@PostMapping("/create") |
|
49 |
@Operation(summary = "创建指标项") |
|
50 |
@PreAuthorize("@ss.hasPermission('data:ind-item-value:create')") |
|
51 |
public CommonResult<Boolean> create(@Valid @RequestBody IndItemValueSaveReqVO createReqVO) { |
|
52 |
indItemValueService.create(createReqVO); |
|
53 |
return success(true); |
|
54 |
} |
|
55 |
|
|
56 |
@PutMapping("/update") |
|
57 |
@Operation(summary = "修改指标项") |
|
58 |
@PreAuthorize("@ss.hasPermission('data:ind-item-value:update')") |
|
59 |
public CommonResult<Boolean> update(@Valid @RequestBody IndItemValueSaveReqVO updateReqVO) { |
|
60 |
indItemValueService.update(updateReqVO); |
|
61 |
return success(true); |
|
62 |
} |
|
63 |
|
|
64 |
@DeleteMapping("/delete") |
|
65 |
@Operation(summary = "删除指标项") |
|
66 |
@Parameter(name = "id", description = "指标项编号", required= true, example = "1024") |
|
67 |
@PreAuthorize("@ss.hasPermission('data:ind-item-value:delete')") |
|
68 |
public CommonResult<Boolean> delete(@RequestParam("id") String id) { |
|
69 |
indItemValueService.delete(id); |
|
70 |
return success(true); |
|
71 |
} |
|
72 |
|
|
73 |
@GetMapping("/get") |
|
74 |
@Operation(summary = "获取指标项信息") |
|
75 |
@PreAuthorize("@ss.hasPermission('system:ind-item:query')") |
|
76 |
public CommonResult<IndItemRespVO> get(String id) { |
|
77 |
IndItemValueEntity entity = indItemValueService.get(id); |
|
78 |
return success(BeanUtils.toBean(entity, IndItemRespVO.class)); |
|
79 |
} |
1d02b4
|
80 |
|
J |
81 |
@GetMapping("/getList") |
|
82 |
@Operation(summary = "获取指标项数据集合信息") |
|
83 |
public CommonResult<List<IndItemValueVO>> getList(@Valid IndItemValuePageReqVO reqVO) { |
|
84 |
List<IndItemValueVO> list = indItemValueService.getValueList(reqVO); |
|
85 |
return success(list); |
|
86 |
} |
2a6f08
|
87 |
} |