| | |
| | | List<ThreeSale> list = listByWorkerId(worker.getId());
|
| | | if (list != null && list.size() > 0) {
|
| | | for (ThreeSale ts : list) {
|
| | | if (!ts.getState() && ts.getExpire() == ThreeSale.EXPIRE_OUTOFDATE) {
|
| | | if (!ts.getState() && ts.getExpire() == ThreeSale.EXPIRE_BREAK) {
|
| | | outOfDateCount++;
|
| | | }
|
| | | }
|
| | |
| | | if (list != null)
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | if (list.get(i).getState() != null && list.get(i).getState() == false
|
| | | && list.get(i).getExpire() == ThreeSale.EXPIRE_OUTOFDATE) {// 过期的
|
| | | && list.get(i).getExpire() == ThreeSale.EXPIRE_BREAK) {// 过期的
|
| | | list.remove(i);
|
| | | i--;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ThreeSale> listFirstTeamByUndeleted(long start, int count, Long uid) {
|
| | | return threeSaleMapper.listFirstTeamByUndeleted(start, count, uid);
|
| | | }
|
| | | |
| | | @Override
|
| | | public long countFirstTeamByUndeleted(Long uid) {
|
| | | return threeSaleMapper.countFirstTeamByUndeleted(uid);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<ThreeSale> listSecondTeamByUndeleted(long start, int count, Long uid) {
|
| | | return threeSaleMapper.listSecondTeamByUndeleted(start, count, uid);
|
| | | }
|
| | | |
| | | @Override
|
| | | public long countSecondTeamByUndeleted(Long uid) {
|
| | | return threeSaleMapper.countSecondTeamByUndeleted(uid);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<ThreeSale> listSecondTeam(long start, int count, Long uid, Integer state) {
|
| | | return threeSaleMapper.listSecondTeam(start, count, uid, state);
|
| | | }
|
| | |
| | | return threeSaleMapper.getTeamOrderNumByWorkerId(workerId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ThreeSale> getValidWorkerIdsByTime(Long bossId, long limitTime) {
|
| | | return threeSaleMapper.getValidWorkerIdsByTime(bossId, limitTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ThreeSale> getMyBossDeepList(Long uid, int deep) {
|
| | |
|
| | | List<ThreeSale> deepList = new ArrayList<>();
|
| | | ThreeSale boss = getMyBoss(uid);
|
| | | while (deep > 0 && boss != null) {
|
| | | deep--;
|
| | | deepList.add(boss);
|
| | | boss = getMyBoss(boss.getBoss().getId());
|
| | | }
|
| | |
|
| | | return deepList;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void remvoeBreak(Long id, Long uid, Long tid) {
|
| | | ThreeSale threeSale = threeSaleMapper.selectByPrimaryKey(id);
|
| | | if (threeSale == null) {
|
| | | return;
|
| | | }
|
| | | |
| | | Long workerId = threeSale.getWorker().getId();
|
| | | if (tid.longValue() != workerId.longValue()) {
|
| | | return;
|
| | | }
|
| | | |
| | | Integer expire = threeSale.getExpire();
|
| | | if (expire == ThreeSale.EXPIRE_NORMAL) {
|
| | | return;
|
| | | }
|
| | | |
| | | int upExpire = expire;
|
| | | Long bossId = threeSale.getBoss().getId();
|
| | | if (bossId.longValue() == uid.longValue()) { // 直接粉丝
|
| | | if (expire == ThreeSale.EXPIRE_BREAK_VIP_DEL4) {
|
| | | upExpire =ThreeSale.EXPIRE_BREAK_VIP_DEL34;
|
| | | } else {
|
| | | upExpire = ThreeSale.EXPIRE_BREAK_VIP_DEL3;
|
| | | }
|
| | | } else { // 间接粉丝
|
| | | if (expire == ThreeSale.EXPIRE_BREAK_VIP_DEL3) {
|
| | | upExpire =ThreeSale.EXPIRE_BREAK_VIP_DEL34;
|
| | | } else {
|
| | | upExpire = ThreeSale.EXPIRE_BREAK_VIP_DEL4;
|
| | | }
|
| | | }
|
| | | |
| | | ThreeSale update = new ThreeSale();
|
| | | update.setId(id);
|
| | | update.setExpire(upExpire);
|
| | | update.setUpdateTime(java.lang.System.currentTimeMillis());
|
| | | threeSaleMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | |
|
| | | }
|