Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
head_group
xyqb-user2
Commits
bf3f0bb0
Commit
bf3f0bb0
authored
May 23, 2018
by
xiaoguang.xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
del: 删除一些enum set
parent
99044458
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
48 additions
and
97 deletions
+48
-97
EducationEnum.java
src/main/java/cn/quantgroup/user/enums/EducationEnum.java
+0
-4
Gender.java
src/main/java/cn/quantgroup/user/enums/Gender.java
+0
-4
IdType.java
src/main/java/cn/quantgroup/user/enums/IdType.java
+0
-4
MaritalStatus.java
src/main/java/cn/quantgroup/user/enums/MaritalStatus.java
+3
-8
OccupationEnum.java
src/main/java/cn/quantgroup/user/enums/OccupationEnum.java
+0
-4
Relation.java
src/main/java/cn/quantgroup/user/enums/Relation.java
+3
-8
Bootstrap.java
src/main/java/cn/quantgroup/xyqb/Bootstrap.java
+3
-6
UserQueryLogController.java
.../controller/external/queryLog/UserQueryLogController.java
+2
-2
SmsController.java
...uantgroup/xyqb/controller/internal/sms/SmsController.java
+1
-1
MaritalStatus.java
...va/cn/quantgroup/xyqb/entity/enumerate/MaritalStatus.java
+3
-4
OccupationEnum.java
...a/cn/quantgroup/xyqb/entity/enumerate/OccupationEnum.java
+0
-4
Relation.java
...in/java/cn/quantgroup/xyqb/entity/enumerate/Relation.java
+3
-8
GeetestLib.java
...n/java/cn/quantgroup/xyqb/service/captcha/GeetestLib.java
+2
-2
HttpServiceImpl.java
...cn/quantgroup/xyqb/service/http/impl/HttpServiceImpl.java
+2
-4
UserDetailServiceImpl.java
...ntgroup/xyqb/service/user/impl/UserDetailServiceImpl.java
+25
-31
ValidationUtil.java
src/main/java/cn/quantgroup/xyqb/util/ValidationUtil.java
+1
-3
No files found.
src/main/java/cn/quantgroup/user/enums/EducationEnum.java
View file @
bf3f0bb0
...
...
@@ -21,10 +21,6 @@ public enum EducationEnum {
this
.
name
=
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getName
()
{
return
name
;
}
...
...
src/main/java/cn/quantgroup/user/enums/Gender.java
View file @
bf3f0bb0
...
...
@@ -14,10 +14,6 @@ public enum Gender {
this
.
name
=
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getName
()
{
return
name
;
}
...
...
src/main/java/cn/quantgroup/user/enums/IdType.java
View file @
bf3f0bb0
...
...
@@ -22,10 +22,6 @@ public enum IdType {
this
.
name
=
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getName
()
{
return
name
;
}
...
...
src/main/java/cn/quantgroup/user/enums/MaritalStatus.java
View file @
bf3f0bb0
...
...
@@ -23,15 +23,10 @@ public enum MaritalStatus {
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
@Override
public
String
toString
()
{
final
StringBuilder
sb
=
new
StringBuilder
(
"MaritalStatus{"
);
sb
.
append
(
"description='"
).
append
(
description
).
append
(
'\''
);
sb
.
append
(
'}'
);
return
sb
.
toString
();
String
sb
=
"MaritalStatus{"
+
"description='"
+
description
+
'\''
+
'}'
;
return
sb
;
}
}
src/main/java/cn/quantgroup/user/enums/OccupationEnum.java
View file @
bf3f0bb0
...
...
@@ -23,10 +23,6 @@ public enum OccupationEnum {
this
.
name
=
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getName
()
{
return
name
;
}
...
...
src/main/java/cn/quantgroup/user/enums/Relation.java
View file @
bf3f0bb0
...
...
@@ -25,15 +25,10 @@ public enum Relation {
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
@Override
public
String
toString
()
{
final
StringBuilder
sb
=
new
StringBuilder
(
"Relation{"
);
sb
.
append
(
"description='"
).
append
(
description
).
append
(
'\''
);
sb
.
append
(
'}'
);
return
sb
.
toString
();
String
sb
=
"Relation{"
+
"description='"
+
description
+
'\''
+
'}'
;
return
sb
;
}
}
src/main/java/cn/quantgroup/xyqb/Bootstrap.java
View file @
bf3f0bb0
...
...
@@ -28,12 +28,9 @@ public class Bootstrap {
public
static
void
main
(
String
[]
args
)
{
SpringApplication
springApplication
=
new
SpringApplication
(
Bootstrap
.
class
);
springApplication
.
addListeners
(
new
ApplicationListener
<
ContextRefreshedEvent
>()
{
@Override
public
void
onApplicationEvent
(
ContextRefreshedEvent
event
)
{
MotanSwitcherUtil
.
setSwitcherValue
(
MotanConstants
.
REGISTRY_HEARTBEAT_SWITCHER
,
true
);
log
.
info
(
"注册zookeeper成功"
);
}
springApplication
.
addListeners
((
ApplicationListener
<
ContextRefreshedEvent
>)
event
->
{
MotanSwitcherUtil
.
setSwitcherValue
(
MotanConstants
.
REGISTRY_HEARTBEAT_SWITCHER
,
true
);
log
.
info
(
"注册zookeeper成功"
);
});
springApplication
.
run
(
args
);
}
...
...
src/main/java/cn/quantgroup/xyqb/controller/external/queryLog/UserQueryLogController.java
View file @
bf3f0bb0
...
...
@@ -471,7 +471,7 @@ public class UserQueryLogController {
// 第二步,在webbook中添加一个sheet,对应Excel文件中的sheet
HSSFSheet
sheet
=
wb
.
createSheet
(
"用户信息列表"
);
// 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制short
HSSFRow
row
=
sheet
.
createRow
(
(
int
)
0
);
HSSFRow
row
=
sheet
.
createRow
(
0
);
// 第四步,创建单元格,并设置值表头 设置表头居中
HSSFCellStyle
style
=
wb
.
createCellStyle
();
style
.
setAlignment
(
HSSFCellStyle
.
ALIGN_CENTER
);
// 创建一个居中格式
...
...
@@ -499,7 +499,7 @@ public class UserQueryLogController {
//List list = CreateSimpleExcelToDisk.getStudent();
for
(
int
i
=
0
;
i
<
uqls
.
size
();
i
++)
{
row
=
sheet
.
createRow
(
(
int
)
i
+
1
);
row
=
sheet
.
createRow
(
i
+
1
);
UserQueryInfo
user
=
uqls
.
get
(
i
);
// 第四步,创建单元格,并设置值
if
(
user
!=
null
&&
row
!=
null
)
{
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/sms/SmsController.java
View file @
bf3f0bb0
...
...
@@ -213,7 +213,7 @@ public class SmsController implements IBaseController {
private
JsonResult
sendVerificationCode2Voice
(
String
phoneNo
,
String
usage
)
{
String
verificationCountKey
=
Constants
.
REDIS_VOICE_CODE_COUNT
+
phoneNo
;
Long
getVerificationCount
=
redisTemplate
.
opsForHash
().
increment
(
verificationCountKey
,
usage
.
toString
()
,
1
);
Long
getVerificationCount
=
redisTemplate
.
opsForHash
().
increment
(
verificationCountKey
,
usage
,
1
);
redisTemplate
.
expire
(
verificationCountKey
,
DateUtils
.
getSeconds
(),
TimeUnit
.
SECONDS
);
if
(
getVerificationCount
>
5
)
{
return
JsonResult
.
buildErrorStateResult
(
"今天已获取5次语音验证码,请使用短信验证码或明天再试"
,
null
);
...
...
src/main/java/cn/quantgroup/xyqb/entity/enumerate/MaritalStatus.java
View file @
bf3f0bb0
...
...
@@ -29,9 +29,8 @@ public enum MaritalStatus {
@Override
public
String
toString
()
{
final
StringBuilder
sb
=
new
StringBuilder
(
"MaritalStatus{"
);
sb
.
append
(
"description='"
).
append
(
description
).
append
(
'\''
);
sb
.
append
(
'}'
);
return
sb
.
toString
();
String
sb
=
"MaritalStatus{"
+
"description='"
+
description
+
'\''
+
'}'
;
return
sb
;
}
}
src/main/java/cn/quantgroup/xyqb/entity/enumerate/OccupationEnum.java
View file @
bf3f0bb0
...
...
@@ -27,10 +27,6 @@ public enum OccupationEnum {
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
@Override
public
String
toString
()
{
return
name
;
...
...
src/main/java/cn/quantgroup/xyqb/entity/enumerate/Relation.java
View file @
bf3f0bb0
...
...
@@ -25,15 +25,10 @@ public enum Relation {
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
@Override
public
String
toString
()
{
final
StringBuilder
sb
=
new
StringBuilder
(
"Relation{"
);
sb
.
append
(
"description='"
).
append
(
description
).
append
(
'\''
);
sb
.
append
(
'}'
);
return
sb
.
toString
();
String
sb
=
"Relation{"
+
"description='"
+
description
+
'\''
+
'}'
;
return
sb
;
}
}
src/main/java/cn/quantgroup/xyqb/service/captcha/GeetestLib.java
View file @
bf3f0bb0
...
...
@@ -429,13 +429,13 @@ public class GeetestLib {
* @time 2014年7月10日 下午3:30:01
*/
private
String
md5Encode
(
String
plainText
)
{
String
re_md5
=
new
String
()
;
String
re_md5
=
""
;
try
{
MessageDigest
md
=
MessageDigest
.
getInstance
(
"MD5"
);
md
.
update
(
plainText
.
getBytes
());
byte
b
[]
=
md
.
digest
();
int
i
;
StringBuilder
buf
=
new
StringBuilder
(
""
);
StringBuilder
buf
=
new
StringBuilder
();
for
(
int
offset
=
0
;
offset
<
b
.
length
;
offset
++)
{
i
=
b
[
offset
];
if
(
i
<
0
)
{
...
...
src/main/java/cn/quantgroup/xyqb/service/http/impl/HttpServiceImpl.java
View file @
bf3f0bb0
...
...
@@ -3,7 +3,6 @@ package cn.quantgroup.xyqb.service.http.impl;
import
cn.quantgroup.tech.brave.service.ITechHttpClient
;
import
cn.quantgroup.xyqb.service.http.IHttpService
;
import
cn.quantgroup.xyqb.util.Utils
;
import
com.google.common.base.Predicates
;
import
com.google.common.collect.Maps
;
import
org.apache.commons.codec.Charsets
;
import
org.apache.commons.collections.MapUtils
;
...
...
@@ -29,7 +28,6 @@ import org.apache.http.conn.ssl.SSLContextBuilder;
import
org.apache.http.cookie.Cookie
;
import
org.apache.http.cookie.CookieOrigin
;
import
org.apache.http.cookie.CookieSpecProvider
;
import
org.apache.http.cookie.MalformedCookieException
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.DefaultConnectionKeepAliveStrategy
;
import
org.apache.http.impl.client.StandardHttpRequestRetryHandler
;
...
...
@@ -211,7 +209,7 @@ public class HttpServiceImpl implements IHttpService {
*/
private
void
setParameter
(
RequestBuilder
requestBuilder
,
Map
<
String
,
String
>
parameters
,
String
method
)
{
if
(
MapUtils
.
isNotEmpty
(
parameters
))
{
parameters
=
Maps
.
filterValues
(
parameters
,
Predicates
.
notNull
()
);
parameters
=
Maps
.
filterValues
(
parameters
,
s
->
s
!=
null
);
Set
<
Map
.
Entry
<
String
,
String
>>
entrys
=
parameters
.
entrySet
();
/************** Get 请求 **************/
...
...
@@ -244,7 +242,7 @@ public class HttpServiceImpl implements IHttpService {
.
setHeader
(
"Connection"
,
"keep-alive"
);
if
(
MapUtils
.
isNotEmpty
(
headers
))
{
headers
=
Maps
.
filterValues
(
headers
,
Predicates
.
notNull
()
);
headers
=
Maps
.
filterValues
(
headers
,
s
->
s
!=
null
);
Set
<
Map
.
Entry
<
String
,
String
>>
entrys
=
headers
.
entrySet
();
for
(
Map
.
Entry
<
String
,
String
>
entry
:
entrys
)
{
...
...
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserDetailServiceImpl.java
View file @
bf3f0bb0
...
...
@@ -118,21 +118,18 @@ public class UserDetailServiceImpl implements IUserDetailService {
private
Specification
<
UserDetail
>
getSpecification
(
String
name
,
String
phoneNo
,
String
idNo
)
{
List
<
Predicate
>
list
=
new
ArrayList
<>();
Specification
<
UserDetail
>
specification
=
new
Specification
<
UserDetail
>()
{
@Override
public
Predicate
toPredicate
(
Root
<
UserDetail
>
root
,
CriteriaQuery
<?>
criteriaQuery
,
CriteriaBuilder
criteriaBuilder
)
{
if
(!
StringUtils
.
isEmpty
(
name
))
{
list
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
"name"
).
as
(
String
.
class
),
name
));
}
if
(!
StringUtils
.
isEmpty
(
phoneNo
))
{
list
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
Constants
.
PHONE_NO
).
as
(
String
.
class
),
phoneNo
));
}
if
(!
StringUtils
.
isEmpty
(
idNo
))
{
list
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
"idNo"
).
as
(
String
.
class
),
idNo
));
}
Predicate
[]
p
=
new
Predicate
[
list
.
size
()];
return
criteriaBuilder
.
and
(
list
.
toArray
(
p
));
Specification
<
UserDetail
>
specification
=
(
root
,
criteriaQuery
,
criteriaBuilder
)
->
{
if
(!
StringUtils
.
isEmpty
(
name
))
{
list
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
"name"
).
as
(
String
.
class
),
name
));
}
if
(!
StringUtils
.
isEmpty
(
phoneNo
))
{
list
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
Constants
.
PHONE_NO
).
as
(
String
.
class
),
phoneNo
));
}
if
(!
StringUtils
.
isEmpty
(
idNo
))
{
list
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
"idNo"
).
as
(
String
.
class
),
idNo
));
}
Predicate
[]
p
=
new
Predicate
[
list
.
size
()];
return
criteriaBuilder
.
and
(
list
.
toArray
(
p
));
};
return
specification
;
}
...
...
@@ -148,24 +145,21 @@ public class UserDetailServiceImpl implements IUserDetailService {
private
Specification
<
UserDetail
>
valueInSpecification
(
List
<
Long
>
userId
,
List
<
String
>
phoneNo
,
List
<
String
>
idNo
)
{
List
<
Predicate
>
list
=
new
ArrayList
<>();
Specification
<
UserDetail
>
specification
=
new
Specification
<
UserDetail
>()
{
@Override
public
Predicate
toPredicate
(
Root
<
UserDetail
>
root
,
CriteriaQuery
<?>
criteriaQuery
,
CriteriaBuilder
criteriaBuilder
)
{
if
(
userId
!=
null
&&
userId
.
size
()
>
0
)
{
criteriaQuery
.
where
(
root
.
get
(
"userId"
).
in
(
userId
));
list
.
add
(
criteriaQuery
.
getRestriction
());
}
if
(
phoneNo
!=
null
&&
phoneNo
.
size
()
>
0
)
{
criteriaQuery
.
where
(
root
.
get
(
Constants
.
PHONE_NO
).
in
(
phoneNo
));
list
.
add
(
criteriaQuery
.
getRestriction
());
}
if
(
idNo
!=
null
&&
idNo
.
size
()
>
0
)
{
criteriaQuery
.
where
(
root
.
get
(
"idNo"
).
in
(
idNo
));
list
.
add
(
criteriaQuery
.
getRestriction
());
}
Predicate
[]
p
=
new
Predicate
[
list
.
size
()];
return
criteriaBuilder
.
and
(
list
.
toArray
(
p
));
Specification
<
UserDetail
>
specification
=
(
root
,
criteriaQuery
,
criteriaBuilder
)
->
{
if
(
userId
!=
null
&&
userId
.
size
()
>
0
)
{
criteriaQuery
.
where
(
root
.
get
(
"userId"
).
in
(
userId
));
list
.
add
(
criteriaQuery
.
getRestriction
());
}
if
(
phoneNo
!=
null
&&
phoneNo
.
size
()
>
0
)
{
criteriaQuery
.
where
(
root
.
get
(
Constants
.
PHONE_NO
).
in
(
phoneNo
));
list
.
add
(
criteriaQuery
.
getRestriction
());
}
if
(
idNo
!=
null
&&
idNo
.
size
()
>
0
)
{
criteriaQuery
.
where
(
root
.
get
(
"idNo"
).
in
(
idNo
));
list
.
add
(
criteriaQuery
.
getRestriction
());
}
Predicate
[]
p
=
new
Predicate
[
list
.
size
()];
return
criteriaBuilder
.
and
(
list
.
toArray
(
p
));
};
return
specification
;
}
...
...
src/main/java/cn/quantgroup/xyqb/util/ValidationUtil.java
View file @
bf3f0bb0
...
...
@@ -133,9 +133,7 @@ public class ValidationUtil {
public
static
String
getMd5Key
(
boolean
lock
)
{
Calendar
today
=
Calendar
.
getInstance
();
int
hour_24
=
today
.
get
(
Calendar
.
HOUR_OF_DAY
);
StringBuilder
_key
=
new
StringBuilder
();
_key
.
append
(
Constants
.
CLEAR_LOCK_FOR_IPV4_KEY
).
append
(
lock
).
append
(
hour_24
);
return
MD5Util
.
build
(
_key
.
toString
());
return
MD5Util
.
build
(
Constants
.
CLEAR_LOCK_FOR_IPV4_KEY
+
lock
+
hour_24
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment