-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayerSvcImpl.java
More file actions
99 lines (77 loc) · 2.28 KB
/
Copy pathPlayerSvcImpl.java
File metadata and controls
99 lines (77 loc) · 2.28 KB
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
97
98
99
package deep.zero.svc;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import deep.tool.DateUtils;
import deep.zero.bean.Account;
import deep.zero.bean.Player;
import deep.zero.repo.AccountRepo;
import deep.zero.repo.PlayerRepo;
@Service("playerSvc")
@Transactional(readOnly=true)
public class PlayerSvcImpl implements PlayerSvc {
@Autowired
private PlayerRepo pr;
@Autowired
private AccountRepo ar;
@Transactional
public Player addPlayer(Player p){
Account account=new Account();
account.setName(-1L);//玩家主账户识别为-1,其他游戏账户为gameId
pr.saveAndFlush(p);
account.setPlayerId(p.getId());
ar.save(account);
return p;
}
@Transactional
public void delPlayer(Long id){
pr.delete(id);
}
@Transactional
public Player modiPlayer(Player p){
return pr.save(p);
}
public Player get(Long id){
return pr.findOne(id);
}
public List<Player> getAll(){
return pr.findAll();
}
public Player getByCode(String code) {
return pr.getByCode(code);
}
public List<Player> getPlayerByRegWeek() {
Date startTime=DateUtils.weekStartTime();
Date endTime=DateUtils.weekEndTime();
return pr.getPlayerByRegWeek(startTime,endTime);
}
public List<Player> getPlayerByRegMonth() {
Date startTime=DateUtils.getCurrentMonthStartTime();
Date endTime=DateUtils.getCurrentMonthEndTime();
return pr.getPlayerByRegMonth(startTime,endTime);
}
public List<Player> getPlayerByRegQuarter() {
Date startTime=DateUtils.getCurrentQuarterStartTime();
Date endTime=DateUtils.getCurrentQuarterEndTime();
return pr.getPlayerByRegQuarter(startTime,endTime);
}
public List<Player> getPlayerByDt(Date dStart, Date dEnd) {
return pr.getPlayerByDt(dStart,dEnd);
}
public List<Player> getFreezenPlayer() {
return pr.getFreezenPlayer();
}
public boolean validate(String code, String password) {
// TODO Auto-generated method stub
return pr.validate(code, password);
}
public Player getByAbbrName(String abbrName) {
// TODO Auto-generated method stub
return pr.getByAbbrName(abbrName);
}
// public List<Player> getNoDepositedPlayer() {
// return pr.getNoDepositedPlayer();
// }
}