mirror of
https://github.com/getrebuild/rebuild.git
synced 2024-11-10 17:04:33 +08:00
Update FieldWriteback.java
This commit is contained in:
parent
b1887f4e76
commit
579302e75e
1 changed files with 15 additions and 2 deletions
|
@ -14,9 +14,12 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import com.rebuild.core.Application;
|
||||
import com.rebuild.core.configuration.general.AutoFillinManager;
|
||||
import com.rebuild.core.metadata.MetadataHelper;
|
||||
import com.rebuild.core.metadata.easymeta.DisplayType;
|
||||
import com.rebuild.core.metadata.easymeta.EasyDate;
|
||||
import com.rebuild.core.metadata.easymeta.EasyField;
|
||||
import com.rebuild.core.metadata.easymeta.EasyMetaFactory;
|
||||
import com.rebuild.core.service.trigger.ActionContext;
|
||||
import com.rebuild.core.service.trigger.ActionType;
|
||||
import com.rebuild.core.support.general.FieldValueCompatibleConversion;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -92,7 +95,17 @@ public class FieldWriteback extends FieldAggregation {
|
|||
|
||||
Field sourceField = MetadataHelper.getLastJoinField(sourceEntity, e.getValue());
|
||||
Field targetField = targetEntity.getField(e.getKey());
|
||||
Object newValue = new FieldValueCompatibleConversion(sourceField, targetField).convert(value, exprsMap.get(e.getKey()));
|
||||
|
||||
Object newValue;
|
||||
EasyField sourceFieldEasy = EasyMetaFactory.valueOf(sourceField);
|
||||
if (sourceFieldEasy.getDisplayType() == DisplayType.DATETIME
|
||||
|| sourceFieldEasy.getDisplayType() == DisplayType.DATE) {
|
||||
newValue = ((EasyDate) sourceFieldEasy)
|
||||
.convertCompatibleValue(value, EasyMetaFactory.valueOf(targetField), exprsMap.get(e.getKey()));
|
||||
} else {
|
||||
newValue = sourceFieldEasy.convertCompatibleValue(value, EasyMetaFactory.valueOf(targetField));
|
||||
}
|
||||
|
||||
if (newValue != null) {
|
||||
record.setObjectValue(targetField.getName(), newValue);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue