2021-11-15 09:22

@成功灵灵七 聚和功能是ES的问题,我使用这个版本可以聚会,这个并不是把SQL语句转DSL语句。所以能不能聚和,能不能使用SQL语句看你的ES版本

2021-10-10 18:22

@zzutligang 这个去官方查看,我并不是对SQL转换(原SQL发送过去的),只是将查询数据封装成JDBC形式而已

2020-06-04 17:20

@JFinal 相信很多人都是从 springMVC 过来的,为什么这个路由不模仿springMVC的方式,同时也支持现有方式,照顾一下强迫症者(我也是搞题主的模式的)

2020-04-21 17:41

可能是平台的XSS拦截过滤了泛型字符串

2020-04-21 17:40

代码里的泛型被过滤掉了

2020-04-21 17:38

我习惯性的操作如下:
File file = getFile().getFile();
ExcelReader er = new ExcelReader(file, "Sheet1");
List> list = er.getSheetData();








import org.apache.poi.ss.usermodel.*;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;


public class ExcelReader {
private File file;
private String sheetName;
private Sheet sheet;
private List> listData = null;


public ExcelReader(String filePath, String sheetName) {
this.file = new File(filePath);
this.sheetName = sheetName;
this.load();
}

public ExcelReader(File file, String sheetName) {
this.file = file;
this.sheetName = sheetName;
this.load();
}


private void load() {
FileInputStream inStream = null;
try {
inStream = new FileInputStream(file);
Workbook workBook = WorkbookFactory.create(inStream);
sheet = workBook.getSheet(sheetName);
dealSheetData();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (inStream != null) {
inStream.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}

private void dealSheetData() {
listData = new ArrayList<>();

int length = sheet.getLastRowNum() + 1;
for (int i = 0; i < length; i++) {
Row row = sheet.getRow(i);

List list = new ArrayList<>();
if (row != null) {
for (int j = 0; j < row.getLastCellNum(); j++) {
Cell cell = row.getCell(j);

list.add(getCellValue(cell));
}
}
listData.add(list);
}
}


private String getCellValue(Cell cell) {
String cellValue = "";
if (cell != null) {
switch (cell.getCellTypeEnum()) {
case NUMERIC:
if (DateUtil.isCellDateFormatted(cell)) {
DataFormatter formatter = new DataFormatter();
cellValue = formatter.formatCellValue(cell);
} else {
double value = cell.getNumericCellValue();
int intValue = (int) value;
cellValue = value - intValue == 0 ? String.valueOf(intValue) : String.valueOf(value);
}
break;
case STRING:
cellValue = cell.getStringCellValue();
break;
case BOOLEAN:
cellValue = String.valueOf(cell.getBooleanCellValue());
break;
case FORMULA:
cellValue = String.valueOf(cell.getCellFormula());
break;
case BLANK:
cellValue = "";
break;
case ERROR:
cellValue = "";
break;
default:
cellValue = cell.toString().trim();
break;
}
}
return cellValue.trim();
}

public List> getSheetData() {
return listData;
}

public String getCellData(int row, int col) {
if (row <= 0 || col <= 0) return null;

if (listData.size() >= row && listData.get(row - 1).size() >= col) {
return listData.get(row - 1).get(col - 1);
}
return null;
}


public static void main(String[] args) {
ExcelReader eh = new ExcelReader("C:\\Users\\lzy\\Desktop\\工作簿1.xls", "Sheet1");
System.out.println(eh.getCellData(1, 1));
// System.out.println(eh.getCellData(1, "test1"));
System.out.println(eh.getCellData(1, 2));
System.out.println(eh.getSheetData());
}

}

2020-04-02 15:54

我有碰到类似情况,我是这么解决的:
setAttr("listB", JsonKit.toJson(listB));

var listB = JSON.parse('#(listB)'); //这里要 try catch 一下,你的listB可能为空