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 {
//第一行为列头的话就多输出一行
int topNum = haveHeader ? topRowNumber + 1 : topRowNumber;
if(topNum<dataImportModel.getDataList().size())
dataImportModel.setDataList(dataImportModel.getDataList().subList(0,topNum));
if (topNum < dataImportModel.getDataList().size())
dataImportModel.setDataList(dataImportModel.getDataList().subList(0, topNum));
// dataImportModel.setDataList(dataImportModel.getDataList().subList(0,topRowNumber));
}
return dataImportModel;
......@@ -117,7 +117,11 @@ public class NPOIHelper {
if (HSSFDateUtil.isCellDateFormatted(cell)) {
strCell = sdf.format(cell.getDateCellValue());
} else {
strCell = cell.getNumericCellValue() + "";
long longVal = Math.round(cell.getNumericCellValue());
if (Double.parseDouble(longVal + ".0") == cell.getNumericCellValue())
strCell = longVal + "";
else
strCell = cell.getNumericCellValue() + "";
}
break;
case FORMULA:
......
......@@ -41,8 +41,8 @@ public class VoucherInvoiceMappingController {
@RequestMapping(value = "savevmappings/{period}/{IsAddition}", method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity SaveVourcherMappings(@RequestBody List<VoucherMappingDto> list, @PathVariable int period
, @PathVariable int IsAddition) {
public ResponseEntity SaveVourcherMappings(@RequestBody List<VoucherMappingDto> list, @PathVariable Integer period
, @PathVariable Integer IsAddition) {
logger.info("savevmappings/{period}/{IsAddition}");
list.forEach(m -> {
m.ID = UUID.randomUUID().toString();
......@@ -53,8 +53,8 @@ public class VoucherInvoiceMappingController {
@RequestMapping(value = "saveimappings/{period}/{IsAddition}", method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity SaveInvoiceMappings(@RequestBody List<InvoiceMappingDto> list, @PathVariable int period
, @PathVariable int IsAddition) {
public ResponseEntity SaveInvoiceMappings(@RequestBody List<InvoiceMappingDto> list, @PathVariable Integer period
, @PathVariable Integer IsAddition) {
logger.info("savevmappings/{period}/{IsAddition}");
list.forEach(m -> {
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