端午节研究代码 OLD
HTML:
<%-- Task_ID Author Modify_Date Description IT0958 Robin 11/02/2007 DS-007 During search form, it should add filter field "Requested_By" IT0958 Robin 11/02/2007 DS-013 Form can export to excel file IT1029 Young 06/26/2008 DS-001 Revise the condition of showing the deputy logo N/A asnpg9a 11/16/2009 added search criteria "completed date". --%> <%@ include file="/common/head.jsp" %> <%@ taglib uri="/WEB-INF/taglibs-i18n.tld" prefix="i18n" %> <%@page import="java.util.*,com.aiait.eflow.housekeeping.vo.StaffVO,java.text.SimpleDateFormat,com.aiait.eflow.util.StringUtil,com.aiait.eflow.wkf.vo.*,com.aiait.eflow.wkf.util.DataMapUtil,com.aiait.eflow.common.helper.StaffTeamHelper,com.aiait.eflow.common.helper.*" %> <%@page import="com.aiait.eflow.housekeeping.vo.FormTypeVO,com.aiait.eflow.common.helper.FormTypeHelper,com.aiait.eflow.formmanage.vo.FormManageVO,com.aiait.eflow.common.*,com.aiait.eflow.common.helper.AuthorityHelper,com.aiait.eflow.housekeeping.vo.CompanyVO"%> <%@page import="com.aiait.framework.i18n.I18NMessageHelper"%> <%@ taglib uri="/WEB-INF/purview.tld" prefix="purview" %> <%@ include file="/common/loading.jsp" %> <%@ include file="/common/ajaxmessage.jsp" %> <%@ taglib uri="/WEB-INF/taglibs-page.tld" prefix="pageTag" %> <html> <head> <title>Personal Applied Form List</title> <link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css"> <script type=text/javascript src="<%=request.getContextPath()%>/common/message.jsp"></script> <script language="javascript" src="<%=request.getContextPath()%>/js/common.js"></script> <script language="javascript" src="<%=request.getContextPath()%>/js/calendar.js"></script> <script language="javascript" src="<%=request.getContextPath()%>/js/ajax.js"></script> <SCRIPT language="javascript" src="<%=request.getContextPath()%>/js/sorttable.js"></SCRIPT> <script language="javascript" src="<%=request.getContextPath()%>/js/resizeCol.js"></script> <script language="javascript" src="<%=request.getContextPath()%>/js/tableColorChange.js"></script> <script language="javascript" src="<%=request.getContextPath()%>/js/BubbleTooltips.js"></script> <script language="javascript" src="<%=request.getContextPath()%>/js/aiaitjsframe.js"></script> <script language="javascript"> var xmlhttp = createXMLHttpRequest(); function getOptionList(formType){ type = formType; var url = "<%=request.getContextPath()%>/formManageAction.it?method=getFormList&formType="+formType+"&moduleId=<%=ModuleOperateName.MODULE_FORM_INQUIRY%>"; xmlhttp.open("GET", url, true); var objId = "formSystemId"; xmlhttp.onreadystatechange=handleStateChange; xmlhttp.setRequestHeader("If-Modified-Since","0"); xmlhttp.send(null); var ob = $('formType'); if(ob[ob.selectedIndex].text.toLowerCase().indexOf("epayment")>-1){ $('divsunac').style.visibility = "visible"; } else { $('divsunac').style.visibility = "hidden"; } } function getStaffList(orgId){ var url = "<%=request.getContextPath()%>/userManageAction.it?method=getCompanyStaffList"; var param = "orgId="+orgId; var myAjax = new Ajax.Request( url, { method:"post", // parameters:param, // setRequestHeader:{"If-Modified-Since":"0"}, // onComplete:function(x){ // updateStaffList(x.responseXML); }, onError:function(x){ // alert('Fail to get staff list for company'); } } ); } function verifyCompletedDates(){ if(document.forms[0].beginCompletedDate.value!=""){ if(isDate(document.forms[0].beginCompletedDate,"<%=I18NMessageHelper.getMessage("common.complete_date_from")%>")==false){ return false; } } if(document.forms[0].endCompletedDate.value!=""){ if(isDate(document.forms[0].endCompletedDate,"<%=I18NMessageHelper.getMessage("common.complete_date_to")%>")==false){ return false; } } if(document.forms[0].beginCompletedDate.value!="" && document.forms[0].endCompletedDate.value!=""){ if(compareDate(document.forms[0].beginCompletedDate.value.Trim(),document.forms[0].endCompletedDate.value.Trim())==false){ alert(from_to_date_compare); document.forms[0].beginCompletedDate.focus(); return false; } } return true; } function searchForm(){ if(document.forms[0].beginSubmissionDate.value.Trim()!=""){ if(isDate(document.forms[0].beginSubmissionDate,"Submitted From")==false){ return; } } if(document.forms[0].endSubmissionDate.value.Trim()!=""){ if(isDate(document.forms[0].endSubmissionDate,"Submitted To")==false){ return; } } if(document.forms[0].beginSubmissionDate.value.Trim()!="" && document.forms[0].endSubmissionDate.value.Trim()!=""){ if(compareDate(document.forms[0].beginSubmissionDate.value.Trim(),document.forms[0].endSubmissionDate.value.Trim())==false){ alert(from_to_date_compare); document.forms[0].beginSubmissionDate.focus(); return; } } if (!(verifyCompletedDates())) return; var url = "<%=request.getContextPath()%>/wkfProcessAction.it?method=listInquiryForm"; document.forms[0].action = url; document.forms[0].submit(); } /** IT0973 **/ function unlockForms(){ if(checkSelect('requestNos')<=0){ alert(have_no_select); return; } if(confirm(confirm_unlock_form)){ document.forms[0].action = "<%=request.getContextPath()%>/wkfProcessAction.it?method=unlockForms&moduleId=<%=ModuleOperateName.MODULE_FORM_INQUIRY%>&operateId=<%=ModuleOperateName.OPER_FORM_INQUIRY_UNLOCK%>"; document.forms[0].submit(); } } /** IT0973 **/ function openSelectStaffWindow(requestNo,nodeId,requestStaffCode,formSystemId){ if(confirm(confirm_reassign_form)){ document.all['reassignRequestNo'].value = requestNo; document.all['reassignNodeId'].value = nodeId; document.all['reassignRequestStaffCode'].value = requestStaffCode; document.all['reassignFormSystemId'].value = formSystemId; var returnValue = showModalDialog('<%=request.getContextPath()%>/userManageAction.it?method=enterSelectStaff&moduleId=<%=ModuleOperateName.MODULE_FORM_INQUIRY%>&operateId=<%=ModuleOperateName.OPER_FORM_INQUIRY_REASSIGN%>&tempDate='+Math.random()*100000, window,'dialogWidth:475px; dialogHeight:500px;help:0;status:0;resizable:1;'); if (returnValue != null){ document.all['selectStaff'].value = returnValue; if(document.all['selectStaff'].value.length > 100){ alert("You selected too many users to reassign."); return; } reassignForms(); } } } function reassignForms(){ var url = "<%=request.getContextPath()%>/wkfProcessAction.it?method=adjustProcessorForm" +"&reassignRequestNo="+document.all['reassignRequestNo'].value +"&reassignNodeId="+document.all['reassignNodeId'].value +"&selectStaff="+document.all['selectStaff'].value +"&reassignRequestStaffCode="+document.all['reassignRequestStaffCode'].value +"&reassignFormSystemId="+document.all['reassignFormSystemId'].value; xmlhttp.open("POST", url, true); xmlhttp.onreadystatechange=function(){ if(xmlhttp.readyState == 4){ if(xmlhttp.status == 200){ result = xmlhttp.responseText; if(result=="success"){ hideMessage(); alert(operate_success); window.document.forms[0].submit(); }else{ alert("Fail:"+result); hideMessage(); } } }else{ showMessage(operating_tip); } } xmlhttp.setRequestHeader("If-Modified-Since","0"); xmlhttp.send(null); } /** IT0958 DS-013 Begin **/ function openExportPage(){ if(document.forms[0].formSystemId.value==""){ alert(select_export_form); document.forms[0].formSystemId.focus(); return; } if (!(verifyCompletedDates())) return; var url = "<%=request.getContextPath()%>/wkfProcessAction.it?method=enterSettingExportExcel&formSystemId="+document.forms[0].formSystemId.value +"&status="+document.forms[0].status.value+"&requestedBy="+document.forms[0].requestedBy.value +"&beginDate="+document.forms[0].beginSubmissionDate.value+"&endDate="+document.forms[0].endSubmissionDate.value +"&beginCompletedDate="+document.forms[0].beginCompletedDate.value+"&endCompletedDate="+document.forms[0].endCompletedDate.value +"&requestNo="+document.forms[0].requestNo.value+"&companyId="+document.forms[0].companyId.value +"&processType="+document.forms[0].processType.value; var date = new Date(); var w_name = "w_" + date.getTime(); openCenterWindow(url, 600, 350, w_name); } //IT0958 DS-013 End function openExportQueryPage() { if (document.forms[0].beginSubmissionDate.value.Trim() != "") { if (isDate(document.forms[0].beginSubmissionDate, "Submitted From") == false) { return; } } if (document.forms[0].endSubmissionDate.value.Trim() != "") { if (isDate(document.forms[0].endSubmissionDate, "Submitted To") == false) { return; } } if (document.forms[0].beginSubmissionDate.value.Trim() != "" && document.forms[0].endSubmissionDate.value.Trim() != "") { if (compareDate(document.forms[0].beginSubmissionDate.value.Trim(), document.forms[0].endSubmissionDate.value.Trim()) == false) { alert(from_to_date_compare); document.forms[0].beginSubmissionDate.focus(); return; } } if (!(verifyCompletedDates())) return; var url = "<%=request.getContextPath()%>/wkfProcessAction.it?method=exportInquiryForm"; document.forms[0].action = url; document.forms[0].target = "_blank"; document.forms[0].submit(); document.forms[0].target = ""; //openCenterWindow(url,600,350); } function exportPDF() { if (checkSelect('requestNos') <= 0) { alert(have_no_select); return; } if (confirm(confirm_export_pdfs) == false) { return; } var date = new Date(); var w_name = "pdf_" + date.getTime(); // alert("w_name: " + w_name); openCenterWindow2(w_name, 800, 600); var url = "<%=request.getContextPath()%>/wkfProcessAction.it?method=exportPDF"; document.forms[0].action = url; document.forms[0].target = w_name; document.forms[0].submit(); document.forms[0].target = ""; } /** CHO ePayment Begin **/ function openExportAce() { if (document.forms[0].beginSubmissionDate.value.Trim() != "") { if (isDate(document.forms[0].beginSubmissionDate, "Submitted From") == false) { return; } } if (document.forms[0].endSubmissionDate.value.Trim() != "") { if (isDate(document.forms[0].endSubmissionDate, "Submitted To") == false) { return; } } if (document.forms[0].beginSubmissionDate.value.Trim() != "" && document.forms[0].endSubmissionDate.value.Trim() != "") { if (compareDate(document.forms[0].beginSubmissionDate.value.Trim(), document.forms[0].endSubmissionDate.value.Trim()) == false) { alert(from_to_date_compare); document.forms[0].beginSubmissionDate.focus(); return; } } if (!(verifyCompletedDates())) return; var url = "<%=request.getContextPath()%>/wkfProcessAction.it?method=exportToAce"; document.forms[0].action = url; document.forms[0].target = "_blank"; document.forms[0].submit(); document.forms[0].target = ""; //openCenterWindow(url,600,350); } function leaveMonthlyRecords() { window.location = "<%=request.getContextPath()%>/leaveAIASSAction.it?method=monthlyList"; } </script> <% boolean canReassign = false; StaffVO currentStaff = (StaffVO)session.getAttribute( CommonName.CURRENT_STAFF_INFOR); AuthorityHelper authority = AuthorityHelper.getInstance(); if(authority.checkAuthority(currentStaff.getCurrentRoleId(),ModuleOperateName.MODULE_FORM_INQUIRY,ModuleOperateName.OPER_FORM_INQUIRY_REASSIGN)){ canReassign = true; } Collection formList = (ArrayList)request.getAttribute("inquiryFormList"); // search result list Collection formSelectList = (ArrayList)request.getAttribute("formSelectList"); // select form list String formSystemId = (String)request.getParameter("formSystemId"); String requestedBy = (String)request.getParameter("requestedBy"); String companyId = (String)request.getParameter("companyId"); Collection staffList = (Collection) request.getAttribute("staffList"); String requestNo = (String)request.getParameter("requestNo"); if(requestNo==null){ requestNo = (String)request.getAttribute("requestNo"); } String formType = (String)request.getParameter("formType"); String status = (String)request.getParameter("status"); String beginSubmissionDate = (String)request.getParameter("beginSubmissionDate"); String endSubmissionDate = (String)request.getParameter("endSubmissionDate"); String beginCompletedDate = (String)request.getParameter("beginCompletedDate"); String endCompletedDate = (String)request.getParameter("endCompletedDate"); String processType = request.getParameter("processType"); String needquery = (String)request.getParameter("needquery"); if(needquery!=null && "false".equals(needquery)){ beginSubmissionDate = (String)request.getAttribute("beginSubmissionDate"); endSubmissionDate = (String)request.getAttribute("endSubmissionDate"); beginCompletedDate = (String)request.getAttribute("beginCompletedDate"); endCompletedDate = (String)request.getAttribute("endCompletedDate"); } String lockedForm = (String)request.getParameter("lockedForm"); boolean contentField2 = false; boolean contentField3 = false; String contentFields = ParamConfigHelper.getInstance().getParamValue(CommonName.PARAM_LIST_CONTENT_FIELDS); if (contentFields != null && !"".equals(contentFields)) { String[] aryContentFields = contentFields.split(";"); for (int i = 0; i < aryContentFields.length; i++) { if (aryContentFields[i].equals("2")) { contentField2 = true; } else if (aryContentFields[i].equals("3")) { contentField3 = true; } } } %> <body> <FORM nane=AVActionForm method="post"> <input type="hidden" name="selectStaff"> <input type="hidden" name="reassignRequestNo"> <input type="hidden" name="reassignFormSystemId"> <input type="hidden" name="reassignRequestStaffCode"> <input type="hidden" name="reassignNodeId"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td height="10"></td> </tr> <!--<tr> <td> <strong><font color='#5980BB' family='Times New Roman'><i18n:message key="form_inquiry.navigate"/></font></strong> </td> </tr> --></table> <TABLE WIDTH=100% bordercolor="#6595D6" style="border-collapse:collapse;" BORDER=1 CELLPADDING=3 CELLSPACING=0 class="tr0" > <TR align="center" > <TD height="25" colspan="4" class="tr1"><i18n:message key="menu.monitor.form_inquiry"/></TD> </TR> <TR > <TD width=15% height="20" class="tr3"><div align="right"><span class="style1"><i18n:message key="common.request_no"/></span></div></TD> <TD width=35% height="20" > <font size="2"> <INPUT Name="requestNo" Type="text" value="<%=requestNo==null?"":requestNo%>" class="text2" style="WIDTH: 130px" id="requestNo"> </font> </TD> <TD width=15% height="20" class="tr3"><div align="right"><span class="style1"><i18n:message key="common.form_type"/></span></div></TD> <TD width=35% height="20" ><font size="2"> <select name="formType" onchange="getOptionList(this.value)"> <option value="">All</option> <% Collection typeList = FormTypeHelper.getInstance().getFormTypeList(); if(typeList!=null && typeList.size()>0){ Iterator it = typeList.iterator(); while(it.hasNext()){ FormTypeVO typeVo = (FormTypeVO)it.next(); if(authority.checkAuthorityByFormType(currentStaff.getCurrentRoleId(),ModuleOperateName.MODULE_FORM_INQUIRY,typeVo.getFormTypeId())){ %> <option value="<%=typeVo.getFormTypeId()%>" <%=(formType!=null && (typeVo.getFormTypeId()).equals(formType))?"selected" : ""%>><%=typeVo.getFormTypeName()%></option> <% } } } %> </select> </TD> </TR> <tr> <TD width=15% height="20" class="tr3"><div align="right"><span class="style1"><i18n:message key="common.form"/></span></div></TD> <TD width=35% height="20" colspan='3'><font size="2"> <select name="formSystemId"> <option value=""> </option> <% if(formSelectList!=null && formSelectList.size()>0){ Iterator formIt = formSelectList.iterator(); while(formIt.hasNext()){ FormManageVO form = (FormManageVO)formIt.next(); out.print("<option value='" + form.getFormSystemId()+"'"); if(formSystemId!=null && !"".equals(formSystemId) && formSystemId.equals(""+form.getFormSystemId())){ out.print(" selected "); } out.print(">"+form.getFormId()+" - "+form.getFormName()+"</option>"); } }%> </select> </TD> </tr> <tr> <TD width=15% height="20" class="tr3"><div align="right"><span class="style1"><i18n:message key="common.company"/></span></div></TD> <TD width=35% height="20"> <select name="companyId" onchange="getStaffList(this.value)"> <option value=""></option> <% if (companyId == null) { companyId = currentStaff.getOrgId(); } Collection companyList = currentStaff.getOwnCompanyList(); //CompanyHelper.getInstance().getOwnCompanyList(currentStaff.getOrgId());//CompanyHelper.getInstance().getCompanyList(); if(companyList!=null){ Iterator companyIt = companyList.iterator(); while(companyIt.hasNext()){ CompanyVO company = (CompanyVO)companyIt.next(); if(company.getOrgId().equals(companyId)){ out.println("<option value='"+company.getOrgId()+"' selected>"+company.getOrgName()+"</option>"); }else{ out.println("<option value='"+company.getOrgId()+"'>"+company.getOrgName()+"</option>"); } } } %> </select> <!-- New Company List above --------------------------------------------------------------------------------> <TD width=15% height="20" class="tr3"><div align="right"><span class="style1"><i18n:message key="common.request_by"/></span></div></TD> <TD width=35% height="20"> <select name="requestedBy"> <option value=""> </option> <% if(staffList!=null){ Iterator staffIt = staffList.iterator(); while(staffIt.hasNext()){ StaffVO staff = (StaffVO)staffIt.next(); if(staff.getStaffCode().equals(requestedBy)){ out.println("<option value='"+staff.getStaffCode()+"' selected>"+staff.getStaffName()+"</option>"); }else{ out.println("<option value='"+staff.getStaffCode()+"'>"+staff.getStaffName()+"</option>"); } } } %> </select> </tr> <TR> <TD width=15% height="20" class="tr3"><div align="right"><span class="style1"><i18n:message key="common.submit_date_from"/></span></div></TD> <TD width=35% height="20" > <font size="2"> <INPUT Name="beginSubmissionDate" onclick='setday(this)' Type="text" value="<%=beginSubmissionDate==null?"":beginSubmissionDate%>" class="text2" style="WIDTH: 130px" id="beginSubmissionDate">(mm/dd/yyyy) </font> </TD> <TD width=15% height="20" class="tr3"><div align="right"><span class="style1"><i18n:message key="common.submit_date_to"/></span></div></TD> <TD width=35% height="20" ><font size="2"> <INPUT Name="endSubmissionDate" onclick='setday(this)' Type="text" value="<%=endSubmissionDate==null?"":endSubmissionDate%>" class="text2" style="WIDTH: 130px" id="endSubmissionDate">(mm/dd/yyyy) </TD> </TR> <TR> <TD width=15% height="20" class="tr3"><div align="right"><span class="style1"><i18n:message key="common.complete_date_from"/></span></div></TD> <TD width=35% height="20" > <font size="2"> <INPUT Name="beginCompletedDate" onclick='setday(this)' Type="text" value="<%=beginCompletedDate==null?"":beginCompletedDate%>" class="text2" style="WIDTH: 130px" id="beginCompletedDate">(mm/dd/yyyy) </font> </TD> <TD width=15% height="20" class="tr3"><div align="right"><span class="style1"><i18n:message key="common.complete_date_to"/></span></div></TD> <TD width=35% height="20" ><font size="2"> <INPUT Name="endCompletedDate" onclick='setday(this)' Type="text" value="<%=endCompletedDate==null?"":endCompletedDate%>" class="text2" style="WIDTH: 130px" id="endCompletedDate">(mm/dd/yyyy) </TD> </TR> <TR> <TD width=15% height="20" class="tr3"><div align="right"><span class="style1"><i18n:message key="epayment.process_type"/></span></div></TD> <TD width=35% height="20"> <select name="processType" id="processType"> <option value=""></option> <option value="<%=CommonName.NODE_TYPE_APPROVAL %>" <%=(CommonName.NODE_TYPE_APPROVAL.equals(processType))?"selected":"" %> ><i18n:message key="flow_node.nodetype_approval"/></option> <option value="<%=CommonName.NODE_TYPE_PROCESS %>" <%=(CommonName.NODE_TYPE_PROCESS.equals(processType))?"selected":"" %> ><i18n:message key="flow_node.nodetype_process"/></option> <option value="<%=CommonName.NODE_TYPE_WAITING %>" <%=(CommonName.NODE_TYPE_WAITING.equals(processType)) ? "selected" : ""%>><i18n:message key="flow_node.nodetype_waiting"/></option> <% if (CompanyHelper.getInstance().getEFlowCompany().equals( CompanyHelper.EFlow_AIA_CHINA)) { %> <option value="<%=CommonName.NODE_TYPE_PAYMENT %>" <%=(CommonName.NODE_TYPE_PAYMENT.equals(processType)) ? "selected" : ""%>><i18n:message key="flow_node.nodetype_payment"/></option> <% } %> </select> <i18n:message key="common.form_locked"/>: <select name="lockedForm"> <option value=""></option> <option value="0" <%=(lockedForm!=null && "0".equals(lockedForm))?"selected":""%>>No</option> <option value="1" <%=(lockedForm!=null && "1".equals(lockedForm))?"selected":""%>>Yes</option> </select> </TD> <!-- moved from above to here --> <TD width=15% height="20" class="tr3"><div align="right"><span class="style1"><i18n:message key="common.status"/></span></div></TD> <TD width=35% height="20"> <select name="status" id="status"> <option value="">All</option> <option value="00" <%=(status!=null && "00".equals(status))?"selected" : ""%>>Drafted</option> <option value="01" <%=(status!=null && "01".equals(status))?"selected" : ""%>>Submitted</option> <option value="02" <%=(status!=null && "02".equals(status))?"selected" : ""%>>IN Progress</option> <option value="03" <%=(status!=null && "03".equals(status))?"selected" : ""%>>Rejected</option> <option value="04" <%=(status!=null && "04".equals(status))?"selected" : ""%>>Completed</option> </select> </TD> </TR> <tr> <td colspan='4' align='center' noWrap> <input type="button" name="searchBtn" value='<i18n:message key="button.search"/>' class=btn3_mouseout onmouseover="this.className='btn3_mouseover'" onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'" onmouseup="this.className='btn3_mouseup'" onclick="searchForm()"> <input type="button" name="excelBtn" value='<i18n:message key="button.export_file"/>' class=btn3_mouseout onmouseover="this.className='btn3_mouseover'" onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'" onmouseup="this.className='btn3_mouseup'" onclick="openExportPage()"> <input type="button" name="exportQueryBtn" value='<i18n:message key="button.export_query"/>' class=btn3_mouseout onmouseover="this.className='btn3_mouseover'" onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'" onmouseup="this.className='btn3_mouseup'" onclick="openExportQueryPage()"> <input type="button" name="exportPDFBtn" value='<i18n:message key="button.export_pdf"/>' class=btn3_mouseout onmouseover="this.className='btn3_mouseover'" onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'" onmouseup="this.className='btn3_mouseup'" onclick="exportPDF()"> <purview:purview moduleId='<%=ModuleOperateName.MODULE_FORM_INQUIRY%>' operateId='<%=ModuleOperateName.OPER_FORM_INQUIRY_UNLOCK%>' isButton='true' labelValue='Unlock Form'> <input type="button" name="unlockBtn" value='<i18n:message key="button.unlock_form"/>' class=btn3_mouseout onmouseover="this.className='btn3_mouseover'" onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'" onmouseup="this.className='btn3_mouseup'" onclick="unlockForms()"> </purview:purview> <input type="Reset" name="resetBtn" value='<i18n:message key="button.reset"/>' class=btn3_mouseout onmouseover="this.className='btn3_mouseover'" onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'" onmouseup="this.className='btn3_mouseup'"> <div id="divsunac" style="visibility:hidden;display:inline; width:100px; position:absolute"> <input type="button" name="sunacBtn" value='<i18n:message key="button.ace_file"/>' class=btn3_mouseout onmouseover="this.className='btn3_mouseover'" onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'" onmouseup="this.className='btn3_mouseup'" onclick="openExportAce()"></div> <% if ((!CompanyHelper.getInstance().getEFlowCompany().equals(CompanyHelper.EFlow_AIAIT)) && ("Yes".equalsIgnoreCase(ParamConfigHelper.getInstance().getParamValue(CommonName.PARAM_LEAVE_BALANCE))) ) { %> <purview:purview moduleId='<%=ModuleOperateName.MODULE_USER_MANAGE%>' operateId='<%=ModuleOperateName.OPER_USER_DELETE%>' isButton='true' labelValue='<i18n:message key="housekeeping_leave.monthly_records"/>'> <input type="button" name="deleteBtn" value='<i18n:message key="housekeeping_leave.monthly_records"/>' onclick="leaveMonthlyRecords()" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'" onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'" onmouseup="this.className='btn3_mouseup'"> </purview:purview> <%}%> </td> </tr> </TABLE> <table width="100%" border="0" cellpadding="0" cellspacing="1" class=sortable id=mytable style="border:1px #8899cc solid;"> <tr class="liebiao_tou"> <td align='center' > </td> <td align='center' ><input type="checkbox" name="allBtn" onclick="selectAll(this,'requestNos')"></td> <td align='center' ><i18n:message key="common.request_no"/></td> <td align='center' ><i18n:message key="common.request_form"/></td> <td align='center' ><i18n:message key="common.highlight_content"/></td> <% if (contentField2) { %> <td align='center' ><i18n:message key="common.highlight_content"/> 2</td> <% } if (contentField3) { %> <td align='center' ><i18n:message key="common.highlight_content"/> 3</td> <% } %> <td align='center' ><i18n:message key="common.status"/></td> <td align='center' ><i18n:message key="common.submit_draft_date"/></td> <td align='center' ><i18n:message key="common.request_by"/></td> <td align='center' ><i18n:message key="common.processed_by"/></td> <td align='center' ><i18n:message key="common.handle_date"/></td> <td align='center' ><i18n:message key="common.processing_by"/></td> <%if(canReassign){ %> <td align='center' ><i18n:message key="common.reassign"/></td> <%}%> </tr> <% if(formList!=null){ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Iterator formIt = formList.iterator(); int i = 1; while(formIt.hasNext()){ WorkFlowProcessVO vo = (WorkFlowProcessVO)formIt.next(); Date cDate = null; if(vo.getSubmissionDateStr()!=null && !"".equals(vo.getSubmissionDateStr())){ cDate = df.parse(vo.getSubmissionDateStr()); } String handleDate = ""; if (vo.getHandleDateStr() != null && !"".equals(vo.getHandleDateStr())) { handleDate = StringUtil.getDateStr(df.parse(vo.getHandleDateStr()), "MM/dd/yyyy HH:mm:ss"); } %> <tr class="tr_change"> <td align='center'> <%=i%> </td> <td align='center'><input type="checkbox" name="requestNos" value="<%=vo.getRequestNo()%>"></td> <td ><a href="<%=request.getContextPath()%>/formManageAction.it?method=displayFormContent&operateType=view&viewFlag=false&requestNo=<%=vo.getRequestNo()%>&formSystemId=<%=vo.getFormSystemId()%>" <%=vo.getHtmlTitleAttr()%>><%=vo.getRequestNo()%> </td> <td ><%=vo.getFormName()%> </td> <td ><%=vo.getHighlightContent()%></td> <% if (contentField2) { %> <td ><%=vo.getHighlightContent2()%></td> <% } if (contentField3) { %> <td ><%=vo.getHighlightContent3()%></td> <% } %> <td ><%=DataMapUtil.covertNodeStatus(vo.getStatus())%> </td> <td ><%=(vo.getSubmissionDateStr()!=null && !"".equals(vo.getSubmissionDateStr()))?StringUtil.getDateStr(cDate,"MM/dd/yyyy HH:mm:ss"):""%> </td> <td><%=StaffTeamHelper.getInstance().getStaffNameByCode(vo.getRequestStaffCode())%> </td> <td ><%=StaffTeamHelper.getInstance().getStaffNameByCode(vo.getPreviousProcessor())%> </td> <td ><%=handleDate%></td> <td > <% String processing_by = null; if (CommonName.NODE_TYPE_WAITING.equals(vo.getNodeType())) { processing_by = vo.getNodeName(); } else { processing_by = (!"-1".equals(vo.getNodeId()) && vo.getIsDeputy()!=null && "1".equals(vo.getIsDeputy()) && vo.getOriginProcessor()!=null && vo.getOriginProcessor().indexOf(",")==-1 && (!"".equals(vo.getCurrentProcessor())))?"<a href='#' title=\"It is "+StaffTeamHelper.getInstance().getStaffNameByCode(vo.getOriginProcessor()).trim()+"'s deputy.\"><img border=0 src='"+request.getContextPath()+"/images/deputy.gif'></a>":""; processing_by += StaffTeamHelper.getInstance().getStaffNameByCode(vo.getCurrentProcessor()); } %> <%=processing_by%> </td> <%if(canReassign){ %> <td align='center' > <%if((vo.getStatus()!=null && ("03".equals(vo.getStatus()) || "02".equals(vo.getStatus()) || "01".equals(vo.getStatus())))){%> <a href="javascript:openSelectStaffWindow('<%=vo.getRequestNo()%>','<%=vo.getNodeId()%>','<%=vo.getRequestStaffCode()%>','<%=vo.getFormSystemId()%>')"> Reassign </a> <%}%> </td> <%}%> </tr> <% i++; } }else{ %> <tr class="liebiao_nr2"> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <% if (contentField2) { %> <td> </td> <% } if (contentField3) { %> <td> </td> <% } %> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <%if(canReassign){ %> <td> </td> <%}%> </tr> <%}%> </table> <pageTag:page action="/wkfProcessAction.it?method=listInquiryForm"></pageTag:page> </form> </body> </html> <script language="javascript"> //setResizeAble(mytable); //ZebraTable.stripe('mytable'); window.onload=function(){enableTooltips()}; var ob = $('formType'); if(ob[ob.selectedIndex].text.toLowerCase().indexOf("epayment")>-1){ $('divsunac').style.visibility = "visible"; } else { $('divsunac').style.visibility = "hidden"; } </script>
Java:
package com.aiait.eflow.wkf.vo; import java.util.Date; import com.aiait.eflow.util.StringUtil; import com.aiait.framework.vo.BaseVO; public class WorkFlowProcessVO extends BaseVO { protected String requestNo; protected String requestStaffCode; protected int flowId; protected Date receivingDate; protected String receivingDateStr; protected String previousProcessor; protected String currentProcessor; protected String nextProcessor; protected String nodeId; protected String nodeType; protected String approveAlias; protected String rejectAlias; protected String status; protected String formType; protected int formSystemId; protected String formId; protected String formName; protected Date submissionDate; protected String submissionDateStr; protected String beginSubmissionDate; protected String endSubmissionDate; protected String beginHandleDate; protected String endHandleDate; protected String beginCompleteDate; protected String endCompleteDate; protected boolean expertMultiReply = false; protected boolean expertReplied = false; protected String remainTime; protected String inProcess; protected String inProcessStaffCode; protected double limitedHours; protected String nodeName; protected Date handleDate; protected String handleDateStr; protected double handleHours; protected String openFlag; protected String hasNextNode; protected String isUrgent; protected String invitedExpert; protected String submittedBy; protected boolean expertAdviceFlag; protected String ccStaffs; protected String isDeputy; protected String originProcessor; protected String orgId; protected String orgName; protected String teamCode; protected String teamName; protected Date waitNodeProcessDate; protected String waitNodeProcessType; //indicator to show is deal form or personal form protected boolean IsDealForm; // For tip field protected String[] tipField; // For highlight fields protected String[] highlightField; protected String[] highlightField2; protected String[] highlightField3; protected FormBasicDataVO formBasicData; protected Date updateDate; protected int remaineApproversNum; public String getOrgId() { return orgId; } public void setOrgId(String orgId) { this.orgId = orgId; } /** * @return the orgName */ public String getOrgName() { return orgName; } /** * @param orgName * the orgName to set */ public void setOrgName(String orgName) { this.orgName = orgName; } public String getTeamCode() { return teamCode; } public void setTeamCode(String teamCode) { this.teamCode = teamCode; } public String getTeamName() { return teamName; } public void setTeamName(String teamName) { this.teamName = teamName; } public String getIsDeputy() { return isDeputy; } public void setIsDeputy(String isDeputy) { this.isDeputy = isDeputy; } public String getOriginProcessor() { return originProcessor; } public void setOriginProcessor(String originProcessor) { this.originProcessor = originProcessor; } public String getCcStaffs() { return ccStaffs; } public void setCcStaffs(String ccStaffs) { this.ccStaffs = ccStaffs; } public boolean getExpertAdviceFlag() { return expertAdviceFlag; } public void setExpertAdviceFlag(boolean expertAdviceFlag) { this.expertAdviceFlag = expertAdviceFlag; } public String getInvitedExpert() { return invitedExpert; } public void setInvitedExpert(String invitedExpert) { this.invitedExpert = invitedExpert; } public String getIsUrgent() { return isUrgent; } public void setIsUrgent(String isUrgent) { this.isUrgent = isUrgent; } public String getHasNextNode() { return hasNextNode; } public void setHasNextNode(String hasNextNode) { this.hasNextNode = hasNextNode; } public String getOpenFlag() { return openFlag; } public void setOpenFlag(String openFlag) { this.openFlag = openFlag; } /** * @return the handleDate */ public Date getHandleDate() { return handleDate; } /** * @param handleDate * the handleDate to set */ public void setHandleDate(Date handleDate) { this.handleDate = handleDate; } public String getHandleDateStr() { return handleDateStr; } public void setHandleDateStr(String handleDateStr) { this.handleDateStr = handleDateStr; } /** * @return the handleHours */ public double getHandleHours() { return handleHours; } /** * @param handleHours * the handleHours to set */ public void setHandleHours(double handleHours) { this.handleHours = handleHours; } public String getNodeName() { return nodeName; } public void setNodeName(String nodeName) { this.nodeName = nodeName; } public double getLimitedHours() { return limitedHours; } public void setLimitedHours(double limitedHours) { this.limitedHours = limitedHours; } public String getInProcessStaffCode() { return inProcessStaffCode; } public void setInProcessStaffCode(String inProcessStaffCode) { this.inProcessStaffCode = inProcessStaffCode; } public String getInProcess() { return inProcess; } public void setInProcess(String inProcess) { this.inProcess = inProcess; } public String getCurrentInProcessor() { if ("1".equals(this.getInProcess())) { return this.getInProcessStaffCode(); } return this.getCurrentProcessor(); } /** * @return the formId */ public String getFormId() { return formId; } /** * @param formId * the formId to set */ public void setFormId(String formId) { this.formId = formId; } public int getFormSystemId() { return formSystemId; } public void setFormSystemId(int formSystemId) { this.formSystemId = formSystemId; } public String getRemainTime() { return remainTime; } public void setRemainTime(String remainTime) { this.remainTime = remainTime; } public String getFormType() { return formType; } public void setFormType(String formType) { this.formType = formType; } public String getFormName() { return formName; } public void setFormName(String formName) { this.formName = formName; } public Date getSubmissionDate() { return submissionDate; } public void setSubmissionDate(Date submissionDate) { this.submissionDate = submissionDate; } public String getCurrentProcessor() { return currentProcessor; } public void setCurrentProcessor(String currentProcessor) { this.currentProcessor = currentProcessor; } public int getFlowId() { return flowId; } public void setFlowId(int flowId) { this.flowId = flowId; } public String getNextProcessor() { return nextProcessor; } public void setNextProcessor(String nextProcessor) { this.nextProcessor = nextProcessor; } public String getNodeId() { return nodeId; } public void setNodeId(String nodeId) { this.nodeId = nodeId; } public String getPreviousProcessor() { return previousProcessor; } public void setPreviousProcessor(String previousProcessor) { this.previousProcessor = previousProcessor; } public Date getReceivingDate() { return receivingDate; } public void setReceivingDate(Date receivingDate) { this.receivingDate = receivingDate; } public String getRequestNo() { return requestNo; } public void setRequestNo(String requestNo) { this.requestNo = requestNo; } public String getRequestStaffCode() { return requestStaffCode; } public void setRequestStaffCode(String requestStaffCode) { this.requestStaffCode = requestStaffCode; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getReceivingDateStr() { return receivingDateStr; } public void setReceivingDateStr(String receivingDateStr) { this.receivingDateStr = receivingDateStr; } public String getSubmissionDateStr() { return submissionDateStr; } public void setSubmissionDateStr(String submissionDateStr) { this.submissionDateStr = submissionDateStr; } public String getBeginSubmissionDate() { return beginSubmissionDate; } public void setBeginSubmissionDate(String beginSubmissionDate) { this.beginSubmissionDate = beginSubmissionDate; } public String getEndSubmissionDate() { return endSubmissionDate; } public void setEndSubmissionDate(String endSubmissionDate) { this.endSubmissionDate = endSubmissionDate; } public String getSubmittedBy() { return submittedBy; } public void setSubmittedBy(String submittedBy) { this.submittedBy = submittedBy; } public String getBeginHandleDate() { return beginHandleDate; } public void setBeginHandleDate(String beginHandleDate) { this.beginHandleDate = beginHandleDate; } public String getEndHandleDate() { return endHandleDate; } public void setEndHandleDate(String endHandleDate) { this.endHandleDate = endHandleDate; } public boolean isDealByDeputy() { if (!"-1".equals(this.getNodeId()) && this.getIsDeputy() != null && "1".equals(this.getIsDeputy()) && this.getOriginProcessor() != null && this.getOriginProcessor().indexOf(",") == -1) { return true; } return false; } public String[] getTipField() { return tipField; } public void setTipField(String[] tipField) { this.tipField = tipField; } // For tip field public String getHtmlTitleAttr() { if (this.tipField == null) { return ""; } String titleAttr = "title='" + StringUtil.htmlEncoder(this.tipField[1] + ": " + this.tipField[2]) + "'"; return titleAttr; } public String getTipContent() { if (this.tipField == null) { return ""; } String tip = this.tipField[1] + ": " + this.tipField[2]; return tip; } // For highlight field public String[] getHighlightField() { return highlightField; } public void setHighlightField(String[] highlightField) { this.highlightField = highlightField; } public String getHighlightContent() { return this.getHighlightContent(false); } public String getHighlightContent(boolean onlyContent) { if (this.highlightField == null) { return ""; } String remark = this.highlightField[3]; String content; if (onlyContent || (remark != null && !"".equals(remark))) { content = StringUtil.htmlEncoder(this.highlightField[2]); } else { content = StringUtil.htmlEncoder(this.highlightField[1]) + ": <b>" + StringUtil.htmlEncoder(this.highlightField[2]) + "</b>"; } return content; } // For highlight field 2 public String[] getHighlightField2() { return highlightField2; } public void setHighlightField2(String[] highlightField2) { this.highlightField2 = highlightField2; } public String getHighlightContent2() { return this.getHighlightContent2(false); } public String getHighlightContent2(boolean onlyContent) { if (this.highlightField2 == null) { return ""; } String remark = this.highlightField2[3]; String content; if (onlyContent || (remark != null && !"".equals(remark))) { content = StringUtil.htmlEncoder(this.highlightField2[2]); } else { content = StringUtil.htmlEncoder(this.highlightField2[1]) + ": <b>" + StringUtil.htmlEncoder(this.highlightField2[2]) + "</b>"; } return content; } // For highlight field 3 public String[] getHighlightField3() { return highlightField3; } public void setHighlightField3(String[] highlightField3) { this.highlightField3 = highlightField3; } public String getHighlightContent3() { return this.getHighlightContent3(false); } public String getHighlightContent3(boolean onlyContent) { if (this.highlightField3 == null) { return ""; } String remark = this.highlightField3[3]; String content; if (onlyContent || (remark != null && !"".equals(remark))) { content = StringUtil.htmlEncoder(this.highlightField3[2]); } else { content = StringUtil.htmlEncoder(this.highlightField3[1]) + ": <b>" + StringUtil.htmlEncoder(this.highlightField3[2]) + "</b>"; } return content; } public FormBasicDataVO getFormBasicData() { return formBasicData; } public void setFormBasicData(FormBasicDataVO formBasicData) { this.formBasicData = formBasicData; } /** * @return the nodeType */ public String getNodeType() { return nodeType; } /** * @param nodeType * the nodeType to set */ public void setNodeType(String nodeType) { this.nodeType = nodeType; } /** * @return the approveAlias */ public String getApproveAlias() { return approveAlias; } /** * @param approveAlias * the approveAlias to set */ public void setApproveAlias(String approveAlias) { this.approveAlias = approveAlias; } /** * @return the rejectAlias */ public String getRejectAlias() { return rejectAlias; } /** * @param rejectAlias * the rejectAlias to set */ public void setRejectAlias(String rejectAlias) { this.rejectAlias = rejectAlias; } public void setBeginCompleteDate(String beginCompleteDate) { this.beginCompleteDate = beginCompleteDate; } public String getBeginCompleteDate() { return beginCompleteDate; } public void setEndCompleteDate(String endCompleteDate) { this.endCompleteDate = endCompleteDate; } public String getEndCompleteDate() { return endCompleteDate; } public void setExpertMultiReply(boolean expertMultiReply) { this.expertMultiReply = expertMultiReply; } public boolean isExpertMultiReply() { return expertMultiReply; } public void setExpertReplied(boolean expertReplied) { this.expertReplied = expertReplied; } public boolean isExpertReplied() { return expertReplied; } /** * @return the waitNodeProcessDate */ public Date getWaitNodeProcessDate() { return waitNodeProcessDate; } /** * @param waitNodeProcessDate * the waitNodeProcessDate to set */ public void setWaitNodeProcessDate(Date waitNodeProcessDate) { this.waitNodeProcessDate = waitNodeProcessDate; } /** * @return the waitNodeProcessType */ public String getWaitNodeProcessType() { return waitNodeProcessType; } /** * @param waitNodeProcessType * the waitNodeProcessType to set */ public void setWaitNodeProcessType(String waitNodeProcessType) { this.waitNodeProcessType = waitNodeProcessType; } public Date getUpdateDate() { return updateDate; } public void setUpdateDate(Date updateDate) { this.updateDate = updateDate; } public int getRemaineApproversNum() { return remaineApproversNum; } public void setRemaineApproversNum(int remaineApproversNum) { this.remaineApproversNum = remaineApproversNum; } }
Java2:
/** * 综合查询(查询指定条件的form) * * @param mapping * @param request * @param response * @return * @throws Exception */ public ActionLocation listInquiryFormAjax(ModuleMapping mapping, HttpServletRequest request, HttpServletResponse response) throws Exception { String formType = (String) request.getParameter("formType"); IDBManager dbManager = null; WorkFlowProcessVO vo = new WorkFlowProcessVO(); PrintWriter out = response.getWriter(); // 增加分页查询功能 String pagenum = (String) request.getParameter(GlobalCommonName.PAGE_CURRENT_NUM); if (pagenum == null) { pagenum = "1"; } // HashMap paramMap = new HashMap(); //用来保存查询参数 PageVO page = new PageVO(Integer.parseInt(ParamConfigHelper.getInstance().getParamValue( CommonName.EVERY_PAGE_RECORDS_NUM, CommonName.DEFAULT_RECORDS_NUM))); page.setCurrentPage(Integer.parseInt(pagenum)); if (formType != null && !"".equals(formType)) { vo.setFormType("'" + formType + "'"); // paramMap.put("formType",formType); } else { // 如果是查询所有form,则需要知道当前user可以查看到的form类型 String formTypes = ""; StaffVO currentStaff = (StaffVO) request.getSession().getAttribute(CommonName.CURRENT_STAFF_INFOR); AuthorityHelper authority = AuthorityHelper.getInstance(); Collection typeList = FormTypeHelper.getInstance().getFormTypeList(); if (typeList != null && typeList.size() > 0) { Iterator it = typeList.iterator(); while (it.hasNext()) { FormTypeVO typeVo = (FormTypeVO) it.next(); if (authority.checkAuthorityByFormType(currentStaff.getCurrentRoleId(), ModuleOperateName.MODULE_FORM_INQUIRY, typeVo.getFormTypeId())) { formTypes = formTypes + "'" + typeVo.getFormTypeId() + "',"; } } } if (!"".equals(formTypes)) { formTypes = formTypes.substring(0, formTypes.length() - 1); } vo.setFormType(formTypes); // paramMap.put("formType",formTypes); } StaffVO currentStaff = (StaffVO) request.getSession().getAttribute(CommonName.CURRENT_STAFF_INFOR); String supperOrgs = currentStaff.getUpperCompanys();// CompanyHelper.getInstance().getUpperCompany(currentStaff.getOrgId()); String lowerOrgs = currentStaff.getLowerCompanys(); // CompanyHelper.getInstance().getLowerCompany(currentStaff.getOrgId()); try { dbManager = DBManagerFactory.getDBManager(); FormManageDAO formDao = new FormManageDAO(dbManager); Collection formSelectList = formDao.getFormListByTypeList(vo.getFormType(), supperOrgs, null); request.setAttribute("formSelectList", formSelectList); String orgId = (String) request.getParameter("companyId"); // if user enter the page by clicking the left menu tree,it needn't // to query! String needQuery = (String) request.getParameter("needquery"); if (needQuery != null && "false".equals(needQuery)) { Collection list = new ArrayList(); request.setAttribute("overtimeFormList", list); // 赋予一个初始化的时间段(一个星期) ParamConfigHelper paramHelper = ParamConfigHelper.getInstance(); String defaultDays = paramHelper.getParamValue("list_data_days"); int days = 0; if (defaultDays == null || "".equals(defaultDays)) { days = -7; } else { days = -Integer.parseInt(defaultDays); } String beginSubmissionDate = ""; String endSubmissionDate = ""; String paramCode=ParamConfigHelper.getInstance().getParamValue("dateFormat"); SimpleDateFormat bartDateFormat = new SimpleDateFormat(paramCode); Date now = new Date(); endSubmissionDate = bartDateFormat.format(now); beginSubmissionDate = StringUtil.afterNDay(days, paramCode); request.setAttribute("beginSubmissionDate2", beginSubmissionDate); request.setAttribute("endSubmissionDate2", endSubmissionDate); // default same as submission date request.setAttribute("beginCompleteDate", beginSubmissionDate); request.setAttribute("endCompleteDate", endSubmissionDate); } else { String requestNo = (String) request.getParameter("requestNo"); String status = (String) request.getParameter("status"); // IT0958 DS-007 Begin String requestedBy = (String) request.getParameter("requestedBy"); // IT0958 DS-008 End String beginSubmissionDate = (String) request.getParameter("beginSubmissionDate2"); String endSubmissionDate = (String) request.getParameter("endSubmissionDate2"); // IT0973 BEGIN String lockedForm = (String) request.getParameter("lockedForm"); if (lockedForm != null && !"".equals(lockedForm)) { vo.setInProcess(lockedForm); // paramMap.put("lockedForm",lockedForm); } // IT0973 END if (requestNo != null && !"".equals(requestNo)) { vo.setRequestNo(requestNo); // paramMap.put("requestNo",requestNo); } else { vo.setRequestNo(""); } if (status != null && !"".equals(status)) { vo.setStatus(status); // paramMap.put("status",status); } vo.setOrgId(orgId); if (requestedBy != null && !"".equals(requestedBy)) { vo.setRequestStaffCode(requestedBy); // paramMap.put("requestedBy",requestedBy); } else { vo.setRequestStaffCode(""); } // vo.setOrgId(supperOrgs); // vo.setOrgId(lowerOrgs); // paramMap.put("orgId",supperOrgs); if ((beginSubmissionDate != null && !"".equals(beginSubmissionDate)) || (endSubmissionDate != null && !"".equals(endSubmissionDate))){ vo.setBeginSubmissionDate(beginSubmissionDate); vo.setEndSubmissionDate(endSubmissionDate); System.err.println(vo.getBeginSubmissionDate()); System.err.println(vo.getEndSubmissionDate()); vo.setStatus("04");// }else { vo.setBeginSubmissionDate(""); vo.setEndSubmissionDate(""); } // paramMap.put("beginSubmissionDate",beginSubmissionDate); // paramMap.put("endSubmissionDate",endSubmissionDate); String formSystemId = (String) request.getParameter("formSystemId"); if (formSystemId != null && !"".equals(formSystemId)) { vo.setFormSystemId(Integer.parseInt(formSystemId)); // paramMap.put("formSystemId",formSystemId); } String nodeName = (String)request.getParameter("nodeNames"); request.setAttribute("nodeName", nodeName); System.out.println("-----------"+nodeName); if(nodeName != null && !"".equals(nodeName)){ vo.setNodeName(nodeName); } String beginCompletedDate = (String) request.getParameter("beginCompletedDate"); vo.setBeginCompleteDate(beginCompletedDate); String endCompletedDate = (String) request.getParameter("endCompletedDate"); vo.setEndCompleteDate(endCompletedDate); if ((beginCompletedDate != null && !"".equals(beginCompletedDate)) || (endCompletedDate != null && !"".equals(endCompletedDate))) { // Set status as completed vo.setStatus("04"); //beginSubmissionDate setb } String processType = request.getParameter("processType"); vo.setNodeType(processType); ListInquiryFormDAO dao = new ListInquiryFormDAO(dbManager); // page.setParamMap(paramMap); // Collection list = dao.getInquiryFormList(vo); //System.out.println("-----------"+request.getParameter("method")); //String ss = request.getParameter("nodeNames"); //System.out.println("-----------"+ss); int totalRecordsNum = dao.getTotalRecordsNum(vo, page, supperOrgs); page = PageUtil.createPage(page, totalRecordsNum); Collection list = dao.searchInquiryForm(vo, page, supperOrgs); System.out.println("00000000"); request.setAttribute(GlobalCommonName.PAGE_INFORMATION_NAME, page); request.setAttribute("inquiryFormList", list); if (orgId == null || "".equals(orgId)) { orgId = currentStaff.getOrgId(); } StaffDAO staffDao = new StaffDAO(dbManager); Collection staffList = null; if ("Y".equals(ParamConfigHelper.getInstance().getParamValue("show_terminated_staffs"))) { staffList = staffDao.getATStaffListByCompany(orgId); //staffDao.get } else { staffList = staffDao.getStaffListByCompany(orgId); } request.setAttribute("staffList", staffList); System.out.println(Arrays.asList(staffList)); //out.print(staffList); if(list!=null){ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Iterator formIt = list.iterator(); int i = 1; StringBuffer sb = new StringBuffer(); while(formIt.hasNext()){ WorkFlowProcessVO vo1 = (WorkFlowProcessVO)formIt.next(); Date cDate = null; if(vo1.getSubmissionDateStr()!=null && !"".equals(vo1.getSubmissionDateStr())){ cDate = df.parse(vo1.getSubmissionDateStr()); } String handleDate = ""; if (vo1.getHandleDateStr() != null && !"".equals(vo1.getHandleDateStr())) { handleDate = StringUtil.getDateStr(df.parse(vo1.getHandleDateStr()), "MM/dd/yyyy HH:mm:ss"); } String processing_by = null; if (CommonName.NODE_TYPE_WAITING.equals(vo1.getNodeType())) { processing_by = vo1.getNodeName(); } else { processing_by = (!"-1".equals(vo1.getNodeId()) && vo1.getIsDeputy()!=null && "1".equals(vo1.getIsDeputy()) && vo1.getOriginProcessor()!=null && vo1.getOriginProcessor().indexOf(",")==-1 && (!"".equals(vo1.getCurrentProcessor())))?"<a href='#' title=\"It is "+StaffTeamHelper.getInstance().getStaffNameByCode(vo1.getOriginProcessor()).trim()+"'s deputy.\"><img border=0 src='"+request.getContextPath()+"/images/deputy.gif'></a>":""; processing_by += StaffTeamHelper.getInstance().getStaffNameByCode(vo1.getCurrentProcessor()); } sb.append("<tr class='tr_change'> " + "<td align='center'> " + i + " </td> " + "<td align='center'><input type='checkbox' name='requestNos' value="+vo1.getRequestNo()+"></td> " + "<td ><a href='javascript:openFormWithLayer('" + request.getContextPath() + "/formManageAction.it?method=displayFormContent&operateType=view&viewFlag=false&requestNo=" + vo1.getRequestNo() + "&formSystemId=" + vo1.getFormSystemId() + "');'"+ " " + vo1.getHtmlTitleAttr() + ">" + vo1.getRequestNo() + " </td> " + "<td >" + vo1.getFormName() + " </td> " + " <td >" + vo1.getHighlightContent() + "</td> " + " <td >" + DataMapUtil.covertNodeStatus(vo1.getStatus()) + " </td> " + " <td >" + ((vo1.getSubmissionDateStr()!=null && !"".equals(vo1.getSubmissionDateStr()))?StringUtil.getDateStr(cDate,"yyyy-MM-dd"):"") + " </td> " + " <td>" + StaffTeamHelper.getInstance().getStaffNameByCode(vo1.getRequestStaffCode()) + " </td> " + " <td >" + handleDate + "</td> " + " <td >"+ processing_by +" </td> " + " <td id='a2' ></td> "); if(true){ sb.append("<td align='center' >"); if((vo1.getStatus()!=null && ("03".equals(vo1.getStatus()) || "02".equals(vo1.getStatus()) || "01".equals(vo1.getStatus())))){ sb.append("<a href='javascript:openSelectStaffWindow('" + vo1.getRequestNo() + "','" + vo1.getNodeId() + "','" + vo1.getRequestStaffCode() + "','" + vo1.getFormSystemId() + "')> Reassign </a>" ); } sb.append("</td>"); } sb.append("</tr>"); i++; } out.print(sb); } } } catch (DAOException e) { request.setAttribute(CommonName.COMMON_ERROR_INFOR, e.toString()); e.printStackTrace(); } finally { if (dbManager != null) dbManager.freeConnection(); if (out != null) out.close(); } return null; } /** * 综合查询(查询指定条件的form) * * @param mapping * @param request * @param response * @return * @throws Exception */ public ActionLocation listInquiryForm(ModuleMapping mapping, HttpServletRequest request, HttpServletResponse response) throws Exception { String resultLabel = "listInquiryForm"; String formType = (String) request.getParameter("formType"); IDBManager dbManager = null; WorkFlowProcessVO vo = new WorkFlowProcessVO(); // 增加分页查询功能 String pagenum = (String) request.getParameter(GlobalCommonName.PAGE_CURRENT_NUM); if (pagenum == null) { pagenum = "1"; } // HashMap paramMap = new HashMap(); //用来保存查询参数 PageVO page = new PageVO(Integer.parseInt(ParamConfigHelper.getInstance().getParamValue( CommonName.EVERY_PAGE_RECORDS_NUM, CommonName.DEFAULT_RECORDS_NUM))); page.setCurrentPage(Integer.parseInt(pagenum)); if (formType != null && !"".equals(formType)) { vo.setFormType("'" + formType + "'"); // paramMap.put("formType",formType); } else { // 如果是查询所有form,则需要知道当前user可以查看到的form类型 String formTypes = ""; StaffVO currentStaff = (StaffVO) request.getSession().getAttribute(CommonName.CURRENT_STAFF_INFOR); AuthorityHelper authority = AuthorityHelper.getInstance(); Collection typeList = FormTypeHelper.getInstance().getFormTypeList(); if (typeList != null && typeList.size() > 0) { Iterator it = typeList.iterator(); while (it.hasNext()) { FormTypeVO typeVo = (FormTypeVO) it.next(); if (authority.checkAuthorityByFormType(currentStaff.getCurrentRoleId(), ModuleOperateName.MODULE_FORM_INQUIRY, typeVo.getFormTypeId())) { formTypes = formTypes + "'" + typeVo.getFormTypeId() + "',"; } } } if (!"".equals(formTypes)) { formTypes = formTypes.substring(0, formTypes.length() - 1); } vo.setFormType(formTypes); // paramMap.put("formType",formTypes); } StaffVO currentStaff = (StaffVO) request.getSession().getAttribute(CommonName.CURRENT_STAFF_INFOR); String supperOrgs = currentStaff.getUpperCompanys();// CompanyHelper.getInstance().getUpperCompany(currentStaff.getOrgId()); String lowerOrgs = currentStaff.getLowerCompanys(); // CompanyHelper.getInstance().getLowerCompany(currentStaff.getOrgId()); try { dbManager = DBManagerFactory.getDBManager(); FormManageDAO formDao = new FormManageDAO(dbManager); Collection formSelectList = formDao.getFormListByTypeList(vo.getFormType(), supperOrgs, null); request.setAttribute("formSelectList", formSelectList); String orgId = (String) request.getParameter("companyId"); // if user enter the page by clicking the left menu tree,it needn't // to query! String needQuery = (String) request.getParameter("needquery"); if (needQuery != null && "false".equals(needQuery)) { Collection list = new ArrayList(); request.setAttribute("overtimeFormList", list); // 赋予一个初始化的时间段(一个星期) ParamConfigHelper paramHelper = ParamConfigHelper.getInstance(); String defaultDays = paramHelper.getParamValue("list_data_days"); int days = 0; if (defaultDays == null || "".equals(defaultDays)) { days = -7; } else { days = -Integer.parseInt(defaultDays); } String beginSubmissionDate = ""; String endSubmissionDate = ""; String paramCode=ParamConfigHelper.getInstance().getParamValue("dateFormat"); SimpleDateFormat bartDateFormat = new SimpleDateFormat(paramCode); Date now = new Date(); endSubmissionDate = bartDateFormat.format(now); beginSubmissionDate = StringUtil.afterNDay(days, paramCode); request.setAttribute("beginSubmissionDate2", beginSubmissionDate); request.setAttribute("endSubmissionDate2", endSubmissionDate); // default same as submission date request.setAttribute("beginCompleteDate", beginSubmissionDate); request.setAttribute("endCompleteDate", endSubmissionDate); } else { String requestNo = (String) request.getParameter("requestNo"); String status = (String) request.getParameter("status"); // IT0958 DS-007 Begin String requestedBy = (String) request.getParameter("requestedBy"); // IT0958 DS-008 End String beginSubmissionDate = (String) request.getParameter("beginSubmissionDate2"); String endSubmissionDate = (String) request.getParameter("endSubmissionDate2"); // IT0973 BEGIN String lockedForm = (String) request.getParameter("lockedForm"); if (lockedForm != null && !"".equals(lockedForm)) { vo.setInProcess(lockedForm); // paramMap.put("lockedForm",lockedForm); } // IT0973 END if (requestNo != null && !"".equals(requestNo)) { vo.setRequestNo(requestNo); // paramMap.put("requestNo",requestNo); } else { vo.setRequestNo(""); } if (status != null && !"".equals(status)) { vo.setStatus(status); // paramMap.put("status",status); } vo.setOrgId(orgId); if (requestedBy != null && !"".equals(requestedBy)) { vo.setRequestStaffCode(requestedBy); // paramMap.put("requestedBy",requestedBy); } else { vo.setRequestStaffCode(""); } // vo.setOrgId(supperOrgs); // vo.setOrgId(lowerOrgs); // paramMap.put("orgId",supperOrgs); vo.setBeginSubmissionDate(beginSubmissionDate); vo.setEndSubmissionDate(endSubmissionDate); // paramMap.put("beginSubmissionDate",beginSubmissionDate); // paramMap.put("endSubmissionDate",endSubmissionDate); String formSystemId = (String) request.getParameter("formSystemId"); if (formSystemId != null && !"".equals(formSystemId)) { vo.setFormSystemId(Integer.parseInt(formSystemId)); // paramMap.put("formSystemId",formSystemId); } String nodeName = (String)request.getParameter("nodeName"); if(nodeName != null && !"".equals(nodeName)){ vo.setNodeName(nodeName); } String beginCompletedDate = (String) request.getParameter("beginCompletedDate"); vo.setBeginCompleteDate(beginCompletedDate); String endCompletedDate = (String) request.getParameter("endCompletedDate"); vo.setEndCompleteDate(endCompletedDate); if ((beginCompletedDate != null && !"".equals(beginCompletedDate)) || (endCompletedDate != null && !"".equals(endCompletedDate))) { // Set status as completed vo.setStatus("04"); //beginSubmissionDate setb } String processType = request.getParameter("processType"); vo.setNodeType(processType); ListInquiryFormDAO dao = new ListInquiryFormDAO(dbManager); // page.setParamMap(paramMap); // Collection list = dao.getInquiryFormList(vo); //System.out.println("-----------"+request.getParameter("method")); //String ss = request.getParameter("nodeNames"); //System.out.println("-----------"+ss); int totalRecordsNum = dao.getTotalRecordsNum(vo, page, supperOrgs); page = PageUtil.createPage(page, totalRecordsNum); Collection list = dao.searchInquiryForm(vo, page, supperOrgs); System.out.println("00000000"); request.setAttribute(GlobalCommonName.PAGE_INFORMATION_NAME, page); request.setAttribute("inquiryFormList", list); } if (orgId == null || "".equals(orgId)) { orgId = currentStaff.getOrgId(); } StaffDAO staffDao = new StaffDAO(dbManager); Collection staffList = null; if ("Y".equals(ParamConfigHelper.getInstance().getParamValue("show_terminated_staffs"))) { staffList = staffDao.getATStaffListByCompany(orgId); //staffDao.get } else { staffList = staffDao.getStaffListByCompany(orgId); } request.setAttribute("staffList", staffList); } catch (DAOException e) { resultLabel = "fail"; request.setAttribute(CommonName.COMMON_ERROR_INFOR, e.toString()); e.printStackTrace(); } finally { dbManager.freeConnection(); } return mapping.findActionLocation(resultLabel); }
/**IT0958 : add filter : requested by * 获取指定用户所申请的记录 * @param staffCode * @return * @throws DAOException */ public Collection searchInquiryForm(WorkFlowProcessVO queryVo, PageVO page, String supperOrgs)throws DAOException{ StringBuffer sql = new StringBuffer("select distinct a.request_no,a.flow_id,a.submission_date,a.request_staff_code,a.receiving_date,a.previous_processor,a.current_processor,a.status,a.inprocess,c.form_name,c.form_system_id,a.node_id,e.node_type,e.node_name,a.is_deputy,a.origin_processor, a.handle_date, a.org_id, a.team_code, a.SUBMIT_STAFF_CODE "); sql.append(" from teflow_wkf_process a "); if (queryVo.getNodeType() != null && !"".equals(queryVo.getNodeType())) { sql.append(" INNER JOIN "); } else { sql.append(" LEFT OUTER JOIN "); } sql.append(" teflow_wkf_detail e on (a.flow_id = e.flow_id) and (a.node_id = e.node_id),teflow_wkf_define b,teflow_form c, tpma_staffbasic d where 1=1 "); HashMap resultMap = makeCondition(queryVo, supperOrgs); sql.append(resultMap.get("conditionSQL")); //sql.append(" and a.flow_id=b.flow_id and b.form_system_id = c.form_system_id and a.flow_id = e.flow_id and a.node_id = e.node_id and a.request_staff_code = d.staff_code order by a.submission_date desc"); //join -> left join sql.append(" and (a.flow_id = b.flow_id) and (b.form_system_id = c.form_system_id) and (a.request_staff_code = d.staff_code) "); // For query condition related to node. /*if (queryVo.getNodeType() != null && !"".equals(queryVo.getNodeType())) { sql.append("and (a.flow_id = e.flow_id) and (a.node_id = e.node_id)"); } else { sql.append("and (a.flow_id *= e.flow_id) and (a.node_id *= e.node_id)"); }*/ sql.append(" order by a.submission_date desc"); //Collection list = dbManager.query(sql.toString()); //Collection list = dbManager.query(sql.toString(),(Object[])resultMap.get("parameters"),(int[])resultMap.get("dataType")); // System.out.println("-----sql_2: " + sql); long timeStart = System.currentTimeMillis(); Collection list = dbManager.query(sql.toString(),(Object[])resultMap.get("parameters"),(int[])resultMap.get("dataType"),page.getPageSize(),page.getCurrentPage()); boolean logTime = "yes".equalsIgnoreCase(ParamConfigHelper.getInstance().getParamValue(CommonName.PARAM_LOG_TIME)); if (logTime) { System.out.println("Inquiry List sql: " + sql); System.out.println("Inquiry List Time - 1: " + (System.currentTimeMillis() - timeStart)); } boolean contentField2 = false; boolean contentField3 = false; String contentFields = ParamConfigHelper.getInstance().getParamValue(CommonName.PARAM_LIST_CONTENT_FIELDS); if (contentFields != null && !"".equals(contentFields)) { String[] aryContentFields = contentFields.split(";"); for (int i = 0; i < aryContentFields.length; i++) { if (aryContentFields[i].equals("2")) { contentField2 = true; } else if (aryContentFields[i].equals("3")) { contentField3 = true; } } } if(list==null && list.size()==0) return null; Collection result = new ArrayList(); Iterator it = list.iterator(); int count = 1; while( it.hasNext()){ // System.out.println("count - " + count++); HashMap map = (HashMap)it.next(); WorkFlowProcessVO vo = convertMapToVo(map); //if(page.getPageSize()>0 ){ // Set tip field vo.setTipField(this.getSpecialField(vo.getRequestNo(), SpecialFieldVo.TYPE_TIP, vo.getFormSystemId())); // Set highlight fields vo.setHighlightField(this.getSpecialField(vo.getRequestNo(), SpecialFieldVo.TYPE_HIGHLIGHT_1, vo.getFormSystemId())); if (contentField2) { vo.setHighlightField2(this.getSpecialField(vo.getRequestNo(), SpecialFieldVo.TYPE_HIGHLIGHT_2, vo.getFormSystemId())); } if (contentField3) { vo.setHighlightField3(this.getSpecialField(vo.getRequestNo(), SpecialFieldVo.TYPE_HIGHLIGHT_3, vo.getFormSystemId())); } //} result.add(vo); } if (logTime) { System.out.println("Inquiry List Time - 2: " + (System.currentTimeMillis() - timeStart)); } return result; } /**为新的页面获取用户查询后的数据 * @param staffCode * @return * @throws DAOException */ public Collection searchInquiryFormNew(WorkFlowProcessVO queryVo, PageVO page, String supperOrgs)throws DAOException{ return null; }

浙公网安备 33010602011771号