[1379] 견적서 출력 zip, address, tel, fax 수정
This commit is contained in:
parent
9bbedbba6b
commit
0e37811b53
@ -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) {
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user