main
黄海 2 years ago
parent dfa683c439
commit 34deb60ce4

@ -238,9 +238,21 @@ public class CollectController extends Controller {
renderJson(kvAllCheck);
return;
}
List<Record> listJobSheet = cm.getSheets(job_id);
//检查是不是某张表中存在字段名称重复的情况
for (int i = 0; i < listJobSheet.size(); i++) {
List<Record> list = cm.checkColumnNameDuplicate(job_id, i);
if (list.size() > 0) {
Map map = new HashMap();
map.put("success", false);
map.put("message", "第" + (i + 1) + "个Sheet表中存在字段名称重复的情况请检查后重新保存");
map.put("list", list);
renderJson(map);
return;
}
}
//检查通过,处理建表逻辑
List<Record> listJobSheet = cm.getSheets(job_id);
for (int i = 0; i < listJobSheet.size(); i++) cm.createTable(job_id, i);//创建表
//检查是不是需要对指定列进行加红星+Comment操作

@ -255,6 +255,7 @@ public class CollectModel {
/**
*
*
* @param job_id
* @return
*/
@ -263,6 +264,19 @@ public class CollectModel {
return Db.find(sql, job_id);
}
/**
* +SheetIndex
*
* @param job_id
* @param sheet_index
* @return
*/
public List<Record> checkColumnNameDuplicate(int job_id, int sheet_index) {
String sql = "select column_name,count(1) as c from t_collect_job_sheet_col where job_id=? and sheet_index=? group by column_name having count(1)>1";
List<Record> list = Db.find(sql, job_id, sheet_index);
return list;
}
/**
* Sheet
*

Loading…
Cancel
Save