Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JeeSpringCloud
Commits
7fa8137a
"src/main/vscode:/vscode.git/clone" did not exist on "18091947b9bbb6faa0bc7e999d54b639e33ae9ec"
Commit
7fa8137a
authored
Oct 22, 2018
by
HuangBingGui
Browse files
no commit message
parent
6c859da2
Changes
202
Hide whitespace changes
Inline
Side-by-side
JeeSpringCloud/src/main/java/com/jeespring/modules/echarts/web/ChinaWeatherDataBeanController.java
View file @
7fa8137a
...
...
@@ -187,7 +187,7 @@ public class ChinaWeatherDataBeanController extends AbstractBaseController {
@RequiresPermissions
(
"echarts:chinaWeatherDataBean:del"
)
@RequestMapping
(
value
=
"deleteAll"
)
public
String
deleteAll
(
String
ids
,
RedirectAttributes
redirectAttributes
)
{
String
idArray
[]
=
ids
.
split
(
","
);
String
[]
idArray
=
ids
.
split
(
","
);
for
(
String
id
:
idArray
){
chinaWeatherDataBeanService
.
delete
(
chinaWeatherDataBeanService
.
get
(
id
));
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/echarts/web/PieClassController.java
View file @
7fa8137a
...
...
@@ -125,7 +125,7 @@ public class PieClassController extends AbstractBaseController {
@RequiresPermissions
(
"echarts:pieClass:del"
)
@RequestMapping
(
value
=
"deleteAll"
)
public
String
deleteAll
(
String
ids
,
RedirectAttributes
redirectAttributes
)
{
String
idArray
[]
=
ids
.
split
(
","
);
String
[]
idArray
=
ids
.
split
(
","
);
for
(
String
id
:
idArray
){
pieClassService
.
delete
(
pieClassService
.
get
(
id
));
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/gen/entity/GenTable.java
View file @
7fa8137a
...
...
@@ -52,7 +52,9 @@ public void setName(String name)
public
String
getPk
()
{
if
(
this
.
pk
==
""
||
this
.
pk
==
null
)
this
.
pk
=
"id"
;
if
(
this
.
pk
==
""
||
this
.
pk
==
null
)
{
this
.
pk
=
"id"
;
}
return
this
.
pk
;
}
...
...
@@ -165,15 +167,17 @@ public List<String> getImportList()
for
(
Iterator
iterator
=
getColumnList
().
iterator
();
iterator
.
hasNext
();)
{
GenTableColumn
column
=
(
GenTableColumn
)
iterator
.
next
();
if
((
column
.
getIsNotBaseField
().
booleanValue
()
||
"1"
.
equals
(
column
.
getIsQuery
())
&&
"between"
.
equals
(
column
.
getQueryType
())
&&
(
"createDate"
.
equals
(
column
.
getSimpleJavaField
())
||
"updateDate"
.
equals
(
column
.
getSimpleJavaField
())))
&&
StringUtils
.
indexOf
(
column
.
getJavaType
(),
"."
)
!=
-
1
&&
!
importList
.
contains
(
column
.
getJavaType
()))
if
((
column
.
getIsNotBaseField
().
booleanValue
()
||
"1"
.
equals
(
column
.
getIsQuery
())
&&
"between"
.
equals
(
column
.
getQueryType
())
&&
(
"createDate"
.
equals
(
column
.
getSimpleJavaField
())
||
"updateDate"
.
equals
(
column
.
getSimpleJavaField
())))
&&
StringUtils
.
indexOf
(
column
.
getJavaType
(),
"."
)
!=
-
1
&&
!
importList
.
contains
(
column
.
getJavaType
()))
{
importList
.
add
(
column
.
getJavaType
());
}
if
(
column
.
getIsNotBaseField
().
booleanValue
())
{
for
(
Iterator
iterator1
=
column
.
getAnnotationList
().
iterator
();
iterator1
.
hasNext
();)
{
String
ann
=
(
String
)
iterator1
.
next
();
if
(!
importList
.
contains
(
StringUtils
.
substringBeforeLast
(
ann
,
"("
)))
if
(!
importList
.
contains
(
StringUtils
.
substringBeforeLast
(
ann
,
"("
)))
{
importList
.
add
(
StringUtils
.
substringBeforeLast
(
ann
,
"("
));
}
}
}
...
...
@@ -181,10 +185,12 @@ public List<String> getImportList()
if
(
getChildList
()
!=
null
&&
getChildList
().
size
()
>
0
)
{
if
(!
importList
.
contains
(
"java.util.List"
))
if
(!
importList
.
contains
(
"java.util.List"
))
{
importList
.
add
(
"java.util.List"
);
if
(!
importList
.
contains
(
"com.google.common.collect.Lists"
))
}
if
(!
importList
.
contains
(
"com.google.common.collect.Lists"
))
{
importList
.
add
(
"com.google.common.collect.Lists"
);
}
}
return
importList
;
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/gen/service/CgAutoListService.java
View file @
7fa8137a
...
...
@@ -55,8 +55,9 @@ public class CgAutoListService extends AbstractService
public
boolean
checkTableName
(
String
tableName
)
{
if
(
StringUtils
.
isBlank
(
tableName
))
if
(
StringUtils
.
isBlank
(
tableName
))
{
return
true
;
}
GenTable
genTable
=
new
GenTable
();
genTable
.
setName
(
tableName
);
List
list
=
genTableDao
.
findList
(
genTable
);
...
...
@@ -65,8 +66,9 @@ public class CgAutoListService extends AbstractService
public
boolean
checkTableNameFromDB
(
String
tableName
)
{
if
(
StringUtils
.
isBlank
(
tableName
))
if
(
StringUtils
.
isBlank
(
tableName
))
{
return
true
;
}
GenTable
genTable
=
new
GenTable
();
genTable
.
setName
(
tableName
);
List
list
=
genDataBaseDictDao
.
findTableList
(
genTable
);
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/gen/service/GenSchemeService.java
View file @
7fa8137a
...
...
@@ -82,16 +82,18 @@ public class GenSchemeService extends AbstractService
genScheme
.
setGenTable
(
childTable
);
Map
childTableModel
=
GenUtils
.
getDataModel
(
genScheme
);
GenTemplate
tpl
;
for
(
Iterator
iterator2
=
childTableTemplateList
.
iterator
();
iterator2
.
hasNext
();
result
.
append
(
GenUtils
.
generateToFile
(
tpl
,
childTableModel
,
true
)))
tpl
=
(
GenTemplate
)
iterator2
.
next
();
for
(
Iterator
iterator2
=
childTableTemplateList
.
iterator
();
iterator2
.
hasNext
();
result
.
append
(
GenUtils
.
generateToFile
(
tpl
,
childTableModel
,
true
)))
{
tpl
=
(
GenTemplate
)
iterator2
.
next
();
}
}
genScheme
.
setGenTable
(
genTable
);
Map
model
=
GenUtils
.
getDataModel
(
genScheme
);
GenTemplate
tpl
;
for
(
Iterator
iterator1
=
templateList
.
iterator
();
iterator1
.
hasNext
();
result
.
append
(
GenUtils
.
generateToFile
(
tpl
,
model
,
true
)))
tpl
=
(
GenTemplate
)
iterator1
.
next
();
for
(
Iterator
iterator1
=
templateList
.
iterator
();
iterator1
.
hasNext
();
result
.
append
(
GenUtils
.
generateToFile
(
tpl
,
model
,
true
)))
{
tpl
=
(
GenTemplate
)
iterator1
.
next
();
}
return
result
.
toString
();
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/gen/service/GenTableService.java
View file @
7fa8137a
...
...
@@ -58,8 +58,9 @@ public class GenTableService extends AbstractService
public
boolean
checkTableName
(
String
tableName
)
{
if
(
StringUtils
.
isBlank
(
tableName
))
if
(
StringUtils
.
isBlank
(
tableName
))
{
return
true
;
}
GenTable
genTable
=
new
GenTable
();
genTable
.
setName
(
tableName
);
List
list
=
genTableDao
.
findList
(
genTable
);
...
...
@@ -68,8 +69,9 @@ public class GenTableService extends AbstractService
public
boolean
checkTableNameFromDB
(
String
tableName
)
{
if
(
StringUtils
.
isBlank
(
tableName
))
if
(
StringUtils
.
isBlank
(
tableName
))
{
return
true
;
}
GenTable
genTable
=
new
GenTable
();
genTable
.
setName
(
tableName
);
List
list
=
genDataBaseDictDao
.
findTableList
(
genTable
);
...
...
@@ -86,8 +88,9 @@ public class GenTableService extends AbstractService
if
(
StringUtils
.
isBlank
(
genTable
.
getId
()))
{
genTable
=
(
GenTable
)
list
.
get
(
0
);
if
(
StringUtils
.
isBlank
(
genTable
.
getComments
()))
if
(
StringUtils
.
isBlank
(
genTable
.
getComments
()))
{
genTable
.
setComments
(
genTable
.
getName
());
}
genTable
.
setClassName
(
StringUtils
.
toCapitalizeCamelCase
(
genTable
.
getName
()));
}
List
columnList
=
genDataBaseDictDao
.
findTableColumnList
(
genTable
);
...
...
@@ -98,12 +101,14 @@ public class GenTableService extends AbstractService
for
(
Iterator
iterator2
=
genTable
.
getColumnList
().
iterator
();
iterator2
.
hasNext
();)
{
GenTableColumn
e
=
(
GenTableColumn
)
iterator2
.
next
();
if
(
e
.
getName
()
!=
null
&&
e
.
getName
().
equals
(
column
.
getName
()))
if
(
e
.
getName
()
!=
null
&&
e
.
getName
().
equals
(
column
.
getName
()))
{
b
=
true
;
}
}
if
(!
b
)
if
(!
b
)
{
genTable
.
getColumnList
().
add
(
column
);
}
}
for
(
Iterator
iterator1
=
genTable
.
getColumnList
().
iterator
();
iterator1
.
hasNext
();)
...
...
@@ -113,12 +118,14 @@ public class GenTableService extends AbstractService
for
(
Iterator
iterator3
=
columnList
.
iterator
();
iterator3
.
hasNext
();)
{
GenTableColumn
column
=
(
GenTableColumn
)
iterator3
.
next
();
if
(
column
.
getName
().
equals
(
e
.
getName
()))
if
(
column
.
getName
().
equals
(
e
.
getName
()))
{
b
=
true
;
}
}
if
(!
b
)
if
(!
b
)
{
e
.
setDelFlag
(
"1"
);
}
}
genTable
.
setPkList
(
genDataBaseDictDao
.
findTablePK
(
genTable
));
...
...
@@ -152,15 +159,17 @@ public class GenTableService extends AbstractService
}
else
{
GenTableColumn
oldColumn
=
genTableColumnDao
.
get
(
column
.
getId
());
if
(!
oldColumn
.
getName
().
equals
(
column
.
getName
())
||
!
oldColumn
.
getJdbcType
().
equals
(
column
.
getJdbcType
())
||
!
oldColumn
.
getIsPk
().
equals
(
column
.
getIsPk
())
||
!
oldColumn
.
getComments
().
equals
(
column
.
getComments
()))
if
(!
oldColumn
.
getName
().
equals
(
column
.
getName
())
||
!
oldColumn
.
getJdbcType
().
equals
(
column
.
getJdbcType
())
||
!
oldColumn
.
getIsPk
().
equals
(
column
.
getIsPk
())
||
!
oldColumn
.
getComments
().
equals
(
column
.
getComments
()))
{
isSync
=
false
;
}
}
}
}
}
if
(!
isSync
)
if
(!
isSync
)
{
genTable
.
setIsSync
(
"0"
);
}
if
(
StringUtils
.
isBlank
(
genTable
.
getId
()))
{
genTable
.
preInsert
();
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/gen/service/GenTemplateService.java
View file @
7fa8137a
...
...
@@ -39,8 +39,9 @@ public class GenTemplateService extends AbstractService
@Transactional
(
readOnly
=
false
)
public
void
save
(
GenTemplate
genTemplate
)
{
if
(
genTemplate
.
getContent
()
!=
null
)
if
(
genTemplate
.
getContent
()
!=
null
)
{
genTemplate
.
setContent
(
StringEscapeUtils
.
unescapeHtml4
(
genTemplate
.
getContent
()));
}
if
(
StringUtils
.
isBlank
(
genTemplate
.
getId
()))
{
genTemplate
.
preInsert
();
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/gen/util/GenUtils.java
View file @
7fa8137a
...
...
@@ -38,11 +38,12 @@ public class GenUtils
GenTableColumn
column
=
(
GenTableColumn
)
iterator
.
next
();
if
(!
StringUtils
.
isNotBlank
(
column
.
getId
()))
{
if
(
StringUtils
.
isBlank
(
column
.
getComments
()))
if
(
StringUtils
.
isBlank
(
column
.
getComments
()))
{
column
.
setComments
(
column
.
getName
());
if
(
StringUtils
.
startsWithIgnoreCase
(
column
.
getJdbcType
(),
"CHAR"
)
||
StringUtils
.
startsWithIgnoreCase
(
column
.
getJdbcType
(),
"VARCHAR"
)
||
StringUtils
.
startsWithIgnoreCase
(
column
.
getJdbcType
(),
"NARCHAR"
))
}
if
(
StringUtils
.
startsWithIgnoreCase
(
column
.
getJdbcType
(),
"CHAR"
)
||
StringUtils
.
startsWithIgnoreCase
(
column
.
getJdbcType
(),
"VARCHAR"
)
||
StringUtils
.
startsWithIgnoreCase
(
column
.
getJdbcType
(),
"NARCHAR"
))
{
column
.
setJavaType
(
"String"
);
else
if
(
StringUtils
.
startsWithIgnoreCase
(
column
.
getJdbcType
(),
"BLOB"
)){
}
else
if
(
StringUtils
.
startsWithIgnoreCase
(
column
.
getJdbcType
(),
"BLOB"
)){
column
.
setJavaType
(
"byte[]"
);
}
else
...
...
@@ -57,14 +58,15 @@ public class GenUtils
||
StringUtils
.
startsWithIgnoreCase
(
column
.
getJdbcType
(),
"INT"
)
||
StringUtils
.
startsWithIgnoreCase
(
column
.
getJdbcType
(),
"TINYINT"
))
{
String
ss
[]
=
StringUtils
.
split
(
StringUtils
.
substringBetween
(
column
.
getJdbcType
(),
"("
,
")"
),
","
);
if
(
ss
!=
null
&&
ss
.
length
==
2
&&
Integer
.
parseInt
(
ss
[
1
])
>
0
)
String
[]
ss
=
StringUtils
.
split
(
StringUtils
.
substringBetween
(
column
.
getJdbcType
(),
"("
,
")"
),
","
);
if
(
ss
!=
null
&&
ss
.
length
==
2
&&
Integer
.
parseInt
(
ss
[
1
])
>
0
)
{
column
.
setJavaType
(
"Double"
);
else
if
(
ss
!=
null
&&
ss
.
length
==
1
&&
Integer
.
parseInt
(
ss
[
0
])
<=
10
)
}
else
if
(
ss
!=
null
&&
ss
.
length
==
1
&&
Integer
.
parseInt
(
ss
[
0
])
<=
10
)
{
column
.
setJavaType
(
"Integer"
);
else
}
else
{
column
.
setJavaType
(
"Long"
);
}
}
if
(
column
.
getJavaType
()==
null
||
""
.
equals
(
column
.
getJavaType
())){
column
.
setJavaType
(
"String"
);
...
...
@@ -75,22 +77,26 @@ public class GenUtils
column
.
setJavaField
(
"id"
);
}
column
.
setIsInsert
(
"1"
);
if
(!
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"id"
)
&&
!
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"create_by"
)
&&
!
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"create_date"
)
&&
!
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"del_flag"
))
if
(!
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"id"
)
&&
!
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"create_by"
)
&&
!
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"create_date"
)
&&
!
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"del_flag"
))
{
column
.
setIsEdit
(
"1"
);
else
}
else
{
column
.
setIsEdit
(
"0"
);
if
(
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"name"
)
||
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"title"
)
||
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"remarks"
)
||
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"update_date"
))
}
if
(
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"name"
)
||
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"title"
)
||
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"remarks"
)
||
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"update_date"
))
{
column
.
setIsList
(
"1"
);
else
}
else
{
column
.
setIsList
(
"0"
);
if
(
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"name"
)
||
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"title"
))
}
if
(
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"name"
)
||
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"title"
))
{
column
.
setIsQuery
(
"1"
);
else
}
else
{
column
.
setIsQuery
(
"0"
);
if
(
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"name"
)
||
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"title"
))
}
if
(
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"name"
)
||
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"title"
))
{
column
.
setQueryType
(
"like"
);
else
}
else
{
column
.
setQueryType
(
"="
);
}
if
(
StringUtils
.
startsWithIgnoreCase
(
column
.
getJdbcType
(),
"DATETIME"
)
||
StringUtils
.
startsWithIgnoreCase
(
column
.
getJdbcType
(),
"DATE"
)
||
StringUtils
.
startsWithIgnoreCase
(
column
.
getJdbcType
(),
"TIMESTAMP"
))
{
column
.
setQueryType
(
"between"
);
...
...
@@ -120,12 +126,12 @@ public class GenUtils
column
.
setJavaField
((
new
StringBuilder
(
String
.
valueOf
(
column
.
getJavaField
()))).
append
(
".id"
).
toString
());
column
.
setShowType
(
"input"
);
}
else
if
(
StringUtils
.
startsWithIgnoreCase
(
column
.
getName
(),
"create_date"
)
||
StringUtils
.
startsWithIgnoreCase
(
column
.
getName
(),
"update_date"
))
if
(
StringUtils
.
startsWithIgnoreCase
(
column
.
getName
(),
"create_date"
)
||
StringUtils
.
startsWithIgnoreCase
(
column
.
getName
(),
"update_date"
))
{
column
.
setShowType
(
"dateselect"
);
else
if
(
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"remarks"
)
||
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"content"
))
}
else
if
(
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"remarks"
)
||
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"content"
))
{
column
.
setShowType
(
"textarea"
);
else
}
else
if
(
StringUtils
.
equalsIgnoreCase
(
column
.
getName
(),
"parent_id"
))
{
column
.
setJavaType
(
"This"
);
...
...
@@ -143,8 +149,9 @@ public class GenUtils
column
.
setDictType
(
"del_flag"
);
}
else
{
if
(
column
.
getShowType
()==
""
||
column
.
getShowType
()==
null
)
column
.
setShowType
(
"input"
);
if
(
column
.
getShowType
()==
""
||
column
.
getShowType
()==
null
)
{
column
.
setShowType
(
"input"
);
}
}
if
(
column
.
getName
().
toLowerCase
().
contains
(
"remark"
)
||
StringUtils
.
startsWithIgnoreCase
(
column
.
getJdbcType
(),
"TEXT"
)){
column
.
setShowType
(
"textarea"
);
...
...
@@ -174,7 +181,7 @@ public class GenUtils
}
}
if
(
column
.
getName
().
toLowerCase
().
contains
(
"_state"
)
||
column
.
getName
().
toLowerCase
()
.
equals
(
"state"
)){
if
(
column
.
getName
().
toLowerCase
().
contains
(
"_state"
)
||
"state"
.
equals
(
column
.
getName
().
toLowerCase
())){
column
.
setShowType
(
"select"
);
if
(
dictList
.
contains
(
column
.
getName
())
||
dictList
.
contains
(
StringUtils
.
toCapitalizeCamelCase
(
column
.
getName
()))){
column
.
setDictType
(
column
.
getName
());
...
...
@@ -184,7 +191,7 @@ public class GenUtils
column
.
setQueryType
(
"like"
);
}
if
(
column
.
getAutoIncrement
()
.
equals
(
"1"
)){
if
(
"1"
.
equals
(
column
.
getAutoIncrement
())){
column
.
setIsInsert
(
"0"
);
}
...
...
@@ -205,12 +212,13 @@ public class GenUtils
try
{
File
file
=
(
new
DefaultResourceLoader
()).
getResource
(
""
).
getFile
();
if
(
file
!=
null
)
return
(
new
StringBuilder
(
String
.
valueOf
(
file
.
getAbsolutePath
()))).
append
(
File
.
separator
).
append
(
StringUtils
.
replaceEach
(
GenUtils
.
class
.
getName
(),
new
String
[]
{
(
new
StringBuilder
(
"util."
)).
append
(
GenUtils
.
class
.
getSimpleName
()).
toString
(),
"."
},
new
String
[]
{
"template"
,
File
.
separator
if
(
file
!=
null
)
{
return
(
new
StringBuilder
(
String
.
valueOf
(
file
.
getAbsolutePath
()))).
append
(
File
.
separator
).
append
(
StringUtils
.
replaceEach
(
GenUtils
.
class
.
getName
(),
new
String
[]{
(
new
StringBuilder
(
"util."
)).
append
(
GenUtils
.
class
.
getSimpleName
()).
toString
(),
"."
},
new
String
[]{
"template"
,
File
.
separator
})).
toString
();
}
}
catch
(
Exception
e
)
{
...
...
@@ -231,14 +239,17 @@ public class GenUtils
do
{
String
line
=
br
.
readLine
();
if
(
line
==
null
)
if
(
line
==
null
)
{
break
;
}
sb
.
append
(
line
).
append
(
"\r\n"
);
}
while
(
true
);
if
(
is
!=
null
)
if
(
is
!=
null
)
{
is
.
close
();
if
(
br
!=
null
)
}
if
(
br
!=
null
)
{
br
.
close
();
}
return
JaxbMapper
.
fromXml
(
sb
.
toString
(),
clazz
);
}
catch
(
IOException
e
)
...
...
@@ -264,10 +275,11 @@ public class GenUtils
if
(
category
.
equals
(
e
.
getValue
()))
{
List
list
=
null
;
if
(!
isChildTable
)
if
(!
isChildTable
)
{
list
=
e
.
getTemplate
();
else
}
else
{
list
=
e
.
getChildTableTemplate
();
}
if
(
list
!=
null
)
{
for
(
Iterator
iterator1
=
list
.
iterator
();
iterator1
.
hasNext
();)
...
...
@@ -279,8 +291,9 @@ public class GenUtils
}
else
{
GenTemplate
template
=
(
GenTemplate
)
fileToObject
(
s
,
GenTemplate
.
class
);
if
(
template
!=
null
)
if
(
template
!=
null
)
{
templateList
.
add
(
template
);
}
}
}
...
...
@@ -338,7 +351,7 @@ public class GenUtils
return
"文件已存在:"
+
fileName
+
"<br/>"
;
}
public
static
void
main
(
String
args
[]
)
public
static
void
main
(
String
[]
args
)
{
try
{
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/gen/web/CgAutoListController.java
View file @
7fa8137a
...
...
@@ -40,10 +40,11 @@ public class CgAutoListController extends AbstractBaseController
@ModelAttribute
public
GenScheme
get
(
@RequestParam
(
required
=
true
)
String
id
)
{
if
(
StringUtils
.
isNotBlank
(
id
))
if
(
StringUtils
.
isNotBlank
(
id
))
{
return
genSchemeService
.
get
(
id
);
else
}
else
{
return
new
GenScheme
();
}
}
@RequestMapping
(
value
={
"list"
})
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/gen/web/GenSchemeController.java
View file @
7fa8137a
...
...
@@ -44,10 +44,11 @@ public class GenSchemeController extends AbstractBaseController
@ModelAttribute
public
GenScheme
get
(
@RequestParam
(
required
=
true
)
String
id
)
{
if
(
StringUtils
.
isNotBlank
(
id
))
if
(
StringUtils
.
isNotBlank
(
id
))
{
return
genSchemeService
.
get
(
id
);
else
}
else
{
return
new
GenScheme
();
}
}
@RequiresPermissions
(
value
={
"gen:genScheme:view"
})
...
...
@@ -55,8 +56,9 @@ public class GenSchemeController extends AbstractBaseController
public
String
list
(
GenScheme
genScheme
,
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
User
user
=
UserUtils
.
getUser
();
if
(!
user
.
isAdmin
())
if
(!
user
.
isAdmin
())
{
genScheme
.
setCreateBy
(
user
);
}
Page
page
=
genSchemeService
.
find
(
new
Page
(
request
,
response
),
genScheme
);
model
.
addAttribute
(
"page"
,
page
);
return
"modules/gen/genSchemeList"
;
...
...
@@ -66,8 +68,9 @@ public class GenSchemeController extends AbstractBaseController
@RequestMapping
(
value
={
"form"
})
public
String
form
(
GenScheme
genScheme
,
Model
model
)
{
if
(
StringUtils
.
isBlank
(
genScheme
.
getPackageName
()))
if
(
StringUtils
.
isBlank
(
genScheme
.
getPackageName
()))
{
genScheme
.
setPackageName
(
"com.jeespring.modules"
);
}
model
.
addAttribute
(
"genScheme"
,
genScheme
);
model
.
addAttribute
(
"config"
,
GenUtils
.
getConfig
());
model
.
addAttribute
(
"tableList"
,
genTableService
.
findAll
());
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/gen/web/GenTableController.java
View file @
7fa8137a
...
...
@@ -47,10 +47,11 @@ public class GenTableController extends AbstractBaseController
public
GenTable
get
(
GenTable
genTable
)
{
if
(
StringUtils
.
isNotBlank
(
genTable
.
getId
()))
if
(
StringUtils
.
isNotBlank
(
genTable
.
getId
()))
{
return
genTableService
.
get
(
genTable
.
getId
());
else
}
else
{
return
genTable
;
}
}
@RequiresPermissions
(
value
={
"gen:genTable:list"
})
...
...
@@ -59,8 +60,9 @@ public class GenTableController extends AbstractBaseController
{
genTable
=
get
(
genTable
);
User
user
=
UserUtils
.
getUser
();
if
(!
user
.
isAdmin
())
if
(!
user
.
isAdmin
())
{
genTable
.
setCreateBy
(
user
);
}
Page
page
=
genTableService
.
find
(
new
Page
(
request
,
response
),
genTable
);
model
.
addAttribute
(
"page"
,
page
);
return
"modules/gen/genTableList"
;
...
...
@@ -202,7 +204,7 @@ public class GenTableController extends AbstractBaseController
for
(
Iterator
iterator
=
getTableColumnList
.
iterator
();
iterator
.
hasNext
();)
{
GenTableColumn
column
=
(
GenTableColumn
)
iterator
.
next
();
if
(
column
.
getIsPk
()
.
equals
(
"1"
))
if
(
"1"
.
equals
(
column
.
getIsPk
()))
{
sql
.
append
((
new
StringBuilder
(
" "
)).
append
(
column
.
getName
()).
append
(
" "
).
append
(
column
.
getJdbcType
()).
append
(
" comment '"
).
append
(
column
.
getComments
()).
append
(
"',"
).
toString
());
pk
=
(
new
StringBuilder
(
String
.
valueOf
(
pk
))).
append
(
column
.
getName
()).
append
(
","
).
toString
();
...
...
@@ -223,11 +225,13 @@ public class GenTableController extends AbstractBaseController
@RequestMapping
(
value
={
"genCodeForm"
})
public
String
genCodeForm
(
GenScheme
genScheme
,
Model
model
,
RedirectAttributes
redirectAttributes
)
{
if
(
StringUtils
.
isBlank
(
genScheme
.
getPackageName
()))
if
(
StringUtils
.
isBlank
(
genScheme
.
getPackageName
()))
{
genScheme
.
setPackageName
(
"com.company.project.modules"
);
}
GenScheme
oldGenScheme
=
genSchemeService
.
findUniqueByProperty
(
"gen_table_id"
,
genScheme
.
getGenTable
().
getId
());
if
(
oldGenScheme
!=
null
)
if
(
oldGenScheme
!=
null
)
{
genScheme
=
oldGenScheme
;
}
model
.
addAttribute
(
"genScheme"
,
genScheme
);
model
.
addAttribute
(
"config"
,
GenUtils
.
getConfig
());
model
.
addAttribute
(
"tableList"
,
genTableService
.
findAll
());
...
...
@@ -251,7 +255,7 @@ public class GenTableController extends AbstractBaseController
}
else
{
href
=
"/"
+
genScheme
.
getModuleName
()+
"/"
+
StringUtils
.
toCamelCase
(
genScheme
.
getGenTable
().
getName
());
}
if
(
genScheme
.
getCategory
()
.
equals
(
"tree"
)){
if
(
"tree"
.
equals
(
genScheme
.
getCategory
())){
href
=
href
+
"Tree"
;
}
genMenu
(
genScheme
,
href
);
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/gen/web/GenTemplateController.java
View file @
7fa8137a
...
...
@@ -41,10 +41,11 @@ public class GenTemplateController extends AbstractBaseController
@ModelAttribute
public
GenTemplate
get
(
@RequestParam
(
required
=
true
)
String
id
)
{
if
(
StringUtils
.
isNotBlank
(
id
))
if
(
StringUtils
.
isNotBlank
(
id
))
{
return
genTemplateService
.
get
(
id
);
else
}
else
{
return
new
GenTemplate
();
}
}
@RequiresPermissions
(
value
={
"gen:genTemplate:view"
})
...
...
@@ -52,8 +53,9 @@ public class GenTemplateController extends AbstractBaseController
public
String
list
(
GenTemplate
genTemplate
,
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
User
user
=
UserUtils
.
getUser
();
if
(!
user
.
isAdmin
())
if
(!
user
.
isAdmin
())
{
genTemplate
.
setCreateBy
(
user
);
}
Page
page
=
genTemplateService
.
find
(
new
Page
(
request
,
response
),
genTemplate
);
model
.
addAttribute
(
"page"
,
page
);
return
"modules/gen/genTemplateList"
;
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/iim/service/ChatHistoryService.java
View file @
7fa8137a
...
...
@@ -22,28 +22,33 @@ import com.jeespring.modules.iim.entity.ChatHistory;
@Transactional
(
readOnly
=
true
)
public
class
ChatHistoryService
extends
AbstractBaseService
<
ChatHistoryDao
,
ChatHistory
>
{
public
ChatHistory
get
(
String
id
)
{
@Override
public
ChatHistory
get
(
String
id
)
{
return
super
.
get
(
id
);
}
public
List
<
ChatHistory
>
findList
(
ChatHistory
chatHistory
)
{
@Override
public
List
<
ChatHistory
>
findList
(
ChatHistory
chatHistory
)
{
return
super
.
findList
(
chatHistory
);
}
public
Page
<
ChatHistory
>
findPage
(
Page
<
ChatHistory
>
page
,
ChatHistory
entity
)
{
@Override
public
Page
<
ChatHistory
>
findPage
(
Page
<
ChatHistory
>
page
,
ChatHistory
entity
)
{
entity
.
setPage
(
page
);
page
.
setList
(
dao
.
findLogList
(
entity
));
return
page
;
}
@Transactional
(
readOnly
=
false
)
@Override
@Transactional
(
readOnly
=
false
)
public
void
save
(
ChatHistory
chatHistory
)
{
super
.
save
(
chatHistory
);
}
@Transactional
(
readOnly
=
false
)
@Override
@Transactional
(
readOnly
=
false
)
public
void
delete
(
ChatHistory
chatHistory
)
{
super
.
delete
(
chatHistory
);
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/iim/service/MailBoxService.java
View file @
7fa8137a
...
...
@@ -26,11 +26,13 @@ public class MailBoxService extends AbstractBaseService<MailBoxDao, MailBox> {
@Autowired
private
MailBoxDao
mailBoxDao
;
public
MailBox
get
(
String
id
)
{
@Override
public
MailBox
get
(
String
id
)
{
return
super
.
get
(
id
);
}
public
List
<
MailBox
>
findList
(
MailBox
mailBox
)
{
@Override
public
List
<
MailBox
>
findList
(
MailBox
mailBox
)
{
return
super
.
findList
(
mailBox
);
}
...
...
@@ -38,12 +40,14 @@ public class MailBoxService extends AbstractBaseService<MailBoxDao, MailBox> {
return
super
.
findPage
(
page
,
mailBox
);
}
@Transactional
(
readOnly
=
false
)
@Override
@Transactional
(
readOnly
=
false
)
public
void
save
(
MailBox
mailBox
)
{
super
.
save
(
mailBox
);
}
@Transactional
(
readOnly
=
false
)
@Override
@Transactional
(
readOnly
=
false
)
public
void
delete
(
MailBox
mailBox
)
{
super
.
delete
(
mailBox
);
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/iim/service/MailComposeService.java
View file @
7fa8137a
...
...
@@ -25,11 +25,13 @@ import com.jeespring.modules.iim.entity.MailPage;
public
class
MailComposeService
extends
AbstractBaseService
<
MailComposeDao
,
MailCompose
>
{
@Autowired
private
MailComposeDao
mailComposeDao
;
public
MailCompose
get
(
String
id
)
{
@Override
public
MailCompose
get
(
String
id
)
{
return
super
.
get
(
id
);
}
public
List
<
MailCompose
>
findList
(
MailCompose
mailCompose
)
{
@Override
public
List
<
MailCompose
>
findList
(
MailCompose
mailCompose
)
{
return
super
.
findList
(
mailCompose
);
}
...
...
@@ -37,12 +39,14 @@ public class MailComposeService extends AbstractBaseService<MailComposeDao, Mail
return
super
.
findPage
(
page
,
mailCompose
);
}
@Transactional
(
readOnly
=
false
)
@Override
@Transactional
(
readOnly
=
false
)
public
void
save
(
MailCompose
mailCompose
)
{
super
.
save
(
mailCompose
);
}
@Transactional
(
readOnly
=
false
)
@Override
@Transactional
(
readOnly
=
false
)
public
void
delete
(
MailCompose
mailCompose
)
{
super
.
delete
(
mailCompose
);
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/iim/service/MailService.java
View file @
7fa8137a
...
...
@@ -33,22 +33,26 @@ public class MailService extends AbstractBaseService<MailDao, Mail> {
@Autowired
private
MailComposeDao
mailComposeDao
;
public
Mail
get
(
String
id
)
{
@Override
public
Mail
get
(
String
id
)
{
Mail
mail
=
super
.
get
(
id
);
mail
.
setMailBoxList
(
mailBoxDao
.
findList
(
new
MailBox
(
mail
)));
mail
.
setMailComposeList
(
mailComposeDao
.
findList
(
new
MailCompose
(
mail
)));
return
mail
;
}
public
List
<
Mail
>
findList
(
Mail
mail
)
{
@Override
public
List
<
Mail
>
findList
(
Mail
mail
)
{
return
super
.
findList
(
mail
);
}
public
Page
<
Mail
>
findPage
(
Page
<
Mail
>
page
,
Mail
mail
)
{
@Override
public
Page
<
Mail
>
findPage
(
Page
<
Mail
>
page
,
Mail
mail
)
{
return
super
.
findPage
(
page
,
mail
);
}
@Transactional
(
readOnly
=
false
)
@Override
@Transactional
(
readOnly
=
false
)
public
void
save
(
Mail
mail
)
{
super
.
save
(
mail
);
for
(
MailBox
mailBox
:
mail
.
getMailBoxList
()){
...
...
@@ -125,7 +129,8 @@ public class MailService extends AbstractBaseService<MailDao, Mail> {
}
}
@Transactional
(
readOnly
=
false
)
@Override
@Transactional
(
readOnly
=
false
)
public
void
delete
(
Mail
mail
)
{
super
.
delete
(
mail
);
mailBoxDao
.
delete
(
new
MailBox
(
mail
));
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/iim/service/MyCalendarService.java
View file @
7fa8137a
...
...
@@ -23,24 +23,29 @@ import com.jeespring.modules.iim.entity.MyCalendar;
@Transactional
(
readOnly
=
true
)
public
class
MyCalendarService
extends
AbstractBaseService
<
MyCalendarDao
,
MyCalendar
>
{
public
MyCalendar
get
(
String
id
)
{
@Override
public
MyCalendar
get
(
String
id
)
{
return
super
.
get
(
id
);
}
public
List
<
MyCalendar
>
findList
(
MyCalendar
myCalendar
)
{
@Override
public
List
<
MyCalendar
>
findList
(
MyCalendar
myCalendar
)
{
return
super
.
findList
(
myCalendar
);
}
public
Page
<
MyCalendar
>
findPage
(
Page
<
MyCalendar
>
page
,
MyCalendar
myCalendar
)
{
@Override
public
Page
<
MyCalendar
>
findPage
(
Page
<
MyCalendar
>
page
,
MyCalendar
myCalendar
)
{
return
super
.
findPage
(
page
,
myCalendar
);
}
@Transactional
(
readOnly
=
false
)
@Override
@Transactional
(
readOnly
=
false
)
public
void
save
(
MyCalendar
myCalendar
)
{
super
.
save
(
myCalendar
);
}
@Transactional
(
readOnly
=
false
)
@Override
@Transactional
(
readOnly
=
false
)
public
void
delete
(
MyCalendar
myCalendar
)
{
super
.
delete
(
myCalendar
);
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/iim/web/ChatHistoryController.java
View file @
7fa8137a
...
...
@@ -104,7 +104,7 @@ public class ChatHistoryController extends AbstractBaseController {
*/
@RequestMapping
(
value
=
"deleteAll"
)
public
String
deleteAll
(
String
ids
,
RedirectAttributes
redirectAttributes
)
{
String
idArray
[]
=
ids
.
split
(
","
);
String
[]
idArray
=
ids
.
split
(
","
);
for
(
String
id
:
idArray
){
chatHistoryService
.
delete
(
chatHistoryService
.
get
(
id
));
}
...
...
@@ -138,7 +138,7 @@ public class ChatHistoryController extends AbstractBaseController {
Page
<
ChatHistory
>
page
=
chatHistoryService
.
findPage
(
new
Page
<
ChatHistory
>(
request
,
response
),
chatHistory
);
List
<
ChatHistory
>
list
=
page
.
getList
();
for
(
ChatHistory
c
:
list
){
if
(
c
.
getStatus
()
.
equals
(
"0"
)){
if
(
"0"
.
equals
(
c
.
getStatus
())){
if
(
c
.
getUserid2
().
equals
(
UserUtils
.
getUser
().
getLoginName
())){
//把发送给我的信息标记为已读
c
.
setStatus
(
"1"
);
//标记为已读
chatHistoryService
.
save
(
c
);
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/iim/web/ContactController.java
View file @
7fa8137a
...
...
@@ -85,7 +85,7 @@ public class ContactController extends AbstractBaseController {
*/
@RequestMapping
(
value
=
"addFriend"
)
public
String
addFriend
(
String
ids
,
RedirectAttributes
redirectAttributes
)
{
String
idArray
[]
=
ids
.
split
(
","
);
String
[]
idArray
=
ids
.
split
(
","
);
User
currentUser
=
UserUtils
.
getUser
();
for
(
String
id
:
idArray
){
if
(
userDao
.
findFriend
(
currentUser
.
getId
(),
id
)
==
null
){
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/iim/web/MailBoxController.java
View file @
7fa8137a
...
...
@@ -88,7 +88,7 @@ public class MailBoxController extends AbstractBaseController {
@RequestMapping
(
value
=
"detail"
)
public
String
detail
(
MailBox
mailBox
,
Model
model
)
{
if
(
mailBox
.
getReadstatus
()
.
equals
(
"0"
)){
//更改未读状态为已读状态
if
(
"0"
.
equals
(
mailBox
.
getReadstatus
())){
//更改未读状态为已读状态
mailBox
.
setReadstatus
(
"1"
);
//1表示已读
mailBoxService
.
save
(
mailBox
);
}
...
...
@@ -143,7 +143,7 @@ public class MailBoxController extends AbstractBaseController {
*/
@RequestMapping
(
value
=
"deleteAll"
)
public
String
deleteAll
(
String
ids
,
RedirectAttributes
redirectAttributes
)
{
String
idArray
[]
=
ids
.
split
(
","
);
String
[]
idArray
=
ids
.
split
(
","
);
for
(
String
id
:
idArray
){
mailBoxService
.
delete
(
mailBoxService
.
get
(
id
));
}
...
...
Prev
1
2
3
4
5
6
7
8
9
…
11
Next
Write
Preview
Supports
Markdown
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