Files
wace_plm/WebContent/WEB-INF/view/partMng/structurePopupLeftExcel.jsp
2025-10-27 12:09:22 +09:00

157 lines
5.2 KiB
Plaintext

<%@ page isThreadSafe = "true" %>
<%@ page buffer="256kb" %>
<%@ page autoFlush = "true" %>
<%@ page contentType="application/vnd.ms-excel;charset=UTF-8" %>
<%@ page import="com.pms.common.utils.*"%>
<%@ page import="java.util.*" %>
<%
java.text.SimpleDateFormat frm= new java.text.SimpleDateFormat ("yyyy_MM_dd_HH_mm");
Calendar cal = Calendar.getInstance();
String todayKor = frm.format(cal.getTime());
ArrayList list = (ArrayList)request.getAttribute("tree");
Map sumPriceMap = (Map)request.getAttribute("info");
// 품번 정보가 있으면 파일명에 사용
String partNo = CommonUtils.checkNull(sumPriceMap.get("PART_NO"));
String excelName = "구조등록";
if(!partNo.isEmpty()) {
excelName = partNo;
}
String encodeName = excelName+"_"+todayKor+".xls";
String fileName = java.net.URLEncoder.encode(encodeName,"UTF-8");
response.setHeader("Content-Disposition", "attachment;filename="+fileName+"");
response.setHeader("Content-Description", "JSP Generated Data");
int z = 0;
int Maxlevel = 0;
int[] levelarr = new int[list.size()];
for(int i=0; i< list.size(); i++){
HashMap treemap = (HashMap)list.get(i);
int level = Integer.parseInt(CommonUtils.checkNull(treemap.get("LEVEL")));
levelarr[i] = level;
}
if(null != list && 0 < list.size()){
HashMap MaxlevelMap = (HashMap)list.get(0);
Maxlevel = Integer.parseInt(CommonUtils.checkNull(MaxlevelMap.get("MAX_LEVEL")));
}
%>
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=UTF-8">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 11">
<title><%=Constants.SYSTEM_NAME%></title>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script>
</script>
</head>
<body class="backcolor">
<form name="form1" action="" method="post">
<section class="min_part_search">
<div class="pdm_menu_name">
<h2>
<span>구조등록
<%
if(!partNo.isEmpty()) {
%>
(<%=partNo%>)
<%
} else {
%>
(${info.CUSTOMER_NAME}_${info.CUSTOMER_PROJECT_NAME}_${info.UNIT_NAME})_${info.REVISION}
<%
}
%>
</span>
</h2>
</div>
<div class="contents_page_basic_margin">
<div class="pdm_table_wrap">
<table class="pdm_table_noImg" style="text-align:center;" border="1">
<colgroup>
<% if(Maxlevel == 0){%>
<%}else{%>
<col width="25px" />
<%}
for(int i=0; i< Maxlevel; i++){%>
<col width="25px" />
<%}%>
<col width="130px" />
<col width="160px" />
<col width="50px" />
<col width="30px" /> <!-- 3D -->
<col width="30px" /> <!-- 2D -->
<col width="30px" /> <!-- 2D PDF -->
<col width="70px" /> <!-- Material -->
<col width="190px" /> <!-- SPEC. -->
<col width="90px" /> <!-- MAKER. -->
<col width="70px" /> <!-- Revision -->
<col width="75px" /> <!-- EO no -->
<col width="75px" /> <!-- EO Date -->
<col width="70px" />
</colgroup>
<tr class="pdm_thead" align="center" style="background:yellow; font-weight:bold;">
<td colspan="${MAXLEV}">Level</td>
<td>품번</td>
<td>품명</td>
<td>수량</td>
<td>3D</td>
<td>2D</td>
<td>PDF</td>
<td>재질</td>
<td>사양(규격)</td>
<td>MAKER</td>
<td>Revision</td>
<td>EO No</td>
<td>EO Date</td>
<td>PART 구분</td>
</tr>
<%
if(list != null && !list.isEmpty()){
for(int i = 0 ; i < list.size() ; i++){
HashMap map = (HashMap)list.get(i);
%>
<tr>
<%
for(int j=0; j< Maxlevel; j++){
if(levelarr[z] == (j+1)){%>
<td>*</td>
<% }else{ %>
<td> </td>
<% }
}
z++;
%>
<td align="left"><%=CommonUtils.checkNull(map.get("PART_NO"))%></td>
<td align="left"><%=CommonUtils.checkNull(map.get("PART_NAME"))%></td>
<td align="center"><%=CommonUtils.checkNull(map.get("QTY_TEMP"))%></td>
<td align="center"><%=CommonUtils.checkNull(map.get("CU01_CNT"))%></td>
<td align="center"><%=CommonUtils.checkNull(map.get("CU02_CNT"))%></td>
<td align="center"><%=CommonUtils.checkNull(map.get("CU03_CNT"))%></td>
<td align="left"><%=CommonUtils.checkNull(map.get("MATERIAL"))%></td>
<td align="left"><%=CommonUtils.checkNull(map.get("SPEC"))%></td>
<td align="left"><%=CommonUtils.checkNull(map.get("MAKER"))%></td>
<td align="center"><%=CommonUtils.checkNull(map.get("REVISION"))%></td>
<td align="center"><%=CommonUtils.checkNull(map.get("EO_NO"))%></td>
<td align="center"><%=CommonUtils.checkNull(map.get("EO_DATE"))%></td>
<td align="center"><%=CommonUtils.checkNull(map.get("PART_TYPE_TITLE"))%></td>
</tr>
<%
}
}
%>
</table>
</div>
</div>
</section>
</form>
</body>
</html>