package com.yeshi.fanli.service.impl.user.invite;
|
|
import java.math.BigDecimal;
|
import java.util.Date;
|
import java.util.List;
|
|
import javax.annotation.Resource;
|
|
import org.springframework.stereotype.Service;
|
|
import com.yeshi.fanli.dao.user.invite.TeamFansInfoDao;
|
import com.yeshi.fanli.dto.user.ThreeSaleFocusDTO;
|
import com.yeshi.fanli.entity.bus.user.TeamFansInfo;
|
import com.yeshi.fanli.service.inter.user.invite.TeamFansInfoService;
|
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
|
@Service
|
public class TeamFansInfoServiceImpl implements TeamFansInfoService {
|
|
@Resource
|
private TeamFansInfoDao teamFansInfoDao;
|
|
@Resource
|
private ThreeSaleSerivce threeSaleSerivce;
|
|
@Override
|
public void save(TeamFansInfo record) {
|
teamFansInfoDao.save(record);
|
}
|
|
|
@Override
|
public void updateMemoName(Long workerId, int type, String memoName) {
|
teamFansInfoDao.updateMemoName(workerId, type, memoName);
|
}
|
|
@Override
|
public void updateTags(Long workerId, int type, String tags) {
|
teamFansInfoDao.updateTags(workerId, type, tags);
|
}
|
|
@Override
|
public void updateNickName(Long workerId, String nickName) {
|
teamFansInfoDao.updateNickName(workerId, nickName);
|
}
|
|
|
@Override
|
public void updateStateValid(Long workerId, boolean stateValid) {
|
teamFansInfoDao.updateStateValid(workerId, stateValid);
|
}
|
|
@Override
|
public void updateTaobaoBind(Long workerId, boolean taobaoBind) {
|
teamFansInfoDao.updateTaobaoBind(workerId, taobaoBind);
|
}
|
|
@Override
|
public void updateWeixinBind(Long workerId, boolean weixinBind) {
|
teamFansInfoDao.updateWeixinBind(workerId, weixinBind);
|
}
|
|
@Override
|
public void updateActiveTime(Long workerId, Date activeTime) {
|
teamFansInfoDao.updateActiveTime(workerId, activeTime);
|
}
|
|
@Override
|
public void updateFansNum(Long workerId) {
|
long firstTeam = threeSaleSerivce.countFirstTeam(workerId);
|
long secondTeam = threeSaleSerivce.countSecondTeam(workerId);
|
int fansNum = (int) (firstTeam + secondTeam);
|
teamFansInfoDao.updateFansNum(workerId, fansNum);
|
}
|
|
@Override
|
public void updateIncome(Long workerId, BigDecimal income) {
|
teamFansInfoDao.updateIncome(workerId, income);
|
}
|
|
|
@Override
|
public List<TeamFansInfo> query(int start, int count, int type, Long uid, ThreeSaleFocusDTO focusDTO) {
|
return teamFansInfoDao.query(start, count, type, uid, focusDTO);
|
}
|
|
@Override
|
public long count(int type, Long uid, ThreeSaleFocusDTO focusDTO) {
|
return teamFansInfoDao.count(type, uid, focusDTO);
|
}
|
|
@Override
|
public TeamFansInfo getbyWorkerId(Long workerId) {
|
return teamFansInfoDao.getbyWorkerId(workerId);
|
}
|
}
|