/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.workfullexecute.web;

import com.google.common.collect.Lists;
import com.jeeplus.common.config.Global;
import com.jeeplus.common.json.AjaxJson;
import com.jeeplus.common.persistence.Page;
import com.jeeplus.common.utils.DateUtils;
import com.jeeplus.common.utils.MyBeanUtils;
import com.jeeplus.common.utils.StringUtils;
import com.jeeplus.common.utils.excel.ExportExcel;
import com.jeeplus.common.utils.excel.ImportExcel;
import com.jeeplus.common.web.BaseController;
import com.jeeplus.modules.act.entity.Act;
import com.jeeplus.modules.act.service.ActTaskService;
import com.jeeplus.modules.act.utils.ActUtils;
import com.jeeplus.modules.sys.entity.Office;
import com.jeeplus.modules.sys.entity.Role;
import com.jeeplus.modules.sys.entity.User;
import com.jeeplus.modules.sys.service.OfficeService;
import com.jeeplus.modules.sys.utils.UserUtils;
import com.jeeplus.modules.workactivity.entity.Activity;
import com.jeeplus.modules.workactivity.service.ActivityService;
import com.jeeplus.modules.workfullexecute.entity.WorkFullExecute;
import com.jeeplus.modules.workfullexecute.service.WorkFullExecuteService;
import com.jeeplus.modules.workfullmanage.entity.WorkFullManage;
import com.jeeplus.modules.workfullmanage.service.WorkFullManageService;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolationException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 项目实施Controller
 * @author fgy
 * @version 2017-10-27
 */
@SuppressWarnings("all")
@Controller
@RequestMapping(value = "${adminPath}/workfullexecute/workFullExecute")
public class WorkFullExecuteController extends BaseController {

	@Autowired
	private OfficeService officeService;
	@Autowired
	private ActTaskService actTaskService;
	@Autowired
	private WorkFullExecuteService workFullExecuteService;
	@Autowired
	private WorkFullManageService workFullManageService;
	@Autowired
	private ActivityService activityService;

	@ModelAttribute
	public WorkFullExecute get(@RequestParam(required=false) String id) {
		WorkFullExecute entity = null;
		if (StringUtils.isNotBlank(id)){
			entity = workFullExecuteService.get(id);
		}
		if (entity == null){
			entity = new WorkFullExecute();
		}
		return entity;
	}

	/**
	 * 待实施项目的列表
	 */
	@RequiresPermissions("workfullexecute:workFullExecute:workfullmanageList")
	@RequestMapping("/workfullmanageList")
	public String workfullmanageList(WorkFullManage workFullManage ,HttpServletRequest request, HttpServletResponse response,Model model){
		String userId = UserUtils.getUser().getId();
		//仅是普通员工
		if(!UserUtils.getSelectRoleInfo()){
			workFullManage.setQueryCon(userId);
		}

		Page<WorkFullManage> page = workFullExecuteService.findListOfWorkFullManage(new Page<WorkFullManage>(request, response), workFullManage);
		model.addAttribute("page", page);
		return "modules/workfullexecute/workfullmanageList";
	}
	/**
	 * 项目实施记录列表页面
	 */
	@RequiresPermissions("workfullexecute:workFullExecute:list")
	@RequestMapping(value = {"list", ""})
	public String list(WorkFullExecute workFullExecute, HttpServletRequest request, HttpServletResponse response, Model model) {
		String workFullManageId = request.getParameter("workFullManageId");

		if(StringUtils.isNotBlank(workFullManageId)){
			workFullExecute.setWorkFullManageId(workFullManageId);
		}
		Page<WorkFullExecute> page = workFullExecuteService.findPage(new Page<WorkFullExecute>(request, response), workFullExecute);
		model.addAttribute("page", page);
		model.addAttribute("workFullManage",workFullManageService.get(workFullManageId));

		if(page.getList()!=null && page.getList().size()==0){
			model.addAttribute("closeable","3");//无项目实施记录
		}else{
			WorkFullManage m = workFullManageService.getSimpleWorkFullManage(workFullManageId);
			if(Integer.parseInt(m.getFullProjectStatus())>=4){
				model.addAttribute("closeable","2");//实施阶段已过
			}else {
				Role role = UserUtils.getSelectRole().get(0);
				if(role.getDataScope().equals("4")){
					model.addAttribute("closeable","1");//部门负责人可关闭
				}else{
					model.addAttribute("closeable","0");//非部门负责人不可关闭
				}
			}
		}
		model.addAttribute("workFullManageId",workFullManageId);
		return "modules/workfullexecute/workFullExecuteList";
	}

	/**
	 * 项目实施列表，仅查看---全过程监控
	 */
	@RequestMapping("list4monitor")
	public String list4monitor(WorkFullExecute workFullExecute, HttpServletRequest request, HttpServletResponse response, Model model) {
		String workFullManageId = request.getParameter("workFullManageId");

		//workFullManageId = request.getSession().getAttribute("workFullManageId").toString();

		if(StringUtils.isNotBlank(workFullManageId)){
			workFullExecute.setWorkFullManageId(workFullManageId);
		}
		Page<WorkFullExecute> page = workFullExecuteService.findPage(new Page<WorkFullExecute>(request, response), workFullExecute);
		model.addAttribute("page", page);
		return "modules/workfullexecute/list4monitor";
	}

	/**
	 * 查看，增加，编辑项目实施记录表单页面
	 */
	@RequiresPermissions(value={"workfullexecute:workFullExecute:view","workfullexecute:workFullExecute:add","workfullexecute:workFullExecute:edit"},logical=Logical.OR)
	@RequestMapping(value = "form")
	public String form(WorkFullExecute workFullExecute, Model model,HttpServletRequest request) {
		String dialog = request.getParameter("dialog");
		String workFullManageId = request.getParameter("workFullManageId");
		String listpage = request.getParameter("listpage");
		if(StringUtils.isBlank(workFullManageId)){
			workFullManageId = workFullExecute.getWorkFullManageId();
		}
		if(StringUtils.isNotBlank(workFullManageId)){
			WorkFullManage workFullManage = workFullManageService.get(workFullManageId);
			model.addAttribute("workFullManage",workFullManage);
		}
		model.addAttribute("workFullExecute", workFullExecute);
		model.addAttribute("listpage",listpage);

		if(workFullExecute.getAct()!=null && StringUtils.isNotBlank(workFullExecute.getAct().getTaskId())){
			String taskId = workFullExecute.getAct().getTaskId();
			return "modules/workfullexecute/workFullExecuteAudit";
		}

		if("add".equals(dialog) || "edit".equals(dialog)){
			return "modules/workfullexecute/workFullExecuteForm";
		}
		if("view".equals(dialog)){
			return "modules/workfullexecute/workFullExecuteView";
		}
		return "modules/workfullexecute/workFullExecuteForm";
	}

	/**
	 * 保存项目实施记录
	 */
	@RequiresPermissions(value={"workfullexecute:workFullExecute:add","workfullexecute:workFullExecute:edit"},logical=Logical.OR)
	@RequestMapping(value = "save")
	public String save(WorkFullExecute workFullExecute, Model model,HttpServletRequest request,
					   @RequestParam(value = "listpage",required = false)String listpage,RedirectAttributes redirectAttributes) throws Exception{
		//被驳回（reapply重新申请，repeal撤销）
		String submit = request.getParameter("submit");
		String workFullManageId = request.getParameter("workFullManageId");
		if (!beanValidator(model, workFullExecute)){
			return form(workFullExecute, model,null);
		}
		if(!workFullExecute.getIsNewRecord()){//编辑表单保存
			WorkFullExecute t = workFullExecuteService.get(workFullExecute.getId());//从数据库取出记录的值
			MyBeanUtils.copyBeanNotNull2Bean(workFullExecute, t);//将编辑表单中的非NULL值覆盖数据库记录中的值

			//被驳回状态
			if (StringUtils.isNotBlank(t.getStatus()) &&t.getStatus().equals("3")){
				ProcessInstance processInstance = actTaskService.getProcIns(t.getProcessInstanceId());
				if (processInstance!=null) {
					Task taskInfok = actTaskService.getCurrentTaskInfo(processInstance);
					Act act = new Act();
					act.setTaskId(taskInfok.getId());
					act.setTaskName(taskInfok.getName());
					act.setTaskDefKey(taskInfok.getTaskDefinitionKey());
					act.setProcDefId(taskInfok.getProcessDefinitionId());
					act.setProcInsId(taskInfok.getProcessInstanceId());
					act.setTask(taskInfok);
					if("reapply".equals(submit)){act.setFlag("yes");}//重新申请
					if("repeal".equals(submit)){act.setFlag("no");}//撤销
					t.setAct(act);
				}
			}
			workFullExecuteService.save(t,workFullManageId,submit,request);//保存
			if("reapply".equals(submit)){
				addMessage(redirectAttributes,"重新申请项目实施，并发往部门负责人审核");
			} else if("repeal".equals(submit)){
				addMessage(redirectAttributes,"已撤销该项目实施");
			}
			return "redirect:"+Global.getAdminPath()+"/workfullexecute/workFullExecute/?repage";
		}else{//新增表单保存
			workFullExecute = workFullExecuteService.save(workFullExecute,workFullManageId,submit,request);//保存
			String result = StringUtils.isNoneBlank(workFullExecute.getId())?"添加项目实施成功":"项目实施添加失败";
			addMessage(redirectAttributes, result);
			if(StringUtils.isNotBlank(listpage)&&listpage.equals("workfullmanageList")){
				return "redirect:"+Global.getAdminPath()+"/workfullexecute/workFullExecute/"+listpage;
			}
			return "redirect:"+Global.getAdminPath()+"/workfullexecute/workFullExecute/?repage";
		}
	}

	/**
	 * 流程追踪
	 */
	@RequestMapping("getProcess")
	public String getProcess(WorkFullExecute workFullExecute, Model model){

		model.addAttribute("processInstanceId",workFullExecute.getProcessInstanceId());
		return "modules/workfullexecute/workFullExecuteTask";
	}
	/**
	 * 待办任务
	 */
	@RequestMapping("auditTodo")
	public String auditTodo(Act act , Model model ,HttpServletRequest request,HttpServletResponse response, RedirectAttributes redirectAttributes){
		act.setProcDefKey("workFullExecute");
		List<Act> actList = new ArrayList<>();
		actList.addAll(actTaskService.todoList(act));
		Office office = UserUtils.getSelectCompany();
		String companyId = office==null?"":office.getId();

		List<Activity> activities = activityService.groupByActivityMenu("190aeda1d370481ab80387a71080f93c",companyId);
		for (Activity activity:activities){
			act.setProcDefKey(activity.getProcessKey());
			actList.addAll(actTaskService.todoList(act));
		}

		List<WorkFullExecute> executesList = new ArrayList<>();
		Role role = UserUtils.getSelectRole().get(0);
		String officeId = "";
		if(role.getDataScope().equals("4")){
			User user = UserUtils.getUser();
			officeId = user.getOffice().getId();
		}

		for(Act a : actList){
			//重新申请和撤销不在代办和历史任务列表展示
			if("audit".equals(a.getTask().getTaskDefinitionKey())||(! "reapply".equals(a.getTask().getTaskDefinitionKey()) && !a.getTask().getTaskDefinitionKey().contains("audit"))){
				WorkFullExecute workFullExecute = workFullExecuteService.getByProcessInstanceId(a.getProcInsId());
				if(workFullExecute != null){
					workFullExecute = workFullExecuteService.get(workFullExecute.getId());
				}
				if(workFullExecute != null && workFullExecute.getCompanyId().equals(companyId)){
					User createBy = UserUtils.get(workFullExecute.getCreateBy().getId());
					if (StringUtils.isNotBlank(officeId)) {
						if (officeId.equals(createBy.getOffice().getId())) {
							if (a.getVars().getMap().get("applyUserId") != null) {
								User user = UserUtils.get(a.getVars().getMap().get("applyUserId").toString());
								if (user != null) {
									a.getVars().getMap().put("applyUserId", UserUtils.get(a.getVars().getMap().get("applyUserId").toString()).getName());
								}
							}
							workFullExecute.setAct(a);
							if (workFullExecute.getWorkFullManage() != null && workFullExecute.getWorkFullManage().getId() != null) {
								WorkFullManage workFullManage = workFullManageService.get(workFullExecute.getWorkFullManage().getId());
								workFullExecute.setWorkFullManage(workFullManage);
							}
							if (StringUtils.isNotBlank(workFullExecute.getId())) {
								workFullExecute.setName(officeService.get(companyId).getName());
							}
							executesList.add(workFullExecute);
						}
					}else{
						if(a.getVars().getMap().get("applyUserId") != null){
							User user = UserUtils.get(a.getVars().getMap().get("applyUserId").toString());
							if(user != null){
								a.getVars().getMap().put("applyUserId",UserUtils.get(a.getVars().getMap().get("applyUserId").toString()).getName());
							}
						}
						workFullExecute.setAct(a);
						if(workFullExecute.getWorkFullManage()!=null && workFullExecute.getWorkFullManage().getId()!=null){
							WorkFullManage workFullManage = workFullManageService.get(workFullExecute.getWorkFullManage().getId());
							workFullExecute.setWorkFullManage(workFullManage);
						}
						if(StringUtils.isNotBlank(workFullExecute.getId())){
							workFullExecute.setName(officeService.get(companyId).getName());
						}
						executesList.add(workFullExecute);
					}
				}
			}
		}

		model.addAttribute("list", executesList);
		return "modules/workfullexecute/workFullExecuteAuditTodo";

	}

	/**
	 * 已办任务
	 */
	@RequestMapping("auditHistory")
	public String auditHistory(Act act , Model model,HttpServletRequest request,HttpServletResponse response){
		act.setProcDefKey("workFullExecute");
		List<Act> list = actTaskService.historicList(act);
		Office office = UserUtils.getSelectCompany();
		String companyId = office==null?"":office.getId();

		List<Activity> activities = activityService.groupByActivityMenu("190aeda1d370481ab80387a71080f93c",companyId);
		for (Activity activity:activities){
			act.setProcDefKey(activity.getProcessKey());
			list.addAll(actTaskService.historicList(act));
		}

		List<WorkFullExecute> workFullExecuteList = new ArrayList<WorkFullExecute>();
		Role role = UserUtils.getSelectRole().get(0);
		String officeId = "";
		if(role.getDataScope().equals("4")){
			User user = UserUtils.getUser();
			officeId = user.getOffice().getId();
		}
		for (Act a : list) {
			//重新申请和撤销不展示在代办和历史任务列表里
			if(! "reapply".equals(a.getHistTask().getTaskDefinitionKey())){
				WorkFullExecute workFullExecute = workFullExecuteService.getByProcessInstanceId(a.getHistTask().getProcessInstanceId());
				if(workFullExecute != null){
					workFullExecute = workFullExecuteService.get(workFullExecute.getId());
				}
				if (workFullExecute != null && workFullExecute.getCompanyId().equals(companyId)) {
					User createBy = UserUtils.get(workFullExecute.getCreateBy().getId());
					if (StringUtils.isNotBlank(officeId)) {
						if (officeId.equals(createBy.getOffice().getId())) {
							if (a.getVars().getMap().get("applyUserId")!=null){
								a.getVars().getMap().put("applyUserId",UserUtils.get(a.getVars().getMap().get("applyUserId").toString()).getName());
							}
							workFullExecute.setAct(a);
							if(workFullExecute.getWorkFullManage()!=null && workFullExecute.getWorkFullManage().getId()!=null){
								WorkFullManage workFullManage = workFullManageService.get(workFullExecute.getWorkFullManage().getId());
								workFullExecute.setWorkFullManage(workFullManage);
							}
							if (StringUtils.isNotBlank(workFullExecute.getId())){
								workFullExecute.setName(officeService.get(companyId).getName());
							}
							workFullExecuteList.add(workFullExecute);
						}
					}else {
						if (a.getVars().getMap().get("applyUserId")!=null){
							a.getVars().getMap().put("applyUserId",UserUtils.get(a.getVars().getMap().get("applyUserId").toString()).getName());
						}
						workFullExecute.setAct(a);
						if(workFullExecute.getWorkFullManage()!=null && workFullExecute.getWorkFullManage().getId()!=null){
							WorkFullManage workFullManage = workFullManageService.get(workFullExecute.getWorkFullManage().getId());
							workFullExecute.setWorkFullManage(workFullManage);
						}
						if (StringUtils.isNotBlank(workFullExecute.getId())){
							workFullExecute.setName(officeService.get(companyId).getName());
						}
						workFullExecuteList.add(workFullExecute);
					}
				}
			}
		}
		model.addAttribute("list", workFullExecuteList);
		return "modules/workfullexecute/workFullExecuteAuditHistory";

	}

	/**
	 * 打开审核框
	 */
	@RequestMapping("applyOnWorkFullExecute")
	public String applyOnWorkFullExecute(Act act){
		// 获取流程XML上的表单KEY
		String formKey = "/workfullexecute/workFullExecute/form";
		//logger.info("------formKeys:"+formKeys);
		// 获取流程实例对象
		if (act.getProcInsId() != null){
			if(actTaskService.getProcIns(act.getProcInsId())!=null){
				act.setProcIns(actTaskService.getProcIns(act.getProcInsId()));
			}else{
				act.setFinishedProcIns(actTaskService.getFinishedProcIns(act.getProcInsId()));
			}
		}
		return "redirect:" + ActUtils.getFormUrl(formKey, act);
	}

	/**
	 * 部门负责人审核
	 */
	@RequestMapping("saveAudit")
	public String saveAudit(WorkFullExecute workFullExecute, Map<String, Object> vars, Model model, RedirectAttributes redirectAttributes) {
		/*if (StringUtils.isBlank(workFullExecute.getAct().getComment())){
			addMessage(model, "请填写审核意见。");
			return form(workFullExecute, model,null);
		}*/
		String message = workFullExecuteService.auditSave(workFullExecute);
		addMessage(redirectAttributes, message);
		return "redirect:"+Global.getAdminPath()+"/workfullexecute/workFullExecute/?repage";
	}
	/**
	 * 删除项目实施记录
	 */
	@RequiresPermissions("workfullexecute:workFullExecute:del")
	@RequestMapping(value = "delete")
	public String delete(WorkFullExecute workFullExecute, HttpServletRequest request, HttpServletResponse response, Model model) {
		workFullExecuteService.delete(workFullExecute);
		WorkFullExecute w = new WorkFullExecute();
		w.setWorkFullManageId(workFullExecute.getWorkFullManageId());
		model.addAttribute("workFullExecute",w);
		model.addAttribute("message","删除项目实施成功");
		return list(w,request,response,model);
	}
	/**
	 *  删除附件（实施文件或底稿）
	 */
	@ResponseBody
	@RequestMapping("delFile")
	public AjaxJson delFile(WorkFullExecute workFullExecute , HttpServletRequest request, HttpServletResponse response,Model model){
//		String attachmentFlag = request.getParameter("attachmentFlag");
//		workFullExecuteService.delFile(workFullExecute,attachmentFlag);
//		workFullExecute = workFullExecuteService.get(workFullExecute.getId());
//		model.addAttribute("workFullExecute",workFullExecute);
//		return form(workFullExecute,model,request);
		String workFullDesignchangeId = request.getParameter("id");
		String attaId = request.getParameter("attaId");
		String attachmentUrl = request.getParameter("attachmentUrl");
		workFullExecute.setRemarks(attaId);
		workFullExecuteService.delFile(workFullExecute,attachmentUrl);
		AjaxJson ajaxJson = new AjaxJson();
		ajaxJson.put("attachmentUrl",attachmentUrl);
		return ajaxJson;
	}
	//结束项目实施，由部门负责人操作
	@RequestMapping("closeWorkFullExecute")
	public String closeWorkFullExecute(@RequestParam("workFullManageId") String workFullManageId,RedirectAttributes redirectAttributes,Model model){
		WorkFullExecute workFullExecute = new WorkFullExecute();
		if(StringUtils.isNotBlank(workFullManageId)){
			workFullExecute.setWorkFullManageId(workFullManageId);
			int flag = workFullExecuteService.updateWorkFullManageStatus(workFullExecute);
			if(flag == 0){
				addMessage(redirectAttributes,"关闭项目实施成功！");
			}else{
				addMessage(redirectAttributes,"项目实施列表中有些未完成审批，请等待全部流程完成，再次尝试此操作");
				//return "redirect:"+Global.getAdminPath()+"/workfullexecute/workFullExecute/auditTodo";
			}
		}
		return "redirect:"+Global.getAdminPath()+"/workfullexecute/workFullExecute/?repage";
	}

	/**
	 * 批量删除项目实施记录 （暂时不做批量删除操作，该方法没有写完整）
	 */
//	@RequiresPermissions("workfullexecute:workFullExecute:del")
//	@RequestMapping(value = "deleteAll")
//	public String deleteAll(String ids, RedirectAttributes redirectAttributes) {
//		String idArray[] =ids.split(",");
//		for(String id : idArray){
//			workFullExecuteService.delete(workFullExecuteService.get(id));
//		}
//		addMessage(redirectAttributes, "删除项目实施记录成功");
//		return "redirect:"+Global.getAdminPath()+"/workfullexecute/workFullExecute/?repage";
//	}
	
	/**
	 * 导出excel文件
	 */
	@RequiresPermissions("workfullexecute:workFullExecute:export")
    @RequestMapping(value = "export", method=RequestMethod.POST)
    public String exportFile(WorkFullExecute workFullExecute, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
		try {
            String fileName = "项目实施记录"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
            Page<WorkFullExecute> page = workFullExecuteService.findPage(new Page<WorkFullExecute>(request, response, -1), workFullExecute);
    		new ExportExcel("项目实施记录", WorkFullExecute.class).setDataList(page.getList()).write(response, fileName).dispose();
    		return null;
		} catch (Exception e) {
			addMessage(redirectAttributes, "导出项目实施记录记录失败！失败信息："+e.getMessage());
		}
		return "redirect:"+Global.getAdminPath()+"/workfullexecute/workFullExecute/?repage";
    }

	/**
	 * 导入Excel数据

	 */
	@RequiresPermissions("workfullexecute:workFullExecute:import")
    @RequestMapping(value = "import", method=RequestMethod.POST)
    public String importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
		try {
			int successNum = 0;
			int failureNum = 0;
			StringBuilder failureMsg = new StringBuilder();
			ImportExcel ei = new ImportExcel(file, 1, 0);
			List<WorkFullExecute> list = ei.getDataList(WorkFullExecute.class);
			for (WorkFullExecute workFullExecute : list){
				try{
					workFullExecuteService.save(workFullExecute);
					successNum++;
				}catch(ConstraintViolationException ex){
					failureNum++;
				}catch (Exception ex) {
					failureNum++;
				}
			}
			if (failureNum>0){
				failureMsg.insert(0, "，失败 "+failureNum+" 条项目实施记录记录。");
			}
			addMessage(redirectAttributes, "已成功导入 "+successNum+" 条项目实施记录记录"+failureMsg);
		} catch (Exception e) {
			addMessage(redirectAttributes, "导入项目实施记录失败！失败信息："+e.getMessage());
		}
		return "redirect:"+Global.getAdminPath()+"/workfullexecute/workFullExecute/?repage";
    }
	
	/**
	 * 下载导入项目实施记录数据模板
	 */
	@RequiresPermissions("workfullexecute:workFullExecute:import")
    @RequestMapping(value = "import/template")
    public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
		try {
            String fileName = "项目实施记录数据导入模板.xlsx";
    		List<WorkFullExecute> list = Lists.newArrayList(); 
    		new ExportExcel("项目实施记录数据", WorkFullExecute.class, 1).setDataList(list).write(response, fileName).dispose();
    		return null;
		} catch (Exception e) {
			addMessage(redirectAttributes, "导入模板下载失败！失败信息："+e.getMessage());
		}
		return "redirect:"+Global.getAdminPath()+"/workfullexecute/workFullExecute/?repage";
    }
	
	
	

}