| | |
| | | package com.yeshi.fanli.service.impl.user;
|
| | |
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | |
| | | 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;
|
| | |
| | | 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();
|
| | |
| | | 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) {
|
| | |
| | | return inviteCode;
|
| | | }
|
| | |
|
| | | public void countUserRank() {
|
| | | |
| | | |
| | | |
| | | }
|
| | | |
| | | |
| | | |
| | | }
|