|
@@ -17,7 +17,6 @@ import com.boman.gen.api.RemoteGenTableService;
|
|
|
import com.boman.domain.GenTable;
|
|
|
import com.boman.domain.GenTableColumn;
|
|
|
import com.boman.system.api.RemoteDictDataService;
|
|
|
-import com.boman.domain.SysFile;
|
|
|
import com.boman.web.core.domain.*;
|
|
|
import com.boman.web.core.service.delete.IBaseDeleteService;
|
|
|
import com.boman.web.core.service.save.IBaseSaveService;
|
|
@@ -239,6 +238,10 @@ public class TableServiceCmdService {
|
|
|
|
|
|
List<JSONObject> result = selectService.selectByCondition(tableName, condition, packCondition, showData, dto);
|
|
|
result = filter(result, ObjectUtils::isNotEmpty);
|
|
|
+
|
|
|
+ // 查询时为null的列不显示的处理
|
|
|
+ handleNullColumnValue(result, showData);
|
|
|
+
|
|
|
// 处理blob
|
|
|
handleBlob(result, genTable.getIsContainsBlob());
|
|
|
// 处理日期、外键、字典值
|
|
@@ -271,18 +274,23 @@ public class TableServiceCmdService {
|
|
|
return getByTableName(tableName, columns, isUi);
|
|
|
}
|
|
|
|
|
|
- // 默认查所有字段,不支持自定义
|
|
|
+ List<GenTableColumn> updateVisibleColumns = filterData(columns, 2, MaskConstant.UPDATE_VISIBLE::equals);
|
|
|
+ List<String> showData = map(updateVisibleColumns, GenTableColumn::getColumnName);
|
|
|
String pkName = IdUtils.getPkName(genTable.getColumns());
|
|
|
- JSONObject json = selectService.selectById(tableName, pkName, id);
|
|
|
- requireNonNull(json, "id 为[" + id + "]的数据不存在, 表名为[" + tableName + "]");
|
|
|
- // 处理blob
|
|
|
- handleBlob(Collections.singletonList(json), genTable.getIsContainsBlob());
|
|
|
|
|
|
+ List<JSONObject> jsonList = selectService.selectByIdList(tableName, pkName, Lists.newArrayList(id), showData);
|
|
|
+ requireNonNull(jsonList, "id 为[" + id + "]的数据不存在, 模块为[" + genTable.getFunctionName() + "]");
|
|
|
+ // 查询时为null的列不显示的处理
|
|
|
+ handleNullColumnValue(jsonList, showData);
|
|
|
+ JSONObject json = jsonList.get(0);
|
|
|
+
|
|
|
+ // 处理blob
|
|
|
+ handleBlob(jsonList, genTable.getIsContainsBlob());
|
|
|
List<GenTableColumn> parentColumns = filterHrAndSort(columns);
|
|
|
// 处理成hr的形式
|
|
|
for (GenTableColumn hrColumn : parentColumns) {
|
|
|
List<GenTableColumn> children = Lists.newArrayListWithCapacity(16);
|
|
|
- for (GenTableColumn column : columns) {
|
|
|
+ for (GenTableColumn column : updateVisibleColumns) {
|
|
|
if (hrColumn.getId().equals(column.getHrParentId())) {
|
|
|
String columnName = column.getColumnName();
|
|
|
String columnType = column.getColumnType();
|
|
@@ -361,7 +369,7 @@ public class TableServiceCmdService {
|
|
|
// genTable.getMenuRole() 暂时数据库没有数据,
|
|
|
jsonObject.put(FormDataConstant.BUTTON_LIST, Strings.nullToEmpty(genTable.getMenuRole()));
|
|
|
|
|
|
- jsonObject.put(ViewConst.VIEW_TYPE, Strings.nullToEmpty(genTable.getTplCategory()));
|
|
|
+ jsonObject.put(ViewTypeConst.VIEW_TYPE, Strings.nullToEmpty(genTable.getTplCategory()));
|
|
|
jsonObject.put(RULES, packRequireColumn(columns));
|
|
|
return AjaxResult.success(jsonObject);
|
|
|
}
|