package com.zcxk.evaluation.controller;

import com.zcxk.evaluation.service.EvaluationResultTaskDetailsService;
import com.zcxk.evaluation.vo.EvaluationResultTaskDetailsVo;
import com.zcxk.model.AjaxMessage;
import com.zcxk.model.ResultStatus;
import com.zcxk.util.IntegerUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName EvaluationResultTaskDetailsController
 * @Description: 绩效考评任务详情
 * @Author lihui
 * @Date 2021/5/7
 * @Version V1.0
 **/
@RestController
@RequestMapping("/evaluation/task")
@Api(tags = "考评任务结果详情")
public class EvaluationResultTaskDetailsController {

    @Autowired
    private EvaluationResultTaskDetailsService evaluationResultTaskDetailsService;

    @ApiOperation(value = "查询考评结果任务详情")
    @RequestMapping(value = "/find", method = RequestMethod.POST)
    @ResponseBody
    public AjaxMessage<EvaluationResultTaskDetailsVo> find(@RequestParam Integer evaluationResultId) {
        if (IntegerUtil.isNullOrZero(evaluationResultId)) {
            return new AjaxMessage<>(ResultStatus.PARAM_ERROR.getStatus(), "参数错误", null);
        }
        return new AjaxMessage<>(ResultStatus.OK, evaluationResultTaskDetailsService.findResultTaskDetail(evaluationResultId));
    }

}

