|
|
|
@ -85,7 +85,7 @@ public class OnlinePageController { |
|
|
|
@OperationLog(type = SysOperationLogType.ADD) |
|
|
|
@OperationLog(type = SysOperationLogType.ADD) |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@PostMapping("/add") |
|
|
|
@PostMapping("/add") |
|
|
|
public ResponseResult<Long> add(@MyRequestBody OnlinePageDto onlinePageDto) { |
|
|
|
public ResponseResult<OnlinePage> add(@MyRequestBody OnlinePageDto onlinePageDto) { |
|
|
|
String errorMessage = MyCommonUtil.getModelValidationError(onlinePageDto); |
|
|
|
String errorMessage = MyCommonUtil.getModelValidationError(onlinePageDto); |
|
|
|
if (errorMessage != null) { |
|
|
|
if (errorMessage != null) { |
|
|
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage); |
|
|
|
return ResponseResult.error(ErrorCodeEnum.DATA_VALIDATED_FAILED, errorMessage); |
|
|
|
@ -115,7 +115,6 @@ public class OnlinePageController { |
|
|
|
return ResponseResult.error(ErrorCodeEnum.DUPLICATED_UNIQUE_KEY, errorMessage); |
|
|
|
return ResponseResult.error(ErrorCodeEnum.DUPLICATED_UNIQUE_KEY, errorMessage); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Long masterTableId; |
|
|
|
|
|
|
|
OnlFormHead onlFormHead; |
|
|
|
OnlFormHead onlFormHead; |
|
|
|
|
|
|
|
|
|
|
|
if ("new".equals(metaSource)) { |
|
|
|
if ("new".equals(metaSource)) { |
|
|
|
@ -125,7 +124,7 @@ public class OnlinePageController { |
|
|
|
String tableTxt = onlinePageDto.getPageName(); |
|
|
|
String tableTxt = onlinePageDto.getPageName(); |
|
|
|
|
|
|
|
|
|
|
|
onlFormHead = iOnlFormHeadService.createMetaAndSync(tableName, tableTxt, metaType, null); |
|
|
|
onlFormHead = iOnlFormHeadService.createMetaAndSync(tableName, tableTxt, metaType, null); |
|
|
|
masterTableId = onlFormHead.getId(); |
|
|
|
Long masterTableId = onlFormHead.getId(); |
|
|
|
onlinePage.setMasterTableId(String.valueOf(masterTableId)); |
|
|
|
onlinePage.setMasterTableId(String.valueOf(masterTableId)); |
|
|
|
onlinePage.setMasterTableName(onlFormHead.getTableName()); |
|
|
|
onlinePage.setMasterTableName(onlFormHead.getTableName()); |
|
|
|
|
|
|
|
|
|
|
|
@ -138,7 +137,6 @@ public class OnlinePageController { |
|
|
|
// === Existing branch: use existing metadata ===
|
|
|
|
// === Existing branch: use existing metadata ===
|
|
|
|
String formMetadata = onlinePageDto.getMasterTableId(); |
|
|
|
String formMetadata = onlinePageDto.getMasterTableId(); |
|
|
|
onlFormHead = iOnlFormHeadService.getById(formMetadata); |
|
|
|
onlFormHead = iOnlFormHeadService.getById(formMetadata); |
|
|
|
masterTableId = Long.valueOf(formMetadata); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
@ -179,7 +177,7 @@ public class OnlinePageController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
addOnlineDatasourceRelation(onlFormHead, onlineDatasource, errorMessage, onlineDblink); |
|
|
|
addOnlineDatasourceRelation(onlFormHead, onlineDatasource, errorMessage, onlineDblink); |
|
|
|
|
|
|
|
|
|
|
|
return ResponseResult.success(onlinePage.getPageId()); |
|
|
|
return ResponseResult.success(onlinePage); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|