Commit 75e045cd 75e045cdf006dc52a864609112f6a61c43ab73a2 by xianghan

1.添加解绑、换绑的日志

1 parent a2e2b42f
...@@ -459,6 +459,18 @@ public class UserOperationController { ...@@ -459,6 +459,18 @@ public class UserOperationController {
459 public ResultInfo tvUnbind(@Validated(value = {UpdateGroup.class}) @RequestBody TvUnBindBean resources) { 459 public ResultInfo tvUnbind(@Validated(value = {UpdateGroup.class}) @RequestBody TvUnBindBean resources) {
460 log.info("UserOperationController ==> unbind ==>> param ==> [{}]",resources); 460 log.info("UserOperationController ==> unbind ==>> param ==> [{}]",resources);
461 461
462 String memberCode = resources.getMemberCode();
463 log.info("大屏解绑,前端参数,需要解绑的会员code,memberCode ==>> {}", memberCode);
464 if (StringUtils.isBlank(memberCode)) {
465 throw new BadRequestException(GlobeExceptionMsg.MEMBER_CODE_IS_NULL);
466 }
467
468 String platformAccount = resources.getPlatformAccount();
469 log.info("大屏解绑,前端参数,大屏账号,platformAccount ==>> {}", platformAccount);
470 if (StringUtils.isBlank(platformAccount)) {
471 throw new BadRequestException(GlobeExceptionMsg.IPTV_PLATFORM_ACCOUNT_IS_NULL);
472 }
473
462 this.userOperationService.tvUnbind(resources); 474 this.userOperationService.tvUnbind(resources);
463 return ResultInfo.success(); 475 return ResultInfo.success();
464 } 476 }
......
...@@ -697,25 +697,33 @@ public class UserOperationServiceImpl implements UserOperationService { ...@@ -697,25 +697,33 @@ public class UserOperationServiceImpl implements UserOperationService {
697 String platformAccount = resources.getPlatformAccount(); 697 String platformAccount = resources.getPlatformAccount();
698 String memberCode = resources.getMemberCode(); 698 String memberCode = resources.getMemberCode();
699 699
700 MemberDTO memberDTO = this.memberService.findByCode(memberCode);
701
702 UserTvDTO userTvDTO = this.findByPlatformAccount(platformAccount); 700 UserTvDTO userTvDTO = this.findByPlatformAccount(platformAccount);
703 if (Objects.isNull(userTvDTO)) 701 log.info("大屏解绑,通过大屏账号查询大屏账号信息,结果 userTvDTO ==>> {}", userTvDTO);
702 if (Objects.isNull(userTvDTO.getId()))
704 throw new EntityNotFoundException(UserTvDTO.class, "PlatformAccount", GlobeExceptionMsg.IPTV_IS_NULL); 703 throw new EntityNotFoundException(UserTvDTO.class, "PlatformAccount", GlobeExceptionMsg.IPTV_IS_NULL);
705 704
705 MemberDTO memberDTO = this.memberService.findByCode(memberCode);
706 log.info("大屏解绑,通过会员code查询会员信息,结果memberDTO==>>{}", memberDTO);
707
708
706 // 解绑(置空大屏信息) 709 // 解绑(置空大屏信息)
707 MemberDTO _memberDTO = this.minaUnbind_(this.findMemberByCode(memberCode)); 710 log.info("开始置空会员的user_iptv_id ==>> {}", memberDTO);
711 MemberDTO _memberDTO = this.minaUnbind_(memberDTO);
708 if (Objects.isNull(_memberDTO)) { 712 if (Objects.isNull(_memberDTO)) {
709 _memberDTO = memberDTO; 713 _memberDTO = memberDTO;
710 } 714 }
715 log.info("会员信息置空大屏的结果,_memberDTO ==>> {}", _memberDTO);
711 716
712 // 置空主账号 717 // 置空主账号
718 log.info("开始置空大屏账号的主会员priorityMemberCode");
713 UserTvDTO _userTvDTO = this.resetMainAccount(memberCode, userTvDTO.getId(), autoModel, bindMemberCode); 719 UserTvDTO _userTvDTO = this.resetMainAccount(memberCode, userTvDTO.getId(), autoModel, bindMemberCode);
714 if (Objects.isNull(_userTvDTO)){ 720 if (Objects.isNull(_userTvDTO)){
715 _userTvDTO = userTvDTO; 721 _userTvDTO = userTvDTO;
716 } 722 }
723 log.info("大屏账号置空主会员的结果,_userTvDTO ==>> {}", _userTvDTO);
717 724
718 // 同步至iptv 725 // 同步至iptv
726 log.info("开始同步解绑,参数 ==>> {} ",new MemberAndUserTvDTO(_memberDTO, _userTvDTO));
719 ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUnbind(new MemberAndUserTvDTO(_memberDTO, _userTvDTO)); 727 ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUnbind(new MemberAndUserTvDTO(_memberDTO, _userTvDTO));
720 } 728 }
721 729
...@@ -1258,17 +1266,23 @@ public class UserOperationServiceImpl implements UserOperationService { ...@@ -1258,17 +1266,23 @@ public class UserOperationServiceImpl implements UserOperationService {
1258 private UserTvDTO resetMainAccount(String memberCode, Long id, Boolean autoModel, String bindMemberCode) { 1266 private UserTvDTO resetMainAccount(String memberCode, Long id, Boolean autoModel, String bindMemberCode) {
1259 1267
1260 UserTvDTO userTvDTO = this.userTvService.findByPriorityMemberCode(memberCode); 1268 UserTvDTO userTvDTO = this.userTvService.findByPriorityMemberCode(memberCode);
1261 if (Objects.nonNull(userTvDTO)) { 1269 log.info("大屏解绑,重置大屏账号的主会员,查看当前会员是否是主账号 ==>>memberCode ==>> {} || 大屏账号 ==>> userTvDTO ==>> {}", userTvDTO);
1262 1270 if (Objects.nonNull(userTvDTO.getId())) {
1271 log.info("主账号存在");
1263 if (StringUtils.isBlank(bindMemberCode)) { 1272 if (StringUtils.isBlank(bindMemberCode)) {
1264
1265 // 有其他绑定的小程序会员,排除自己 1273 // 有其他绑定的小程序会员,排除自己
1266 List<MemberDTO> memberDTOList = this.memberService.findByUserIptvId(id); 1274 /*List<MemberDTO> memberDTOList = this.memberService.findByUserIptvId(id);
1275 log.info("后台指定一个默认主会员,通过大屏id查询到的绑定的小屏会员memberDTOList ==>> {}", memberDTOList);
1267 if (!CollectionUtils.isEmpty(memberDTOList)) { 1276 if (!CollectionUtils.isEmpty(memberDTOList)) {
1268 1277
1278 Long memberId = userTvDTO.getMemberId();
1279 MemberDTO memberDTO1 = this.memberService.findById(memberId);
1280
1269 List<MemberDTO> collect = 1281 List<MemberDTO> collect =
1270 memberDTOList.stream().filter(memberDTO -> 1282 memberDTOList.stream().filter(memberDTO ->
1271 !memberDTO.getCode().equalsIgnoreCase(memberCode)).collect(Collectors.toList()); 1283 !memberDTO.getCode().equalsIgnoreCase(memberCode) &&
1284 !memberDTO.getCode().equalsIgnoreCase(memberDTO1.getCode())).collect(Collectors.toList());
1285 log.info("过滤掉当前需要解绑的会员以及绑定的大屏会员之后剩余的会员列表 ==>> {}", memberDTOList);
1272 1286
1273 if (!CollectionUtils.isEmpty(collect)) { 1287 if (!CollectionUtils.isEmpty(collect)) {
1274 1288
...@@ -1282,6 +1296,7 @@ public class UserOperationServiceImpl implements UserOperationService { ...@@ -1282,6 +1296,7 @@ public class UserOperationServiceImpl implements UserOperationService {
1282 1296
1283 // 绑定新的主账号 1297 // 绑定新的主账号
1284 UserTvDTO _userTvDTO = this.bondPriorityMember(userTvDTO, memberDTOList.get(0).getCode(), "manual"); 1298 UserTvDTO _userTvDTO = this.bondPriorityMember(userTvDTO, memberDTOList.get(0).getCode(), "manual");
1299 log.info("绑定新的主账号 ==>> _userTvDTO ==>> {}", _userTvDTO);
1285 1300
1286 return _userTvDTO; 1301 return _userTvDTO;
1287 1302
...@@ -1289,12 +1304,19 @@ public class UserOperationServiceImpl implements UserOperationService { ...@@ -1289,12 +1304,19 @@ public class UserOperationServiceImpl implements UserOperationService {
1289 1304
1290 } else { 1305 } else {
1291 1306
1307 log.info("无其他绑定的小屏会员信息 ");
1292 // 绑定新的主账号 1308 // 绑定新的主账号
1293 UserTvDTO _userTvDTO = this.bondPriorityMember(userTvDTO, null, "manual"); 1309 UserTvDTO _userTvDTO = this.bondPriorityMember(userTvDTO, null, "manual");
1294 1310 log.info("绑定新的主账号 ==>> _userTvDTO ==>> {}", _userTvDTO);
1295 return _userTvDTO; 1311 return _userTvDTO;
1296 1312
1297 } 1313 }*/
1314
1315 log.info("无其他绑定的小屏会员信息 ");
1316 // 绑定新的主账号
1317 UserTvDTO _userTvDTO = this.bondPriorityMember(userTvDTO, null, "manual");
1318 log.info("绑定新的主账号 ==>> _userTvDTO ==>> {}", _userTvDTO);
1319 return _userTvDTO;
1298 1320
1299 } else { 1321 } else {
1300 1322
...@@ -1328,6 +1350,7 @@ public class UserOperationServiceImpl implements UserOperationService { ...@@ -1328,6 +1350,7 @@ public class UserOperationServiceImpl implements UserOperationService {
1328 memberDTOS.setUserIptvId(null); 1350 memberDTOS.setUserIptvId(null);
1329 memberDTOS.setBindIptvPlatformType(null); 1351 memberDTOS.setBindIptvPlatformType(null);
1330 BeanUtils.copyProperties(memberDTOS, member); 1352 BeanUtils.copyProperties(memberDTOS, member);
1353 log.info("大屏绑定,置空绑定的大屏信息, member ==>> {}", member);
1331 MemberDTO memberDTO = this.memberService.update(member); 1354 MemberDTO memberDTO = this.memberService.update(member);
1332 return memberDTO; 1355 return memberDTO;
1333 } 1356 }
......