From 28321f12f4cb343977d1f2cc639a104b0f488282 Mon Sep 17 00:00:00 2001 From: zxcxz2002 Date: Mon, 30 Jan 2023 13:09:25 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=91=EC=85=80=20=EB=8B=A4=EC=9A=B4=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 26 --- .../mobile/website/biz/dto/SellInfoDto.java | 20 +- .../website/biz/service/SellInfoService.java | 2 + .../biz/service/impl/SellInfoServiceImpl.java | 158 ++++++++++++++++ .../controller/home/SellInfoController.java | 125 ++++++++++++- .../home/api/ApiSellInfoController.java | 1 + .../static/res/front/css/default.css | 9 + .../static/res/front/js/biz/common/common.js | 7 +- .../static/res/front/js/biz/sell/add.js | 7 +- .../static/res/front/js/biz/sell/info.js | 107 ++++++++++- src/main/webapp/WEB-INF/view/sell/add.jsp | 175 +++++++++--------- .../webapp/WEB-INF/view/sell/excel/info.jsp | 164 ++++++++++++++++ src/main/webapp/WEB-INF/view/sell/info.jsp | 134 +++++++------- 13 files changed, 746 insertions(+), 189 deletions(-) create mode 100644 src/main/webapp/WEB-INF/view/sell/excel/info.jsp diff --git a/pom.xml b/pom.xml index 5187bfb..b8c5134 100644 --- a/pom.xml +++ b/pom.xml @@ -215,7 +215,6 @@ javax.servlet jstl - 1.2 taglibs @@ -278,31 +277,6 @@ - - - javax.servlet - jstl - - - - - org.projectlombok lombok diff --git a/src/main/java/com/ns/mobile/website/biz/dto/SellInfoDto.java b/src/main/java/com/ns/mobile/website/biz/dto/SellInfoDto.java index b00c047..a42f930 100644 --- a/src/main/java/com/ns/mobile/website/biz/dto/SellInfoDto.java +++ b/src/main/java/com/ns/mobile/website/biz/dto/SellInfoDto.java @@ -95,7 +95,25 @@ public class SellInfoDto extends BaseDto{ return sellInfoDto; } - + public String getPayBackYnText() { + if(payBack == 0) { + return ""; + }else { + if(payBackYn) { + return "지급완료"; + }else { + return "지급대기"; + } + } + } + public String getPhoneNumberText() { + String regEx = "(\\d{3})(\\d{3,4})(\\d{4})"; + return phoneNumber.replaceAll(regEx, "$1-$2-$3"); + } + public String getPphoneNumberText() { + String regEx = "(\\d{3})(\\d{3,4})(\\d{4})"; + return pphoneNumber.replaceAll(regEx, "$1-$2-$3"); + } public String getInsertTypeText(){ switch(insertType) { case "move": diff --git a/src/main/java/com/ns/mobile/website/biz/service/SellInfoService.java b/src/main/java/com/ns/mobile/website/biz/service/SellInfoService.java index 34c7818..3217547 100644 --- a/src/main/java/com/ns/mobile/website/biz/service/SellInfoService.java +++ b/src/main/java/com/ns/mobile/website/biz/service/SellInfoService.java @@ -12,4 +12,6 @@ public interface SellInfoService { public SellAddInfoModel getSellAddInfo(); public void insertSellAdd(SellAddInfoParameter parameter); + + public void sellExcelDownload(); } diff --git a/src/main/java/com/ns/mobile/website/biz/service/impl/SellInfoServiceImpl.java b/src/main/java/com/ns/mobile/website/biz/service/impl/SellInfoServiceImpl.java index ad751f2..ecab588 100644 --- a/src/main/java/com/ns/mobile/website/biz/service/impl/SellInfoServiceImpl.java +++ b/src/main/java/com/ns/mobile/website/biz/service/impl/SellInfoServiceImpl.java @@ -1,11 +1,27 @@ package com.ns.mobile.website.biz.service.impl; +import java.io.File; +import java.io.FileOutputStream; import java.time.LocalDate; import java.time.YearMonth; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.List; +import org.apache.poi.hssf.usermodel.HSSFFont; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.BorderStyle; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.xssf.usermodel.XSSFCell; +import org.apache.poi.xssf.usermodel.XSSFFont; +import org.apache.poi.xssf.usermodel.XSSFRow; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springframework.stereotype.Service; import com.ns.mobile.website.biz.dto.SellInfoDto; @@ -124,4 +140,146 @@ public class SellInfoServiceImpl implements SellInfoService{ sellInfoRepository.save(sellInfo); } + @Override + public void sellExcelDownload() { + + } +// @Override +// public void sellExcelDownload() { +// //.xls 확장자 지원 +// HSSFWorkbook wb = null; +// HSSFSheet sheet = null; +// Row row = null; +// Cell cell = null; +// +// //.xlsx 확장자 지원 +// XSSFWorkbook xssfWb = null; // .xlsx +// XSSFSheet xssfSheet = null; // .xlsx +// XSSFRow xssfRow = null; // .xlsx +// XSSFCell xssfCell = null;// .xlsx +// +// try { +// int rowNo = 0; // 행 갯수 +// // 워크북 생성 +// xssfWb = new XSSFWorkbook(); +// xssfSheet = xssfWb.createSheet("엑셀 테스트"); // 워크시트 이름 +// +// //헤더용 폰트 스타일 +// XSSFFont font = xssfWb.createFont(); +// font.setFontName(HSSFFont.FONT_ARIAL); //폰트스타일 +// font.setFontHeightInPoints((short)14); //폰트크기 +// font.setBold(true); //Bold 유무 +// +// //테이블 타이틀 스타일 +// CellStyle cellStyle_Title = xssfWb.createCellStyle(); +// +// xssfSheet.setColumnWidth(3, (xssfSheet.getColumnWidth(3))+(short)2048); // 3번째 컬럼 넓이 조절 +// xssfSheet.setColumnWidth(4, (xssfSheet.getColumnWidth(4))+(short)2048); // 4번째 컬럼 넓이 조절 +// xssfSheet.setColumnWidth(5, (xssfSheet.getColumnWidth(5))+(short)2048); // 5번째 컬럼 넓이 조절 +// +// xssfSheet.setColumnWidth(8, (xssfSheet.getColumnWidth(8))+(short)4096); // 8번째 컬럼 넓이 조절 +// +// cellStyle_Title.setFont(font); // cellStle에 font를 적용 +// cellStyle_Title.setAlignment(HorizontalAlignment.CENTER); // 정렬 +// +// //셀병합 +// xssfSheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 8)); //첫행, 마지막행, 첫열, 마지막열( 0번째 행의 0~8번째 컬럼을 병합한다) +// //타이틀 생성 +// xssfRow = xssfSheet.createRow(rowNo++); //행 객체 추가 +// xssfCell = xssfRow.createCell((short) 0); // 추가한 행에 셀 객체 추가 +// xssfCell.setCellStyle(cellStyle_Title); // 셀에 스타일 지정 +// xssfCell.setCellValue("타이틀 입니다."); // 데이터 입력 +// +// xssfRow = xssfSheet.createRow(rowNo++); // 빈행 추가 +// +// CellStyle cellStyle_Body = xssfWb.createCellStyle(); +// cellStyle_Body.setAlignment(HorizontalAlignment.LEFT); +// +// //헤더 생성 +// xssfSheet.addMergedRegion(new CellRangeAddress(rowNo, rowNo, 0, 1)); //첫행,마지막행,첫열,마지막열 +// xssfRow = xssfSheet.createRow(rowNo++); //헤더 01 +// xssfCell = xssfRow.createCell((short) 0); +// xssfCell.setCellStyle(cellStyle_Body); +// xssfCell.setCellValue("헤더01 셀01"); +// xssfCell = xssfRow.createCell((short) 8); +// xssfCell.setCellStyle(cellStyle_Body); +// xssfCell.setCellValue("헤더01 셀08"); +// xssfRow = xssfSheet.createRow(rowNo++); //헤더 02 +// xssfCell = xssfRow.createCell((short) 0); +// xssfCell.setCellStyle(cellStyle_Body); +// xssfCell.setCellValue("헤더02 셀01"); +// xssfCell = xssfRow.createCell((short) 8); +// xssfCell.setCellStyle(cellStyle_Body); +// xssfCell.setCellValue("헤더02 셀08"); +// xssfRow = xssfSheet.createRow(rowNo++); //헤더 03 +// xssfCell = xssfRow.createCell((short) 0); +// xssfCell.setCellStyle(cellStyle_Body); +// xssfCell.setCellValue("헤더03 셀01"); +// xssfCell = xssfRow.createCell((short) 8); +// xssfCell.setCellStyle(cellStyle_Body); +// xssfCell.setCellValue("헤더03 셀08"); +// xssfRow = xssfSheet.createRow(rowNo++); //헤더 04 +// xssfCell = xssfRow.createCell((short) 0); +// xssfCell.setCellStyle(cellStyle_Body); +// xssfCell.setCellValue("헤더04 셀01"); +// xssfCell = xssfRow.createCell((short) 8); +// xssfCell.setCellStyle(cellStyle_Body); +// xssfCell.setCellValue("헤더04 셀08"); +// +// //테이블 스타일 설정 +// CellStyle cellStyle_Table_Center = xssfWb.createCellStyle(); +// cellStyle_Table_Center.setBorderTop(BorderStyle.THIN); //테두리 위쪽 +// cellStyle_Table_Center.setBorderBottom(BorderStyle.THIN); //테두리 아래쪽 +// cellStyle_Table_Center.setBorderLeft(BorderStyle.THIN); //테두리 왼쪽 +// cellStyle_Table_Center.setBorderRight(BorderStyle.THIN); //테두리 오른쪽 +// cellStyle_Table_Center.setAlignment(HorizontalAlignment.CENTER); +// +// xssfRow = xssfSheet.createRow(rowNo++); +// xssfCell = xssfRow.createCell((short) 0); +// xssfCell.setCellStyle(cellStyle_Table_Center); +// xssfCell.setCellValue("테이블 셀1"); +// xssfCell = xssfRow.createCell((short) 1); +// xssfCell.setCellStyle(cellStyle_Table_Center); +// xssfCell.setCellValue("테이블 셀2"); +// xssfCell = xssfRow.createCell((short) 2); +// xssfCell.setCellStyle(cellStyle_Table_Center); +// xssfCell.setCellValue("테이블 셀3"); +// xssfCell = xssfRow.createCell((short) 3); +// xssfCell.setCellStyle(cellStyle_Table_Center); +// xssfCell.setCellValue("테이블 셀4"); +// xssfCell = xssfRow.createCell((short) 4); +// xssfCell.setCellStyle(cellStyle_Table_Center); +// xssfCell.setCellValue("테이블 셀5"); +// xssfCell = xssfRow.createCell((short) 5); +// xssfCell.setCellStyle(cellStyle_Table_Center); +// xssfCell.setCellValue("테이블 셀6"); +// xssfCell = xssfRow.createCell((short) 6); +// xssfCell.setCellStyle(cellStyle_Table_Center); +// xssfCell.setCellValue("테이블 셀7"); +// xssfCell = xssfRow.createCell((short) 7); +// xssfCell.setCellStyle(cellStyle_Table_Center); +// xssfCell.setCellValue("테이블 셀8"); +// xssfCell = xssfRow.createCell((short) 8); +// xssfCell.setCellStyle(cellStyle_Table_Center); +// xssfCell.setCellValue("테이블 셀9"); +// +// String localFile = "D:\\Desktop\\" + "테스트_엑셀" + ".xlsx"; +// File file = new File(localFile); +// FileOutputStream fos = null; +// fos = new FileOutputStream(file); +// xssfWb.write(fos); +// +// if (xssfWb != null) xssfWb.close(); +// if (fos != null) fos.close(); +// +// //ctx.put("FILENAME", "입고상세출력_"+ mapList.get(0).get("PRINT_DATE")); +// //if(file != null) file.deleteOnExit(); +// } +// catch(Exception e){ +// +// }finally{ +// +// } +// } + } diff --git a/src/main/java/com/ns/mobile/website/web/controller/home/SellInfoController.java b/src/main/java/com/ns/mobile/website/web/controller/home/SellInfoController.java index 7403e5a..8eb90dc 100644 --- a/src/main/java/com/ns/mobile/website/web/controller/home/SellInfoController.java +++ b/src/main/java/com/ns/mobile/website/web/controller/home/SellInfoController.java @@ -1,12 +1,26 @@ package com.ns.mobile.website.web.controller.home; +import java.net.URLEncoder; +import java.util.Calendar; +import java.util.Date; + import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import org.apache.poi.hssf.usermodel.HSSFDataFormat; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.CreationHelper; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.json.JSONArray; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import com.ns.mobile.website.biz.service.SellInfoService; import com.ns.mobile.website.web.auth.PublicAccess; @@ -22,7 +36,7 @@ public class SellInfoController extends BaseController { private final LaneduProperties laneduProperties; @Autowired - private SellInfoService sellService; + private SellInfoService sellInfoService; @PublicAccess @RequestMapping(value = {"sell/info"}) @@ -40,7 +54,116 @@ public class SellInfoController extends BaseController { return "sell/add"; } + @PublicAccess + @RequestMapping(value = {"sell/excel/info"}) + String excelInfo(Model model, HttpServletRequest request, HttpSession session + ) { + model.addAttribute("version", laneduProperties.getVersion()); + return "sell/excel/info"; + } + @PublicAccess + @RequestMapping(value = {"sell/excel/download.do"}) + public void excelDown(HttpServletRequest request, HttpServletResponse response, + @RequestParam(value = "title") String title, @RequestParam(value = "contents") String contents, + @RequestParam(value = "name") String name, @RequestParam(value = "rows") String rows, + @RequestParam(value = "columns") String columns) throws Exception{ + + try { + + // request로 json 데이터 받기 String으로 받아 json으로 변환 + JSONArray dataArry = new JSONArray(contents); + String[] myTitle = title.split(","); + + // 로우 파라미터 int로 변환 + int myRows = Integer.parseInt(rows); + + // 컬럼 파라미터 int로 변환 + int myColumns = Integer.parseInt(columns); + + // Workbook 생성 + XSSFWorkbook xlsWb = new XSSFWorkbook(); // Excel 2007 이전 버전 + + // Sheet 생성 + Sheet sheet1 = xlsWb.createSheet(name); + Row row = null; + Cell cell = null; + + row = sheet1.createRow(0); + + // excel 파일 저장 + for (int r = 0; r < myRows; r++) { + + // 셀 제목 설정 + if (r == 0) { + + for (int c = 0; c < myColumns; c++) { + + cell = row.createCell(c); + cell.setCellValue(myTitle[c]); + + } + } + + row = sheet1.createRow(r + 1); // 두번째줄을 생성(i+1) + + for (int c = 0; c < myColumns; c++) { + + cell = row.createCell(c); + if(!dataArry.getJSONObject(r).getString(myTitle[c]).equals("0")) { + if(myTitle[c].equals("개통일")) { + CellStyle formatCs = xlsWb.createCellStyle(); + CreationHelper createHelper = xlsWb.getCreationHelper(); + formatCs.setDataFormat( + createHelper.createDataFormat().getFormat("MM월dd일")); + Calendar date1 = Calendar.getInstance(); + int yyyy = Integer.parseInt(dataArry.getJSONObject(r).getString(myTitle[c]).substring(0,4)); + int MM = Integer.parseInt(dataArry.getJSONObject(r).getString(myTitle[c]).substring(4,6))-1; + int dd = Integer.parseInt(dataArry.getJSONObject(r).getString(myTitle[c]).substring(6,8)); + date1.set(yyyy, MM, dd); + cell.setCellValue(date1); + cell.setCellStyle(formatCs); + }else if(myTitle[c].equals("정산금액") || myTitle[c].equals("세금") || myTitle[c].equals("실마진")) { + Long money = Long.parseLong(dataArry.getJSONObject(r).getString(myTitle[c]).replaceAll(",", "")); + cell.setCellValue(money); + }else { + cell.setCellValue(dataArry.getJSONObject(r).getString(myTitle[c])); + } + }else { + cell.setCellValue(""); + } + + } + + } + + // 브라우저 별 한글 인코딩 + String header = request.getHeader("User-Agent"); + if (header.contains("MSIE") || header.contains("Trident")) { // IE 11버전부터 Trident로 변경되었기때문에 추가해준다. + name = URLEncoder.encode(name, "UTF-8").replaceAll("\\+", "%20"); + response.setHeader("Content-Disposition", "attachment;filename=" + name + ".xls;"); + } else if (header.contains("Chrome")) { + name = new String(name.getBytes("UTF-8"), "ISO-8859-1"); + response.setHeader("Content-Disposition", "attachment; filename=\"" + name + "\".xls"); + } else if (header.contains("Opera")) { + name = new String(name.getBytes("UTF-8"), "ISO-8859-1"); + response.setHeader("Content-Disposition", "attachment; filename=\"" + name + "\".xls"); + } else if (header.contains("Firefox")) { + name = new String(name.getBytes("UTF-8"), "ISO-8859-1"); + response.setHeader("Content-Disposition", "attachment; filename=\"" + name + "\".xls"); + } + + // 엑셀 출력 + xlsWb.write(response.getOutputStream()); + xlsWb.close(); + System.out.println("Excel 출력 완료"); + } catch (Exception e) { + e.printStackTrace(); + response.setHeader("Set-Cookie", "fileDownload=false; path=/"); + System.out.println("Excel 출력 실패"); + } + + } } diff --git a/src/main/java/com/ns/mobile/website/web/controller/home/api/ApiSellInfoController.java b/src/main/java/com/ns/mobile/website/web/controller/home/api/ApiSellInfoController.java index dc60091..f49eef9 100644 --- a/src/main/java/com/ns/mobile/website/web/controller/home/api/ApiSellInfoController.java +++ b/src/main/java/com/ns/mobile/website/web/controller/home/api/ApiSellInfoController.java @@ -47,6 +47,7 @@ public class ApiSellInfoController extends BaseController { sellInfoService.insertSellAdd(parameter); return ResponseResult.success(); } + // // @PublicAccess // @PostMapping("/api/phone/detail.api") diff --git a/src/main/resources/static/res/front/css/default.css b/src/main/resources/static/res/front/css/default.css index f164af2..5ccdb50 100644 --- a/src/main/resources/static/res/front/css/default.css +++ b/src/main/resources/static/res/front/css/default.css @@ -25,6 +25,15 @@ #container { min-width: 100vw; } +.one-line-table thead > tr > th{ + white-space:nowrap; +} +.one-line-table tbody > tr > th{ + white-space:nowrap; +} +.one-line-table tbody > tr > td{ + white-space:nowrap; +} body.sb-sidenav-toggled #wrapper #sidebar-wrapper { margin-left: 0; diff --git a/src/main/resources/static/res/front/js/biz/common/common.js b/src/main/resources/static/res/front/js/biz/common/common.js index d37ec48..61db865 100644 --- a/src/main/resources/static/res/front/js/biz/common/common.js +++ b/src/main/resources/static/res/front/js/biz/common/common.js @@ -324,11 +324,13 @@ function moneyText(value){ return moneyText(value,'N'); } function moneyText(value,numYn){ - if(numYn == 'N') + if(numYn == 'N' || numYn == undefined) value = Number(value.replaceAll(',', '')); - if(value < 999){ + if((0 < value && value < 999) || value == ""){ value = value*10000; + }else{ + value = Number(value); } if(isNaN(value)) { //NaN인지 판별 @@ -338,6 +340,7 @@ function moneyText(value,numYn){ return formatValue; } } + //Toggle Menu 버튼 window.addEventListener('DOMContentLoaded', event => { diff --git a/src/main/resources/static/res/front/js/biz/sell/add.js b/src/main/resources/static/res/front/js/biz/sell/add.js index 4aff44c..f54445e 100644 --- a/src/main/resources/static/res/front/js/biz/sell/add.js +++ b/src/main/resources/static/res/front/js/biz/sell/add.js @@ -28,7 +28,7 @@ let appVue = new Vue({ installment: '0', phoneId: '', insertType: 'change', - usim: '0', + usim: '', formula: '', faceValueRebate: '', guestMoney: '', @@ -46,6 +46,7 @@ let appVue = new Vue({ }, mounted: function () { this.init(); +document.body.classList.toggle('sb-sidenav-toggled'); }, computed: {}, updated: function(){ @@ -128,7 +129,7 @@ let appVue = new Vue({ alert('출고가를 입력하세요'); return false; } - if($this.disclosureSubsidy != '' || $this.disclosureSubsidy != 0){ + if($this.disclosureSubsidy != '' || $this.disclosureSubsidy != 0 || $this.disclosureSubsidy != '0'){ $this.disclosureSubsidyYn = true; } @@ -174,7 +175,7 @@ let appVue = new Vue({ return false; } alert("저장 되었습니다."); - //location.reload(); + location.reload(); }); }, openingDayBlur: function (){ diff --git a/src/main/resources/static/res/front/js/biz/sell/info.js b/src/main/resources/static/res/front/js/biz/sell/info.js index c73c83f..2981b7d 100644 --- a/src/main/resources/static/res/front/js/biz/sell/info.js +++ b/src/main/resources/static/res/front/js/biz/sell/info.js @@ -75,10 +75,8 @@ let appVue = new Vue({ }, getSettlementAmount: function(x){ //(액면리베이트+고객현금)-(현금수납+유심비+수수료) = 정산금액 - var fees = 0; - if(x.insertType == 'move'){ - fees = 800; - } + let $this = this; + let fees = $this.getFees(x); var settlementAmount = (x.faceValueRebate+x.guestMoney) - (x.cashRebate+x.usim+fees); return moneyText(settlementAmount,'Y'); @@ -114,10 +112,8 @@ let appVue = new Vue({ getBondIssuanceAmount: function(x){ //(액면리베이트+추가리베이트+유심)-(현금수납+수수료+차감) = 채권발생액 //차감없음 let $this = this; - var fees = 0; - if(x.insertType == 'move'){ - fees = 800; - } + let fees = $this.getFees(x); + var settlementAmount = Number($this.getSettlementAmount(x).replaceAll(',','')); var bondIssuanceAmount = ((settlementAmount + x.addRebate + x.usim)-(x.guestMoney+fees)); @@ -131,6 +127,12 @@ let appVue = new Vue({ return moneyText(realBondIssuanceAmount,'Y'); }, + getinstallmentPrincipal: function(x){ + //출고가-공시지원금 = 할부원금 + let $this = this; + var installmentPrincipal = x.factoryPrice - x.disclosureSubsidy; + return moneyText(installmentPrincipal,'Y'); + }, searchDateBlur: function (){ let $this = this; @@ -140,6 +142,95 @@ let appVue = new Vue({ else if($this.searchDate.length == 4){ $this.searchDate = '20' + $this.searchDate; } + }, + getFees: function (x){ + var fees = 0; + if(x.insertType == 'move'){ + fees = 800; + } + return fees; + }, + getSubPlan: function (x,i){ + var fullText = x.subRatePlan; + var subPlanList = fullText.split(','); + if(subPlanList.length > i){ + if(i==2){ + var temp = ''; + for(var j=2;j tbody > tr").length; + var columns = $("table > thead > tr > th").length; + if (rows < 2) { + alert("엑셀파일로 저장할 데이터가 없습니다."); + return; + } + var dataParam = $this.tableToJson(myTable); + var myTitle = dataParam[0].toString(); + var myContents = dataParam[1]; + var name = "판매일보"; + var form = "
"; + form += ""; + form += ""; + form += ""; + form += ""; + form += ""; + form += "
"; + + jQuery(form).appendTo("body").submit().remove(); + } + }, + tableToJson: function(table) { + var myRows = []; + var title = []; + var $headers = table.find('th'); + table.find('th').each(function(index, item) { + title[index] = $(item).html(); + }); + + var $rows = table.find('tbody tr').each( + function(index) { + $cells = $(this).find("td"); + myRows[index] = {}; + $cells.each(function(cellIndex) { + myRows[index][$($headers[cellIndex]).html()] = $( + this).html(); + }); + }); + + var myObj = {}; + myObj = myRows; + + var myJson = JSON.stringify(myObj); + return [ title, myJson ]; } } }); \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/view/sell/add.jsp b/src/main/webapp/WEB-INF/view/sell/add.jsp index 5481c39..1ba2fc4 100644 --- a/src/main/webapp/WEB-INF/view/sell/add.jsp +++ b/src/main/webapp/WEB-INF/view/sell/add.jsp @@ -23,7 +23,7 @@

고객정보 등록

-
거래 정보
+
뒷면
@@ -33,7 +33,7 @@
@@ -42,42 +42,78 @@
+
+
+ +
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
+
고객정보 등록
- +
- +
- +
- +
- +
- +
@@ -85,33 +121,16 @@
개통정보
- -
- -
-
-
-
- -
- -
- -
- -
- @@ -120,94 +139,78 @@
+
+ +
+ +
+
+ +
+ +
+
+
- +
- +
- +
- -
-
- -
-
+
+ +
+ +
+
-
리베이트
+
기타
- +
- +
- +
- +
-
- -
- -
-
- -
- -
-
+
- +
- -
-
- -
- -
-
- -
- -
- -
-
- -
- -
-
- -
- -
- +
- @@ -216,7 +219,7 @@
- @@ -244,13 +247,13 @@
- +
- +
diff --git a/src/main/webapp/WEB-INF/view/sell/excel/info.jsp b/src/main/webapp/WEB-INF/view/sell/excel/info.jsp new file mode 100644 index 0000000..4452beb --- /dev/null +++ b/src/main/webapp/WEB-INF/view/sell/excel/info.jsp @@ -0,0 +1,164 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> + + + + + + + +
+ + + + + +
+ + + + +
+
+
+

조회 할 달1

+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
연번개통일거래처통신사명의자주민번호개통번호고객종류법대법대 전화번호할부개월펫네임일련번호가입구분부가서비스1부가서비스2부가서비스3요금제유지기간변경일액면R/B추가R/B고객현금차감차감내용현금수납 or 유선상품권유심비수수료정산금액세금치팅비(삐삐)소개비P/B지급예정일자지급여부중간마진세금키핑실마진채권발생액현금영수증출고가공시지원금할부원금리베이트 계산입금 계좌참고할 내용실채권입금액세금키핑
{{x.id}}{{changeDateFormat(x.openingDate,'yyyyMMdd')}}{{info.businessPartnerList[x.businessPartner-1].partnerName}}{{info.businessPartnerList[x.businessPartner-1].carrierName}}{{x.name}}{{changeDateFormat(x.birthday,'yyyyMMdd').substring(2,8)}}{{x.phoneNumberText}} {{x.pname}}{{changeDateFormat(x.pbirthday,'yyyyMMdd').substring(2,8)}}{{x.pphoneNumberText}}{{x.installment}}{{info.phoneList[x.phoneId-1].petName}}{{x.serialNumber}}{{x.insertTypeText}}{{getSubPlan(x,0)}}{{getSubPlan(x,1)}}{{getSubPlan(x,2)}}{{x.mainRatePlan}}{{getMaintenancePeriod(x)}}{{getChangeDay(x)}}{{callMoneyText(x.faceValueRebate)}}{{callMoneyText(x.addRebate)}}{{callMoneyText(x.guestMoney)}}00{{callMoneyText(x.cashRebate)}}{{callMoneyText(x.usim)}}{{getFees(x)}}{{getSettlementAmount(x)}}{{getTex(x)}}{{callMoneyText(x.introductionPay)}}{{callMoneyText(x.payBack)}}{{x.payBackYnText}}{{getMiddleMargin(x)}}{{getRealMargin(x)}}{{getBondIssuanceAmount(x)}}{{callMoneyText(x.factoryPrice)}}{{callMoneyText(x.disclosureSubsidy)}}{{getinstallmentPrincipal(x)}}{{x.formula}}{{x.payBackBank}} {{x.payBackBankNumber}}{{getRealBondIssuanceAmount(x)}}
+
+
+
+
+ + + + diff --git a/src/main/webapp/WEB-INF/view/sell/info.jsp b/src/main/webapp/WEB-INF/view/sell/info.jsp index f0789c6..81bb4dc 100644 --- a/src/main/webapp/WEB-INF/view/sell/info.jsp +++ b/src/main/webapp/WEB-INF/view/sell/info.jsp @@ -32,72 +32,82 @@
- +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#개통일이름생년월일핸드폰번호거래처모델명일련번호가입구분부가가입여부리베이트부가차감금액현금수납금액채권발생액실마진
{{x.id}}{{x.openingDate}}{{x.name}}{{x.birthday}}{{x.phoneNumber}}{{info.businessPartnerList[x.businessPartner-1].partnerName}}{{info.phoneList[x.phoneId-1].petName}}{{x.serialNumber}}{{x.insertTypeText}}{{x.subRatePlan}}{{callMoneyText(x.faceValueRebate)}}{{callMoneyText(x.cashRebate)}}{{getBondIssuanceAmount(x)}}{{getRealMargin(x)}}
합계{{view.bondIssuanceAmountSum}}{{view.realMarginSum}}
- - + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#개통일이름생년월일핸드폰번호거래처모델명일련번호가입구분부가가입여부리베이트부가차감금액현금수납금액채권발생액실마진실마진실마진실마진
{{x.id}}{{x.openingDate}}{{x.name}}{{x.birthday}}{{x.phoneNumber}}{{info.businessPartnerList[x.businessPartner-1].partnerName}}{{info.phoneList[x.phoneId-1].petName}}{{x.serialNumber}}{{x.insertTypeText}}{{x.subRatePlan}}{{callMoneyText(x.faceValueRebate)}}{{callMoneyText(x.cashRebate)}}{{getBondIssuanceAmount(x)}}{{getRealMargin(x)}}{{getRealMargin(x)}}{{getRealMargin(x)}}{{getRealMargin(x)}}
합계{{view.bondIssuanceAmountSum}}{{view.realMarginSum}}{{view.realMarginSum}}{{view.realMarginSum}}{{view.realMarginSum}}
+ +