|
@@ -1210,6 +1210,12 @@ public class TableServiceCmdService {
|
|
|
|
|
|
// 主表是修改操作
|
|
// 主表是修改操作
|
|
JSONObject fixedData = dto.getFixedData();
|
|
JSONObject fixedData = dto.getFixedData();
|
|
|
|
+ List<FormDataDto> children = dto.getChildren();
|
|
|
|
+ if (isEmpty(children)) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ FormDataDto childDto = children.get(0);
|
|
for (Map.Entry<String, Object> entry : fixedData.entrySet()) {
|
|
for (Map.Entry<String, Object> entry : fixedData.entrySet()) {
|
|
Object value = entry.getValue();
|
|
Object value = entry.getValue();
|
|
if (value instanceof String) {
|
|
if (value instanceof String) {
|
|
@@ -1217,17 +1223,8 @@ public class TableServiceCmdService {
|
|
if (!strValue.contains(FK_POINT)) {
|
|
if (!strValue.contains(FK_POINT)) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- String[] split = strValue.split(POINT);
|
|
|
|
- // 默认关联的都是主表的id,fk.primaryTableName
|
|
|
|
- String lastTableName = split[split.length - 1];
|
|
|
|
- Long maxId = tableNameIdMap.get(lastTableName);
|
|
|
|
- if (maxId == null) {
|
|
|
|
- throw new RuntimeException(String.format("保存失败, 主表id: null, 表名为: %s ", lastTableName));
|
|
|
|
- }
|
|
|
|
- fixedData.put(entry.getKey(), maxId);
|
|
|
|
|
|
|
|
- deleteService.delete(dto.getTable(), JSONObjectUtils.putValue(entry.getKey(), maxId));
|
|
|
|
- dto.setFixedData(fixedData);
|
|
|
|
|
|
+ deleteService.delete(childDto.getTable(), JSONObjectUtils.putValue(entry.getKey(), dto.getObjId()));
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|