From 6d711bfc5cb1aa2a4980ea6f7e6ef6e9064704a0 Mon Sep 17 00:00:00 2001 From: jungpyo Date: Wed, 14 Jan 2026 16:09:33 +0900 Subject: [PATCH] =?UTF-8?q?[=EC=9D=B4=EC=A0=95=ED=91=9C]=20=EA=B2=AC?= =?UTF-8?q?=EC=A0=81=EC=84=9C=20PDF=202=EC=B0=A8=EC=A0=90=20=EA=B0=80?= =?UTF-8?q?=EA=B2=A9=20=EC=88=A8=EA=B9=80=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../qcast/biz/estimate/EstimateService.java | 68 +++++++------------ 1 file changed, 26 insertions(+), 42 deletions(-) diff --git a/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java b/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java index 50da5e35..fcf9c4fe 100644 --- a/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java +++ b/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java @@ -1335,8 +1335,18 @@ public class EstimateService { } try { + // 견적서 상세 조회 estimateResponse = estimateMapper.selectEstimatePdfDetail(estimateRequest); + + // 1차점이 2차점 견적서를 만들어 준 경우 - 2차점 사용자가 다운받을 시 무조건 정가로만 표시 + String userId = estimateRequest.getUserId(); + String storeLvl = estimateRequest.getStoreLvl(); + if (storeLvl != null && !storeLvl.equals("1")) { + if (!Objects.equals(estimateResponse.getCreateSaleStoreId(), userId)) { + estimateRequest.setSchUnitPriceFlg("1"); + } + } // file Name 명이 없는경우 if (estimateRequest.getFileName() == null || "".equals(estimateRequest.getFileName())) { @@ -1662,26 +1672,14 @@ public class EstimateService { String[] arrSection = new String[6]; int iSection = 0; - String templateFilePath = "pdf_download_quotation_detail_template.html"; - - - String userId = estimateRequest.getUserId(); - String storeLvl = estimateRequest.getStoreLvl(); - String createStoreId = estimateRequest.getCreateStoreId(); - String hiddenYn = "N"; - if(storeLvl != null && !storeLvl.equals("1")){ - if(!Objects.equals(estimateResponse.getCreateSaleStoreId(), userId)) { - hiddenYn = "Y"; - //templateFilePath = "pdf_download_quotation_detail_template2.html"; - } - } + String templateFilePath = "pdf_download_quotation_detail_template.html"; // 템플릿 html 조회 Document doc = PdfUtil.getPdfDoc(request, templateFilePath); // 견적서 상세 pdf Html 생성 - doc = this.estimatePdfHtml(doc, estimateResponse, estimateItemList, hiddenYn); + doc = this.estimatePdfHtml(doc, estimateResponse, estimateItemList); // 발전시뮬레이션 pdf Html 생성 doc = pwrGnrSimService.pwrGnrSimPdfHtml(doc, pwrGnrSimResponse); @@ -1723,16 +1721,6 @@ public class EstimateService { String excelTemplateNam = "excel_download_quotation_detail_template.xlsx"; - String userId = estimateRequest.getUserId(); - String storeLvl = estimateRequest.getStoreLvl(); - String createStoreId = estimateRequest.getCreateStoreId(); - if(storeLvl != null && !storeLvl.equals("1")){ - if(!Objects.equals(estimateResponse.getCreateSaleStoreId(), userId)) - excelTemplateNam = "excel_download_quotation_detail_template2.xlsx"; - } - - - // itemGroup이 "STAND_"가 아닌 항목들만 필터링하여 새로운 리스트 생성 List estimateItemList15 = estimateItemList.stream() .filter(item -> !"STAND_".equals(item.getItemGroup())) @@ -2075,7 +2063,7 @@ public class EstimateService { * @throws IOException * @throws QcastException */ - public Document estimatePdfHtml(Document doc, EstimateResponse data, List list, String hiddenYn) + public Document estimatePdfHtml(Document doc, EstimateResponse data, List list) throws IOException, QcastException { Element elm; @@ -2128,10 +2116,8 @@ public class EstimateService { elm = doc.getElementById("totVolKw1"); elm.text(StringUtils.defaultString(data.getTotVolKw())); - if (!"Y".equals(hiddenYn)) { - elm = doc.getElementById("totPrice"); - elm.text(StringUtils.defaultString(data.getTotPrice())); - } + elm = doc.getElementById("totPrice"); + elm.text(StringUtils.defaultString(data.getTotPrice())); StringBuilder sb = new StringBuilder(); for (ItemResponse itemResponse : list) { @@ -2144,14 +2130,14 @@ public class EstimateService { + ""); sb.append( "" - + ((!"Y".equals(hiddenYn)) ? StringUtils.defaultString(itemResponse.getSalePrice()) : "") + + StringUtils.defaultString(itemResponse.getSalePrice()) + ""); sb.append("" + StringUtils.defaultString(itemResponse.getAmount()) + ""); sb.append( "" + StringUtils.defaultString(itemResponse.getUnit()) + ""); sb.append("" - + ((!"Y".equals(hiddenYn)) ? StringUtils.defaultString(itemResponse.getSaleTotPrice()) : "") + ""); + + StringUtils.defaultString(itemResponse.getSaleTotPrice()) + ""); sb.append(""); } if ("Y".equals(data.getPkgYn())) { @@ -2165,22 +2151,20 @@ public class EstimateService { + StringUtils.defaultString(data.getTotVol()) + ""); sb.append("W"); sb.append("" - + ((!"Y".equals(hiddenYn)) ? StringUtils.defaultString(data.getPkgTotPrice()) : "") + ""); + + StringUtils.defaultString(data.getPkgTotPrice()) + ""); sb.append(""); } elm = doc.getElementById("itemList_detail"); elm.before(sb.toString()); + + elm = doc.getElementById("supplyPrice"); + elm.text(StringUtils.defaultString(data.getSupplyPrice())); - if (!"Y".equals(hiddenYn)) { - elm = doc.getElementById("supplyPrice"); - elm.text(StringUtils.defaultString(data.getSupplyPrice())); - - elm = doc.getElementById("vatPrice"); - elm.text(StringUtils.defaultString(data.getVatPrice())); - - elm = doc.getElementById("totPrice1"); - elm.text(StringUtils.defaultString(data.getTotPrice())); - } + elm = doc.getElementById("vatPrice"); + elm.text(StringUtils.defaultString(data.getVatPrice())); + + elm = doc.getElementById("totPrice1"); + elm.text(StringUtils.defaultString(data.getTotPrice())); if (!StringUtils.isEmpty(data.getRemarks())) { elm = doc.getElementById("remarks");