|
@ -3,6 +3,7 @@ package com.ekexiu.portal.service;
|
3
|
3
|
import java.sql.Connection;
|
4
|
4
|
import java.sql.SQLException;
|
5
|
5
|
import java.text.SimpleDateFormat;
|
|
6
|
import java.util.ArrayList;
|
6
|
7
|
import java.util.Calendar;
|
7
|
8
|
import java.util.Date;
|
8
|
9
|
import java.util.HashMap;
|
|
@ -79,21 +80,6 @@ public class GrowthLogService {
|
79
|
80
|
this.rule = rule;
|
80
|
81
|
}
|
81
|
82
|
|
82
|
|
@Post
|
83
|
|
@Path("/updateData")
|
84
|
|
public boolean updateData(@JdbcConn(true) Connection con)throws SQLException{
|
85
|
|
List<User> users = this.userDao.queryList(con);
|
86
|
|
for (User user : users) {
|
87
|
|
if((user.getInviterId() != null) && (user.getInviterId().trim().length() == 32)){
|
88
|
|
Professor professor = this.professorDao.queryOne(con, user.getInviterId());
|
89
|
|
if(professor != null){
|
90
|
|
this.invite(con, professor.getId());
|
91
|
|
}
|
92
|
|
}
|
93
|
|
}
|
94
|
|
return true;
|
95
|
|
}
|
96
|
|
|
97
|
83
|
@Get
|
98
|
84
|
@Path("/queryByPro")
|
99
|
85
|
public List<GrowthLog> queryByPro(@JdbcConn Connection con,String professorId,@DefaultValue("com.ekexiu.portal.service.GrowthLogService.MAX_CREATE_TIME") String createTime,@DefaultValue("20") int rows)throws SQLException{
|
|
@ -116,6 +102,29 @@ public class GrowthLogService {
|
116
|
102
|
map.put("inviteScore", inviteScore);
|
117
|
103
|
return map;
|
118
|
104
|
}
|
|
105
|
|
|
106
|
@Get
|
|
107
|
@Path("/inviteScore")
|
|
108
|
public int queryInviteScore(@JdbcConn Connection con,String professorId)throws SQLException{
|
|
109
|
return this.growthLogDao.queryInviteScore(con, professorId);
|
|
110
|
}
|
|
111
|
|
|
112
|
@Get
|
|
113
|
@Path("/qlInviter")
|
|
114
|
public List<String> queryInviterId(@JdbcConn Connection con,String professorId,@DefaultValue("com.ekexiu.portal.service.GrowthLogService.MAX_CREATE_TIME") String createTime,@DefaultValue("20") int rows)throws SQLException{
|
|
115
|
List<User> users = this.userDao.queryLimit(con, professorId, createTime, rows);
|
|
116
|
List<String> strings = new ArrayList<String>();
|
|
117
|
for (User user : users) {
|
|
118
|
strings.add(user.getId());
|
|
119
|
}
|
|
120
|
return strings;
|
|
121
|
}
|
|
122
|
|
|
123
|
@Get
|
|
124
|
@Path("/inviterCount")
|
|
125
|
public int queryInviterCount(@JdbcConn Connection con,String professorId)throws SQLException{
|
|
126
|
return this.userDao.queryInviter(con, professorId);
|
|
127
|
}
|
119
|
128
|
|
120
|
129
|
/**
|
121
|
130
|
* 分享专家
|