1.同步master
Showing
4 changed files
with
36 additions
and
8 deletions
| 1 | package com.topdraw.business.module.user.weixin.subscribe.domain; | 1 | package com.topdraw.business.module.user.weixin.subscribe.domain; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | ||
| 4 | import cn.hutool.core.bean.copier.CopyOptions; | ||
| 5 | import lombok.Data; | 3 | import lombok.Data; |
| 6 | import lombok.experimental.Accessors; | 4 | import lombok.experimental.Accessors; |
| 5 | import cn.hutool.core.bean.BeanUtil; | ||
| 6 | import cn.hutool.core.bean.copier.CopyOptions; | ||
| 7 | import javax.persistence.*; | ||
| 7 | import org.springframework.data.annotation.CreatedDate; | 8 | import org.springframework.data.annotation.CreatedDate; |
| 8 | import org.springframework.data.annotation.LastModifiedDate; | 9 | import org.springframework.data.annotation.LastModifiedDate; |
| 9 | import org.springframework.data.jpa.domain.support.AuditingEntityListener; | 10 | import org.springframework.data.jpa.domain.support.AuditingEntityListener; |
| 11 | import java.sql.Timestamp; | ||
| 12 | import java.util.UUID; | ||
| 10 | 13 | ||
| 11 | import javax.persistence.*; | ||
| 12 | import java.io.Serializable; | 14 | import java.io.Serializable; |
| 13 | import java.sql.Timestamp; | ||
| 14 | 15 | ||
| 15 | /** | 16 | /** |
| 16 | * @author XiangHan | 17 | * @author XiangHan | ... | ... |
| ... | @@ -360,6 +360,12 @@ public class UserOperationController { | ... | @@ -360,6 +360,12 @@ public class UserOperationController { |
| 360 | // 大屏账户 | 360 | // 大屏账户 |
| 361 | String platformAccount = iptvUserInfo.getString("platformAccount"); | 361 | String platformAccount = iptvUserInfo.getString("platformAccount"); |
| 362 | 362 | ||
| 363 | if (StringUtils.isBlank(platformAccount)) { | ||
| 364 | log.warn("绑定失败,platformAccount is null "); | ||
| 365 | return ResultInfo.failure("绑定失败"); | ||
| 366 | } | ||
| 367 | |||
| 368 | |||
| 363 | try { | 369 | try { |
| 364 | String headimgurl = iptvUserInfo.get("headimgurl").toString(); | 370 | String headimgurl = iptvUserInfo.get("headimgurl").toString(); |
| 365 | 371 | ... | ... |
| ... | @@ -470,18 +470,29 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -470,18 +470,29 @@ public class UserOperationServiceImpl implements UserOperationService { |
| 470 | 470 | ||
| 471 | // 修改会员信息 | 471 | // 修改会员信息 |
| 472 | MemberDTO _memberDTO1 = this.doUpdateMemberByMemberDTO(memberDTO); | 472 | MemberDTO _memberDTO1 = this.doUpdateMemberByMemberDTO(memberDTO); |
| 473 | log.info("发送关注消息至大屏侧,发送的账号信息 ==>> {} || 会员信息 ==>> {}", _userWeixinDTO , _memberDTO1); | ||
| 473 | // 同步至iptv | 474 | // 同步至iptv |
| 474 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncSubscribe(new MemberAndWeixinUserDTO(_memberDTO1, _userWeixinDTO)); | 475 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncSubscribe(new MemberAndWeixinUserDTO(_memberDTO1, _userWeixinDTO)); |
| 475 | 476 | ||
| 477 | |||
| 476 | // 大屏信息 | 478 | // 大屏信息 |
| 477 | JSONObject iptvUserInfo = resources.getIptvUserInfo(); | 479 | JSONObject iptvUserInfo = resources.getIptvUserInfo(); |
| 478 | if (Objects.nonNull(iptvUserInfo)) { | 480 | log.info("存储的大小屏账号信息 iptvUserInfo ==>> {}" , iptvUserInfo); |
| 479 | 481 | ||
| 482 | if (Objects.nonNull(iptvUserInfo)) { | ||
| 480 | // 大屏账户 | 483 | // 大屏账户 |
| 481 | String platformAccount = iptvUserInfo.getString("platformAccount"); | 484 | String platformAccount = iptvUserInfo.getString("platformAccount"); |
| 485 | log.info("存储的大屏账号信息 platformAccount ==>> {}" , platformAccount); | ||
| 486 | log.info("绑定开始"); | ||
| 487 | |||
| 488 | if (StringUtils.isBlank(platformAccount)) { | ||
| 489 | log.warn("绑定失败,platformAccount is null "); | ||
| 490 | return false; | ||
| 491 | } | ||
| 492 | |||
| 482 | // 绑定 | 493 | // 绑定 |
| 483 | this.bind(memberDTO, platformAccount); | 494 | this.bind(memberDTO, platformAccount); |
| 484 | 495 | log.info("绑定结束"); | |
| 485 | } | 496 | } |
| 486 | 497 | ||
| 487 | // 保存关注记录 | 498 | // 保存关注记录 |
| ... | @@ -557,6 +568,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -557,6 +568,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
| 557 | // 会员 | 568 | // 会员 |
| 558 | MemberDTO memberDTO = this.findMemberByUserWeixinDTO(userWeixinDTO); | 569 | MemberDTO memberDTO = this.findMemberByUserWeixinDTO(userWeixinDTO); |
| 559 | 570 | ||
| 571 | memberDTO.setUserIptvId(null); | ||
| 560 | // 修改会员vip,如果没有购买会员则取消团粉 | 572 | // 修改会员vip,如果没有购买会员则取消团粉 |
| 561 | MemberDTO _memberDTO = this.doUpdateMemberVip(memberDTO, 0); | 573 | MemberDTO _memberDTO = this.doUpdateMemberVip(memberDTO, 0); |
| 562 | 574 | ||
| ... | @@ -1015,6 +1027,10 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1015,6 +1027,10 @@ public class UserOperationServiceImpl implements UserOperationService { |
| 1015 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) | 1027 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) |
| 1016 | public void bind(MemberDTO memberDTO, UserTvDTO userTvDTO) { | 1028 | public void bind(MemberDTO memberDTO, UserTvDTO userTvDTO) { |
| 1017 | String platformAccount = userTvDTO.getPlatformAccount(); | 1029 | String platformAccount = userTvDTO.getPlatformAccount(); |
| 1030 | |||
| 1031 | if (StringUtils.isBlank(platformAccount)) { | ||
| 1032 | return; | ||
| 1033 | } | ||
| 1018 | // 绑定 | 1034 | // 绑定 |
| 1019 | this.bind(memberDTO,platformAccount); | 1035 | this.bind(memberDTO,platformAccount); |
| 1020 | } | 1036 | } |
| ... | @@ -1027,8 +1043,9 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1027,8 +1043,9 @@ public class UserOperationServiceImpl implements UserOperationService { |
| 1027 | */ | 1043 | */ |
| 1028 | @Override | 1044 | @Override |
| 1029 | public UserTvDTO bind(MemberDTO memberDTO, String platformAccount) { | 1045 | public UserTvDTO bind(MemberDTO memberDTO, String platformAccount) { |
| 1030 | 1046 | log.info("bind start"); | |
| 1031 | MemberDTO memberDTO1 = this.memberService.findByCode(memberDTO.getCode()); | 1047 | MemberDTO memberDTO1 = this.memberService.findByCode(memberDTO.getCode()); |
| 1048 | log.info("查询会员信息 ==>> {}", memberDTO1); | ||
| 1032 | if (Objects.nonNull(memberDTO1.getUserIptvId())) { | 1049 | if (Objects.nonNull(memberDTO1.getUserIptvId())) { |
| 1033 | UserTvDTO userTvDTO = this.userTvService.findById(memberDTO1.getUserIptvId()); | 1050 | UserTvDTO userTvDTO = this.userTvService.findById(memberDTO1.getUserIptvId()); |
| 1034 | return userTvDTO; | 1051 | return userTvDTO; |
| ... | @@ -1036,6 +1053,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1036,6 +1053,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
| 1036 | 1053 | ||
| 1037 | // 大屏账户 | 1054 | // 大屏账户 |
| 1038 | UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); | 1055 | UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); |
| 1056 | log.info("查询大屏账号信息 ==>> {}", userTvDTO); | ||
| 1039 | if (Objects.isNull(userTvDTO)) { | 1057 | if (Objects.isNull(userTvDTO)) { |
| 1040 | throw new BadRequestException(GlobeExceptionMsg.IPTV_IS_NULL); | 1058 | throw new BadRequestException(GlobeExceptionMsg.IPTV_IS_NULL); |
| 1041 | } | 1059 | } |
| ... | @@ -1072,6 +1090,10 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1072,6 +1090,10 @@ public class UserOperationServiceImpl implements UserOperationService { |
| 1072 | // 修改会员 | 1090 | // 修改会员 |
| 1073 | MemberDTO _memberDTO = this.doUpdateMemberByMemberDTO(memberDTO); | 1091 | MemberDTO _memberDTO = this.doUpdateMemberByMemberDTO(memberDTO); |
| 1074 | 1092 | ||
| 1093 | _memberDTO.setPlatformAccount(platformAccount); | ||
| 1094 | |||
| 1095 | |||
| 1096 | log.info("发送到大屏侧的消息对象 会员信息 ==>> {} || 账号信息 ==>> {}", _memberDTO , _userTvDTO); | ||
| 1075 | // 同步至iptv | 1097 | // 同步至iptv |
| 1076 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncAppletBind(new MemberAndUserTvDTO(_memberDTO, _userTvDTO)); | 1098 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncAppletBind(new MemberAndUserTvDTO(_memberDTO, _userTvDTO)); |
| 1077 | 1099 | ... | ... |
-
Please register or sign in to post a comment