Commit a2e2b42f a2e2b42fd577cb1d9bb870d1136b9fe63f67f339 by xianghan

1.为关注、绑定功能添加必要的参数校验和日志输出

1 parent 77aaa301
...@@ -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
......
...@@ -472,18 +472,29 @@ public class UserOperationServiceImpl implements UserOperationService { ...@@ -472,18 +472,29 @@ public class UserOperationServiceImpl implements UserOperationService {
472 472
473 // 修改会员信息 473 // 修改会员信息
474 MemberDTO _memberDTO1 = this.doUpdateMemberByMemberDTO(memberDTO); 474 MemberDTO _memberDTO1 = this.doUpdateMemberByMemberDTO(memberDTO);
475 log.info("发送关注消息至大屏侧,发送的账号信息 ==>> {} || 会员信息 ==>> {}", _userWeixinDTO , _memberDTO1);
475 // 同步至iptv 476 // 同步至iptv
476 ((UserOperationServiceImpl)AopContext.currentProxy()).asyncSubscribe(new MemberAndWeixinUserDTO(_memberDTO1, _userWeixinDTO)); 477 ((UserOperationServiceImpl)AopContext.currentProxy()).asyncSubscribe(new MemberAndWeixinUserDTO(_memberDTO1, _userWeixinDTO));
477 478
479
478 // 大屏信息 480 // 大屏信息
479 JSONObject iptvUserInfo = resources.getIptvUserInfo(); 481 JSONObject iptvUserInfo = resources.getIptvUserInfo();
480 if (Objects.nonNull(iptvUserInfo)) { 482 log.info("存储的大小屏账号信息 iptvUserInfo ==>> {}" , iptvUserInfo);
481 483
484 if (Objects.nonNull(iptvUserInfo)) {
482 // 大屏账户 485 // 大屏账户
483 String platformAccount = iptvUserInfo.getString("platformAccount"); 486 String platformAccount = iptvUserInfo.getString("platformAccount");
487 log.info("存储的大屏账号信息 platformAccount ==>> {}" , platformAccount);
488 log.info("绑定开始");
489
490 if (StringUtils.isBlank(platformAccount)) {
491 log.warn("绑定失败,platformAccount is null ");
492 return false;
493 }
494
484 // 绑定 495 // 绑定
485 this.bind(memberDTO, platformAccount); 496 this.bind(memberDTO, platformAccount);
486 497 log.info("绑定结束");
487 } 498 }
488 499
489 // 保存关注记录 500 // 保存关注记录
...@@ -559,6 +570,7 @@ public class UserOperationServiceImpl implements UserOperationService { ...@@ -559,6 +570,7 @@ public class UserOperationServiceImpl implements UserOperationService {
559 // 会员 570 // 会员
560 MemberDTO memberDTO = this.findMemberByUserWeixinDTO(userWeixinDTO); 571 MemberDTO memberDTO = this.findMemberByUserWeixinDTO(userWeixinDTO);
561 572
573 memberDTO.setUserIptvId(null);
562 // 修改会员vip,如果没有购买会员则取消团粉 574 // 修改会员vip,如果没有购买会员则取消团粉
563 MemberDTO _memberDTO = this.doUpdateMemberVip(memberDTO, 0); 575 MemberDTO _memberDTO = this.doUpdateMemberVip(memberDTO, 0);
564 576
...@@ -1017,6 +1029,10 @@ public class UserOperationServiceImpl implements UserOperationService { ...@@ -1017,6 +1029,10 @@ public class UserOperationServiceImpl implements UserOperationService {
1017 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) 1029 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
1018 public void bind(MemberDTO memberDTO, UserTvDTO userTvDTO) { 1030 public void bind(MemberDTO memberDTO, UserTvDTO userTvDTO) {
1019 String platformAccount = userTvDTO.getPlatformAccount(); 1031 String platformAccount = userTvDTO.getPlatformAccount();
1032
1033 if (StringUtils.isBlank(platformAccount)) {
1034 return;
1035 }
1020 // 绑定 1036 // 绑定
1021 this.bind(memberDTO,platformAccount); 1037 this.bind(memberDTO,platformAccount);
1022 } 1038 }
...@@ -1029,8 +1045,9 @@ public class UserOperationServiceImpl implements UserOperationService { ...@@ -1029,8 +1045,9 @@ public class UserOperationServiceImpl implements UserOperationService {
1029 */ 1045 */
1030 @Override 1046 @Override
1031 public UserTvDTO bind(MemberDTO memberDTO, String platformAccount) { 1047 public UserTvDTO bind(MemberDTO memberDTO, String platformAccount) {
1032 1048 log.info("bind start");
1033 MemberDTO memberDTO1 = this.memberService.findByCode(memberDTO.getCode()); 1049 MemberDTO memberDTO1 = this.memberService.findByCode(memberDTO.getCode());
1050 log.info("查询会员信息 ==>> {}", memberDTO1);
1034 if (Objects.nonNull(memberDTO1.getUserIptvId())) { 1051 if (Objects.nonNull(memberDTO1.getUserIptvId())) {
1035 UserTvDTO userTvDTO = this.userTvService.findById(memberDTO1.getUserIptvId()); 1052 UserTvDTO userTvDTO = this.userTvService.findById(memberDTO1.getUserIptvId());
1036 return userTvDTO; 1053 return userTvDTO;
...@@ -1038,6 +1055,7 @@ public class UserOperationServiceImpl implements UserOperationService { ...@@ -1038,6 +1055,7 @@ public class UserOperationServiceImpl implements UserOperationService {
1038 1055
1039 // 大屏账户 1056 // 大屏账户
1040 UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); 1057 UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount);
1058 log.info("查询大屏账号信息 ==>> {}", userTvDTO);
1041 if (Objects.isNull(userTvDTO)) { 1059 if (Objects.isNull(userTvDTO)) {
1042 throw new BadRequestException(GlobeExceptionMsg.IPTV_IS_NULL); 1060 throw new BadRequestException(GlobeExceptionMsg.IPTV_IS_NULL);
1043 } 1061 }
...@@ -1074,6 +1092,10 @@ public class UserOperationServiceImpl implements UserOperationService { ...@@ -1074,6 +1092,10 @@ public class UserOperationServiceImpl implements UserOperationService {
1074 // 修改会员 1092 // 修改会员
1075 MemberDTO _memberDTO = this.doUpdateMemberByMemberDTO(memberDTO); 1093 MemberDTO _memberDTO = this.doUpdateMemberByMemberDTO(memberDTO);
1076 1094
1095 _memberDTO.setPlatformAccount(platformAccount);
1096
1097
1098 log.info("发送到大屏侧的消息对象 会员信息 ==>> {} || 账号信息 ==>> {}", _memberDTO , _userTvDTO);
1077 // 同步至iptv 1099 // 同步至iptv
1078 ((UserOperationServiceImpl)AopContext.currentProxy()).asyncAppletBind(new MemberAndUserTvDTO(_memberDTO, _userTvDTO)); 1100 ((UserOperationServiceImpl)AopContext.currentProxy()).asyncAppletBind(new MemberAndUserTvDTO(_memberDTO, _userTvDTO));
1079 1101
......
...@@ -2,9 +2,12 @@ ...@@ -2,9 +2,12 @@
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://122.112.214.149:3306/tj_user_admin?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
6 # username: root
7 # password: root
8 url: jdbc:log4jdbc:mysql://139.196.145.150:3306/ucs_admin_chongshu?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
6 username: root 9 username: root
7 password: Tjlh@2017 10 password: Tjlh@2021
8 11
9 driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy 12 driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
10 #Druid 13 #Druid
...@@ -66,7 +69,7 @@ spring: ...@@ -66,7 +69,7 @@ spring:
66 # publisher-confirms: true #如果对异步消息需要回调必须设置为true 69 # publisher-confirms: true #如果对异步消息需要回调必须设置为true
67 host: 122.112.214.149 # rabbitmq的连接地址 70 host: 122.112.214.149 # rabbitmq的连接地址
68 port: 5672 # rabbitmq的连接端口号 71 port: 5672 # rabbitmq的连接端口号
69 virtual-host: member_center # rabbitmq的虚拟hosthhh 72 virtual-host: member_center_small_chongshu # rabbitmq的虚拟hosthhh
70 username: guest # rabbitmq的用户名 73 username: guest # rabbitmq的用户名
71 password: guest # rabbitmq的密码 74 password: guest # rabbitmq的密码
72 publisher-confirms: true #如果对异步消息需要回调必须设置为true 75 publisher-confirms: true #如果对异步消息需要回调必须设置为true
...@@ -104,8 +107,8 @@ file: ...@@ -104,8 +107,8 @@ file:
104 107
105 service: 108 service:
106 mq: 109 mq:
107 exchange: uce.exchange 110 exchange: exchange.MemberInfoSync
108 queue: uce.queue 111 queue: queue.MemberInfoSync
109 112
110 weixin: 113 weixin:
111 list: 114 list:
......