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 875b87b3..aa57e894 100644 --- a/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java +++ b/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java @@ -1664,19 +1664,23 @@ public class EstimateService { 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)) - templateFilePath = "pdf_download_quotation_detail_template2.html"; + hiddenYn = 'Y'; + //templateFilePath = "pdf_download_quotation_detail_template2.html"; } + // 템플릿 html 조회 Document doc = PdfUtil.getPdfDoc(request, templateFilePath); // 견적서 상세 pdf Html 생성 - doc = this.estimatePdfHtml(doc, estimateResponse, estimateItemList); + doc = this.estimatePdfHtml(doc, estimateResponse, estimateItemList, hiddenYn); // 발전시뮬레이션 pdf Html 생성 doc = pwrGnrSimService.pwrGnrSimPdfHtml(doc, pwrGnrSimResponse); @@ -2070,7 +2074,7 @@ public class EstimateService { * @throws IOException * @throws QcastException */ - public Document estimatePdfHtml(Document doc, EstimateResponse data, List list) + public Document estimatePdfHtml(Document doc, EstimateResponse data, List list, String hiddenYn) throws IOException, QcastException { Element elm; @@ -2123,8 +2127,10 @@ public class EstimateService { elm = doc.getElementById("totVolKw1"); elm.text(StringUtils.defaultString(data.getTotVolKw())); - elm = doc.getElementById("totPrice"); - elm.text(StringUtils.defaultString(data.getTotPrice())); + if (!"Y".equals(hiddenYn)) { + elm = doc.getElementById("totPrice"); + elm.text(StringUtils.defaultString(data.getTotPrice())); + } StringBuilder sb = new StringBuilder(); for (ItemResponse itemResponse : list) { @@ -2137,14 +2143,14 @@ public class EstimateService { + ""); sb.append( "" - + StringUtils.defaultString(itemResponse.getSalePrice()) + + !"Y".equals(hiddenYn) ? StringUtils.defaultString(itemResponse.getSalePrice()) : "" + ""); sb.append("" + StringUtils.defaultString(itemResponse.getAmount()) + ""); sb.append( "" + StringUtils.defaultString(itemResponse.getUnit()) + ""); sb.append("" - + StringUtils.defaultString(itemResponse.getSaleTotPrice()) + ""); + + !"Y".equals(hiddenYn) ? StringUtils.defaultString(itemResponse.getSaleTotPrice()) : "" + ""); sb.append(""); } if ("Y".equals(data.getPkgYn())) { @@ -2158,20 +2164,22 @@ public class EstimateService { + StringUtils.defaultString(data.getTotVol()) + ""); sb.append("W"); sb.append("" - + StringUtils.defaultString(data.getPkgTotPrice()) + ""); + + !"Y".equals(hiddenYn) ? 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())); - - elm = doc.getElementById("vatPrice"); - elm.text(StringUtils.defaultString(data.getVatPrice())); - - elm = doc.getElementById("totPrice1"); - elm.text(StringUtils.defaultString(data.getTotPrice())); + 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())); + } if (!StringUtils.isEmpty(data.getRemarks())) { elm = doc.getElementById("remarks");