Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
445b5c8a
authored
Nov 07, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:子女端登陆问题
parent
f2b7157e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
23 deletions
server-service/src/main/java/com/makeit/service/wechat/impl/PlatElderChildrenInfoUserLoginWechatServiceImpl.java
server-service/src/main/java/com/makeit/service/wechat/impl/PlatElderChildrenInfoUserLoginWechatServiceImpl.java
View file @
445b5c8a
...
@@ -18,6 +18,7 @@ import com.makeit.utils.third.wechat.WxUserInfo;
...
@@ -18,6 +18,7 @@ import com.makeit.utils.third.wechat.WxUserInfo;
import
com.makeit.utils.third.wechat.WechatUtil
;
import
com.makeit.utils.third.wechat.WechatUtil
;
import
com.makeit.utils.user.TokenUtil
;
import
com.makeit.utils.user.TokenUtil
;
import
com.makeit.utils.user.wechat.WechatUserInfo
;
import
com.makeit.utils.user.wechat.WechatUserInfo
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -25,6 +26,7 @@ import org.springframework.stereotype.Service;
...
@@ -25,6 +26,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
@Service
@Service
public
class
PlatElderChildrenInfoUserLoginWechatServiceImpl
implements
PlatElderChildrenInfoUserLoginWechatService
{
public
class
PlatElderChildrenInfoUserLoginWechatServiceImpl
implements
PlatElderChildrenInfoUserLoginWechatService
{
...
@@ -45,46 +47,41 @@ public class PlatElderChildrenInfoUserLoginWechatServiceImpl implements PlatElde
...
@@ -45,46 +47,41 @@ public class PlatElderChildrenInfoUserLoginWechatServiceImpl implements PlatElde
logger
.
info
(
"userinfo:{}"
,
userInfo
);
logger
.
info
(
"userinfo:{}"
,
userInfo
);
PlatElderChildrenInfo
childrenInfo
=
platElderChildrenInfoService
.
getOne
(
new
QueryWrapper
<
PlatElderChildrenInfo
>().
lambda
()
List
<
PlatElderChildrenInfo
>
childrenInfoList
=
platElderChildrenInfoService
.
list
(
new
QueryWrapper
<
PlatElderChildrenInfo
>().
lambda
()
.
eq
(
PlatElderChildrenInfo:
:
getOpenid
,
userInfo
.
getOpenId
()));
.
eq
(
PlatElderChildrenInfo:
:
getOpenid
,
userInfo
.
getOpenId
()));
//.eq(PlatElderChildrenInfo::getPhone, userInfo.getPhoneNumber()));
PlatElderChildrenInfo
childrenInfo
;
if
(
CollectionUtils
.
isEmpty
(
childrenInfoList
))
{
if
(
childrenInfo
==
null
)
{
childrenInfo
=
new
PlatElderChildrenInfo
();
childrenInfo
=
new
PlatElderChildrenInfo
();
childrenInfo
.
setOpenid
(
userInfo
.
getOpenId
());
childrenInfo
.
setOpenid
(
userInfo
.
getOpenId
());
childrenInfo
.
setName
(
userInfo
.
getNickName
());
childrenInfo
.
setName
(
userInfo
.
getNickName
());
/* PlatOrgSplitDTO vo = platOrgService.getOrgSplitVO(dto.getOrgId());
childrenInfo.setOrgId(dto.getOrgId());
childrenInfo.setCityOrgId(vo.getCityOrgId());
childrenInfo.setDistrictOrgId(vo.getDistrictOrgId());
childrenInfo.setStreetOrgId(vo.getStreetOrgId());
childrenInfo.setOrgPath(vo.getOrgPath());*/
childrenInfo
.
setCreateBy
(
userInfo
.
getNickName
());
childrenInfo
.
setCreateBy
(
userInfo
.
getNickName
());
childrenInfo
.
setUpdateBy
(
userInfo
.
getNickName
());
childrenInfo
.
setUpdateBy
(
userInfo
.
getNickName
());
logger
.
info
(
"children:{}"
,
childrenInfo
);
}
//childrenInfo.setOpenid(userInfo.getOpenId());
childrenInfo
.
setPhone
(
userInfo
.
getPhoneNumber
());
childrenInfo
.
setPhone
(
userInfo
.
getPhoneNumber
());
childrenInfo
.
setAvatar
(
userInfo
.
getAvatarUrl
());
childrenInfo
.
setAvatar
(
userInfo
.
getAvatarUrl
());
logger
.
info
(
"children:{}"
,
childrenInfo
);
String
token
=
IdGen
.
getUUID
();
NoFillUtil
.
executeCreate
(()
->
{
platElderChildrenInfoService
.
save
(
childrenInfo
);
});
}
else
{
for
(
PlatElderChildrenInfo
platElderChildrenInfo
:
childrenInfoList
)
{
platElderChildrenInfo
.
setPhone
(
userInfo
.
getPhoneNumber
());
platElderChildrenInfo
.
setAvatar
(
userInfo
.
getAvatarUrl
());
//RequestUtil.setHeader(HeaderConst.WECHAT_TOKEN, token);
//RequestUtil.setHeader(HeaderConst.WECHAT_TOKEN, token);
childrenInfo
.
setUpdateBy
(
userInfo
.
getNickName
());
platElderChildrenInfo
.
setUpdateBy
(
userInfo
.
getNickName
());
PlatElderChildrenInfo
finalChildrenInfo
=
childrenInfo
;
NoFillUtil
.
executeCreate
(()
->
{
NoFillUtil
.
executeCreate
(()
->
{
NoFillUtil
.
executeUpdate
(()
->
{
NoFillUtil
.
executeUpdate
(()
->
{
platElderChildrenInfoService
.
saveOrUpdate
(
final
ChildrenInfo
);
platElderChildrenInfoService
.
saveOrUpdate
(
platElder
ChildrenInfo
);
});
});
});
});
}
childrenInfo
=
childrenInfoList
.
get
(
0
);
}
//childrenInfo.setOpenid(userInfo.getOpenId());
WechatUserInfo
wechatUserVo
=
BeanDtoVoUtils
.
convert
(
childrenInfo
,
WechatUserInfo
.
class
);
WechatUserInfo
wechatUserVo
=
BeanDtoVoUtils
.
convert
(
childrenInfo
,
WechatUserInfo
.
class
);
...
@@ -92,6 +89,8 @@ public class PlatElderChildrenInfoUserLoginWechatServiceImpl implements PlatElde
...
@@ -92,6 +89,8 @@ public class PlatElderChildrenInfoUserLoginWechatServiceImpl implements PlatElde
u
.
setAvatarPath
(
f
.
getFullUrl
());
u
.
setAvatarPath
(
f
.
getFullUrl
());
});
});
String
token
=
IdGen
.
getUUID
();
wechatUserVo
.
setToken
(
token
);
wechatUserVo
.
setToken
(
token
);
TokenUtil
.
wechatLogin
(
token
,
wechatUserVo
);
TokenUtil
.
wechatLogin
(
token
,
wechatUserVo
);
...
...
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