//package com.jeeww.web.activiti.controller.processinstancemanage;
//
//import java.util.Locale;
//import javax.servlet.http.HttpServletRequest;
//
//import org.activiti.engine.runtime.ProcessInstance;
//import org.apache.log4j.Logger;
//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 org.springframework.web.servlet.ModelAndView;
//
//import com.jeeww.activiti.ActivitiConstants;
//import com.jeeww.activiti.ActivitiUtils;
//import com.jeeww.activiti.service.ActivitiCoreService;
//import com.jeeww.core.utils.AgileUiDataUtils;
//import com.jeeww.core.vo.Pager;
//import com.jeeww.web.BaseController;
//import com.jeeww.web.activiti.dto.ActivitiSearchModel;
//
///**
// * 功能描述：流程定义相关操作.
// */
//@Controller
//@RequestMapping("/activiti")
//public class ProcessInstanceManageController extends BaseController {
//    /**
//     * logger.
//     */
//    private Logger logger = Logger.getLogger(ProcessInstanceManageController.class);
//    /**
//     * 图片大小.
//     */
//    public static final int C_M_SIZE = 1024;
//    /**
//     * 跳转路径.
//     */
//    public static final String C_FILE_PATH = ActivitiConstants.WEBAPP_ACTIVITI + "processinstancemanage/";
//    /**
//     * activitiCoreService.
//     */
//    @Autowired
//    private ActivitiCoreService activitiCoreService;
//
//    /**
//     * 功能描述 :跳转到流程实例管理页面.
//     * @param locale locale
//     * @param model model
//     * @param req req
//     * @return ModelAndView
//     * @throws Exception e
//     */
//    @RequestMapping(
//            value = "/toProcessInstancePage.do", method = RequestMethod.GET)
//    public ModelAndView toProcessInstancePage(final Locale locale, final ModelMap model, final HttpServletRequest req)
//            throws Exception {
//        if (logger.isDebugEnabled()) {
//            logger.info("跳转到流程实例管理页面.");
//        }
//        return new ModelAndView(C_FILE_PATH + "processinstance_main", model);
//    }
//
//    /**
//     * 功能描述 :获取流程实例信息.
//     * @param req req.
//     * @return String 返回流程实例信息.
//     * @throws Exception e.
//     */
//    @RequestMapping(
//            value = "/getProcessInstances.do", method = RequestMethod.POST)
//    @ResponseBody
//    public String getProcessInstances(final HttpServletRequest req) throws Exception {
//        if (logger.isDebugEnabled()) {
//            logger.debug("获取流程实例信息.");
//        }
//        ActivitiSearchModel activitiSearchModel = new ActivitiSearchModel();
//        Pager<ProcessInstance> pager = new Pager<ProcessInstance>();
//        AgileUiDataUtils.initPager(pager, activitiSearchModel, req);
//        activitiCoreService.getProcessInstances(pager);
//        return ActivitiUtils.getProcessInstanceGrid(pager);
//    }
//}
