Browse Source

专家信息表添加联系方式phone和联系邮箱email字段。

zzy.zhiyuan.foxmail 8 years ago
parent
commit
00fb16d89a

+ 21 - 3
src/main/java/com/ekexiu/portal/po/Professor.java

@ -46,6 +46,8 @@ public class Professor implements CreateTimeSupported, ModifyTimeSupported{
46 46
	private Integer authentication;
47 47
	private Integer authType;
48 48
	private Integer authStatus;
49
	private String phone;
50
	private String email;
49 51
	
50 52
	private Organization organization;
51 53
	private List<Resource> resources;
@ -226,7 +228,7 @@ public class Professor implements CreateTimeSupported, ModifyTimeSupported{
226 228
		this.starAvg = starAvg;
227 229
	}
228 230
229
	@Column(handlerClass=WIntHandler.class,dbType="INT",insertable=false,nullable=false,renewable=false,queryable=true)
231
	@Column(handlerClass=WIntHandler.class,dbType="INT",insertable=true,nullable=false,renewable=false,queryable=true)
230 232
	public Integer getAuthentication() {
231 233
		return authentication;
232 234
	}
@ -252,7 +254,23 @@ public class Professor implements CreateTimeSupported, ModifyTimeSupported{
252 254
	public void setAuthStatus(Integer authStatus) {
253 255
		this.authStatus = authStatus;
254 256
	}
255
	
256
	
257
258
	@Column(value=DE.String_de,dbType="VARCHAR(20)")
259
	public String getPhone() {
260
		return phone;
261
	}
262
263
	public void setPhone(String phone) {
264
		this.phone = phone;
265
	}
266
267
	@Column(DE.Email_de)
268
	public String getEmail() {
269
		return email;
270
	}
271
272
	public void setEmail(String email) {
273
		this.email = email;
274
	}
257 275
258 276
}

+ 17 - 0
src/main/java/com/ekexiu/portal/service/ProfessorService.java

@ -32,8 +32,10 @@ import com.ekexiu.portal.dao.ProjectDao;
32 32
import com.ekexiu.portal.dao.ResearchAreaDao;
33 33
import com.ekexiu.portal.dao.ResearchAreaLogDao;
34 34
import com.ekexiu.portal.dao.ResourceDao;
35
import com.ekexiu.portal.dao.UserDao;
35 36
import com.ekexiu.portal.dao.WatchDao;
36 37
import com.ekexiu.portal.po.Professor;
38
import com.ekexiu.portal.po.User;
37 39
import com.ekexiu.portal.pojo.EditProfessor;
38 40
import com.ekexiu.portal.pojo.EditResearchAreaLog;
39 41
import com.ekexiu.portal.pojo.ProfessorInfo;
@ -41,6 +43,8 @@ import com.ekexiu.portal.util.Calculate;
41 43

42 44
@Path("/professor")
43 45
public class ProfessorService {
46
	@Autowrie
47
	private UserDao userDao;
44 48
	@Autowrie
45 49
	private WatchDao watchDao;
46 50
	@Autowrie
@ -73,6 +77,14 @@ public class ProfessorService {
73 77
	private ProjectDao projectDao;
74 78

75 79
	
80
	public UserDao getUserDao() {
81
		return userDao;
82
	}
83

84
	public void setUserDao(UserDao userDao) {
85
		this.userDao = userDao;
86
	}
87

76 88
	public WatchDao getWatchDao() {
77 89
		return watchDao;
78 90
	}
@ -210,6 +222,11 @@ public class ProfessorService {
210 222
				professor.setOrgId(this.orgService.createOrganization(con, orgName));
211 223
			}
212 224
		}
225
		User user = this.userDao.query(con, professor.getId());
226
		if(user != null){
227
			professor.setPhone(user.getMobilePhone());
228
			professor.setEmail(user.getEmail());
229
		}
213 230
		this.professorDao.insert(con, professor);
214 231
		return professor.getId();
215 232
	}