Browse Source

专家权重 审核更改auth_type和auth_status_expert字段

XMTT 7 years ago
parent
commit
38c27b0bd6

+ 19 - 4
src/main/java/com/ekexiu/console/system/dao/ProfessorDao.java

@ -8,10 +8,7 @@ import org.jfw.apt.orm.annotation.dao.DAO;
8 8
import org.jfw.apt.orm.annotation.dao.method.From;
9 9
import org.jfw.apt.orm.annotation.dao.method.IncludeFixSet;
10 10
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
11
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
12
import org.jfw.apt.orm.annotation.dao.method.operator.PageQuery;
13
import org.jfw.apt.orm.annotation.dao.method.operator.Update;
14
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
11
import org.jfw.apt.orm.annotation.dao.method.operator.*;
15 12
import org.jfw.apt.orm.annotation.dao.param.*;
16 13
import org.jfw.util.PageQueryResult;
17 14
@ -56,4 +53,22 @@ public interface ProfessorDao {
56 53
    @UpdateWith
57 54
    @From(Professor.class)
58 55
    int[] updateProfessorState(Connection con, @Batch String[] id, @Set Integer professorState) throws SQLException;
56
57
    @Nullable
58
    @QueryOne
59
    ProfessorInfo query(Connection con, String id) throws SQLException;
60
61
    @UpdateWith
62
    @From(Professor.class)
63
    int updateSortFirst(Connection con, String id, @Set Integer sortFirst) throws SQLException;
64
65
    @Batch
66
    @UpdateWith
67
    @From(Professor.class)
68
    int[] updateAuthType(Connection con, @Batch String[] id, @Set Integer authType) throws SQLException;
69
70
    @Batch
71
    @UpdateWith
72
    @From(Professor.class)
73
    int[] updateAuthStatusExpert(Connection con, @Batch String[] id, @Set Integer authStatusExpert) throws SQLException;
59 74
}

+ 3 - 3
src/main/java/com/ekexiu/console/system/po/Professor.java

@ -54,8 +54,10 @@ public class Professor implements CreateTimeSupported,ModifyTimeSupported {
54 54
    private String idCard;
55 55
    private String cuserId;
56 56
    private Integer professorState;
57
57
    private Integer sortFirst;
58
    
58 59
    @Column(handlerClass=FixLenStringHandler.class,dbType="CHAR(1)",renewable=false)
60
59 61
    public String getOrgAuth() {
60 62
        return orgAuth;
61 63
    }
@ -91,8 +93,6 @@ public class Professor implements CreateTimeSupported,ModifyTimeSupported {
91 93
        this.idCard = idCard;
92 94
    }
93 95
94
    private Integer sortFirst;
95
96 96
    @Column(value=DE.String_de,dbType="TEXT")
97 97
    public String getOffice() {
98 98
        return office;

+ 12 - 1
src/main/java/com/ekexiu/console/system/pojo/ProfessorInfo.java

@ -3,14 +3,16 @@ package com.ekexiu.console.system.pojo;
3 3
import com.ekexiu.console.system.po.Professor;
4 4
import org.jfw.apt.orm.annotation.entry.CalcColumn;
5 5
import org.jfw.apt.orm.annotation.entry.ExtendView;
6
import org.jfw.apt.orm.core.defaultImpl.FixLenStringHandler;
6 7
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
7 8
8 9
/**
9 10
 * Created by TT on 2017/5/25.
10 11
 */
11
@ExtendView(fromSentence = "professor p LEFT JOIN cuser c on p.cuser_id = c.id LEFT JOIN organization o on p.org_id = o.id", tableAlias = "p")
12
@ExtendView(fromSentence = "professor p LEFT JOIN luser l on p.id = l.id LEFT JOIN cuser c on p.cuser_id = c.id LEFT JOIN organization o on p.org_id = o.id", tableAlias = "p")
12 13
public class ProfessorInfo extends Professor {
13 14
15
    private String activeTime;
14 16
    private String enter;
15 17
    private String orgName;
16 18
@ -31,4 +33,13 @@ public class ProfessorInfo extends Professor {
31 33
    public void setEnter(String enter) {
32 34
        this.enter = enter;
33 35
    }
36
37
    @CalcColumn(handlerClass = FixLenStringHandler.class, column = "l.active_time")
38
    public String getActiveTime() {
39
        return activeTime;
40
    }
41
42
    public void setActiveTime(String activeTime) {
43
        this.activeTime = activeTime;
44
    }
34 45
}

+ 16 - 1
src/main/java/com/ekexiu/console/system/service/ProfessorService.java

@ -14,6 +14,7 @@ import org.jfw.apt.web.annotation.operate.Get;
14 14
import org.jfw.apt.web.annotation.operate.Post;
15 15
import org.jfw.apt.web.annotation.operate.Put;
16 16
import org.jfw.apt.web.annotation.param.JdbcConn;
17
import org.jfw.apt.web.annotation.param.PathVar;
17 18
import org.jfw.apt.web.annotation.param.RequestBody;
18 19
import org.jfw.util.PageQueryResult;
19 20
import org.jfw.util.StringUtil;
@ -103,6 +104,18 @@ public class ProfessorService {
103 104
        return this.professorDao.pageQuery(con,enter, oName, pname, professorState, bt, et, pageSize, pageNo);
104 105
    }
105 106
107
    @Get
108
    @Path("/id/{id}")
109
    public ProfessorInfo sortFirst(@JdbcConn Connection con,@PathVar String id) throws SQLException {
110
        return this.professorDao.query(con, id);
111
    }
112
113
    @Post
114
    @Path("/sortFirst")
115
    public void updateSortFirst(@JdbcConn(true) Connection con,String id,Integer sortFirst)throws SQLException {
116
        this.professorDao.updateSortFirst(con, id, sortFirst);
117
    }
118
106 119
    @Get
107 120
    @Path("/pqperson")
108 121
    public PageQueryResult<ProfessorInfo> pageQueryPerson(@JdbcConn Connection con, @LoginUser ConsoleAuthUser cau,@Nullable String orgName, @Nullable String name, @Nullable Integer professorState,@Nullable String bt, @Nullable String et, @DefaultValue("10") int pageSize, @DefaultValue("1") int pageNo) throws SQLException {
@ -123,7 +136,9 @@ public class ProfessorService {
123 136
124 137
    @Post
125 138
    @Path("/check")
126
    public void check(@JdbcConn(true) Connection con, String[] ids,Integer professorState)throws SQLException {
139
    public void check(@JdbcConn(true) Connection con, String[] ids, Integer professorState, Integer authType, Integer authStatusExpert)throws SQLException {
127 140
        this.professorDao.updateProfessorState(con, ids, professorState);
141
        this.professorDao.updateAuthType(con, ids, authType);
142
        this.professorDao.updateAuthStatusExpert(con, ids, authStatusExpert);
128 143
    }
129 144
}