Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
c6c2fbb9
提交
c6c2fbb9
编写于
12月 14, 2021
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
push
上级
30c6f92b
变更
16
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
802 行增加
和
1560 行删除
+802
-1560
DefaultGenerator.java
...re/src/main/java/cn/ibizlab/codegen/DefaultGenerator.java
+0
-5
DstSystemModel.java
...src/main/java/cn/ibizlab/codegen/lite/DstSystemModel.java
+0
-172
FieldModel.java
...ore/src/main/java/cn/ibizlab/codegen/lite/FieldModel.java
+0
-116
MetaEntityModel.java
...rc/main/java/cn/ibizlab/codegen/lite/MetaEntityModel.java
+0
-154
MetaFieldModel.java
...src/main/java/cn/ibizlab/codegen/lite/MetaFieldModel.java
+0
-313
MetaRelationshipModel.java
...n/java/cn/ibizlab/codegen/lite/MetaRelationshipModel.java
+0
-151
Setting.java
...r-core/src/main/java/cn/ibizlab/codegen/lite/Setting.java
+0
-81
DataSetModel.java
.../src/main/java/cn/ibizlab/codegen/model/DataSetModel.java
+2
-2
DynamicModelStorage.java
...in/java/cn/ibizlab/codegen/model/DynamicModelStorage.java
+85
-289
EntityModel.java
...e/src/main/java/cn/ibizlab/codegen/model/EntityModel.java
+394
-0
FieldModel.java
...re/src/main/java/cn/ibizlab/codegen/model/FieldModel.java
+227
-0
LookupModel.java
...e/src/main/java/cn/ibizlab/codegen/model/LookupModel.java
+2
-2
ModelStorage.java
.../src/main/java/cn/ibizlab/codegen/model/ModelStorage.java
+4
-24
PojoSchema.java
...re/src/main/java/cn/ibizlab/codegen/model/PojoSchema.java
+1
-10
RelationshipModel.java
...main/java/cn/ibizlab/codegen/model/RelationshipModel.java
+60
-0
TransUtils.java
...re/src/main/java/cn/ibizlab/codegen/model/TransUtils.java
+27
-241
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/DefaultGenerator.java
浏览文件 @
c6c2fbb9
...
...
@@ -18,20 +18,15 @@
package
cn
.
ibizlab
.
codegen
;
import
cn.ibizlab.codegen.ignore.CodegenIgnoreProcessor
;
import
cn.ibizlab.codegen.lite.DynamicModelStorage
;
import
cn.ibizlab.codegen.model.CliOption
;
import
cn.ibizlab.codegen.model.ModelStorage
;
import
cn.ibizlab.codegen.templating.*
;
import
cn.ibizlab.codegen.templating.TemplatePathLocator
;
import
cn.ibizlab.codegen.templating.TemplateProcessor
;
import
cn.ibizlab.codegen.templating.TemplatingEngineAdapter
;
import
cn.ibizlab.codegen.templating.*
;
import
com.github.mustachejava.DefaultMustacheFactory
;
import
com.github.mustachejava.Mustache
;
import
lombok.extern.slf4j.Slf4j
;
import
java.io.*
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.util.*
;
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/lite/DstSystemModel.java
已删除
100644 → 0
浏览文件 @
30c6f92b
package
cn
.
ibizlab
.
codegen
.
lite
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
cn.ibizlab.codegen.utils.DataObject
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
lombok.experimental.Accessors
;
import
org.springframework.util.StringUtils
;
import
java.io.IOException
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Getter
@Setter
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@JsonIgnoreProperties
(
value
=
"handler"
)
public
class
DstSystemModel
{
/**
* 系统标识
*/
@JSONField
(
name
=
"pssystemid"
)
@JsonProperty
(
"pssystemid"
)
private
String
pssystemid
;
/**
* 系统名称
*/
@JSONField
(
name
=
"pssystemname"
)
@JsonProperty
(
"pssystemname"
)
private
String
pssystemname
;
/**
* 结构
*/
@JSONField
(
name
=
"sysstructure"
)
@JsonProperty
(
"sysstructure"
)
private
Map
sysstructure
;
/**
* 应用
*/
@JSONField
(
name
=
"apps"
)
@JsonProperty
(
"apps"
)
private
List
<
App
>
apps
;
public
DstSystemModel
addApp
(
App
app
)
{
if
(
apps
==
null
)
apps
=
new
ArrayList
<>();
apps
.
add
(
app
.
setSystemid
(
this
.
pssystemid
));
return
this
;
}
@Getter
@Setter
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@JsonInclude
(
JsonInclude
.
Include
.
NON_EMPTY
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
static
class
App
{
private
String
id
;
private
String
label
;
private
String
systemid
;
private
String
fullname
;
private
String
type
;
private
String
group
;
private
String
icon
;
private
Integer
visabled
;
private
String
addr
;
}
/**
* 校验
*/
@JSONField
(
name
=
"md5check"
)
@JsonProperty
(
"md5check"
)
private
String
md5check
;
/**
* 排序
*/
@JSONField
(
name
=
"showorder"
)
@JsonProperty
(
"showorder"
)
private
Integer
showorder
;
private
Map
<
String
,
Object
>
extensionparams
;
public
DstSystemModel
setDynamicModelPath
(
String
dynamic_model_path
)
{
if
(
extensionparams
==
null
)
extensionparams
=
new
HashMap
<
String
,
Object
>();
extensionparams
.
put
(
"dynamic_model_path"
,
dynamic_model_path
);
return
this
;
}
@JSONField
(
serialize
=
false
)
@JsonIgnore
public
String
getDynamicModelPath
()
{
if
(
extensionparams
!=
null
&&
extensionparams
.
get
(
"dynamic_model_path"
)!=
null
)
return
extensionparams
.
get
(
"dynamic_model_path"
).
toString
();
return
null
;
}
public
DstSystemModel
setLastModify
(
Long
lastModify
)
{
if
(
extensionparams
==
null
)
extensionparams
=
new
HashMap
<
String
,
Object
>();
extensionparams
.
put
(
"last_modify"
,
lastModify
);
return
this
;
}
@JSONField
(
serialize
=
false
)
@JsonIgnore
public
Long
getLastModify
()
{
if
(
extensionparams
!=
null
&&
extensionparams
.
get
(
"last_modify"
)!=
null
)
return
DataObject
.
getLongValue
(
extensionparams
.
get
(
"last_modify"
),
0L
);
return
0L
;
}
public
DstSystemModel
fromPath
(
Path
path
)
{
try
{
if
(!
Files
.
exists
(
path
))
throw
new
IllegalArgumentException
(
"读取文件失败DstSystem:"
+
path
.
toString
());
JSONObject
jo
=
JSON
.
parseObject
(
new
String
(
Files
.
readAllBytes
(
path
),
StandardCharsets
.
UTF_8
));
this
.
setPssystemid
(
jo
.
getString
(
"codeName"
));
this
.
setPssystemname
(
jo
.
getString
(
"logicName"
));
this
.
setLastModify
(
path
.
toFile
().
lastModified
());
if
(
jo
.
containsKey
(
"getAllPSApps"
))
{
JSONArray
array
=
jo
.
getJSONArray
(
"getAllPSApps"
);
array
.
forEach
(
obj
->{
JSONObject
app
=(
JSONObject
)
obj
;
String
appPath
=
app
.
getString
(
"path"
);
if
(!
StringUtils
.
isEmpty
(
appPath
))
{
String
[]
args
=
appPath
.
split
(
"/"
);
if
(
args
.
length
==
3
)
{
String
appId
=
args
[
1
];
this
.
addApp
(
new
App
().
setId
(
appId
).
setLabel
(
appId
));
}
}
});
}
this
.
setDynamicModelPath
(
path
.
getParent
().
toAbsolutePath
().
toString
());
}
catch
(
IOException
e
)
{
throw
new
IllegalArgumentException
(
"读取文件失败DstSystem:"
+
path
.
toString
());
}
return
this
;
}
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/lite/FieldModel.java
已删除
100644 → 0
浏览文件 @
30c6f92b
package
cn
.
ibizlab
.
codegen
.
lite
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
cn.ibizlab.codegen.utils.DataObject
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
lombok.experimental.Accessors
;
import
org.springframework.util.StringUtils
;
@Getter
@Setter
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@JsonIgnoreProperties
(
value
=
"handler"
)
public
class
FieldModel
{
private
String
columnName
;
private
String
codeName
;
private
String
unionName
;
private
String
showName
;
private
String
comment
;
private
MetaFieldModel
field
;
private
RelationshipModel
reference
;
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
String
getColumnExp
()
{
if
(
field
.
getPhysicalField
()!=
null
&&
1
==
field
.
getPhysicalField
())
{
return
columnName
+
" as \""
+
columnName
.
toUpperCase
()+
"\""
;
}
else
if
(!
StringUtils
.
isEmpty
(
field
.
getExpression
()))
{
return
field
.
getExpression
()+
" as \""
+
columnName
.
toUpperCase
()+
"\""
;
}
return
""
;
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
boolean
isPhysicalField
()
{
return
this
.
getField
().
getPhysicalField
()!=
null
&&
1
==
this
.
getField
().
getPhysicalField
();
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
boolean
isKeyField
()
{
return
this
.
getField
().
getKeyField
()!=
null
&&
1
==
this
.
getField
().
getKeyField
();
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
boolean
isLogicValidField
()
{
return
"LOGICVALID"
.
equals
(
this
.
getField
().
getPredefined
());
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
boolean
isLastModifyField
()
{
return
"UPDATEDATE"
.
equals
(
this
.
getField
().
getPredefined
());
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
boolean
isCreateTimeField
()
{
return
"CREATEDATE"
.
equals
(
this
.
getField
().
getPredefined
());
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
boolean
isUnionKeyField
()
{
return
!
StringUtils
.
isEmpty
(
this
.
getField
().
getUnionKey
());
}
public
String
getPropType
()
{
String
dataType
=
this
.
getField
().
getDataType
().
toUpperCase
();
if
(
dataType
.
indexOf
(
"TEXT"
)>=
0
||
dataType
.
indexOf
(
"CHAR"
)>=
0
||
dataType
.
indexOf
(
"LOB"
)>=
0
)
return
"string"
;
else
if
(
dataType
.
indexOf
(
"TIME"
)>=
0
)
return
"date-time"
;
else
if
(
dataType
.
indexOf
(
"DATE"
)>=
0
)
return
"date"
;
else
if
(
dataType
.
indexOf
(
"NUM"
)>=
0
||
dataType
.
indexOf
(
"FLOAT"
)>=
0
||
dataType
.
indexOf
(
"DOUBLE"
)>=
0
||
dataType
.
indexOf
(
"DECIMAL"
)>=
0
)
return
"number"
;
else
if
(
dataType
.
indexOf
(
"INT"
)==
0
)
return
"integer"
;
return
"string"
;
}
public
String
getColumnName
(
String
dsType
)
{
return
DataObject
.
getStringValue
(
field
.
get
(
"column-"
+
dsType
.
toLowerCase
()),
getColumnName
());
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
private
Object
node
;
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/lite/MetaEntityModel.java
已删除
100644 → 0
浏览文件 @
30c6f92b
package
cn
.
ibizlab
.
codegen
.
lite
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
cn.ibizlab.codegen.utils.DataObject
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
lombok.experimental.Accessors
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
/**
* 实体[实体]
*/
@Getter
@Setter
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@JsonIgnoreProperties
(
value
=
"handler"
)
public
class
MetaEntityModel
{
/**
* 标识
*/
@JSONField
(
name
=
"entity_id"
)
@JsonProperty
(
"entity_id"
)
private
String
entityId
;
/**
* 实体名
*/
@JSONField
(
name
=
"entity_name"
)
@JsonProperty
(
"entity_name"
)
private
String
entityName
;
/**
* 逻辑名称
*/
@JSONField
(
name
=
"logic_name"
)
@JsonProperty
(
"logic_name"
)
private
String
logicName
;
/**
* 代码名称
*/
@JSONField
(
name
=
"code_name"
)
@JsonProperty
(
"code_name"
)
private
String
codeName
;
/**
* 表名称
*/
@JSONField
(
name
=
"table_name"
)
@JsonProperty
(
"table_name"
)
private
String
tableName
;
/**
* 系统标识
*/
@JSONField
(
name
=
"system_id"
)
@JsonProperty
(
"system_id"
)
private
String
systemId
;
/**
* 系统
*/
@JSONField
(
name
=
"system_name"
)
@JsonProperty
(
"system_name"
)
private
String
systemName
;
/**
* 数据源标识
*/
@JSONField
(
name
=
"ds_id"
)
@JsonProperty
(
"ds_id"
)
private
String
dsId
;
/**
* 数据源
*/
@JSONField
(
name
=
"ds_name"
)
@JsonProperty
(
"ds_name"
)
private
String
dsName
;
/**
* 模块标识
*/
@JSONField
(
name
=
"module_id"
)
@JsonProperty
(
"module_id"
)
private
String
moduleId
;
/**
* 模块
*/
@JSONField
(
name
=
"module_name"
)
@JsonProperty
(
"module_name"
)
private
String
moduleName
;
/**
* 扩展参数
*/
@JSONField
(
name
=
"ext_params"
)
@JsonProperty
(
"ext_params"
)
private
String
extParams
;
/**
* 排序
*/
@JSONField
(
name
=
"show_order"
)
@JsonProperty
(
"show_order"
)
private
Integer
showOrder
;
/**
* 创建时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"createdate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"createdate"
)
private
Timestamp
createdate
;
/**
* 最后修改时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"updatedate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"updatedate"
)
private
Timestamp
updatedate
;
@JSONField
(
serialize
=
false
)
@JsonIgnore
private
Map
<
String
,
Object
>
extensionparams
;
public
Object
get
(
String
key
)
{
if
(
extensionparams
==
null
)
extensionparams
=
Setting
.
getMap
(
extParams
);
return
extensionparams
.
get
(
key
);
}
public
MetaEntityModel
set
(
String
key
,
Object
value
)
{
if
(
value
==
null
)
return
this
;
if
(
extensionparams
==
null
)
extensionparams
=
Setting
.
getMap
(
extParams
);
extensionparams
.
put
(
key
,
value
);
List
<
Setting
>
settingList
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
String
,
Object
>
entry:
extensionparams
.
entrySet
())
{
if
(!
entry
.
getKey
().
equalsIgnoreCase
(
"param"
))
settingList
.
add
(
new
Setting
().
setProperty
(
entry
.
getKey
()).
setValue
(
DataObject
.
getStringValue
(
entry
.
getValue
(),
""
)));
}
return
setExtParams
(
JSON
.
toJSONString
(
settingList
));
}
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/lite/MetaFieldModel.java
已删除
100644 → 0
浏览文件 @
30c6f92b
package
cn
.
ibizlab
.
codegen
.
lite
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
cn.ibizlab.codegen.utils.DataObject
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
lombok.experimental.Accessors
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
/**
* 实体[属性]
*/
@Getter
@Setter
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@JsonIgnoreProperties
(
value
=
"handler"
)
@ApiModel
(
"属性"
)
public
class
MetaFieldModel
{
/**
* 属性标识
*/
@JSONField
(
name
=
"field_id"
)
@JsonProperty
(
"field_id"
)
@ApiModelProperty
(
"属性标识"
)
private
String
fieldId
;
/**
* 属性名称
*/
@JSONField
(
name
=
"field_name"
)
@JsonProperty
(
"field_name"
)
@ApiModelProperty
(
"属性名称"
)
private
String
fieldName
;
/**
* 代码名称
*/
@JSONField
(
name
=
"code_name"
)
@JsonProperty
(
"code_name"
)
@ApiModelProperty
(
"代码名称"
)
private
String
codeName
;
/**
* 实体标识
*/
@JSONField
(
name
=
"entity_id"
)
@JsonProperty
(
"entity_id"
)
@ApiModelProperty
(
"实体标识"
)
private
String
entityId
;
/**
* 实体名称
*/
@JSONField
(
name
=
"entity_name"
)
@JsonProperty
(
"entity_name"
)
@ApiModelProperty
(
"实体名称"
)
private
String
entityName
;
/**
* 实体代码名称
*/
@JSONField
(
name
=
"entity_code_name"
)
@JsonProperty
(
"entity_code_name"
)
@ApiModelProperty
(
"实体代码名称"
)
private
String
entityCodeName
;
/**
* 系统
*/
@JSONField
(
name
=
"system_id"
)
@JsonProperty
(
"system_id"
)
@ApiModelProperty
(
"系统"
)
private
String
systemId
;
/**
* 属性逻辑名
*/
@JSONField
(
name
=
"field_logic_name"
)
@JsonProperty
(
"field_logic_name"
)
@ApiModelProperty
(
"属性逻辑名"
)
private
String
fieldLogicName
;
/**
* 属性全路径名称
*/
@JSONField
(
name
=
"field_uni_name"
)
@JsonProperty
(
"field_uni_name"
)
@ApiModelProperty
(
"属性全路径名称"
)
private
String
fieldUniName
;
/**
* 显示名称
*/
@JSONField
(
name
=
"field_show_name"
)
@JsonProperty
(
"field_show_name"
)
@ApiModelProperty
(
"显示名称"
)
private
String
fieldShowName
;
/**
* 引用属性标识
*/
@JSONField
(
name
=
"ref_field_id"
)
@JsonProperty
(
"ref_field_id"
)
@ApiModelProperty
(
"引用属性标识"
)
private
String
refFieldId
;
/**
* 引用属性名称
*/
@JSONField
(
name
=
"ref_field_name"
)
@JsonProperty
(
"ref_field_name"
)
@ApiModelProperty
(
"引用属性名称"
)
private
String
refFieldName
;
/**
* 引用属性代码名称
*/
@JSONField
(
name
=
"ref_field_code_name"
)
@JsonProperty
(
"ref_field_code_name"
)
@ApiModelProperty
(
"引用属性代码名称"
)
private
String
refFieldCodeName
;
/**
* 引用关系标识
*/
@JSONField
(
name
=
"relation_id"
)
@JsonProperty
(
"relation_id"
)
@ApiModelProperty
(
"引用关系标识"
)
private
String
relationId
;
/**
* 引用关系
*/
@JSONField
(
name
=
"relation_name"
)
@JsonProperty
(
"relation_name"
)
@ApiModelProperty
(
"引用关系"
)
private
String
relationName
;
/**
* 关系代码
*/
@JSONField
(
name
=
"relation_code_name"
)
@JsonProperty
(
"relation_code_name"
)
@ApiModelProperty
(
"关系代码"
)
private
String
relationCodeName
;
/**
* 引用实体
*/
@JSONField
(
name
=
"ref_entity_name"
)
@JsonProperty
(
"ref_entity_name"
)
@ApiModelProperty
(
"引用实体"
)
private
String
refEntityName
;
/**
* 主键
*/
@JSONField
(
name
=
"key_field"
)
@JsonProperty
(
"key_field"
)
@ApiModelProperty
(
"主键"
)
private
Integer
keyField
;
/**
* 主信息
*/
@JSONField
(
name
=
"major_field"
)
@JsonProperty
(
"major_field"
)
@ApiModelProperty
(
"主信息"
)
private
Integer
majorField
;
/**
* 联合主键
*/
@JSONField
(
name
=
"union_key"
)
@JsonProperty
(
"union_key"
)
@ApiModelProperty
(
"联合主键"
)
private
String
unionKey
;
/**
* 属性类型
*/
@JSONField
(
name
=
"field_type"
)
@JsonProperty
(
"field_type"
)
@ApiModelProperty
(
"属性类型"
)
private
String
fieldType
;
/**
* 预定义类型
*/
@JSONField
(
name
=
"predefined"
)
@JsonProperty
(
"predefined"
)
@ApiModelProperty
(
"预定义类型"
)
private
String
predefined
;
/**
* 数据字典
*/
@JSONField
(
name
=
"dict"
)
@JsonProperty
(
"dict"
)
@ApiModelProperty
(
"数据字典"
)
private
String
dict
;
/**
* 允许为空
*/
@JSONField
(
name
=
"nullable"
)
@JsonProperty
(
"nullable"
)
@ApiModelProperty
(
"允许为空"
)
private
Integer
nullable
;
/**
* 物理属性
*/
@JSONField
(
name
=
"physical_field"
)
@JsonProperty
(
"physical_field"
)
@ApiModelProperty
(
"物理属性"
)
private
Integer
physicalField
;
/**
* 数据类型
*/
@JSONField
(
name
=
"data_type"
)
@JsonProperty
(
"data_type"
)
@ApiModelProperty
(
"数据类型"
)
private
String
dataType
;
/**
* 长度
*/
@JSONField
(
name
=
"data_length"
)
@JsonProperty
(
"data_length"
)
@ApiModelProperty
(
"长度"
)
private
Integer
dataLength
;
/**
* 精度
*/
@JSONField
(
name
=
"data_preci"
)
@JsonProperty
(
"data_preci"
)
@ApiModelProperty
(
"精度"
)
private
Integer
dataPreci
;
/**
* 逻辑表达式
*/
@JSONField
(
name
=
"expression"
)
@JsonProperty
(
"expression"
)
@ApiModelProperty
(
"逻辑表达式"
)
private
String
expression
;
/**
* 扩展属性
*/
@JSONField
(
name
=
"extension_field"
)
@JsonProperty
(
"extension_field"
)
@ApiModelProperty
(
"扩展属性"
)
private
Integer
extensionField
;
/**
* 审计
*/
@JSONField
(
name
=
"is_enable_audit"
)
@JsonProperty
(
"is_enable_audit"
)
@ApiModelProperty
(
"审计"
)
private
Integer
isEnableAudit
;
/**
* 排序
*/
@JSONField
(
name
=
"show_order"
)
@JsonProperty
(
"show_order"
)
@ApiModelProperty
(
"排序"
)
private
Integer
showOrder
;
/**
* 创建时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"createdate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"createdate"
)
@ApiModelProperty
(
"创建时间"
)
private
Timestamp
createdate
;
/**
* 最后修改时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"updatedate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"updatedate"
)
@ApiModelProperty
(
"最后修改时间"
)
private
Timestamp
updatedate
;
/**
* 扩展参数
*/
@JSONField
(
name
=
"ext_params"
)
@JsonProperty
(
"ext_params"
)
private
String
extParams
;
@JSONField
(
serialize
=
false
)
@JsonIgnore
private
Map
<
String
,
Object
>
extensionparams
;
public
Object
get
(
String
key
)
{
if
(
extensionparams
==
null
)
extensionparams
=
Setting
.
getMap
(
extParams
);
return
extensionparams
.
get
(
key
);
}
public
MetaFieldModel
set
(
String
key
,
Object
value
)
{
if
(
value
==
null
)
return
this
;
if
(
extensionparams
==
null
)
extensionparams
=
Setting
.
getMap
(
extParams
);
extensionparams
.
put
(
key
,
value
);
List
<
Setting
>
settingList
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
String
,
Object
>
entry:
extensionparams
.
entrySet
())
{
if
(!
entry
.
getKey
().
equalsIgnoreCase
(
"param"
))
settingList
.
add
(
new
Setting
().
setProperty
(
entry
.
getKey
()).
setValue
(
DataObject
.
getStringValue
(
entry
.
getValue
(),
""
)));
}
return
setExtParams
(
JSON
.
toJSONString
(
settingList
));
}
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/lite/MetaRelationshipModel.java
已删除
100644 → 0
浏览文件 @
30c6f92b
package
cn
.
ibizlab
.
codegen
.
lite
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 实体[实体关系]
*/
@Getter
@Setter
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@JsonIgnoreProperties
(
value
=
"handler"
)
@ApiModel
(
"实体关系"
)
public
class
MetaRelationshipModel
implements
Serializable
{
/**
* 关系标识
*/
@JSONField
(
name
=
"id"
)
@JsonProperty
(
"id"
)
@ApiModelProperty
(
"关系标识"
)
private
String
id
;
/**
* 关系名称
*/
@JSONField
(
name
=
"name"
)
@JsonProperty
(
"name"
)
@ApiModelProperty
(
"关系名称"
)
private
String
name
;
/**
* 类型
*/
@JSONField
(
name
=
"relation_type"
)
@JsonProperty
(
"relation_type"
)
@ApiModelProperty
(
"类型"
)
private
String
relationType
;
/**
* 代码名称
*/
@JSONField
(
name
=
"code_name"
)
@JsonProperty
(
"code_name"
)
@ApiModelProperty
(
"代码名称"
)
private
String
codeName
;
/**
* 实体标识
*/
@JSONField
(
name
=
"entity_id"
)
@JsonProperty
(
"entity_id"
)
@ApiModelProperty
(
"实体标识"
)
private
String
entityId
;
/**
* 实体名称
*/
@JSONField
(
name
=
"entity_name"
)
@JsonProperty
(
"entity_name"
)
@ApiModelProperty
(
"实体名称"
)
private
String
entityName
;
/**
* 实体代码名称
*/
@JSONField
(
name
=
"entity_code_name"
)
@JsonProperty
(
"entity_code_name"
)
@ApiModelProperty
(
"实体代码名称"
)
private
String
entityCodeName
;
/**
* 引用实体标识
*/
@JSONField
(
name
=
"ref_entity_id"
)
@JsonProperty
(
"ref_entity_id"
)
@ApiModelProperty
(
"引用实体标识"
)
private
String
refEntityId
;
/**
* 引用实体名称
*/
@JSONField
(
name
=
"ref_entity_name"
)
@JsonProperty
(
"ref_entity_name"
)
@ApiModelProperty
(
"引用实体名称"
)
private
String
refEntityName
;
/**
* 引用实体代码名称
*/
@JSONField
(
name
=
"ref_entity_code_name"
)
@JsonProperty
(
"ref_entity_code_name"
)
@ApiModelProperty
(
"引用实体代码名称"
)
private
String
refEntityCodeName
;
/**
* 嵌套代码名称
*/
@JSONField
(
name
=
"nested_name"
)
@JsonProperty
(
"nested_name"
)
@ApiModelProperty
(
"嵌套代码名称"
)
private
String
nestedName
;
/**
* 系统
*/
@JSONField
(
name
=
"system_id"
)
@JsonProperty
(
"system_id"
)
@ApiModelProperty
(
"系统"
)
private
String
systemId
;
/**
* 创建时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"createdate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"createdate"
)
@ApiModelProperty
(
"创建时间"
)
private
Timestamp
createdate
;
/**
* 最后修改时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"updatedate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"updatedate"
)
@ApiModelProperty
(
"最后修改时间"
)
private
Timestamp
updatedate
;
/**
* lookup
*/
@JSONField
(
name
=
"lookups"
)
@JsonProperty
(
"lookups"
)
private
List
<
MetaLookupModel
>
lookup
;
public
MetaRelationshipModel
addLookup
(
MetaLookupModel
obj
)
{
if
(
lookup
==
null
)
lookup
=
new
ArrayList
<>();
lookup
.
add
(
obj
);
return
this
;
}
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/lite/Setting.java
已删除
100644 → 0
浏览文件 @
30c6f92b
package
cn
.
ibizlab
.
codegen
.
lite
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
cn.ibizlab.codegen.utils.DataObject
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
lombok.experimental.Accessors
;
import
org.springframework.util.StringUtils
;
import
java.io.IOException
;
import
java.io.StringReader
;
import
java.util.*
;
@Getter
@Setter
@NoArgsConstructor
@Accessors
(
chain
=
true
)
public
class
Setting
{
private
String
property
;
private
String
value
;
public
static
String
getValue
(
String
configString
,
String
propertyName
)
{
return
DataObject
.
getStringValue
(
getMap
(
configString
).
get
(
propertyName
),
""
);
}
public
static
Map
getMap
(
String
configString
)
{
Map
map
=
new
HashMap
();
map
.
put
(
"param"
,
configString
);
if
(!(
StringUtils
.
isEmpty
(
configString
)))
{
try
{
Object
obj
=
JSON
.
parse
(
configString
);
if
(
obj
==
null
)
return
map
;
else
if
(
obj
instanceof
JSONArray
)
{
List
<
Setting
>
settings
=
JSONArray
.
parseArray
(
configString
,
Setting
.
class
);
for
(
Setting
setting:
settings
)
map
.
put
(
setting
.
getProperty
(),
setting
.
getValue
());
}
else
if
(
obj
instanceof
JSONObject
)
{
JSONObject
jo
=
(
JSONObject
)
obj
;
jo
.
keySet
().
forEach
(
key
->{
map
.
put
(
key
,
jo
.
get
(
key
));
});
}
}
catch
(
Exception
ex
)
{
if
(
configString
.
indexOf
(
"="
)>
0
)
{
Properties
proper
=
new
Properties
();
try
{
proper
.
load
(
new
StringReader
(
configString
));
//把字符串转为reader
}
catch
(
IOException
e
)
{
}
Enumeration
enum1
=
proper
.
propertyNames
();
while
(
enum1
.
hasMoreElements
())
{
String
strKey
=
(
String
)
enum1
.
nextElement
();
String
strValue
=
proper
.
getProperty
(
strKey
);
map
.
put
(
strKey
,
strValue
);
}
}
}
}
return
map
;
}
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/
lite/Meta
DataSetModel.java
→
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/
model/
DataSetModel.java
浏览文件 @
c6c2fbb9
package
cn
.
ibizlab
.
codegen
.
lite
;
package
cn
.
ibizlab
.
codegen
.
model
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
...
...
@@ -19,7 +19,7 @@ import lombok.experimental.Accessors;
@Accessors
(
chain
=
true
)
@JsonIgnoreProperties
(
value
=
"handler"
)
@ApiModel
(
"数据集"
)
public
class
Meta
DataSetModel
{
public
class
DataSetModel
{
/**
* 标识
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/
lite
/DynamicModelStorage.java
→
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/
model
/DynamicModelStorage.java
浏览文件 @
c6c2fbb9
此差异已折叠。
点击以展开。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/
lite
/EntityModel.java
→
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/
model
/EntityModel.java
浏览文件 @
c6c2fbb9
此差异已折叠。
点击以展开。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/FieldModel.java
0 → 100644
浏览文件 @
c6c2fbb9
package
cn
.
ibizlab
.
codegen
.
model
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
lombok.experimental.Accessors
;
import
net.ibizsys.model.dataentity.defield.IPSDEField
;
import
org.springframework.util.StringUtils
;
import
java.util.LinkedHashSet
;
import
java.util.Set
;
@Getter
@Setter
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@JsonIgnoreProperties
(
value
=
"handler"
)
public
class
FieldModel
{
public
String
getCodeName
()
{
return
getField
().
getCodeName
();
}
public
String
getFieldName
()
{
return
getField
().
getName
();
}
public
String
getColumnName
(){
return
getField
().
getName
();
}
public
String
getLogicName
()
{
return
getField
().
getLogicName
();
}
public
DataType
getType
()
{
return
DataType
.
findTypeName
(
this
.
getField
().
getStdDataType
());
}
private
String
expression
;
private
IPSDEField
field
;
private
RelationshipModel
reference
;
private
String
refFieldName
;
private
String
refFieldCodeName
;
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
boolean
isPhysicalField
()
{
return
this
.
getField
().
isPhisicalDEField
();
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
boolean
isKeyField
()
{
return
this
.
getField
().
isKeyDEField
();
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
boolean
isLogicValidField
()
{
return
"LOGICVALID"
.
equals
(
this
.
getField
().
getPredefinedType
());
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
boolean
isLastModifyField
()
{
return
"UPDATEDATE"
.
equals
(
this
.
getField
().
getPredefinedType
());
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
boolean
isCreateTimeField
()
{
return
"CREATEDATE"
.
equals
(
this
.
getField
().
getPredefinedType
());
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
boolean
isUnionKeyField
()
{
return
!
StringUtils
.
isEmpty
(
this
.
getField
().
getUnionKeyValue
());
}
public
String
getDefaultValue
()
{
if
((!
StringUtils
.
isEmpty
(
getField
().
getDefaultValueType
()))||(!
StringUtils
.
isEmpty
(
getField
().
getDefaultValue
())))
{
String
defaultValue
=
""
;
if
(
StringUtils
.
isEmpty
(
getField
().
getDefaultValueType
())||
"NONE"
.
equalsIgnoreCase
(
getField
().
getDefaultValueType
()))
{
defaultValue
=
getField
().
getDefaultValue
();
}
else
if
(!
StringUtils
.
isEmpty
(
getField
().
getDefaultValue
()))
{
defaultValue
=
String
.
format
(
"${%1$s.%2$s}"
,
getField
().
getDefaultValueType
(),
getField
().
getDefaultValue
());
}
else
{
defaultValue
=
String
.
format
(
"${%1$s}"
,
getField
().
getDefaultValueType
());
}
return
defaultValue
;
}
return
null
;
}
public
Set
<
String
>
getSearchMode
()
{
Set
<
String
>
modes
=
new
LinkedHashSet
<>();
if
(
getField
().
getAllPSDEFSearchModes
()!=
null
)
{
getField
().
getAllPSDEFSearchModes
().
forEach
(
item
->
modes
.
add
(
item
.
getValueOP
().
toLowerCase
()));
}
if
(
getField
().
isEnableQuickSearch
())
modes
.
add
(
"query"
);
return
modes
;
}
private
DataObj
extParams
=
new
DataObj
();
public
FieldModel
set
(
String
key
,
Object
val
)
{
extParams
.
set
(
key
,
val
);
return
this
;
}
public
String
getStringValue
(
String
key
,
String
defaultVal
)
{
return
extParams
.
getStringValue
(
key
,
defaultVal
);
}
public
String
getColumnName
(
String
dsType
)
{
return
this
.
getStringValue
(
"column-"
+
dsType
.
toLowerCase
(),
getColumnName
());
}
public
static
enum
DataType
{
UNKNOWN
(
0
,
"UNKNOWN"
,
"string"
,
"String"
),
BIGINT
(
1
,
"BIGINT"
,
"number"
,
"Long"
),
BINARY
(
2
,
"BINARY"
,
"string"
,
"String"
),
BIT
(
3
,
"BIT"
,
"boolean"
,
"Boolean"
),
CHAR
(
4
,
"CHAR"
,
"string"
,
"String"
),
DATETIME
(
5
,
"DATETIME"
,
"string"
,
"Timestamp"
),
DECIMAL
(
6
,
"DECIMAL"
,
"number"
,
"BigDecimal"
),
FLOAT
(
7
,
"FLOAT"
,
"number"
,
"BigDecimal"
),
IMAGE
(
8
,
"IMAGE"
,
"string"
,
"String"
),
INT
(
9
,
"INT"
,
"number"
,
"Integer"
),
MONEY
(
10
,
"MONEY"
,
"number"
,
"BigDecimal"
),
NCHAR
(
11
,
"NCHAR"
,
"string"
,
"String"
),
NTEXT
(
12
,
"NTEXT"
,
"string"
,
"String"
),
NVARCHAR
(
13
,
"NVARCHAR"
,
"string"
,
"String"
),
NUMERIC
(
14
,
"NUMERIC"
,
"number"
,
"BigDecimal"
),
REAL
(
15
,
"REAL"
,
"number"
,
"Float"
),
SMALLDATETIME
(
16
,
"SMALLDATETIME"
,
"string"
,
"Timestamp"
),
SMALLINT
(
17
,
"SMALLINT"
,
"number"
,
"Integer"
),
SMALLMONEY
(
18
,
"SMALLMONEY"
,
"number"
,
"BigDecimal"
),
SQL_VARIANT
(
19
,
"SQL_VARIANT"
,
"string"
,
"String"
),
SYSNAME
(
20
,
"SYSNAME"
,
"string"
,
"String"
),
TEXT
(
21
,
"TEXT"
,
"string"
,
"String"
),
TIMESTAMP
(
22
,
"TIMESTAMP"
,
"string"
,
"Timestamp"
),
TINYINT
(
23
,
"TINYINT"
,
"number"
,
"Integer"
),
VARBINARY
(
24
,
"VARBINARY"
,
"string"
,
"String"
),
VARCHAR
(
25
,
"VARCHAR"
,
"string"
,
"String"
),
UNIQUEIDENTIFIER
(
26
,
"UNIQUEIDENTIFIER"
,
"string"
,
"String"
),
DATE
(
27
,
"DATE"
,
"string"
,
"Timestamp"
),
TIME
(
28
,
"TIME"
,
"string"
,
"Timestamp"
);
public
final
int
code
;
public
final
String
name
;
public
final
String
prop
;
public
final
String
java
;
private
DataType
(
int
code
,
String
name
,
String
prop
,
String
java
)
{
this
.
code
=
code
;
this
.
name
=
name
;
this
.
prop
=
prop
;
this
.
java
=
java
;
}
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
public
String
getProp
()
{
return
prop
;
}
public
String
getJava
()
{
return
java
;
}
public
static
DataType
findTypeName
(
Integer
type
)
{
for
(
DataType
userTypeEnum
:
DataType
.
values
())
{
if
(
userTypeEnum
.
getCode
()==
type
)
{
return
userTypeEnum
;
}
}
return
VARCHAR
;
}
}
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/
lite/Meta
LookupModel.java
→
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/
model/
LookupModel.java
浏览文件 @
c6c2fbb9
package
cn
.
ibizlab
.
codegen
.
lite
;
package
cn
.
ibizlab
.
codegen
.
model
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
...
...
@@ -20,7 +20,7 @@ import java.io.Serializable;
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@ApiModel
(
"lookup"
)
public
class
Meta
LookupModel
implements
Serializable
{
public
class
LookupModel
implements
Serializable
{
/**
* 标识
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/ModelStorage.java
浏览文件 @
c6c2fbb9
package
cn
.
ibizlab
.
codegen
.
model
;
import
cn.ibizlab.codegen.lite.DynamicModelStorage
;
import
cn.ibizlab.codegen.lite.EntityModel
;
import
cn.ibizlab.codegen.CodegenConfig
;
import
cn.ibizlab.codegen.CodegenConstants
;
...
...
@@ -60,25 +58,7 @@ public class ModelStorage {
}
public
PojoSchema
getEntitySchema
(
String
entity
)
{
EntityModel
entityModel
=
null
;
try
{
entityModel
=
dynamicService
.
getDynamicEntity
(
entity
);
}
catch
(
Exception
exception
)
{
exception
.
printStackTrace
();
}
Assert
.
notNull
(
entityModel
,
"loadDOModel未找到实体"
+
"."
+
entity
);
PojoSchema
schema
=
TransUtils
.
EntityModelModel2Schema
(
entityModel
);
Assert
.
notNull
(
schema
,
"loadDOModel未找到实体"
+
"."
+
entity
);
for
(
String
dsType
:
entityModel
.
getDsTypes
())
{
POSchema
poSchema
=
TransUtils
.
EntityModelModel2PO
(
entityModel
,
dsType
);
if
(
poSchema
!=
null
)
{
schema
.
addPOSchema
(
dsType
,
poSchema
);
}
}
return
schema
;
}
private
Map
<
TemplateFileType
,
CliData
>
templateData
=
new
HashMap
<>();
...
...
@@ -122,9 +102,9 @@ public class ModelStorage {
else
if
(
type
.
equals
(
TemplateFileType
.
entity
))
{
dynamicService
.
getPSSystem
().
getAllPSDataEntities
().
forEach
(
item
->{
PojoSchema
pojoSchema
=
this
.
getEntitySchema
(
item
.
getName
());
CliOption
opt
=
newCliOption
(
TemplateFileType
.
entity
).
setCliSubType
(
pojoSchema
.
getStorageMode
()).
setModule
(
pojoS
chema
.
getModule
())
.
baseData
(
pojoS
chema
,
item
.
getCodeName
());
EntityModel
schema
=
dynamicService
.
getEntitySchema
(
item
.
getId
());
CliOption
opt
=
newCliOption
(
TemplateFileType
.
entity
).
setCliSubType
(
schema
.
getStorageMode
()).
setModule
(
s
chema
.
getModule
())
.
baseData
(
s
chema
,
item
.
getCodeName
());
rt
.
addOption
(
opt
);
});
}
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/PojoSchema.java
浏览文件 @
c6c2fbb9
...
...
@@ -626,16 +626,7 @@ public class PojoSchema {
}
}
if
((
"default"
.
equals
(
name
)||
this
.
getDefaultDataSoruce
().
equalsIgnoreCase
(
name
)))
{
POSchema
defaultPOSchema
=
TransUtils
.
PojoSchema2PO
(
this
);
if
(
defaultPOSchema
!=
null
)
{
poSchemas
.
put
(
"default"
,
defaultPOSchema
);
if
(!
StringUtils
.
isEmpty
(
this
.
getDefaultDataSoruce
()))
poSchemas
.
put
(
this
.
getDefaultDataSoruce
().
toLowerCase
(),
defaultPOSchema
);
return
defaultPOSchema
;
}
}
return
null
;
}
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/
lite
/RelationshipModel.java
→
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/
model
/RelationshipModel.java
浏览文件 @
c6c2fbb9
package
cn
.
ibizlab
.
codegen
.
lite
;
package
cn
.
ibizlab
.
codegen
.
model
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
lombok.experimental.Accessors
;
import
net.ibizsys.model.dataentity.der.IPSDERBase
;
import
java.util.ArrayList
;
import
java.util.List
;
@Getter
@Setter
...
...
@@ -15,6 +17,8 @@ import lombok.experimental.Accessors;
@JsonIgnoreProperties
(
value
=
"handler"
)
public
class
RelationshipModel
{
private
String
name
;
private
String
codeName
;
private
String
entityName
;
...
...
@@ -23,18 +27,34 @@ public class RelationshipModel {
private
String
entityLogicName
;
private
String
systemId
;
private
String
dataSourceName
;
private
String
tableName
;
private
String
entityId
;
private
MetaRelationshipModel
relation
;
private
String
relationType
;
private
IPSDERBase
relation
;
private
List
<
FieldModel
>
fields
;
public
RelationshipModel
addField
(
FieldModel
obj
)
{
if
(
fields
==
null
)
fields
=
new
ArrayList
<>();
fields
.
add
(
obj
);
return
this
;
}
private
List
<
LookupModel
>
lookup
;
public
RelationshipModel
addLookup
(
LookupModel
obj
)
{
if
(
lookup
==
null
)
lookup
=
new
ArrayList
<>();
lookup
.
add
(
obj
);
return
this
;
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
private
Object
node
;
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/TransUtils.java
浏览文件 @
c6c2fbb9
此差异已折叠。
点击以展开。
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录