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
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/common/utils/ImageGeo.java
View file @
7fa8137a
...
@@ -20,10 +20,10 @@ public class ImageGeo {
...
@@ -20,10 +20,10 @@ public class ImageGeo {
GpsDirectory
gpsdir
=
(
GpsDirectory
)
metadata
GpsDirectory
gpsdir
=
(
GpsDirectory
)
metadata
.
getDirectory
(
GpsDirectory
.
class
);
.
getDirectory
(
GpsDirectory
.
class
);
Rational
latpart
[]
=
gpsdir
Rational
[]
latpart
=
gpsdir
.
getRationalArray
(
GpsDirectory
.
TAG_GPS_LATITUDE
);
.
getRationalArray
(
GpsDirectory
.
TAG_GPS_LATITUDE
);
Rational
lonpart
[]
=
gpsdir
Rational
[]
lonpart
=
gpsdir
.
getRationalArray
(
GpsDirectory
.
TAG_GPS_LONGITUDE
);
.
getRationalArray
(
GpsDirectory
.
TAG_GPS_LONGITUDE
);
String
northing
=
gpsdir
String
northing
=
gpsdir
.
getString
(
GpsDirectory
.
TAG_GPS_LATITUDE_REF
);
.
getString
(
GpsDirectory
.
TAG_GPS_LATITUDE_REF
);
String
easting
=
gpsdir
String
easting
=
gpsdir
...
@@ -35,11 +35,13 @@ public class ImageGeo {
...
@@ -35,11 +35,13 @@ public class ImageGeo {
}
}
double
latsign
=
1.0d
;
double
latsign
=
1.0d
;
if
(
northing
.
equalsIgnoreCase
(
"S"
))
if
(
"S"
.
equalsIgnoreCase
(
northing
))
{
latsign
=
-
1.0d
;
latsign
=
-
1.0d
;
}
double
lonsign
=
1.0d
;
double
lonsign
=
1.0d
;
if
(
easting
.
equalsIgnoreCase
(
"W"
))
if
(
"W"
.
equalsIgnoreCase
(
easting
))
{
lonsign
=
-
1.0d
;
lonsign
=
-
1.0d
;
}
lat
=
(
Math
.
abs
(
latpart
[
0
].
doubleValue
())
lat
=
(
Math
.
abs
(
latpart
[
0
].
doubleValue
())
+
latpart
[
1
].
doubleValue
()
/
60.0d
+
latpart
[
2
]
+
latpart
[
1
].
doubleValue
()
/
60.0d
+
latpart
[
2
]
.
doubleValue
()
/
3600.0d
)
*
latsign
;
.
doubleValue
()
/
3600.0d
)
*
latsign
;
...
@@ -47,8 +49,9 @@ public class ImageGeo {
...
@@ -47,8 +49,9 @@ public class ImageGeo {
+
lonpart
[
1
].
doubleValue
()
/
60.0d
+
lonpart
[
2
]
+
lonpart
[
1
].
doubleValue
()
/
60.0d
+
lonpart
[
2
]
.
doubleValue
()
/
3600.0d
)
*
lonsign
;
.
doubleValue
()
/
3600.0d
)
*
lonsign
;
if
(
Double
.
isNaN
(
lat
)
||
Double
.
isNaN
(
lon
))
if
(
Double
.
isNaN
(
lat
)
||
Double
.
isNaN
(
lon
))
{
error
=
true
;
error
=
true
;
}
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
error
=
true
;
error
=
true
;
}
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/utils/MyBeanUtils.java
View file @
7fa8137a
...
@@ -34,8 +34,8 @@ public class MyBeanUtils
...
@@ -34,8 +34,8 @@ public class MyBeanUtils
// Copy the properties, converting as necessary
// Copy the properties, converting as necessary
if
(
orig
instanceof
DynaBean
)
{
if
(
orig
instanceof
DynaBean
)
{
DynaProperty
origDescriptors
[]
=
DynaProperty
[]
origDescriptors
=
(
(
DynaBean
)
orig
).
getDynaClass
().
getDynaProperties
();
(
(
DynaBean
)
orig
).
getDynaClass
().
getDynaProperties
();
for
(
int
i
=
0
;
i
<
origDescriptors
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
origDescriptors
.
length
;
i
++)
{
String
name
=
origDescriptors
[
i
].
getName
();
String
name
=
origDescriptors
[
i
].
getName
();
if
(
PropertyUtils
.
isWriteable
(
dest
,
name
))
{
if
(
PropertyUtils
.
isWriteable
(
dest
,
name
))
{
...
@@ -69,8 +69,8 @@ public class MyBeanUtils
...
@@ -69,8 +69,8 @@ public class MyBeanUtils
else
else
/* if (orig is a standard JavaBean) */
/* if (orig is a standard JavaBean) */
{
{
PropertyDescriptor
origDescriptors
[]
=
PropertyDescriptor
[]
origDescriptors
=
PropertyUtils
.
getPropertyDescriptors
(
orig
);
PropertyUtils
.
getPropertyDescriptors
(
orig
);
for
(
int
i
=
0
;
i
<
origDescriptors
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
origDescriptors
.
length
;
i
++)
{
String
name
=
origDescriptors
[
i
].
getName
();
String
name
=
origDescriptors
[
i
].
getName
();
// String type = origDescriptors[i].getPropertyType().toString();
// String type = origDescriptors[i].getPropertyType().toString();
...
@@ -108,7 +108,7 @@ public class MyBeanUtils
...
@@ -108,7 +108,7 @@ public class MyBeanUtils
*/
*/
public
static
void
copyBeanNotNull2Bean
(
Object
databean
,
Object
tobean
)
throws
Exception
public
static
void
copyBeanNotNull2Bean
(
Object
databean
,
Object
tobean
)
throws
Exception
{
{
PropertyDescriptor
origDescriptors
[]
=
PropertyUtils
.
getPropertyDescriptors
(
databean
);
PropertyDescriptor
[]
origDescriptors
=
PropertyUtils
.
getPropertyDescriptors
(
databean
);
for
(
int
i
=
0
;
i
<
origDescriptors
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
origDescriptors
.
length
;
i
++)
{
String
name
=
origDescriptors
[
i
].
getName
();
String
name
=
origDescriptors
[
i
].
getName
();
// String type = origDescriptors[i].getPropertyType().toString();
// String type = origDescriptors[i].getPropertyType().toString();
...
@@ -192,8 +192,8 @@ public class MyBeanUtils
...
@@ -192,8 +192,8 @@ public class MyBeanUtils
continue
;
continue
;
}
}
String
className
=
clazz
.
getName
();
String
className
=
clazz
.
getName
();
if
(
className
.
equalsIgnoreCase
(
"java.sql.Timestamp"
))
{
if
(
"java.sql.Timestamp"
.
equalsIgnoreCase
(
className
))
{
if
(
value
==
null
||
value
.
equals
(
""
))
{
if
(
value
==
null
||
""
.
equals
(
value
))
{
continue
;
continue
;
}
}
}
}
...
@@ -241,7 +241,7 @@ public class MyBeanUtils
...
@@ -241,7 +241,7 @@ public class MyBeanUtils
}
}
String
className
=
clazz
.
getName
();
String
className
=
clazz
.
getName
();
// 临时对策(如果不处理默认的类型转换时会出错)
// 临时对策(如果不处理默认的类型转换时会出错)
if
(
className
.
equalsIgnoreCase
(
"java.util.Date"
))
{
if
(
"java.util.Date"
.
equalsIgnoreCase
(
className
))
{
value
=
new
java
.
util
.
Date
(((
java
.
sql
.
Timestamp
)
value
).
getTime
());
// wait to do:貌似有时区问题, 待进一步确认
value
=
new
java
.
util
.
Date
(((
java
.
sql
.
Timestamp
)
value
).
getTime
());
// wait to do:貌似有时区问题, 待进一步确认
}
}
// if (className.equalsIgnoreCase("java.sql.Timestamp")) {
// if (className.equalsIgnoreCase("java.sql.Timestamp")) {
...
@@ -287,12 +287,12 @@ public class MyBeanUtils
...
@@ -287,12 +287,12 @@ public class MyBeanUtils
continue
;
continue
;
}
}
String
className
=
clazz
.
getName
();
String
className
=
clazz
.
getName
();
if
(
className
.
equalsIgnoreCase
(
"java.sql.Timestamp"
))
{
if
(
"java.sql.Timestamp"
.
equalsIgnoreCase
(
className
))
{
if
(
value
==
null
||
value
.
equals
(
""
))
{
if
(
value
==
null
||
""
.
equals
(
value
))
{
continue
;
continue
;
}
}
}
}
if
(
className
.
equalsIgnoreCase
(
"java.lang.String"
))
{
if
(
"java.lang.String"
.
equalsIgnoreCase
(
className
))
{
if
(
value
==
null
)
{
if
(
value
==
null
)
{
value
=
defaultValue
;
value
=
defaultValue
;
}
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/utils/OrderProperties.java
View file @
7fa8137a
...
@@ -51,6 +51,7 @@ public class OrderProperties extends Properties {
...
@@ -51,6 +51,7 @@ public class OrderProperties extends Properties {
return
context
;
return
context
;
}
}
@Override
public
synchronized
void
load
(
InputStream
inStream
)
throws
IOException
{
public
synchronized
void
load
(
InputStream
inStream
)
throws
IOException
{
BufferedReader
in
;
BufferedReader
in
;
...
@@ -61,21 +62,25 @@ public class OrderProperties extends Properties {
...
@@ -61,21 +62,25 @@ public class OrderProperties extends Properties {
String
line
=
in
.
readLine
();
String
line
=
in
.
readLine
();
// intract property/comment string
// intract property/comment string
String
intactLine
=
line
;
String
intactLine
=
line
;
if
(
line
==
null
)
if
(
line
==
null
)
{
return
;
return
;
}
if
(
line
.
length
()
>
0
)
{
if
(
line
.
length
()
>
0
)
{
// Find start of key
// Find start of key
int
len
=
line
.
length
();
int
len
=
line
.
length
();
int
keyStart
;
int
keyStart
;
for
(
keyStart
=
0
;
keyStart
<
len
;
keyStart
++)
for
(
keyStart
=
0
;
keyStart
<
len
;
keyStart
++)
{
if
(
whiteSpaceChars
.
indexOf
(
line
.
charAt
(
keyStart
))
==
-
1
)
if
(
whiteSpaceChars
.
indexOf
(
line
.
charAt
(
keyStart
))
==
-
1
)
{
break
;
break
;
}
}
// Blank lines are ignored
// Blank lines are ignored
if
(
keyStart
==
len
)
if
(
keyStart
==
len
)
{
continue
;
continue
;
}
// Continue lines that end in slashes if they are not comments
// Continue lines that end in slashes if they are not comments
char
firstChar
=
line
.
charAt
(
keyStart
);
char
firstChar
=
line
.
charAt
(
keyStart
);
...
@@ -84,14 +89,17 @@ public class OrderProperties extends Properties {
...
@@ -84,14 +89,17 @@ public class OrderProperties extends Properties {
while
(
continueLine
(
line
))
{
while
(
continueLine
(
line
))
{
String
nextLine
=
in
.
readLine
();
String
nextLine
=
in
.
readLine
();
intactLine
=
intactLine
+
"\n"
+
nextLine
;
intactLine
=
intactLine
+
"\n"
+
nextLine
;
if
(
nextLine
==
null
)
if
(
nextLine
==
null
)
{
nextLine
=
""
;
nextLine
=
""
;
}
String
loppedLine
=
line
.
substring
(
0
,
len
-
1
);
String
loppedLine
=
line
.
substring
(
0
,
len
-
1
);
// Advance beyond whitespace on new line
// Advance beyond whitespace on new line
int
startIndex
;
int
startIndex
;
for
(
startIndex
=
0
;
startIndex
<
nextLine
.
length
();
startIndex
++)
for
(
startIndex
=
0
;
startIndex
<
nextLine
.
length
();
startIndex
++)
{
if
(
whiteSpaceChars
.
indexOf
(
nextLine
.
charAt
(
startIndex
))
==
-
1
)
if
(
whiteSpaceChars
.
indexOf
(
nextLine
.
charAt
(
startIndex
))
==
-
1
)
{
break
;
break
;
}
}
nextLine
=
nextLine
.
substring
(
startIndex
,
nextLine
.
length
());
nextLine
=
nextLine
.
substring
(
startIndex
,
nextLine
.
length
());
line
=
loppedLine
+
nextLine
;
line
=
loppedLine
+
nextLine
;
len
=
line
.
length
();
len
=
line
.
length
();
...
@@ -101,27 +109,33 @@ public class OrderProperties extends Properties {
...
@@ -101,27 +109,33 @@ public class OrderProperties extends Properties {
int
separatorIndex
;
int
separatorIndex
;
for
(
separatorIndex
=
keyStart
;
separatorIndex
<
len
;
separatorIndex
++)
{
for
(
separatorIndex
=
keyStart
;
separatorIndex
<
len
;
separatorIndex
++)
{
char
currentChar
=
line
.
charAt
(
separatorIndex
);
char
currentChar
=
line
.
charAt
(
separatorIndex
);
if
(
currentChar
==
'\\'
)
if
(
currentChar
==
'\\'
)
{
separatorIndex
++;
separatorIndex
++;
else
if
(
keyValueSeparators
.
indexOf
(
currentChar
)
!=
-
1
)
}
else
if
(
keyValueSeparators
.
indexOf
(
currentChar
)
!=
-
1
)
{
break
;
break
;
}
}
}
// Skip over whitespace after key if any
// Skip over whitespace after key if any
int
valueIndex
;
int
valueIndex
;
for
(
valueIndex
=
separatorIndex
;
valueIndex
<
len
;
valueIndex
++)
for
(
valueIndex
=
separatorIndex
;
valueIndex
<
len
;
valueIndex
++)
{
if
(
whiteSpaceChars
.
indexOf
(
line
.
charAt
(
valueIndex
))
==
-
1
)
if
(
whiteSpaceChars
.
indexOf
(
line
.
charAt
(
valueIndex
))
==
-
1
)
{
break
;
break
;
}
}
// Skip over one non whitespace key value separators if any
// Skip over one non whitespace key value separators if any
if
(
valueIndex
<
len
)
if
(
valueIndex
<
len
)
{
if
(
strictKeyValueSeparators
.
indexOf
(
line
.
charAt
(
valueIndex
))
!=
-
1
)
if
(
strictKeyValueSeparators
.
indexOf
(
line
.
charAt
(
valueIndex
))
!=
-
1
)
{
valueIndex
++;
valueIndex
++;
}
}
// Skip over white space after other separators if any
// Skip over white space after other separators if any
while
(
valueIndex
<
len
)
{
while
(
valueIndex
<
len
)
{
if
(
whiteSpaceChars
.
indexOf
(
line
.
charAt
(
valueIndex
))
==
-
1
)
if
(
whiteSpaceChars
.
indexOf
(
line
.
charAt
(
valueIndex
))
==
-
1
)
{
break
;
break
;
}
valueIndex
++;
valueIndex
++;
}
}
String
key
=
line
.
substring
(
keyStart
,
separatorIndex
);
String
key
=
line
.
substring
(
keyStart
,
separatorIndex
);
...
@@ -196,12 +210,11 @@ public class OrderProperties extends Properties {
...
@@ -196,12 +210,11 @@ public class OrderProperties extends Properties {
}
}
outBuffer
.
append
((
char
)
value
);
outBuffer
.
append
((
char
)
value
);
}
else
{
}
else
{
if
(
aChar
==
't'
)
if
(
aChar
==
't'
)
{
outBuffer
.
append
(
'\t'
);
/* ibm@7211 */
outBuffer
.
append
(
'\t'
);
/* ibm@7211 */
}
else
if
(
aChar
==
'r'
)
{
else
if
(
aChar
==
'r'
)
outBuffer
.
append
(
'\r'
);
/* ibm@7211 */
outBuffer
.
append
(
'\r'
);
/* ibm@7211 */
}
else
if
(
aChar
==
'n'
)
{
else
if
(
aChar
==
'n'
)
{
/*
/*
* ibm@8897 do not convert a \n to a line.separator
* ibm@8897 do not convert a \n to a line.separator
* because on some platforms line.separator is a String
* because on some platforms line.separator is a String
...
@@ -212,23 +225,27 @@ public class OrderProperties extends Properties {
...
@@ -212,23 +225,27 @@ public class OrderProperties extends Properties {
*
*
*/
*/
outBuffer
.
append
(
'\n'
);
/* ibm@8897 ibm@7211 */
outBuffer
.
append
(
'\n'
);
/* ibm@8897 ibm@7211 */
}
else
if
(
aChar
==
'f'
)
}
else
if
(
aChar
==
'f'
)
{
outBuffer
.
append
(
'\f'
);
/* ibm@7211 */
outBuffer
.
append
(
'\f'
);
/* ibm@7211 */
else
}
else
/* ibm@7211 */
/* ibm@7211 */
{
outBuffer
.
append
(
aChar
);
/* ibm@7211 */
outBuffer
.
append
(
aChar
);
/* ibm@7211 */
}
}
}
}
else
}
else
{
outBuffer
.
append
(
aChar
);
outBuffer
.
append
(
aChar
);
}
}
}
return
outBuffer
.
toString
();
return
outBuffer
.
toString
();
}
}
@Override
public
synchronized
void
store
(
OutputStream
out
,
String
header
)
throws
IOException
{
public
synchronized
void
store
(
OutputStream
out
,
String
header
)
throws
IOException
{
BufferedWriter
awriter
;
BufferedWriter
awriter
;
awriter
=
new
BufferedWriter
(
new
OutputStreamWriter
(
out
,
"8859_1"
));
awriter
=
new
BufferedWriter
(
new
OutputStreamWriter
(
out
,
"8859_1"
));
if
(
header
!=
null
)
if
(
header
!=
null
)
{
writeln
(
awriter
,
"#"
+
header
);
writeln
(
awriter
,
"#"
+
header
);
}
@SuppressWarnings
(
"rawtypes"
)
@SuppressWarnings
(
"rawtypes"
)
List
entrys
=
context
.
getCommentOrEntrys
();
List
entrys
=
context
.
getCommentOrEntrys
();
for
(
Object
obj
:
entrys
)
{
for
(
Object
obj
:
entrys
)
{
...
@@ -242,8 +259,9 @@ public class OrderProperties extends Properties {
...
@@ -242,8 +259,9 @@ public class OrderProperties extends Properties {
private
boolean
continueLine
(
String
line
)
{
private
boolean
continueLine
(
String
line
)
{
int
slashCount
=
0
;
int
slashCount
=
0
;
int
index
=
line
.
length
()
-
1
;
int
index
=
line
.
length
()
-
1
;
while
((
index
>=
0
)
&&
(
line
.
charAt
(
index
--)
==
'\\'
))
while
((
index
>=
0
)
&&
(
line
.
charAt
(
index
--)
==
'\\'
))
{
slashCount
++;
slashCount
++;
}
return
(
slashCount
%
2
==
1
);
return
(
slashCount
%
2
==
1
);
}
}
...
@@ -259,8 +277,9 @@ public class OrderProperties extends Properties {
...
@@ -259,8 +277,9 @@ public class OrderProperties extends Properties {
char
aChar
=
theString
.
charAt
(
x
);
char
aChar
=
theString
.
charAt
(
x
);
switch
(
aChar
)
{
switch
(
aChar
)
{
case
' '
:
case
' '
:
if
(
x
==
0
||
escapeSpace
)
if
(
x
==
0
||
escapeSpace
)
{
outBuffer
.
append
(
'\\'
);
outBuffer
.
append
(
'\\'
);
}
outBuffer
.
append
(
' '
);
outBuffer
.
append
(
' '
);
break
;
break
;
...
@@ -293,8 +312,9 @@ public class OrderProperties extends Properties {
...
@@ -293,8 +312,9 @@ public class OrderProperties extends Properties {
outBuffer
.
append
(
toHex
((
aChar
>>
4
)
&
0xF
));
outBuffer
.
append
(
toHex
((
aChar
>>
4
)
&
0xF
));
outBuffer
.
append
(
toHex
(
aChar
&
0xF
));
outBuffer
.
append
(
toHex
(
aChar
&
0xF
));
}
else
{
}
else
{
if
(
specialSaveChars
.
indexOf
(
aChar
)
!=
-
1
)
if
(
specialSaveChars
.
indexOf
(
aChar
)
!=
-
1
)
{
outBuffer
.
append
(
'\\'
);
outBuffer
.
append
(
'\\'
);
}
outBuffer
.
append
(
aChar
);
outBuffer
.
append
(
aChar
);
}
}
}
}
...
@@ -302,6 +322,7 @@ public class OrderProperties extends Properties {
...
@@ -302,6 +322,7 @@ public class OrderProperties extends Properties {
return
outBuffer
.
toString
();
return
outBuffer
.
toString
();
}
}
@Override
public
synchronized
Object
put
(
Object
key
,
Object
value
)
{
public
synchronized
Object
put
(
Object
key
,
Object
value
)
{
context
.
putOrUpdate
(
key
.
toString
(),
value
.
toString
());
context
.
putOrUpdate
(
key
.
toString
(),
value
.
toString
());
return
super
.
put
(
key
,
value
);
return
super
.
put
(
key
,
value
);
...
@@ -312,6 +333,7 @@ public class OrderProperties extends Properties {
...
@@ -312,6 +333,7 @@ public class OrderProperties extends Properties {
return
super
.
put
(
key
,
value
);
return
super
.
put
(
key
,
value
);
}
}
@Override
public
synchronized
Object
remove
(
Object
key
)
{
public
synchronized
Object
remove
(
Object
key
)
{
context
.
remove
(
key
.
toString
());
context
.
remove
(
key
.
toString
());
return
super
.
remove
(
key
);
return
super
.
remove
(
key
);
...
@@ -419,6 +441,7 @@ public class OrderProperties extends Properties {
...
@@ -419,6 +441,7 @@ public class OrderProperties extends Properties {
this
.
value
=
value
;
this
.
value
=
value
;
}
}
@Override
public
String
toString
()
{
public
String
toString
()
{
if
(
line
!=
null
)
{
if
(
line
!=
null
)
{
return
line
;
return
line
;
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/utils/PropertiesLoader.java
View file @
7fa8137a
...
@@ -181,8 +181,9 @@ public class PropertiesLoader {
...
@@ -181,8 +181,9 @@ public class PropertiesLoader {
String
mapKey
=
currentkey
+
"."
+
key
.
toString
();
String
mapKey
=
currentkey
+
"."
+
key
.
toString
();
values
.
put
(
mapKey
,
currentMap
.
get
(
key
).
toString
());
values
.
put
(
mapKey
,
currentMap
.
get
(
key
).
toString
());
}
}
}
else
}
else
{
values
.
put
(
currentkey
,
String
.
valueOf
(
currentObj
));
values
.
put
(
currentkey
,
String
.
valueOf
(
currentObj
));
}
}
}
return
values
;
return
values
;
}
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/utils/SendMailUtil.java
View file @
7fa8137a
/**
/**
* Copyright © 2012-2016 <a href="https://git
hub
.com
.
jee
s
pring
.>JeeSite
</a>
All rights reserved.
* Copyright © 2012-2016 <a href="https://git
ee
.com
/JeeHuangBingGui/
jee
S
pring
Cloud">JeeSpring
</a>All rights reserved.
*/
*/
package
com.jeespring.common.utils
;
package
com.jeespring.common.utils
;
...
@@ -159,8 +159,9 @@ public class SendMailUtil {
...
@@ -159,8 +159,9 @@ public class SendMailUtil {
hemail
.
setAuthentication
(
username
,
password
);
hemail
.
setAuthentication
(
username
,
password
);
hemail
.
setSubject
(
subject
);
hemail
.
setSubject
(
subject
);
hemail
.
setMsg
(
message
);
hemail
.
setMsg
(
message
);
if
(
from
.
contains
(
"@qq.com"
))
if
(
from
.
contains
(
"@qq.com"
))
{
hemail
.
setSSL
(
true
);
hemail
.
setSSL
(
true
);
}
hemail
.
send
();
hemail
.
send
();
//System.out.println("email send true!");
//System.out.println("email send true!");
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -181,8 +182,9 @@ public class SendMailUtil {
...
@@ -181,8 +182,9 @@ public class SendMailUtil {
hemail
.
setAuthentication
(
fromMailUsername
,
fromMailPassword
);
hemail
.
setAuthentication
(
fromMailUsername
,
fromMailPassword
);
hemail
.
setSubject
(
subject
);
hemail
.
setSubject
(
subject
);
hemail
.
setMsg
(
message
);
hemail
.
setMsg
(
message
);
if
(
fromMailAddr
.
contains
(
"@qq.com"
))
if
(
fromMailAddr
.
contains
(
"@qq.com"
))
{
hemail
.
setSSL
(
true
);
hemail
.
setSSL
(
true
);
}
hemail
.
send
();
hemail
.
send
();
//System.out.println("email send true!");
//System.out.println("email send true!");
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -230,8 +232,9 @@ public class SendMailUtil {
...
@@ -230,8 +232,9 @@ public class SendMailUtil {
// @SuppressWarnings("unchecked")
// @SuppressWarnings("unchecked")
public
static
String
getAppPath
(
Class
<?>
cls
)
{
public
static
String
getAppPath
(
Class
<?>
cls
)
{
// 检查用户传入的参数是否为空
// 检查用户传入的参数是否为空
if
(
cls
==
null
)
if
(
cls
==
null
)
{
throw
new
IllegalArgumentException
(
"参数不能为空!"
);
throw
new
IllegalArgumentException
(
"参数不能为空!"
);
}
ClassLoader
loader
=
cls
.
getClassLoader
();
ClassLoader
loader
=
cls
.
getClassLoader
();
// 获得类的全名,包括包名
// 获得类的全名,包括包名
String
clsName
=
cls
.
getName
()
+
".class"
;
String
clsName
=
cls
.
getName
()
+
".class"
;
...
@@ -242,14 +245,15 @@ public class SendMailUtil {
...
@@ -242,14 +245,15 @@ public class SendMailUtil {
if
(
pack
!=
null
)
{
if
(
pack
!=
null
)
{
String
packName
=
pack
.
getName
();
String
packName
=
pack
.
getName
();
// 此处简单判定是否是Java基础类库,防止用户传入JDK内置的类库
// 此处简单判定是否是Java基础类库,防止用户传入JDK内置的类库
if
(
packName
.
startsWith
(
"java."
)
||
packName
.
startsWith
(
"javax."
))
if
(
packName
.
startsWith
(
"java."
)
||
packName
.
startsWith
(
"javax."
))
{
throw
new
IllegalArgumentException
(
"不要传送系统类!"
);
throw
new
IllegalArgumentException
(
"不要传送系统类!"
);
}
// 在类的名称中,去掉包名的部分,获得类的文件名
// 在类的名称中,去掉包名的部分,获得类的文件名
clsName
=
clsName
.
substring
(
packName
.
length
()
+
1
);
clsName
=
clsName
.
substring
(
packName
.
length
()
+
1
);
// 判定包名是否是简单包名,如果是,则直接将包名转换为路径,
// 判定包名是否是简单包名,如果是,则直接将包名转换为路径,
if
(
packName
.
indexOf
(
"."
)
<
0
)
if
(
packName
.
indexOf
(
"."
)
<
0
)
{
path
=
packName
+
"/"
;
path
=
packName
+
"/"
;
else
{
// 否则按照包名的组成部分,将包名转换为路径
}
else
{
// 否则按照包名的组成部分,将包名转换为路径
int
start
=
0
,
end
=
0
;
int
start
=
0
,
end
=
0
;
end
=
packName
.
indexOf
(
"."
);
end
=
packName
.
indexOf
(
"."
);
while
(
end
!=
-
1
)
{
while
(
end
!=
-
1
)
{
...
@@ -266,14 +270,16 @@ public class SendMailUtil {
...
@@ -266,14 +270,16 @@ public class SendMailUtil {
String
realPath
=
url
.
getPath
();
String
realPath
=
url
.
getPath
();
// 去掉路径信息中的协议名"file:"
// 去掉路径信息中的协议名"file:"
int
pos
=
realPath
.
indexOf
(
"file:"
);
int
pos
=
realPath
.
indexOf
(
"file:"
);
if
(
pos
>
-
1
)
if
(
pos
>
-
1
)
{
realPath
=
realPath
.
substring
(
pos
+
5
);
realPath
=
realPath
.
substring
(
pos
+
5
);
}
// 去掉路径信息最后包含类文件信息的部分,得到类所在的路径
// 去掉路径信息最后包含类文件信息的部分,得到类所在的路径
pos
=
realPath
.
indexOf
(
path
+
clsName
);
pos
=
realPath
.
indexOf
(
path
+
clsName
);
realPath
=
realPath
.
substring
(
0
,
pos
-
1
);
realPath
=
realPath
.
substring
(
0
,
pos
-
1
);
// 如果类文件被打包到JAR等文件中时,去掉对应的JAR等打包文件名
// 如果类文件被打包到JAR等文件中时,去掉对应的JAR等打包文件名
if
(
realPath
.
endsWith
(
"!"
))
if
(
realPath
.
endsWith
(
"!"
))
{
realPath
=
realPath
.
substring
(
0
,
realPath
.
lastIndexOf
(
"/"
));
realPath
=
realPath
.
substring
(
0
,
realPath
.
lastIndexOf
(
"/"
));
}
/*------------------------------------------------------------
/*------------------------------------------------------------
ClassLoader的getResource方法使用了utf-8对路径信息进行了编码,当路径
ClassLoader的getResource方法使用了utf-8对路径信息进行了编码,当路径
中存在中文和空格时,他会对这些字符进行转换,这样,得到的往往不是我们想要
中存在中文和空格时,他会对这些字符进行转换,这样,得到的往往不是我们想要
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/utils/StreamUtils.java
View file @
7fa8137a
...
@@ -38,8 +38,9 @@ public class StreamUtils {
...
@@ -38,8 +38,9 @@ public class StreamUtils {
String
string
=
null
;
String
string
=
null
;
int
count
=
0
;
int
count
=
0
;
try
{
try
{
while
((
count
=
in
.
read
(
data
,
0
,
BUFFER_SIZE
))
!=
-
1
)
while
((
count
=
in
.
read
(
data
,
0
,
BUFFER_SIZE
))
!=
-
1
)
{
outStream
.
write
(
data
,
0
,
count
);
outStream
.
write
(
data
,
0
,
count
);
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -67,8 +68,9 @@ public class StreamUtils {
...
@@ -67,8 +68,9 @@ public class StreamUtils {
byte
[]
data
=
new
byte
[
BUFFER_SIZE
];
byte
[]
data
=
new
byte
[
BUFFER_SIZE
];
int
count
=
-
1
;
int
count
=
-
1
;
try
{
try
{
while
((
count
=
in
.
read
(
data
,
0
,
BUFFER_SIZE
))
!=
-
1
)
while
((
count
=
in
.
read
(
data
,
0
,
BUFFER_SIZE
))
!=
-
1
)
{
outStream
.
write
(
data
,
0
,
count
);
outStream
.
write
(
data
,
0
,
count
);
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -126,8 +128,9 @@ public class StreamUtils {
...
@@ -126,8 +128,9 @@ public class StreamUtils {
ByteArrayOutputStream
outStream
=
new
ByteArrayOutputStream
();
ByteArrayOutputStream
outStream
=
new
ByteArrayOutputStream
();
byte
[]
data
=
new
byte
[
BUFFER_SIZE
];
byte
[]
data
=
new
byte
[
BUFFER_SIZE
];
int
count
=
-
1
;
int
count
=
-
1
;
while
((
count
=
in
.
read
(
data
,
0
,
BUFFER_SIZE
))
!=
-
1
)
while
((
count
=
in
.
read
(
data
,
0
,
BUFFER_SIZE
))
!=
-
1
)
{
outStream
.
write
(
data
,
0
,
count
);
outStream
.
write
(
data
,
0
,
count
);
}
data
=
null
;
data
=
null
;
return
outStream
.
toByteArray
();
return
outStream
.
toByteArray
();
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/utils/TimeUtils.java
View file @
7fa8137a
...
@@ -284,6 +284,7 @@ public class TimeUtils {
...
@@ -284,6 +284,7 @@ public class TimeUtils {
+
this
.
timeSeparator
+
"mm"
+
this
.
timeSeparator
+
"ss"
);
+
this
.
timeSeparator
+
"mm"
+
this
.
timeSeparator
+
"ss"
);
}
}
@Override
public
String
toString
()
{
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
(
16
);
StringBuilder
sb
=
new
StringBuilder
(
16
);
sb
.
append
(
fields
[
DAY
]).
append
(
','
).
append
(
' '
);
sb
.
append
(
fields
[
DAY
]).
append
(
','
).
append
(
' '
);
...
@@ -300,6 +301,7 @@ public class TimeUtils {
...
@@ -300,6 +301,7 @@ public class TimeUtils {
return
sb
.
append
(
fields
[
field
]);
return
sb
.
append
(
fields
[
field
]);
}
}
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
final
int
PRIME
=
31
;
final
int
PRIME
=
31
;
int
result
=
1
;
int
result
=
1
;
...
@@ -307,13 +309,17 @@ public class TimeUtils {
...
@@ -307,13 +309,17 @@ public class TimeUtils {
return
result
;
return
result
;
}
}
@Override
public
boolean
equals
(
Object
obj
)
{
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
if
(
this
==
obj
)
{
return
true
;
return
true
;
if
(
obj
==
null
)
}
if
(
obj
==
null
)
{
return
false
;
return
false
;
if
(
getClass
()
!=
obj
.
getClass
())
}
if
(
getClass
()
!=
obj
.
getClass
())
{
return
false
;
return
false
;
}
final
TimeUtils
other
=
(
TimeUtils
)
obj
;
final
TimeUtils
other
=
(
TimeUtils
)
obj
;
if
(!
Arrays
.
equals
(
fields
,
other
.
fields
))
{
if
(!
Arrays
.
equals
(
fields
,
other
.
fields
))
{
return
false
;
return
false
;
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/utils/UploadUtils.java
View file @
7fa8137a
...
@@ -82,7 +82,7 @@ public class UploadUtils {
...
@@ -82,7 +82,7 @@ public class UploadUtils {
infos
[
0
]
=
this
.
validateFields
(
request
);
infos
[
0
]
=
this
.
validateFields
(
request
);
// 初始化表单元素
// 初始化表单元素
Map
<
String
,
Object
>
fieldsMap
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
fieldsMap
=
new
HashMap
<
String
,
Object
>();
if
(
infos
[
0
].
equals
(
"true"
))
{
if
(
"true"
.
equals
(
infos
[
0
]
))
{
fieldsMap
=
this
.
initFields
(
request
);
fieldsMap
=
this
.
initFields
(
request
);
}
}
// 上传
// 上传
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/utils/WorkDayUtils.java
View file @
7fa8137a
...
@@ -98,7 +98,7 @@ public class WorkDayUtils {
...
@@ -98,7 +98,7 @@ public class WorkDayUtils {
* @return
* @return
*/
*/
public
String
getChineseWeek
(
Calendar
date
)
{
public
String
getChineseWeek
(
Calendar
date
)
{
final
String
dayNames
[]
=
{
"星期日"
,
"星期一"
,
"星期二"
,
"星期三"
,
"星期四"
,
"星期五"
,
"星期六"
};
final
String
[]
dayNames
=
{
"星期日"
,
"星期一"
,
"星期二"
,
"星期三"
,
"星期四"
,
"星期五"
,
"星期六"
};
int
dayOfWeek
=
date
.
get
(
Calendar
.
DAY_OF_WEEK
);
int
dayOfWeek
=
date
.
get
(
Calendar
.
DAY_OF_WEEK
);
// System.out.println(dayNames[dayOfWeek - 1]);
// System.out.println(dayNames[dayOfWeek - 1]);
return
dayNames
[
dayOfWeek
-
1
];
return
dayNames
[
dayOfWeek
-
1
];
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/utils/ZxingHandler.java
View file @
7fa8137a
...
@@ -23,7 +23,7 @@ import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
...
@@ -23,7 +23,7 @@ import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
/**
/**
* 条形码和二维码编码解码
* 条形码和二维码编码解码
*
*
* @author
ThinkGem
* @author
JeeSpring
* @version 2014-02-28
* @version 2014-02-28
*/
*/
public
class
ZxingHandler
{
public
class
ZxingHandler
{
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/utils/http/HttpUtils.java
View file @
7fa8137a
...
@@ -183,7 +183,7 @@ public class HttpUtils
...
@@ -183,7 +183,7 @@ public class HttpUtils
String
ret
=
""
;
String
ret
=
""
;
while
((
ret
=
br
.
readLine
())
!=
null
)
while
((
ret
=
br
.
readLine
())
!=
null
)
{
{
if
(
ret
!=
null
&&
!
ret
.
trim
()
.
equals
(
""
))
if
(
ret
!=
null
&&
!
""
.
equals
(
ret
.
trim
()))
{
{
result
.
append
(
new
String
(
ret
.
getBytes
(
"ISO-8859-1"
),
"utf-8"
));
result
.
append
(
new
String
(
ret
.
getBytes
(
"ISO-8859-1"
),
"utf-8"
));
}
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/web/AbstractBaseController.java
View file @
7fa8137a
...
@@ -195,23 +195,31 @@ public abstract class AbstractBaseController {
...
@@ -195,23 +195,31 @@ public abstract class AbstractBaseController {
if
(!
RedisUtils
.
isShireRedis
()){
return
;}
if
(!
RedisUtils
.
isShireRedis
()){
return
;}
if
(!
oauthService
.
isOauthOpen
()){
return
;}
if
(!
oauthService
.
isOauthOpen
()){
return
;}
//if(request.getRequestURI().indexOf("/rest/")<0) return;
//if(request.getRequestURI().indexOf("/rest/")<0) return;
if
(
request
.
getRequestURI
().
indexOf
(
"/rest/oauth/apiTimeLimiFaild"
)>=
0
)
return
;
if
(
request
.
getRequestURI
().
indexOf
(
"/rest/oauth/apiTimeLimiFaild"
)>=
0
)
{
if
(
request
.
getRequestURI
().
indexOf
(
"/admin?login"
)>=
0
)
return
;
return
;
if
(
request
.
getRequestURI
().
indexOf
(
"/admin/login"
)>=
0
)
return
;
}
if
(
request
.
getRequestURI
().
equals
(
"/admin"
)){
if
(
request
.
getRequestURI
().
indexOf
(
"/admin?login"
)>=
0
)
{
return
;
}
if
(
request
.
getRequestURI
().
indexOf
(
"/admin/login"
)>=
0
)
{
return
;
}
if
(
"/admin"
.
equals
(
request
.
getRequestURI
())){
Result
result
=
oauthService
.
userOnlineAmount
();
Result
result
=
oauthService
.
userOnlineAmount
();
if
(
result
.
getResultCode
()
.
equals
(
"-1"
))
if
(
"-1"
.
equals
(
result
.
getResultCode
()))
{
response
.
sendRedirect
(
"/rest/oauth/userOnlineAmountFaild"
);
response
.
sendRedirect
(
"/rest/oauth/userOnlineAmountFaild"
);
}
return
;
return
;
}
}
oauthService
.
setApiTime
();
oauthService
.
setApiTime
();
Result
result
=
oauthService
.
ApiTimeLimi
(
request
.
getRemoteAddr
());
Result
result
=
oauthService
.
ApiTimeLimi
(
request
.
getRemoteAddr
());
if
(
result
.
getResultCoe
().
toString
()==
"-1"
){
if
(
result
.
getResultCoe
().
toString
()==
"-1"
){
//response.sendRedirect("../error/403");
//response.sendRedirect("../error/403");
if
(
request
.
getRequestURI
().
indexOf
(
"/rest/"
)>
0
)
if
(
request
.
getRequestURI
().
indexOf
(
"/rest/"
)>
0
)
{
response
.
sendRedirect
(
"/rest/oauth/apiTimeLimiFaild?apiTimeLimi="
+
result
.
getResultObject
());
response
.
sendRedirect
(
"/rest/oauth/apiTimeLimiFaild?apiTimeLimi="
+
result
.
getResultObject
());
else
}
else
{
response
.
sendRedirect
(
"/rest/oauth/apiTimeLimiFaild?apiTimeLimi="
+
result
.
getResultObject
());
response
.
sendRedirect
(
"/rest/oauth/apiTimeLimiFaild?apiTimeLimi="
+
result
.
getResultObject
());
}
//response.sendRedirect("/rest/oauth/apiTimeLimifaild");
//response.sendRedirect("/rest/oauth/apiTimeLimifaild");
}
}
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
...
@@ -226,10 +234,18 @@ public abstract class AbstractBaseController {
...
@@ -226,10 +234,18 @@ public abstract class AbstractBaseController {
try
{
try
{
if
(!
RedisUtils
.
isShireRedis
()){
return
;}
if
(!
RedisUtils
.
isShireRedis
()){
return
;}
if
(!
oauthService
.
isOauthOpen
()){
return
;}
if
(!
oauthService
.
isOauthOpen
()){
return
;}
if
(
request
.
getRequestURI
().
indexOf
(
"/rest/"
)<
0
)
return
;
if
(
request
.
getRequestURI
().
indexOf
(
"/rest/"
)<
0
)
{
if
(
request
.
getRequestURI
().
indexOf
(
"/rest/oauth/token"
)>=
0
)
return
;
return
;
if
(
request
.
getRequestURI
().
indexOf
(
"/rest/oauth/faild"
)>=
0
)
return
;
}
if
(
request
.
getRequestURI
().
indexOf
(
"/rest/oauth/checkToken"
)>=
0
)
return
;
if
(
request
.
getRequestURI
().
indexOf
(
"/rest/oauth/token"
)>=
0
)
{
return
;
}
if
(
request
.
getRequestURI
().
indexOf
(
"/rest/oauth/faild"
)>=
0
)
{
return
;
}
if
(
request
.
getRequestURI
().
indexOf
(
"/rest/oauth/checkToken"
)>=
0
)
{
return
;
}
Result
result
=
oauthService
.
checkToken
(
request
.
getParameter
(
"token"
),
request
.
getRemoteAddr
());
Result
result
=
oauthService
.
checkToken
(
request
.
getParameter
(
"token"
),
request
.
getRemoteAddr
());
if
(
result
.
getResultCoe
().
toString
()==
"-1"
){
if
(
result
.
getResultCoe
().
toString
()==
"-1"
){
//response.sendRedirect("../error/403");
//response.sendRedirect("../error/403");
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/web/CKFinderConfig.java
View file @
7fa8137a
...
@@ -96,25 +96,28 @@ public class CKFinderConfig extends Configuration {
...
@@ -96,25 +96,28 @@ public class CKFinderConfig extends Configuration {
for
(
int
i
=
0
;
i
<
nodeList
.
getLength
();
++
i
)
{
for
(
int
i
=
0
;
i
<
nodeList
.
getLength
();
++
i
)
{
Node
childNode
=
nodeList
.
item
(
i
);
Node
childNode
=
nodeList
.
item
(
i
);
if
(
childNode
.
getNodeName
()
.
equals
(
"enabled"
))
if
(
"enabled"
.
equals
(
childNode
.
getNodeName
()))
{
this
.
enabled
=
Boolean
.
valueOf
(
childNode
.
getTextContent
().
trim
()).
booleanValue
();
this
.
enabled
=
Boolean
.
valueOf
(
childNode
.
getTextContent
().
trim
()).
booleanValue
();
}
if
(
childNode
.
getNodeName
()
.
equals
(
"baseDir"
))
{
if
(
"baseDir"
.
equals
(
childNode
.
getNodeName
()))
{
this
.
baseDir
=
childNode
.
getTextContent
().
trim
();
this
.
baseDir
=
childNode
.
getTextContent
().
trim
();
this
.
baseDir
=
PathUtils
.
escape
(
this
.
baseDir
);
this
.
baseDir
=
PathUtils
.
escape
(
this
.
baseDir
);
this
.
baseDir
=
PathUtils
.
addSlashToEnd
(
this
.
baseDir
);
this
.
baseDir
=
PathUtils
.
addSlashToEnd
(
this
.
baseDir
);
}
}
if
(
childNode
.
getNodeName
()
.
equals
(
"baseURL"
))
{
if
(
"baseURL"
.
equals
(
childNode
.
getNodeName
()))
{
this
.
baseURL
=
childNode
.
getTextContent
().
trim
();
this
.
baseURL
=
childNode
.
getTextContent
().
trim
();
this
.
baseURL
=
PathUtils
.
escape
(
this
.
baseURL
);
this
.
baseURL
=
PathUtils
.
escape
(
this
.
baseURL
);
this
.
baseURL
=
PathUtils
.
addSlashToEnd
(
this
.
baseURL
);
this
.
baseURL
=
PathUtils
.
addSlashToEnd
(
this
.
baseURL
);
}
}
if
(
childNode
.
getNodeName
()
.
equals
(
"licenseName"
))
if
(
"licenseName"
.
equals
(
childNode
.
getNodeName
()))
{
this
.
licenseName
=
childNode
.
getTextContent
().
trim
();
this
.
licenseName
=
childNode
.
getTextContent
().
trim
();
if
(
childNode
.
getNodeName
().
equals
(
"licenseKey"
))
}
if
(
"licenseKey"
.
equals
(
childNode
.
getNodeName
()))
{
this
.
licenseKey
=
childNode
.
getTextContent
().
trim
();
this
.
licenseKey
=
childNode
.
getTextContent
().
trim
();
}
String
value
;
String
value
;
if
(
childNode
.
getNodeName
()
.
equals
(
"imgWidth"
))
{
if
(
"imgWidth"
.
equals
(
childNode
.
getNodeName
()))
{
value
=
childNode
.
getTextContent
().
trim
();
value
=
childNode
.
getTextContent
().
trim
();
value
=
value
.
replaceAll
(
"//D"
,
""
);
value
=
value
.
replaceAll
(
"//D"
,
""
);
...
@@ -124,14 +127,14 @@ public class CKFinderConfig extends Configuration {
...
@@ -124,14 +127,14 @@ public class CKFinderConfig extends Configuration {
this
.
imgWidth
=
null
;
this
.
imgWidth
=
null
;
}
}
}
}
if
(
childNode
.
getNodeName
()
.
equals
(
"imgQuality"
))
{
if
(
"imgQuality"
.
equals
(
childNode
.
getNodeName
()))
{
value
=
childNode
.
getTextContent
().
trim
();
value
=
childNode
.
getTextContent
().
trim
();
value
=
value
.
replaceAll
(
"//D"
,
""
);
value
=
value
.
replaceAll
(
"//D"
,
""
);
method
=
clazz
.
getDeclaredMethod
(
"adjustQuality"
,
new
Class
[]{
String
.
class
});
method
=
clazz
.
getDeclaredMethod
(
"adjustQuality"
,
new
Class
[]{
String
.
class
});
method
.
setAccessible
(
true
);
method
.
setAccessible
(
true
);
this
.
imgQuality
=
Float
.
parseFloat
(
method
.
invoke
(
this
,
value
).
toString
());
this
.
imgQuality
=
Float
.
parseFloat
(
method
.
invoke
(
this
,
value
).
toString
());
}
}
if
(
childNode
.
getNodeName
()
.
equals
(
"imgHeight"
))
{
if
(
"imgHeight"
.
equals
(
childNode
.
getNodeName
()))
{
value
=
childNode
.
getTextContent
().
trim
();
value
=
childNode
.
getTextContent
().
trim
();
value
=
value
.
replaceAll
(
"//D"
,
""
);
value
=
value
.
replaceAll
(
"//D"
,
""
);
try
{
try
{
...
@@ -140,63 +143,72 @@ public class CKFinderConfig extends Configuration {
...
@@ -140,63 +143,72 @@ public class CKFinderConfig extends Configuration {
this
.
imgHeight
=
null
;
this
.
imgHeight
=
null
;
}
}
}
}
if
(
childNode
.
getNodeName
()
.
equals
(
"thumbs"
))
{
if
(
"thumbs"
.
equals
(
childNode
.
getNodeName
()))
{
method
=
clazz
.
getDeclaredMethod
(
"setThumbs"
,
new
Class
[]{
NodeList
.
class
});
method
=
clazz
.
getDeclaredMethod
(
"setThumbs"
,
new
Class
[]{
NodeList
.
class
});
method
.
setAccessible
(
true
);
method
.
setAccessible
(
true
);
method
.
invoke
(
this
,
childNode
.
getChildNodes
());
method
.
invoke
(
this
,
childNode
.
getChildNodes
());
}
}
if
(
childNode
.
getNodeName
().
equals
(
"accessControls"
))
{
if
(
"accessControls"
.
equals
(
childNode
.
getNodeName
()
))
{
method
=
clazz
.
getDeclaredMethod
(
"setACLs"
,
new
Class
[]{
NodeList
.
class
});
method
=
clazz
.
getDeclaredMethod
(
"setACLs"
,
new
Class
[]{
NodeList
.
class
});
method
.
setAccessible
(
true
);
method
.
setAccessible
(
true
);
method
.
invoke
(
this
,
childNode
.
getChildNodes
());
method
.
invoke
(
this
,
childNode
.
getChildNodes
());
}
}
if
(
childNode
.
getNodeName
()
.
equals
(
"hideFolders"
))
{
if
(
"hideFolders"
.
equals
(
childNode
.
getNodeName
()))
{
method
=
clazz
.
getDeclaredMethod
(
"setHiddenFolders"
,
new
Class
[]{
NodeList
.
class
});
method
=
clazz
.
getDeclaredMethod
(
"setHiddenFolders"
,
new
Class
[]{
NodeList
.
class
});
method
.
setAccessible
(
true
);
method
.
setAccessible
(
true
);
method
.
invoke
(
this
,
childNode
.
getChildNodes
());
method
.
invoke
(
this
,
childNode
.
getChildNodes
());
}
}
if
(
childNode
.
getNodeName
()
.
equals
(
"hideFiles"
))
{
if
(
"hideFiles"
.
equals
(
childNode
.
getNodeName
()))
{
method
=
clazz
.
getDeclaredMethod
(
"setHiddenFiles"
,
new
Class
[]{
NodeList
.
class
});
method
=
clazz
.
getDeclaredMethod
(
"setHiddenFiles"
,
new
Class
[]{
NodeList
.
class
});
method
.
setAccessible
(
true
);
method
.
setAccessible
(
true
);
method
.
invoke
(
this
,
childNode
.
getChildNodes
());
method
.
invoke
(
this
,
childNode
.
getChildNodes
());
}
}
if
(
childNode
.
getNodeName
().
equals
(
"checkDoubleExtension"
))
if
(
"checkDoubleExtension"
.
equals
(
childNode
.
getNodeName
()))
{
this
.
doubleExtensions
=
Boolean
.
valueOf
(
childNode
.
getTextContent
().
trim
()).
booleanValue
();
this
.
doubleExtensions
=
Boolean
.
valueOf
(
childNode
.
getTextContent
().
trim
()).
booleanValue
();
if
(
childNode
.
getNodeName
().
equals
(
"disallowUnsafeCharacters"
))
}
if
(
"disallowUnsafeCharacters"
.
equals
(
childNode
.
getNodeName
()))
{
this
.
disallowUnsafeCharacters
=
Boolean
.
valueOf
(
childNode
.
getTextContent
().
trim
()).
booleanValue
();
this
.
disallowUnsafeCharacters
=
Boolean
.
valueOf
(
childNode
.
getTextContent
().
trim
()).
booleanValue
();
if
(
childNode
.
getNodeName
().
equals
(
"forceASCII"
))
}
if
(
"forceASCII"
.
equals
(
childNode
.
getNodeName
()))
{
this
.
forceASCII
=
Boolean
.
valueOf
(
childNode
.
getTextContent
().
trim
()).
booleanValue
();
this
.
forceASCII
=
Boolean
.
valueOf
(
childNode
.
getTextContent
().
trim
()).
booleanValue
();
if
(
childNode
.
getNodeName
().
equals
(
"checkSizeAfterScaling"
))
}
if
(
"checkSizeAfterScaling"
.
equals
(
childNode
.
getNodeName
()))
{
this
.
checkSizeAfterScaling
=
Boolean
.
valueOf
(
childNode
.
getTextContent
().
trim
()).
booleanValue
();
this
.
checkSizeAfterScaling
=
Boolean
.
valueOf
(
childNode
.
getTextContent
().
trim
()).
booleanValue
();
}
Scanner
sc
;
Scanner
sc
;
if
(
childNode
.
getNodeName
().
equals
(
"htmlExtensions"
))
{
if
(
"htmlExtensions"
.
equals
(
childNode
.
getNodeName
()
))
{
value
=
childNode
.
getTextContent
();
value
=
childNode
.
getTextContent
();
sc
=
(
new
Scanner
(
value
)).
useDelimiter
(
","
);
sc
=
(
new
Scanner
(
value
)).
useDelimiter
(
","
);
while
(
sc
.
hasNext
())
{
while
(
sc
.
hasNext
())
{
String
val
=
sc
.
next
();
String
val
=
sc
.
next
();
if
(
val
!=
null
&&
!
val
.
equals
(
""
))
if
(
val
!=
null
&&
!
""
.
equals
(
val
))
{
this
.
htmlExtensions
.
add
(
val
.
trim
().
toLowerCase
());
this
.
htmlExtensions
.
add
(
val
.
trim
().
toLowerCase
());
}
}
}
}
}
if
(
childNode
.
getNodeName
().
equals
(
"secureImageUploads"
))
if
(
"secureImageUploads"
.
equals
(
childNode
.
getNodeName
()))
{
this
.
secureImageUploads
=
Boolean
.
valueOf
(
childNode
.
getTextContent
().
trim
()).
booleanValue
();
this
.
secureImageUploads
=
Boolean
.
valueOf
(
childNode
.
getTextContent
().
trim
()).
booleanValue
();
if
(
childNode
.
getNodeName
().
equals
(
"uriEncoding"
))
}
if
(
"uriEncoding"
.
equals
(
childNode
.
getNodeName
()))
{
this
.
uriEncoding
=
childNode
.
getTextContent
().
trim
();
this
.
uriEncoding
=
childNode
.
getTextContent
().
trim
();
if
(
childNode
.
getNodeName
().
equals
(
"userRoleSessionVar"
))
}
if
(
"userRoleSessionVar"
.
equals
(
childNode
.
getNodeName
()))
{
this
.
userRoleSessionVar
=
childNode
.
getTextContent
().
trim
();
this
.
userRoleSessionVar
=
childNode
.
getTextContent
().
trim
();
if
(
childNode
.
getNodeName
().
equals
(
"defaultResourceTypes"
))
{
}
if
(
"defaultResourceTypes"
.
equals
(
childNode
.
getNodeName
()))
{
value
=
childNode
.
getTextContent
().
trim
();
value
=
childNode
.
getTextContent
().
trim
();
sc
=
(
new
Scanner
(
value
)).
useDelimiter
(
","
);
sc
=
(
new
Scanner
(
value
)).
useDelimiter
(
","
);
while
(
sc
.
hasNext
())
while
(
sc
.
hasNext
())
{
this
.
defaultResourceTypes
.
add
(
sc
.
next
());
this
.
defaultResourceTypes
.
add
(
sc
.
next
());
}
}
}
if
(
childNode
.
getNodeName
()
.
equals
(
"plugins"
))
{
if
(
"plugins"
.
equals
(
childNode
.
getNodeName
()))
{
method
=
clazz
.
getDeclaredMethod
(
"setPlugins"
,
new
Class
[]{
Node
.
class
});
method
=
clazz
.
getDeclaredMethod
(
"setPlugins"
,
new
Class
[]{
Node
.
class
});
method
.
setAccessible
(
true
);
method
.
setAccessible
(
true
);
method
.
invoke
(
this
,
childNode
);
method
.
invoke
(
this
,
childNode
);
}
}
if
(
childNode
.
getNodeName
().
equals
(
"basePathBuilderImpl"
))
{
if
(
"basePathBuilderImpl"
.
equals
(
childNode
.
getNodeName
()
))
{
method
=
clazz
.
getDeclaredMethod
(
"setBasePathImpl"
,
new
Class
[]{
String
.
class
});
method
=
clazz
.
getDeclaredMethod
(
"setBasePathImpl"
,
new
Class
[]{
String
.
class
});
method
.
setAccessible
(
true
);
method
.
setAccessible
(
true
);
method
.
invoke
(
this
,
childNode
.
getTextContent
().
trim
());
method
.
invoke
(
this
,
childNode
.
getTextContent
().
trim
());
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/web/Servlets.java
View file @
7fa8137a
...
@@ -239,8 +239,9 @@ public class Servlets {
...
@@ -239,8 +239,9 @@ public class Servlets {
* @throws Exception
* @throws Exception
*/
*/
public
static
boolean
isStaticFile
(
String
uri
)
{
public
static
boolean
isStaticFile
(
String
uri
)
{
if
(
staticFiles
==
null
)
if
(
staticFiles
==
null
)
{
staticFiles
=
StringUtils
.
split
(
Global
.
getConfig
(
"web.staticFile"
),
","
);
staticFiles
=
StringUtils
.
split
(
Global
.
getConfig
(
"web.staticFile"
),
","
);
}
return
StringUtils
.
endsWithAny
(
uri
,
staticFiles
)
&&
!
StringUtils
.
endsWithAny
(
uri
,
".html"
)
return
StringUtils
.
endsWithAny
(
uri
,
staticFiles
)
&&
!
StringUtils
.
endsWithAny
(
uri
,
".html"
)
&&
!
StringUtils
.
endsWithAny
(
uri
,
".jsp"
)
&&
!
StringUtils
.
endsWithAny
(
uri
,
".java"
);
&&
!
StringUtils
.
endsWithAny
(
uri
,
".jsp"
)
&&
!
StringUtils
.
endsWithAny
(
uri
,
".java"
);
}
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/websocket/WebSockertFilter.java
View file @
7fa8137a
...
@@ -56,7 +56,8 @@ public class WebSockertFilter{
...
@@ -56,7 +56,8 @@ public class WebSockertFilter{
Timer
timer
=
new
Timer
();
Timer
timer
=
new
Timer
();
timer
.
scheduleAtFixedRate
(
new
TimerTask
()
{
timer
.
scheduleAtFixedRate
(
new
TimerTask
()
{
public
void
run
()
{
@Override
public
void
run
()
{
//PersonService personService = (PersonService)ApplicationContext.getBean("personService");
//PersonService personService = (PersonService)ApplicationContext.getBean("personService");
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/act/dao/ActDao.java
View file @
7fa8137a
/**
/**
* Copyright © 2012-2016 <a href="https://git
hub
.com/
thinkgem/jeesite
">JeeS
ite
</a> All rights reserved.
* Copyright © 2012-2016 <a href="https://git
ee
.com/
JeeHuangBingGui/jeeSpringCloud
">JeeS
pring
</a> All rights reserved.
*/
*/
package
com.jeespring.modules.act.dao
;
package
com.jeespring.modules.act.dao
;
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/act/entity/Act.java
View file @
7fa8137a
/**
/**
* Copyright © 2012-2016 <a href="https://git
hub
.com/
thinkgem/jeesite
">JeeS
ite
</a> All rights reserved.
* Copyright © 2012-2016 <a href="https://git
ee
.com/
JeeHuangBingGui/jeeSpringCloud
">JeeS
pring
</a> All rights reserved.
*/
*/
package
com.jeespring.modules.act.entity
;
package
com.jeespring.modules.act.entity
;
...
@@ -22,7 +22,7 @@ import com.jeespring.modules.act.utils.Variable;
...
@@ -22,7 +22,7 @@ import com.jeespring.modules.act.utils.Variable;
/**
/**
* 工作流Entity
* 工作流Entity
* @author
ThinkGem
* @author
JeeSpring
* @version 2013-11-03
* @version 2013-11-03
*/
*/
public
class
Act
extends
AbstractBaseEntity
<
Act
>
{
public
class
Act
extends
AbstractBaseEntity
<
Act
>
{
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/act/rest/diagram/services/BaseProcessDefinitionDiagramLayoutResource.java
View file @
7fa8137a
...
@@ -127,8 +127,9 @@ public class BaseProcessDefinitionDiagramLayoutResource {
...
@@ -127,8 +127,9 @@ public class BaseProcessDefinitionDiagramLayoutResource {
activityArray
.
add
(
activityName
);
activityArray
.
add
(
activityName
);
}
}
for
(
String
flow
:
highLightedFlows
)
for
(
String
flow
:
highLightedFlows
)
{
flowsArray
.
add
(
flow
);
flowsArray
.
add
(
flow
);
}
responseJSON
.
put
(
"highLightedActivities"
,
activityArray
);
responseJSON
.
put
(
"highLightedActivities"
,
activityArray
);
responseJSON
.
put
(
"highLightedFlows"
,
flowsArray
);
responseJSON
.
put
(
"highLightedFlows"
,
flowsArray
);
...
@@ -195,8 +196,9 @@ public class BaseProcessDefinitionDiagramLayoutResource {
...
@@ -195,8 +196,9 @@ public class BaseProcessDefinitionDiagramLayoutResource {
laneSetArray
.
add
(
laneSetJSON
);
laneSetArray
.
add
(
laneSetJSON
);
}
}
if
(
laneSetArray
.
size
()
>
0
)
if
(
laneSetArray
.
size
()
>
0
)
{
responseJSON
.
put
(
"laneSets"
,
laneSetArray
);
responseJSON
.
put
(
"laneSets"
,
laneSetArray
);
}
}
}
ArrayNode
sequenceFlowArray
=
new
ObjectMapper
().
createArrayNode
();
ArrayNode
sequenceFlowArray
=
new
ObjectMapper
().
createArrayNode
();
...
@@ -297,12 +299,15 @@ public class BaseProcessDefinitionDiagramLayoutResource {
...
@@ -297,12 +299,15 @@ public class BaseProcessDefinitionDiagramLayoutResource {
flowJSON
.
put
(
"flow"
,
"("
+
sequenceFlow
.
getSource
().
getId
()
+
")--"
+
sequenceFlow
.
getId
()
+
"-->("
flowJSON
.
put
(
"flow"
,
"("
+
sequenceFlow
.
getSource
().
getId
()
+
")--"
+
sequenceFlow
.
getId
()
+
"-->("
+
sequenceFlow
.
getDestination
().
getId
()
+
")"
);
+
sequenceFlow
.
getDestination
().
getId
()
+
")"
);
if
(
isConditional
)
if
(
isConditional
)
{
flowJSON
.
put
(
"isConditional"
,
isConditional
);
flowJSON
.
put
(
"isConditional"
,
isConditional
);
if
(
isDefault
)
}
flowJSON
.
put
(
"isDefault"
,
isDefault
);
if
(
isDefault
)
{
if
(
isHighLighted
)
flowJSON
.
put
(
"isDefault"
,
isDefault
);
flowJSON
.
put
(
"isHighLighted"
,
isHighLighted
);
}
if
(
isHighLighted
)
{
flowJSON
.
put
(
"isHighLighted"
,
isHighLighted
);
}
flowJSON
.
put
(
"xPointArray"
,
xPointArray
);
flowJSON
.
put
(
"xPointArray"
,
xPointArray
);
flowJSON
.
put
(
"yPointArray"
,
yPointArray
);
flowJSON
.
put
(
"yPointArray"
,
yPointArray
);
...
@@ -320,36 +325,39 @@ public class BaseProcessDefinitionDiagramLayoutResource {
...
@@ -320,36 +325,39 @@ public class BaseProcessDefinitionDiagramLayoutResource {
ObjectNode
propertiesJSON
=
new
ObjectMapper
().
createObjectNode
();
ObjectNode
propertiesJSON
=
new
ObjectMapper
().
createObjectNode
();
for
(
String
key
:
properties
.
keySet
())
{
for
(
String
key
:
properties
.
keySet
())
{
Object
prop
=
properties
.
get
(
key
);
Object
prop
=
properties
.
get
(
key
);
if
(
prop
instanceof
String
)
if
(
prop
instanceof
String
)
{
propertiesJSON
.
put
(
key
,
(
String
)
properties
.
get
(
key
));
propertiesJSON
.
put
(
key
,
(
String
)
properties
.
get
(
key
));
else
if
(
prop
instanceof
Integer
)
}
else
if
(
prop
instanceof
Integer
)
{
propertiesJSON
.
put
(
key
,
(
Integer
)
properties
.
get
(
key
));
propertiesJSON
.
put
(
key
,
(
Integer
)
properties
.
get
(
key
));
else
if
(
prop
instanceof
Boolean
)
}
else
if
(
prop
instanceof
Boolean
)
{
propertiesJSON
.
put
(
key
,
(
Boolean
)
properties
.
get
(
key
));
propertiesJSON
.
put
(
key
,
(
Boolean
)
properties
.
get
(
key
));
else
if
(
"initial"
.
equals
(
key
))
{
}
else
if
(
"initial"
.
equals
(
key
))
{
ActivityImpl
act
=
(
ActivityImpl
)
properties
.
get
(
key
);
ActivityImpl
act
=
(
ActivityImpl
)
properties
.
get
(
key
);
propertiesJSON
.
put
(
key
,
act
.
getId
());
propertiesJSON
.
put
(
key
,
act
.
getId
());
}
else
if
(
"timerDeclarations"
.
equals
(
key
))
{
}
else
if
(
"timerDeclarations"
.
equals
(
key
))
{
ArrayList
<
TimerDeclarationImpl
>
timerDeclarations
=
(
ArrayList
<
TimerDeclarationImpl
>)
properties
.
get
(
key
);
ArrayList
<
TimerDeclarationImpl
>
timerDeclarations
=
(
ArrayList
<
TimerDeclarationImpl
>)
properties
.
get
(
key
);
ArrayNode
timerDeclarationArray
=
new
ObjectMapper
().
createArrayNode
();
ArrayNode
timerDeclarationArray
=
new
ObjectMapper
().
createArrayNode
();
if
(
timerDeclarations
!=
null
)
if
(
timerDeclarations
!=
null
)
{
for
(
TimerDeclarationImpl
timerDeclaration
:
timerDeclarations
)
{
for
(
TimerDeclarationImpl
timerDeclaration
:
timerDeclarations
)
{
ObjectNode
timerDeclarationJSON
=
new
ObjectMapper
().
createObjectNode
();
ObjectNode
timerDeclarationJSON
=
new
ObjectMapper
().
createObjectNode
();
timerDeclarationJSON
.
put
(
"isExclusive"
,
timerDeclaration
.
isExclusive
());
timerDeclarationJSON
.
put
(
"isExclusive"
,
timerDeclaration
.
isExclusive
());
if
(
timerDeclaration
.
getRepeat
()
!=
null
)
if
(
timerDeclaration
.
getRepeat
()
!=
null
)
{
timerDeclarationJSON
.
put
(
"repeat"
,
timerDeclaration
.
getRepeat
());
timerDeclarationJSON
.
put
(
"repeat"
,
timerDeclaration
.
getRepeat
());
}
timerDeclarationJSON
.
put
(
"retries"
,
String
.
valueOf
(
timerDeclaration
.
getRetries
()));
timerDeclarationJSON
.
put
(
"type"
,
timerDeclaration
.
getJobHandlerType
());
timerDeclarationJSON
.
put
(
"retries"
,
String
.
valueOf
(
timerDeclaration
.
getRetries
()));
timerDeclarationJSON
.
put
(
"configuration"
,
timerDeclaration
.
getJobHandlerConfiguration
());
timerDeclarationJSON
.
put
(
"type"
,
timerDeclaration
.
getJobHandlerType
());
//timerDeclarationJSON.put("expression", timerDeclaration.getDescription());
timerDeclarationJSON
.
put
(
"configuration"
,
timerDeclaration
.
getJobHandlerConfiguration
());
//timerDeclarationJSON.put("expression", timerDeclaration.getDescription());
timerDeclarationArray
.
add
(
timerDeclarationJSON
);
}
timerDeclarationArray
.
add
(
timerDeclarationJSON
);
if
(
timerDeclarationArray
.
size
()
>
0
)
}
propertiesJSON
.
put
(
key
,
timerDeclarationArray
);
}
if
(
timerDeclarationArray
.
size
()
>
0
)
{
propertiesJSON
.
put
(
key
,
timerDeclarationArray
);
}
// TODO: implement getting description
// TODO: implement getting description
}
else
if
(
"eventDefinitions"
.
equals
(
key
))
{
}
else
if
(
"eventDefinitions"
.
equals
(
key
))
{
ArrayList
<
EventSubscriptionDeclaration
>
eventDefinitions
=
(
ArrayList
<
EventSubscriptionDeclaration
>)
properties
.
get
(
key
);
ArrayList
<
EventSubscriptionDeclaration
>
eventDefinitions
=
(
ArrayList
<
EventSubscriptionDeclaration
>)
properties
.
get
(
key
);
...
@@ -359,8 +367,9 @@ public class BaseProcessDefinitionDiagramLayoutResource {
...
@@ -359,8 +367,9 @@ public class BaseProcessDefinitionDiagramLayoutResource {
for
(
EventSubscriptionDeclaration
eventDefinition
:
eventDefinitions
)
{
for
(
EventSubscriptionDeclaration
eventDefinition
:
eventDefinitions
)
{
ObjectNode
eventDefinitionJSON
=
new
ObjectMapper
().
createObjectNode
();
ObjectNode
eventDefinitionJSON
=
new
ObjectMapper
().
createObjectNode
();
if
(
eventDefinition
.
getActivityId
()
!=
null
)
if
(
eventDefinition
.
getActivityId
()
!=
null
)
{
eventDefinitionJSON
.
put
(
"activityId"
,
eventDefinition
.
getActivityId
());
eventDefinitionJSON
.
put
(
"activityId"
,
eventDefinition
.
getActivityId
());
}
eventDefinitionJSON
.
put
(
"eventName"
,
eventDefinition
.
getEventName
());
eventDefinitionJSON
.
put
(
"eventName"
,
eventDefinition
.
getEventName
());
eventDefinitionJSON
.
put
(
"eventType"
,
eventDefinition
.
getEventType
());
eventDefinitionJSON
.
put
(
"eventType"
,
eventDefinition
.
getEventType
());
...
@@ -370,8 +379,9 @@ public class BaseProcessDefinitionDiagramLayoutResource {
...
@@ -370,8 +379,9 @@ public class BaseProcessDefinitionDiagramLayoutResource {
}
}
}
}
if
(
eventDefinitionsArray
.
size
()
>
0
)
if
(
eventDefinitionsArray
.
size
()
>
0
)
{
propertiesJSON
.
put
(
key
,
eventDefinitionsArray
);
propertiesJSON
.
put
(
key
,
eventDefinitionsArray
);
}
// TODO: implement it
// TODO: implement it
}
else
if
(
"errorEventDefinitions"
.
equals
(
key
))
{
}
else
if
(
"errorEventDefinitions"
.
equals
(
key
))
{
...
@@ -382,10 +392,11 @@ public class BaseProcessDefinitionDiagramLayoutResource {
...
@@ -382,10 +392,11 @@ public class BaseProcessDefinitionDiagramLayoutResource {
for
(
ErrorEventDefinition
errorEventDefinition
:
errorEventDefinitions
)
{
for
(
ErrorEventDefinition
errorEventDefinition
:
errorEventDefinitions
)
{
ObjectNode
errorEventDefinitionJSON
=
new
ObjectMapper
().
createObjectNode
();
ObjectNode
errorEventDefinitionJSON
=
new
ObjectMapper
().
createObjectNode
();
if
(
errorEventDefinition
.
getErrorCode
()
!=
null
)
if
(
errorEventDefinition
.
getErrorCode
()
!=
null
)
{
errorEventDefinitionJSON
.
put
(
"errorCode"
,
errorEventDefinition
.
getErrorCode
());
errorEventDefinitionJSON
.
put
(
"errorCode"
,
errorEventDefinition
.
getErrorCode
());
else
}
else
{
errorEventDefinitionJSON
.
putNull
(
"errorCode"
);
errorEventDefinitionJSON
.
putNull
(
"errorCode"
);
}
errorEventDefinitionJSON
.
put
(
"handlerActivityId"
,
errorEventDefinition
.
getHandlerActivityId
());
errorEventDefinitionJSON
.
put
(
"handlerActivityId"
,
errorEventDefinition
.
getHandlerActivityId
());
...
@@ -393,8 +404,9 @@ public class BaseProcessDefinitionDiagramLayoutResource {
...
@@ -393,8 +404,9 @@ public class BaseProcessDefinitionDiagramLayoutResource {
}
}
}
}
if
(
errorEventDefinitionsArray
.
size
()
>
0
)
if
(
errorEventDefinitionsArray
.
size
()
>
0
)
{
propertiesJSON
.
put
(
key
,
errorEventDefinitionsArray
);
propertiesJSON
.
put
(
key
,
errorEventDefinitionsArray
);
}
}
}
}
}
...
@@ -448,14 +460,18 @@ public class BaseProcessDefinitionDiagramLayoutResource {
...
@@ -448,14 +460,18 @@ public class BaseProcessDefinitionDiagramLayoutResource {
activityJSON
.
put
(
"activityId"
,
activity
.
getId
());
activityJSON
.
put
(
"activityId"
,
activity
.
getId
());
activityJSON
.
put
(
"properties"
,
propertiesJSON
);
activityJSON
.
put
(
"properties"
,
propertiesJSON
);
if
(
multiInstance
!=
null
)
if
(
multiInstance
!=
null
)
{
activityJSON
.
put
(
"multiInstance"
,
multiInstance
);
activityJSON
.
put
(
"multiInstance"
,
multiInstance
);
if
(
collapsed
)
}
activityJSON
.
put
(
"collapsed"
,
collapsed
);
if
(
collapsed
)
{
if
(
nestedActivityArray
.
size
()
>
0
)
activityJSON
.
put
(
"collapsed"
,
collapsed
);
activityJSON
.
put
(
"nestedActivities"
,
nestedActivityArray
);
}
if
(
isInterrupting
!=
null
)
if
(
nestedActivityArray
.
size
()
>
0
)
{
activityJSON
.
put
(
"isInterrupting"
,
isInterrupting
);
activityJSON
.
put
(
"nestedActivities"
,
nestedActivityArray
);
}
if
(
isInterrupting
!=
null
)
{
activityJSON
.
put
(
"isInterrupting"
,
isInterrupting
);
}
activityJSON
.
put
(
"x"
,
activity
.
getX
());
activityJSON
.
put
(
"x"
,
activity
.
getX
());
activityJSON
.
put
(
"y"
,
activity
.
getY
());
activityJSON
.
put
(
"y"
,
activity
.
getY
());
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/act/rest/servlet/FilterServletOutputStream.java
View file @
7fa8137a
...
@@ -15,15 +15,18 @@ public class FilterServletOutputStream extends ServletOutputStream {
...
@@ -15,15 +15,18 @@ public class FilterServletOutputStream extends ServletOutputStream {
stream
=
new
DataOutputStream
(
output
);
stream
=
new
DataOutputStream
(
output
);
}
}
public
void
write
(
int
b
)
throws
IOException
{
@Override
public
void
write
(
int
b
)
throws
IOException
{
stream
.
write
(
b
);
stream
.
write
(
b
);
}
}
public
void
write
(
byte
[]
b
)
throws
IOException
{
@Override
public
void
write
(
byte
[]
b
)
throws
IOException
{
stream
.
write
(
b
);
stream
.
write
(
b
);
}
}
public
void
write
(
byte
[]
b
,
int
off
,
int
len
)
throws
IOException
{
@Override
public
void
write
(
byte
[]
b
,
int
off
,
int
len
)
throws
IOException
{
stream
.
write
(
b
,
off
,
len
);
stream
.
write
(
b
,
off
,
len
);
}
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/modules/act/rest/servlet/GenericResponseWrapper.java
View file @
7fa8137a
...
@@ -22,15 +22,18 @@ public class GenericResponseWrapper extends HttpServletResponseWrapper {
...
@@ -22,15 +22,18 @@ public class GenericResponseWrapper extends HttpServletResponseWrapper {
return
output
.
toByteArray
();
return
output
.
toByteArray
();
}
}
public
ServletOutputStream
getOutputStream
()
{
@Override
public
ServletOutputStream
getOutputStream
()
{
return
new
FilterServletOutputStream
(
output
);
return
new
FilterServletOutputStream
(
output
);
}
}
public
PrintWriter
getWriter
()
{
@Override
public
PrintWriter
getWriter
()
{
return
new
PrintWriter
(
getOutputStream
(),
true
);
return
new
PrintWriter
(
getOutputStream
(),
true
);
}
}
public
void
setContentLength
(
int
length
)
{
@Override
public
void
setContentLength
(
int
length
)
{
this
.
contentLength
=
length
;
this
.
contentLength
=
length
;
super
.
setContentLength
(
length
);
super
.
setContentLength
(
length
);
}
}
...
@@ -39,12 +42,14 @@ public class GenericResponseWrapper extends HttpServletResponseWrapper {
...
@@ -39,12 +42,14 @@ public class GenericResponseWrapper extends HttpServletResponseWrapper {
return
contentLength
;
return
contentLength
;
}
}
public
void
setContentType
(
String
type
)
{
@Override
public
void
setContentType
(
String
type
)
{
this
.
contentType
=
type
;
this
.
contentType
=
type
;
super
.
setContentType
(
type
);
super
.
setContentType
(
type
);
}
}
public
String
getContentType
()
{
@Override
public
String
getContentType
()
{
return
contentType
;
return
contentType
;
}
}
}
}
Prev
1
2
3
4
5
6
7
…
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