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

补充tyyw2

上级 1a6c5604
...@@ -61,7 +61,7 @@ public class LiteDataService { ...@@ -61,7 +61,7 @@ public class LiteDataService {
public void processDataModel(String metaModelId,Timestamp lastModify,LiteDataCallback callback) public void processDataModel(String metaModelId,Timestamp lastModify,LiteDataCallback callback)
{ {
DataModel dataModel= JSON.toJavaObject(JSON.parseObject(metaModelService.get(metaModelId).getConfig()), DataModel.class); DataModel dataModel= liteModelService.getDataModel(metaModelId);
EntityModel entityModel = dataModel.getFactEntityModel(); EntityModel entityModel = dataModel.getFactEntityModel();
getEntityService(entityModel.getDsName()).processList(dataModel,lastModify,callback); getEntityService(entityModel.getDsName()).processList(dataModel,lastModify,callback);
} }
......
...@@ -8,12 +8,16 @@ import cn.ibizlab.core.lite.extensions.domain.EntityModel; ...@@ -8,12 +8,16 @@ import cn.ibizlab.core.lite.extensions.domain.EntityModel;
import cn.ibizlab.core.lite.extensions.domain.FieldModel; import cn.ibizlab.core.lite.extensions.domain.FieldModel;
import cn.ibizlab.core.lite.extensions.domain.RelationshipModel; import cn.ibizlab.core.lite.extensions.domain.RelationshipModel;
import cn.ibizlab.core.lite.extensions.model.DataModel; import cn.ibizlab.core.lite.extensions.model.DataModel;
import cn.ibizlab.core.lite.extensions.model.Property;
import cn.ibizlab.core.lite.extensions.model.PropertyMapping;
import cn.ibizlab.core.lite.extensions.util.LiteStorage; import cn.ibizlab.core.lite.extensions.util.LiteStorage;
import cn.ibizlab.core.lite.filter.MetaFieldSearchContext; import cn.ibizlab.core.lite.filter.MetaFieldSearchContext;
import cn.ibizlab.core.lite.service.*; import cn.ibizlab.core.lite.service.*;
import cn.ibizlab.util.domain.FileItem; import cn.ibizlab.util.domain.FileItem;
import cn.ibizlab.util.errors.InternalServerErrorException; import cn.ibizlab.util.errors.InternalServerErrorException;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -182,8 +186,40 @@ public class LiteModelService { ...@@ -182,8 +186,40 @@ public class LiteModelService {
public DataModel getDataModel(String dataModelId) public DataModel getDataModel(String dataModelId)
{ {
String cfg=metaModelService.get(dataModelId).getConfig(); String cfg=metaModelService.get(dataModelId).getConfig();
DataModel dataModel = JSON.toJavaObject(JSON.parseObject(metaModelService.get(dataModelId).getConfig()),DataModel.class); JSONObject model=JSON.parseObject(metaModelService.get(dataModelId).getConfig());
dataModel.setModelString(cfg);
String factPropertyName="";
String factSystem="";
if(model.containsKey("objectProperties"))
{
JSONArray objProps=model.getJSONArray("objectProperties");
if(objProps.size()>0)
{
JSONObject factObject=objProps.getJSONObject(0);
factPropertyName=factObject.getString("propertyName");
factSystem=factObject.getString("system");
if("tyyw2plus".equals(factSystem))
{
String aj="{\"propertyName\":\"DL_GG_AJXX2\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"DL_GG_AJXX2\",\"propertyMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"joinPropertyName\":\"T_TYYW_XJ_YSGS_AJ\",\"joinPropertyColumn\":\"BMSAH\"}]}";
String blry="{\"dataModelName\":\"AJBLRY\",\"objectProperties\":[{\"propertyName\":\"DL_GG_AJBLRY2\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"DL_GG_AJBLRY2\"}],\"layerMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"parentPropertyColumn\":\"BMSAH\"}]}";
String wshz="{\"dataModelName\":\"AJWSHZ\",\"objectProperties\":[{\"propertyName\":\"JCNJ_YX_AJJZWJ\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"JCNJ_YX_AJJZWJ\"},{\"propertyName\":\"YX_WS_NR2\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"YX_WS_NR2\",\"propertyMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"joinPropertyName\":\"JCNJ_YX_AJJZWJ\",\"joinPropertyColumn\":\"BMSAH\"},{\"selfPropertyColumn\":\"WSBH\",\"joinPropertyName\":\"JCNJ_YX_AJJZWJ\",\"joinPropertyColumn\":\"JZWJH\"}]}],\"layerMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"parentPropertyColumn\":\"BMSAH\"}]}";
String jzhz="{\"dataModelName\":\"AJDZJZJBXX\",\"objectProperties\":[{\"propertyName\":\"DZJZ_YX_JZML\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"DZJZ_YX_JZML\"},{\"propertyName\":\"YX_DZJZ_NR2\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"YX_DZJZ_NR2\",\"propertyMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"joinPropertyName\":\"DZJZ_YX_JZML\",\"joinPropertyColumn\":\"BMSAH\"},{\"selfPropertyColumn\":\"MLBH\",\"joinPropertyName\":\"DZJZ_YX_JZML\",\"joinPropertyColumn\":\"MLBH\"}]}],\"layerMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"parentPropertyColumn\":\"BMSAH\"}]}";
String glaj="{\"dataModelName\":\"AJGLHZ\",\"objectProperties\":[{\"propertyName\":\"AJ_YX_GLAJJL\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"AJ_YX_GLAJJL\"},{\"propertyName\":\"YAJ_XX\",\"system\":\"tyyw2plus\",\"propertyEntity\":\"DL_GG_AJXX2\",\"propertyMappings\":[{\"selfPropertyColumn\":\"BMSAH\",\"joinPropertyName\":\"AJ_YX_GLAJJL\",\"joinPropertyColumn\":\"YAJ_BMSAH\"}]}],\"layerMappings\":[{\"selfPropertyColumn\":\"GLAJ_BMSAH\",\"parentPropertyColumn\":\"BMSAH\"}]}";
objProps.add(JSON.parseObject(aj));
if(!model.containsKey("nestedDataModels"))
model.put("nestedDataModels",new JSONArray());
JSONArray nested=model.getJSONArray("nestedDataModels");
nested.add(JSON.parseObject(blry));
nested.add(JSON.parseObject(wshz));
nested.add(JSON.parseObject(jzhz));
nested.add(JSON.parseObject(glaj));
}
}
}
DataModel dataModel = JSON.toJavaObject(model,DataModel.class);
dataModel.setModelString(JSON.toJSONString(model));
return dataModel; return dataModel;
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册