Merge pull request '[1379] 견적서 출력 zip, address, tel, fax 수정' (#389) from dev into dev-deploy

Reviewed-on: #389
This commit is contained in:
ysCha 2026-02-10 17:25:16 +09:00
commit 3777da8540
2 changed files with 22 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
@ -1869,8 +1870,8 @@ public class EstimateService {
}
applyExcelNumberFormat(workbook);
applyExcelFixedNumberFormat(workbook, Arrays.asList("H25", "C12"), "#,##0.00");
applyExcelFixedNumberFormat(workbook, Arrays.asList("X32", "I44"), "#,##0.00");
// applyExcelFixedNumberFormat(workbook, Arrays.asList("H25", "C12"), "#,##0.00");
// applyExcelFixedNumberFormat(workbook, Arrays.asList("X32", "I44"), "#,##0.00");
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
workbook.write(byteArrayOutputStream);
@ -2002,6 +2003,7 @@ public class EstimateService {
private static void coerceExcelDataNumberFields(Map<String, Object> map) {
coerceExcelNumberFields(map, EXCEL_DATA_NUMBER_FIELDS);
coerceExcelScale(map, "totVol", 2);
}
private static void coerceExcelRoofNumberFields(List<Map<String, Object>> list) {
@ -2052,6 +2054,24 @@ public class EstimateService {
}
}
private static void coerceExcelScale(Map<String, Object> map, String key, int scale) {
if (map == null || key == null) {
return;
}
Object value = map.get(key);
Object parsed = parseExcelNumber(value);
if (!(parsed instanceof Number)) {
return;
}
BigDecimal decimal;
if (parsed instanceof BigDecimal) {
decimal = (BigDecimal) parsed;
} else {
decimal = new BigDecimal(parsed.toString());
}
map.put(key, decimal.setScale(scale, RoundingMode.HALF_UP));
}
private static void putExcelItemList(Map<String, Object> excelData, String key,
List<ItemResponse> items) {
if (excelData == null || items == null) {