fix: 处理 excel 公式错误

This commit is contained in:
taojinlong 2021-08-02 13:38:56 +08:00
parent 084aab5e92
commit 7376becd68
3 changed files with 7 additions and 11 deletions

View File

@ -68,6 +68,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

@ -217,15 +217,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("---------");
}
}
/**
@ -326,7 +317,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();