ソースを参照

--add updateAuthType();update queryAuth();

zzy.zhiyuan.foxmail 8 年 前
コミット
c8d92840db
共有2 個のファイルを変更した9 個の追加22 個の削除を含む
  1. 1 3
      src/main/java/com/ekexiu/portal/dao/ProfessorDao.java
  2. 8 19
      src/main/java/com/ekexiu/portal/service/ProfessorService.java

+ 1 - 3
src/main/java/com/ekexiu/portal/dao/ProfessorDao.java

@ -15,7 +15,6 @@ import org.jfw.apt.orm.annotation.dao.method.From;
15 15
import org.jfw.apt.orm.annotation.dao.method.Or;
16 16
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
17 17
import org.jfw.apt.orm.annotation.dao.method.Select;
18
import org.jfw.apt.orm.annotation.dao.method.SetSentence;
19 18
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
20 19
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
21 20
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
@ -61,11 +60,10 @@ public abstract class ProfessorDao {
61 60
	
62 61
	@UpdateWith
63 62
	@From(Professor.class)
64
	public abstract int updateAuthypen(Connection con,String id,@Set Integer authentication)throws SQLException;
63
	public abstract int updateAuthTypype(Connection con, String id, @Set Integer authType) throws SQLException;
65 64
	
66 65
	@UpdateWith
67 66
	@From(Professor.class)
68
	@SetSentence("AUTH_STATUS=1")
69 67
	public abstract int updateAuthentication(Connection con, String id, @Set Integer authentication) throws SQLException;
70 68
	
71 69
	@UpdateWith

+ 8 - 19
src/main/java/com/ekexiu/portal/service/ProfessorService.java

@ -22,7 +22,6 @@ import org.jfw.util.PageQueryResult;
22 22
import org.jfw.util.StringUtil;
23 23

24 24
import com.ekexiu.portal.dao.ArticleDao;
25
import com.ekexiu.portal.dao.AuthApplyDao;
26 25
import com.ekexiu.portal.dao.HonorDao;
27 26
import com.ekexiu.portal.dao.ImageDao;
28 27
import com.ekexiu.portal.dao.OrgDao;
@ -37,7 +36,6 @@ import com.ekexiu.portal.dao.ResearchAreaLogDao;
37 36
import com.ekexiu.portal.dao.ResourceDao;
38 37
import com.ekexiu.portal.dao.UserDao;
39 38
import com.ekexiu.portal.dao.WatchDao;
40
import com.ekexiu.portal.po.AuthApply;
41 39
import com.ekexiu.portal.po.Professor;
42 40
import com.ekexiu.portal.po.Resource;
43 41
import com.ekexiu.portal.po.User;
@ -54,8 +52,6 @@ public class ProfessorService {
54 52
	@Autowrie
55 53
	private ImageDao imageDao;
56 54
	@Autowrie
57
	private AuthApplyDao authApplyDao;
58
	@Autowrie
59 55
	private UserDao userDao;
60 56
	@Autowrie
61 57
	private WatchDao watchDao;
@ -97,14 +93,6 @@ public class ProfessorService {
97 93
		this.articleDao = articleDao;
98 94
	}
99 95

100
	public AuthApplyDao getAuthApplyDao() {
101
		return authApplyDao;
102
	}
103

104
	public void setAuthApplyDao(AuthApplyDao authApplyDao) {
105
		this.authApplyDao = authApplyDao;
106
	}
107

108 96
	public UserDao getUserDao() {
109 97
		return userDao;
110 98
	}
@ -292,12 +280,7 @@ public class ProfessorService {
292 280
	@Get
293 281
	@Path("/auth")
294 282
	public Professor queryAuth(@JdbcConn Connection con, String id) throws SQLException{
295
		Professor professor =  this.professorDao.queryAuth(con, id);
296
		AuthApply apply = this.authApplyDao.queryPro(con, id);
297
		if(apply != null) {
298
			professor.setAuthStatus(apply.getSolveStatus()+2);
299
		}
300
		return professor;
283
		return this.professorDao.queryAuth(con, id);
301 284
	}
302 285
	
303 286
	@Get
@ -402,10 +385,16 @@ public class ProfessorService {
402 385
		this.professorDao.updateAuthentication(con, id, authentication, authType, authStatus);
403 386
	}
404 387
	
388
	@Post
389
	@Path("/authType")
390
	public void updateAuthType(@JdbcConn(true) Connection con,String id,Integer authType)throws SQLException{
391
		this.professorDao.updateAuthType(con, id, authType);
392
	}
393
	
405 394
	@Post
406 395
	@Path("/authen")
407 396
	public void updateAuthen(@JdbcConn(true) Connection con,String id,Integer authentication)throws SQLException{
408
		this.professorDao.updateAuthypen(con, id, authentication);
397
		this.professorDao.updateAuthentication(con, id, authentication);
409 398
	}
410 399
	
411 400
	@Post