提交 bc028771 编写于 作者: sq3536's avatar sq3536

bug modify

上级 89695371
......@@ -192,18 +192,12 @@ public class EntityModel {
String columnExp=fieldModel.getColumnExp();
if(StringUtils.isEmpty(columnExp))
continue;
// if(fieldModel.isPhysicalField())
// continue;
if(!StringUtils.isEmpty(columnSet)){
columnSet=columnSet+",";
}
columnSet=columnSet+columnExp;
}
// if(!StringUtils.isEmpty(columnSet)){
// columnSet=columnSet+",";
// }
//columnSet=columnSet+"t.*";
return "select "+columnSet+" from "+this.getTableName()+" t ";
}
else if("CORE".equalsIgnoreCase(dataSet))
......@@ -242,18 +236,7 @@ public class EntityModel {
public String getExtParams(String key)
{
if(!(StringUtils.isEmpty(this.getEntity().getExtParams())))
{
List<Setting> settings=JSONArray.parseArray(this.getEntity().getExtParams(),Setting.class);
for(Setting setting:settings)
{
if(key.equals(setting.getProperty()))
{
return setting.getValue();
}
}
}
return null;
return Setting.getValue(this.getEntity().getExtParams(),key);
}
......
......@@ -2,6 +2,8 @@ package cn.ibizlab.core.lite.extensions.model;
import cn.ibizlab.core.lite.extensions.domain.EntityModel;
import cn.ibizlab.core.lite.extensions.domain.EntityObj;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
......@@ -20,6 +22,27 @@ import java.util.List;
@NoArgsConstructor
@Accessors(chain = true)
public class DataModel {
@JsonIgnore
@JSONField(serialize = false)
private String modelString;
public String getModelString()
{
if(StringUtils.isEmpty(modelString))
{
modelString= JSONObject.toJSONString(this);
}
return modelString;
}
@JsonIgnore
@JSONField(serialize = false)
public DataModel clone()
{
DataModel clone = JSON.toJavaObject(JSONObject.parseObject(this.getModelString()),DataModel.class);
clone.setModelString(this.getModelString());
return clone;
}
@JsonIgnore
@JSONField(serialize = false)
......@@ -138,9 +161,6 @@ public class DataModel {
for (Property property:this.getObjectProperties())
if(name.equalsIgnoreCase(property.getPropertyName()))
return property;
// for (Property property:this.getObjectProperties())
// if(name.equalsIgnoreCase(property.getPropertyEntity()))
// return property;
}
return null;
}
......@@ -336,7 +356,8 @@ public class DataModel {
@JSONField(serialize = false)
public LinkedHashSet<Property> getAllProperty()
{
LinkedHashSet<Property> properties=this.getObjectProperties();
LinkedHashSet<Property> properties=new LinkedHashSet<>();
properties.addAll(this.getObjectProperties());
if (this.getNestedDataModels() != null) {
for (DataModel dm : this.getNestedDataModels()) {
......
......@@ -163,7 +163,7 @@ public class DbEntityService extends ServiceImpl<DbEntityMapper, EntityObj> impl
@Override
public List<ModelObj> getModelObjs(String metaModelId, Set<String> fillPropertys, Timestamp lastModify)
{
DataModel dataModel= JSON.toJavaObject(JSON.parseObject(metaModelService.get(metaModelId).getConfig()), DataModel.class);
DataModel dataModel= liteModelService.getDataModel(metaModelId);
EntityModel entityModel=dataModel.getFactEntityModel();
FieldModel lastModifyField=entityModel.getLastModifyField();
QueryFilter filter=new QueryFilter();
......@@ -179,7 +179,7 @@ public class DbEntityService extends ServiceImpl<DbEntityMapper, EntityObj> impl
@Override
public ModelObj getModelObjs(String metaModelId, Set<String> fillPropertys, Object factKey)
{
DataModel dataModel= JSON.toJavaObject(JSON.parseObject(metaModelService.get(metaModelId).getConfig()), DataModel.class);
DataModel dataModel= liteModelService.getDataModel(metaModelId);
List<EntityObj> kEntityObjs = new ArrayList<>();
kEntityObjs.add(new EntityObj().set(dataModel.getFactEntityModel().getKeyField().getColumnName(),factKey));
List<ModelObj> list = getModelObjs(dataModel,fillPropertys,kEntityObjs);
......@@ -191,7 +191,7 @@ public class DbEntityService extends ServiceImpl<DbEntityMapper, EntityObj> impl
@Override
public ModelObj getModelObjs(String metaModelId, Set<String> fillPropertys, Object... factUniKey)
{
DataModel dataModel= JSON.toJavaObject(JSON.parseObject(metaModelService.get(metaModelId).getConfig()), DataModel.class);
DataModel dataModel= liteModelService.getDataModel(metaModelId);
List<EntityObj> kEntityObjs = new ArrayList<>();
EntityObj entityObj = new EntityObj();
List<FieldModel> uniKeys = dataModel.getFactEntityModel().getUnionKeyFields();
......@@ -207,7 +207,7 @@ public class DbEntityService extends ServiceImpl<DbEntityMapper, EntityObj> impl
@Override
public List<ModelObj> getModelObjs(String metaModelId, Set<String> fillPropertys, List<EntityObj> kEntityObjs)
{
DataModel dataModel= JSON.toJavaObject(JSON.parseObject(metaModelService.get(metaModelId).getConfig()), DataModel.class);
DataModel dataModel= liteModelService.getDataModel(metaModelId);
return getModelObjs(dataModel,fillPropertys,kEntityObjs);
}
......
......@@ -177,7 +177,10 @@ public class LiteModelService {
public DataModel getDataModel(String dataModelId)
{
return JSON.toJavaObject(JSON.parseObject(metaModelService.get(dataModelId).getConfig()),DataModel.class);
String cfg=metaModelService.get(dataModelId).getConfig();
DataModel dataModel = JSON.toJavaObject(JSON.parseObject(metaModelService.get(dataModelId).getConfig()),DataModel.class);
dataModel.setModelString(cfg);
return dataModel;
}
public DataModel getDataModel(String rootDataModelId,String subDataModelName)
......
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-3.8.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
<changeSet author="mac (generated)" id="1608271176252-1">
<preConditions onFail="MARK_RAN" >
<not>
<columnExists tableName="IBZDABUILD" columnName="TOTAL" />
</not>
</preConditions>
<addColumn tableName="IBZDABUILD">
<column name="TOTAL" type="INTEGER"/>
</addColumn>
<addColumn tableName="IBZRULEENGINE">
<column name="TOTAL" type="INTEGER"/>
</addColumn>
<addColumn tableName="IBZDABUILD">
<column name="PROCESSED" type="INTEGER"/>
</addColumn>
<addColumn tableName="IBZRULEENGINE">
<column name="PROCESSED" type="INTEGER"/>
</addColumn>
<addColumn tableName="IBZDABUILD">
<column name="EXTPARAMS" type="CLOB(2147483647)"/>
</addColumn>
</changeSet>
</databaseChangeLog>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册