package com.hz.pm.api.performance.controller;

import javax.validation.Valid;

import com.ningdatech.log.annotation.WebLog;
import com.hz.pm.api.performance.manage.RectifyAuditManage;
import org.springframework.web.bind.annotation.*;

import com.ningdatech.basic.model.PageVo;
import com.hz.pm.api.performance.model.dto.ProjectAppraisalDTO;
import com.hz.pm.api.performance.model.req.PerformanceAppraisalListReq;
import com.hz.pm.api.performance.model.vo.PerformanceAppraisalProjectVO;
import com.hz.pm.api.performance.model.vo.PerformanceAppraisalVO;

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

/**
 * RectifyController
 * @return
 * @author CMM
 * @since 2023/08/12 15:45
 */
@RestController
@RequiredArgsConstructor
@Api(tags = "绩效评价-项目整改核查")
@RequestMapping("/api/v1/rectify-audit")
public class RectifyAuditController {

    private final RectifyAuditManage rectifyAuditManage;

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

    @GetMapping("/unAudit-list/{planId}")
    @ApiOperation("当前绩效评价待整改审核列表")
    public PageVo<PerformanceAppraisalProjectVO> unAuditList(@PathVariable Long planId, PerformanceAppraisalListReq req) {
        return rectifyAuditManage.unAuditList(planId,req);
    }

    @GetMapping("/audited-list/{planId}")
    @ApiOperation("当前绩效评价已整改审核列表")
    public PageVo<PerformanceAppraisalProjectVO> auditedList(@PathVariable Long planId,PerformanceAppraisalListReq req) {
        return rectifyAuditManage.auditedList(planId,req);
    }

    @PostMapping("/submit")
    @ApiOperation("提交整改审核结果")
    @WebLog(value = "提交整改审核结果",modular = "绩效评价-项目整改核查")
    public String submit(@Valid @RequestBody ProjectAppraisalDTO param){
        return rectifyAuditManage.submit(param);
    }

}
