|
|
|
@ -605,7 +605,7 @@ public class CollectModel {
|
|
|
|
|
|
|
|
|
|
String column_name, original_name;
|
|
|
|
|
for (int colNum = 0; colNum < ed.getLastCellNum(); colNum++) {
|
|
|
|
|
if (StrKit.isBlank(ed.getCell(colNum).toString())) {
|
|
|
|
|
if (StrKit.isBlank(ed.getCell(colNum).toString())) {//下面没有,应该听上面的
|
|
|
|
|
original_name = CommonUtil.removeKuoHao(st.getCell(colNum).toString().replace("\n", ""));
|
|
|
|
|
column_name = ChineseCharacterUtil.getColumnNameByMemo(CommonUtil.removeKuoHao(st.getCell(colNum).toString()));
|
|
|
|
|
Record record = new Record();
|
|
|
|
@ -613,12 +613,19 @@ public class CollectModel {
|
|
|
|
|
record.set("column_name", column_name);
|
|
|
|
|
list.add(record);
|
|
|
|
|
} else {
|
|
|
|
|
int k = colNum;
|
|
|
|
|
int k = colNum;//如果最后一列有值
|
|
|
|
|
while (StrKit.isBlank(st.getCell(k).toString())) k--;
|
|
|
|
|
original_name = st.getCell(k).toString().replace("\n", "")
|
|
|
|
|
+ "_" + ed.getCell(colNum).toString().replace("\n", "");
|
|
|
|
|
column_name = ChineseCharacterUtil.getColumnNameByMemo(CommonUtil.removeKuoHao(st.getCell(k).toString()))
|
|
|
|
|
+ "_" + ChineseCharacterUtil.getColumnNameByMemo(CommonUtil.removeKuoHao(ed.getCell(colNum).toString()));
|
|
|
|
|
|
|
|
|
|
if (k == colNum) {
|
|
|
|
|
original_name = st.getCell(k).toString().replace("\n", "");
|
|
|
|
|
column_name = ChineseCharacterUtil.getColumnNameByMemo(CommonUtil.removeKuoHao(st.getCell(k).toString()));
|
|
|
|
|
} else {
|
|
|
|
|
original_name = st.getCell(k).toString().replace("\n", "")
|
|
|
|
|
+ "_" + ed.getCell(colNum).toString().replace("\n", "");
|
|
|
|
|
column_name = ChineseCharacterUtil.getColumnNameByMemo(CommonUtil.removeKuoHao(st.getCell(k).toString()))
|
|
|
|
|
+ "_" + ChineseCharacterUtil.getColumnNameByMemo(CommonUtil.removeKuoHao(ed.getCell(colNum).toString()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Record record = new Record();
|
|
|
|
|
record.set("original_name", original_name);
|
|
|
|
|
record.set("column_name", column_name.toLowerCase());
|
|
|
|
@ -1661,7 +1668,7 @@ public class CollectModel {
|
|
|
|
|
* @param job_id
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public List<Record> getAllSheetByJobId(int job_id) {
|
|
|
|
|
public List<Record> getAllSheetByJobId(int job_id) {
|
|
|
|
|
String sql = "select * from t_collect_job_sheet where job_id=? order by sheet_index";
|
|
|
|
|
return Db.find(sql, job_id);
|
|
|
|
|
}
|
|
|
|
@ -1672,7 +1679,7 @@ public class CollectModel {
|
|
|
|
|
* @param table_name
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public List<Record> getTableStruct(String table_name) {
|
|
|
|
|
public List<Record> getTableStruct(String table_name) {
|
|
|
|
|
String sql = "select column_name,excel_column_idx,original_name from t_collect_mapping where table_name=?";
|
|
|
|
|
return Db.find(sql, table_name);
|
|
|
|
|
}
|
|
|
|
@ -1684,7 +1691,7 @@ public class CollectModel {
|
|
|
|
|
* @param table_name
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public List<Record> getTableDataByJobId(int job_id, String table_name) {
|
|
|
|
|
public List<Record> getTableDataByJobId(int job_id, String table_name) {
|
|
|
|
|
String sql = "select * from " + table_name + " where job_id = ?";
|
|
|
|
|
return Db.find(sql, job_id);
|
|
|
|
|
}
|
|
|
|
@ -1696,7 +1703,7 @@ public class CollectModel {
|
|
|
|
|
* @param filePath
|
|
|
|
|
* @throws IOException
|
|
|
|
|
*/
|
|
|
|
|
public void getSummaryExcel(int job_id, String filePath) throws IOException { //给定任务编号,获取它有哪些表
|
|
|
|
|
public void getSummaryExcel(int job_id, String filePath) throws IOException { //给定任务编号,获取它有哪些表
|
|
|
|
|
// 创建工作簿和工作表
|
|
|
|
|
SXSSFWorkbook workbook = new SXSSFWorkbook();//默认100行,超100行将写入临时文件
|
|
|
|
|
workbook.setCompressTempFiles(false); //是否压缩临时文件,否则写入速度更快,但更占磁盘,但程序最后是会将临时文件删掉的
|
|
|
|
|