| | |
| | |
|
| | | 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;
|
| | |
|
| | |
| | | * 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 syncInviteData(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);
|
| | | }
|
| | |
| | | } else {
|
| | | record.setBeyondDaRen(map.get(key));
|
| | | }
|
| | | // TODO 保存
|
| | | // teamDailyRecordService.
|
| | | // 保存
|
| | | try {
|
| | | teamDailyRecordService.save(record);
|
| | | } catch (TeamDailyRecordException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|