Compare commits
No commits in common. "86fae0f5f8b06e650d415f3ac5b0a851caf88075" and "7512a4cbb053ca783a805d62234c4871b5f68b61" have entirely different histories.
86fae0f5f8
...
7512a4cbb0
@ -6,7 +6,6 @@ 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;
|
||||
@ -1870,8 +1869,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);
|
||||
@ -2003,7 +2002,6 @@ 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) {
|
||||
@ -2054,24 +2052,6 @@ 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