You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
318 lines
14 KiB
318 lines
14 KiB
<%-- |
|
Document : report_list.jsp |
|
Created on : 2014. 8. 19, 오후 5:12:19 |
|
Author : choyoungjun |
|
|
|
* 업무포탈 연계포틀릿 설정방법 |
|
1. 업무포탈에 관리자로 로그인 |
|
2. 우측 상단 [관리자] 클릭 -> [포털빌더] 클릭 |
|
3. 좌측 메뉴 [포틀릿] 클릭 |
|
4. 포틀릿 찾기 (2014.08.20 기준 포틀릿명이 "자료집계목록" 으로 저장되어있음) |
|
|
|
--%> |
|
<%@page import="kr.co.kihyun.moumi.MoumiConfig"%> |
|
<%@page import="java.util.Date"%> |
|
<%@page import="java.util.Calendar"%> |
|
<%@page import="java.util.List"%> |
|
<%@page import="java.util.Map"%> |
|
<%@page import="java.util.HashMap"%> |
|
<%@page import="java.text.SimpleDateFormat"%> |
|
<%@page import="javax.jdo.Transaction"%> |
|
<%@page import="kr.co.kihyun.moumi.Moumi"%> |
|
<%@page import="kr.co.kihyun.lang.Encoder"%> |
|
<%@page import="kr.co.kihyun.lang.MInteger"%> |
|
<%@page import="kr.co.kihyun.lang.MString"%> |
|
<%@page import="kr.co.kihyun.beans.entity.MUser"%> |
|
<%@page import="kr.co.kihyun.beans.entity.*"%> |
|
<%@page import="kr.co.kihyun.beans.entity.TotReportProcess"%> |
|
<%@page import="kr.co.kihyun.beans.entity.util.PMF"%> |
|
<%@page import="kr.co.kihyun.beans.entity.util.MPersistenceManager"%> |
|
<%@page import="kr.co.kihyun.beans.user.HttpSSOLogin"%> |
|
<%@page import="kr.co.kihyun.service.vo.TotReportVO"%> |
|
<%@page import="kr.co.kihyun.service.TotReportService"%> |
|
<%@page contentType="text/html" pageEncoding="EUC-KR"%> |
|
<%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%> |
|
<% |
|
String currentServerName = request.getServerName(); |
|
//System.out.println("=====> currentServerName : " + currentServerName); |
|
|
|
String usID = (String) session.getAttribute("SSO_USER_ID"); |
|
String dpID = HttpSSOLogin.getDeptID(request); |
|
|
|
if (MString.isNull(usID)) { |
|
if (MString.isNull(HttpSSOLogin.getLoginID(request))) { |
|
out.println("<center>※ 통합로그인(SSO)이 되지 않아 내용을 표시할 수 없습니다.<br></center>"); |
|
return; |
|
} else { |
|
usID = HttpSSOLogin.getLoginID(request); |
|
} |
|
} |
|
|
|
//System.out.println("=====> usID : " + usID); |
|
|
|
MPersistenceManager pm = new MPersistenceManager(PMF.get().getPersistenceManager()); |
|
Transaction tx = pm.currentTransaction(); |
|
|
|
try { |
|
|
|
/********** Parameter **********/ |
|
String strPage = clearXSS(request.getParameter("strPage"),""); |
|
String findOption = clearXSS(request.getParameter("findOption"),null); |
|
String findWord = clearXSS(Encoder.toJava(request.getParameter("findWord")),null); |
|
|
|
//String method = clearXSS(request.getParameter("method"),""); |
|
//if(method.equals("GET")) findWord = URLDecoder.decode(MString.checkNull(request.getParameter("findWord")), "UTF-8"); |
|
//String uri = URLEncoder.encode("report_list.jsp?findOption="+MString.checkNull(findOption),"UTF-8")+"&method=GET"; |
|
|
|
int docNameLengthLimit = 30; // 제목(자료명) 길이 제한 |
|
|
|
tx.begin(); |
|
|
|
String tmpMagam; |
|
|
|
int pageSize=0; |
|
int currentPage=0; |
|
int currentPageSetUp=0; |
|
int recordSize=3; // 출력 레코드 갯수 |
|
|
|
if(strPage == null || strPage.length()<=0) { |
|
currentPage = 1; |
|
} else if(strPage.equals("null")) { |
|
currentPage = 1; |
|
} else { |
|
try { |
|
currentPage=Integer.parseInt(strPage); |
|
} catch(NumberFormatException ex) { |
|
System.out.println(ex); |
|
} |
|
} |
|
|
|
//====================================================================== |
|
MUser mUser = pm.getObjectById(MUser.class, usID); |
|
SysAuth sysAuth = mUser.getSysAuth(); |
|
|
|
TotReportService reportService = new TotReportService(pm); |
|
//검색조건파라미터(연계포틀릿에서는 검색 기능이 제외된다.) |
|
Map params = new HashMap(); |
|
params.put("findOption", findOption); |
|
params.put("filterValue", findWord); |
|
params.put("userId", usID); |
|
params.put("deptId", dpID); |
|
params.put("sysAuth", mUser.getSysAuth()); |
|
|
|
//검색메인쿼리와 레코드갯수조회쿼리를 생성 후 멤버변수로 저장 |
|
reportService.createAcceptReportListSearchQuery(params); |
|
|
|
//레코드갯수조회쿼리를 실행하여 레코드갯수를 구함 |
|
int count = reportService.getCountFromMainQuery(); |
|
|
|
if((count%recordSize) == 0) { |
|
pageSize = (int)(count/recordSize); |
|
} else { |
|
pageSize = (int)(count/recordSize)+1; |
|
} |
|
|
|
if( currentPage > pageSize ) currentPage = pageSize; |
|
currentPageSetUp = (int)(currentPage/10)*10; |
|
if (currentPage%10 == 0) { |
|
currentPageSetUp-=10; |
|
} |
|
|
|
int startNo = (currentPage - 1) * recordSize + 1; |
|
int endNo = currentPage * recordSize; |
|
|
|
List list = null; |
|
|
|
//검색목록조회쿼리 실행 |
|
if( count > 0 ) { |
|
//페이징처리를 위한 추가파라미터 설정 |
|
reportService.getParams().put("startNo", startNo); |
|
reportService.getParams().put("endNo", endNo); |
|
|
|
//검색메인쿼리를 페이징처리를 위한 쿼리로 변환 |
|
reportService.convertToPagenatingQuery(); |
|
|
|
//만족하는 레코드가 존재하면 조회 |
|
list = reportService.executeQuery(TotReportVO.class); |
|
} |
|
//====================================================================== |
|
tx.rollback(); |
|
|
|
SimpleDateFormat ymdFormat = new SimpleDateFormat("yyyy-MM-dd"); |
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
Calendar cal = Calendar.getInstance(); |
|
|
|
String nowTime = ""; |
|
nowTime = sdf.format(cal.getTime()); |
|
Date nowDate = sdf.parse(nowTime); |
|
%> |
|
<html> |
|
<head> |
|
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR"> |
|
<title>업무포탈 메인페이지 연계포틀릿</title> |
|
<style type="text/css"> |
|
html{overflow: hidden;} |
|
body{margin:0; overflow: hidden; background-color: #FFF; } |
|
img{border: none;} |
|
.wrap{margin:0; overflow: hidden;} |
|
.report_txt{font-size: 9pt; font-family: Gulim, Dotum, Arial; color: #000;} |
|
.report_list{margin:20px 0 0 0; padding:0; list-style: none;} |
|
.report_list th{font-size: 9pt; font-family: Gulim, Dotum, Arial; color: #555; border-bottom:1px solid #ccc;} |
|
.report_list td{height:19px;} |
|
.report_title{width:41%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;} |
|
.report_title a{width:100%; white-space: nowrap; text-overflow: ellipsis; text-decoration: none; border:none;} |
|
.report_title .report_title_prefix{color: #8e86d4;} |
|
.report_title .report_title_txt:hover{color: #088ce0;} |
|
|
|
.report_name_up{width:15%; text-align: center;} |
|
.report_onwer_name{width:10%; text-align: center;} |
|
.report_start_date{width:12%; text-align: center;} |
|
.report_end_date{width:12%; text-align: center;} |
|
.report_etc{text-align: center;} |
|
.report_no_data{padding:30px 0 0 0; text-align: center;} |
|
</style> |
|
</head> |
|
<body> |
|
<div class="wrap"> |
|
<table width="100%" height="70" border="0" cellpadding="0" cellspacing="0"> |
|
<tr valign="middle" style="padding-top: 3"> |
|
<!--<th nowrap>시행번호</th>--> |
|
<td width="200" align="center" nowrap class="kecttep_tdmenu"><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.doc")%><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.name")%></td> |
|
<td width="110" align="center" nowrap class="kecttep_tdmenu"><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.request")%><%=Moumi.getMessageBundle().getString("moumi.message.totsys.sysadm.part.part_list_jsp")%></td> |
|
<td width="90" align="center" nowrap class="kecttep_tdmenu"><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.request")%><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.person")%></td> |
|
<td width="100" align="center" nowrap class="kecttep_tdmenu"><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.startDate")%></td> |
|
<td width="135" align="center" nowrap class="kecttep_tdmenu"><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.endDate")%></td> |
|
<td width="70" align="center" nowrap class="kecttep_tdmenu"><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.remark")%></td> |
|
</tr> |
|
<% |
|
tx.begin(); |
|
if( count > 0 ) { |
|
|
|
int listCount = list.size(); |
|
|
|
for(int i = 0; i < listCount; i++){ |
|
TotReportVO reportVO = (TotReportVO)list.get(i); |
|
String tmpMoumiAcptLimitStrategy = Integer.toString(reportVO.getSubmitLimitCnt()); |
|
String tmp2= null; |
|
String tstr = "시 종료"; |
|
String tcnt; |
|
tcnt = "("+Integer.toString(reportVO.getSubmitLimitCnt())+"개 기관)"; |
|
if(tmpMoumiAcptLimitStrategy.equals("0")){ |
|
tmp2 = new SimpleDateFormat("yyyy-MM-dd HH").format(reportVO.getEndDate()); |
|
tcnt = ""; |
|
}else{ |
|
tmp2 = Moumi.getMessageBundle().getString("moumi.message.tot_doc.endBySubmitTotal"); |
|
tstr = ""; |
|
} |
|
if(tmp2.contains("9999-12-30")) tmp2=Moumi.getMessageBundle().getString("moumi.message.tot_doc.endManually"); |
|
if(tmp2.equals(Moumi.getMessageBundle().getString("moumi.message.tot_doc.endManually"))) tstr = ""; |
|
|
|
tmpMagam = tmp2; |
|
%> |
|
<tr style="padding-top: 3" valign="middle"> |
|
<!--// 문서명 --> |
|
<td width="200" id="div_name" nowrap class="kecttep_graytd"> |
|
<img src="/totsys/totper/images/bu_002.gif" width="8" height="7" hspace="5"> |
|
<a href="/totsys/repoper/mydocbox/tempbox/report_regist.jsp?reportID=<%=reportVO.getId()%>" onclick="openTop(2);"> |
|
<%= MString.getEllipsis(reportVO.getDocName(), docNameLengthLimit) %> |
|
</a> |
|
</td> |
|
|
|
<!-- 문서명 //--> |
|
|
|
<!--// 요청기관/부서 --> |
|
<td width="110" align="center" nowrap class="kecttep_graytd"> |
|
<%= MString.checkNull(reportVO.getDeptName()) %> |
|
</td><!-- 요청기관/부서 //--> |
|
<!--// 집계요청자 --> |
|
<td width="90" align="center" nowrap class="kecttep_graytd"> |
|
<%= MString.checkNull(reportVO.getDocOwnerName()) %> |
|
</td><!-- 집계요청자 //--> |
|
<!--// 시작일 --> |
|
<td width="100" align="center" nowrap class="kecttep_graytd"> |
|
<%=ymdFormat.format(reportVO.getStartDate())%> |
|
</td><!-- 시작일 //--> |
|
<!--// 종료일 --> |
|
<td width="135" align="center" nowrap class="kecttep_graytd"> |
|
<% |
|
out.write(tmp2+tstr+tcnt); |
|
%> |
|
</td><!-- 종료일 //--> |
|
<!--// 비고 --> |
|
<td width="70" align="center" nowrap class="kecttep_graytd"> |
|
<%if(reportVO.getDownDocId() == 0){%> |
|
<%if(reportVO.getPrss() == 3){%> |
|
<%=TotReportProcess.RETURN %> |
|
<%}%> |
|
<%}else{%> |
|
<%if(reportVO.getPrss() == 3){%> |
|
<%=TotReportProcess.RETURN %> |
|
<%}%> |
|
<%}%> |
|
</td><!-- 비고 //--> |
|
</tr> |
|
<% |
|
} //end of for list |
|
|
|
} //end of if( count > 0) |
|
else |
|
{ |
|
%> |
|
<tr> |
|
<td colspan="7" class="report_no_data report_txt">접수된 자료가 없습니다.</td> |
|
</tr> |
|
<% |
|
} |
|
tx.rollback(); |
|
%> |
|
</table> |
|
</div> |
|
</body> |
|
<script type="text/javascript"> |
|
function fn_popupView(prss, downDocId, id, tmpStrMagam, tmpMagam) { |
|
|
|
var redirectUrl = ""; |
|
|
|
if (prss === "0") { |
|
// 접수 문서 |
|
|
|
if (downDocId === "0") { |
|
redirectUrl = "/totsys/repoper/mydocbox/tempbox/report_regist.jsp?reportID="+id+"&totperInfo=true&tmpStrMagam="+tmpStrMagam+"&tmpMagam="+tmpMagam; |
|
} else { |
|
redirectUrl = "/totsys/repoper/mydocbox/tempbox/tot_report_regist.jsp?reportID="+id; |
|
} |
|
} else if (prss === "3") { |
|
// 재입력요청 문서 |
|
|
|
if (downDocId === "0") { |
|
redirectUrl = "/totsys/repoper/mydocbox/returnbox/return_report_modify.jsp?reportID="+id+"&type=returndoc&totperInfo=true"; |
|
} else { |
|
redirectUrl = "/totsys/repoper/mydocbox/returnbox/report_view.jsp?reportID="+id+"&type=returndoc&totperInfo=true&tmpStrMagam="+tmpStrMagam+"&tmpMagam="+tmpMagam; |
|
} |
|
} |
|
|
|
var targetUrl = "/servlet/kr.co.kihyun.beans.user.HttpSSOLogin?redirect="; // 연계포틀릿에서 자료 클릭시 이동될 url.(각 교육청 도메인의 servlet 을 호출) |
|
|
|
<% |
|
// 로컬PC에서 개발시 request.getServerName() = 'localhost' 으로 테스트 한다. |
|
if (currentServerName.equals("localhost")) { %> |
|
targetUrl = "/totsys/login/frame.jsp?redirect="; // 개발시 확인 |
|
<% } %> |
|
|
|
var option = "width=800,height=600,top=0,left=0,resizable=yes,scrollbars=yes,menubar=no,status=no"; |
|
|
|
window.open(targetUrl + redirectUrl, "자료집계" ,option); |
|
} |
|
</script> |
|
</html> |
|
<% |
|
} catch(Exception ex) { |
|
ex.printStackTrace(); |
|
out.println(kr.co.kihyun.text.html.ServletUtil.getJavaScript("location='/servlet/kr.co.kihyun.beans.user.HttpSSOLogin?mode=logout';")); |
|
} finally { |
|
if(tx.isActive()) { |
|
tx.rollback(); |
|
} |
|
pm.close(); |
|
} |
|
%>
|
|
|