엑셀/PDF 다운로드시 구분값 추가

This commit is contained in:
DESKTOP-6ARNG1Q\dlsgk 2024-11-21 09:54:20 +09:00
parent 11c9cbe49a
commit 9cf28ad5f5
2 changed files with 32 additions and 24 deletions

View File

@ -9,7 +9,6 @@ import com.interplug.qcast.biz.object.ObjectMapper;
import com.interplug.qcast.biz.object.dto.ObjectRequest;
import com.interplug.qcast.biz.object.dto.ObjectResponse;
import com.interplug.qcast.biz.pwrGnrSimulation.PwrGnrSimService;
import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimGuideResponse;
import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimRequest;
import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimResponse;
import com.interplug.qcast.config.Exception.ErrorCode;
@ -938,11 +937,11 @@ public class EstimateService {
if (pwrGnrSimResponse != null) {
try {
// 발전시뮬레이션 안내사항 조회
PwrGnrSimGuideResponse pwrGnrSimGuideInfo =
pwrGnrSimService.selectPwrGnrSimulationGuideInfo();
if (pwrGnrSimGuideInfo != null) {
pwrGnrSimResponse.setGuideInfo(pwrGnrSimGuideInfo.getData());
}
// PwrGnrSimGuideResponse pwrGnrSimGuideInfo =
// pwrGnrSimService.selectPwrGnrSimulationGuideInfo();
// if (pwrGnrSimGuideInfo != null) {
// pwrGnrSimResponse.setGuideInfo(pwrGnrSimGuideInfo.getData());
// }
} catch (Exception e) {
}
}
@ -958,26 +957,36 @@ public class EstimateService {
// 템플릿 html 조회
Document doc = PdfUtil.getPdfDoc(request, templateFilePath);
// 삭제하려는 element
Element elm;
arrSection[iSection] = "div.section1";
iSection++;
arrSection[iSection] = "div.section2";
iSection++;
// 견적서 상세 pdf Html 생성
doc = this.estimatePdfHtml(doc, estimateResponse, estimateItemList);
if ("1".equals(estimateRequest.getSchDrawingFlg())) {
arrSection[iSection] = "div.section3";
iSection++;
arrSection[iSection] = "div.section4";
iSection++;
arrSection[iSection] = "div.section5";
// 발전시뮬레이션 pdf Html 생성
doc = pwrGnrSimService.pwrGnrSimPdfHtml(doc, pwrGnrSimResponse);
// 발전시뮬레이션 pdf Html 생성
doc = pwrGnrSimService.pwrGnrSimPdfHtml(doc, pwrGnrSimResponse);
// SchDrawingFlg 1 : 전체 , 2 : 견적서, 3 : 발전시뮬레이션, 4 : 도면
if ("1".equals(estimateRequest.getSchDrawingFlg())) {
arrSection[iSection] = "div.section1";
iSection++;
arrSection[iSection] = "div.section2";
iSection++;
arrSection[iSection] = "div.section3"; // 발전시뮬레이션
iSection++;
arrSection[iSection] = "div.section4"; // 도면
iSection++;
arrSection[iSection] = "div.section5"; // 도면
} else if ("2".equals(estimateRequest.getSchDrawingFlg())) {
arrSection[iSection] = "div.section1";
iSection++;
arrSection[iSection] = "div.section2";
} else if ("3".equals(estimateRequest.getSchDrawingFlg())) {
arrSection[iSection] = "div.section3"; // 발전시뮬레이션
} else if ("4".equals(estimateRequest.getSchDrawingFlg())) {
arrSection[iSection] = "div.section4"; // 도면
iSection++;
arrSection[iSection] = "div.section5"; // 도면
} else {
throw new QcastException(
ErrorCode.NOT_FOUND, message.getMessage("common.message.no.data"));
}
// pdf 다운로드

View File

@ -1513,8 +1513,7 @@ public class PwrGnrSimService {
// 예측발전량
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 13; i++) {
sb.append(
"<td>" + StringUtils.defaultString(String.format("%,d", pwrGnrSimList[i])) + "</td>");
sb.append("<td>" + StringUtils.defaultString(pwrGnrSimList[i]) + "</td>");
}
elm = doc.getElementById("frcPwrGnrList_detail");