yujian
2020-05-07 a9c9da611563738e2974103a45270d5857b746b6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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.ThreeSaleFocusInfoDao;
import com.yeshi.fanli.dto.user.ThreeSaleFocusDTO;
import com.yeshi.fanli.entity.bus.user.ThreeSaleFocusInfo;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleFocusInfoService;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
 
@Service
public class ThreeSaleFocusInfoServiceImpl implements ThreeSaleFocusInfoService {
 
    @Resource
    private ThreeSaleFocusInfoDao threeSaleFocusInfoDao;
    
    @Resource
    private ThreeSaleSerivce threeSaleSerivce;
    
    @Override
    public void save(ThreeSaleFocusInfo record) {
        threeSaleFocusInfoDao.save(record);
    }
 
    
    @Override
    public void updateMemoName(Long workerId, int type, String memoName) {
        threeSaleFocusInfoDao.updateMemoName(workerId, type, memoName);
    }
 
    @Override
    public void updateTags(Long workerId, int type, String tags) {
        threeSaleFocusInfoDao.updateTags(workerId, type, tags);
    }
    
    @Override
    public void updateNickName(Long workerId, String nickName) {
        threeSaleFocusInfoDao.updateNickName(workerId, nickName);
    }
    
    
    @Override
    public void updateStateValid(Long workerId, boolean stateValid) {
        threeSaleFocusInfoDao.updateStateValid(workerId, stateValid);
    }
    
    @Override
    public void updateTaobaoBind(Long workerId, boolean taobaoBind) {
        threeSaleFocusInfoDao.updateTaobaoBind(workerId, taobaoBind);
    }
    
    @Override
    public void updateWeixinBind(Long workerId, boolean weixinBind) {
        threeSaleFocusInfoDao.updateWeixinBind(workerId, weixinBind);
    }
 
    @Override
    public void updateActiveTime(Long workerId, Date activeTime) {
        threeSaleFocusInfoDao.updateActiveTime(workerId, activeTime);
    }
 
    @Override
    public void updateFansNum(Long workerId) {
        long firstTeam = threeSaleSerivce.countFirstTeam(workerId);
        long secondTeam = threeSaleSerivce.countSecondTeam(workerId);
        int fansNum = (int) (firstTeam + secondTeam);
        threeSaleFocusInfoDao.updateFansNum(workerId, fansNum);
    }
 
    @Override
    public void updateIncome(Long workerId, BigDecimal income) {
        threeSaleFocusInfoDao.updateIncome(workerId, income);
    }
    
 
    @Override
    public List<ThreeSaleFocusInfo> query(int start, int count, int type, Long uid, ThreeSaleFocusDTO focusDTO) {
        return threeSaleFocusInfoDao.query(start, count, type, uid, focusDTO);
    }
    
    @Override
    public long count(int type, Long uid, ThreeSaleFocusDTO focusDTO) {
        return threeSaleFocusInfoDao.count(type, uid, focusDTO);
    }
    
    @Override
    public ThreeSaleFocusInfo getbyWorkerId(Long workerId) {
        return threeSaleFocusInfoDao.getbyWorkerId(workerId);
    }
}