diff --git a/WebContent/WEB-INF/view/partMng/partMngListExcel.jsp b/WebContent/WEB-INF/view/partMng/partMngListExcel.jsp index 5e90746..e01d559 100644 --- a/WebContent/WEB-INF/view/partMng/partMngListExcel.jsp +++ b/WebContent/WEB-INF/view/partMng/partMngListExcel.jsp @@ -2,8 +2,8 @@ <%@ 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.*" %> +<%@ 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(); @@ -17,22 +17,19 @@ response.setHeader("Content-Disposition", "attachment;filename="+fileName+""); response.setHeader("Content-Description", "JSP Generated Data"); ArrayList list = (ArrayList)request.getAttribute("LIST"); +if(list == null) list = new ArrayList(); %> - - + + <%=Constants.SYSTEM_NAME%> - - - - -
+ + + -
- - \ No newline at end of file + + + diff --git a/src/com/pms/controller/PartMngController.java b/src/com/pms/controller/PartMngController.java index 02f5cb8..04e14ee 100644 --- a/src/com/pms/controller/PartMngController.java +++ b/src/com/pms/controller/PartMngController.java @@ -134,29 +134,29 @@ public class PartMngController { String actionType = CommonUtils.checkNull(paramMap.get("actionType")); String search = CommonUtils.checkNull(paramMap.get("search")); try { - + if("0".equals(searchRevision)){ paramMap.put("IS_LAST",""); }else if("1".equals(searchRevision)){ paramMap.put("IS_LAST",searchRevision); } - + code_map.put("product_code",commonService.bizMakeOptionList("", (String)paramMap.get("product_code"),"common.getProductCodeselect")); //고객사 code_map.put("customer_cd",commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)paramMap.get("customer_cd")),"common.getmatersupplyselect")); - - if("Y".equals(search)){ - //list = CommonUtils.keyChangeUpperList(partMngService.getPartMngList(request,paramMap)); + + if("excel".equals(actionType)){ + list = partMngService.getPartMngGridListAll(paramMap); } - + } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } - + request.setAttribute("code_map",code_map); request.setAttribute("LIST", list); - + if("excel".equals(actionType)){ page ="/partMng/partMngListExcel"; } diff --git a/src/com/pms/service/PartMngService.java b/src/com/pms/service/PartMngService.java index f539589..affed6a 100644 --- a/src/com/pms/service/PartMngService.java +++ b/src/com/pms/service/PartMngService.java @@ -142,6 +142,23 @@ public class PartMngService extends BaseService { return CommonUtils.toUpperCaseMapKey(resultList); } + /** + * PART 조회 - 엑셀 다운로드용 전체 목록(페이징 없음). 화면 그리드와 동일한 partMngGridList 사용. + */ + public List getPartMngGridListAll(Map paramMap){ + List> resultList = new ArrayList(); + SqlSession sqlSession = null; + try{ + sqlSession = SqlMapConfig.getInstance().getSqlSession(); + resultList = (ArrayList)sqlSession.selectList("partMng.partMngGridList", paramMap); + }catch(Exception e){ + e.printStackTrace(); + }finally{ + if(sqlSession != null) sqlSession.close(); + } + return CommonUtils.toUpperCaseMapKey(resultList); + } + /** * 부서정보 조회 * @param paramMap