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

import com.google.common.collect.Lists;
import com.jeeplus.common.config.Global;
import com.jeeplus.common.persistence.Page;
import com.jeeplus.common.utils.DateUtils;
import com.jeeplus.common.utils.IdGen;
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.common.websocket.onchat.ChatServerPool;
import com.jeeplus.modules.act.entity.Act;
import com.jeeplus.modules.act.service.ActTaskService;
import com.jeeplus.modules.caseinfo.entity.CaseInfo;
import com.jeeplus.modules.caseinfo.service.CaseInfoService;
import com.jeeplus.modules.hr.entity.UserInfo;
import com.jeeplus.modules.iim.entity.MailBox;
import com.jeeplus.modules.iim.entity.MailPage;
import com.jeeplus.modules.iim.service.MailBoxService;
import com.jeeplus.modules.leaveapply.dao.LeaveDetailDao;
import com.jeeplus.modules.leaveapply.entity.LeaveApply;
import com.jeeplus.modules.leaveapply.entity.LeaveDetail;
import com.jeeplus.modules.leaveapply.service.LeaveApplyService;
import com.jeeplus.modules.oa.entity.Leave;
import com.jeeplus.modules.oa.entity.OaNotify;
import com.jeeplus.modules.oa.service.LeaveService;
import com.jeeplus.modules.oa.service.OaNotifyService;
import com.jeeplus.modules.oa_evection.entity.oa_evection.OaEvection;
import com.jeeplus.modules.oa_evection.service.oa_evection.OaEvectionService;
import com.jeeplus.modules.oaall.entity.OaAll;
import com.jeeplus.modules.oaall.service.OaAllService;
import com.jeeplus.modules.oabuy.entity.OaBuy;
import com.jeeplus.modules.oabuy.service.OaBuyService;
import com.jeeplus.modules.oaperformance.entity.OaPerformance;
import com.jeeplus.modules.oaperformance.service.OaPerformanceService;
import com.jeeplus.modules.officeintroduce.dao.OfficeintroduceDao;
import com.jeeplus.modules.officeintroduce.entity.Officeintroduce;
import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportRecord;
import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
import com.jeeplus.modules.projectcontentinfo.service.ProjectReportChangeService;
import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
import com.jeeplus.modules.projectcontentinfo.service.ProjectReportRecordService;
import com.jeeplus.modules.projectcontentinfo.service.ProjectcontentinfoService;
import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
import com.jeeplus.modules.projectrecord.entity.ProjectRecordsAlter;
import com.jeeplus.modules.projectrecord.service.ProjectRecordsAlterService;
import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecordsAlter;
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsAlterService;
import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
import com.jeeplus.modules.serialnum.service.SerialNumTplService;
import com.jeeplus.modules.sys.entity.*;
import com.jeeplus.modules.sys.service.CompanyService;
import com.jeeplus.modules.sys.service.OfficeService;
import com.jeeplus.modules.sys.utils.UserUtils;
import com.jeeplus.modules.sysuseroffice.entity.Useroffice;
import com.jeeplus.modules.sysuseroffice.service.UserofficeService;
import com.jeeplus.modules.syswarning.entity.SysWarning;
import com.jeeplus.modules.syswarning.service.SysWarningService;
import com.jeeplus.modules.workadministrativeatamp.entity.WorkAdministrativeAtamp;
import com.jeeplus.modules.workadministrativeatamp.service.WorkAdministrativeAtampService;
import com.jeeplus.modules.workaskcheckprice.entity.WorkAskCheckPrice;
import com.jeeplus.modules.workaskcheckprice.service.WorkAskCheckPriceService;
import com.jeeplus.modules.workattendance.entity.WorkAttendanceCount;
import com.jeeplus.modules.workattendance.entity.WorkAttendanceInfo;
import com.jeeplus.modules.workattendance.service.WorkAttendanceCountService;
import com.jeeplus.modules.workattendance.service.WorkAttendanceInfoService;
import com.jeeplus.modules.workbidingdocument.entity.WorkBidingDocument;
import com.jeeplus.modules.workbidingdocument.service.WorkBidingDocumentService;
import com.jeeplus.modules.workbidingproject.entity.WorkBidingProject;
import com.jeeplus.modules.workbidingproject.service.WorkBidingProjectService;
import com.jeeplus.modules.workbidproject.entity.WorkBidProject;
import com.jeeplus.modules.workbidproject.service.WorkBidProjectService;
import com.jeeplus.modules.workborrowmangement.entity.WorkBorrowBack;
import com.jeeplus.modules.workborrowmangement.entity.WorkBorrowMangement;
import com.jeeplus.modules.workborrowmangement.service.WorkBorrowBackService;
import com.jeeplus.modules.workborrowmangement.service.WorkBorrowMangementService;
import com.jeeplus.modules.workchangejob.entity.WorkChangeJob;
import com.jeeplus.modules.workchangejob.entity.WorkChangeJobUser;
import com.jeeplus.modules.workchangejob.service.WorkChangeJobService;
import com.jeeplus.modules.workchangejob.service.WorkChangeJobUserService;
import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
import com.jeeplus.modules.workcontractrecord.entity.WorkContractRecord;
import com.jeeplus.modules.workcontractrecord.service.WorkContractRecordService;
import com.jeeplus.modules.workcontractsignature.entity.WorkContractSignature;
import com.jeeplus.modules.workcontractsignature.service.WorkContractSignatureService;
import com.jeeplus.modules.workdailyroutine.entity.WorkDailyRoutine;
import com.jeeplus.modules.workdailyroutine.entity.WorkDailyRoutineDetail;
import com.jeeplus.modules.workdailyroutine.service.WorkDailyRoutineDetailService;
import com.jeeplus.modules.workdailyroutine.service.WorkDailyRoutineService;
import com.jeeplus.modules.workengineeringproject.entity.WorkEngineeringProject;
import com.jeeplus.modules.workengineeringproject.service.WorkEngineeringProjectService;
import com.jeeplus.modules.workexample.entity.WorkExample;
import com.jeeplus.modules.workexample.service.WorkExampleService;
import com.jeeplus.modules.workfield.entity.WorkField;
import com.jeeplus.modules.workfield.service.WorkFieldService;
import com.jeeplus.modules.workfullconstructsheet.entity.WorkFullConstructsheet;
import com.jeeplus.modules.workfullconstructsheet.service.WorkFullConstructsheetService;
import com.jeeplus.modules.workfulldesignchange.entity.WorkFullDesignchange;
import com.jeeplus.modules.workfulldesignchange.service.WorkFullDesignchangeService;
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.entity.WorkFullPay;
import com.jeeplus.modules.workfullmanage.entity.WorkFullRecord;
import com.jeeplus.modules.workfullmanage.service.WorkFullManageService;
import com.jeeplus.modules.workfullmanage.service.WorkFullPayService;
import com.jeeplus.modules.workfullmanage.service.WorkFullRecordService;
import com.jeeplus.modules.workfullmeetingminutes.entity.WorkFullMeetingminutes;
import com.jeeplus.modules.workfullmeetingminutes.service.WorkFullMeetingminutesService;
import com.jeeplus.modules.workfullproprietorsheet.entity.WorkFullProprietorsheet;
import com.jeeplus.modules.workfullproprietorsheet.service.WorkFullProprietorsheetService;
import com.jeeplus.modules.workfullsupervisorsheet.entity.WorkFullSupervisorsheet;
import com.jeeplus.modules.workfullsupervisorsheet.service.WorkFullSupervisorsheetService;
import com.jeeplus.modules.workgoout.entity.GoOut;
import com.jeeplus.modules.workgoout.service.GoOutService;
import com.jeeplus.modules.workincomingmessage.entity.WorkIncomingMessage;
import com.jeeplus.modules.workincomingmessage.service.WorkIncomingMessageService;
import com.jeeplus.modules.workinvoice.entity.WorkInvoice;
import com.jeeplus.modules.workinvoice.service.WorkInvoiceService;
import com.jeeplus.modules.workinvoicealter.entity.WorkInvoiceAlter;
import com.jeeplus.modules.workinvoicealter.service.WorkInvoiceAlterService;
import com.jeeplus.modules.workinvoicedetail.entity.WorkInvoiceDetail;
import com.jeeplus.modules.workinvoicedetail.service.WorkInvoiceDetailService;
import com.jeeplus.modules.workinvoicereturn.entity.WorkInvoiceReturn;
import com.jeeplus.modules.workinvoicereturn.service.WorkInvoiceReturnService;
import com.jeeplus.modules.workinvoicereturnalter.entity.WorkInvoiceReturnAlter;
import com.jeeplus.modules.workinvoicereturnalter.service.WorkInvoiceReturnAlterService;
import com.jeeplus.modules.workitemcollar.entity.WorkItemCollar;
import com.jeeplus.modules.workitemcollar.entity.WorkItemCollarCatalog;
import com.jeeplus.modules.workitemcollar.entity.WorkItemCollarItem;
import com.jeeplus.modules.workitemcollar.service.WorkItemCollarService;
import com.jeeplus.modules.workitemstock.entity.WorkItemStock;
import com.jeeplus.modules.workitemstock.service.WorkItemStockService;
import com.jeeplus.modules.workloan.entity.WorkLoan;
import com.jeeplus.modules.workloan.service.WorkLoanService;
import com.jeeplus.modules.workofficechange.entity.WorkOfficeChange;
import com.jeeplus.modules.workofficechange.entity.WorkOfficeChangeUser;
import com.jeeplus.modules.workofficechange.service.WorkOfficeChangeService;
import com.jeeplus.modules.workofficechange.service.WorkOfficeChangeUserService;
import com.jeeplus.modules.workout.entity.WorkOut;
import com.jeeplus.modules.workout.service.WorkOutService;
import com.jeeplus.modules.workovertime.entity.WorkOvertime;
import com.jeeplus.modules.workovertime.service.WorkOvertimeService;
import com.jeeplus.modules.workovertimeform.entity.WorkOvertimeForm;
import com.jeeplus.modules.workovertimeform.service.WorkOvertimeFormService;
import com.jeeplus.modules.workpayment.entity.WorkPayment;
import com.jeeplus.modules.workpayment.service.WorkPaymentService;
import com.jeeplus.modules.workpettycash.entity.WorkPettyCash;
import com.jeeplus.modules.workpettycash.service.WorkPettyCashService;
import com.jeeplus.modules.workproject.entity.WorkProject;
import com.jeeplus.modules.workproject.service.WorkProjectService;
import com.jeeplus.modules.workprojectcompletion.entity.WorkProjectCompletionInfo;
import com.jeeplus.modules.workprojectcompletion.service.WorkProjectCompletionService;
import com.jeeplus.modules.workprojectdeposit.entity.WorkProjectDeposit;
import com.jeeplus.modules.workprojectdeposit.service.WorkProjectDepositService;
import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
import com.jeeplus.modules.workreceiptsrevise.entity.WorkReceiptsRevise;
import com.jeeplus.modules.workreceiptsrevise.service.WorkReceiptsReviseService;
import com.jeeplus.modules.workreceiptssettle.entity.WorkReceiptsSettle;
import com.jeeplus.modules.workreceiptssettle.service.WorkReceiptsSettleService;
import com.jeeplus.modules.workregularapply.entity.WorkRegularApply;
import com.jeeplus.modules.workregularapply.entity.WorkRegularScore;
import com.jeeplus.modules.workregularapply.service.WorkRegularApplyService;
import com.jeeplus.modules.workregularapply.service.WorkRegularScoreService;
import com.jeeplus.modules.workreimbur.entity.WorkReimbur;
import com.jeeplus.modules.workreimbur.service.WorkReimburService;
import com.jeeplus.modules.workreimbursement.entity.WorkReimbursement;
import com.jeeplus.modules.workreimbursement.service.WorkReimbursementService;
import com.jeeplus.modules.workrelationship.entity.WorkRelationship;
import com.jeeplus.modules.workrelationship.service.WorkRelationshipService;
import com.jeeplus.modules.workrepay.entity.WorkRepay;
import com.jeeplus.modules.workrepay.service.WorkRepayService;
import com.jeeplus.modules.workresignation.entity.WorkResignation;
import com.jeeplus.modules.workresignation.service.WorkResignationService;
import com.jeeplus.modules.workresignationtemplate.entity.WorkResignationTemplate;
import com.jeeplus.modules.workreview.entity.WorkReviewAudit;
import com.jeeplus.modules.workreview.entity.WorkReviewStandard;
import com.jeeplus.modules.workreview.service.WorkReviewStandardService;
import com.jeeplus.modules.workscrap.entity.WorkScrap;
import com.jeeplus.modules.workscrap.service.WorkScrapService;
import com.jeeplus.modules.worksealform.entity.WorkSealForm;
import com.jeeplus.modules.worksealform.service.WorkSealFormService;
import com.jeeplus.modules.worksendmessage.entity.WorkSendMessage;
import com.jeeplus.modules.worksendmessage.service.WorkSendMessageService;
import com.jeeplus.modules.worksinglewage.entity.WorkSingleWage;
import com.jeeplus.modules.worksinglewage.service.WorkSingleWageService;
import com.jeeplus.modules.workstaff.entity.WorkStaffBasicInfo;
import com.jeeplus.modules.workstaff.service.WorkStaffBasicInfoService;
import com.jeeplus.modules.workstock.entity.WorkStock;
import com.jeeplus.modules.workstock.service.WorkStockService;
import com.jeeplus.modules.workstockcontract.entity.WorkStockContract;
import com.jeeplus.modules.workstockcontract.service.WorkStockContractService;
import com.jeeplus.modules.workvisa.entity.WorkVisa;
import com.jeeplus.modules.workvisa.service.WorkVisaService;
import org.activiti.engine.HistoryService;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.java_websocket.WebSocket;
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.*;

/**
 * 通知Controller
 * @author yangfan
 * @version 2017-11-10
 */
@SuppressWarnings("all")
@Controller
@RequestMapping(value = "${adminPath}/workprojectnotify/workProjectNotify")
public class WorkProjectNotifyController extends BaseController {

	@Autowired
	private WorkFullManageService workFullManageService;
	@Autowired
	private WorkExampleService workExampleService;
	@Autowired
	private WorkLoanService workLoanService;

	@Autowired
	private CaseInfoService caseInfoService;
	@Autowired
	private WorkOvertimeService workOvertimeService;
	@Autowired
	private WorkOutService workOutService;
	@Autowired
	private WorkFieldService workFieldService;
	@Autowired
	private WorkResignationService workResignationService;

	@Autowired
	private OfficeService officeService;
	@Autowired
	private WorkBidingDocumentService workBidingDocumentService;
	@Autowired
	private WorkFullExecuteService workFullExecuteService;
	@Autowired
	private WorkFullMeetingminutesService workFullMeetingminutesService;
	@Autowired
	private WorkFullDesignchangeService workFullDesignchangeService;
	@Autowired
	private WorkFullProprietorsheetService workFullProprietorsheetService;
	@Autowired
	private OaBuyService oaBuyService;
	@Autowired
	private OaPerformanceService oaPerformanceService;
	@Autowired
	private WorkContractRecordService workContractRecordService;
	@Autowired
	private SerialNumTplService serialNumTplService;

	@Autowired
	private WorkFullSupervisorsheetService workFullSupervisorsheetService;
	@Autowired
	private WorkFullConstructsheetService workFullConstructsheetService;
	@Autowired
	private WorkProjectNotifyService workProjectNotifyService;
	@Autowired
	private WorkBidProjectService workBidProjectService;
	@Autowired
	private WorkProjectDepositService workProjectDepositService;
	@Autowired
	private WorkItemStockService workItemStockService;

	@Autowired
	private WorkEngineeringProjectService workEngineeringProjectService;
	@Autowired
	private WorkFullRecordService workFullRecordService;
	@Autowired
	private WorkInvoiceService workInvoiceService;
	@Autowired
	private WorkReimbursementService workReimbursementService;
	@Autowired
	private OaNotifyService oaNotifyService;
	@Autowired
	private MailBoxService mailBoxService;
	@Autowired
	private WorkProjectCompletionService workProjectCompletionService;
	@Autowired
	private WorkContractInfoService workContractInfoService;
	@Autowired
	private WorkFullPayService workFullPayService;
	@Autowired
	private WorkAskCheckPriceService workAskCheckPriceService;
	@Autowired
	private WorkVisaService workVisaService;
	@Autowired
	private CompanyService companyService;
	@Autowired
	private LeaveService leaveService;
	@Autowired
	private GoOutService goOutService;
	@Autowired
	private WorkProjectService workProjectService;
	@Autowired
	private WorkBorrowMangementService workBorrowMangementService;
	@Autowired
	private UserofficeService userofficeService;
	@Autowired
	private WorkSealFormService workSealFormService;
	@Autowired
	private WorkOvertimeFormService workOvertimeFormService;
	@Autowired
	private OaEvectionService oaEvectionService;
	@Autowired
	private WorkBidingProjectService workBidingProjectService;
	@Autowired
	private OaAllService oaAllService;
	@Autowired
	private WorkPettyCashService workPettyCashService;
	@Autowired
	private WorkPaymentService workPaymentService;
	@Autowired
	private WorkInvoiceAlterService workInvoiceAlterService;
	@Autowired
	private WorkContractSignatureService workContractSignatureService;
	@Autowired
	private WorkReimburService workReimburService;
	@Autowired
	private OfficeintroduceDao officeintroduceDao;
	@Autowired
	private ActTaskService actTaskService;
	@Autowired
	protected HistoryService historyService;
	@Autowired
	protected WorkInvoiceDetailService workInvoiceDetailService;
    @Autowired
    private ProjectRecordsService projectRecordsService;
    @Autowired
    private RuralProjectRecordsService ruralProjectRecordsService;
	@Autowired
	private ProjectRecordsAlterService projectRecordsAlterService;
	@Autowired
	private RuralProjectRecordsAlterService ruralProjectRecordsAlterService;
	@Autowired
	private ProjectReportDataService projectReportDataService;
	@Autowired
	private ProjectcontentinfoService projectcontentinfoService;
	@Autowired
	private ProjectReportChangeService projectReportChangeService;
	@Autowired
	private WorkInvoiceReturnService workInvoiceReturnService;
	@Autowired
	private WorkInvoiceReturnAlterService workInvoiceReturnAlterService;
	@Autowired
	private WorkReviewStandardService workReviewStandardService;
	@Autowired
	private ProjectReportRecordService projectReportRecordService;
    @Autowired
    private WorkReceiptsSettleService workReceiptsSettleService;
	@Autowired
	private WorkReceiptsReviseService workReceiptsReviseService;
    @Autowired
    private WorkIncomingMessageService workIncomingMessageService;
    @Autowired
    private WorkAdministrativeAtampService workAdministrativeAtampService;
    @Autowired
    private WorkDailyRoutineDetailService workDailyRoutineDetailService;
    @Autowired
    private WorkDailyRoutineService workDailyRoutineService;
	@Autowired
	private WorkBorrowBackService workBorrowBackService;
	@Autowired
	private WorkStockContractService workStockContractService;
    @Autowired
    private WorkSendMessageService workSendMessageService;
	@Autowired
	private WorkStockService workStockService;
	@Autowired
	private WorkScrapService workScrapService;
	@Autowired
	private WorkItemCollarService workItemCollarService;
	@Autowired
	private WorkRegularApplyService workRegularApplyService;
	@Autowired
	private WorkRegularScoreService workRegularScoreService;
	@Autowired
	private WorkOfficeChangeService workOfficeChangeService;
	@Autowired
	private WorkOfficeChangeUserService workOfficeChangeUserService;
    @Autowired
    private WorkStaffBasicInfoService workStaffBasicInfoService;
	@Autowired
	private WorkChangeJobService workChangeJobService;
	@Autowired
	private WorkChangeJobUserService workChangeJobUserService;
	@Autowired
	private WorkRelationshipService workRelationshipService;
	@Autowired
	private SysWarningService sysWarningService;
	@Autowired
	private LeaveApplyService leaveApplyService;
	@Autowired
	private LeaveDetailDao leaveDetailDao;
	@Autowired
	private WorkAttendanceInfoService workAttendanceInfoService;
	@Autowired
	private WorkAttendanceCountService workAttendanceCountService;
	@Autowired
	private WorkSingleWageService workSingleWageService;
	@Autowired
	private WorkRepayService workRepayService;

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

	/**
	 * 通知列表页面
	 */
	@RequestMapping(value = {"list", ""})
	public String list(WorkProjectNotify workProjectNotify, HttpServletRequest request, HttpServletResponse response, Model model) {
		User user = UserUtils.getUser();
		workProjectNotify.setUser(user);
		workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
		workProjectNotify.setRemarks("待审批");
		Page<WorkProjectNotify> pageList = workProjectNotifyService.findPage(new Page<WorkProjectNotify>(request, response),workProjectNotify);
		model.addAttribute("page", pageList);
		return "modules/workprojectnotify/workProjectNotifyList";
	}

	/**
	 * 通知列表页面
	 */
	@RequestMapping(value = {"lists", ""})
	public String lists(WorkProjectNotify notify, HttpServletRequest request, HttpServletResponse response, Model model) {
		User user = UserUtils.getUser();
		notify.setRemarks("待审批");
		if(StringUtils.isBlank(notify.getStatus())){
			notify.setStatus("-1");
		}
		notify.setUser(user);
		notify.setCompanyId(UserUtils.getSelectCompany().getId());
		Page<WorkProjectNotify> pageList = workProjectNotifyService.findPages(new Page<WorkProjectNotify>(request, response),notify);
		for (WorkProjectNotify workProjectNotify:pageList.getList()){
			String type = workProjectNotify.getType();
			String processInstanceId = "";
			if(workProjectNotify.getType().equals("1")){
				WorkBidProject workBidProject =workBidProjectService.get(workProjectNotify.getNotifyId());
				if (workBidProject!=null){
					processInstanceId = workBidProject.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("2")){
				WorkEngineeringProject workEngineeringProject = workEngineeringProjectService.get(workProjectNotify.getNotifyId());
				if (workEngineeringProject!=null) {
					processInstanceId = workEngineeringProject.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("3")){
				WorkEngineeringProject workEngineeringProject = workEngineeringProjectService.get(workProjectNotify.getNotifyId());
				if (workEngineeringProject!=null) {
					processInstanceId = workEngineeringProject.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("4")){
				WorkFullRecord workFullRecord = workFullRecordService.get(workProjectNotify.getNotifyId());
				if (workFullRecord!=null) {
					processInstanceId = workFullRecord.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("5")){
				WorkBidingDocument workBidingDocument = workBidingDocumentService.getById(workProjectNotify.getNotifyId());
				if (workBidingDocument!=null) {
					processInstanceId = workBidingDocument.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("6")) {
				WorkBidingDocument workBidingDocument = workBidingDocumentService.get(workProjectNotify.getNotifyId());
				if (workBidingDocument != null){
					processInstanceId = workBidingDocument.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("7")){
				WorkFullExecute workFullExecute = workFullExecuteService.get(workProjectNotify.getNotifyId());
				if (workFullExecute != null) {
					processInstanceId = workFullExecute.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("8")){
				WorkFullMeetingminutes meetingminutes = workFullMeetingminutesService.get(workProjectNotify.getNotifyId());
				if (meetingminutes != null) {
					processInstanceId = meetingminutes.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("9")){
				WorkFullDesignchange workFullDesignchange = workFullDesignchangeService.get(workProjectNotify.getNotifyId());
				if (workFullDesignchange != null) {
					processInstanceId = workFullDesignchange.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("10")){
				WorkFullConstructsheet workFullConstructsheet = workFullConstructsheetService.get(workProjectNotify.getNotifyId());
				if (workFullConstructsheet != null) {
					processInstanceId = workFullConstructsheet.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("11")){
				WorkFullProprietorsheet workFullProprietorsheet = workFullProprietorsheetService.get(workProjectNotify.getNotifyId());
				if (workFullProprietorsheet != null) {
					processInstanceId = workFullProprietorsheet.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("12")){
				WorkFullSupervisorsheet workFullSupervisorsheet  =  workFullSupervisorsheetService.get(workProjectNotify.getNotifyId());
				if (workFullSupervisorsheet != null) {
					processInstanceId = workFullSupervisorsheet.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("13")){	//报销
				WorkReimbursement workReimbursement = workReimbursementService.get(workProjectNotify.getNotifyId());
				if (workReimbursement != null) {
					processInstanceId = workReimbursement.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("14")){	//工程计量支付
				WorkFullPay workFullPay = workFullPayService.get(workProjectNotify.getNotifyId());
				if (workFullPay != null) {
					processInstanceId = workFullPay.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("15")){	//项目归档
				WorkFullRecord workFullRecord = workFullRecordService.get(workProjectNotify.getNotifyId());
				if (workFullRecord != null) {
					processInstanceId = workFullRecord.getProcessInstanceId();
				}
			}
			else if(workProjectNotify.getType().equals("16")){	//合同管理
				WorkContractInfo workContractInfo =workContractInfoService.get(workProjectNotify.getNotifyId());
				if (workContractInfo != null) {
					processInstanceId = workContractInfo.getProcessInstanceId();
				}
			}
			else if(workProjectNotify.getType().equals("17")){	//项目竣工
				WorkProjectCompletionInfo workProjectCompletionInfo =workProjectCompletionService.get(workProjectNotify.getNotifyId());
				if (workProjectCompletionInfo != null) {
					processInstanceId = workProjectCompletionInfo.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("18")){
				Company company = companyService.get(workProjectNotify.getNotifyId());
			}else if(workProjectNotify.getType().equals("19")){
				Company company = companyService.get(workProjectNotify.getNotifyId());
			}
			else if(workProjectNotify.getType().equals("21")){	//开票管理
				WorkInvoice workInvoice = workInvoiceService.get(workProjectNotify.getNotifyId());
				if (workInvoice != null) {
					processInstanceId = workInvoice.getProcessInstanceId();
				}
			}
			else if(workProjectNotify.getType().equals("22")){//工程签证
				WorkVisa workVisa =workVisaService.get(workProjectNotify.getNotifyId());
				if (workVisa != null) {
					processInstanceId = workVisa.getProcessInstanceId();
				}
			}
			else if(workProjectNotify.getType().equals("23")){//询价与核价
				WorkAskCheckPrice workAskCheckPrice =workAskCheckPriceService.get(workProjectNotify.getNotifyId());
				if (workAskCheckPrice != null)
				processInstanceId = workAskCheckPrice.getProcessInstanceId();
			}else if(workProjectNotify.getType().equals("24")){
				Leave oaLeave = leaveService.get(workProjectNotify.getNotifyId());
				if (oaLeave != null)
					processInstanceId = oaLeave.getProcessInstanceId();
			}else if(workProjectNotify.getType().equals("25")){
				WorkOvertimeForm workOvertimeForm = workOvertimeFormService.get(workProjectNotify.getNotifyId());
				if (workOvertimeForm != null)
				processInstanceId = workOvertimeForm.getProcessInstanceId();
			}else if(workProjectNotify.getType().equals("26")){
				OaEvection oaEvection = oaEvectionService.get(workProjectNotify.getNotifyId());
				if (oaEvection != null)
				processInstanceId = oaEvection.getProcessInstanceId();
			}else if(workProjectNotify.getType().equals("27")){
				WorkSealForm workSealForm = workSealFormService.get(workProjectNotify.getNotifyId());
				if (workSealForm != null)
					processInstanceId = workSealForm.getProcessInstanceId();
			} else if(workProjectNotify.getType().equals("28")){
				GoOut goOut = goOutService.get(workProjectNotify.getNotifyId());
				if (goOut != null)
					processInstanceId = goOut.getProcessInstanceId();
			}
			else if(workProjectNotify.getType().equals("29")){
				WorkProjectDeposit workProjectDeposit = workProjectDepositService.get(workProjectNotify.getNotifyId());
			}
			//招标代理
			else if(workProjectNotify.getType().equals("30")){
				WorkBidingProject workBidingProject = workBidingProjectService.get(workProjectNotify.getNotifyId());
			}
			//招标代理
			else if(workProjectNotify.getType().equals("31")){
				WorkFullRecord workFullRecord = workFullRecordService.gett(workProjectNotify.getNotifyId());
				if (workFullRecord != null)
				processInstanceId = workFullRecord.getProcessInstanceId();
			}else if("32".equals(workProjectNotify.getType())){
				OaAll oaAll = oaAllService.get(workProjectNotify.getNotifyId());
				if (oaAll != null)
				processInstanceId = oaAll.getProcessInstanceId();
			}else if("33".equals(workProjectNotify.getType())){
				WorkPettyCash workPettyCash = workPettyCashService.get(workProjectNotify.getNotifyId());
				processInstanceId = workPettyCash.getProcessInstanceId();
			}else if("34".equals(workProjectNotify.getType())){
				WorkPayment workPayment = workPaymentService.get(workProjectNotify.getNotifyId());
				if (workPayment != null)
				processInstanceId = workPayment.getProcessInstanceId();
			}else if("37".equals(workProjectNotify.getType())){
				WorkReimbur workReimbur = workReimburService.get(workProjectNotify.getNotifyId());
				if (workReimbur != null)
				processInstanceId = workReimbur.getProcessInstanceId();
			}else if("35".equals(workProjectNotify.getType())){ //采购
				OaBuy oaBuy = oaBuyService.get(workProjectNotify.getNotifyId());
				if (oaBuy != null)
				processInstanceId = oaBuy.getProcessInstanceId();
			}
			else if("36".equals(workProjectNotify.getType())){  //绩效自评
				OaPerformance oaPerformance = oaPerformanceService.get(workProjectNotify.getNotifyId());
				if (oaPerformance != null)
				processInstanceId = oaPerformance.getProcessInstanceId();
			}
			else if("38".equals(workProjectNotify.getType())){ //案例
				CaseInfo caseInfo = caseInfoService.get(workProjectNotify.getNotifyId());
				if (caseInfo != null)
				processInstanceId = caseInfo.getProcessInstanceId();
			}
			else if("40".equals(workProjectNotify.getType())){ //退票
				WorkInvoiceDetail workInvoiceDetail = workInvoiceDetailService.get(workProjectNotify.getNotifyId());
				if (workInvoiceDetail != null)
				processInstanceId = workInvoiceDetail.getProcessInstanceId();
			}
			else if("39".equals(workProjectNotify.getType())){ //退票
				ProjectRecords projectRecords = projectRecordsService.get(workProjectNotify.getNotifyId());
				if (projectRecords != null){
					processInstanceId = projectRecords.getProcessInstanceId();
				}else {
					RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(workProjectNotify.getNotifyId());
					if (ruralProjectRecords!=null){
						processInstanceId = ruralProjectRecords.getProcessInstanceId();
					}
				}
			}
			else if("41".equals(workProjectNotify.getType())){ //退票
				ProjectRecordsAlter projectRecordsAlter = projectRecordsAlterService.get(workProjectNotify.getNotifyId());
				if (projectRecordsAlter != null)
				processInstanceId = projectRecordsAlter.getProcessInstanceId();
			}else if(workProjectNotify.getType().equals("45")){	//工作内容报告
				ProjectReportData projectReportData = projectReportDataService.get(workProjectNotify.getNotifyId());
				if (projectReportData != null)
				processInstanceId = projectReportData.getProcessInstanceId();
			}
			else if(workProjectNotify.getType().equals("46")){	//工作内容报告变更
				ProjectReportData projectReportData = projectReportChangeService.get(workProjectNotify.getNotifyId());
				if (projectReportData != null)
				processInstanceId = projectReportData.getProcessInstanceId();
			}
			else if(workProjectNotify.getType().equals("47")){	//工作内容报告作废
				ProjectReportData projectReportData = projectReportDataService.get(workProjectNotify.getNotifyId());
				if (projectReportData != null)
				processInstanceId = projectReportData.getInvalidProcessInstanceId();
			}else if(workProjectNotify.getType().equals("51")){	//工作内容报告归档
				ProjectReportRecord projectReportRecord = projectReportRecordService.get(workProjectNotify.getNotifyId());
				if (projectReportRecord != null)
				processInstanceId = projectReportRecord.getProcessInstanceId();
			}else if("52".equals(workProjectNotify.getType())){	//收入结算
                WorkReceiptsSettle workReceiptsSettle = workReceiptsSettleService.get(workProjectNotify.getNotifyId());
				if (workReceiptsSettle != null)
                processInstanceId = workReceiptsSettle.getProcessInstanceId();
			}else if("55".equals(workProjectNotify.getType())){	//收文
                WorkIncomingMessage workIncomingMessage = workIncomingMessageService.get(workProjectNotify.getNotifyId());
				if (workIncomingMessage != null)
                processInstanceId = workIncomingMessage.getProcessInstanceId();
			}else if("56".equals(workProjectNotify.getType())){	//行政盖章
                WorkAdministrativeAtamp workAdministrativeAtamp = workAdministrativeAtampService.get(workProjectNotify.getNotifyId());
				if (workAdministrativeAtamp != null)
                processInstanceId = workAdministrativeAtamp.getProcessInstanceId();
			}else if("59".equals(workProjectNotify.getType())){	//借用管理
				WorkBorrowMangement workBorrowMangement = workBorrowMangementService.get(workProjectNotify.getNotifyId());
				if (workBorrowMangement != null)
				processInstanceId = workBorrowMangement.getProcessInstanceId();
			}else if("62".equals(workProjectNotify.getType())){	//发文管理
                WorkSendMessage workSendMessage = workSendMessageService.get(workProjectNotify.getNotifyId());
                if(workSendMessage!=null && StringUtils.isNotBlank(workSendMessage.getId())){
                    workSendMessageService.queryDetails(workSendMessage);
					processInstanceId = workSendMessage.getProcessInstanceId();
				}
			}else if("89".equals(workProjectNotify.getType())){	//发文管理
                OaNotify oaNotify = oaNotifyService.get(workProjectNotify.getNotifyId());
                if(oaNotify!=null && StringUtils.isNotBlank(oaNotify.getId())){
                    oaNotifyService.queryDetails(oaNotify);
                    processInstanceId = oaNotify.getProcessInstanceId();
                }
            }else if("60".equals(workProjectNotify.getType())){	//归还借用管理
				WorkBorrowBack workBorrowBack = workBorrowBackService.get(workProjectNotify.getNotifyId());
				if (workBorrowBack != null)
				processInstanceId = workBorrowBack.getProcessInstanceId();
			}else if("64".equals(workProjectNotify.getType())){	//领用管理
				WorkItemCollar workItemCollar = workItemCollarService.get(workProjectNotify.getNotifyId());
				if (workItemCollar != null)
				processInstanceId = workItemCollar.getProcessInstanceId();
			}else if(workProjectNotify.getType().equals("42")){	//合同归档
				WorkContractRecord workContractRecord = workContractRecordService.get(workProjectNotify.getNotifyId());
				if(workContractRecord!=null){
					processInstanceId = workContractRecord.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("91")){	//合同簽章
				WorkContractSignature workContractSignature = workContractSignatureService.get(workProjectNotify.getNotifyId());
				if(workContractSignature!=null){
					processInstanceId = workContractSignature.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("54")){	//收入调整作废
				WorkReceiptsRevise workReceiptsRevise = workReceiptsReviseService.get(workProjectNotify.getNotifyId());
				processInstanceId = workReceiptsRevise.getInvalidProcessInstanceId();
			}
			else if(workProjectNotify.getType().equals("53")){	//收入调整
				WorkReceiptsRevise workReceiptsRevise = workReceiptsReviseService.get(workProjectNotify.getNotifyId());
				processInstanceId = workReceiptsRevise.getProcessInstanceId();
			}else if(workProjectNotify.getType().equals("48")){	//发票变更
				WorkInvoiceAlter workInvoiceAlter = workInvoiceAlterService.get(workProjectNotify.getNotifyId());
				processInstanceId = workInvoiceAlter.getProcessInstanceId();
			}else if(workProjectNotify.getType().equals("49")){	//退票变更
				WorkInvoiceReturnAlter workInvoiceReturnAlter = workInvoiceReturnAlterService.get(workProjectNotify.getNotifyId());
				processInstanceId = workInvoiceReturnAlter.getProcessInstanceId();
			}else if(workProjectNotify.getType().equals("44")){	//合同变更
				WorkContractInfo workContractInfo =workContractInfoService.get(workProjectNotify.getNotifyId());
				if(workContractInfo!=null){
					processInstanceId = workContractInfo.getAlterProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("43")){	//合同作废
				WorkContractInfo workContractInfo = workContractInfoService.get(workProjectNotify.getNotifyId());
				if(workContractInfo!=null) {
					processInstanceId = workContractInfo.getInvalidateProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("50")){	//投标管理
				WorkBidProject workBidProject = workBidProjectService.get(workProjectNotify.getNotifyId());
				if(workBidProject!=null) {
					processInstanceId = workBidProject.getProcessInstanceId();
				}
			}else if(("57").equals(workProjectNotify.getType())){	//采购合同
				WorkStockContract workStockContract = workStockContractService.get(workProjectNotify.getNotifyId());
				if(workStockContract!=null) {
					processInstanceId = workStockContract.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("61")){	//采购管理
				WorkStock workStock =workStockService.get(workProjectNotify.getNotifyId());
				if(workStock!=null) {
					processInstanceId = workStock.getProcessInstanceId();
				}
			}else if(workProjectNotify.getType().equals("63")){	//报废管理
				WorkScrap workScrap =workScrapService.get(workProjectNotify.getNotifyId());
				if(workScrap!=null) {
					processInstanceId = workScrap.getProcessInstanceId();
				}
			}else if("66".equals(workProjectNotify.getType())){	//转正申请
				WorkRegularApply workRegularApply = workRegularApplyService.get(workProjectNotify.getNotifyId());
				if (workRegularApply != null)
					processInstanceId = workRegularApply.getProcessInstanceId();
			}else if("68".equals(workProjectNotify.getType())){	//部门调整
				WorkOfficeChange workOfficeChange = workOfficeChangeService.get(workProjectNotify.getNotifyId());
				if (workOfficeChange != null)
					processInstanceId = workOfficeChange.getProcessInstanceId();
			}else if("70".equals(workProjectNotify.getType())){	//职级调整
				WorkChangeJob workChangeJob = workChangeJobService.get(workProjectNotify.getNotifyId());
				if (workChangeJob != null)
					processInstanceId = workChangeJob.getProcessInstanceId();
			}else if("67".equals(workProjectNotify.getType())){	//劳动关系
				WorkRelationship workRelationship  = workRelationshipService.get(workProjectNotify.getNotifyId());
				if (workRelationship != null)
					processInstanceId = workRelationship.getProcessInstanceId();
			}else if ("72".equals(workProjectNotify.getType())) {
				WorkContractInfo workContractInfo = workContractInfoService.get(workProjectNotify.getNotifyId());
				if (workContractInfo != null)
					processInstanceId = workContractInfo.getProcessInstanceId();
			}else if ("75".equals(workProjectNotify.getType())) {    //加入企业
				Useroffice useroffice = userofficeService.get(workProjectNotify.getNotifyId());
				if (useroffice != null)
					processInstanceId = useroffice.getProcessInstanceId();
			}else if("71".equals(workProjectNotify.getType())){	//职级调整
				WorkResignation workResignation = workResignationService.get(workProjectNotify.getNotifyId());
				if (workResignation != null)
					processInstanceId = workResignation.getProcessInstanceId();
			}else if("80".equals(workProjectNotify.getType())){	//请假
				LeaveApply leaveApply = leaveApplyService.get(workProjectNotify.getNotifyId());
				if (leaveApply != null)
					processInstanceId = leaveApply.getProcessInstanceId();
			}else if("81".equals(workProjectNotify.getType())){	//销假
				LeaveApply leaveApply = leaveApplyService.get(workProjectNotify.getNotifyId());
				if (leaveApply != null)
					processInstanceId = leaveApply.getProcessInstanceId();
			}else if ("83".equals(workProjectNotify.getType())) {//补卡
				WorkAttendanceInfo workAttendanceInfo = workAttendanceInfoService.getAudit(workProjectNotify.getNotifyId());
			}else if("82".equals(workProjectNotify.getType())){	//续假
				LeaveApply leaveApply = leaveApplyService.get(workProjectNotify.getNotifyId());
				if (leaveApply != null)
					processInstanceId = leaveApply.getProcessInstanceId();
			}else if ("84".equals(workProjectNotify.getType())) {//补卡
				WorkAttendanceCount workAttendanceCount = workAttendanceCountService.get(workProjectNotify.getNotifyId());
			}else if ("85".equals(workProjectNotify.getType())) {//补卡
				WorkSingleWage workSingleWage = workSingleWageService.get(workProjectNotify.getNotifyId());
				if (workSingleWage != null)
					processInstanceId = workSingleWage.getProcessInstanceId();
			}
			workProjectNotify.setProcessInstanceId(processInstanceId);
			workProjectNotify.setUser(workProjectNotify.getUser()!=null?UserUtils.get(workProjectNotify.getUser().getId()):new User());
		}
		model.addAttribute("page", pageList);
		return "modules/workprojectnotify/workProjectNotifyLists";
	}

	/**
	 * 通知列表页面
	 */
	@RequestMapping(value = {"listShow"})
	public String listShow(WorkProjectNotify workProjectNotify, HttpServletRequest request, HttpServletResponse response, Model model) {
		User user = UserUtils.getUser();
		workProjectNotify.setUser(user);
		workProjectNotify.setStatus("0");
		workProjectNotify.setRemarks("待通知");
		workProjectNotify.setCompanyId(UserUtils.getSelectCompany().getId());
		Page<WorkProjectNotify> pageList = workProjectNotifyService.findPage(new Page<WorkProjectNotify>(request, response),workProjectNotify);
		model.addAttribute("page", pageList);
		return "modules/workprojectnotify/workProjectNotifyShowList";
	}

	/**
	 * 查看，增加，编辑通知表单页面
	 */
	@RequestMapping(value = "form")
	public String form(WorkProjectNotify workProjectNotify, Model model,HttpServletRequest request) {
		try {
			if (workProjectNotify.getRemarks().equals("待通知")){
			/*	List<WebSocket> toUserConnList = ChatServerPool.getWebSocketByUser(UserUtils.getUser().getId());
				for (WebSocket toUserConn:toUserConnList) {
					String message = "{\"useType\":\"sys_me\"}";
					ChatServerPool.sendMessageToUser(toUserConn, message);//同时向本人发送消息
				}*/
				UserUtils.pushMeIm("");
			}

			workProjectNotify.setStatus("2");
			workProjectNotify.preUpdate();
			workProjectNotifyService.save(workProjectNotify);
			if (StringUtils.isNotBlank(workProjectNotify.getType())) {
				if (workProjectNotify.getType().equals("13")) {    //报销
					WorkReimbursement workReimbursement = workReimbursementService.get(workProjectNotify.getNotifyId());
					workReimbursement.setAct(getByAct(workReimbursement.getProcessInstanceId()));
					workReimbursement.setHome("home");
					model.addAttribute("workReimbursement", workReimbursement);
					String param=UserUtils.getSysParam("check_subjects",UserUtils.getUser());
					if("是".equals(param)){
						model.addAttribute("isShow", '1');
					}else{
						model.addAttribute("isShow", '0');
					}
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						if (workReimbursement.getAct() != null && StringUtils.isNotBlank(workReimbursement.getAct().getTaskDefKey()) && "cw".equals(workReimbursement.getAct().getTaskDefKey())) {
							return "modules/workreimbursement/workReimbursementCWAudit";
						}
						return "modules/workreimbursement/workReimbursementAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workreimbursement/workReimbursementModifyApply";
					} else {
						return "modules/workreimbursement/workReimbursementFormDetail";
					}

				} else if (workProjectNotify.getType().equals("16")) {    //合同管理
					WorkContractInfo workContractInfo = workContractInfoService.get(workProjectNotify.getNotifyId());
					workContractInfo.setHome("home");
					workContractInfo.setAct(getByAct(workContractInfo.getProcessInstanceId()));
					model.addAttribute("workContractInfo", workContractInfo);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						if (workContractInfo.getAct() != null) {
							if ("gzr".equals(workContractInfo.getAct().getTaskDefKey())) {
								return "modules/workcontractinfo/workContractgzAudit";
							}
						}
						return "modules/workcontractinfo/workContractAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
                    	/*if(("3").equals(workContractInfo.getAlterState())){
							return "redirect:"+Global.getAdminPath()+"/workcontractinfo/workContractInfo?id="+workContractInfo.getAlterBeforeId();
						}*/
						return "modules/workcontractinfo/workContractInfoFormEdit";
					} else if (workProjectNotify.getRemarks().contains("待通知")) {
						return "modules/workcontractinfo/workContractInfoLookForm";
					}
				} else if (workProjectNotify.getType().equals("18")) {
					Company company = companyService.get(workProjectNotify.getNotifyId());
					company.setHome("home");
					model.addAttribute("company", company);
					model.addAttribute("disabled","true");
					return "modules/sys/companyForm";
				} else if (workProjectNotify.getType().equals("19")) {
					Company company = companyService.get(workProjectNotify.getNotifyId());
					company.setHome("home");
					model.addAttribute("company", company);
					model.addAttribute("disabled","true");
					return "modules/sys/companyForm";
				} else if (workProjectNotify.getType().equals("21")) {    //开票管理
					WorkInvoice workInvoice = workInvoiceService.get(workProjectNotify.getNotifyId());
					workInvoice.setHome("home");
					workInvoice.setAct(getByAct(workInvoice.getProcessInstanceId()));
					String taskDefKey = workInvoice.getAct().getTaskDefKey();
					model.addAttribute("workInvoice", workInvoice);
					if (workProjectNotify.getRemarks().contains("待通知")) {
						return "modules/workinvoice/workInvoiceView";
					} else if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						if (StringUtils.isNotBlank(taskDefKey) && ("bmzr".equals(taskDefKey) ||
								"scbzr".equals(taskDefKey))) {
							return "modules/workinvoice/workInvoiceAudit";
						} else if (StringUtils.isNotBlank(taskDefKey) && "fpgly".equals(taskDefKey)) {
							workInvoice.setDrawerName(UserUtils.getUser().getName());
							workInvoice.setInvoiceDate(new Date());
							model.addAttribute("workInvoice", workInvoice);
							return "modules/workinvoice/workInvoiceAuditEnd";
						}
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workinvoice/workInvoiceModify";
					}
				} else if (workProjectNotify.getType().equals("24")) {
					Leave oaLeave = leaveService.get(workProjectNotify.getNotifyId());
					oaLeave.setAct(getByAct(oaLeave.getProcessInstanceId()));
					oaLeave.setHome("home");
					model.addAttribute("leave", oaLeave);
					if (workProjectNotify.getRemarks().contains("待通知")) {
						return "redirect:" + Global.getAdminPath() + "/oa/leave/form?id=" + oaLeave.getId() + "&name=view";
					} else if (workProjectNotify.getRemarks().contains("待审批")) {
						//return "redirect:"+Global.getAdminPath()+"/oa/leave/leaveTodoList";
						return "modules/oa/leaveAudit";
					}
				} else if (workProjectNotify.getType().equals("25")) {
					WorkOvertimeForm workOvertimeForm = workOvertimeFormService.get(workProjectNotify.getNotifyId());
					workOvertimeForm.setAct(getByAct(workOvertimeForm.getProcessInstanceId()));
					workOvertimeForm.setHome("home");
					model.addAttribute("workOvertimeForm", workOvertimeForm);
					if (workProjectNotify.getRemarks().contains("待通知")) {
						return "redirect:" + Global.getAdminPath() + "/workovertimeform/workOvertimeForm/form?id=" + workOvertimeForm.getId() + "&name=view";
					} else if (workProjectNotify.getRemarks().contains("待审批")) {
						//return "redirect:"+Global.getAdminPath()+"/workovertimeform/workOvertimeForm/workOvertimeTodoList";
						return "modules/workovertimeform/workOvertimeAudit";
					}
				} else if (workProjectNotify.getType().equals("26")) {
					OaEvection oaEvection = oaEvectionService.get(workProjectNotify.getNotifyId());
					oaEvection.setAct(getByAct(oaEvection.getProcessInstanceId()));
					oaEvection.setHome("home");
					model.addAttribute("oaEvection", oaEvection);
					if (workProjectNotify.getRemarks().contains("待通知")) {
						return "redirect:" + Global.getAdminPath() + "/oa_evection/oaEvection/form?id=" + oaEvection.getId() + "&name=view";
					} else if (workProjectNotify.getRemarks().contains("待审批")) {
						//return "redirect:"+Global.getAdminPath()+"/oa_evection/oaEvection/oaEvectionTodoList";
						return "modules/oa_evection/oaEvectionAudit";
					}
				} else if (workProjectNotify.getType().equals("27")) {
					WorkSealForm workSealForm = workSealFormService.get(workProjectNotify.getNotifyId());
					workSealForm.setAct(getByAct(workSealForm.getProcessInstanceId()));
					workSealForm.setHome("home");
					model.addAttribute("workSealForm", workSealForm);
					if (workProjectNotify.getRemarks().contains("待通知")) {
						return "redirect:" + Global.getAdminPath() + "/worksealform/workSealForm/form?id=" + workSealForm.getId() + "&name=view";
					} else if (workProjectNotify.getRemarks().contains("待审批")) {
						//return "redirect:"+Global.getAdminPath()+"/worksealform/workSealForm/workSealFormTodoList";
						return "modules/worksealform/workSealFormAudit";
					}

				} else if (workProjectNotify.getType().equals("28")) {
					GoOut goOut = goOutService.get(workProjectNotify.getNotifyId());
					goOut.setAct(getByAct(goOut.getProcessInstanceId()));
					goOut.setHome("home");
					model.addAttribute("goOut", goOut);
					if (workProjectNotify.getRemarks().contains("待通知")) {
						return "redirect:" + Global.getAdminPath() + "/goout/goOut/form?id=" + goOut.getId() + "&name=view";
					} else if (workProjectNotify.getRemarks().contains("待审批")) {
						//return "redirect:"+Global.getAdminPath()+"/goout/goOut/goOutTodoList";
						return "modules/goout/goOutAudit";
					}
				} else if (workProjectNotify.getType().equals("29")) {
					WorkProjectDeposit workProjectDeposit = workProjectDepositService.get(workProjectNotify.getNotifyId());
					model.addAttribute("workProjectDeposit", workProjectDeposit);
					if (workProjectNotify.getRemarks().contains("待通知")) {
						return "redirect:" + Global.getAdminPath() + "/workprojectdeposit/workProjectDeposit/form?id=" + workProjectDeposit.getId();
					}
				} else if ("32".equals(workProjectNotify.getType())) {
					OaAll oaAll = oaAllService.get(workProjectNotify.getNotifyId());
					oaAll.setAct(getByAct(oaAll.getProcessInstanceId()));
					oaAll.setHome("home");
					model.addAttribute("oaAll", oaAll);
					if (workProjectNotify.getRemarks().contains("待通知")) {
						return "redirect:" + Global.getAdminPath() + "/oaall/oaAll/form?id=" + oaAll.getId() + "&tabId=0";
					} else if (workProjectNotify.getRemarks().contains("待审批")) {
						//return "redirect:"+Global.getAdminPath()+"/oaall/oaAll/leaveTodoList";
						return "modules/oaall/oaAllAudit";
					}
				} else if ("33".equals(workProjectNotify.getType())) {
					WorkPettyCash workPettyCash = workPettyCashService.get(workProjectNotify.getNotifyId());
					workPettyCash.setAct(getByAct(workPettyCash.getProcessInstanceId()));
					workPettyCash.setHome("home");
					model.addAttribute("workPettyCash", workPettyCash);
					if (workProjectNotify.getRemarks().contains("待通知")) {
						return "redirect:" + Global.getAdminPath() + "/workpettycash/workPettyCash/form?id=" + workPettyCash.getId() + "&name=view";
					} else if (workProjectNotify.getRemarks().contains("待审批")) {
						//return "redirect:"+Global.getAdminPath()+"/workpettycash/workPettyCash/workPettyCashTodoList";
						return "modules/workpettycash/workPettyCashAudit";
					}
				} else if ("34".equals(workProjectNotify.getType())) {
					WorkPayment workPayment = workPaymentService.get(workProjectNotify.getNotifyId());
					workPayment.setAct(getByAct(workPayment.getProcessInstanceId()));
					workPayment.setHome("home");
					model.addAttribute("workPayment", workPayment);
					if (workProjectNotify.getRemarks().contains("待通知")) {
						return "redirect:" + Global.getAdminPath() + "/workpayment/workPayment/form?id=" + workPayment.getId() + "&name=view";
					} else if (workProjectNotify.getRemarks().contains("待审批")) {
						//return "redirect:"+Global.getAdminPath()+"/workpayment/workPayment/workPaymentTodoList";
						return "modules/workpayment/workPaymentAudit";
					}
				} else if ("37".equals(workProjectNotify.getType())) {
					WorkReimbur workReimbur = workReimburService.get(workProjectNotify.getNotifyId());
					workReimbur.setAct(getByAct(workReimbur.getProcessInstanceId()));
					workReimbur.setHome("home");
					model.addAttribute("workReimbur", workReimbur);
					if (workProjectNotify.getRemarks().contains("待通知")) {
						return "redirect:" + Global.getAdminPath() + "/workreimbur/workReimbur/form?id=" + workReimbur.getId() + "&name=view";
					} else if (workProjectNotify.getRemarks().contains("待审批")) {
						//return "redirect:"+Global.getAdminPath()+"/workreimbur/workReimbur/workReimburTodoList";
						return "modules/workreimbur/workReimburAudit";
					}
				} else if ("35".equals(workProjectNotify.getType())) { //采购
					OaBuy oaBuy = oaBuyService.get(workProjectNotify.getNotifyId());
					oaBuy.setAct(getByAct(oaBuy.getProcessInstanceId()));
					oaBuy.setHome("home");
					model.addAttribute("oaBuy", oaBuy);
					if (workProjectNotify.getRemarks().contains("待通知")) {
						return "redirect:" + Global.getAdminPath() + "/oabuy/oaBuy/form?id=" + oaBuy.getId() + "&tabId=0";
					} else if (workProjectNotify.getRemarks().contains("待审批")) {
						//return "redirect:"+Global.getAdminPath()+"/oabuy/oaBuy/oaBuyTodoList";
						return "modules/oabuy/oaBuyAudit";
					}
				} else if ("36".equals(workProjectNotify.getType())) {  //绩效自评
					OaPerformance oaPerformance = oaPerformanceService.get(workProjectNotify.getNotifyId());
					oaPerformance.setAct(getByAct(oaPerformance.getProcessInstanceId()));
					oaPerformance.setHome("home");
					model.addAttribute("oaPerformance", oaPerformance);
					if (workProjectNotify.getRemarks().contains("待通知")) {
						return "redirect:" + Global.getAdminPath() + "/oaperformance/oaPerformance/form?id=" + oaPerformance.getId() + "&tabId=0";
					} else if (workProjectNotify.getRemarks().contains("待审批")) {
						//return "redirect:"+Global.getAdminPath()+"/oaperformance/oaPerformance/oaPerformanceTodoList";
						return "modules/oaperformance/oaPerformanceAudit";
					}
				} else if ("38".equals(workProjectNotify.getType())) { //案例
					CaseInfo caseInfo = caseInfoService.get(workProjectNotify.getNotifyId());
					caseInfo.setHome("home");
					caseInfo.setAct(getByAct(caseInfo.getProcessInstanceId()));
					model.addAttribute("caseInfo", caseInfo);
					if (workProjectNotify.getRemarks().contains("待通知")) {
						return "modules/caseinfo/caseInfoView";
					} else if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/caseinfo/caseInfoAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/caseinfo/caseInfoForm";
					}
				} else if ("40".equals(workProjectNotify.getType())) { //退票
					WorkInvoiceReturn workInvoiceReturn = workInvoiceReturnService.get(workProjectNotify.getNotifyId());
					workInvoiceReturn.setHome("home");
					workInvoiceReturn.setAct(getByAct(workInvoiceReturn.getProcessInstanceId()));
					model.addAttribute("workInvoiceReturn", workInvoiceReturn);
					if (workProjectNotify.getRemarks().contains("待通知")) {
						return "modules/workinvoicereturn/workInvoiceReturnView";
					} else if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						if ("fpgly".equals(workInvoiceReturn.getAct().getTaskDefKey())) {
							if (workInvoiceReturn.getReturnDate() == null) {
								workInvoiceReturn.setReturnDate(new Date());
							}
							model.addAttribute("workInvoiceReturn", workInvoiceReturn);
							return "modules/workinvoicereturn/workInvoiceReturnfpglyAudit";
						}
						return "modules/workinvoicereturn/workInvoiceReturnAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workinvoicereturn/workInvoiceReturnModify";
					}
				} else if (workProjectNotify.getType().equals("39")) {    //项目登记
					boolean flag = false;
					ProjectRecords projectRecords = projectRecordsService.get(workProjectNotify.getNotifyId());
					RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(workProjectNotify.getNotifyId());
					if (projectRecords != null && StringUtils.isNotBlank(projectRecords.getId())) {
						projectRecordsService.queryProjectDetail(projectRecords);
						flag = true;
					}
					if (flag){
						projectRecords.setAct(getByAct(projectRecords.getProcessInstanceId()));
						projectRecords.setHome("home");
						model.addAttribute("processInstanceId", projectRecords.getProcessInstanceId());
						model.addAttribute("projectRecords", projectRecords);
						if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
							return "modules/projectrecord/projectRecordsAudit";
						} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
							return "modules/projectrecord/projectRecordsModify";
						} else {
							return "modules/projectrecord/projectRecordsView";
						}
					}else {
						if (ruralProjectRecords != null && StringUtils.isNotBlank(ruralProjectRecords.getId())) {
							ruralProjectRecordsService.queryProjectDetail(ruralProjectRecords);
						}
						ruralProjectRecords.setAct(getByAct(ruralProjectRecords.getProcessInstanceId()));
						ruralProjectRecords.setHome("home");
						model.addAttribute("processInstanceId", ruralProjectRecords.getProcessInstanceId());
						model.addAttribute("projectRecords", ruralProjectRecords);
						if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
							return "modules/ruralprojectrecords/ruralProjectRecordsAudit";
						} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
							return "modules/ruralprojectrecords/ruralProjectRecordsModify";
						} else {
							return "modules/ruralprojectrecords/ruralProjectRecordsView";
						}
					}

				} else if (workProjectNotify.getType().equals("41")) {    //项目变更
					boolean flag = false;
					ProjectRecordsAlter projectRecordsAlter = projectRecordsAlterService.get(workProjectNotify.getNotifyId());
					if (projectRecordsAlter != null && StringUtils.isNotBlank(projectRecordsAlter.getId())) {
						projectRecordsAlterService.queryProjectAlterDetail(projectRecordsAlter);
						flag = true;
					}
					if (flag){
						ProjectRecords projectRecords = null;
						if (projectRecordsAlter.getAlterBeforeRecords() != null && StringUtils.isNotBlank(projectRecordsAlter.getAlterBeforeRecords().getId())) {
							projectRecords = projectRecordsService.get(projectRecordsAlter.getAlterBeforeRecords().getId());
							projectRecordsService.queryProjectDetail(projectRecords);
							projectRecordsAlter.setAlterBeforeRecords(projectRecords);
						}
						projectRecordsAlter.setAct(getByAct(projectRecordsAlter.getProcessInstanceId()));
						projectRecordsAlter.setHome("home");
						model.addAttribute("processInstanceId", projectRecordsAlter.getProcessInstanceId());
						model.addAttribute("projectRecordsAlter", projectRecordsAlter);
						if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
							return "modules/projectrecord/projectRecordsAlterAudit";
						} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
							return "modules/projectrecord/projectRecordsAlterModify";
						} else {
							return "modules/projectrecord/projectRecordsAlterView";
						}
					}else {
						RuralProjectRecordsAlter ruralProjectRecordsAlter = ruralProjectRecordsAlterService.get(workProjectNotify.getNotifyId());
						if (ruralProjectRecordsAlter != null && StringUtils.isNotBlank(ruralProjectRecordsAlter.getId())) {
							ruralProjectRecordsAlterService.queryProjectAlterDetail(ruralProjectRecordsAlter);
						}
						RuralProjectRecords ruralProjectRecords = null;
						if (ruralProjectRecordsAlter.getAlterBeforeRecords() != null && StringUtils.isNotBlank(ruralProjectRecordsAlter.getAlterBeforeRecords().getId())) {
							ruralProjectRecords = ruralProjectRecordsService.get(ruralProjectRecordsAlter.getAlterBeforeRecords().getId());
							ruralProjectRecordsService.queryProjectDetail(ruralProjectRecords);
							ruralProjectRecordsAlter.setAlterBeforeRecords(ruralProjectRecords);
						}
						ruralProjectRecordsAlter.setAct(getByAct(ruralProjectRecordsAlter.getProcessInstanceId()));
						ruralProjectRecordsAlter.setHome("home");
						model.addAttribute("processInstanceId", ruralProjectRecordsAlter.getProcessInstanceId());
						model.addAttribute("projectRecordsAlter", ruralProjectRecordsAlter);
						if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
							return "modules/ruralprojectrecords/ruralProjectRecordsAlterAudit";
						} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
							return "modules/ruralprojectrecords/ruralProjectRecordsAlterModify";
						} else {
							return "modules/ruralprojectrecords/ruralProjectRecordsAlterView";
						}
					}
				} else if (workProjectNotify.getType().equals("42")) {    //合同归档
					WorkContractRecord workContractRecord = workContractRecordService.get(workProjectNotify.getNotifyId());
					workContractRecord.setAct(getByAct(workContractRecord.getProcessInstanceId()));
					workContractRecord.setHome("home");
					model.addAttribute("workContractRecord", workContractRecord);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workcontractrecord/workContractRecordAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workcontractrecord/workContractRecordModifyApply";
					} else {
						return "modules/workcontractrecord/workContractView";
					}
				}  else if (workProjectNotify.getType().equals("91")) {    //合同簽章
					WorkContractSignature workContractSignature = workContractSignatureService.get(workProjectNotify.getNotifyId());
					workContractSignature.setAct(getByAct(workContractSignature.getProcessInstanceId()));
					workContractSignature.setHome("home");
					model.addAttribute("processInstanceId", workContractSignature.getProcessInstanceId());
					model.addAttribute("workContractSignature", workContractSignature);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workcontractsignature/workContractSignatureAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workcontractsignature/workContractSignatureModifyApply";
					} else {
						return "modules/workcontractsignature/workContractSignatureView";
					}
				}else if (workProjectNotify.getType().equals("53")) {    //收入调整
					WorkReceiptsRevise workReceiptsRevise = workReceiptsReviseService.get(workProjectNotify.getNotifyId());
					workReceiptsRevise.setAct(getByAct(workReceiptsRevise.getProcessInstanceId()));
					workReceiptsRevise.setHome("home");
					model.addAttribute("workReceiptsRevise", workReceiptsRevise);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workreceiptsrevise/workReceiptsReviseAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workreceiptsrevise/workReceiptsReviseModify";
					} else {
						return "modules/workreceiptsrevise/workReceiptsReviseView";
					}
				} else if (workProjectNotify.getType().equals("54")) {    //收入调整作废
					WorkReceiptsRevise workReceiptsRevise = workReceiptsReviseService.get(workProjectNotify.getNotifyId());
					workReceiptsRevise.setAct(getByAct(workReceiptsRevise.getInvalidProcessInstanceId()));
					workReceiptsRevise.setHome("home");
					model.addAttribute("workReceiptsRevise", workReceiptsRevise);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workreceiptsrevise/workReceiptsReviseInvalidAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workreceiptsrevise/workReceiptsReviseInvalidModify";
					} else {
						return "modules/workreceiptsrevise/workReceiptsReviseView";
					}
				} else if (workProjectNotify.getType().equals("48")) {    //发票变更
					WorkInvoiceAlter workInvoiceAlter = workInvoiceAlterService.get(workProjectNotify.getNotifyId());
					workInvoiceAlter.setAct(getByAct(workInvoiceAlter.getProcessInstanceId()));
					workInvoiceAlter.setHome("home");
					model.addAttribute("workInvoiceAlter", workInvoiceAlter);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workinvoicealter/workInvoiceAudita";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workinvoicealter/workInvoiceModifya";
					} else {
						return "modules/workinvoicealter/workInvoiceViewa";
					}
				} else if (workProjectNotify.getType().equals("49")) {    //退票变更
					WorkInvoiceReturnAlter workInvoiceReturnAlter = workInvoiceReturnAlterService.get(workProjectNotify.getNotifyId());
					workInvoiceReturnAlter.setAct(getByAct(workInvoiceReturnAlter.getProcessInstanceId()));
					workInvoiceReturnAlter.setHome("home");
					model.addAttribute("workInvoiceReturnAlter", workInvoiceReturnAlter);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workinvoicereturnalter/workInvoiceReturnAlterAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workinvoicereturnalter/workInvoiceReturnAlterModify";
					} else {
						return "modules/workinvoicereturnalter/workInvoiceReturnAlterView";
					}
				} else if (workProjectNotify.getType().equals("44")) {    //合同变更
					WorkContractInfo workContractInfo = workContractInfoService.get(workProjectNotify.getNotifyId());
					workContractInfo.setHome("home");
					workContractInfo.setAct(getByAct(workContractInfo.getAlterProcessInstanceId()));
					model.addAttribute("workContractInfo", workContractInfo);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						if (workContractInfo.getAct() != null) {
							if ("gzr".equals(workContractInfo.getAct().getTaskDefKey())) {
								return "modules/workcontractinfo/contractgzAlterAudit";
							}
						}
						return "modules/workcontractinfo/contractAlterAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
                    	/*if(("3").equals(workContractInfo.getAlterState())){
							return "redirect:"+Global.getAdminPath()+"/workcontractinfo/workContractInfo?id="+workContractInfo.getAlterBeforeId();
						}*/
						return "modules/workcontractinfo/workContractInfoFormEdita";
					} else if (workProjectNotify.getRemarks().contains("待通知")) {
						return "modules/workcontractinfo/workContractInfoLookForm";
					}
				} else if (workProjectNotify.getType().equals("43")) {    //合同作废
					WorkContractInfo workContractInfo = workContractInfoService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(workContractInfo.getInvalidateProcessInstanceId());
					workContractInfo.setHome("home");
					workContractInfo.setAct(act);
					String view = "contractInvalidateAudit";
					if (act.getProcInsId() != null) {
						if (actTaskService.getProcIns(act.getProcInsId()) != null) {
							act.setProcIns(actTaskService.getProcIns(act.getProcInsId()));
						} else {
							act.setFinishedProcIns(actTaskService.getFinishedProcIns(act.getProcInsId()));
						}
					}
					if (act != null && StringUtils.isNotBlank(act.getTaskId())) {
						workContractInfo.setAct(act);
						model.addAttribute("processInstanceId", workContractInfo.getInvalidateProcessInstanceId());
					}
					// 环节编号,默认是 "bmzrAudit"
					String taskDefKey = workContractInfo.getAct().getTaskDefKey();

					model.addAttribute("workContractInfo", workContractInfo);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workcontractinfo/" + view;
					} else if (("3").equals(workContractInfo.getInvalidateStatus())) {
						return "modules/workcontractinfo/contractInvalidateFormModify";
					} else {
						return "modules/workcontractinfo/workContractInfoLookForm";
					}
				} else if (workProjectNotify.getType().equals("45")) {    //工作内容报告
					ProjectReportData projectReportData = projectReportDataService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(projectReportData.getProcessInstanceId());
					projectReportData.setAct(act);
					Projectcontentinfo projectcontentinfo = projectcontentinfoService.getByInfoId(projectReportData.getId());
					projectcontentinfo.setProjectReportData(projectReportData);
					projectcontentinfo.setHome("home");
					model.addAttribute("projectId", projectcontentinfo.getProject().getId());
					model.addAttribute("id", projectcontentinfo.getId());
					model.addAttribute("projectcontentinfo", projectcontentinfo);
					WorkReviewAudit workReviewAudit = new WorkReviewAudit();
					String type = "";
					if ("master".equals(act.getTaskDefKey())) {
						type = "2";
					} else if ("bmzr".equals(act.getTaskDefKey())) {
						type = "3";
					} else if ("bzshbyg".equals(act.getTaskDefKey())) {
						type = "4";
					} else if ("bzshb".equals(act.getTaskDefKey())) {
						type = "4";
					}
					workReviewAudit.setCompanyId(UserUtils.getSelectCompany().getId());
					workReviewAudit.setType(type);
					workReviewAudit.setReportId(workProjectNotify.getNotifyId());
					List<WorkReviewAudit> workReviewAudits = workReviewStandardService.findAuditList(workReviewAudit);
					model.addAttribute("type", type);
					model.addAttribute("list", workReviewAudits);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/projectcontentinfo/reportAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/projectcontentinfo/reportModifyApply";
					} else {
						return "modules/projectcontentinfo/reportView";
					}
				} else if (workProjectNotify.getType().equals("46")) {    //工作内容报告变更
					ProjectReportData projectReportData = projectReportChangeService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(projectReportData.getProcessInstanceId());
					projectReportData.setAct(act);
					List<Projectcontentinfo> projectcontentinfos = projectcontentinfoService.getByChangeInfoId(projectReportData.getId());
					Projectcontentinfo projectcontentinfo = projectcontentinfos.get(0);
					projectcontentinfo.setProjectReportData(projectReportData);
					projectcontentinfo.setHome("home");
					WorkReviewAudit workReviewAudit = new WorkReviewAudit();
					String type = "";
					if ("master".equals(act.getTaskDefKey())) {
						type = "2";
					} else if ("bmzr".equals(act.getTaskDefKey())) {
						type = "3";
					} else if ("bzshbyg".equals(act.getTaskDefKey())) {
						type = "4";
					} else if ("bzshb".equals(act.getTaskDefKey())) {
						type = "4";
					}
					workReviewAudit.setCompanyId(UserUtils.getSelectCompany().getId());
					workReviewAudit.setType(type);
					workReviewAudit.setReportId(workProjectNotify.getNotifyId());
					List<WorkReviewAudit> workReviewAudits = workReviewStandardService.findAuditList(workReviewAudit);
					model.addAttribute("type", type);
					model.addAttribute("list", workReviewAudits);
					model.addAttribute("projectId", projectcontentinfo.getProject().getId());
					model.addAttribute("projectcontentinfo", projectcontentinfo);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/projectcontentinfo/reportChangeAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/projectcontentinfo/reportChangeModifyApply";
					} else {
						ProjectReportData beforeEntity = projectReportChangeService.getBefore(projectReportData.getBeforeEntity().getId());
						projectReportData.setBeforeEntity(beforeEntity);
						return "modules/projectcontentinfo/reportChangeView";
					}
				} else if (workProjectNotify.getType().equals("47")) {    //工作内容报告作废
					ProjectReportData projectReportData = projectReportDataService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(projectReportData.getInvalidProcessInstanceId());
					projectReportData.setAct(act);
					Projectcontentinfo projectcontentinfo = projectcontentinfoService.getByInfoId(projectReportData.getId());
					projectcontentinfo.setProjectReportData(projectReportData);
					projectcontentinfo.setHome("home");
					model.addAttribute("projectId", projectcontentinfo.getProject().getId());
					model.addAttribute("projectcontentinfo", projectcontentinfo);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/projectcontentinfo/reportInvalidAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/projectcontentinfo/reportInvalidModifyApply";
					} else {
						return "modules/projectcontentinfo/reportInvalidView";
					}
				} else if (workProjectNotify.getType().equals("50")) {    //投标管理
					WorkBidProject workBidProject = workBidProjectService.get(workProjectNotify.getNotifyId());
					workBidProject.setAct(getByAct(workBidProject.getProcessInstanceId()));
					workBidProject.setHome("home");
					model.addAttribute("workBidProject", workBidProject);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						if ("zjl".equals(workBidProject.getAct().getTaskDefKey())) {
							return "modules/workbidproject/workBidProjectzjlAudit";
						} else if ("tbzy".equals(workBidProject.getAct().getTaskDefKey())) {
							return "modules/workbidproject/workBidProjectbzAudit";
						} else if ("gzr".equals(workBidProject.getAct().getTaskDefKey())) {
							return "modules/workbidproject/workBidProjectgzAudit";
						} else if ("sqr".equals(workBidProject.getAct().getTaskDefKey())) {
							return "modules/workbidproject/workBidProjectkbAudit";
						} else if ("scyfglbzrss".equals(workBidProject.getAct().getTaskDefKey())) {
							return "modules/workbidproject/workBidProjectwhAudit";
						} else {
							return "modules/workbidproject/workBidProjectAudit";
						}
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workbidproject/workBidProjectModify";
					} else {
						return "modules/workbidproject/workBidProjectView";
					}

				} else if (workProjectNotify.getType().equals("51")) {    //工作内容报告归档
					ProjectReportRecord projectReportRecord = projectReportRecordService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(projectReportRecord.getProcessInstanceId());
					projectReportRecord.setAct(act);
					projectReportRecord.setHome("home");
					model.addAttribute("projectReportRecord", projectReportRecord);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/projectcontentinfo/projectReportRecordAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/projectcontentinfo/projectReportRecordModifyApply";
					} else {
						return "modules/projectcontentinfo/projectReportRecordView";
					}
				} else if ("52".equals(workProjectNotify.getType())) {    //收入结算
					WorkReceiptsSettle workReceiptsSettle = workReceiptsSettleService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(workReceiptsSettle.getProcessInstanceId());
					workReceiptsSettle.setAct(act);
					workReceiptsSettle.setHome("home");
					model.addAttribute("workReceiptsSettle", workReceiptsSettle);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						if ("fpgly".equals(workReceiptsSettle.getAct().getTaskDefKey())) {
							return "modules/workreceiptssettle/workReceiptsSettleKPAudit";
						} else if ("cn".equals(act.getTaskDefKey())) {
							return "modules/workreceiptssettle/workReceiptsSettleCNAudit";
						} else {
							return "modules/workreceiptssettle/workReceiptsSettleAudit";
						}
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workreceiptssettle/workReceiptsSettleModifyApply";
					} else {
						return "modules/workreceiptssettle/workReceiptsSettleView";
					}
				} else if ("55".equals(workProjectNotify.getType())) {    //收文
					WorkIncomingMessage workIncomingMessage = workIncomingMessageService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(workIncomingMessage.getProcessInstanceId());
					workIncomingMessage.setAct(act);
					workIncomingMessage.setHome("home");
                    if(StringUtils.isNotBlank(workIncomingMessage.getDailyId())&&!"NoN".equals(workIncomingMessage.getDailyId())){
                        WorkDailyRoutineDetail routineDetail = new WorkDailyRoutineDetail();
                        routineDetail.setWorkDailyRoutine(new WorkDailyRoutine(workIncomingMessage.getDailyId()));
                        List<WorkDailyRoutineDetail> list = workDailyRoutineDetailService.findList(routineDetail);
                        if(list!=null&&list.size()>0){
                            for (WorkDailyRoutineDetail detail : list) {
                                if("未完成".equals(detail.getStatus())){
                                    workIncomingMessage.setDailyFlag(false);
                                    break;
                                }
                            }
                        }
                        workIncomingMessage.setDetailList(list);
                    }
					model.addAttribute("workIncomingMessage", workIncomingMessage);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workincomingmessage/workIncomingMessageAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workincomingmessage/workIncomingMessageModifyApply";
					} else {
						return "modules/workincomingmessage/workIncomingMessageView";
					}
				} else if ("56".equals(workProjectNotify.getType())) {    //行政盖章
					WorkAdministrativeAtamp workAdministrativeAtamp = workAdministrativeAtampService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(workAdministrativeAtamp.getProcessInstanceId());
					workAdministrativeAtamp.setAct(act);
					workAdministrativeAtamp.setHome("home");
					model.addAttribute("workAdministrativeAtamp", workAdministrativeAtamp);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workadministrativeatamp/workAdministrativeAtampAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workadministrativeatamp/workAdministrativeAtampModifyApply";
					} else {
						return "modules/workadministrativeatamp/workAdministrativeAtampView";
					}
				} else if (("57").equals(workProjectNotify.getType())) {    //采购合同
					WorkStockContract workStockContract = workStockContractService.get(workProjectNotify.getNotifyId());
					workStockContract.setAct(getByAct(workStockContract.getProcessInstanceId()));
					workStockContract.setHome("home");
					model.addAttribute("workStockContract", workStockContract);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						if ("gzr".equals(workStockContract.getAct().getTaskDefKey())) {
							return "modules/workstockcontract/workStockContractgzAudit";
						} else if ("sqr".equals(workStockContract.getAct().getTaskDefKey())) {
							return "modules/workstockcontract/workStockContractSqrAudit";
						} else {
							return "modules/workstockcontract/workStockContractAudit";
						}
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workstockcontract/workStockContractModify";
					} else {
						return "modules/workstockcontract/workStockContractView";
					}

				} else if ("58".equals(workProjectNotify.getType())) {    //日常事务
					if (workProjectNotify.getRemarks().contains("待处理") && !"1".equals(workProjectNotify.getStatus())) {
						WorkDailyRoutineDetail workDailyRoutineDetail = workDailyRoutineDetailService.getByDailyId(workProjectNotify.getNotifyId());
						workDailyRoutineDetail.setHome("home");
						model.addAttribute("workDailyRoutineDetail", workDailyRoutineDetail);
						return "modules/workdailyroutine/workDailyRoutineDetailForm";
					} else {
						WorkDailyRoutine workDailyRoutine = workDailyRoutineService.get(workProjectNotify.getNotifyId());
						if (StringUtils.isNotBlank(workDailyRoutine.getId())) {
							workDailyRoutineService.queryDetails(workDailyRoutine);
						}
						model.addAttribute("workDailyRoutine", workDailyRoutine);
						return "modules/workdailyroutine/workDailyRoutineView";
					}
				} else if ("59".equals(workProjectNotify.getType())) {    //借用管理
					WorkBorrowMangement workBorrowMangement = workBorrowMangementService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(workBorrowMangement.getProcessInstanceId());
					workBorrowMangement.setAct(act);
					workBorrowMangement.setHome("home");
					model.addAttribute("workBorrowMangement", workBorrowMangement);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workborrowmangement/workBorrowMangementAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workborrowmangement/workBorrowMangementModifyApply";
					} else {
						return "modules/workborrowmangement/workBorrowMangementView";
					}
				} else if ("62".equals(workProjectNotify.getType())) {    //发文管理
					WorkSendMessage workSendMessage = workSendMessageService.get(workProjectNotify.getNotifyId());
					if (StringUtils.isNotBlank(workSendMessage.getId())) {
						workSendMessageService.queryDetails(workSendMessage);
					}
					Act act = getByAct(workSendMessage.getProcessInstanceId());
					workSendMessage.setAct(act);
					workSendMessage.setHome("home");
					model.addAttribute("workSendMessage", workSendMessage);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/worksendmessage/workSendMessageAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/worksendmessage/workSendMessageModifyApply";
					} else {
						if (UserUtils.getUser().getId().equals(workSendMessage.getCreateBy().getId())) {
							return "modules/worksendmessage/workSendMessageView";
						} else {
							return "modules/worksendmessage/workSendMessageMemberView";
						}
					}
				}else if ("89".equals(workProjectNotify.getType())) {    //发文管理
                    OaNotify oaNotify = oaNotifyService.get(workProjectNotify.getNotifyId());
                    if (StringUtils.isNotBlank(oaNotify.getId())) {
                        oaNotifyService.queryDetails(oaNotify);
                    }
                    Act act = getByAct(oaNotify.getProcessInstanceId());
                    oaNotify.setAct(act);
                    oaNotify.setHome("home");
                    model.addAttribute("oaNotify", oaNotify);
                    if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
                        return "modules/oa/oaNotifyAudit";
                    } else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
                        return "modules/oa/oaNotifyModifyApply";
                    } else {
                        return "modules/oa/oaNotifyView";
                    }
                } else if ("60".equals(workProjectNotify.getType())) {    //归还借用管理
					WorkBorrowBack workBorrowBack = workBorrowBackService.get(workProjectNotify.getNotifyId());
					WorkBorrowMangement mangement = workBorrowMangementService.get(workBorrowBack.getBorrowMangementId());
					workBorrowBack.setWorkBorrowMangement(mangement);
					Act act = getByAct(workBorrowBack.getProcessInstanceId());
					workBorrowBack.setAct(act);
					workBorrowBack.setHome("home");
					model.addAttribute("workBorrowBack", workBorrowBack);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workborrowmangement/workBorrowBackAudit";
					} else {
						return "modules/workborrowmangement/workBorrowBackView";
					}
				} else if (workProjectNotify.getType().equals("61")) {    //采购管理
					WorkStock workStock = workStockService.get(workProjectNotify.getNotifyId());
					workStock.setAct(getByAct(workStock.getProcessInstanceId()));
					workStock.setHome("home");
					model.addAttribute("workStock", workStock);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						if ("xzzg".equals(workStock.getAct().getTaskDefKey())) {
							if (workStock.getAcceptDate() == null) {
								workStock.setAcceptDate(new Date());
							}
							if (StringUtils.isBlank(workStock.getAcceptName())) {
								workStock.setAcceptName(UserUtils.getUser().getName());
							}
							return "modules/workstock/workStockAcceptAudit";
						} else if ("xzzgs".equals(workStock.getAct().getTaskDefKey())) {
							WorkItemStock workItemStock = new WorkItemStock();
							if (workStock != null) {
								workItemStock.setStockId(workStock.getId());
								//固定资产编号
								workItemStock.setIsAssets("1");
								workItemStock.setSign("1");
								List<WorkItemStock> buyDetailsList3 = workItemStockService.findLists(workItemStock);
								if (buyDetailsList3 != null && buyDetailsList3.size() > 0) {
								}
								workStock.setWorkItemStockAssets(buyDetailsList3);
								model.addAttribute("workStock", workStock);
							}
							return "modules/workstock/workStocksAudit";
						} else {
							return "modules/workstock/workStockAudit";
						}
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workstock/workStockModify";
					} else {
						return "modules/workstock/workStockView";
					}
				} else if (workProjectNotify.getType().equals("63")) {    //报废管理
					WorkScrap workScrap = workScrapService.get(workProjectNotify.getNotifyId());
					workScrap.setAct(getByAct(workScrap.getProcessInstanceId()));
					workScrap.setHome("home");
					model.addAttribute("workScrap", workScrap);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workscrap/workScrapAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workscrap/workScrapModify";
					} else {
						return "modules/workscrap/workScrapView";
					}
				} else if ("64".equals(workProjectNotify.getType())) {    //领用管理
					WorkItemCollar workItemCollar = workItemCollarService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(workItemCollar.getProcessInstanceId());
					workItemCollar.setAct(act);
					workItemCollar.setHome("home");
					List<WorkItemCollarCatalog> workItemCollarCatalogList = workItemCollarService.findWorkItemCollarCatalogList(workItemCollar);
					workItemCollar.setWorkItemCollarCatalogList(workItemCollarCatalogList);
					List<WorkItemCollarItem> workItemCollarItem = workItemCollarService.findWorkItemCollarItemList(workItemCollar);
					workItemCollar.setWorkItemCollarItemList(workItemCollarItem);
					model.addAttribute("workItemCollar", workItemCollar);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workitemcollar/workItemCollarAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workitemcollar/workItemCollarModifyApply";
					} else {
						return "modules/workitemcollar/workItemCollarView";
					}
				} else if ("66".equals(workProjectNotify.getType())) {    //转正申请
					WorkRegularApply workRegularApply = workRegularApplyService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(workRegularApply.getProcessInstanceId());
					workRegularApply.setAct(act);
					workRegularApply.setHome("home");
					WorkRegularScore workRegularScore = new WorkRegularScore();
					workRegularScore.setRegularApplyId(workRegularApply.getId());
					List<WorkRegularScore> workRegularScoreList = workRegularScoreService.findList(workRegularScore);
					workRegularApply.setWorkRegularScoreList(workRegularScoreList);
					model.addAttribute("workRegularApply", workRegularApply);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workregularapply/workRegularApplyAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workregularapply/workRegularApplyModifyApply";
					} else {
						return "modules/workregularapply/workRegularApplyView";
					}
				} else if ("68".equals(workProjectNotify.getType())) {    //部门调转
					WorkOfficeChange workOfficeChange = workOfficeChangeService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(workOfficeChange.getProcessInstanceId());
					workOfficeChange.setAct(act);
					workOfficeChange.setHome("home");
					WorkOfficeChangeUser workOfficeChangeUser = new WorkOfficeChangeUser();
					workOfficeChangeUser.setChangeId(workOfficeChange.getId());
					List<WorkOfficeChangeUser> workOfficeChangeUserList = workOfficeChangeUserService.findList(workOfficeChangeUser);
					workOfficeChange.setWorkOfficeChangeUserList(workOfficeChangeUserList);
					model.addAttribute("workOfficeChange", workOfficeChange);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workofficechange/workOfficeChangeAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workofficechange/workOfficeChangeModifyApply";
					} else {
						return "modules/workofficechange/workOfficeChangeView";
					}
				} else if ("69".equals(workProjectNotify.getType())) {    //日常事务
					if (workProjectNotify.getRemarks().contains("待处理") && !"1".equals(workProjectNotify.getStatus())) {
						WorkStaffBasicInfo select = new WorkStaffBasicInfo();
						select.setAchiveId(workProjectNotify.getNotifyId());
						WorkStaffBasicInfo workStaffBasicInfo = workStaffBasicInfoService.getAchive(select);
						if (StringUtils.isNotBlank(workStaffBasicInfo.getId())) {
							workStaffBasicInfoService.queryDetails(workStaffBasicInfo);
						}
						workStaffBasicInfo.setHome("home");
						model.addAttribute("workStaffBasicInfo", workStaffBasicInfo);
						String view = "modules/workstaff/workStaffAchiveInfoForm";
						if (UserUtils.getUser().getId().equals(workStaffBasicInfo.getUserId())) {
							view = "modules/workstaff/workStaffBasicDetailForm";
						}
						return view;
					} else {
						WorkStaffBasicInfo workStaffBasicInfo = workStaffBasicInfoService.get(workProjectNotify.getNotifyId());
						if (StringUtils.isNotBlank(workStaffBasicInfo.getId())) {
							workStaffBasicInfoService.queryDetails(workStaffBasicInfo);
						}
						model.addAttribute("workStaffBasicInfo", workStaffBasicInfo);
						return "modules/workstaff/workStaffBasicInfoView";
					}
				} else if ("86".equals(workProjectNotify.getType())) {    //日常事务
					if (workProjectNotify.getRemarks().contains("待处理") && !"1".equals(workProjectNotify.getStatus())) {
						WorkStaffBasicInfo select = new WorkStaffBasicInfo();
						select.setAchiveId(workProjectNotify.getNotifyId());
						WorkStaffBasicInfo workStaffBasicInfo = workStaffBasicInfoService.getAchive(select);
						if (StringUtils.isNotBlank(workStaffBasicInfo.getId())) {
							workStaffBasicInfoService.queryDetailsApply(workStaffBasicInfo);
						}
						workStaffBasicInfo.setHome("home");
						model.addAttribute("workStaffBasicInfo", workStaffBasicInfo);
						return "modules/workstaff/workStaffBasicDetailAudit";
					}
					} else if ("70".equals(workProjectNotify.getType())) {    //部门调转
					WorkChangeJob workChangeJob = workChangeJobService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(workChangeJob.getProcessInstanceId());
					workChangeJob.setAct(act);
					workChangeJob.setHome("home");
					WorkChangeJobUser WorkChangeJobUser = new WorkChangeJobUser();
					WorkChangeJobUser.setChangeId(workChangeJob.getId());
					List<WorkChangeJobUser> workChangeJobUserList = workChangeJobUserService.findList(WorkChangeJobUser);
					workChangeJob.setWorkChangeJobUserList(workChangeJobUserList);
					model.addAttribute("workChangeJob", workChangeJob);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workchangejob/workChangeJobAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workchangejob/workChangeJobModifyApply";
					} else {
						return "modules/workchangejob/workChangeJobView";
					}
				} else if ("72".equals(workProjectNotify.getType())) {
					WorkContractInfo workContractInfo = workContractInfoService.get(workProjectNotify.getNotifyId());
					workContractInfo.setHome("home");
					workContractInfo.setAct(getByAct(workContractInfo.getProcessInstanceId()));
					model.addAttribute("workContractInfo", workContractInfo);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workcontractinfo/workContractCompletionAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workcontractinfo/workContractCompletionAudit";
					} else if (workProjectNotify.getRemarks().contains("待通知")) {
						return "modules/workcontractinfo/workContractInfoLookForm";
					}
				}else if ("76".equals(workProjectNotify.getType())) {
					WorkExample workExample = workExampleService.get(workProjectNotify.getNotifyId());
					workExample.setHome("home");
					workExample.setAct(getByAct(workExample.getProcessInstanceId()));
					model.addAttribute("workExample", workExample);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						model.addAttribute("workExample", workExample);
						model.addAttribute("sign", "audit");
						return "modules/workexample/workExampleIndex";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						model.addAttribute("workExample", workExample);
						model.addAttribute("sign", "modify");
						return "modules/workexample/workExampleIndex";
					} else if (workProjectNotify.getRemarks().contains("待通知")) {
						model.addAttribute("workExample", workExample);
						model.addAttribute("sign", "view");
						return "modules/workexample/workExampleIndex";
					}
				}else if ("75".equals(workProjectNotify.getType())) {    //加入企业
					Useroffice useroffice = userofficeService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(useroffice.getProcessInstanceId());
					useroffice.setAct(act);
					useroffice.setHome("home");
					model.addAttribute("useroffice", useroffice);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						Office office = officeService.get(useroffice.getCompanyId());
						User user = UserUtils.get(UserUtils.getUser().getId());
						model.addAttribute("user", user);
						model.addAttribute("office", office);

						User master =  UserUtils.getUser();
						useroffice.setMasterName(master.getName());

						model.addAttribute("companyinfo", useroffice);
						String companyId = UserUtils.getSelectCompany().getId();
						Role roles = new Role();
						roles.setCompany(new Office(companyId));
						List<Role> roleList = UserUtils.getRoleListByCompany(roles);
						useroffice.setMaster(UserUtils.getUser().getId());
						userofficeService.save(useroffice);
						return "modules/sys/applyOnCompany";
					}else {
						Office office = officeService.get(useroffice.getCompanyId());
						User user = UserUtils.get(useroffice.getUserId());
						if(StringUtils.isNotBlank(useroffice.getMaster())){
							User master =  UserUtils.get(useroffice.getMaster());
							useroffice.setMasterName(master.getName());
						}

						model.addAttribute("companyinfo", useroffice);
						model.addAttribute("office", office);
						model.addAttribute("user", user);
						model.addAttribute("disabled",true);
						return "modules/sys/companyinfoView";
					}
				} else if ("67".equals(workProjectNotify.getType())) { //劳动关系
					WorkRelationship workRelationship = workRelationshipService.get(workProjectNotify.getNotifyId());
					workRelationship.setHome("home");
					workRelationship.setAct(getByAct(workRelationship.getProcessInstanceId()));
					model.addAttribute("workRelationship", workRelationship);
					if (workProjectNotify.getRemarks().contains("待通知")) {
						return "modules/workrelationship/workRelationshipView";
					} else if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						if ("rlzybzr".equals(workRelationship.getAct().getTaskDefKey())) {
							return "modules/workrelationship/workRelationshipAudit";
						} else if ("rlzy".equals(workRelationship.getAct().getTaskDefKey())) {
							if (workRelationship.getTransactTime() == null) {
								workRelationship.setTransactTime(new Date());
								model.addAttribute("workRelationship", workRelationship);
							}
							return "modules/workrelationship/workRelationshiprlzyAudit";
						} else if ("qyr".equals(workRelationship.getAct().getTaskDefKey())) {
							return "modules/workrelationship/workRelationshipqyrAudit";
						}
					}
				}else if ("90".equals(workProjectNotify.getType())) { //首次劳动关系
					WorkRelationship workRelationship = workRelationshipService.get(workProjectNotify.getNotifyId());
					workRelationship.setHome("home");
					workRelationship.setAct(getByAct(workRelationship.getProcessInstanceId()));
					model.addAttribute("workRelationship", workRelationship);
					if (workProjectNotify.getRemarks().contains("待通知")) {
						return "modules/workrelationship/workRelationshipView";
					} else if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workrelationship/workRelationshipAuditFirst";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workrelationship/workRelationshipModify";
					}
				}else if("74".equals(workProjectNotify.getType())){//系统预警
					SysWarning sysWarning =sysWarningService.get(workProjectNotify.getNotifyId());
					model.addAttribute("sysWarning", sysWarning);
					if(workProjectNotify.getRemarks().contains("待通知")){
						return "modules/syswarning/sysWarningLookForm";
					}
				}
				else if("71".equals(workProjectNotify.getType())){	//离职申请
					WorkResignation workResignation = workResignationService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(workResignation.getProcessInstanceId());
					workResignation.setAct(act);
					workResignation.setHome("home");
					model.addAttribute("workResignation", workResignation);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						if ("bmzr".equals(workResignation.getAct().getTaskDefKey()) || "fgld".equals(workResignation.getAct().getTaskDefKey()) ||"zjl".equals(workResignation.getAct().getTaskDefKey()) ) {
							return "modules/workresignation/workResignationAudit";
						} else {
							if ("各级审批".equals(workProjectNotify.getNotifyRole())) {
								model.addAttribute("workResignation", workResignation);
								return "modules/workresignation/workResignationAudits";
							} else if ("人力专员审核".equals(workProjectNotify.getNotifyRole())) {
								return "modules/workresignation/workResignationrlzyAudit";
							}
						}

					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						if ("调整".equals(workProjectNotify.getNotifyRole())) {
							return "modules/workresignation/workResignationForm";
						}
						return "modules/workresignation/workResignationModify";
					} else {
						return "modules/workresignation/workResignationView";
					}
				}
				else if ("77".equals(workProjectNotify.getType())) {  //加班
					WorkOvertime workOvertime = workOvertimeService.get(workProjectNotify.getNotifyId());
					workOvertime.setHome("home");
					workOvertime.setAct(getByAct(workOvertime.getProcessInstanceId()));
					model.addAttribute("workOvertime", workOvertime);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workovertime/workOvertimeAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workovertime/workOvertimeModify";
					} else if (workProjectNotify.getRemarks().contains("待通知")) {
						return "modules/workovertime/workOvertimeView";
					}
				}
				else if ("78".equals(workProjectNotify.getType())) {//出差
					WorkOut workOut = workOutService.get(workProjectNotify.getNotifyId());
					workOut.setHome("home");
					workOut.setAct(getByAct(workOut.getProcessInstanceId()));
					model.addAttribute("workOut", workOut);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workout/workOutAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workout/workOutModify";
					} else if (workProjectNotify.getRemarks().contains("待通知")) {
						return "modules/workout/workOutView";
					}
				}
				else if ("79".equals(workProjectNotify.getType())) {//外勤
					WorkField workField = workFieldService.get(workProjectNotify.getNotifyId());
					workField.setHome("home");
					workField.setAct(getByAct(workField.getProcessInstanceId()));
					model.addAttribute("workField", workField);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workfield/workFieldAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workfield/workFieldModify";
					} else if (workProjectNotify.getRemarks().contains("待通知")) {
						return "modules/workfield/workFieldView";
					}
				}else if ("80".equals(workProjectNotify.getType())||"81".equals(workProjectNotify.getType())||"82".equals(workProjectNotify.getType())) {    //请假
					LeaveApply leaveApply = leaveApplyService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(leaveApply.getProcessInstanceId());
					leaveApply.setAct(act);
					leaveApply.setHome("home");
					//查询请假明细
					LeaveDetail leaveDetail=new LeaveDetail();
					leaveDetail.setLeaveId(leaveApply.getId());
					List<LeaveDetail> list=leaveDetailDao.findList(leaveDetail);
					leaveApply.setLeaveDetailList(list);
					//查询历史明细
					List<LeaveDetail> hisList=leaveDetailDao.findListHis(leaveApply.getStaffId());
					leaveApply.setHisLeaveDetailList(hisList);
					model.addAttribute("leaveApply", leaveApply);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/leaveapply/leaveApplyAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						if ("81".equals(workProjectNotify.getType())){
							return "modules/leaveapply/leaveApplyBackModifyApply";
						}else if ("82".equals(workProjectNotify.getType())){
							return "modules/leaveapply/leaveApplyExtendModifyApply";
						}
						return "modules/leaveapply/leaveApplyModifyApply";
					} else {
						return "modules/leaveapply/leaveApplyView";
					}
				}else if ("83".equals(workProjectNotify.getType())) {//补卡
					WorkAttendanceInfo workAttendanceInfo = workAttendanceInfoService.getAudit(workProjectNotify.getNotifyId());
					workAttendanceInfo.setHome("home");
					model.addAttribute("workAttendanceInfo", workAttendanceInfo);
					model.addAttribute("ids", workProjectNotify.getKind());
					return "modules/workattendance/workAttendanceAudit";
				}else if ("84".equals(workProjectNotify.getType())) {//补卡
					WorkAttendanceCount workAttendanceCount = workAttendanceCountService.get(workProjectNotify.getNotifyId());
					workAttendanceCount.setHome("home");
					model.addAttribute("workAttendanceCount", workAttendanceCount);
					return "modules/workattendance/workAttendanceCountForm";
				}else if ("85".equals(workProjectNotify.getType())) {//单笔工资项发放
					WorkSingleWage workSingleWage = workSingleWageService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(workSingleWage.getProcessInstanceId());
					workSingleWage.setAct(act);
					workSingleWage.setHome("home");
					Map<String,String> map = StringUtils.getMonth();
					model.addAttribute("workSingleWage", workSingleWage);
					model.addAttribute("nowm", map.get("1"));
					model.addAttribute("oldm", map.get("2"));
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/worksinglewage/workSingleWageAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/worksinglewage/workSingleWageModifyApply";
					} else if (workProjectNotify.getRemarks().contains("待通知")) {
						return "modules/workfield/workSingleWageView";
					}
				}else if ("87".equals(workProjectNotify.getType())) {//借款
					WorkLoan workLoan = workLoanService.get(workProjectNotify.getNotifyId());
					workLoan.setHome("home");
					workLoan.setAct(getByAct(workLoan.getProcessInstanceId()));
					model.addAttribute("workLoan", workLoan);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workloan/workLoanAudit";
					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workloan/workLoanModify";
					} else if (workProjectNotify.getRemarks().contains("待通知")) {
						return "modules/workloan/workLoanView";
					}
				}else if ("88".equals(workProjectNotify.getType())) {//借款
					WorkRepay workRepay = workRepayService.get(workProjectNotify.getNotifyId());
					workRepay.setHome("home");
					workRepay.setAct(getByAct(workRepay.getProcessInstanceId()));
					model.addAttribute("workRepay", workRepay);
					if (workProjectNotify.getRemarks().contains("待审批") && !"1".equals(workProjectNotify.getStatus())) {
						return "modules/workrepay/workRepayAudit";
					}else if (workProjectNotify.getRemarks().contains("待通知")) {
						return "modules/workrepay/workRepayView";
					}
				}
			}
		}
		//如果该通知所对应的某记录已经被删除，在获取记录时会空指针
		catch (Exception e) {
			workProjectNotify.setStatus("1");
			workProjectNotify.preUpdate();
			workProjectNotifyService.save(workProjectNotify);
			model.addAttribute("errorMsg","关联记录已经被删除!!!");
		}
		model.addAttribute("workProjectNotify", workProjectNotify);
		return "modules/workprojectnotify/workProjectNotifyForm";
	}

	/**
	 * 查看，增加，编辑通知表单页面
	 */
	@RequestMapping(value = "view")
	public String view(WorkProjectNotify workProjectNotify, Model model,HttpServletRequest request) {
		try {
			if (StringUtils.isNotBlank(workProjectNotify.getType())){
				if(workProjectNotify.getType().equals("13")){	//报销
					WorkReimbursement workReimbursement = workReimbursementService.get(workProjectNotify.getNotifyId());
					model.addAttribute("workReimbursement",workReimbursement);
					return "modules/workreimbursement/workReimbursementFormDetail";

				}
				else if(workProjectNotify.getType().equals("16")){	//合同管理
					WorkContractInfo workContractInfo =workContractInfoService.get(workProjectNotify.getNotifyId());
					model.addAttribute("workContractInfo", workContractInfo);
					return "modules/workcontractinfo/workContractInfoLookForm";
				}
				else if(workProjectNotify.getType().equals("18")){
					Company company = companyService.get(workProjectNotify.getNotifyId());
					model.addAttribute("company", company);
					model.addAttribute("disabled","true");
					return "modules/sys/companyForm";
				}else if(workProjectNotify.getType().equals("19")){
					Company company = companyService.get(workProjectNotify.getNotifyId());
					model.addAttribute("company", company);
					model.addAttribute("disabled","true");
					return "modules/sys/companyForm";
				}
				else if(workProjectNotify.getType().equals("21")){	//开票管理
					WorkInvoice workInvoice = workInvoiceService.get(workProjectNotify.getNotifyId());
					workInvoice.setAct(getByAct(workInvoice.getProcessInstanceId()));
					if ( workInvoice.getAct()!=null){
						String taskDefKey = workInvoice.getAct().getTaskDefKey();
					}
					model.addAttribute("workInvoice",workInvoice);
					return "modules/workinvoice/workInvoiceView";
				}
				else if(workProjectNotify.getType().equals("24")){
					Leave oaLeave = leaveService.get(workProjectNotify.getNotifyId());
					oaLeave.setAct(getByAct(oaLeave.getProcessInstanceId()));
					oaLeave.setHome("home");
					model.addAttribute("leave",oaLeave);
					return "redirect:"+Global.getAdminPath()+"/oa/leave/form?id="+oaLeave.getId()+"&name=view";
				}else if(workProjectNotify.getType().equals("25")){
					WorkOvertimeForm workOvertimeForm = workOvertimeFormService.get(workProjectNotify.getNotifyId());
					workOvertimeForm.setAct(getByAct(workOvertimeForm.getProcessInstanceId()));
					workOvertimeForm.setHome("home");
					return "redirect:"+Global.getAdminPath()+"/workovertimeform/workOvertimeForm/form?id="+workOvertimeForm.getId()+"&name=view";

				}else if(workProjectNotify.getType().equals("26")){
					OaEvection oaEvection = oaEvectionService.get(workProjectNotify.getNotifyId());
					oaEvection.setAct(getByAct(oaEvection.getProcessInstanceId()));
					oaEvection.setHome("home");
					model.addAttribute("oaEvection",oaEvection);
					return "redirect:"+Global.getAdminPath()+"/oa_evection/oaEvection/form?id="+oaEvection.getId()+"&name=view";

				}else if(workProjectNotify.getType().equals("27")){
					WorkSealForm workSealForm = workSealFormService.get(workProjectNotify.getNotifyId());
					workSealForm.setAct(getByAct(workSealForm.getProcessInstanceId()));
					workSealForm.setHome("home");
					model.addAttribute("workSealForm",workSealForm);
					return "redirect:"+Global.getAdminPath()+"/worksealform/workSealForm/form?id="+workSealForm.getId()+"&name=view";


				} else if(workProjectNotify.getType().equals("28")){
					GoOut goOut = goOutService.get(workProjectNotify.getNotifyId());
					goOut.setAct(getByAct(goOut.getProcessInstanceId()));
					goOut.setHome("home");
					model.addAttribute("goOut",goOut);
					return "redirect:"+Global.getAdminPath()+"/goout/goOut/form?id="+goOut.getId()+"&name=view";

				}
				else if(workProjectNotify.getType().equals("29")){
					WorkProjectDeposit workProjectDeposit = workProjectDepositService.get(workProjectNotify.getNotifyId());
					model.addAttribute("workProjectDeposit",workProjectDeposit);
					return "redirect:"+Global.getAdminPath()+"/workprojectdeposit/workProjectDeposit/form?id="+workProjectDeposit.getId();

				}
				else if("32".equals(workProjectNotify.getType())){
					OaAll oaAll = oaAllService.get(workProjectNotify.getNotifyId());
					oaAll.setAct(getByAct(oaAll.getProcessInstanceId()));
					oaAll.setHome("home");
					model.addAttribute("oaAll",oaAll);
					return "redirect:"+Global.getAdminPath()+"/oaall/oaAll/form?id="+oaAll.getId()+"&tabId=0";

				}else if("33".equals(workProjectNotify.getType())){
					WorkPettyCash workPettyCash = workPettyCashService.get(workProjectNotify.getNotifyId());
					workPettyCash.setAct(getByAct(workPettyCash.getProcessInstanceId()));
					workPettyCash.setHome("home");
					model.addAttribute("workPettyCash",workPettyCash);
					return "redirect:"+Global.getAdminPath()+"/workpettycash/workPettyCash/form?id="+workPettyCash.getId()+"&name=view";
				}else if("34".equals(workProjectNotify.getType())){
					WorkPayment workPayment = workPaymentService.get(workProjectNotify.getNotifyId());
					workPayment.setAct(getByAct(workPayment.getProcessInstanceId()));
					workPayment.setHome("home");
					model.addAttribute("workPayment",workPayment);
					return "redirect:"+Global.getAdminPath()+"/workpayment/workPayment/form?id="+workPayment.getId()+"&name=view";

				}else if("37".equals(workProjectNotify.getType())){
					WorkReimbur workReimbur = workReimburService.get(workProjectNotify.getNotifyId());
					workReimbur.setAct(getByAct(workReimbur.getProcessInstanceId()));
					workReimbur.setHome("home");
					model.addAttribute("workReimbur",workReimbur);
					return "redirect:"+Global.getAdminPath()+"/workreimbur/workReimbur/form?id="+workReimbur.getId()+"&name=view";

				}else if("35".equals(workProjectNotify.getType())){ //采购
					OaBuy oaBuy = oaBuyService.get(workProjectNotify.getNotifyId());
					oaBuy.setAct(getByAct(oaBuy.getProcessInstanceId()));
					oaBuy.setHome("home");
					model.addAttribute("oaBuy",oaBuy);
					return "redirect:"+Global.getAdminPath()+"/oabuy/oaBuy/form?id="+oaBuy.getId()+"&tabId=0";

				}
				else if("36".equals(workProjectNotify.getType())){  //绩效自评
					OaPerformance oaPerformance = oaPerformanceService.get(workProjectNotify.getNotifyId());
					oaPerformance.setAct(getByAct(oaPerformance.getProcessInstanceId()));
					oaPerformance.setHome("home");
					model.addAttribute("oaPerformance",oaPerformance);
					return "redirect:"+Global.getAdminPath()+"/oaperformance/oaPerformance/form?id="+oaPerformance.getId()+"&tabId=0";

				}
				else if("38".equals(workProjectNotify.getType())){ //案例
					CaseInfo caseInfo = caseInfoService.get(workProjectNotify.getNotifyId());
					caseInfo.setAct(getByAct(caseInfo.getProcessInstanceId()));
					model.addAttribute("caseInfo",caseInfo);
					return "modules/caseinfo/caseInfoView";

				}
				else if("40".equals(workProjectNotify.getType())){ //退票
					WorkInvoiceDetail workInvoiceDetail = workInvoiceDetailService.get(workProjectNotify.getNotifyId());
					workInvoiceDetail.setAct(getByAct(workInvoiceDetail.getProcessInstanceId()));
					model.addAttribute("workInvoiceDetail",workInvoiceDetail);
					return "modules/workinvoicedetail/workInvoiceDetailFormDetail";
				}
				else if("39".equals(workProjectNotify.getType())){ //项目登记
					boolean flag = false;
					ProjectRecords projectRecords = projectRecordsService.get(workProjectNotify.getNotifyId());
                    if (projectRecords!=null&&StringUtils.isNotBlank(projectRecords.getId())) {
                        projectRecordsService.queryProjectDetail(projectRecords);
                        flag = true;
                    }
                    if (flag){
						projectRecords.setAct(getByAct(projectRecords.getProcessInstanceId()));
						model.addAttribute("projectRecords",projectRecords);
						return "modules/projectrecord/projectRecordsView";
					}else {
						RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(workProjectNotify.getNotifyId());
						if (ruralProjectRecords!=null&&StringUtils.isNotBlank(ruralProjectRecords.getId())){
							ruralProjectRecordsService.queryProjectDetail(ruralProjectRecords);
						}
						ruralProjectRecords.setAct(getByAct(ruralProjectRecords.getProcessInstanceId()));
						model.addAttribute("projectRecords",ruralProjectRecords);
						return "modules/ruralprojectrecords/ruralProjectRecordsView";
					}

				}
				else if("41".equals(workProjectNotify.getType())){ //项目变更
					boolean flag = false;
					ProjectRecordsAlter projectRecordsAlter = projectRecordsAlterService.get(workProjectNotify.getNotifyId());
                    if (projectRecordsAlter!=null&&StringUtils.isNotBlank(projectRecordsAlter.getId())) {
                        projectRecordsAlterService.queryProjectAlterDetail(projectRecordsAlter);
                        flag = true;
                    }
                    if (flag){
						ProjectRecords projectRecords = null;
						if (projectRecordsAlter.getAlterBeforeRecords()!=null&&StringUtils.isNotBlank(projectRecordsAlter.getAlterBeforeRecords().getId())){
							projectRecords = projectRecordsService.get(projectRecordsAlter.getAlterBeforeRecords().getId());
							projectRecordsService.queryProjectDetail(projectRecords);
							projectRecordsAlter.setAlterBeforeRecords(projectRecords);
						}
						projectRecords.setAct(getByAct(projectRecords.getProcessInstanceId()));
						model.addAttribute("projectRecordsAlter",projectRecordsAlter);
						return "modules/projectrecord/projectRecordsAlterView";
					}else {
						RuralProjectRecordsAlter ruralProjectRecordsAlter = ruralProjectRecordsAlterService.get(workProjectNotify.getNotifyId());
						if (projectRecordsAlter!=null&&StringUtils.isNotBlank(projectRecordsAlter.getId())) {
							projectRecordsAlterService.queryProjectAlterDetail(projectRecordsAlter);
							flag = true;
						}
						RuralProjectRecords ruralProjectRecords = null;
						if (ruralProjectRecordsAlter.getAlterBeforeRecords()!=null&&StringUtils.isNotBlank(ruralProjectRecordsAlter.getAlterBeforeRecords().getId())){
							ruralProjectRecords = ruralProjectRecordsService.get(ruralProjectRecordsAlter.getAlterBeforeRecords().getId());
							ruralProjectRecordsService.queryProjectDetail(ruralProjectRecords);
							ruralProjectRecordsAlter.setAlterBeforeRecords(ruralProjectRecords);
						}
						ruralProjectRecords.setAct(getByAct(ruralProjectRecords.getProcessInstanceId()));
						model.addAttribute("projectRecordsAlter",projectRecordsAlter);
						return "modules/ruralprojectrecords/ruralProjectRecordsAlterView";
					}

				}
				else if("45".equals(workProjectNotify.getType())){ //工作内容报告
					ProjectReportData projectReportData = projectReportDataService.get(workProjectNotify.getNotifyId());
					Projectcontentinfo projectcontentinfo = projectcontentinfoService.getByInfoId(projectReportData.getId());
					projectcontentinfo.setProjectReportData(projectReportData);
					model.addAttribute("projectcontentinfo", projectcontentinfo);
					return "modules/projectcontentinfo/reportView";
				}
				else if("46".equals(workProjectNotify.getType())){ //工作内容报告
					ProjectReportData projectReportData = projectReportChangeService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(projectReportData.getProcessInstanceId());
					projectReportData.setAct(act);
					List<Projectcontentinfo> projectcontentinfos = projectcontentinfoService.getByChangeInfoId(projectReportData.getId());
					Projectcontentinfo projectcontentinfo = projectcontentinfos.get(0);
					projectcontentinfo.setProjectReportData(projectReportData);
					ProjectReportData beforeEntity = projectReportChangeService.getBefore(projectReportData.getBeforeEntity().getId());
					projectReportData.setBeforeEntity(beforeEntity);
					model.addAttribute("projectcontentinfo", projectcontentinfo);
					return "modules/projectcontentinfo/reportChangeView";
				}
				else if("47".equals(workProjectNotify.getType())){ //工作内容报告
					ProjectReportData projectReportData = projectReportDataService.get(workProjectNotify.getNotifyId());
					Projectcontentinfo projectcontentinfo = projectcontentinfoService.getByInfoId(projectReportData.getId());
					projectcontentinfo.setProjectReportData(projectReportData);
					model.addAttribute("projectcontentinfo", projectcontentinfo);
					return "modules/projectcontentinfo/reportView";
				}else if(workProjectNotify.getType().equals("51")){	//工作内容报告归档
					ProjectReportRecord projectReportRecord = projectReportRecordService.get(workProjectNotify.getNotifyId());
					model.addAttribute("projectReportRecord", projectReportRecord);
					return "modules/projectcontentinfo/reportRecordView";
				}else if("52".equals(workProjectNotify.getType())){	//收入结算
                    WorkReceiptsSettle workReceiptsSettle = workReceiptsSettleService.get(workProjectNotify.getNotifyId());
                    model.addAttribute("workReceiptsSettle", workReceiptsSettle);
                    return "modules/workreceiptssettle/workReceiptsSettleView";
                }else if("55".equals(workProjectNotify.getType())){	//收文
                    WorkIncomingMessage workIncomingMessage = workIncomingMessageService.get(workProjectNotify.getNotifyId());
                    if(StringUtils.isNotBlank(workIncomingMessage.getDailyId())&&!"NoN".equals(workIncomingMessage.getDailyId())){
                        WorkDailyRoutineDetail routineDetail = new WorkDailyRoutineDetail();
                        routineDetail.setWorkDailyRoutine(new WorkDailyRoutine(workIncomingMessage.getDailyId()));
                        List<WorkDailyRoutineDetail> list = workDailyRoutineDetailService.findList(routineDetail);
                        if(list!=null&&list.size()>0){
                            for (WorkDailyRoutineDetail detail : list) {
                                if("未完成".equals(detail.getStatus())){
                                    workIncomingMessage.setDailyFlag(false);
                                    break;
                                }
                            }
                        }
                        workIncomingMessage.setDetailList(list);
                    }
                    model.addAttribute("workIncomingMessage", workIncomingMessage);
                    return "modules/workincomingmessage/workIncomingMessageView";
                }else if("56".equals(workProjectNotify.getType())){	//行政盖章
                    WorkAdministrativeAtamp workAdministrativeAtamp = workAdministrativeAtampService.get(workProjectNotify.getNotifyId());
                    model.addAttribute("workAdministrativeAtamp", workAdministrativeAtamp);
                    return "modules/workadministrativeatamp/workAdministrativeAtampView";
                }else if("58".equals(workProjectNotify.getType())){	//日常事务
                        WorkDailyRoutine workDailyRoutine = workDailyRoutineService.get(workProjectNotify.getNotifyId());
                        if(StringUtils.isNotBlank(workDailyRoutine.getId())){
                            workDailyRoutineService.queryDetails(workDailyRoutine);
                        }
                        model.addAttribute("workDailyRoutine", workDailyRoutine);
                        return "modules/workdailyroutine/workDailyRoutineView";
                }else if("59".equals(workProjectNotify.getType())){	//借用管理
					WorkBorrowMangement workBorrowMangement = workBorrowMangementService.get(workProjectNotify.getNotifyId());
					model.addAttribute("workBorrowMangement", workBorrowMangement);
					return "modules/workborrowmangement/workBorrowMangementView";
				}else if("62".equals(workProjectNotify.getType())){	//发文管理
                    WorkSendMessage workSendMessage = workSendMessageService.get(workProjectNotify.getNotifyId());
                    if(StringUtils.isNotBlank(workSendMessage.getId())){
                        workSendMessageService.queryDetails(workSendMessage);
                    }
                    model.addAttribute("workSendMessage", workSendMessage);
                    return "modules/worksendmessage/workSendMessageView";
				}else if("89".equals(workProjectNotify.getType())){	//发文管理
                    OaNotify oaNotify = oaNotifyService.get(workProjectNotify.getNotifyId());
                    if(StringUtils.isNotBlank(oaNotify.getId())){
                        oaNotifyService.queryDetails(oaNotify);
                    }
                    model.addAttribute("oaNotify", oaNotify);
                    return "modules/oa/oaNotifyView";
                }else if("60".equals(workProjectNotify.getType())){	//归还借用管理
					WorkBorrowBack workBorrowBack = workBorrowBackService.get(workProjectNotify.getNotifyId());
					WorkBorrowMangement mangement=workBorrowMangementService.get(workBorrowBack.getBorrowMangementId());
					workBorrowBack.setWorkBorrowMangement(mangement);
					model.addAttribute("workBorrowBack", workBorrowBack);
					return "modules/workborrowmangement/workBorrowBackView";
				}else if("64".equals(workProjectNotify.getType())){	//归还借用管理
					WorkItemCollar workItemCollar = workItemCollarService.get(workProjectNotify.getNotifyId());
					List<WorkItemCollarCatalog> workItemCollarCatalogList=workItemCollarService.findWorkItemCollarCatalogList(workItemCollar);
					workItemCollar.setWorkItemCollarCatalogList(workItemCollarCatalogList);
					List<WorkItemCollarItem> workItemCollarItem=workItemCollarService.findWorkItemCollarItemList(workItemCollar);
					workItemCollar.setWorkItemCollarItemList(workItemCollarItem);
					model.addAttribute("workItemCollar", workItemCollar);
					return "modules/workitemcollar/workItemCollarView";
				}
				else if(workProjectNotify.getType().equals("42")){	//合同归档
					WorkContractRecord workContractRecord = workContractRecordService.get(workProjectNotify.getNotifyId());
					workContractRecord.setAct(getByAct(workContractRecord.getProcessInstanceId()));
					workContractRecord.setHome("home");
					model.addAttribute("workContractRecord",workContractRecord);
					return "modules/workcontractrecord/workContractView";
				}else if(workProjectNotify.getType().equals("54")){	//收入调整作废
					WorkReceiptsRevise workReceiptsRevise = workReceiptsReviseService.get(workProjectNotify.getNotifyId());
					workReceiptsRevise.setAct(getByAct(workReceiptsRevise.getInvalidProcessInstanceId()));
					workReceiptsRevise.setHome("home");
					model.addAttribute("workReceiptsRevise",workReceiptsRevise);
					return "modules/workreceiptsrevise/workReceiptsReviseView";
				}
				else if(workProjectNotify.getType().equals("53")){	//收入调整
					WorkReceiptsRevise workReceiptsRevise = workReceiptsReviseService.get(workProjectNotify.getNotifyId());
					workReceiptsRevise.setAct(getByAct(workReceiptsRevise.getProcessInstanceId()));
					workReceiptsRevise.setHome("home");
					model.addAttribute("workReceiptsRevise",workReceiptsRevise);
					return "modules/workreceiptsrevise/workReceiptsReviseView";
				}else if(workProjectNotify.getType().equals("48")){	//发票变更
					WorkInvoiceAlter workInvoiceAlter = workInvoiceAlterService.get(workProjectNotify.getNotifyId());
					workInvoiceAlter.setAct(getByAct(workInvoiceAlter.getProcessInstanceId()));
					workInvoiceAlter.setHome("home");
					model.addAttribute("workInvoiceAlter",workInvoiceAlter);
					return "modules/workinvoicealter/workInvoiceViewa";
				}else if(workProjectNotify.getType().equals("49")){	//退票变更
					WorkInvoiceReturnAlter workInvoiceReturnAlter = workInvoiceReturnAlterService.get(workProjectNotify.getNotifyId());
					workInvoiceReturnAlter.setAct(getByAct(workInvoiceReturnAlter.getProcessInstanceId()));
					workInvoiceReturnAlter.setHome("home");
					model.addAttribute("workInvoiceReturnAlter",workInvoiceReturnAlter);
					return "modules/workinvoicereturnalter/workInvoiceReturnAlterView";
				}else if(workProjectNotify.getType().equals("44")){	//合同变更
					WorkContractInfo workContractInfo =workContractInfoService.get(workProjectNotify.getNotifyId());
					workContractInfo.setHome("home");
					workContractInfo.setAct(getByAct(workContractInfo.getAlterProcessInstanceId()));
					model.addAttribute("workContractInfo", workContractInfo);
					return "modules/workcontractinfo/workContractInfoLookForm";
				}else if(workProjectNotify.getType().equals("43")){	//合同作废
					WorkContractInfo workContractInfo = workContractInfoService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(workContractInfo.getInvalidateProcessInstanceId());
					workContractInfo.setHome("home");
					workContractInfo.setAct(act);
					String view = "contractInvalidateAudit";
					if (act.getProcInsId() != null) {
						if (actTaskService.getProcIns(act.getProcInsId()) != null) {
							act.setProcIns(actTaskService.getProcIns(act.getProcInsId()));
						} else {
							act.setFinishedProcIns(actTaskService.getFinishedProcIns(act.getProcInsId()));
						}
					}
					if (act != null && StringUtils.isNotBlank(act.getTaskId())) {
						workContractInfo.setAct(act);
						model.addAttribute("processInstanceId", workContractInfo.getInvalidateProcessInstanceId());
					}
					// 环节编号,默认是 "bmzrAudit"
					String taskDefKey = workContractInfo.getAct().getTaskDefKey();

					model.addAttribute("workContractInfo", workContractInfo);
					return "modules/workcontractinfo/workContractInfoLookForm";
				}else if(workProjectNotify.getType().equals("50")){	//投标管理
					WorkBidProject workBidProject = workBidProjectService.get(workProjectNotify.getNotifyId());
					workBidProject.setAct(getByAct(workBidProject.getProcessInstanceId()));
					workBidProject.setHome("home");
					model.addAttribute("workBidProject",workBidProject);
					return "modules/workbidproject/workBidProjectView";
				}else if(("57").equals(workProjectNotify.getType())){	//采购合同
					WorkStockContract workStockContract = workStockContractService.get(workProjectNotify.getNotifyId());
					workStockContract.setAct(getByAct(workStockContract.getProcessInstanceId()));
					workStockContract.setHome("home");
					model.addAttribute("workStockContract",workStockContract);
					return "modules/workstockcontract/workStockContractView";
				}else if(workProjectNotify.getType().equals("61")){	//采购管理
					WorkStock workStock =workStockService.get(workProjectNotify.getNotifyId());
					workStock.setAct(getByAct(workStock.getProcessInstanceId()));
					workStock.setHome("home");
					model.addAttribute("workStock",workStock);
					return "modules/workstock/workStockView";
				}else if(workProjectNotify.getType().equals("63")){	//报废管理
					WorkScrap workScrap =workScrapService.get(workProjectNotify.getNotifyId());
					workScrap.setAct(getByAct(workScrap.getProcessInstanceId()));
					workScrap.setHome("home");
					model.addAttribute("workScrap",workScrap);
					return "modules/workscrap/workScrapView";
				}else if(workProjectNotify.getType().equals("66")){	//转正申请
					WorkRegularApply workRegularApply =workRegularApplyService.get(workProjectNotify.getNotifyId());
					workRegularApply.setAct(getByAct(workRegularApply.getProcessInstanceId()));
					workRegularApply.setHome("home");
					WorkRegularScore workRegularScore=new WorkRegularScore();
					workRegularScore.setRegularApplyId(workRegularApply.getId());
					List<WorkRegularScore> workRegularScoreList=workRegularScoreService.findList(workRegularScore);
					workRegularApply.setWorkRegularScoreList(workRegularScoreList);
					model.addAttribute("workRegularApply",workRegularApply);
					return "modules/workregularapply/workRegularApplyView";
				}else if(workProjectNotify.getType().equals("68")){	//部门调整
					WorkOfficeChange workOfficeChange =workOfficeChangeService.get(workProjectNotify.getNotifyId());
					workOfficeChange.setAct(getByAct(workOfficeChange.getProcessInstanceId()));
					workOfficeChange.setHome("home");
					WorkOfficeChangeUser workOfficeChangeUser=new WorkOfficeChangeUser();
					workOfficeChangeUser.setChangeId(workOfficeChange.getId());
					List<WorkOfficeChangeUser> workOfficeChangeUserList=workOfficeChangeUserService.findList(workOfficeChangeUser);
					workOfficeChange.setWorkOfficeChangeUserList(workOfficeChangeUserList);
					model.addAttribute("workOfficeChange",workOfficeChange);
					return "modules/workofficechange/workOfficeChangeView";
				}else if("69".equals(workProjectNotify.getType())){	//日常事务
                    WorkStaffBasicInfo select = new WorkStaffBasicInfo();
                    select.setAchiveId(workProjectNotify.getNotifyId());
                    WorkStaffBasicInfo workStaffBasicInfo= workStaffBasicInfoService.getAchive(select);
                    if(StringUtils.isNotBlank(workStaffBasicInfo.getId())) {
                        workStaffBasicInfoService.queryDetails(workStaffBasicInfo);
                    }
                    workStaffBasicInfo.setHome("home");
                    model.addAttribute("workStaffBasicInfo", workStaffBasicInfo);
                    String view = "modules/workstaff/workStaffAchiveInfoForm";
                    if(UserUtils.getUser().getId().equals(workStaffBasicInfo.getUserId())){
                        view = "modules/workstaff/workStaffBasicDetailForm";
                    }
                    return view;
                }else if("86".equals(workProjectNotify.getType())){	//日常事务
					WorkStaffBasicInfo select = new WorkStaffBasicInfo();
					select.setAchiveId(workProjectNotify.getNotifyId());
					WorkStaffBasicInfo workStaffBasicInfo= workStaffBasicInfoService.getAchive(select);
					if(StringUtils.isNotBlank(workStaffBasicInfo.getId())) {
						workStaffBasicInfoService.queryDetailsApply(workStaffBasicInfo);
					}
					workStaffBasicInfo.setHome("home");
					model.addAttribute("workStaffBasicInfo", workStaffBasicInfo);
					return "modules/workstaff/workStaffBasicDetailAudit";
				}else if(workProjectNotify.getType().equals("70")){	//职级调整
					WorkChangeJob workChangeJob =workChangeJobService.get(workProjectNotify.getNotifyId());
					workChangeJob.setAct(getByAct(workChangeJob.getProcessInstanceId()));
					workChangeJob.setHome("home");
					WorkChangeJobUser WorkChangeJobUser=new WorkChangeJobUser();
					WorkChangeJobUser.setChangeId(workChangeJob.getId());
					List<WorkChangeJobUser> workChangeJobUserList=workChangeJobUserService.findList(WorkChangeJobUser);
					workChangeJob.setWorkChangeJobUserList(workChangeJobUserList);
					model.addAttribute("workChangeJob",workChangeJob);
					return "modules/workchangejob/workChangeJobView";
				}else if(workProjectNotify.getType().equals("67")){	//劳动关系
					WorkRelationship workRelationship  = workRelationshipService.get(workProjectNotify.getNotifyId());
					workRelationship.setAct(getByAct(workRelationship.getProcessInstanceId()));
					workRelationship.setHome("home");
					model.addAttribute("workRelationship",workRelationship);
					return "modules/workrelationship/workRelationshipView";
				}else if ("72".equals(workProjectNotify.getType())) {
					WorkContractInfo workContractInfo = workContractInfoService.get(workProjectNotify.getNotifyId());
					workContractInfo.setAct(getByAct(workContractInfo.getProcessInstanceId()));
					workContractInfo.setHome("home");
					model.addAttribute("workContractInfo", workContractInfo);
					return "modules/workcontractinfo/workContractInfoLookForm";
				}else if ("75".equals(workProjectNotify.getType())) {    //加入企业
					Useroffice useroffice = userofficeService.get(workProjectNotify.getNotifyId());
					Act act = getByAct(useroffice.getProcessInstanceId());
					useroffice.setAct(act);
					useroffice.setHome("home");
					model.addAttribute("useroffice", useroffice);
					Office office = officeService.get(useroffice.getCompanyId());
					User user = UserUtils.get(useroffice.getUserId());
					if(StringUtils.isNotBlank(useroffice.getMaster())){
						User master =  UserUtils.get(useroffice.getMaster());
						useroffice.setMasterName(master.getName());
					}

					model.addAttribute("companyinfo", useroffice);
					model.addAttribute("office", office);
					model.addAttribute("user", user);
					model.addAttribute("disabled",true);
					return "modules/sys/companyinfoView";
				}else if(workProjectNotify.getType().equals("71")){	//职级调整
					WorkResignation workResignation = workResignationService.get(workProjectNotify.getNotifyId());
					workResignation.setAct(getByAct(workResignation.getProcessInstanceId()));
					workResignation.setHome("home");
					model.addAttribute("workResignation",workResignation);
					return "modules/workresignation/workResignationView";
				}else if(workProjectNotify.getType().equals("80")){	//请假
					LeaveApply leaveApply =leaveApplyService.get(workProjectNotify.getNotifyId());
					leaveApply.setAct(getByAct(leaveApply.getProcessInstanceId()));
					leaveApply.setHome("home");
					//查询请假明细
					LeaveDetail leaveDetail=new LeaveDetail();
					leaveDetail.setLeaveId(leaveApply.getId());
					List<LeaveDetail> list=leaveDetailDao.findList(leaveDetail);
					leaveApply.setLeaveDetailList(list);
					//查询历史明细
					List<LeaveDetail> hisList=leaveDetailDao.findListHis(leaveApply.getStaffId());
					leaveApply.setHisLeaveDetailList(hisList);
					model.addAttribute("leaveApply",leaveApply);
					return "modules/leaveapply/leaveApplyView";
				}else if ("83".equals(workProjectNotify.getType())) {//补卡
					WorkAttendanceInfo workAttendanceInfo = workAttendanceInfoService.getAudit(workProjectNotify.getNotifyId());
					workAttendanceInfo.setHome("home");
					model.addAttribute("workAttendanceInfo", workAttendanceInfo);
					model.addAttribute("ids", workProjectNotify.getKind());
					return "modules/workattendance/workAttendanceAudit";
				}else if ("84".equals(workProjectNotify.getType())) {//补卡
					WorkAttendanceCount workAttendanceCount = workAttendanceCountService.get(workProjectNotify.getNotifyId());
					workAttendanceCount.setHome("home");
					model.addAttribute("workAttendanceCount", workAttendanceCount);
					return "modules/workattendance/workAttendanceCountForm";
				}else if ("85".equals(workProjectNotify.getType())) {//补卡
					WorkSingleWage workSingleWage = workSingleWageService.get(workProjectNotify.getNotifyId());
					workSingleWage.setHome("home");
					Map<String,String> map = StringUtils.getMonth();
					model.addAttribute("workSingleWage", workSingleWage);
					model.addAttribute("nowm", map.get("1"));
					model.addAttribute("oldm", map.get("2"));
					return "modules/worksinglewage/workSingleWageView";
				}else if ("91".equals(workProjectNotify.getType())) {
					WorkContractSignature workContractSignature = workContractSignatureService.get(workProjectNotify.getNotifyId());
					workContractSignature.setAct(getByAct(workContractSignature.getProcessInstanceId()));
					workContractSignature.setHome("home");
					model.addAttribute("workContractSignature", workContractSignature);
					return "modules/workcontractsignature/workContractSignatureView";
				}
			}
		}
		//如果该通知所对应的某记录已经被删除，在获取记录时会空指针WorkItemCollar workItemCollar = workItemCollarService
		catch (Exception e) {
			workProjectNotify.setStatus("1");
			workProjectNotify.preUpdate();
			workProjectNotifyService.save(workProjectNotify);
			model.addAttribute("errorMsg","关联记录已经被删除!!!");
		}
		model.addAttribute("workProjectNotify", workProjectNotify);
		return "modules/workprojectnotify/workProjectNotifyForm";
	}

	public Act getByAct(String processInstanceId){
		Act act = new Act();
		HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
		ProcessInstance processInstance = actTaskService.getProcIns(processInstanceId);
		if (processInstance!=null) {
			List<Task> taskList = actTaskService.getCurrentTaskList(processInstance);
			if(taskList!=null && taskList.size()>1){
				for (Task taskInfok:taskList) {
					if (taskInfok.getAssignee().equals(UserUtils.getUser().getId())) {
						act.setTaskId(taskInfok.getId());
						act.setTaskName(taskInfok.getName());
						act.setTaskDefKey(taskInfok.getTaskDefinitionKey());
						act.setProcDefId(taskInfok.getProcessDefinitionId());
						act.setProcInsId(taskInfok.getProcessInstanceId());
						act.setTask(taskInfok);
					}
				}
			}else {
				Task task = actTaskService.getCurrentTaskInfo(processInstance);
				act.setTaskId(task.getId());
				act.setTaskName(task.getName());
				act.setTaskDefKey(task.getTaskDefinitionKey());
				act.setProcDefId(task.getProcessDefinitionId());
				act.setProcInsId(task.getProcessInstanceId());
				act.setTask(task);
			}
		}
		return  act;
		/*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);
			return act;
		}else {
			return null;
		}*/
	}

	/**
	 * 保存通知
	 */
	@RequestMapping(value = "save")
	public String save(WorkProjectNotify workProjectNotify, Model model, RedirectAttributes redirectAttributes,HttpServletRequest request) throws Exception{
		if (!beanValidator(model, workProjectNotify)){
			return form(workProjectNotify, model,request);
		}
		if(!workProjectNotify.getIsNewRecord()){//编辑表单保存
			WorkProjectNotify t = workProjectNotifyService.get(workProjectNotify.getId());//从数据库取出记录的值
			MyBeanUtils.copyBeanNotNull2Bean(workProjectNotify, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
			workProjectNotifyService.save(t);//保存
		}else{//新增表单保存
			workProjectNotifyService.save(workProjectNotify);//保存
		}
		addMessage(redirectAttributes, "保存通知成功");
		return "redirect:"+Global.getAdminPath()+"/workprojectnotify/workProjectNotify/?repage";
	}

	/**
	 * 删除通知
	 */
	@RequestMapping(value = "delete")
	public String delete(WorkProjectNotify workProjectNotify, RedirectAttributes redirectAttributes) {
		workProjectNotifyService.delete(workProjectNotify);
		addMessage(redirectAttributes, "删除通知成功");
		return "redirect:"+Global.getAdminPath()+"/workprojectnotify/workProjectNotify/?repage";
	}

	/**
	 * 批量删除通知
	 */
	@RequestMapping(value = "deleteAll")
	public String deleteAll(String ids, RedirectAttributes redirectAttributes) {
		String idArray[] =ids.split(",");
		for(String id : idArray){
			workProjectNotifyService.delete(workProjectNotifyService.get(id));
		}
		addMessage(redirectAttributes, "删除通知成功");
		return "redirect:"+Global.getAdminPath()+"/workprojectnotify/workProjectNotify/?repage";
	}

	/**
	 * 导出excel文件
	 */
    @RequestMapping(value = "export", method=RequestMethod.POST)
    public String exportFile(WorkProjectNotify workProjectNotify, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
		try {
            String fileName = "通知"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
            Page<WorkProjectNotify> page = workProjectNotifyService.findPage(new Page<WorkProjectNotify>(request, response, -1), workProjectNotify);
    		new ExportExcel("通知", WorkProjectNotify.class).setDataList(page.getList()).write(response, fileName).dispose();
    		return null;
		} catch (Exception e) {
			addMessage(redirectAttributes, "导出通知记录失败！失败信息："+e.getMessage());
		}
		return "redirect:"+Global.getAdminPath()+"/workprojectnotify/workProjectNotify/?repage";
    }

	/**
	 * 导入Excel数据

	 */
    @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<WorkProjectNotify> list = ei.getDataList(WorkProjectNotify.class);
			for (WorkProjectNotify workProjectNotify : list){
				try{
					workProjectNotifyService.save(workProjectNotify);
					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()+"/workprojectnotify/workProjectNotify/?repage";
    }

	/**
	 * 下载导入通知数据模板
	 */
    @RequestMapping(value = "import/template")
    public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
		try {
            String fileName = "通知数据导入模板.xlsx";
    		List<WorkProjectNotify> list = Lists.newArrayList();
    		new ExportExcel("通知数据", WorkProjectNotify.class, 1).setDataList(list).write(response, fileName).dispose();
    		return null;
		} catch (Exception e) {
			addMessage(redirectAttributes, "导入模板下载失败！失败信息："+e.getMessage());
		}
		return "redirect:"+Global.getAdminPath()+"/workprojectnotify/workProjectNotify/?repage";
    }

	/**
	 * 获取通知数据
	 */
	@RequestMapping(value = "/notify")
	@ResponseBody
	public Map<String,Object> notify(HttpServletRequest request, HttpServletResponse response){
		String officeId = "";
		Map map = new HashMap();
		User user = UserUtils.getUser();
		OaNotify oaNotify = new OaNotify();
		oaNotify.setReadFlag("0");
		oaNotify.setSelf(true);
		Page<OaNotify> page = oaNotifyService.findMyself(new Page<OaNotify>(request, response), oaNotify);
		map.put("count", page.getList().size());//未读通知条数
		WorkProjectNotify workProjectNotify = new WorkProjectNotify();
		workProjectNotify.setUser(user);
		workProjectNotify.setCompanyId(user.getComId());
		workProjectNotify.setRemarks("待审批");
		Page<WorkProjectNotify> notifyPage = workProjectNotifyService.findPage(new Page<WorkProjectNotify>(request, response), workProjectNotify);
		map.put("notifyCount", notifyPage.getList().size());//未读通知条数
		workProjectNotify.setStatus("0");
		workProjectNotify.setRemarks("待通知");
		Page<WorkProjectNotify> notifyPageShow = workProjectNotifyService.findPage(new Page<WorkProjectNotify>(request, response), workProjectNotify);
		map.put("notifyShowCount", notifyPageShow.getList().size());//未读通知条数
		//
		MailBox mailBox = new MailBox();
		mailBox.setReceiver(user);
		mailBox.setReadstatus("0");//筛选未读
		Page<MailBox> mailPage = mailBoxService.findPage(new MailPage<MailBox>(request, response), mailBox);
		map.put("noReadCount", mailBoxService.getCount(mailBox));
		map.put("msg","success");
		return map;
	}

	/**
	 * 读取单个实体流程
	 * @return
	 */
	@RequestMapping(value = "getProcessOne")
	public String getProcessOne(String processInstanceId,Model model) {
		model.addAttribute("processInstanceId", processInstanceId);
		return "modules/workprojectnotify/workProjectNotifyTask";
	}
	

}