1.update
Showing
1 changed file
with
33 additions
and
0 deletions
... | @@ -205,6 +205,39 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -205,6 +205,39 @@ public class UserOperationServiceImpl implements UserOperationService { |
205 | } | 205 | } |
206 | 206 | ||
207 | @Transactional(propagation = Propagation.SUPPORTS, rollbackFor = Exception.class) | 207 | @Transactional(propagation = Propagation.SUPPORTS, rollbackFor = Exception.class) |
208 | public void asyncSubscribe(MemberAndWeixinUserDTO memberAndWeixinUserDTO) { | ||
209 | UserWeixinDTO userWeixinDTO = memberAndWeixinUserDTO.getUserWeixinDTO(); | ||
210 | String openid = userWeixinDTO.getOpenid(); | ||
211 | String unionid = userWeixinDTO.getUnionid(); | ||
212 | String appid = userWeixinDTO.getAppid(); | ||
213 | MemberDTO memberDTO = memberAndWeixinUserDTO.getMemberDTO(); | ||
214 | |||
215 | UserWeixinDTO _userWeixinDTO = this.userWeixinService.findFirstByUnionIdAndAppIdAndOpenId(unionid, appid, openid); | ||
216 | if (Objects.nonNull(_userWeixinDTO)) { | ||
217 | |||
218 | // 账号存在,修改账号和会员 | ||
219 | this.updateWeixin(_userWeixinDTO, userWeixinDTO); | ||
220 | |||
221 | MemberDTO _memberDTO = this.memberService.findById(_userWeixinDTO.getMemberId()); | ||
222 | if (Objects.nonNull(_memberDTO)) { | ||
223 | |||
224 | memberDTO.setUserIptvId(_memberDTO.getUserIptvId()); | ||
225 | this.updateMember(_memberDTO, memberDTO); | ||
226 | |||
227 | } else { | ||
228 | |||
229 | throw new EntityNotFoundException(MemberDTO.class, "id", GlobeExceptionMsg.MEMBER_ID_IS_NULL); | ||
230 | |||
231 | } | ||
232 | |||
233 | } else { | ||
234 | |||
235 | throw new EntityNotFoundException(UserWeixinDTO.class, "id", GlobeExceptionMsg.WEIXIN_IS_NULL); | ||
236 | |||
237 | } | ||
238 | } | ||
239 | |||
240 | @Transactional(propagation = Propagation.SUPPORTS, rollbackFor = Exception.class) | ||
208 | public void asyncUnsubscribe(MemberAndWeixinUserDTO memberAndWeixinUserDTO) { | 241 | public void asyncUnsubscribe(MemberAndWeixinUserDTO memberAndWeixinUserDTO) { |
209 | UserWeixinDTO userWeixinDTO = memberAndWeixinUserDTO.getUserWeixinDTO(); | 242 | UserWeixinDTO userWeixinDTO = memberAndWeixinUserDTO.getUserWeixinDTO(); |
210 | String openid = userWeixinDTO.getOpenid(); | 243 | String openid = userWeixinDTO.getOpenid(); | ... | ... |
-
Please register or sign in to post a comment