Compare commits
7 Commits
5fd6184f42
...
742ef88874
| Author | SHA1 | Date | |
|---|---|---|---|
| 742ef88874 | |||
| 393b5ace87 | |||
| 52d375c4b9 | |||
| 5599addfd3 | |||
| 4e023e7f9b | |||
| c76292e22e | |||
| 3ddc61b5f3 |
@ -9,6 +9,8 @@ import java.math.BigDecimal;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLDecoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@ -16,6 +18,7 @@ import java.util.stream.Collectors;
|
||||
import com.interplug.qcast.biz.canvaspopupstatus.CanvasPopupStatusService;
|
||||
import com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus;
|
||||
import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimRoofResponse;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.usermodel.WorkbookFactory;
|
||||
@ -26,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.util.HtmlUtils;
|
||||
import org.springframework.web.util.UriComponentsBuilder;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.interplug.qcast.biz.canvasStatus.CanvasStatusService;
|
||||
@ -1421,16 +1425,7 @@ public class EstimateService {
|
||||
|
||||
// 각도 매핑 함수 호출
|
||||
String mappedDegree = excelUtil.mapCompassDegree(degreeValue);
|
||||
// String compasDegImgUrl = frontUrl + "/static/images/canvas/deg/" + mappedDegree + ".png";
|
||||
|
||||
// URL url = new URL(compasDegImgUrl);
|
||||
// URLConnection con = url.openConnection();
|
||||
// HttpURLConnection exitCode = (HttpURLConnection)con;
|
||||
// if (exitCode.getResponseCode() == 200) {
|
||||
// InputStream imageInputStream = new URL(compasDegImgUrl).openStream();
|
||||
// byte[] degImg = Util.toByteArray(imageInputStream);
|
||||
// roofInfoResponse.setCompasDegImg(degImg);
|
||||
// }
|
||||
|
||||
try {
|
||||
// classpath에서 리소스 파일을 읽어옵니다
|
||||
@ -1469,6 +1464,31 @@ public class EstimateService {
|
||||
for (ItemResponse itemResponse : estimateItemList) {
|
||||
itemResponse.setNo(String.valueOf(j++));
|
||||
|
||||
// itemName 디코딩 및 HTML Unescape 처리
|
||||
String itemName = itemResponse.getItemName();
|
||||
if (StringUtils.isNotEmpty(itemName)) {
|
||||
try {
|
||||
// 1. URL 디코딩 (% 처리)
|
||||
if (itemName.contains("%")) {
|
||||
itemName = URLDecoder.decode(itemName, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
// 2. HTML Unescape 처리 (&가 포함된 경우만)
|
||||
// Φ1 -> Φ1 -> Φ1 순차적으로 복원
|
||||
if (itemName.contains("&")) {
|
||||
String prevName;
|
||||
do {
|
||||
prevName = itemName;
|
||||
itemName = HtmlUtils.htmlUnescape(itemName);
|
||||
} while (!prevName.equals(itemName) && itemName.contains("&"));
|
||||
}
|
||||
|
||||
itemResponse.setItemName(itemName);
|
||||
} catch (Exception e) {
|
||||
log.warn("Excel itemName processing failed: {}", itemName);
|
||||
}
|
||||
}
|
||||
|
||||
// 문자열 통화로 변환 처리
|
||||
itemResponse.setSalePrice(
|
||||
String.format("%1$,.0f", Double.parseDouble(itemResponse.getSalePrice())));
|
||||
@ -1571,13 +1591,7 @@ public class EstimateService {
|
||||
estimateResponse.setDrawingImg1(drawingImg1);
|
||||
}
|
||||
log.debug("url1 ::: {}", url);
|
||||
// File file = new File(drawingDirPath + File.separator + baseDrawingImgName + "_1.png");
|
||||
// if (file.exists()) {
|
||||
// InputStream imageInputStream =
|
||||
// new FileInputStream(drawingDirPath + File.separator + baseDrawingImgName + "_1.png");
|
||||
// byte[] drawingImg1 = Util.toByteArray(imageInputStream);
|
||||
// estimateResponse.setDrawingImg1(drawingImg1);
|
||||
// }
|
||||
|
||||
String baseDrawingImgName2 = estimateRequest.getObjectNo() + "_" + estimateRequest.getPlanNo();
|
||||
URL url2 = new URL(drawingDirPath + File.separator + baseDrawingImgName2 + "_2.png");
|
||||
URLConnection con2 = url2.openConnection();
|
||||
@ -1589,13 +1603,7 @@ public class EstimateService {
|
||||
estimateResponse.setDrawingImg2(drawingImg2);
|
||||
}
|
||||
log.debug("url2 ::: {}", url2);
|
||||
// file = new File(drawingDirPath + File.separator + baseDrawingImgName + "_2.png");
|
||||
// if (file.exists()) {
|
||||
// InputStream imageInputStream2 =
|
||||
// new FileInputStream(drawingDirPath + File.separator + baseDrawingImgName + "_2.png");
|
||||
// byte[] drawingImg2 = Util.toByteArray(imageInputStream2);
|
||||
// estimateResponse.setDrawingImg2(drawingImg2);
|
||||
// }
|
||||
|
||||
|
||||
//userId 에 따른 영업점 주소, 전화, fax 정보 조회
|
||||
if(estimateRequest.getSaleStoreId() != null && "T01".equals(estimateRequest.getSaleStoreId())){
|
||||
@ -1658,9 +1666,9 @@ public class EstimateService {
|
||||
|
||||
String userId = estimateRequest.getUserId();
|
||||
String storeLvl = estimateRequest.getStoreLvl();
|
||||
String saleStoreId = estimateRequest.getSaleStoreId();
|
||||
String createStoreId = estimateRequest.getCreateStoreId();
|
||||
if(storeLvl != null && storeLvl.equals("2")){
|
||||
if(!Objects.equals(Objects.requireNonNull(saleStoreId), userId))
|
||||
if(!Objects.equals(createStoreId, userId))
|
||||
templateFilePath = "pdf_download_quotation_detail_template2.html";
|
||||
}
|
||||
|
||||
@ -1709,15 +1717,17 @@ public class EstimateService {
|
||||
Workbook workbook = null;
|
||||
|
||||
String excelTemplateNam = "excel_download_quotation_detail_template.xlsx";
|
||||
|
||||
String userId = estimateRequest.getUserId();
|
||||
String storeLvl = estimateRequest.getStoreLvl();
|
||||
String saleStoreId = estimateRequest.getSaleStoreId();
|
||||
String createStoreId = estimateRequest.getCreateStoreId();
|
||||
if(storeLvl != null && storeLvl.equals("2")){
|
||||
if(!Objects.equals(Objects.requireNonNull(saleStoreId), userId))
|
||||
if(!Objects.equals(createStoreId, userId))
|
||||
excelTemplateNam = "excel_download_quotation_detail_template2.xlsx";
|
||||
}
|
||||
|
||||
|
||||
|
||||
// itemGroup이 "STAND_"가 아닌 항목들만 필터링하여 새로운 리스트 생성
|
||||
List<ItemResponse> estimateItemList15 = estimateItemList.stream()
|
||||
.filter(item -> !"STAND_".equals(item.getItemGroup()))
|
||||
@ -2125,13 +2135,15 @@ public class EstimateService {
|
||||
+ StringUtils.defaultString(itemResponse.getItemName()) + "</td>");
|
||||
sb.append("<td style='width:120px;'>" + StringUtils.defaultString(itemResponse.getItemNo())
|
||||
+ "</td>");
|
||||
sb.append("<td style='width:80px;text-align:right;'>"
|
||||
+ StringUtils.defaultString(itemResponse.getSalePrice()) + "</td>");
|
||||
sb.append(
|
||||
"<td class='hide-column' style='width:80px;text-align:right;'>"
|
||||
+ StringUtils.defaultString(itemResponse.getSalePrice())
|
||||
+ "</td>");
|
||||
sb.append("<td style='width:60px;text-align:right;'>"
|
||||
+ StringUtils.defaultString(itemResponse.getAmount()) + "</td>");
|
||||
sb.append(
|
||||
"<td style='width:60px;'>" + StringUtils.defaultString(itemResponse.getUnit()) + "</td>");
|
||||
sb.append("<td style='width:80px;text-align:right;'>"
|
||||
sb.append("<td class='hide-column' style='width:80px;text-align:right;'>"
|
||||
+ StringUtils.defaultString(itemResponse.getSaleTotPrice()) + "</td>");
|
||||
sb.append("</tr>");
|
||||
}
|
||||
|
||||
@ -219,4 +219,6 @@ public class EstimateRequest {
|
||||
@Schema(description = "판매점레벨")
|
||||
private String storeLvl;
|
||||
|
||||
@Schema(description = "견적서생성판매점코드")
|
||||
private String createStoreId;
|
||||
}
|
||||
|
||||
@ -395,7 +395,7 @@
|
||||
OR
|
||||
(QCAST_CUST_PRD_ID IS NULL AND PC_ITEM_ID = PE.ITEM_ID)
|
||||
OR
|
||||
(QCAST_CUST_PRD_ID IS NOT NULL AND QCAST_CUST_PRD_ID != PC_ITEM_ID AND PC_ITEM_ID = PE.ITEM_ID))), 0) AS MODULE_VOL_KW
|
||||
(QCAST_CUST_PRD_ID IS NOT NULL AND QCAST_CUST_PRD_ID != PC_ITEM_ID AND QCAST_CUST_PRD_ID = PE.ITEM_ID))), 0) AS MODULE_VOL_KW
|
||||
FROM T_PLAN P WITH (NOLOCK)
|
||||
INNER JOIN T_PART_ESTIMATE PE WITH (NOLOCK)
|
||||
ON P.OBJECT_NO = PE.OBJECT_NO
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
|
||||
<mapper namespace="com.interplug.qcast.biz.excelDown.ExcelDownMapper">
|
||||
<select id="selectQuotPlanExclDownData" parameterType="com.interplug.qcast.biz.excelDown.dto.QuotRequest"
|
||||
resultType="com.interplug.qcast.biz.excelDown.dto.QuotPlanResponse">
|
||||
@ -128,6 +129,8 @@
|
||||
, CONVERT(varchar, A.DRAWING_ESTIMATE_CREATE_DATE, 120) AS DRAWING_ESTIMATE_CREATE_DATE/* プラン見積作成日 */
|
||||
-->
|
||||
FROM T_OBJECT B
|
||||
LEFT OUTER JOIN T_OBJECT_INFO OI
|
||||
ON OI.OBJECT_NO = B.OBJECT_NO
|
||||
LEFT OUTER JOIN T_PLAN A
|
||||
ON A.OBJECT_NO = B.OBJECT_NO
|
||||
LEFT OUTER JOIN M_COMM_L C1
|
||||
@ -176,7 +179,7 @@
|
||||
LEFT OUTER JOIN M_SALES_STORE Y
|
||||
ON G.FIRST_AGENT_ID = Y.SALE_STORE_ID /*1차점정보*/
|
||||
WHERE A.DEL_FLG = 0
|
||||
AND B.DEL_FLG = 0
|
||||
AND (B.DEL_FLG = 0 OR (OI.SOURCE_ORIGIN = 'QCAST_III' AND OI.ORG_DEL_FLG = '0'))
|
||||
<if test="sch_startDt != null and sch_startDt != '' and sch_endDt != null and sch_endDt != ''"> <!-- 견적일 -->
|
||||
AND B.ESTIMATE_DETAIL_CREATE_DATE <![CDATA[>=]]> #{sch_startDt} + ' 00:00:00'
|
||||
AND B.ESTIMATE_DETAIL_CREATE_DATE <![CDATA[<=]]> #{sch_endDt} + ' 23:59:59'
|
||||
@ -224,6 +227,8 @@
|
||||
, D.FIRST_AGENT_FLG /* 一次代理店フラグ */
|
||||
-->
|
||||
FROM T_OBJECT C
|
||||
LEFT OUTER JOIN T_OBJECT_INFO OI
|
||||
ON OI.OBJECT_NO = C.OBJECT_NO
|
||||
LEFT OUTER JOIN M_SALES_STORE D
|
||||
ON C.SALE_STORE_ID = D.SALE_STORE_ID
|
||||
LEFT OUTER JOIN T_PLAN B
|
||||
@ -251,7 +256,7 @@
|
||||
LEFT OUTER JOIN M_BUSINESS_TEAM K
|
||||
ON J.BUSINESS_TEAM_CD = K.BUSINESS_TEAM_CD
|
||||
AND K.DEL_FLG = 0
|
||||
WHERE C.DEL_FLG = 0
|
||||
WHERE (C.DEL_FLG = 0 OR (OI.SOURCE_ORIGIN = 'QCAST_III' AND OI.ORG_DEL_FLG = '0'))
|
||||
AND D.DEL_FLG = 0
|
||||
AND B.DEL_FLG = 0
|
||||
<if test="sch_startDt != null and sch_startDt != '' and sch_endDt != null and sch_endDt != ''"> <!-- 견적일 -->
|
||||
|
||||
@ -390,6 +390,10 @@
|
||||
font-size: 8px;
|
||||
}
|
||||
|
||||
.hide-column {
|
||||
display: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@ -492,7 +496,7 @@
|
||||
<th style="width: 110px;">価格</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="itemList_detail2">
|
||||
<tbody id="itemList_detail" >
|
||||
<!-- <tr>-->
|
||||
<!-- <td>1</td>-->
|
||||
<!-- <td>Re.RISE 415</td>-->
|
||||
@ -513,16 +517,16 @@
|
||||
<!-- </tr>-->
|
||||
<tr>
|
||||
<td class="al-r" colspan="6">小計</td>
|
||||
<td class="al-r" ></td>
|
||||
<td class="al-r hide-column" id="supplyPrice"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="al-r" colspan="5">消費税</td>
|
||||
<td class="al-r">(10%)</td>
|
||||
<td class="al-r" ></td>
|
||||
<td class="al-r hide-column" id="vatPrice"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="al-r end" colspan="6">合計金額</td>
|
||||
<td class="al-r end" ></td>
|
||||
<td class="al-r end hide-column" id="totPrice1"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user