1.优化
Showing
2 changed files
with
35 additions
and
4 deletions
| ... | @@ -1522,10 +1522,15 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1522,10 +1522,15 @@ public class UserOperationServiceImpl implements UserOperationService { |
| 1522 | String appId = resources.getAppid(); | 1522 | String appId = resources.getAppid(); |
| 1523 | String openId = resources.getOpenid(); | 1523 | String openId = resources.getOpenid(); |
| 1524 | String unionId = resources.getUnionid(); | 1524 | String unionId = resources.getUnionid(); |
| 1525 | String nickname = resources.getNickname(); | ||
| 1526 | String headimgurl = resources.getHeadimgurl(); | ||
| 1525 | 1527 | ||
| 1526 | // 检查账户是否存在 | 1528 | // 检查账户是否存在 |
| 1527 | UserWeixinDTO userWeixinDTO = this.findFirstByUnionIdAndAppIdAndOpenId(unionId,appId, openId); | 1529 | // UserWeixinDTO userWeixinDTO = this.findFirstByUnionIdAndAppIdAndOpenId(unionId,appId, openId); |
| 1528 | if (Objects.nonNull(userWeixinDTO.getId())) | 1530 | |
| 1531 | UserWeixinDTO userWeixinDTO = this.findUserWeiXinByOpenIdAndAppId(appId, openId); | ||
| 1532 | if (Objects.nonNull(userWeixinDTO.getId()) && StringUtils.isNotBlank(userWeixinDTO.getUnionid()) && | ||
| 1533 | Objects.nonNull(userWeixinDTO.getMemberId())) | ||
| 1529 | return userWeixinDTO; | 1534 | return userWeixinDTO; |
| 1530 | 1535 | ||
| 1531 | // 当前用户的任意微信app | 1536 | // 当前用户的任意微信app |
| ... | @@ -1547,6 +1552,30 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1547,6 +1552,30 @@ public class UserOperationServiceImpl implements UserOperationService { |
| 1547 | 1552 | ||
| 1548 | } | 1553 | } |
| 1549 | 1554 | ||
| 1555 | if (Objects.nonNull(userWeixinDTO.getId())) { | ||
| 1556 | String unionid = userWeixinDTO.getUnionid(); | ||
| 1557 | if (StringUtils.isBlank(unionid)) { | ||
| 1558 | userWeixinDTO.setUnionid(unionId); | ||
| 1559 | } | ||
| 1560 | String nickname_ = userWeixinDTO.getNickname(); | ||
| 1561 | if (StringUtils.isBlank(nickname_)) { | ||
| 1562 | userWeixinDTO.setNickname(nickname); | ||
| 1563 | } | ||
| 1564 | String headimgurl_ = userWeixinDTO.getHeadimgurl(); | ||
| 1565 | if (StringUtils.isBlank(headimgurl_)) { | ||
| 1566 | userWeixinDTO.setHeadimgurl(headimgurl); | ||
| 1567 | } | ||
| 1568 | |||
| 1569 | UserWeixinDTO userWeixinDTO_ = this.doCreateUserWeiXin(userWeixinDTO,memberId); | ||
| 1570 | MemberProfileDTO memberProfileDTO = this.memberProfileService.findByMemberId(memberId); | ||
| 1571 | if (Objects.isNull(memberProfileDTO)) | ||
| 1572 | // 创建会员属性信息 | ||
| 1573 | this.createMemberProfile(userWeixinDTO_); | ||
| 1574 | |||
| 1575 | return userWeixinDTO; | ||
| 1576 | |||
| 1577 | } else { | ||
| 1578 | |||
| 1550 | userWeixinDTO1.setId(null); | 1579 | userWeixinDTO1.setId(null); |
| 1551 | userWeixinDTO1.setAppid(appId); | 1580 | userWeixinDTO1.setAppid(appId); |
| 1552 | userWeixinDTO1.setOpenid(openId); | 1581 | userWeixinDTO1.setOpenid(openId); |
| ... | @@ -1563,6 +1592,8 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1563,6 +1592,8 @@ public class UserOperationServiceImpl implements UserOperationService { |
| 1563 | this.createMemberProfile(userWeixinDTO1); | 1592 | this.createMemberProfile(userWeixinDTO1); |
| 1564 | 1593 | ||
| 1565 | return userWeixinDTO1; | 1594 | return userWeixinDTO1; |
| 1595 | |||
| 1596 | } | ||
| 1566 | } | 1597 | } |
| 1567 | 1598 | ||
| 1568 | @Override | 1599 | @Override | ... | ... |
| ... | @@ -2,9 +2,9 @@ | ... | @@ -2,9 +2,9 @@ |
| 2 | spring: | 2 | spring: |
| 3 | datasource: | 3 | datasource: |
| 4 | # 测试/演示库url: | 4 | # 测试/演示库url: |
| 5 | url: jdbc:log4jdbc:mysql://139.196.192.242:3306/tj_user_0819?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false | 5 | url: jdbc:log4jdbc:mysql://139.196.145.150:3306/ucs_test?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false |
| 6 | username: root | 6 | username: root |
| 7 | password: Tjlh@2017 | 7 | password: Tjlh@2021 |
| 8 | 8 | ||
| 9 | driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy | 9 | driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy |
| 10 | #Druid | 10 | #Druid | ... | ... |
-
Please register or sign in to post a comment