| | |
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSaleDetail;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TeamDailyRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.invite.TeamDailyRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | | import com.yeshi.fanli.exception.user.TeamDailyRecordException;
|
| | | import com.yeshi.fanli.service.inter.user.invite.TeamDailyRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.vip.TeamDailyRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
|
| | |
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | | /**
|
| | | * 用户等级升级
|
| | | * @Title: userUpgraded
|
| | | * @Description: |
| | | * @param uid
|
| | | * @param level
|
| | | * @param date |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void userUpgraded(Long uid, UserLevelEnum level, Date date) {
|
| | |
|
| | | // 更新一级,二级,二级外响应的等级提升
|
| | |
|
| | | // 统计
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 同步会员信息(一级/二级/二级外)
|
| | |
| | | * int 返回类型
|
| | | * @throws
|
| | | */
|
| | | private void syncVIPData(Date minTime, Date maxTime) {
|
| | | public void syncVIPData(Date minTime, Date maxTime) {
|
| | |
|
| | | List<UserVIPPreInfo> totalList = new ArrayList<>();
|
| | |
|
| | |
| | | int page = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | for (int i = 0; i < page; i++) {
|
| | | List<UserVIPPreInfo> list = userVIPPreInfoService.listByProcess(UserLevelEnum.highVIP.getLevel(), minTime,
|
| | | maxTime, page, pageSize);
|
| | | maxTime, i + 1, pageSize);
|
| | | if (list != null)
|
| | | totalList.addAll(list);
|
| | | }
|
| | |
| | | page = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | for (int i = 0; i < page; i++) {
|
| | | List<UserVIPPreInfo> list = userVIPPreInfoService.listByProcess(UserLevelEnum.superVIP.getLevel(), minTime,
|
| | | maxTime, page, pageSize);
|
| | | maxTime, i + 1, pageSize);
|
| | | if (list != null)
|
| | | totalList.addAll(list);
|
| | | }
|
| | |
| | | String day = TimeUtil.getGernalTime(vipPre.getCreateTime().getTime(), "yyyy-MM-dd");
|
| | | List<ThreeSaleDetail> list = threeSaleDetailService.listByWorkerUid(vipPre.getUid());
|
| | | for (ThreeSaleDetail ts : list) {
|
| | | String key = ts.getBossUid() + "#" + vipPre.getProcess() + "#" + day + "#";
|
| | | String key = ts.getBossUid() + "#" + day + "#" + vipPre.getProcess() + "#";
|
| | | if (ts.getLevel() == 1) {
|
| | | key += "1";
|
| | | } else if (ts.getLevel() == 2) {
|
| | |
| | | tempKey = uid + "#" + day + "#" + UserLevelEnum.superVIP.getLevel() + "#" + level;
|
| | | record.setBeyondSuperVIP(map.get(tempKey));
|
| | | }
|
| | | // TODO 保存
|
| | | // teamDailyRecordService.
|
| | | // 保存
|
| | | try {
|
| | | teamDailyRecordService.save(record);
|
| | | } catch (TeamDailyRecordException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | private void syncData(Date minTime, Date maxTime) {
|
| | | public void syncInviteAndTotalData(Date minTime, Date maxTime) {
|
| | | List<ThreeSale> totalList = new ArrayList<>();
|
| | | long count = threeSaleSerivce.countAll(minTime, maxTime);
|
| | | int pageSize = 1000;
|
| | | int page = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | for (int i = 0; i < page; i++) {
|
| | | List<ThreeSale> list = threeSaleSerivce.listAll(minTime, maxTime, page, pageSize);
|
| | | List<ThreeSale> list = threeSaleSerivce.listAll(minTime, maxTime, i + 1, pageSize);
|
| | | if (list != null)
|
| | | totalList.addAll(list);
|
| | | }
|
| | |
| | | record.setCountDay(new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd")));
|
| | | if (level == 1) {
|
| | | record.setFirstDaRen(map.get(key));
|
| | | record.setFirstNum(map.get(key));
|
| | | } else if (level == 2) {
|
| | | record.setSecondDaRen(map.get(key));
|
| | | record.setSecondNum(map.get(key));
|
| | | } else {
|
| | | record.setBeyondDaRen(map.get(key));
|
| | | record.setBeyondNum(map.get(key));
|
| | | }
|
| | | // TODO 保存
|
| | | // teamDailyRecordService.
|
| | | // 保存
|
| | | try {
|
| | | teamDailyRecordService.save(record);
|
| | | } catch (TeamDailyRecordException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 邀请成功
|
| | | * @Title: inviteSuccess
|
| | | * @Description: |
| | | * @param uid 被邀请人用户ID
|
| | | * @param date |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void inviteSuccess(Long uid, Date date) {
|
| | |
|
| | | }
|
| | |
|