1.修改保存大小屏H5服务逻辑
Showing
3 changed files
with
40 additions
and
9 deletions
| ... | @@ -380,23 +380,42 @@ public class UserOperationController { | ... | @@ -380,23 +380,42 @@ public class UserOperationController { |
| 380 | String unionid = json.getString("unionid"); | 380 | String unionid = json.getString("unionid"); |
| 381 | Assert.state(StrUtil.isNotBlank(unionid), "unionid不可为空"); | 381 | Assert.state(StrUtil.isNotBlank(unionid), "unionid不可为空"); |
| 382 | 382 | ||
| 383 | |||
| 384 | List<Object> resultList = new ArrayList<>(); | ||
| 383 | // 大屏侧通过返回值来展示对应的小程序页面 | 385 | // 大屏侧通过返回值来展示对应的小程序页面 |
| 384 | String result = SUBSCRIBE; | 386 | String result = SUBSCRIBE; |
| 387 | String platformAccount1 = ""; | ||
| 385 | 388 | ||
| 386 | // 保存大小屏信息到redis同时返回小屏信息 | 389 | // 保存大小屏信息到redis同时返回小屏信息 |
| 387 | UserWeixinDTO userWeixinDTO = this.userTvOperationService.saveUserInfo(data); | 390 | UserWeixinDTO userWeixinDTO = this.userTvOperationService.saveUserInfo(data); |
| 391 | // 小屏会员 | ||
| 392 | MemberDTO memberDTO = this.memberService.findById(userWeixinDTO.getMemberId()); | ||
| 388 | // 小屏用户不存在或者关注状态为未关注(0),返回未关注 | 393 | // 小屏用户不存在或者关注状态为未关注(0),返回未关注 |
| 389 | if (Objects.isNull(userWeixinDTO) || Objects.isNull(userWeixinDTO.getId()) || userWeixinDTO.getStatus() != SUBSCRIBE_STATUS) { | 394 | if (Objects.isNull(userWeixinDTO) || Objects.isNull(userWeixinDTO.getId()) || userWeixinDTO.getStatus() != SUBSCRIBE_STATUS) { |
| 390 | result = UNSUBSCRIBE; | 395 | result = UNSUBSCRIBE; |
| 391 | return ResultInfo.success(result); | 396 | |
| 397 | if (Objects.nonNull(memberDTO)) { | ||
| 398 | // 检查是否绑定,返回绑定的大屏账户 | ||
| 399 | UserTvDTO userTvDTO = this.userOperationService.checkBind(memberDTO); | ||
| 400 | if (Objects.nonNull(userTvDTO)) { | ||
| 401 | platformAccount1 = userTvDTO.getPlatformAccount(); | ||
| 402 | } | ||
| 403 | |||
| 404 | } else { | ||
| 405 | log.info("userWeixinDTO ==>> [{}]",userWeixinDTO); | ||
| 406 | throw new EntityNotFoundException(MemberDTO.class,"code","member is null !!"); | ||
| 407 | } | ||
| 408 | |||
| 409 | resultList.add(result); | ||
| 410 | resultList.add(platformAccount1); | ||
| 411 | log.info("saveUserInfo ==>> result ==>> [{}]",resultList); | ||
| 412 | return ResultInfo.success(resultList); | ||
| 392 | } | 413 | } |
| 393 | 414 | ||
| 394 | /***************************************************************************************/ | 415 | /***************************************************************************************/ |
| 395 | String platformAccount1 = ""; | 416 | |
| 396 | // 关注未绑定 | 417 | // 关注未绑定 |
| 397 | if (result.equalsIgnoreCase(SUBSCRIBE)) { | 418 | if (result.equalsIgnoreCase(SUBSCRIBE)) { |
| 398 | // 小屏会员 | ||
| 399 | MemberDTO memberDTO = this.memberService.findById(userWeixinDTO.getMemberId()); | ||
| 400 | 419 | ||
| 401 | // redis中的大小屏信息 | 420 | // redis中的大小屏信息 |
| 402 | String content = (String) this.redisUtils.get(RedisKeyUtil.genSeSuSubscribeKey(unionid)); | 421 | String content = (String) this.redisUtils.get(RedisKeyUtil.genSeSuSubscribeKey(unionid)); |
| ... | @@ -434,7 +453,7 @@ public class UserOperationController { | ... | @@ -434,7 +453,7 @@ public class UserOperationController { |
| 434 | 453 | ||
| 435 | } | 454 | } |
| 436 | /****************************************************************************************/ | 455 | /****************************************************************************************/ |
| 437 | List<Object> resultList = new ArrayList<>(); | 456 | |
| 438 | resultList.add(result); | 457 | resultList.add(result); |
| 439 | resultList.add(platformAccount1); | 458 | resultList.add(platformAccount1); |
| 440 | 459 | ... | ... |
| ... | @@ -148,4 +148,5 @@ public interface UserOperationService { | ... | @@ -148,4 +148,5 @@ public interface UserOperationService { |
| 148 | 148 | ||
| 149 | UserTvDTO bind(MemberDTO memberDTO, String platformAccount); | 149 | UserTvDTO bind(MemberDTO memberDTO, String platformAccount); |
| 150 | 150 | ||
| 151 | UserTvDTO checkBind(MemberDTO memberDTO); | ||
| 151 | } | 152 | } | ... | ... |
| ... | @@ -1580,13 +1580,14 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1580,13 +1580,14 @@ public class UserOperationServiceImpl implements UserOperationService { |
| 1580 | this.bind(memberDTO,platformAccount); | 1580 | this.bind(memberDTO,platformAccount); |
| 1581 | } | 1581 | } |
| 1582 | 1582 | ||
| 1583 | |||
| 1584 | |||
| 1583 | @Override | 1585 | @Override |
| 1584 | public UserTvDTO bind(MemberDTO memberDTO, String platformAccount) { | 1586 | public UserTvDTO bind(MemberDTO memberDTO, String platformAccount) { |
| 1585 | 1587 | ||
| 1586 | MemberDTO memberDTO1 = this.memberService.getByCode(memberDTO.getCode()); | 1588 | UserTvDTO userTvDTO1 = this.checkBind(memberDTO); |
| 1587 | if (Objects.nonNull(memberDTO1.getUserIptvId())) { | 1589 | if (Objects.nonNull(userTvDTO1)) { |
| 1588 | UserTvDTO userTvDTO = this.userTvService.findById(memberDTO1.getUserIptvId()); | 1590 | return userTvDTO1; |
| 1589 | return userTvDTO; | ||
| 1590 | } | 1591 | } |
| 1591 | 1592 | ||
| 1592 | // 大屏账户 | 1593 | // 大屏账户 |
| ... | @@ -1610,6 +1611,16 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1610,6 +1611,16 @@ public class UserOperationServiceImpl implements UserOperationService { |
| 1610 | return null; | 1611 | return null; |
| 1611 | } | 1612 | } |
| 1612 | 1613 | ||
| 1614 | @Override | ||
| 1615 | public UserTvDTO checkBind(MemberDTO memberDTO) { | ||
| 1616 | MemberDTO memberDTO1 = this.memberService.getByCode(memberDTO.getCode()); | ||
| 1617 | if (Objects.nonNull(memberDTO1.getUserIptvId())) { | ||
| 1618 | UserTvDTO userTvDTO = this.userTvService.findById(memberDTO1.getUserIptvId()); | ||
| 1619 | return userTvDTO; | ||
| 1620 | } | ||
| 1621 | return null; | ||
| 1622 | } | ||
| 1623 | |||
| 1613 | /** | 1624 | /** |
| 1614 | * | 1625 | * |
| 1615 | * @param userWeixinDTO1 | 1626 | * @param userWeixinDTO1 | ... | ... |
-
Please register or sign in to post a comment