Compare commits
3 Commits
4ec934438b
...
78861015db
| Author | SHA1 | Date | |
|---|---|---|---|
| 78861015db | |||
| 586fcb7ae0 | |||
| 293a1a3a82 |
@ -1664,19 +1664,23 @@ public class EstimateService {
|
|||||||
|
|
||||||
String templateFilePath = "pdf_download_quotation_detail_template.html";
|
String templateFilePath = "pdf_download_quotation_detail_template.html";
|
||||||
|
|
||||||
|
|
||||||
String userId = estimateRequest.getUserId();
|
String userId = estimateRequest.getUserId();
|
||||||
String storeLvl = estimateRequest.getStoreLvl();
|
String storeLvl = estimateRequest.getStoreLvl();
|
||||||
String createStoreId = estimateRequest.getCreateStoreId();
|
String createStoreId = estimateRequest.getCreateStoreId();
|
||||||
|
String hiddenYn = "N";
|
||||||
if(storeLvl != null && !storeLvl.equals("1")){
|
if(storeLvl != null && !storeLvl.equals("1")){
|
||||||
if(!Objects.equals(estimateResponse.getCreateSaleStoreId(), userId))
|
if(!Objects.equals(estimateResponse.getCreateSaleStoreId(), userId))
|
||||||
templateFilePath = "pdf_download_quotation_detail_template2.html";
|
hiddenYn = 'Y';
|
||||||
|
//templateFilePath = "pdf_download_quotation_detail_template2.html";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 템플릿 html 조회
|
// 템플릿 html 조회
|
||||||
Document doc = PdfUtil.getPdfDoc(request, templateFilePath);
|
Document doc = PdfUtil.getPdfDoc(request, templateFilePath);
|
||||||
|
|
||||||
// 견적서 상세 pdf Html 생성
|
// 견적서 상세 pdf Html 생성
|
||||||
doc = this.estimatePdfHtml(doc, estimateResponse, estimateItemList);
|
doc = this.estimatePdfHtml(doc, estimateResponse, estimateItemList, hiddenYn);
|
||||||
|
|
||||||
// 발전시뮬레이션 pdf Html 생성
|
// 발전시뮬레이션 pdf Html 생성
|
||||||
doc = pwrGnrSimService.pwrGnrSimPdfHtml(doc, pwrGnrSimResponse);
|
doc = pwrGnrSimService.pwrGnrSimPdfHtml(doc, pwrGnrSimResponse);
|
||||||
@ -2070,7 +2074,7 @@ public class EstimateService {
|
|||||||
* @throws IOException
|
* @throws IOException
|
||||||
* @throws QcastException
|
* @throws QcastException
|
||||||
*/
|
*/
|
||||||
public Document estimatePdfHtml(Document doc, EstimateResponse data, List<ItemResponse> list)
|
public Document estimatePdfHtml(Document doc, EstimateResponse data, List<ItemResponse> list, String hiddenYn)
|
||||||
throws IOException, QcastException {
|
throws IOException, QcastException {
|
||||||
|
|
||||||
Element elm;
|
Element elm;
|
||||||
@ -2123,8 +2127,10 @@ public class EstimateService {
|
|||||||
elm = doc.getElementById("totVolKw1");
|
elm = doc.getElementById("totVolKw1");
|
||||||
elm.text(StringUtils.defaultString(data.getTotVolKw()));
|
elm.text(StringUtils.defaultString(data.getTotVolKw()));
|
||||||
|
|
||||||
elm = doc.getElementById("totPrice");
|
if (!"Y".equals(hiddenYn)) {
|
||||||
elm.text(StringUtils.defaultString(data.getTotPrice()));
|
elm = doc.getElementById("totPrice");
|
||||||
|
elm.text(StringUtils.defaultString(data.getTotPrice()));
|
||||||
|
}
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
for (ItemResponse itemResponse : list) {
|
for (ItemResponse itemResponse : list) {
|
||||||
@ -2137,14 +2143,14 @@ public class EstimateService {
|
|||||||
+ "</td>");
|
+ "</td>");
|
||||||
sb.append(
|
sb.append(
|
||||||
"<td class='hide-column' style='width:80px;text-align:right;'>"
|
"<td class='hide-column' style='width:80px;text-align:right;'>"
|
||||||
+ StringUtils.defaultString(itemResponse.getSalePrice())
|
+ !"Y".equals(hiddenYn) ? StringUtils.defaultString(itemResponse.getSalePrice()) : ""
|
||||||
+ "</td>");
|
+ "</td>");
|
||||||
sb.append("<td style='width:60px;text-align:right;'>"
|
sb.append("<td style='width:60px;text-align:right;'>"
|
||||||
+ StringUtils.defaultString(itemResponse.getAmount()) + "</td>");
|
+ StringUtils.defaultString(itemResponse.getAmount()) + "</td>");
|
||||||
sb.append(
|
sb.append(
|
||||||
"<td style='width:60px;'>" + StringUtils.defaultString(itemResponse.getUnit()) + "</td>");
|
"<td style='width:60px;'>" + StringUtils.defaultString(itemResponse.getUnit()) + "</td>");
|
||||||
sb.append("<td class='hide-column' style='width:80px;text-align:right;'>"
|
sb.append("<td class='hide-column' style='width:80px;text-align:right;'>"
|
||||||
+ StringUtils.defaultString(itemResponse.getSaleTotPrice()) + "</td>");
|
+ !"Y".equals(hiddenYn) ? StringUtils.defaultString(itemResponse.getSaleTotPrice()) : "" + "</td>");
|
||||||
sb.append("</tr>");
|
sb.append("</tr>");
|
||||||
}
|
}
|
||||||
if ("Y".equals(data.getPkgYn())) {
|
if ("Y".equals(data.getPkgYn())) {
|
||||||
@ -2158,20 +2164,22 @@ public class EstimateService {
|
|||||||
+ StringUtils.defaultString(data.getTotVol()) + "</td>");
|
+ StringUtils.defaultString(data.getTotVol()) + "</td>");
|
||||||
sb.append("<td style='width:60px;'>W</td>");
|
sb.append("<td style='width:60px;'>W</td>");
|
||||||
sb.append("<td style='width:80px;text-align:right;'>"
|
sb.append("<td style='width:80px;text-align:right;'>"
|
||||||
+ StringUtils.defaultString(data.getPkgTotPrice()) + "</td>");
|
+ !"Y".equals(hiddenYn) ? StringUtils.defaultString(data.getPkgTotPrice()) : "" + "</td>");
|
||||||
sb.append("</tr>");
|
sb.append("</tr>");
|
||||||
}
|
}
|
||||||
elm = doc.getElementById("itemList_detail");
|
elm = doc.getElementById("itemList_detail");
|
||||||
elm.before(sb.toString());
|
elm.before(sb.toString());
|
||||||
|
|
||||||
elm = doc.getElementById("supplyPrice");
|
if (!"Y".equals(hiddenYn)) {
|
||||||
elm.text(StringUtils.defaultString(data.getSupplyPrice()));
|
elm = doc.getElementById("supplyPrice");
|
||||||
|
elm.text(StringUtils.defaultString(data.getSupplyPrice()));
|
||||||
elm = doc.getElementById("vatPrice");
|
|
||||||
elm.text(StringUtils.defaultString(data.getVatPrice()));
|
elm = doc.getElementById("vatPrice");
|
||||||
|
elm.text(StringUtils.defaultString(data.getVatPrice()));
|
||||||
elm = doc.getElementById("totPrice1");
|
|
||||||
elm.text(StringUtils.defaultString(data.getTotPrice()));
|
elm = doc.getElementById("totPrice1");
|
||||||
|
elm.text(StringUtils.defaultString(data.getTotPrice()));
|
||||||
|
}
|
||||||
|
|
||||||
if (!StringUtils.isEmpty(data.getRemarks())) {
|
if (!StringUtils.isEmpty(data.getRemarks())) {
|
||||||
elm = doc.getElementById("remarks");
|
elm = doc.getElementById("remarks");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user