fix: 处理 excel 公式错误

This commit is contained in:
taojinlong 2021-08-02 13:38:56 +08:00
parent c94ec45503
commit 956f9b45f4
3 changed files with 7 additions and 11 deletions

View File

@ -70,6 +70,7 @@ public class ExcelReaderUtil {
}
public static void main(String[] args) throws Exception {
ExcelReaderUtil.readExcel("根据前100行判断数据类型.xls", new FileInputStream("/Users/taojinlong/Desktop/根据前100行判断数据类型.xls"));
String file ="全国现有确诊趋势.xlsx";
ExcelReaderUtil.readExcel(file, new FileInputStream("/Users/taojinlong/Desktop/" + file));
}
}

View File

@ -221,15 +221,6 @@ public class ExcelXlsxReader extends DefaultHandler {
return;
}
lastIndex += new String(ch, start, length);
if(curRow==5){
System.out.println("---------");
System.out.println(ch);
System.out.println("start: " + start);
System.out.println("length: " + length);
System.out.println(lastIndex);
System.out.println("---------");
}
}
/**
@ -330,7 +321,7 @@ public class ExcelXlsxReader extends DefaultHandler {
} else if ("s".equals(cellType)) { //处理字符串
nextDataType = CellDataType.SSTINDEX;
} else if ("str".equals(cellType)) {
nextDataType = CellDataType.FORMULA;
nextDataType = CellDataType.SSTINDEX;
}
String cellStyleStr = attributes.getValue("s"); //

View File

@ -90,6 +90,9 @@ public class DataSetTableTaskService {
}
datasetTableTaskMapper.insert(datasetTableTask);
} else {
datasetTableTask.setStatus(null);
datasetTableTask.setLastExecTime(null);
datasetTableTask.setLastExecStatus(null);
datasetTableTaskMapper.updateByPrimaryKeySelective(datasetTableTask);
}
@ -197,6 +200,7 @@ public class DataSetTableTaskService {
if(datasetTableTask.getRate().equalsIgnoreCase(ScheduleType.SIMPLE.name())){
datasetTableTask.setStatus(TaskStatus.Stopped.name());
}else {
datasetTableTask = datasetTableTaskMapper.selectByPrimaryKey(datasetTableTask.getId());
if(StringUtils.isNotEmpty(datasetTableTask.getEnd()) && datasetTableTask.getEnd().equalsIgnoreCase("1")){
BaseGridRequest request = new BaseGridRequest();
ConditionEntity conditionEntity = new ConditionEntity();