admin
2019-08-26 822e2bc06f9e95f357867d457c004e7bb1f67db8
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java
@@ -23,6 +23,7 @@
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.hongbao.ThreeSaleExtraInfoSerivce;
import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.integral.IntegralGetService;
import com.yeshi.fanli.service.inter.msg.MsgInviteDetailService;
import com.yeshi.fanli.service.inter.msg.UserInviteMsgNotificationService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
@@ -69,6 +70,10 @@
   
   @Resource
   private ThreeSaleExtraInfoSerivce threeSaleExtraInfoSerivce;
   @Resource
   private IntegralGetService  integralGetService;
   
   
   @Resource(name = "taskExecutor")
@@ -406,13 +411,11 @@
         object.put("memoName", memoName);
         String nickName = "";
         Long  workerId= null;
         String portrait = "";
         Long lastLoginTime = null;
         UserInfo worker = threeSale.getWorker();
         if (worker != null) {
            workerId = worker.getId();
            portrait = worker.getPortrait();
            lastLoginTime = worker.getLastLoginTime();
            nickName = worker.getNickName();
@@ -505,7 +508,7 @@
   @Override
   @Transactional
   public void bindRelationshipByInviteCode(UserInfo invitee, UserInfo inviter, String platform, String version) throws ThreeSaleException {
   public void bindRelationshipByInviteCode(UserInfo invitee, UserInfo inviter) throws ThreeSaleException {
      if (invitee == null || inviter == null) 
         throw new ThreeSaleException(1, "用户信息为空");
@@ -515,6 +518,8 @@
      if (threeSale != null) {
         // 有效关系--生效
         threeSale.setBoss(inviter);
         threeSale.setWorker(invitee);
         threeSale.setState(true);
         threeSale.setExpire(ThreeSale.EXPIRE_NORMAL);
         threeSale.setSucceedTime(java.lang.System.currentTimeMillis());
@@ -552,8 +557,9 @@
      executor.execute(new Runnable() {
         @Override
         public void run() {
            UserActiveLog activeLog  = userActiveLogService.getUserLatestActiveInfo(inviter.getId());
            try {
               UserActiveLog activeLog  = userActiveLogService.getUserLatestActiveInfo(inviter.getId());
               if (activeLog != null  && !StringUtil.isNullOrEmpty(activeLog.getVersionCode()) ) {
                  String versionCode = activeLog.getVersionCode();
                  String channel = activeLog.getChannel();
@@ -582,6 +588,9 @@
            } catch (Exception e) {
               LogHelper.errorDetailInfo(e);
            }
            // 邀请金币
            integralGetService.addInviteLevelOne(inviter.getId(), invitee.getId());
         }
      });
      
@@ -590,7 +599,7 @@
   @Override
   @Transactional
   public void bindRelationshipByWX(UserInfo invitee, Long inviterId, ThreeSale threeSaleOld, String platform, String version) throws ThreeSaleException {
   public void bindRelationshipByWX(UserInfo invitee, Long inviterId, ThreeSale threeSaleOld) throws ThreeSaleException {
      if (invitee == null || (inviterId == null && threeSaleOld == null))
         throw new ThreeSaleException(1, "用户信息为空");
@@ -633,6 +642,7 @@
      
      UserInfo boss = userInfoService.selectByPKey(threeSale.getBoss().getId());
      threeSale.setBoss(boss);
      threeSale.setWorker(invitee);
      
      // 添加到队列
      ThreeSaleCMQManager.getInstance().addThreeSaleMsg(threeSale);