[1379] 견적서 출력 zip, address, tel, fax 수정 #390
@ -6,6 +6,7 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
@ -1869,8 +1870,8 @@ public class EstimateService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
applyExcelNumberFormat(workbook);
|
applyExcelNumberFormat(workbook);
|
||||||
applyExcelFixedNumberFormat(workbook, Arrays.asList("H25", "C12"), "#,##0.00");
|
// applyExcelFixedNumberFormat(workbook, Arrays.asList("H25", "C12"), "#,##0.00");
|
||||||
applyExcelFixedNumberFormat(workbook, Arrays.asList("X32", "I44"), "#,##0.00");
|
// applyExcelFixedNumberFormat(workbook, Arrays.asList("X32", "I44"), "#,##0.00");
|
||||||
|
|
||||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||||
workbook.write(byteArrayOutputStream);
|
workbook.write(byteArrayOutputStream);
|
||||||
@ -2002,6 +2003,7 @@ public class EstimateService {
|
|||||||
|
|
||||||
private static void coerceExcelDataNumberFields(Map<String, Object> map) {
|
private static void coerceExcelDataNumberFields(Map<String, Object> map) {
|
||||||
coerceExcelNumberFields(map, EXCEL_DATA_NUMBER_FIELDS);
|
coerceExcelNumberFields(map, EXCEL_DATA_NUMBER_FIELDS);
|
||||||
|
coerceExcelScale(map, "totVol", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void coerceExcelRoofNumberFields(List<Map<String, Object>> list) {
|
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,
|
private static void putExcelItemList(Map<String, Object> excelData, String key,
|
||||||
List<ItemResponse> items) {
|
List<ItemResponse> items) {
|
||||||
if (excelData == null || items == null) {
|
if (excelData == null || items == null) {
|
||||||
|
|||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user