Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
45fa7609
Commit
45fa7609
authored
Jul 14, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码生成器调整
parent
78427b22
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
Common.java
.../com/yifu.cloud.plus.v1/yifu/common/core/util/Common.java
+20
-1
ColumnEntity.java
.../yifu.cloud.plus.v1/yifu/codegen/entity/ColumnEntity.java
+5
-0
CodeGenKits.java
.../yifu.cloud.plus.v1/yifu/codegen/support/CodeGenKits.java
+4
-0
No files found.
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/util/Common.java
View file @
45fa7609
...
...
@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.common.core.util;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
java.lang.reflect.Method
;
import
java.util.ArrayList
;
...
...
@@ -31,7 +32,25 @@ public class Common {
public
static
boolean
isEmpty
(
String
str
)
{
return
null
==
str
||
""
.
equals
(
str
.
trim
())
||
"null"
.
equals
(
str
.
trim
())
||
"undefinded"
.
equals
(
str
.
trim
());
}
/**
* 截取startStr和endStr中间的字符串(开区间)
*
* @param startStr 开始的标志
* @param endStr 结束标志
* @param src 源串
* @return 返回符合要求的字符串或者返回null
* @author: fxj
*/
public
static
String
subByStr
(
String
startStr
,
String
endStr
,
String
src
)
{
if
(
StringUtils
.
isNotBlank
(
src
)
&&
StringUtils
.
isNotBlank
(
startStr
)
&&
StringUtils
.
isNotBlank
(
endStr
))
{
int
start
=
src
.
indexOf
(
startStr
);
int
end
=
src
.
indexOf
(
endStr
);
if
(
end
>
start
&&
start
>
-
1
)
{
return
src
.
substring
(
start
+
1
,
end
);
}
}
return
null
;
}
/**
* 对象null
*
...
...
yifu-visual/yifu-codegen/src/main/java/com/yifu.cloud.plus.v1/yifu/codegen/entity/ColumnEntity.java
View file @
45fa7609
...
...
@@ -75,4 +75,9 @@ public class ColumnEntity {
*/
private
Boolean
hidden
;
/**
* 是否隐藏
*/
private
String
maxLength
;
}
yifu-visual/yifu-codegen/src/main/java/com/yifu.cloud.plus.v1/yifu/codegen/support/CodeGenKits.java
View file @
45fa7609
...
...
@@ -26,6 +26,7 @@ import com.yifu.cloud.plus.v1.yifu.codegen.entity.GenFormConf;
import
com.yifu.cloud.plus.v1.yifu.codegen.entity.TableEntity
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
lombok.SneakyThrows
;
import
lombok.experimental.UtilityClass
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -183,6 +184,9 @@ public class CodeGenKits {
String
dataType
=
StrUtil
.
subBefore
(
columnEntity
.
getDataType
(),
"("
,
false
);
String
attrType
=
config
.
getString
(
dataType
,
"unknowType"
);
columnEntity
.
setAttrType
(
attrType
);
if
(
"String"
.
equals
(
attrType
))
{
columnEntity
.
setMaxLength
(
Common
.
subByStr
(
"("
,
")"
,
column
.
get
(
"columnType"
)));
}
if
(!
hasBigDecimal
&&
"BigDecimal"
.
equals
(
attrType
))
{
hasBigDecimal
=
true
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment