Browse Source

Merge branch 'dev' of http://121.42.53.174:3000/jiapeng/portal-web.git into dev

zzy.zhiyuan.foxmail 8 years ago
parent
commit
69dc43451c

+ 6 - 0
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;
18
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
19
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
19
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
20
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
20
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
21
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
57
	public abstract int updateAuthentication(Connection con, String id, @Set Integer authentication, 
58
	public abstract int updateAuthentication(Connection con, String id, @Set Integer authentication, 
58
			@Set Integer authType, @Set Integer authStatus) throws SQLException;
59
			@Set Integer authType, @Set Integer authStatus) throws SQLException;
59
	
60
	
61
	@UpdateWith
62
	@From(Professor.class)
63
	@SetSentence("AUTH_STATUS=1")
64
	public abstract int updateAuthentication(Connection con, String id, @Set Integer authentication) throws SQLException;
65
	
60
	@UpdateWith
66
	@UpdateWith
61
	@From(Professor.class)
67
	@From(Professor.class)
62
	public abstract int updateAuthStatus(Connection con, String id, @Set Integer authStatus) throws SQLException;
68
	public abstract int updateAuthStatus(Connection con, String id, @Set Integer authStatus) throws SQLException;

+ 10 - 1
src/main/java/com/ekexiu/portal/service/AuthApplyService.java

6
import java.util.List;
6
import java.util.List;
7

7

8
import org.jfw.apt.annotation.Autowrie;
8
import org.jfw.apt.annotation.Autowrie;
9
import org.jfw.apt.annotation.Nullable;
9
import org.jfw.apt.web.annotation.Path;
10
import org.jfw.apt.web.annotation.Path;
10
import org.jfw.apt.web.annotation.operate.Get;
11
import org.jfw.apt.web.annotation.operate.Get;
11
import org.jfw.apt.web.annotation.operate.Post;
12
import org.jfw.apt.web.annotation.operate.Post;
12
import org.jfw.apt.web.annotation.param.JdbcConn;
13
import org.jfw.apt.web.annotation.param.JdbcConn;
13
import org.jfw.apt.web.annotation.param.PathVar;
14
import org.jfw.apt.web.annotation.param.PathVar;
14
import org.jfw.util.StringUtil;
15
import org.jfw.util.StringUtil;
16
import org.jfw.util.exception.JfwBaseException;
15

17

16
import com.ekexiu.portal.dao.AuthApplyDao;
18
import com.ekexiu.portal.dao.AuthApplyDao;
17
import com.ekexiu.portal.dao.ProfessorDao;
19
import com.ekexiu.portal.dao.ProfessorDao;
55
	@Path
57
	@Path
56
	public String insert(@JdbcConn(true) Connection con, AuthApply authApply) throws SQLException, IOException{
58
	public String insert(@JdbcConn(true) Connection con, AuthApply authApply) throws SQLException, IOException{
57
		String authApplyId = StringUtil.buildUUID();
59
		String authApplyId = StringUtil.buildUUID();
60
		authApply.setSolveStatus(0);
58
		authApply.setAuthApplyId(authApplyId);
61
		authApply.setAuthApplyId(authApplyId);
59
		this.authApplyDao.insert(con, authApply);
62
		this.authApplyDao.insert(con, authApply);
60
		return authApplyId;
63
		return authApplyId;
62
	
65
	
63
	@Post
66
	@Post
64
	@Path("/state")
67
	@Path("/state")
65
	public void updateState(@JdbcConn(true) Connection con,String id,Integer state)throws SQLException{
68
	public void updateState(@JdbcConn(true) Connection con,String id,Integer state,@Nullable Integer auth,@Nullable String professorId)throws SQLException, JfwBaseException{
69
		if(state==2){
70
			if(auth==null) throw new JfwBaseException(10);
71
			if(professorId==null) throw new JfwBaseException(10);
72
			if(auth>4 || auth <1) throw new JfwBaseException(11);
73
			this.professorDao.updateAuthentication(con, professorId, auth);
74
		}
66
		this.authApplyDao.updateSolveStatus(con,state,id);
75
		this.authApplyDao.updateSolveStatus(con,state,id);
67
	}
76
	}
68
	
77