mirror of https://gitee.com/makejava/EasyCode.git
修复当配置信息中不存在列信息时可能会导致表的其他配置信息丢失问题
This commit is contained in:
parent
55f09db096
commit
6ffdb6fad0
|
@ -70,7 +70,7 @@ public class TableInfoDTO {
|
|||
}
|
||||
|
||||
private static void merge(TableInfoDTO oldData, TableInfoDTO newData) {
|
||||
if (oldData == null || CollectionUtil.isEmpty(oldData.getFullColumn())) {
|
||||
if (oldData == null) {
|
||||
return;
|
||||
}
|
||||
if (!StringUtils.isEmpty(oldData.getPreName())) {
|
||||
|
@ -88,6 +88,9 @@ public class TableInfoDTO {
|
|||
if (!StringUtils.isEmpty(oldData.getSaveModelName())) {
|
||||
newData.saveModelName = oldData.getSaveModelName();
|
||||
}
|
||||
if (CollectionUtil.isEmpty(oldData.getFullColumn())) {
|
||||
return;
|
||||
}
|
||||
// 补充自定义列
|
||||
for (ColumnInfoDTO oldColumn : oldData.getFullColumn()) {
|
||||
if (!oldColumn.getCustom()) {
|
||||
|
|
|
@ -87,6 +87,7 @@ public class TableInfoSettingsDTO {
|
|||
public TableInfo readTableInfo(DbTable dbTable) {
|
||||
String key = generateKey(dbTable);
|
||||
TableInfoDTO dto = this.tableInfoMap.get(key);
|
||||
// 表可能新增了字段,需要重新合并保存
|
||||
dto = new TableInfoDTO(dto, dbTable);
|
||||
this.tableInfoMap.put(key, dto);
|
||||
return dto.toTableInfo(dbTable);
|
||||
|
|
Loading…
Reference in New Issue