1.去除大屏信息缓存
2.在绑定和解绑成功后大屏信息(任务)缓存
Showing
2 changed files
with
17 additions
and
5 deletions
... | @@ -187,7 +187,6 @@ public class UserTvServiceImpl implements UserTvService { | ... | @@ -187,7 +187,6 @@ public class UserTvServiceImpl implements UserTvService { |
187 | } | 187 | } |
188 | 188 | ||
189 | @Override | 189 | @Override |
190 | @Cacheable(cacheNames = RedisKeyConstants.cacheUserTvByPlatformAccount, key = "#platformAccount", unless = "#result.id == null") | ||
191 | @Transactional(readOnly = true) | 190 | @Transactional(readOnly = true) |
192 | public UserTvDTO findByPlatformAccount(String platformAccount) { | 191 | public UserTvDTO findByPlatformAccount(String platformAccount) { |
193 | UserTv userTv = this.userTvRepository.findByPlatformAccount(platformAccount).orElseGet(UserTv::new); | 192 | UserTv userTv = this.userTvRepository.findByPlatformAccount(platformAccount).orElseGet(UserTv::new); | ... | ... |
... | @@ -727,6 +727,9 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -727,6 +727,9 @@ public class UserOperationServiceImpl implements UserOperationService { |
727 | log.info("大屏账号置空主会员的结果,userTvDTO ==>> {}", userTvDTO); | 727 | log.info("大屏账号置空主会员的结果,userTvDTO ==>> {}", userTvDTO); |
728 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUnbind(new MemberAndUserTvDTO(memberDTO, userTvDTO)); | 728 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUnbind(new MemberAndUserTvDTO(memberDTO, userTvDTO)); |
729 | 729 | ||
730 | |||
731 | this.updateUserTvSimplePriorityMemberCodeRedis(platformAccount, ""); | ||
732 | |||
730 | return true; | 733 | return true; |
731 | } | 734 | } |
732 | 735 | ||
... | @@ -1005,6 +1008,8 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1005,6 +1008,8 @@ public class UserOperationServiceImpl implements UserOperationService { |
1005 | ((UserOperationServiceImpl)AopContext.currentProxy()) | 1008 | ((UserOperationServiceImpl)AopContext.currentProxy()) |
1006 | .asyncMinaBind(new MemberAndUserTvDTO(memberDTO, userTvDTO)); | 1009 | .asyncMinaBind(new MemberAndUserTvDTO(memberDTO, userTvDTO)); |
1007 | 1010 | ||
1011 | this.updateUserTvSimplePriorityMemberCodeRedis(platformAccount, memberDTO.getCode()); | ||
1012 | |||
1008 | return true; | 1013 | return true; |
1009 | } | 1014 | } |
1010 | 1015 | ||
... | @@ -1071,14 +1076,20 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1071,14 +1076,20 @@ public class UserOperationServiceImpl implements UserOperationService { |
1071 | // 同步至iptv | 1076 | // 同步至iptv |
1072 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncMinaBind(new MemberAndUserTvDTO(memberDTO, userTvDTO)); | 1077 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncMinaBind(new MemberAndUserTvDTO(memberDTO, userTvDTO)); |
1073 | 1078 | ||
1079 | this.updateUserTvSimplePriorityMemberCodeRedis(platformAccount, memberDTO.getCode()); | ||
1080 | |||
1081 | return userTvDTO; | ||
1082 | } | ||
1083 | |||
1084 | |||
1085 | private void updateUserTvSimplePriorityMemberCodeRedis(String platformAccount, String priorityMemberCode){ | ||
1074 | // 修改缓存中MemberSimple的大屏主账号信息,因为执行任务之前会去检查主会员d | 1086 | // 修改缓存中MemberSimple的大屏主账号信息,因为执行任务之前会去检查主会员d |
1075 | UserTvSimpleDTO userTvSimpleDTO = this.userTvService.findSimpleByPlatformAccount(platformAccount); | 1087 | UserTvSimpleDTO userTvSimpleDTO = this.userTvService.findSimpleByPlatformAccount(platformAccount); |
1076 | if (Objects.nonNull(userTvDTO)) { | 1088 | if (Objects.nonNull(userTvSimpleDTO)) { |
1077 | userTvSimpleDTO.setPriorityMemberCode(memberDTO.getCode()); | 1089 | userTvSimpleDTO.setPriorityMemberCode(priorityMemberCode); |
1078 | JSONObject hashMap = JSONObject.parseObject(JSON.toJSONString(userTvDTO), JSONObject.class); | 1090 | JSONObject hashMap = JSONObject.parseObject(JSON.toJSONString(userTvSimpleDTO), JSONObject.class); |
1079 | this.redisUtils.set(RedisKeyConstants.cacheVisUserByPlatformAccount + "::" + platformAccount, hashMap); | 1091 | this.redisUtils.set(RedisKeyConstants.cacheVisUserByPlatformAccount + "::" + platformAccount, hashMap); |
1080 | } | 1092 | } |
1081 | return userTvDTO; | ||
1082 | } | 1093 | } |
1083 | 1094 | ||
1084 | /** | 1095 | /** |
... | @@ -1386,6 +1397,8 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1386,6 +1397,8 @@ public class UserOperationServiceImpl implements UserOperationService { |
1386 | 1397 | ||
1387 | log.info("同步绑定信息至大屏侧, 参数 ==>> {}", new MemberAndUserTvDTO(memberDTO, userTvDTO)); | 1398 | log.info("同步绑定信息至大屏侧, 参数 ==>> {}", new MemberAndUserTvDTO(memberDTO, userTvDTO)); |
1388 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUnbind(new MemberAndUserTvDTO(memberDTO, userTvDTO)); | 1399 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUnbind(new MemberAndUserTvDTO(memberDTO, userTvDTO)); |
1400 | |||
1401 | this.updateUserTvSimplePriorityMemberCodeRedis(userTvDTO.getPlatformAccount(), ""); | ||
1389 | return true; | 1402 | return true; |
1390 | } | 1403 | } |
1391 | 1404 | ... | ... |
-
Please register or sign in to post a comment