提交 2e37b5da 编写于 作者: zhouweidong's avatar zhouweidong

修复外部接口实体更新时,未设置的属性值会设置为空问题

上级 575b4d64
......@@ -6,9 +6,11 @@ import net.ibizsys.central.database.SysDBSchemeRuntime;
import net.ibizsys.central.dataentity.DataEntityRuntime;
import net.ibizsys.central.dataentity.IDataEntityRuntime;
import net.ibizsys.central.dataentity.service.IDEService;
import net.ibizsys.central.service.client.IWebClient;
import net.ibizsys.model.IPSSystemService;
import net.ibizsys.model.PSModelServiceImpl;
import net.ibizsys.model.dataentity.IPSDataEntity;
import net.ibizsys.runtime.plugin.RuntimeObjectFactory;
import org.springframework.context.annotation.Primary;
import java.lang.annotation.Annotation;
......@@ -19,6 +21,14 @@ public class BootSystemRuntime extends net.ibizsys.central.cloud.core.ServiceSys
private static IBootSystemRuntime instance = null;
static{
registerRuntimeObjectPrimary(IWebClient.class, null, "net.ibizsys.central.plugin.boot.core.runtime.BootWebFluxClient");
}
protected static void registerRuntimeObjectPrimary(Class<?> cls, String strType, Object strObject) {
RuntimeObjectFactory.getInstance().registerObjectPrimary(cls, strType, strObject);
}
public static IBootSystemRuntime getInstance() {
return getInstance(false);
}
......
package net.ibizsys.central.plugin.boot.core.runtime;
import com.fasterxml.jackson.core.JsonProcessingException;
import net.ibizsys.central.plugin.spring.service.client.WebFluxClient;
import net.ibizsys.runtime.util.IEntity;
import org.springframework.http.MediaType;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
public class BootWebFluxClient extends WebFluxClient {
@Override
protected Object getBodyContent(Object objValue, String strContentType) throws JsonProcessingException {
if(ObjectUtils.isEmpty(objValue)) {
return objValue;
}
if(objValue instanceof IEntity){
objValue = ((IEntity)objValue).any();
}
if(!StringUtils.hasLength(strContentType) || strContentType.equals(MediaType.APPLICATION_JSON_VALUE)) {
return OUTMAPPER.writeValueAsString(objValue);
}
return objValue;
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册