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
c6c797af
Commit
c6c797af
authored
Apr 27, 2017
by
minminyan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改日志信息,打印error
parent
a6a1cbec
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
18 deletions
+13
-18
MotanUserServiceImpl.java
.../xyqb/controller/external/motan/MotanUserServiceImpl.java
+13
-18
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/motan/MotanUserServiceImpl.java
View file @
c6c797af
...
...
@@ -28,9 +28,8 @@ import com.fasterxml.jackson.core.type.TypeReference;
import
com.fasterxml.jackson.databind.DeserializationFeature
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.weibo.api.motan.config.springsupport.annotation.MotanService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -44,11 +43,9 @@ import java.util.Random;
/**
* Created by 11 on 2017/2/27.
*/
@Slf4j
@MotanService
(
export
=
"userMotan:8002"
,
registry
=
"registryConfig"
)
public
class
MotanUserServiceImpl
implements
UserMotanService
,
IBaseController
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
MotanUserServiceImpl
.
class
);
private
static
final
ObjectMapper
MAPPER
=
new
ObjectMapper
();
static
{
...
...
@@ -214,7 +211,7 @@ public class MotanUserServiceImpl implements UserMotanService, IBaseController {
try
{
userDetail
.
setGender
(
idCardService
.
getIdCardInfo
(
userDetailUpdateBean
.
getIdNo
()).
getGender
());
}
catch
(
ParseException
e
)
{
LOGGER
.
error
(
"根据身份证获取性别出错,错误信息:"
+
e
);
log
.
error
(
"根据身份证获取性别出错,userDetailUpdateBean:{}"
,
JSON
.
toJSONString
(
userDetailUpdateBean
),
e
);
return
returnValue
(
null
,
"根据身份证获取性别出错."
);
}
userDetail
.
setEmail
(
userDetailUpdateBean
.
getEmail
());
...
...
@@ -249,7 +246,7 @@ public class MotanUserServiceImpl implements UserMotanService, IBaseController {
}
String
requestIp
=
IPUtil
.
getRemoteIP
(
request
);
LOGGER
.
info
(
"第三方用户登录, loginFrom:{}, requestIp:{}"
,
appLoginParam
.
getRegisterFrom
(),
requestIp
);
log
.
info
(
"第三方用户登录, loginFrom:{}, requestIp:{}"
,
appLoginParam
.
getRegisterFrom
(),
requestIp
);
User
user
=
userService
.
findByPhoneInDb
(
appLoginParam
.
getPhoneNo
());
if
(
user
==
null
)
{
user
=
register
(
appLoginParam
.
getRegisterFrom
(),
appLoginParam
.
getPhoneNo
(),
appLoginParam
.
getIdNo
(),
appLoginParam
.
getName
());
...
...
@@ -277,7 +274,7 @@ public class MotanUserServiceImpl implements UserMotanService, IBaseController {
context
.
setAppChannel
(
appLoginParam
.
getAppChannel
());
loginInfo
.
setLoginContext
(
context
);
LOGGER
.
info
(
"第三方用户获取信息登录成功, loginFrom:{}, phoneNo:{},appChannel:{}"
,
appLoginParam
.
getRegisterFrom
(),
appLoginParam
.
getPhoneNo
(),
appLoginParam
.
getAppChannel
());
log
.
info
(
"第三方用户获取信息登录成功, loginFrom:{}, phoneNo:{},appChannel:{}"
,
appLoginParam
.
getRegisterFrom
(),
appLoginParam
.
getPhoneNo
(),
appLoginParam
.
getAppChannel
());
XLoginInfo
xLoginInfo
=
convertObject
(
JSON
.
toJSONString
(
loginInfo
),
new
TypeReference
<
XLoginInfo
>()
{
});
return
returnValue
(
xLoginInfo
,
""
);
...
...
@@ -290,7 +287,7 @@ public class MotanUserServiceImpl implements UserMotanService, IBaseController {
}
return
MAPPER
.
readValue
(
json
,
typeReference
);
}
catch
(
Exception
ex
)
{
LOGGER
.
error
(
"用户信息转换出错,错误信息{}"
,
ex
);
log
.
error
(
"用户信息转换出错,json:{}"
,
json
,
ex
);
return
null
;
}
...
...
@@ -299,7 +296,7 @@ public class MotanUserServiceImpl implements UserMotanService, IBaseController {
@Override
public
void
updateUserQQ
(
String
qq
,
Long
userId
)
{
if
(
StringUtils
.
isEmpty
(
qq
)
||
userId
==
null
||
userId
==
0L
)
{
LOGGER
.
error
(
"QQ或用户id非法,不允许修改:qq{}, userid:{}"
,
qq
,
userId
);
log
.
error
(
"QQ或用户id非法,不允许修改:qq{}, userid:{}"
,
qq
,
userId
);
return
;
}
userDetailService
.
updateUserQQ
(
userId
,
qq
);
...
...
@@ -327,8 +324,8 @@ public class MotanUserServiceImpl implements UserMotanService, IBaseController {
try
{
contactList
=
MAPPER
.
readValue
(
jsonContacts
,
new
TypeReference
<
List
<
Contact
>>()
{
});
}
catch
(
IO
Exception
e
)
{
LOGGER
.
error
(
"联系人列表转换错误:{}"
,
e
.
getMessage
()
);
}
catch
(
Exception
e
)
{
log
.
error
(
"联系人列表转换错误"
,
e
);
return
returnValue
(
null
,
"联系人转换错误"
);
}
Timestamp
now
=
new
Timestamp
(
System
.
currentTimeMillis
());
...
...
@@ -506,7 +503,7 @@ public class MotanUserServiceImpl implements UserMotanService, IBaseController {
String
uuid
=
lkbUserService
.
registerApp
(
phoneNo
,
randomCode
);
Timestamp
currentTime
=
new
Timestamp
(
System
.
currentTimeMillis
());
LOGGER
.
info
(
"第三方登录用户,保存 User"
);
log
.
info
(
"第三方登录用户,保存 User"
);
User
user
=
new
User
();
user
.
setRegisteredFrom
(
registerFrom
);
...
...
@@ -520,12 +517,10 @@ public class MotanUserServiceImpl implements UserMotanService, IBaseController {
if
(
registerFrom
!=
645L
)
{
smsService
.
sendAfterRegister
(
phoneNo
);
LOGGER
.
info
(
"第三方登录用户注册成功, registerFrom:{}, phoneNo:{}, 并且已发送短信通知"
,
registerFrom
,
phoneNo
);
log
.
info
(
"第三方登录用户注册成功, registerFrom:{}, phoneNo:{},idNo:{},name:{} 并且已发送短信通知"
,
registerFrom
,
phoneNo
,
idNo
,
name
);
}
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotEmpty
(
idNo
)
&&
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotEmpty
(
name
))
{
LOGGER
.
info
(
"第三方登录用户,保存 UserDetail"
);
if
(
StringUtils
.
isNotEmpty
(
idNo
)
&&
StringUtils
.
isNotEmpty
(
name
))
{
IdCardInfo
cardInfo
;
try
{
cardInfo
=
idCardService
.
getIdCardInfoWithExceptions
(
idNo
);
...
...
@@ -543,7 +538,7 @@ public class MotanUserServiceImpl implements UserMotanService, IBaseController {
lkbUserService
.
userUpdate
(
user
.
getUuid
(),
name
,
idNo
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"保存 UserDetail 出现异常"
,
e
);
log
.
error
(
"保存 UserDetail 出现异常"
,
e
);
}
}
...
...
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