|
@@ -251,11 +251,12 @@ public class TableServiceCmdService {
|
|
|
// 处理外键
|
|
|
// handlerForeignKey(result, columns);
|
|
|
|
|
|
- handler(result, columns);
|
|
|
+ handler(result = filter(result, ObjectUtils::isNotEmpty), columns);
|
|
|
// 定制接口
|
|
|
result = isCustomized(dto.getTable(),result,"trigger_retrieve");
|
|
|
|
|
|
- rows.put(FormDataConstant.PAGE_ROWS, result);
|
|
|
+ rows.put(PAGE_ROWS, result);
|
|
|
+ rows.put(TABLE_HEAD_LIST, getTableHeadList(genTable));
|
|
|
return AjaxResult.success(rows);
|
|
|
}
|
|
|
|
|
@@ -413,22 +414,28 @@ public class TableServiceCmdService {
|
|
|
}
|
|
|
|
|
|
List<JSONObject> result = Lists.newArrayListWithCapacity(jsonObject.size());
|
|
|
- for (GenTableColumn column : columns) {
|
|
|
- JSONObject map = new JSONObject();
|
|
|
- for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
|
|
|
- if (column.getColumnName().equalsIgnoreCase(entry.getKey())) {
|
|
|
- map.put(SINGLE_OBJ_NAME, column.getColumnName());
|
|
|
- map.put(SINGLE_OBJ_VALUE, entry.getValue());
|
|
|
- String htmlType = column.getHtmlType();
|
|
|
- map.put(SINGLE_OBJ_TYPE, htmlType);
|
|
|
- if (NEED_QUERY_DICT_LIST.contains(htmlType)) {
|
|
|
- map.put(SINGLE_OBJ_TYPES, remoteDictDataService.listByType(column.getDictType()));
|
|
|
- }
|
|
|
|
|
|
- result.add(map);
|
|
|
+ for (GenTableColumn column : columns) {
|
|
|
+ JSONObject map = new JSONObject();
|
|
|
+ for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
|
|
|
+ if (column.getColumnName().equalsIgnoreCase(entry.getKey())) {
|
|
|
+ map.put(SINGLE_OBJ_NAME, column.getColumnName());
|
|
|
+ map.put(SINGLE_OBJ_VALUE, entry.getValue());
|
|
|
+ String htmlType = column.getHtmlType();
|
|
|
+ map.put(SINGLE_OBJ_TYPE, htmlType);
|
|
|
+ if (NEED_QUERY_DICT_LIST.contains(htmlType)) {
|
|
|
+ String dictType = column.getDictType();
|
|
|
+ try {
|
|
|
+ map.put(SINGLE_OBJ_TYPES, remoteDictDataService.listByType(dictType));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ result.add(map);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -482,8 +489,13 @@ public class TableServiceCmdService {
|
|
|
if (GenTableColumn.IS_QUERY.equalsIgnoreCase(column.getIsQuery())) {
|
|
|
String dictType = column.getDictType();
|
|
|
if (ObjectUtils.isNotEmpty(dictType)) {
|
|
|
- List<SysDictData> sysDictData1 = remoteDictDataService.listByType(dictType);
|
|
|
- column.setSysDictData(sysDictData1);
|
|
|
+ try {
|
|
|
+ List<SysDictData> sysDictData1 = remoteDictDataService.listByType(dictType);
|
|
|
+ column.setSysDictData(sysDictData1);
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println("sq_dictType = " + dictType);
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
queryList.add(column);
|
|
@@ -494,7 +506,7 @@ public class TableServiceCmdService {
|
|
|
// genTable.getMenuRole() 暂时数据库没有数据,
|
|
|
jsonObject.put(FormDataConstant.BUTTON_LIST, Strings.nullToEmpty(genTable.getMenuRole()));
|
|
|
|
|
|
- jsonObject.put(FormDataConstant.TABLE_HEAD_LIST, getTableHeadList(genTable));
|
|
|
+ // jsonObject.put(FormDataConstant.TABLE_HEAD_LIST, getTableHeadList(genTable));
|
|
|
return AjaxResult.success(jsonObject);
|
|
|
}
|
|
|
|