From 3f7bcb1fb68b78a2cd2a87b44098f1de70378d92 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 30 十二月 2019 18:59:59 +0800 Subject: [PATCH] 完成微信小程序登录流程 --- fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleSerivceImpl.java | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleSerivceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleSerivceImpl.java index 2db9ebc..14c3df9 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleSerivceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleSerivceImpl.java @@ -86,7 +86,7 @@ return threeSaleMapper.selectBoss(uid); } - @Transactional(rollbackFor=Exception.class) + @Transactional(rollbackFor = Exception.class) public void bind(UserInfo worker, UserInfo inviter) throws ThreeSaleException { if (worker == null || inviter == null) throw new ThreeSaleException(1, "鐢ㄦ埛淇℃伅涓虹┖"); @@ -500,7 +500,7 @@ } @Override - @Transactional(rollbackFor=Exception.class) + @Transactional(rollbackFor = Exception.class) public void bindRelationshipByInviteCode(UserInfo invitee, UserInfo inviter) throws ThreeSaleException { if (invitee == null || inviter == null) throw new ThreeSaleException(1, "鐢ㄦ埛淇℃伅涓虹┖"); @@ -520,11 +520,11 @@ } @Override - @Transactional(rollbackFor=Exception.class) - public void bindRelationshipByWX(UserInfo invitee, Long inviterId)throws ThreeSaleException { + @Transactional(rollbackFor = Exception.class) + public void bindRelationshipByWX(UserInfo invitee, Long inviterId) throws ThreeSaleException { if (invitee == null || inviterId == null) throw new ThreeSaleException(1, "鐢ㄦ埛淇℃伅涓虹┖"); - // 鏂板缓绔嬬‘瀹氬叧绯� + // 鏂板缓绔嬬‘瀹氬叧绯� ThreeSale threeSale = new ThreeSale(); threeSale.setBoss(new UserInfo(inviterId)); threeSale.setWorker(invitee); @@ -538,7 +538,7 @@ UserInfo boss = userInfoService.selectByPKey(threeSale.getBoss().getId()); threeSale.setBoss(boss); threeSale.setWorker(invitee); - + // 閭�璇锋垚鍔燂細娑堟伅銆佺浉鍏冲鐞� inviteSuccess(boss.getId(), invitee.getId(), threeSale); } @@ -550,13 +550,13 @@ private void inviteSuccess(Long bossId, Long workerId, ThreeSale threeSale) { // 閭�璇锋秷鎭� UserActiveLog activeLog = userActiveLogService.getUserLatestActiveInfo(bossId); - if (activeLog != null && VersionUtil.greaterThan_2_0_5("appstore".equalsIgnoreCase(activeLog.getChannel()) ? "ios" : "android", - activeLog.getVersionCode())) { // 2.1鐗堟湰浠ヤ笂 + if (activeLog != null && VersionUtil.greaterThan_2_0_5( + "appstore".equalsIgnoreCase(activeLog.getChannel()) ? "ios" : "android", activeLog.getVersionCode())) { // 2.1鐗堟湰浠ヤ笂 userInviteMsgNotificationService.inviteSuccess2_1(bossId, threeSale); } else { // 鏈�鍒濇秷鎭� userInviteMsgNotificationService.inviteSuccess(threeSale.getBoss().getId(), threeSale); } - + executor.execute(new Runnable() { @Override public void run() { @@ -565,9 +565,9 @@ } }); UserInviteMQMsg msg = new UserInviteMQMsg(bossId, workerId, null, new Date(), UserInviteMQMsg.STATE_SUCCESS); - Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.inviteSuccess, - msg); - producer.send(message); + Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.inviteSuccess, msg); + if (!Constant.IS_TEST) + producer.send(message); } /** @@ -590,7 +590,7 @@ public ThreeSale selectByWorkerId(Long workerId) { return threeSaleMapper.selectSuccessByWorkerId(workerId); } - + @Override public ThreeSale getNearRelationByBossIdAndWorkerId(Long bossId, Long workerId) { return threeSaleMapper.getNearRelationByBossIdAndWorkerId(bossId, workerId); @@ -620,15 +620,15 @@ public ThreeSale getByWorkerIdAndTime(Long workerId, long time) { return threeSaleMapper.getByWorkerIdAndTime(workerId, time); } - + @Override public void inviteSeparate(Long workerId, Long bossId) { threeSaleMapper.inviteSeparate(workerId, bossId); } - + @Override public long getTeamOrderNumByWorkerId(Long workerId) { return threeSaleMapper.getTeamOrderNumByWorkerId(workerId); } - + } -- Gitblit v1.8.0