|
@@ -124,14 +124,13 @@ public class TableServiceCmdService {
|
|
|
|
|
|
TableContext context = TableContext.createContext(dto);
|
|
TableContext context = TableContext.createContext(dto);
|
|
// 拿到pkName和maxId
|
|
// 拿到pkName和maxId
|
|
- List<GenTableColumn> columns = context.getColumns();
|
|
|
|
String pkName = context.getPkName();
|
|
String pkName = context.getPkName();
|
|
JSONObject commitData = context.getCommitData();
|
|
JSONObject commitData = context.getCommitData();
|
|
|
|
|
|
// 新增
|
|
// 新增
|
|
if (ActionType.INSERT.equals(context.getActionType())) {
|
|
if (ActionType.INSERT.equals(context.getActionType())) {
|
|
Long maxId = IdUtils.getMaxId(dto.getTable(), pkName);
|
|
Long maxId = IdUtils.getMaxId(dto.getTable(), pkName);
|
|
- RowResult rowResult = saveService.insertRow(context.getTableName(), pkName, maxId, commitData, columns);
|
|
|
|
|
|
+ RowResult rowResult = saveService.insertRow(context, maxId);
|
|
if (RowResult.checkSuccess(rowResult)) {
|
|
if (RowResult.checkSuccess(rowResult)) {
|
|
LOGGER.info("保存成功,封装到数据库的数据为: {}", JSON.toJSONString(rowResult.getData()));
|
|
LOGGER.info("保存成功,封装到数据库的数据为: {}", JSON.toJSONString(rowResult.getData()));
|
|
} else {
|
|
} else {
|
|
@@ -140,7 +139,7 @@ public class TableServiceCmdService {
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
// 编辑
|
|
// 编辑
|
|
- int effective = updateService.updateByIdList(context, pkName, Collections.singletonList(context.getId()), commitData, columns);
|
|
|
|
|
|
+ int effective = updateService.updateByIdList(context, Collections.singletonList(context.getId()));
|
|
if (effective > 0) {
|
|
if (effective > 0) {
|
|
LOGGER.info("修改成功,封装到数据库的数据为: {}", JSON.toJSONString(commitData));
|
|
LOGGER.info("修改成功,封装到数据库的数据为: {}", JSON.toJSONString(commitData));
|
|
} else {
|
|
} else {
|
|
@@ -697,6 +696,8 @@ public class TableServiceCmdService {
|
|
requireNonNull(condition.getIsUi(), "根据表名获取表字段,未传 isUi 这个字段");
|
|
requireNonNull(condition.getIsUi(), "根据表名获取表字段,未传 isUi 这个字段");
|
|
GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, condition.getTable());
|
|
GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, condition.getTable());
|
|
List<GenTableColumn> allColumns = genTable.getColumns();
|
|
List<GenTableColumn> allColumns = genTable.getColumns();
|
|
|
|
+ // 把新增可见的列过滤出来
|
|
|
|
+// List<GenTableColumn> returnData = ColumnUtils.filterNeedShowData(allColumns, 0, INSERT_VISIBLE::equals);
|
|
// 普通的展示,不带折叠的
|
|
// 普通的展示,不带折叠的
|
|
if (BooleanUtils.isFalse(condition.getIsUi())) {
|
|
if (BooleanUtils.isFalse(condition.getIsUi())) {
|
|
packDictDataToColumns(allColumns, ObjectUtils::isNotEmpty);
|
|
packDictDataToColumns(allColumns, ObjectUtils::isNotEmpty);
|