ソースを参照

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

zzy.zhiyuan.foxmail 8 年 前
コミット
69dc43451c
共有2 個のファイルを変更した16 個の追加1 個の削除を含む
  1. 6 0
      src/main/java/com/ekexiu/portal/dao/ProfessorDao.java
  2. 10 1
      src/main/java/com/ekexiu/portal/service/AuthApplyService.java

+ 6 - 0
src/main/java/com/ekexiu/portal/dao/ProfessorDao.java

@ -15,6 +15,7 @@ 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;
18 19
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
19 20
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
20 21
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
@ -57,6 +58,11 @@ public abstract class ProfessorDao {
57 58
	public abstract int updateAuthentication(Connection con, String id, @Set Integer authentication, 
58 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 66
	@UpdateWith
61 67
	@From(Professor.class)
62 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,12 +6,14 @@ import java.sql.SQLException;
6 6
import java.util.List;
7 7

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

16 18
import com.ekexiu.portal.dao.AuthApplyDao;
17 19
import com.ekexiu.portal.dao.ProfessorDao;
@ -55,6 +57,7 @@ public class AuthApplyService {
55 57
	@Path
56 58
	public String insert(@JdbcConn(true) Connection con, AuthApply authApply) throws SQLException, IOException{
57 59
		String authApplyId = StringUtil.buildUUID();
60
		authApply.setSolveStatus(0);
58 61
		authApply.setAuthApplyId(authApplyId);
59 62
		this.authApplyDao.insert(con, authApply);
60 63
		return authApplyId;
@ -62,7 +65,13 @@ public class AuthApplyService {
62 65
	
63 66
	@Post
64 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 75
		this.authApplyDao.updateSolveStatus(con,state,id);
67 76
	}
68 77