package com.jeeplus.test.centerservice.controller;

import com.jeeplus.test.centerservice.dto.TranspondDTO;
import com.jeeplus.test.centerservice.service.TranspondService;
import com.jeeplus.test.reimbursement.reimbursementInfo.service.ReimbursementInfoService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 流程审核转发controller
 */
@Controller
@RequestMapping(value = "/transpond")
public class TranspondController {

    @Resource
    private ReimbursementInfoService reimbursementInfoService;
    @Resource
    private TranspondService transpondService;

    /**
     * 流程详情分发
     * @param id
     * @param processDefKey
     * @return
     */
    @RequestMapping(value = "detailDistribute", method = RequestMethod.GET)
    @ResponseBody
    public Object detailDistribute(@RequestParam String id, @RequestParam String processDefKey) {
        return transpondService.detailDistribute(id, processDefKey);
    }

    /**
     * 审核分发操作
     * @return
     */
    @RequestMapping(value = "auditDistribute", method = RequestMethod.POST)
    @ResponseBody
    public Map<String,Object> auditDistribute(@RequestBody TranspondDTO transpondDTO) {
        Map<String, Object> res = transpondService.auditDistribute(transpondDTO);
        return res;
    }
}
