Skip to content

Commit

Permalink
be
Browse files Browse the repository at this point in the history
  • Loading branch information
getrebuild committed Nov 13, 2023
1 parent 4409a43 commit bf1531b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ public ID transform(ID sourceRecordId, ID specMainId) {
final boolean checkNullable = transConfig.getBooleanValue("checkNullable35");

Record main = transformRecord(sourceEntity, targetEntity, fieldsMapping, sourceRecordId, dvMap, false, false, checkNullable);
ID newId;
ID theNewId;

// v3.5 先回填
// v3.5 需要先回填
// 因为可能以回填字段作为条件进行转换一次判断
final boolean fillbackFix = fillback(sourceRecordId, EntityHelper.newUnsavedId(main.getEntity().getEntityCode()));

Expand All @@ -159,15 +159,15 @@ public ID transform(ID sourceRecordId, ID specMainId) {
transformRecord(sourceDetailEntity, targetDetailEntity, fieldsMappingDetail, (ID) d[0], null, false, false, checkNullable));
}

newId = saveRecord(main, detailsList);
theNewId = saveRecord(main, detailsList);
} else {
newId = saveRecord(main, null);
theNewId = saveRecord(main, null);
}

// 回填修正
if (fillbackFix) fillback(sourceRecordId, newId);
if (fillbackFix) fillback(sourceRecordId, theNewId);

return newId;
return theNewId;
}

private ID saveRecord(Record record, List<Record> detailsList) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public RespBody transform(HttpServletRequest request) {
}

try {
ID newId = transfomer.transform(sourceRecord, mainid);
return RespBody.ok(newId);
ID theNewId = transfomer.transform(sourceRecord, mainid);
return RespBody.ok(theNewId);
} catch (Exception ex) {
log.warn(">>>>> {}", ex.getLocalizedMessage());

Expand Down

0 comments on commit bf1531b

Please sign in to comment.