Browse Source

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

zzy.zhiyuan.foxmail 8 years ago
parent
commit
c8d92840db

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

15
import org.jfw.apt.orm.annotation.dao.method.Or;
15
import org.jfw.apt.orm.annotation.dao.method.Or;
16
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
16
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
17
import org.jfw.apt.orm.annotation.dao.method.Select;
17
import org.jfw.apt.orm.annotation.dao.method.Select;
18
import org.jfw.apt.orm.annotation.dao.method.SetSentence;
19
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
18
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
20
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
19
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
21
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
20
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
61
	
60
	
62
	@UpdateWith
61
	@UpdateWith
63
	@From(Professor.class)
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
	@UpdateWith
65
	@UpdateWith
67
	@From(Professor.class)
66
	@From(Professor.class)
68
	@SetSentence("AUTH_STATUS=1")
69
	public abstract int updateAuthentication(Connection con, String id, @Set Integer authentication) throws SQLException;
67
	public abstract int updateAuthentication(Connection con, String id, @Set Integer authentication) throws SQLException;
70
	
68
	
71
	@UpdateWith
69
	@UpdateWith

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

22
import org.jfw.util.StringUtil;
22
import org.jfw.util.StringUtil;
23

23

24
import com.ekexiu.portal.dao.ArticleDao;
24
import com.ekexiu.portal.dao.ArticleDao;
25
import com.ekexiu.portal.dao.AuthApplyDao;
26
import com.ekexiu.portal.dao.HonorDao;
25
import com.ekexiu.portal.dao.HonorDao;
27
import com.ekexiu.portal.dao.ImageDao;
26
import com.ekexiu.portal.dao.ImageDao;
28
import com.ekexiu.portal.dao.OrgDao;
27
import com.ekexiu.portal.dao.OrgDao;
37
import com.ekexiu.portal.dao.ResourceDao;
36
import com.ekexiu.portal.dao.ResourceDao;
38
import com.ekexiu.portal.dao.UserDao;
37
import com.ekexiu.portal.dao.UserDao;
39
import com.ekexiu.portal.dao.WatchDao;
38
import com.ekexiu.portal.dao.WatchDao;
40
import com.ekexiu.portal.po.AuthApply;
41
import com.ekexiu.portal.po.Professor;
39
import com.ekexiu.portal.po.Professor;
42
import com.ekexiu.portal.po.Resource;
40
import com.ekexiu.portal.po.Resource;
43
import com.ekexiu.portal.po.User;
41
import com.ekexiu.portal.po.User;
54
	@Autowrie
52
	@Autowrie
55
	private ImageDao imageDao;
53
	private ImageDao imageDao;
56
	@Autowrie
54
	@Autowrie
57
	private AuthApplyDao authApplyDao;
58
	@Autowrie
59
	private UserDao userDao;
55
	private UserDao userDao;
60
	@Autowrie
56
	@Autowrie
61
	private WatchDao watchDao;
57
	private WatchDao watchDao;
97
		this.articleDao = articleDao;
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
	public UserDao getUserDao() {
96
	public UserDao getUserDao() {
109
		return userDao;
97
		return userDao;
110
	}
98
	}
292
	@Get
280
	@Get
293
	@Path("/auth")
281
	@Path("/auth")
294
	public Professor queryAuth(@JdbcConn Connection con, String id) throws SQLException{
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
	@Get
286
	@Get
402
		this.professorDao.updateAuthentication(con, id, authentication, authType, authStatus);
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
	@Post
394
	@Post
406
	@Path("/authen")
395
	@Path("/authen")
407
	public void updateAuthen(@JdbcConn(true) Connection con,String id,Integer authentication)throws SQLException{
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
	@Post
400
	@Post