Commit 4cd820b8 authored by neo's avatar neo

[bugfix] poi get numbricvalue all return double value

parent c7196569
...@@ -81,8 +81,8 @@ public class NPOIHelper { ...@@ -81,8 +81,8 @@ public class NPOIHelper {
//第一行为列头的话就多输出一行 //第一行为列头的话就多输出一行
int topNum = haveHeader ? topRowNumber + 1 : topRowNumber; int topNum = haveHeader ? topRowNumber + 1 : topRowNumber;
if(topNum<dataImportModel.getDataList().size()) if (topNum < dataImportModel.getDataList().size())
dataImportModel.setDataList(dataImportModel.getDataList().subList(0,topNum)); dataImportModel.setDataList(dataImportModel.getDataList().subList(0, topNum));
// dataImportModel.setDataList(dataImportModel.getDataList().subList(0,topRowNumber)); // dataImportModel.setDataList(dataImportModel.getDataList().subList(0,topRowNumber));
} }
return dataImportModel; return dataImportModel;
...@@ -117,6 +117,10 @@ public class NPOIHelper { ...@@ -117,6 +117,10 @@ public class NPOIHelper {
if (HSSFDateUtil.isCellDateFormatted(cell)) { if (HSSFDateUtil.isCellDateFormatted(cell)) {
strCell = sdf.format(cell.getDateCellValue()); strCell = sdf.format(cell.getDateCellValue());
} else { } else {
long longVal = Math.round(cell.getNumericCellValue());
if (Double.parseDouble(longVal + ".0") == cell.getNumericCellValue())
strCell = longVal + "";
else
strCell = cell.getNumericCellValue() + ""; strCell = cell.getNumericCellValue() + "";
} }
break; break;
......
...@@ -41,8 +41,8 @@ public class VoucherInvoiceMappingController { ...@@ -41,8 +41,8 @@ public class VoucherInvoiceMappingController {
@RequestMapping(value = "savevmappings/{period}/{IsAddition}", method = RequestMethod.POST, @RequestMapping(value = "savevmappings/{period}/{IsAddition}", method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE) produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity SaveVourcherMappings(@RequestBody List<VoucherMappingDto> list, @PathVariable int period public ResponseEntity SaveVourcherMappings(@RequestBody List<VoucherMappingDto> list, @PathVariable Integer period
, @PathVariable int IsAddition) { , @PathVariable Integer IsAddition) {
logger.info("savevmappings/{period}/{IsAddition}"); logger.info("savevmappings/{period}/{IsAddition}");
list.forEach(m -> { list.forEach(m -> {
m.ID = UUID.randomUUID().toString(); m.ID = UUID.randomUUID().toString();
...@@ -53,8 +53,8 @@ public class VoucherInvoiceMappingController { ...@@ -53,8 +53,8 @@ public class VoucherInvoiceMappingController {
@RequestMapping(value = "saveimappings/{period}/{IsAddition}", method = RequestMethod.POST, @RequestMapping(value = "saveimappings/{period}/{IsAddition}", method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE) produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity SaveInvoiceMappings(@RequestBody List<InvoiceMappingDto> list, @PathVariable int period public ResponseEntity SaveInvoiceMappings(@RequestBody List<InvoiceMappingDto> list, @PathVariable Integer period
, @PathVariable int IsAddition) { , @PathVariable Integer IsAddition) {
logger.info("savevmappings/{period}/{IsAddition}"); logger.info("savevmappings/{period}/{IsAddition}");
list.forEach(m -> { list.forEach(m -> {
m.ID = UUID.randomUUID().toString(); m.ID = UUID.randomUUID().toString();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment