package com.yh.saas.platform.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.yh.saas.platform.entity.view.FlowTaskCandidateStaffView;
import com.yh.saas.platform.service.IFlowTaskCandidateService;

/**
 * 工作流候选API
 * 
 * @author gdc
 */
@RequestMapping("/flowTaskCandidate")
@RestController
public class FlowTaskCandidateController {

	@Autowired
	private IFlowTaskCandidateService flowTaskCandidateService;

	/**
	 * 获取候选人信息
	 * 
	 * @param workflowId  工作流ID
	 * @param businessKey 业务ID
	 * @return 候选人信息
	 */
	@GetMapping("/query/candidateStaffInfo")
	public FlowTaskCandidateStaffView getCandidateStaffInfo(@RequestParam String workflowId,
			@RequestParam String businessKey) {
		return flowTaskCandidateService.getCandidateStaffInfo(workflowId, businessKey);
	}

	/**
	 *  获取预选人信息
	 * @param businessCode 业务code
	 * @return 返回候选人信息
	 */
	@GetMapping("/query/findPreReveiewerStaffInfo")
	public FlowTaskCandidateStaffView findPreReveiewerStaffInfo(@RequestParam String businessCode) {
		return flowTaskCandidateService.findPreReveiewerStaffInfo(businessCode);
	}

}
