DataCenterInput.jsp 16.7 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453
<%@ page import="weaver.general.Util" %>
<%@ page language="java" contentType="text/html; charset=GBK" %> <%@ include file="/systeminfo/init.jsp" %>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="WorkTypeComInfo" class="weaver.workflow.workflow.WorkTypeComInfo" scope="page"/>
<jsp:useBean id="WorkflowComInfo" class="weaver.workflow.workflow.WorkflowComInfo" scope="page"/>
<jsp:useBean id="shareManager" class="weaver.share.ShareManager" scope="page" />
<%@ include file="/datacenter/maintenance/inputreport/InputReportHrmInclude.jsp" %>
<HTML><HEAD>
<LINK href="/css/Weaver.css" type=text/css rel=STYLESHEET>
</head>
<%

String logintype = "2" ;
String resourceid= ""+user.getUID();
int usertype= 1;
String seclevel = user.getSeclevel();
session.removeAttribute("RequestViewResource") ;
char flag = Util.getSeparator();


String imagefilename = "/images/hdMaintenance.gif";
String titlename = Util.toScreen("数据中心",7,"0") ;
String needfav ="1";
String needhelp ="";
%>
<BODY>
<%@ include file="/systeminfo/TopTitle.jsp" %>

<%@ include file="/systeminfo/RightClickMenuConent.jsp" %>

<%@ include file="/systeminfo/RightClickMenu.jsp" %>

<table width=100% height=100% border="0" cellspacing="0" cellpadding="0">
<colgroup>
<col width="10">
<col width="">
<col width="10">
<tr>
	<td height="10" colspan="3"></td>
</tr>
<tr>
	<td ></td>
	<td valign="top">
		<TABLE class=Shadow>
		<tr>
		<td valign="top">



<TABLE class=viewform>
  <COLGROUP>
  <COL width="48%">
  <COL width=24>
  <COL width="48%">
  <TBODY>
  <TR>
    <TD vAlign=top>
      <TABLE class=viewform width="100%">
        <TBODY> 
        <TR class=title> 
          <TH>报表输入</TH>
        </TR>
 <tr class=spacing><td class=line1></td></tr>
		<%
        char separator = Util.getSeparator() ;
		String userid = ""+user.getUID() ;
        /*
		String contacterid = "" + Util.getIntValue(user.getTitle(), 0) ;
        Calendar today = Calendar.getInstance();
        String currentdate = Util.add0(today.get(Calendar.YEAR), 4) + "-" + Util.add0(today.get(Calendar.MONTH) + 1, 2) + "-" + Util.add0(today.get(Calendar.DAY_OF_MONTH), 2) ;
		RecordSet.executeProc("T_InputReport_SelectByContacterid",contacterid + separator + currentdate);
		while(RecordSet.next()) {
			String inprepid =  Util.null2String(RecordSet.getString("inprepid")) ;
			String inprepname = Util.toScreen(RecordSet.getString("inprepname"),user.getLanguage()) ;
		*/
		this.rs=RecordSet;
		List list1=this.getAllInputReport(userid);
		int sizes=list1.size();
		Map m0=null;
		for(int i=0;i<sizes;i++){
			m0=(Map)list1.get(i);
		%>
        <tr class=spacing> 
          <td><a href="/datacenter/input/InputReportDate.jsp?inprepid=<%=m0.get("inprepId")%>">
			<%=Util.toScreen(m0.get("inprepName").toString(),user.getLanguage())%>
			</a></td>
        </tr>
		<%}%>
        </TBODY> 
      </TABLE>
    </TD>
    <TD></TD>
    <TD vAlign=top> 
      <TABLE class=viewform width="100%">
        <TBODY> 
        <TR class=title> 
          <TH>报表管理</TH>
        </TR>
 <tr class=spacing><td class=line1></td></tr>
        <tr class=spacing> 
          <td><a 
            href="/datacenter/maintenance/user/reportstatus/ReportConfirm.jsp">报表输入确认</a></td>
        </tr>
        <tr class=spacing> 
          <td><a 
            href="/datacenter/maintenance/user/reportstatus/ReportStatus.jsp">报表状态</a></td>
        </tr>
        <tr class=spacing> 
          <td height="8"></td>
        </tr>
        </TBODY> 
      </TABLE>
      <table class=viewform width="100%">
        <tbody> 
        <tr class=title> 
          <th>报表查看</th>
        </tr>
     <tr class=spacing><td class=line1></td></tr>
        <%
		String para = userid + separator + "2" ;
		
		if(HrmUserVarify.checkUserRight("DataCenter:Maintenance", user)) 
			RecordSet.executeProc("T_OutReport_SelectAll","0");
		else
			RecordSet.executeProc("T_OutReport_SelectByUserid",para);
			
		while(RecordSet.next()) {
			String outrepid =  Util.null2String(RecordSet.getString("outrepid")) ;
			String outrepname = Util.toScreen(RecordSet.getString("outrepname"),user.getLanguage()) ;
		%>
        <tr class=spacing> 
          <td><a 
            href="/datacenter/report/OutReportSel.jsp?outrepid=<%=outrepid%>"><%=outrepname%></a></td>
        </tr>
        <%}%>
        </tbody> 
      </table>
      <br>
      <table class=viewform>
          <tr class=title><th>新建讨论</th></tr>
         <tr class=spacing><td class=line1></td></tr>
          <tr><td><UL>
        <%	
            ArrayList NewWorkflows = new ArrayList();
            String wfcrtSqlWhere = shareManager.getWfShareSqlWhere(user, "t1");
            String sql = "select workflowid from ShareInnerWfCreate t1 where " + wfcrtSqlWhere;
            RecordSet.executeSql(sql);
            while(RecordSet.next()){
                NewWorkflows.add(RecordSet.getString("workflowid"));
            }
           
            while(WorkflowComInfo.next()){
                String wfname=WorkflowComInfo.getWorkflowname();
                String wfid = WorkflowComInfo.getWorkflowid();
	 	
	 	        if(NewWorkflows.indexOf(wfid)==-1) continue;
	    %>
		<li><a href="javascript:onNewRequest(<%=wfid%>);">
		<%=Util.toScreen(wfname,user.getLanguage())%></a></li>
	    <%
            }
            WorkflowComInfo.setTofirstRow();
	    %>
         </ul>
         </td>
         </tr>
       </table>
       <br>
    <%
        ArrayList wftypes=new ArrayList();
        ArrayList wftypecounts=new ArrayList();
        ArrayList workflows=new ArrayList();
        ArrayList workflowcounts=new ArrayList();
        int totalcount=0;
        
        RecordSet.executeProc("workflow_requestbase_SWftype",resourceid+flag+usertype+flag+"0");
        while(RecordSet.next()){
            wftypes.add(RecordSet.getString("workflowtype"));
            wftypecounts.add(RecordSet.getString("typecount"));
        }
        RecordSet.executeProc("workflow_requestbase_SelectWf",resourceid+flag+usertype+flag+"0");
        while(RecordSet.next()){
            workflows.add(RecordSet.getString("workflowid"));
            workflowcounts.add(RecordSet.getString("workflowcount"));
        }
        for(int i=0;i<wftypes.size();i++){
            totalcount+=Util.getIntValue((String)wftypecounts.get(i),0);
        }
    %>
    <br>
    <table class="viewform">
    <colgroup><col width="49%"><col width=10><col width="49%">
    <tr>
    <td valign=top>
      <table class="viewform">
      <tr class="Title">
              <th><%=SystemEnv.getHtmlLabelName(732,user.getLanguage())%>:<%=totalcount%></th>
            </tr>
      <tr class="Spacing"><td class="Line1"></td></tr>
      <tr><td>
      <UL>
    <%	
        String typeid="";
        String typecount="";
        String typename="";
        String workflowid="";
        String workflowcount="";
        String workflowname="";
        for(int i=0;i<wftypes.size();i++){
            typeid=(String)wftypes.get(i);
            typecount=(String)wftypecounts.get(i);
            typename=WorkTypeComInfo.getWorkTypename(typeid);
            %>
        <LI><a href="/workflow/search/WFSearchTemp.jsp?method=myreqeustbywftype&wftype=<%=typeid%>&complete=0">
            <%=Util.toScreen(typename,user.getLanguage())%></a>&nbsp;<b>(<%=Util.toScreen(typecount,user.getLanguage())%>)</b>
            <UL>
            <%
            if(typeid.equals("24")) continue;
            for(int j=0;j<workflows.size();j++){
                workflowid=(String)workflows.get(j);
                String curtypeid=WorkflowComInfo.getWorkflowtype(workflowid);
                if(!curtypeid.equals(typeid))	continue;
                workflowcount=(String)workflowcounts.get(j);
                workflowname=WorkflowComInfo.getWorkflowname(workflowid);
                %>
            <LI><a href="/workflow/search/WFSearchTemp.jsp?method=myreqeustbywfid&workflowid=<%=workflowid%>&complete=0">
                <%=Util.toScreen(workflowname,user.getLanguage())%></a>&nbsp;(<%=Util.toScreen(workflowcount,user.getLanguage())%>)
                <%
            }
            %>
        </UL>
            <%
        }
    %>
       </UL></td></tr></table>
        <br>
    <%
        wftypes.clear();
        wftypecounts.clear();
        workflows.clear();
        workflowcounts.clear();
        totalcount=0;
        
        RecordSet.executeProc("workflow_requestbase_SWftype",resourceid+flag+usertype+flag+"1");
        while(RecordSet.next()){
            wftypes.add(RecordSet.getString("workflowtype"));
            wftypecounts.add(RecordSet.getString("typecount"));
        }
        RecordSet.executeProc("workflow_requestbase_SelectWf",resourceid+flag+usertype+flag+"1");
        while(RecordSet.next()){
            workflows.add(RecordSet.getString("workflowid"));
            workflowcounts.add(RecordSet.getString("workflowcount"));
        }
        
        for(int i=0;i<wftypes.size();i++){
            totalcount+=Util.getIntValue((String)wftypecounts.get(i),0);
        }
    %>
      <table class="viewform">
      <tr class="Title"><th><%=SystemEnv.getHtmlLabelName(1961,user.getLanguage())%>:<%=totalcount%></th></tr>
      <tr class="Spacing"><td class="Line1"></td></tr>
      <tr><td><UL>
    <%	
        for(int i=0;i<wftypes.size();i++){
            typeid=(String)wftypes.get(i);
            typecount=(String)wftypecounts.get(i);
            typename=WorkTypeComInfo.getWorkTypename(typeid);
            %>
        <LI><a href="/workflow/search/WFSearchTemp.jsp?method=myreqeustbywftype&wftype=<%=typeid%>&complete=1">
            <%=Util.toScreen(typename,user.getLanguage())%></a>&nbsp;<b>(<%=Util.toScreen(typecount,user.getLanguage())%>)</b>
            <UL>
            <%
            if(typeid.equals("24")) continue;
            for(int j=0;j<workflows.size();j++){
                workflowid=(String)workflows.get(j);
                String curtypeid=WorkflowComInfo.getWorkflowtype(workflowid);
                if(!curtypeid.equals(typeid))	continue;
                workflowcount=(String)workflowcounts.get(j);
                workflowname=WorkflowComInfo.getWorkflowname(workflowid);
                %>
            <LI><a href="/workflow/search/WFSearchTemp.jsp?method=myreqeustbywfid&workflowid=<%=workflowid%>&complete=1">
                <%=Util.toScreen(workflowname,user.getLanguage())%></a>&nbsp;(<%=Util.toScreen(workflowcount,user.getLanguage())%>)
                <%
            }
            %>
        </UL>
            <%
        }
    %>
      </UL></td></tr></table>
    <br>
      <%
            wftypes.clear();
            wftypecounts.clear();
            workflows.clear();
            workflowcounts.clear();
            totalcount=0;

            ArrayList endwftypes=new ArrayList();
            ArrayList endwftypecounts=new ArrayList();
            ArrayList endworkflows=new ArrayList();
            ArrayList endworkflowcounts=new ArrayList();
            int endtotalcount=0;

            // 刘煜为性能优化做的修改, 只是选择一次,然后在根据currentnodetype 和类型进行挑选
            
            RecordSet.executeProc("workflow_currentoperator_SWf",resourceid+flag+usertype);
            while(RecordSet.next()){
                int theworkflowcount = Util.getIntValue(RecordSet.getString(1),0) ;
                String theworkflowid = Util.null2String(RecordSet.getString(2)) ;
                String thecurrenttype = Util.null2String(RecordSet.getString(3)) ;

                if(!thecurrenttype.equals("3")) {       // 未完成
                    String curtypeid=WorkflowComInfo.getWorkflowtype(theworkflowid);

                    int wrkindex = workflows.indexOf(theworkflowid) ;
                    if(wrkindex != -1) {
                        workflowcounts.set(wrkindex,""+(Util.getIntValue((String)workflowcounts.get(wrkindex),0)+theworkflowcount)) ;
                    }
                    else {
                        workflows.add(theworkflowid) ;
                        workflowcounts.add(""+theworkflowcount) ;
                    }

                    int wrktypeindex = wftypes.indexOf(curtypeid) ;
                    if(wrktypeindex != -1) {
                        wftypecounts.set(wrktypeindex,""+(Util.getIntValue((String)wftypecounts.get(wrktypeindex),0)+theworkflowcount)) ;
                    }
                    else {
                        wftypes.add(curtypeid) ;
                        wftypecounts.add(""+theworkflowcount) ;
                    }

                    totalcount += theworkflowcount ;
                }
                else {          // 已经结束的 , 只用一种 currenttype
                    String curtypeid=WorkflowComInfo.getWorkflowtype(theworkflowid);

                    endworkflows.add(theworkflowid) ;
                    endworkflowcounts.add(""+theworkflowcount) ;

                    int wrktypeindex = endwftypes.indexOf(curtypeid) ;
                    if(wrktypeindex != -1) {
                        endwftypecounts.set(wrktypeindex,""+(Util.getIntValue((String)endwftypecounts.get(wrktypeindex),0)+theworkflowcount)) ;
                    }
                    else {
                        endwftypes.add(curtypeid) ;
                        endwftypecounts.add(""+theworkflowcount) ;
                    }

                    endtotalcount += theworkflowcount ;
                }
            }
      %>
      <table class=viewform>
          <tr class=title><th>待处理讨论:<%=totalcount%></th></tr>
         <tr class=spacing><td class=line1></td></tr>
          <tr><td><UL>
        <%	
            
            for(int i=0;i<wftypes.size();i++){
                typeid=(String)wftypes.get(i);
                typecount=(String)wftypecounts.get(i);
                typename=WorkTypeComInfo.getWorkTypename(typeid);
                %>
            <LI><a href="/workflow/search/WFSearchTemp.jsp?method=reqeustbywftype&wftype=<%=typeid%>&complete=0">
                <%=Util.toScreen(typename,user.getLanguage())%></a>&nbsp;<b>(<%=Util.toScreen(typecount,user.getLanguage())%>)</b>
                <UL>
                <%
                for(int j=0;j<workflows.size();j++){
                    workflowid=(String)workflows.get(j);
                    String curtypeid=WorkflowComInfo.getWorkflowtype(workflowid);
                    if(!curtypeid.equals(typeid))	continue;
                    workflowcount=(String)workflowcounts.get(j);
                    workflowname=WorkflowComInfo.getWorkflowname(workflowid);
                %>
                    <LI><a href="/workflow/search/WFSearchTemp.jsp?method=reqeustbywfid&workflowid=<%=workflowid%>&complete=0"><%=Util.toScreen(workflowname,user.getLanguage())%></a>&nbsp;(<%=Util.toScreen(workflowcount,user.getLanguage())%>)
                <% 
                    workflows.remove(j) ;
                    workflowcounts.remove(j) ;
                    j-- ;
                } 
                %>
            </UL>
                <%
            }
        %>
         </UL>
         </td>
         </tr>
       </table>
       <br>
    <%
        wftypes = endwftypes ;
        wftypecounts = endwftypecounts ;
        workflows = endworkflows ;
        workflowcounts = endworkflowcounts ;
        totalcount = endtotalcount ;
    %>
    <table class=viewform>
      <tr class=title><th>已结束讨论:<%=totalcount%></th></tr>
      <tr class=spacing><td class=line1></td></tr>
      <tr><td><UL>
    <%	
        for(int i=0;i<wftypes.size();i++){
            typeid=(String)wftypes.get(i);
            typecount=(String)wftypecounts.get(i);
            typename=WorkTypeComInfo.getWorkTypename(typeid);
            %>
        <LI><a href="/workflow/search/WFSearchTemp.jsp?method=reqeustbywftype&wftype=<%=typeid%>&complete=1">
            <%=Util.toScreen(typename,user.getLanguage())%></a>&nbsp;<b>(<%=Util.toScreen(typecount,user.getLanguage())%>)</b>
            <UL>
            <%
            for(int j=0;j<workflows.size();j++){
                workflowid=(String)workflows.get(j);
                String curtypeid=WorkflowComInfo.getWorkflowtype(workflowid);
                if(!curtypeid.equals(typeid))	continue;
                workflowcount=(String)workflowcounts.get(j);
                workflowname=WorkflowComInfo.getWorkflowname(workflowid);
                %>
            <LI><a href="/workflow/search/WFSearchTemp.jsp?method=reqeustbywfid&workflowid=<%=workflowid%>&complete=1">
                <%=Util.toScreen(workflowname,user.getLanguage())%></a>&nbsp;(<%=Util.toScreen(workflowcount,user.getLanguage())%>)
            <% 
                workflows.remove(j) ;
                workflowcounts.remove(j) ;
                j-- ;
            } 
            %>
        </UL>
            <%
        }
    %>
      </UL></td></tr>
     </table>
    </TD></TR></TBODY></TABLE>
	</td>
		</tr>
		</TABLE>
	</td>
	<td></td>
</tr>
<tr>
	<td height="10" colspan="3"></td>
</tr>
</table>

<script language=javascript>
function onNewRequest(wfid){
	window.location.href = "/workflow/request/AddRequest.jsp?workflowid="+wfid;
}
</script>	

</BODY></HTML>