Compare commits
No commits in common. "3777da85402d860342d0bd4e222089190d799554" and "c5527b63478c0ecba5da87ba12024c4bbcd248a4" have entirely different histories.
3777da8540
...
c5527b6347
@ -6,7 +6,6 @@ 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;
|
||||||
@ -1870,8 +1869,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);
|
||||||
@ -2003,7 +2002,6 @@ 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) {
|
||||||
@ -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,
|
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