package com.ningdatech.pmapi.performance.controller;

import javax.validation.Valid;

import com.ningdatech.pmapi.performance.manage.ReAppraisalManage;
import org.springframework.web.bind.annotation.*;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.performance.model.dto.ProjectAppraisalDTO;
import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectVO;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalVO;
import com.ningdatech.pmapi.performance.model.vo.ProjectAppraisalIndexDetailVO;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;

/**
 * ReAppraisalController
 * @return
 * @author CMM
 * @since 2023/08/10 8:54
 */
@RestController
@RequiredArgsConstructor
@Api(tags = "绩效评价-人工复评")
@RequestMapping("/api/v1/re-appraisal")
public class ReAppraisalController {

    private final ReAppraisalManage reAppraisalManage;

    @GetMapping("/list")
    @ApiOperation("当前复评用户的绩效评价计划列表")
    public PageVo<PerformanceAppraisalVO> list(PerformanceAppraisalListReq req) {
        return reAppraisalManage.list(req);
    }

    @GetMapping("/group-project-list/{groupId}")
    @ApiOperation("当前复评用户所在分组复评项目列表")
    public PageVo<PerformanceAppraisalProjectVO> groupProjectList(@PathVariable Long groupId, PerformanceAppraisalListReq req) {
        return reAppraisalManage.groupProjectList(groupId,req);
    }

    @PostMapping("/submit-reAppraisal")
    @ApiOperation("提交复评")
    public String submitReAppraisal(@Valid @RequestBody ProjectAppraisalDTO param){
        return reAppraisalManage.submitReAppraisal(param);
    }

}
