Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sts网站
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
liyang
sts网站
Commits
81630a09
Commit
81630a09
authored
Feb 13, 2022
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码生成同步保留必填/类型选项
parent
21780d81
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
GenConstants.java
...src/main/java/com/ruoyi/common/constant/GenConstants.java
+3
-0
GenTableServiceImpl.java
...java/com/ruoyi/generator/service/GenTableServiceImpl.java
+10
-1
GenUtils.java
...ator/src/main/java/com/ruoyi/generator/util/GenUtils.java
+1
-0
No files found.
ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java
View file @
81630a09
...
@@ -109,6 +109,9 @@ public class GenConstants
...
@@ -109,6 +109,9 @@ public class GenConstants
/** 模糊查询 */
/** 模糊查询 */
public
static
final
String
QUERY_LIKE
=
"LIKE"
;
public
static
final
String
QUERY_LIKE
=
"LIKE"
;
/** 相等查询 */
public
static
final
String
QUERY_EQ
=
"EQ"
;
/** 需要 */
/** 需要 */
public
static
final
String
REQUIRE
=
"1"
;
public
static
final
String
REQUIRE
=
"1"
;
}
}
ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java
View file @
81630a09
...
@@ -304,8 +304,17 @@ public class GenTableServiceImpl implements IGenTableService
...
@@ -304,8 +304,17 @@ public class GenTableServiceImpl implements IGenTableService
column
.
setColumnId
(
prevColumn
.
getColumnId
());
column
.
setColumnId
(
prevColumn
.
getColumnId
());
if
(
column
.
isList
())
if
(
column
.
isList
())
{
{
// 如果是列表,继续保留
字典类型
// 如果是列表,继续保留
查询方式/字典类型选项
column
.
setDictType
(
prevColumn
.
getDictType
());
column
.
setDictType
(
prevColumn
.
getDictType
());
column
.
setQueryType
(
prevColumn
.
getQueryType
());
}
if
(
StringUtils
.
isNotEmpty
(
prevColumn
.
getIsRequired
())
&&
!
column
.
isPk
()
&&
(
column
.
isInsert
()
||
column
.
isEdit
())
&&
((
column
.
isUsableColumn
())
||
(!
column
.
isSuperColumn
())))
{
// 如果是(新增/修改&非主键/非忽略及父属性),继续保留必填/显示类型选项
column
.
setIsRequired
(
prevColumn
.
getIsRequired
());
column
.
setHtmlType
(
prevColumn
.
getHtmlType
());
}
}
genTableColumnMapper
.
updateGenTableColumn
(
column
);
genTableColumnMapper
.
updateGenTableColumn
(
column
);
}
}
...
...
ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java
View file @
81630a09
...
@@ -42,6 +42,7 @@ public class GenUtils
...
@@ -42,6 +42,7 @@ public class GenUtils
column
.
setJavaField
(
StringUtils
.
toCamelCase
(
columnName
));
column
.
setJavaField
(
StringUtils
.
toCamelCase
(
columnName
));
// 设置默认类型
// 设置默认类型
column
.
setJavaType
(
GenConstants
.
TYPE_STRING
);
column
.
setJavaType
(
GenConstants
.
TYPE_STRING
);
column
.
setQueryType
(
GenConstants
.
QUERY_EQ
);
if
(
arraysContains
(
GenConstants
.
COLUMNTYPE_STR
,
dataType
)
||
arraysContains
(
GenConstants
.
COLUMNTYPE_TEXT
,
dataType
))
if
(
arraysContains
(
GenConstants
.
COLUMNTYPE_STR
,
dataType
)
||
arraysContains
(
GenConstants
.
COLUMNTYPE_TEXT
,
dataType
))
{
{
...
...
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