요금사용내역 신규 화면 엑셀 다운로드 및 pdf 다운로드 기능 수정
@36704ad454dea6f462d746a9aec4fa1234693332
--- src/main/java/itn/let/mjo/pay/web/MjonPayController.java
+++ src/main/java/itn/let/mjo/pay/web/MjonPayController.java
... | ... | @@ -2678,6 +2678,270 @@ |
| 2678 | 2678 |
return "/web/pay/PayUserSWListAjax"; |
| 2679 | 2679 |
} |
| 2680 | 2680 |
|
| 2681 |
+ @RequestMapping(value= {"/web/member/pay/PayPdfSWListPopUpAjax.do"})
|
|
| 2682 |
+ public String payPrintPdfSWDataAjax( |
|
| 2683 |
+ @ModelAttribute("searchVO") MjonMsgVO mjonMsgVO
|
|
| 2684 |
+ , RedirectAttributes redirectAttributes |
|
| 2685 |
+ , ModelMap model) throws Exception {
|
|
| 2686 |
+ //로그인 권한정보 불러오기 |
|
| 2687 |
+ LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null; |
|
| 2688 |
+ String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId()); |
|
| 2689 |
+ String userNm = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getName()); |
|
| 2690 |
+ |
|
| 2691 |
+ mjonMsgVO.setUserId(userId); |
|
| 2692 |
+ model.addAttribute("userNm", userNm);
|
|
| 2693 |
+ |
|
| 2694 |
+ mjonMsgVO.setFirstIndex(0); |
|
| 2695 |
+ mjonMsgVO.setRecordCountPerPage(10000); |
|
| 2696 |
+ |
|
| 2697 |
+ //결제 리스트 정보 불러오기 |
|
| 2698 |
+ List<MjonMsgVO> payUserList = mjonMsgDataService.selectPayUserSWList(mjonMsgVO); |
|
| 2699 |
+ model.addAttribute("payUserList", payUserList);
|
|
| 2700 |
+ |
|
| 2701 |
+ Calendar cal = Calendar.getInstance(); |
|
| 2702 |
+ |
|
| 2703 |
+ int year = cal.get(Calendar.YEAR); |
|
| 2704 |
+ int month = cal.get(Calendar.MONTH) + 1; |
|
| 2705 |
+ int day = cal.get(Calendar.DAY_OF_MONTH); |
|
| 2706 |
+ |
|
| 2707 |
+ model.addAttribute("year", year);
|
|
| 2708 |
+ model.addAttribute("month", month);
|
|
| 2709 |
+ model.addAttribute("day", day);
|
|
| 2710 |
+ |
|
| 2711 |
+ return "web/pay/PrintPayUserSWListPdfPopUp"; |
|
| 2712 |
+ } |
|
| 2713 |
+ |
|
| 2714 |
+ |
|
| 2715 |
+ /** |
|
| 2716 |
+ * 요금 사용내역 엑셀 다운 |
|
| 2717 |
+ * @param mjonMsgVO |
|
| 2718 |
+ * @param model |
|
| 2719 |
+ * @return "/web/member/pay/PayUserListAjax.do" |
|
| 2720 |
+ * @throws Exception |
|
| 2721 |
+ */ |
|
| 2722 |
+ @RequestMapping(value= {"/web/member/pay/PayUserSWListExcelDownload.do"})
|
|
| 2723 |
+ public void PayUserSWListExcelDownload(@ModelAttribute("searchVO") MjonMsgVO mjonMsgVO,
|
|
| 2724 |
+ HttpServletRequest request, |
|
| 2725 |
+ HttpServletResponse response , |
|
| 2726 |
+ ModelMap model) throws Exception{
|
|
| 2727 |
+ |
|
| 2728 |
+ // 메모리에 100개의 행을 유지합니다. 행의 수가 넘으면 디스크에 적습니다. |
|
| 2729 |
+ SXSSFWorkbook wb = new SXSSFWorkbook(100); |
|
| 2730 |
+ String fileName ="사용내역 엑셀 리스트"; // 저장 파일명 |
|
| 2731 |
+ String sheetTitle = "요금사용내역" ; // 셀 제목 |
|
| 2732 |
+ Sheet sheet = wb.createSheet(sheetTitle); |
|
| 2733 |
+ Cell cell = null; |
|
| 2734 |
+ Row row = null; |
|
| 2735 |
+ |
|
| 2736 |
+ CellStyle style = wb.createCellStyle(); |
|
| 2737 |
+ style.setBorderBottom(CellStyle.BORDER_THIN); //테두리 두껍게 |
|
| 2738 |
+ style.setBorderLeft(CellStyle.BORDER_THIN); |
|
| 2739 |
+ style.setBorderRight(CellStyle.BORDER_THIN); |
|
| 2740 |
+ style.setBorderTop(CellStyle.BORDER_THIN); |
|
| 2741 |
+ |
|
| 2742 |
+ // 정렬 |
|
| 2743 |
+ style.setAlignment(CellStyle.ALIGN_CENTER); //가운데 정렬 |
|
| 2744 |
+ style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); //높이 가운데 정렬 |
|
| 2745 |
+ |
|
| 2746 |
+ Font font = wb.createFont(); |
|
| 2747 |
+ font.setBoldweight(Font.BOLDWEIGHT_BOLD); //글씨 bold |
|
| 2748 |
+ |
|
| 2749 |
+ sheet.setColumnWidth(1, 5000); // 칼럼의 폭 조절 |
|
| 2750 |
+ sheet.setColumnWidth(4, 10000); // 칼럼의 폭 조절 |
|
| 2751 |
+ |
|
| 2752 |
+ try{
|
|
| 2753 |
+ |
|
| 2754 |
+ LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); |
|
| 2755 |
+ String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId()); |
|
| 2756 |
+ mjonMsgVO.setUserId(userId); |
|
| 2757 |
+ |
|
| 2758 |
+ mjonMsgVO.setRecordCountPerPage(100000); |
|
| 2759 |
+ mjonMsgVO.setFirstIndex(0); |
|
| 2760 |
+ |
|
| 2761 |
+ if("".equals(mjonMsgVO.getSearchSortCnd())){ //최초조회시 최신것 조회List
|
|
| 2762 |
+ mjonMsgVO.setSearchSortCnd("regDate");
|
|
| 2763 |
+ mjonMsgVO.setSearchSortOrd("desc");
|
|
| 2764 |
+ } |
|
| 2765 |
+ |
|
| 2766 |
+ List<MjonMsgVO> payUserList = mjonMsgDataService.selectPayUserSWList(mjonMsgVO); |
|
| 2767 |
+ {//화면 리스트
|
|
| 2768 |
+ |
|
| 2769 |
+ row = sheet.createRow(0); |
|
| 2770 |
+ |
|
| 2771 |
+ sheet.addMergedRegion(new CellRangeAddress(0,1,0,0)); //셀병합 |
|
| 2772 |
+ sheet.addMergedRegion(new CellRangeAddress(0,1,1,1)); //셀병합 |
|
| 2773 |
+ sheet.addMergedRegion(new CellRangeAddress(0,1,2,2)); //셀병합 |
|
| 2774 |
+ sheet.addMergedRegion(new CellRangeAddress(0,1,3,3)); //셀병합 |
|
| 2775 |
+ |
|
| 2776 |
+ |
|
| 2777 |
+ cell = row.createCell(0); |
|
| 2778 |
+ cell.setCellValue("번호");
|
|
| 2779 |
+ cell.setCellStyle(style); |
|
| 2780 |
+ |
|
| 2781 |
+ cell = row.createCell(1); |
|
| 2782 |
+ cell.setCellValue("날짜");
|
|
| 2783 |
+ cell.setCellStyle(style); |
|
| 2784 |
+ |
|
| 2785 |
+ cell = row.createCell(2); |
|
| 2786 |
+ cell.setCellValue("문자유형");
|
|
| 2787 |
+ cell.setCellStyle(style); |
|
| 2788 |
+ |
|
| 2789 |
+ cell = row.createCell(3); |
|
| 2790 |
+ cell.setCellValue("발송건수");
|
|
| 2791 |
+ cell.setCellStyle(style); |
|
| 2792 |
+ |
|
| 2793 |
+ cell = row.createCell(4); |
|
| 2794 |
+ cell.setCellValue("내용");
|
|
| 2795 |
+ cell.setCellStyle(style); |
|
| 2796 |
+ |
|
| 2797 |
+ /*cell = row.createCell(5); |
|
| 2798 |
+ cell.setCellValue("충전");
|
|
| 2799 |
+ sheet.addMergedRegion(new CellRangeAddress(0,0,5,6)); //셀병합 |
|
| 2800 |
+ cell.setCellStyle(style); |
|
| 2801 |
+ |
|
| 2802 |
+ cell = row.createCell(6); |
|
| 2803 |
+ cell.setCellStyle(style);*/ |
|
| 2804 |
+ |
|
| 2805 |
+ cell = row.createCell(5); |
|
| 2806 |
+ cell.setCellValue("사용");
|
|
| 2807 |
+ sheet.addMergedRegion(new CellRangeAddress(0,0,5,6)); //셀병합 |
|
| 2808 |
+ cell.setCellStyle(style); |
|
| 2809 |
+ |
|
| 2810 |
+ cell = row.createCell(6); |
|
| 2811 |
+ cell.setCellStyle(style); |
|
| 2812 |
+ |
|
| 2813 |
+ |
|
| 2814 |
+ /*cell = row.createCell(9); |
|
| 2815 |
+ cell.setCellValue("잔액");
|
|
| 2816 |
+ sheet.addMergedRegion(new CellRangeAddress(0,0,9,10)); //셀병합 |
|
| 2817 |
+ cell.setCellStyle(style); |
|
| 2818 |
+ |
|
| 2819 |
+ cell = row.createCell(10); |
|
| 2820 |
+ cell.setCellStyle(style);*/ |
|
| 2821 |
+ |
|
| 2822 |
+ row = sheet.createRow(1); |
|
| 2823 |
+ |
|
| 2824 |
+ cell = row.createCell(0); |
|
| 2825 |
+ cell.setCellStyle(style); |
|
| 2826 |
+ |
|
| 2827 |
+ cell = row.createCell(1); |
|
| 2828 |
+ cell.setCellStyle(style); |
|
| 2829 |
+ |
|
| 2830 |
+ cell = row.createCell(2); |
|
| 2831 |
+ cell.setCellStyle(style); |
|
| 2832 |
+ |
|
| 2833 |
+ cell = row.createCell(3); |
|
| 2834 |
+ cell.setCellStyle(style); |
|
| 2835 |
+ |
|
| 2836 |
+ cell = row.createCell(4); |
|
| 2837 |
+ cell.setCellStyle(style); |
|
| 2838 |
+ |
|
| 2839 |
+ /*cell = row.createCell(5); |
|
| 2840 |
+ cell.setCellValue("충전금");
|
|
| 2841 |
+ cell.setCellStyle(style); |
|
| 2842 |
+ |
|
| 2843 |
+ cell = row.createCell(6); |
|
| 2844 |
+ cell.setCellValue("포인트");
|
|
| 2845 |
+ cell.setCellStyle(style);*/ |
|
| 2846 |
+ |
|
| 2847 |
+ cell = row.createCell(5); |
|
| 2848 |
+ cell.setCellValue("충전금");
|
|
| 2849 |
+ cell.setCellStyle(style); |
|
| 2850 |
+ |
|
| 2851 |
+ cell = row.createCell(6); |
|
| 2852 |
+ cell.setCellValue("포인트");
|
|
| 2853 |
+ cell.setCellStyle(style); |
|
| 2854 |
+ |
|
| 2855 |
+ /*cell = row.createCell(9); |
|
| 2856 |
+ cell.setCellValue("충전금");
|
|
| 2857 |
+ cell.setCellStyle(style); |
|
| 2858 |
+ |
|
| 2859 |
+ cell = row.createCell(10); |
|
| 2860 |
+ cell.setCellValue("포인트");
|
|
| 2861 |
+ cell.setCellStyle(style);*/ |
|
| 2862 |
+ |
|
| 2863 |
+ DecimalFormat formatter = new DecimalFormat("###,###.##");
|
|
| 2864 |
+ String befCash = ""; |
|
| 2865 |
+ String befPoint = ""; |
|
| 2866 |
+ String totPrice = ""; |
|
| 2867 |
+ String thisPoint = ""; |
|
| 2868 |
+ |
|
| 2869 |
+ for(int i=0; i < payUserList.size(); i++) {
|
|
| 2870 |
+ |
|
| 2871 |
+ befCash = formatter.format(Double.parseDouble(((MjonMsgVO)payUserList.get(i)).getBefCash())); |
|
| 2872 |
+ befPoint = formatter.format(Double.parseDouble(((MjonMsgVO)payUserList.get(i)).getBefPoint())); |
|
| 2873 |
+ totPrice = formatter.format(Double.parseDouble(((MjonMsgVO)payUserList.get(i)).getTotPrice())); |
|
| 2874 |
+ thisPoint = formatter.format(Double.parseDouble(((MjonMsgVO)payUserList.get(i)).getThisPoint())); |
|
| 2875 |
+ |
|
| 2876 |
+ String msgType = "단문"; |
|
| 2877 |
+ if(payUserList.get(i).getMsgTypeTxt().equals("6") && payUserList.get(i).getFileCnt().equals("0")) {
|
|
| 2878 |
+ msgType = "장문"; |
|
| 2879 |
+ }else if(payUserList.get(i).getMsgTypeTxt().equals("6") && !payUserList.get(i).getFileCnt().equals("0")) {
|
|
| 2880 |
+ msgType = "그림"; |
|
| 2881 |
+ }else if(payUserList.get(i).getMsgTypeTxt().equals("8")) {
|
|
| 2882 |
+ msgType = "알림톡"; |
|
| 2883 |
+ }else if(payUserList.get(i).getMsgTypeTxt().equals("9")) {
|
|
| 2884 |
+ msgType = "친구톡"; |
|
| 2885 |
+ }else if(payUserList.get(i).getMsgTypeTxt().equals("fax")) {
|
|
| 2886 |
+ msgType = "팩스"; |
|
| 2887 |
+ } |
|
| 2888 |
+ |
|
| 2889 |
+ int sendCount = ((MjonMsgVO)payUserList.get(i)).getSendCount(); |
|
| 2890 |
+ |
|
| 2891 |
+ |
|
| 2892 |
+ String sendSum = Integer.toString(sendCount); |
|
| 2893 |
+ |
|
| 2894 |
+ if(payUserList.get(i).getMsgTypeTxt().equals("fax")) {
|
|
| 2895 |
+ sendSum = sendSum+"("+payUserList.get(i).getFileCnt()+")";
|
|
| 2896 |
+ } |
|
| 2897 |
+ |
|
| 2898 |
+ row = sheet.createRow(i+2); |
|
| 2899 |
+ for(int j=0 ; j < 7 ; j++) {
|
|
| 2900 |
+ cell = row.createCell(j); |
|
| 2901 |
+ cell.setCellStyle(style); |
|
| 2902 |
+ if(j==0) cell.setCellValue(i+1); //번호 |
|
| 2903 |
+ if(j==1) cell.setCellValue(((MjonMsgVO)payUserList.get(i)).getRegDate()); //결제일시 |
|
| 2904 |
+ if(j==2) cell.setCellValue(msgType); //문자유형 |
|
| 2905 |
+ if(j==3) cell.setCellValue(((MjonMsgVO)payUserList.get(i)).getSuccSendCnt()); //발송건수 |
|
| 2906 |
+ if(j==4) cell.setCellValue(((MjonMsgVO)payUserList.get(i)).getSmsTxt()); //내용 |
|
| 2907 |
+ if(j==5) cell.setCellValue(((MjonMsgVO)payUserList.get(i)).getSuccSendPrice()); //충전 - 충전금 |
|
| 2908 |
+ if(j==6) cell.setCellValue(0); //충전 - 포인트 |
|
| 2909 |
+ /*if(j==7) cell.setCellValue(totPrice); //사용 - 충전금 |
|
| 2910 |
+ if(j==8) cell.setCellValue(0); //사용 - 포인트 |
|
| 2911 |
+ if(j==9) cell.setCellValue(thisPoint); //잔액 - 충전금 |
|
| 2912 |
+ if(j==10) cell.setCellValue(befPoint); //잔액 - 포인트 |
|
| 2913 |
+*/ } |
|
| 2914 |
+ } |
|
| 2915 |
+ } |
|
| 2916 |
+ response.setHeader("Set-Cookie", "fileDownload=true; path=/");
|
|
| 2917 |
+ SimpleDateFormat mSimpleDateFormat = new SimpleDateFormat ( "yyyy_MM_dd_HH_mm_ss", Locale.KOREA ); |
|
| 2918 |
+ Date currentTime = new Date (); |
|
| 2919 |
+ String mTime = mSimpleDateFormat.format ( currentTime ); |
|
| 2920 |
+ fileName = fileName+"("+mTime+")";
|
|
| 2921 |
+ |
|
| 2922 |
+ response.setHeader("Content-Disposition", String.format("attachment; filename=\""+new String((fileName).getBytes("KSC5601"),"8859_1")+".xlsx"));
|
|
| 2923 |
+ wb.write(response.getOutputStream()); |
|
| 2924 |
+ }catch(Exception e) {
|
|
| 2925 |
+ response.setHeader("Set-Cookie", "fileDownload=false; path=/");
|
|
| 2926 |
+ response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
|
|
| 2927 |
+ response.setHeader("Content-Type","text/html; charset=utf-8");
|
|
| 2928 |
+ OutputStream out = null; |
|
| 2929 |
+ try {
|
|
| 2930 |
+ out = response.getOutputStream(); |
|
| 2931 |
+ byte[] data = new String("fail..").getBytes();
|
|
| 2932 |
+ out.write(data, 0, data.length); |
|
| 2933 |
+ } catch(Exception ignore) {
|
|
| 2934 |
+ ignore.printStackTrace(); |
|
| 2935 |
+ } finally {
|
|
| 2936 |
+ if(out != null) try { out.close(); } catch(Exception ignore) {}
|
|
| 2937 |
+ } |
|
| 2938 |
+ }finally {
|
|
| 2939 |
+ // 디스크 적었던 임시파일을 제거합니다. |
|
| 2940 |
+ wb.dispose(); |
|
| 2941 |
+ try { wb.close(); } catch(Exception ignore) {}
|
|
| 2942 |
+ } |
|
| 2943 |
+ } |
|
| 2944 |
+ |
|
| 2681 | 2945 |
|
| 2682 | 2946 |
|
| 2683 | 2947 |
/** |
--- src/main/webapp/WEB-INF/jsp/web/pay/PayUserSWListAjax.jsp
+++ src/main/webapp/WEB-INF/jsp/web/pay/PayUserSWListAjax.jsp
... | ... | @@ -71,7 +71,7 @@ |
| 71 | 71 |
|
| 72 | 72 |
var frm = document.listForm; |
| 73 | 73 |
frm.method = "post"; |
| 74 |
- frm.action = "/web/member/pay/PayUserListExcelDownload.do"; |
|
| 74 |
+ frm.action = "/web/member/pay/PayUserSWListExcelDownload.do"; |
|
| 75 | 75 |
frm.submit(); |
| 76 | 76 |
}); |
| 77 | 77 |
}); |
... | ... | @@ -185,7 +185,7 @@ |
| 185 | 185 |
|
| 186 | 186 |
$("#listForm").attr("target","msgSentPdfPrint");
|
| 187 | 187 |
window.open('', 'msgSentPdfPrint', 'width='+ popup_wid +', height='+ popup_ht +', left=' + popup_left + ', top='+ popup_top +',scrollbars=1');
|
| 188 |
- $("#listForm").attr({"action":"/web/member/pay/PayPdfListPopUpAjax.do", "method":"post"}).submit();
|
|
| 188 |
+ $("#listForm").attr({"action":"/web/member/pay/PayPdfSWListPopUpAjax.do", "method":"post"}).submit();
|
|
| 189 | 189 |
} |
| 190 | 190 |
|
| 191 | 191 |
//체크박스 전체선택/해제 |
... | ... | @@ -219,9 +219,9 @@ |
| 219 | 219 |
<colgroup> |
| 220 | 220 |
<%-- <col style="width: 5%;"> --%> |
| 221 | 221 |
<col style="width: *%;"> |
| 222 |
- <col style="width: 9%;"> |
|
| 223 |
- <col style="width: 9%;"> |
|
| 224 |
- <col style="width: 9%;"> |
|
| 222 |
+ <col style="width: 15%;"> |
|
| 223 |
+ <col style="width: 15%;"> |
|
| 224 |
+ <col style="width: 15%;"> |
|
| 225 | 225 |
<col style="width: 20%;"> |
| 226 | 226 |
<col style="width: 20%;"> |
| 227 | 227 |
<%-- <col style="width: 10%;"> |
... | ... | @@ -248,18 +248,18 @@ |
| 248 | 248 |
</div> |
| 249 | 249 |
</th> |
| 250 | 250 |
<th rowspan="2">내용</th> |
| 251 |
- <th rowspan="2">발송건수<br/> 성공 / 실패</th> |
|
| 251 |
+ <th rowspan="2">발송건수</th> |
|
| 252 | 252 |
<!-- <th colspan="2">충전</th> |
| 253 | 253 |
<th colspan="2">사용</th> |
| 254 | 254 |
<th colspan="2">잔액</th> --> |
| 255 |
- <th>사용</th> |
|
| 256 |
- <th>반환(실패)</th> |
|
| 255 |
+ <th colspan="2">사용</th> |
|
| 256 |
+ <!-- <th>반환(실패)</th> --> |
|
| 257 | 257 |
<!-- <th colspan="2">잔액</th> --> |
| 258 | 258 |
</tr> |
| 259 | 259 |
<tr> |
| 260 | 260 |
<th>캐시</th> |
| 261 |
- <!-- <th>포인트</th> --> |
|
| 262 |
- <th>캐시</th> |
|
| 261 |
+ <th>포인트</th> |
|
| 262 |
+ <!-- <th>캐시</th> --> |
|
| 263 | 263 |
<!-- <th>포인트</th> --> |
| 264 | 264 |
<!-- <th>충전금</th> |
| 265 | 265 |
<th>포인트</th> --> |
... | ... | @@ -337,18 +337,19 @@ |
| 337 | 337 |
<c:out value="${succCash}"/>
|
| 338 | 338 |
</p> |
| 339 | 339 |
</td> |
| 340 |
- <%-- <td> |
|
| 341 |
- <p> |
|
| 342 |
- <fmt:formatNumber type="number" maxFractionDigits="3" value="${payUserInfo.befPoint}" var="befPoint" />
|
|
| 343 |
- <c:out value="${befPoint}"/>
|
|
| 344 |
- </p> |
|
| 345 |
- </td> --%> |
|
| 346 | 340 |
<td> |
| 341 |
+ <p> |
|
| 342 |
+ <%-- <fmt:formatNumber type="number" maxFractionDigits="3" value="${payUserInfo.befPoint}" var="befPoint" />
|
|
| 343 |
+ <c:out value="${befPoint}"/> --%>
|
|
| 344 |
+ 0 |
|
| 345 |
+ </p> |
|
| 346 |
+ </td> |
|
| 347 |
+ <%-- <td> |
|
| 347 | 348 |
<p class="fwRg c_002c9a"> |
| 348 | 349 |
<fmt:formatNumber type="number" maxFractionDigits="3" value="${payUserInfo.failSendPrice}" var="failPrice" />
|
| 349 | 350 |
<c:out value="${failPrice}"/>
|
| 350 | 351 |
</p> |
| 351 |
- </td> |
|
| 352 |
+ </td> --%> |
|
| 352 | 353 |
<!-- <td> |
| 353 | 354 |
<p class="fwRg c_002c9a"> |
| 354 | 355 |
0 |
+++ src/main/webapp/WEB-INF/jsp/web/pay/PrintPayUserSWListPdfPopUp.jsp
... | ... | @@ -0,0 +1,270 @@ |
| 1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | |
| 2 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
| 3 | +<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> | |
| 4 | +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> | |
| 5 | +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> | |
| 6 | +<%@ page import="itn.com.cmm.LoginVO" %> | |
| 7 | +<!DOCTYPE html> | |
| 8 | +<html lang="ko"> | |
| 9 | + <head> | |
| 10 | + <meta charset="UTF-8"> | |
| 11 | + <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| 12 | + <title>요금 사용내역</title> | |
| 13 | + <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@100;300;400;500;700;900&display=swap" rel="stylesheet"> | |
| 14 | + <link rel="stylesheet" href="/publish/css/reset.css"> | |
| 15 | + <link rel="stylesheet" href="/publish/css/common.css"> | |
| 16 | + <link rel="stylesheet" href="/publish/css/estimate.css"> | |
| 17 | + <link rel="stylesheet" href="/publish/css/font.css"> | |
| 18 | + <link rel="stylesheet" href="/publish/css/button.css"> | |
| 19 | + <script type="text/javascript" src="/publish/js/jquery-3.5.0.js"></script> | |
| 20 | + <script type="text/javascript" src="/js/jsPdf/bluebird.min.js"></script> | |
| 21 | + <script type="text/javascript" src="/js/jsPdf/html2canvas.js"></script> | |
| 22 | + <script type="text/javascript" src="/js/jsPdf/jspdf.min.js"></script> | |
| 23 | + | |
| 24 | + </head> | |
| 25 | + <script type="text/javascript"> | |
| 26 | + | |
| 27 | + $(document).ready(function() { | |
| 28 | + $('.savePdf').click(function() { // pdf저장 button id | |
| 29 | + | |
| 30 | + var HTML_Width = $(".pdfPage").width(); | |
| 31 | + var HTML_Height = $(".pdfPage").height(); | |
| 32 | + var top_left_margin = 15; | |
| 33 | + var PDF_Width = HTML_Width+(top_left_margin*2); | |
| 34 | + var PDF_Height = (PDF_Width*1.5)+(top_left_margin*2); | |
| 35 | + var canvas_image_width = HTML_Width; | |
| 36 | + var canvas_image_height = HTML_Height; | |
| 37 | + | |
| 38 | + var totalPDFPages = Math.ceil(HTML_Height/PDF_Height)-1; | |
| 39 | + | |
| 40 | + //이미지 생성시 스크롤이 있는경우 스크롤을 상단으로 이동 시킨 후 캡쳐를 진행하도록 한다. | |
| 41 | + html2canvas($(".pdfPage")[0],{allowTaint:true, | |
| 42 | + scrollX: 0, | |
| 43 | + scrollY: -window.scrollY, | |
| 44 | + windowWidth: document.documentElement.offsetWidth, | |
| 45 | + windowHeight: document.documentElement.offsetHeight}).then(function(canvas) { | |
| 46 | + canvas.getContext('2d'); | |
| 47 | + | |
| 48 | + var imgData = canvas.toDataURL("image/jpeg", 1.0); | |
| 49 | + var pdf = new jsPDF('p', 'pt', [PDF_Width, PDF_Height]); | |
| 50 | + pdf.addImage(imgData, 'JPG', top_left_margin, top_left_margin,canvas_image_width,canvas_image_height); | |
| 51 | + | |
| 52 | + //1페이지 이상인 경우 추가 페이지 처리 | |
| 53 | + if(totalPDFPages >= 1){ | |
| 54 | + for (var i = 1; i <= totalPDFPages; i++) { | |
| 55 | + pdf.addPage(PDF_Width, PDF_Height); | |
| 56 | + pdf.addImage(imgData, 'JPG', top_left_margin, -(PDF_Height*i)+(top_left_margin*4),canvas_image_width,canvas_image_height); | |
| 57 | + } | |
| 58 | + } | |
| 59 | + | |
| 60 | + var strDate = nowDate(); | |
| 61 | + pdf.save('요금 사용내역_' + strDate + '.pdf'); | |
| 62 | + }); | |
| 63 | + | |
| 64 | + }); | |
| 65 | + }); | |
| 66 | + | |
| 67 | + //현재 날짜를 반환해주는 함수 | |
| 68 | + function nowDate(){ | |
| 69 | + var today = new Date(); | |
| 70 | + var year = today.getFullYear(); | |
| 71 | + var month = today.getMonth() + 1; //월은 0부터 시작하므로 1을 더해준다. | |
| 72 | + var day = today.getDate(); | |
| 73 | + var nowDate = year + "" + month+ "" + day; | |
| 74 | + return nowDate; | |
| 75 | + } | |
| 76 | + | |
| 77 | + </script> | |
| 78 | + <body> | |
| 79 | + <!-- 견적서 --> | |
| 80 | + <div class="estimate_wrap pdfPage" id="pdfPage"> | |
| 81 | + <div class="estimate"> | |
| 82 | + <div class="est_head clearfix"> | |
| 83 | + <img src="/publish/images/CI.png" alt="문자온 CI"> | |
| 84 | + <div class="clearfix"> | |
| 85 | + <p>(12248) 경기도 남양주시 다산순환로 20, A동 735호(다산동, 현대프리미어캠퍼스)</p> | |
| 86 | + <p>TEL 010-8432-9333</p> | |
| 87 | + </div> | |
| 88 | + </div> | |
| 89 | + <div class="est_body"> | |
| 90 | + <h2>요금 사용내역</h2> | |
| 91 | + <div class="cont1 tb_ver2"> | |
| 92 | + <div> | |
| 93 | + <table class="est_table"> | |
| 94 | + <caption>발신자 정보</caption> | |
| 95 | + <colgroup> | |
| 96 | + <col style="width: 50px;"> | |
| 97 | + <col style="width: auto;"> | |
| 98 | + </colgroup> | |
| 99 | + <tbody> | |
| 100 | + <tr> | |
| 101 | + <th></th> | |
| 102 | + <td colspan="2" class="colspan"> | |
| 103 | + <span><c:out value="${userNm}"/></span> 님의 사용내역을 아래와 같이 확인합니다. | |
| 104 | + </td> | |
| 105 | + </tr> | |
| 106 | + </tbody> | |
| 107 | + </table> | |
| 108 | + </div> | |
| 109 | + </div> | |
| 110 | + <div class="cont3"> | |
| 111 | + <div class="est_table2_wrap"> | |
| 112 | + <table class="est_table2"> | |
| 113 | + <caption>사용날짜, 문자유형, 문자내용, 충전 충전금, 충전 포인트, 사용 충전금, 사용 포인트, 잔액 충전금, 잔액 포인트를 제공하는 표</caption> | |
| 114 | + <colgroup> | |
| 115 | + <col style="width: 15%;"> | |
| 116 | + <col style="width: 10%;"> | |
| 117 | + <col style="width: 15%;"> | |
| 118 | + <col style="width: 15%;"> | |
| 119 | + <col style="width: 10%;"> | |
| 120 | + <%-- <col style="width: 10%;"> --%> | |
| 121 | + <%-- <col style="width: 15%;"> | |
| 122 | + <col style="width: 10%;"> --%> | |
| 123 | + </colgroup> | |
| 124 | + <thead> | |
| 125 | + <tr> | |
| 126 | + <th><span style="position:relative;display:block;top:17px;background:#f2f2f2;">날짜</span></th> | |
| 127 | + <th><span style="position:relative;display:block;top:17px;background:#f2f2f2;">문자유형</span></th> | |
| 128 | + <th><span style="position:relative;display:block;top:17px;background:#f2f2f2;">발송건수</span></th> | |
| 129 | + <!-- <th colspan="2">충전</th> --> | |
| 130 | + <th colspan="2">사용</th> | |
| 131 | + <!-- <th colspan="2">잔액</th> --> | |
| 132 | + </tr> | |
| 133 | + <tr> | |
| 134 | + <th></th> | |
| 135 | + <th></th> | |
| 136 | + <th></th> | |
| 137 | + <th>충전금</th> | |
| 138 | + <th>포인트</th> | |
| 139 | + <!-- <th>충전금</th> | |
| 140 | + <th>포인트</th> | |
| 141 | + <th>충전금</th> | |
| 142 | + <th>포인트</th> --> | |
| 143 | + </tr> | |
| 144 | + </thead> | |
| 145 | + <tbody> | |
| 146 | + <c:choose> | |
| 147 | + <c:when test="${not empty payUserList}"> | |
| 148 | + <c:forEach var="payUserInfo" items="${payUserList}" varStatus="status"> | |
| 149 | + <tr> | |
| 150 | + <td> | |
| 151 | + <c:out value="${payUserInfo.regDate}"/> | |
| 152 | + </td> | |
| 153 | + <td> | |
| 154 | + <p style="text-align:center;"> | |
| 155 | + <c:choose> | |
| 156 | + <c:when test="${payUserInfo.msgTypeTxt eq '6' && payUserInfo.fileCnt eq 0 }"> | |
| 157 | + 장문 | |
| 158 | + </c:when> | |
| 159 | + <c:when test="${payUserInfo.msgTypeTxt eq '6' && payUserInfo.fileCnt ne 0 }"> | |
| 160 | + 그림 | |
| 161 | + </c:when> | |
| 162 | + <c:when test="${payUserInfo.msgTypeTxt eq '8'}"> | |
| 163 | + 알림톡 | |
| 164 | + </c:when> | |
| 165 | + <c:when test="${payUserInfo.msgTypeTxt eq '9'}"> | |
| 166 | + 친구톡 | |
| 167 | + </c:when> | |
| 168 | + <c:when test="${payUserInfo.msgTypeTxt eq 'fax'}"> | |
| 169 | + 팩스 | |
| 170 | + </c:when> | |
| 171 | + <c:otherwise> | |
| 172 | + 단문 | |
| 173 | + </c:otherwise> | |
| 174 | + </c:choose> | |
| 175 | + </p> | |
| 176 | + </td> | |
| 177 | + <td> | |
| 178 | + <c:out value="${payUserInfo.succSendCnt}"/> | |
| 179 | + <c:if test="${payUserInfo.msgTypeTxt eq 'fax'}"> | |
| 180 | + (<c:out value="${payUserInfo.fileCnt}"/>) | |
| 181 | + </c:if> | |
| 182 | + <%-- <c:out value="${payUserInfo.sendCount}"/> | |
| 183 | + <c:if test="${payUserInfo.msgTypeTxt eq 'fax'}"> | |
| 184 | + (<c:out value="${payUserInfo.fileCnt}"/>) | |
| 185 | + </c:if> --%> | |
| 186 | + </td> | |
| 187 | + <%-- <td> | |
| 188 | + <p> | |
| 189 | + <fmt:formatNumber type="number" maxFractionDigits="3" value="${payUserInfo.befCash}" var="befCash" /> | |
| 190 | + <c:out value="${befCash}"/> | |
| 191 | + </p> | |
| 192 | + </td> | |
| 193 | + <td> | |
| 194 | + <p> | |
| 195 | + <c:out value="${payUserInfo.befPoint}"/> | |
| 196 | + </p> | |
| 197 | + </td> --%> | |
| 198 | + <td> | |
| 199 | + <p class="fwRg c_002c9a" style="text-align:center;"> | |
| 200 | + <fmt:formatNumber type="number" maxFractionDigits="3" value="${payUserInfo.succSendPrice}" var="succCash" /> | |
| 201 | + <c:out value="${succCash}"/> | |
| 202 | + </p> | |
| 203 | + </td> | |
| 204 | + <td> | |
| 205 | + <p class="fwRg c_002c9a" style="text-align:center;"> | |
| 206 | + 0 | |
| 207 | + </p> | |
| 208 | + </td> | |
| 209 | + <%-- <td> | |
| 210 | + <p class="fwRg c_222"> | |
| 211 | + <fmt:formatNumber type="number" maxFractionDigits="3" value="${payUserInfo.thisPoint}" var="thisPoint" /> | |
| 212 | + <c:out value="${thisPoint}"/> | |
| 213 | + </p> | |
| 214 | + </td> | |
| 215 | + <td> | |
| 216 | + <p class="fwRg c_222"> | |
| 217 | + <c:out value="${payUserInfo.befPoint}"/> | |
| 218 | + </p> | |
| 219 | + </td> --%> | |
| 220 | + </tr> | |
| 221 | + </c:forEach> | |
| 222 | + </c:when> | |
| 223 | + <c:otherwise> | |
| 224 | + <tr> | |
| 225 | + <td colspan="5"> | |
| 226 | + 사용내역이 없습니다. | |
| 227 | + </td> | |
| 228 | + </tr> | |
| 229 | + </c:otherwise> | |
| 230 | + </c:choose> | |
| 231 | + </tbody> | |
| 232 | + </table> | |
| 233 | + </div> | |
| 234 | + </div> | |
| 235 | + <div class="cont4"> | |
| 236 | + <table class="est_table"> | |
| 237 | + <caption>공급가액, 부가세, 총 결제금액에 대한 표</caption> | |
| 238 | + <colgroup> | |
| 239 | + <col style="width: 64px;"> | |
| 240 | + <col style="width: auto;"> | |
| 241 | + </colgroup> | |
| 242 | + <tbody> | |
| 243 | + <tr> | |
| 244 | + <th>대표번호</th> | |
| 245 | + <td>010-8432-9333</td> | |
| 246 | + </tr> | |
| 247 | + <tr> | |
| 248 | + <th>이메일</th> | |
| 249 | + <td>help@iten.co.kr</td> | |
| 250 | + </tr> | |
| 251 | + </tbody> | |
| 252 | + </table> | |
| 253 | + </div> | |
| 254 | + <div class="cont5"> | |
| 255 | + <p><span><c:out value="${year}"/></span> 년 <span><c:out value="${month}"/></span> 월 <span><c:out value="${day}"/></span> 일</p> | |
| 256 | + <div> | |
| 257 | + <span>주식회사 아이티앤 대표이사</span> | |
| 258 | + <span>유 인 식</span> | |
| 259 | + <span class="big_stamp"><img src="/publish/images/content/big_stamp.png"></span> | |
| 260 | + </div> | |
| 261 | + </div> | |
| 262 | + </div> | |
| 263 | + </div> | |
| 264 | + </div> | |
| 265 | + <div class="est_btn_wrap" id="est_btn_wrap"> | |
| 266 | + <button type="button" class="btnType savePdf" ><i class="print_img"></i>pdf저장</button> | |
| 267 | + </div> | |
| 268 | + <!--// 견적서 --> | |
| 269 | + </body> | |
| 270 | +</html> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?