kongzy
2024-01-29 983bdb5b89932b38d08a11ad1eed6ea89d1597e1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package com.gkhy.assess.admin.controller.web;
 
 
import com.gkhy.assess.common.annotation.RepeatSubmit;
import com.gkhy.assess.common.api.CommonResult;
import com.gkhy.assess.system.domain.AssEstimatePlan;
import com.gkhy.assess.system.service.AssEstimatePlanService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
/**
 * <p>
 * 评价项目计划表 前端控制器
 * </p>
 *
 * @author kzy
 * @since 2023-12-12 10:46:54
 */
@Api(tags = "评价项目计划 前端控制器")
@RestController
@RequestMapping("/manage/estimate-plan")
public class AssEstimatePlanController {
    @Autowired
    private AssEstimatePlanService estimatePlanService;
 
    @ApiOperation(value = "根据id获取评价计划详情")
    @GetMapping("/detail/{planId}")
    public CommonResult planDetail(@PathVariable(value = "planId") Long planId){
        return CommonResult.success(estimatePlanService.getEstimatePlanById(planId));
    }
 
    @ApiOperation(value = "根据项目id获取评价计划详情")
    @GetMapping("/getPlanByProjectId")
    public CommonResult getPlanByProjectId( Long projectId){
        return CommonResult.success(estimatePlanService.getEstimatePlanByProjectId(projectId));
    }
 
    @RepeatSubmit
    @ApiOperation(value = "创建评价计划")
    @PostMapping("/add")
    public CommonResult addPlan(@Validated @RequestBody AssEstimatePlan estimatePlan){
        return CommonResult.success(estimatePlanService.addEstimatePlan(estimatePlan));
    }
 
    @RepeatSubmit
    @ApiOperation(value = "编辑评价计划")
    @PutMapping("/edit")
    public CommonResult editPlan(@Validated @RequestBody AssEstimatePlan estimatePlan){
        return CommonResult.success(estimatePlanService.editEstimatePlan(estimatePlan));
    }
 
 
}