package com.uas.platform.b2b.mobile.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.uas.platform.b2b.mobile.service.PublicInterForDetailService;

/**
 * 单据详情的公共接口
 * 
 * @author hejq
 * @time 创建时间：2017年3月18日
 */
@Controller("mobile.PublicInterForDetailController")
@RequestMapping("/mobile/detailCenter")
public class PublicInterForDetailController {

	@Autowired
	private PublicInterForDetailService publicInterForDetailService;

	/**
	 * 获取单据详情
	 * 
	 * @param id
	 * @param whichpage
	 * @return
	 */
	@RequestMapping(value = "/getDetail", method = RequestMethod.GET)
	@ResponseBody
	private ModelMap getDocumentsDetail(Long id, Integer whichpage) {
		return publicInterForDetailService.getDocumentsDetail(id, whichpage);
	}
	
	/**
	 * 删除单据
	 * 
	 * @param id
	 * @param whichpage
	 * @return
	 */
	@RequestMapping(value = "/deleteDocuments", method = RequestMethod.POST)
	@ResponseBody
	private ModelMap deleteDocuments(Long id, Integer whichpage) {
		return publicInterForDetailService.deleteDocuments(id, whichpage);
	}
	
	/**
	 * 重新提交单据
	 * 
	 * @param id
	 * @param whichpage
	 * @return
	 */
	@RequestMapping(value = "/resubmitDocuments", method = RequestMethod.POST)
	@ResponseBody
	private ModelMap resubmitDocuments(Long id, Integer whichpage) {
		return publicInterForDetailService.resubmitDocuments(id, whichpage);
	}

	/**
	 * 变更处理人
	 * 
	 * @param id
	 * @param emcode
	 * @param reason
	 * @return
	 */
	@RequestMapping(value = "/changeDealMan", method = RequestMethod.POST)
	@ResponseBody
	private ModelMap changeDealMan(Long id, Long emcode, String reason) {
		return publicInterForDetailService.changeDealMan(id, emcode, reason);
	}
}
