admin
2019-02-25 03afbcf4b9e9b55433e914d861d643b7a23d69f9
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.impl.user;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
@@ -10,7 +11,6 @@
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.yeshi.utils.DateUtil;
import com.yeshi.fanli.dao.mybatis.user.UserInfoExtraMapper;
import com.yeshi.fanli.dao.mybatis.user.UserRankRecordMapper;
@@ -140,8 +140,11 @@
      if (userInfoExtra != null && userInfoExtra.getId() != null) {
         // 判断当月是否已更新
         Date rankUpdateTime = userInfoExtra.getRankUpdateTime();
         if (rankUpdateTime != null && DateUtil.isSameMonth(rankUpdateTime, new Date())) {
            isupdateRank = false;
         if (rankUpdateTime != null) {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
            if (sdf.format(rankUpdateTime).equals(sdf.format(new Date()))) {
               isupdateRank = false;
            }
         } 
      } else {
         userInfoExtra = new UserInfoExtra();
@@ -290,6 +293,14 @@
         throw new UserInfoExtraException(1, "用户id、邀请码不能为空");
      }
      
      UserInfoExtra extra = userInfoExtraMapper.getInfoExtraByUid(uid);
      if (extra != null) {
         String inviteCodeHas = extra.getInviteCode();
         if (inviteCodeHas != null && inviteCodeHas.trim().length() > 0) {
            throw new UserInfoExtraException(1, "已存在邀请码,请刷新页面");
         }
      }
      // 被邀请人信息
      UserInfo invitee = userInfoService.selectByPKey(uid);
      if (invitee == null) {