XMTT 6 years ago
parent
commit
5013bf188a

+ 13 - 6
src/main/java/com/ekexiu/project/platform/system/service/SysService.java

@ -17,6 +17,7 @@ import org.jfw.apt.web.annotation.method.SetSession;
17 17
import org.jfw.apt.web.annotation.operate.Get;
18 18
import org.jfw.apt.web.annotation.operate.Post;
19 19
import org.jfw.apt.web.annotation.operate.Put;
20
import org.jfw.apt.web.annotation.param.FieldParam;
20 21
import org.jfw.apt.web.annotation.param.JdbcConn;
21 22
import org.jfw.apt.web.annotation.param.PathVar;
22 23
import org.jfw.apt.web.annotation.param.RequestBody;
@ -91,15 +92,21 @@ public class SysService {
91 92
    @Post
92 93
    @Path("/manager/changepasswd")
93 94
    public int changeManagerPasswd(@JdbcConn(true) Connection con, @LoginUser SessionManager loginUser, String npw) throws SQLException {
94
        return userDao.changeManagerPasswd(con, loginUser.getId(),StringUtil.md5(npw));
95
        return userDao.changeManagerPasswd(con, loginUser.getId(), StringUtil.md5(npw));
95 96
    }
96 97
97 98
    @Put
98 99
    @Path("/manager")
99
    public void modifyManager(@JdbcConn(true) Connection con, @LoginUser SessionManager loginUser,
100
                              @RequestParam(excludeFields = {"id", "createTime", "modifyTime", "passwd", "active"}) Manager user) throws SQLException {
100
    public int modifyManager(@JdbcConn(true) Connection con, @LoginUser SessionManager loginUser,
101
                             @RequestParam(fields = {@FieldParam(value = "id", valueClass = String.class),
102
                                     @FieldParam(value = "account", valueClass = String.class),
103
                                     @FieldParam(value = "name", valueClass = String.class),
104
                                     @FieldParam(value = "phone", valueClass = String.class),
105
                                     @FieldParam(value = "email", valueClass = String.class),
106
                                     @FieldParam(value = "job", valueClass = String.class),
107
                                     @FieldParam(value = "comp", valueClass = String.class)}, excludeFields = {"id", "createTime", "modifyTime", "passwd", "actived"}) Manager user) throws SQLException {
101 108
        user.setModifier(loginUser.getId());
102
        userDao.update(con, user);
109
        return userDao.update(con, user);
103 110
    }
104 111
105 112
    @Get
@ -124,8 +131,8 @@ public class SysService {
124 131
125 132
    @Get
126 133
    @Path("/pq")
127
    public PageQueryResult<SessionManager> managerPageQuery(@JdbcConn Connection con,@LoginUser SessionManager user, boolean actived, int pageSize, int pageNo) throws SQLException {
128
        PageQueryResult<ManagerInfo> pageQueryResult = userDao.managerPageQuery(con,user.getId(), actived, pageSize, pageNo);
134
    public PageQueryResult<SessionManager> managerPageQuery(@JdbcConn Connection con, @LoginUser SessionManager user, boolean actived, int pageSize, int pageNo) throws SQLException {
135
        PageQueryResult<ManagerInfo> pageQueryResult = userDao.managerPageQuery(con, user.getId(), actived, pageSize, pageNo);
129 136
        List<ManagerInfo> managers = pageQueryResult.getData();
130 137
        List<SessionManager> sessionManagers = new ArrayList<>();
131 138
        if (!managers.isEmpty()) {