Commit 56a79895604e78ed5455387dfa9ca13519eca502
1 parent
a17b1b68f8
Exists in
master
and in
1 other branch
platform permission
add paging
Showing 3 changed files with 57 additions and 43 deletions
platform-biz-service/src/main/java/com/lyms/platform/permission/model/UsersQuery.java
View file @
56a7989
| 1 | 1 | package com.lyms.platform.permission.model; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | - | |
| 5 | 4 | import com.lyms.platform.common.dao.BaseQuery; |
| 6 | 5 | |
| 7 | 6 | import java.util.Date; |
| 8 | 7 | |
| 9 | 8 | |
| 9 | +public class UsersQuery extends BaseQuery { | |
| 10 | + private Integer id; | |
| 11 | + private Integer logincenterId; | |
| 12 | + private Integer type; | |
| 13 | + private Integer orgId; | |
| 14 | + private Integer deptId; | |
| 15 | + private String name; | |
| 16 | + private String account; | |
| 17 | + private String pwd; | |
| 18 | + private String phone; | |
| 19 | + private Integer publishId; | |
| 20 | + private String publishName; | |
| 21 | + private Integer yn; | |
| 22 | + private Integer enable; | |
| 23 | + private Date modified; | |
| 24 | + private Date created; | |
| 25 | + private String remarks; | |
| 26 | + private Date lastLoginTime; | |
| 27 | + private Integer ksId; | |
| 10 | 28 | |
| 11 | -public class UsersQuery extends BaseQuery {private Integer id;private Integer logincenterId;private Integer type;private Integer orgId;private Integer deptId;private String name;private String account;private String pwd;private String phone;private Integer publishId;private String publishName;private Integer yn;private Integer enable;private Date modified;private Date created;private String remarks;private Date lastLoginTime; | |
| 29 | + public Integer getKsId() { | |
| 30 | + return ksId; | |
| 31 | + } | |
| 12 | 32 | |
| 13 | -public Integer getId() { | |
| 33 | + public void setKsId(Integer ksId) { | |
| 34 | + this.ksId = ksId; | |
| 35 | + } | |
| 36 | + | |
| 37 | + public Integer getId() { | |
| 14 | 38 | return id; |
| 15 | 39 | } |
| 16 | 40 | |
| 17 | 41 | |
| 18 | - | |
| 19 | 42 | public void setId(Integer id) { |
| 20 | 43 | this.id = id; |
| 21 | 44 | |
| 22 | 45 | } |
| 23 | 46 | |
| 24 | -public Integer getLogincenterId() { | |
| 47 | + public Integer getLogincenterId() { | |
| 25 | 48 | return logincenterId; |
| 26 | 49 | } |
| 27 | 50 | |
| 28 | 51 | |
| 29 | - | |
| 30 | 52 | public void setLogincenterId(Integer logincenterId) { |
| 31 | 53 | this.logincenterId = logincenterId; |
| 32 | 54 | |
| 33 | 55 | } |
| 34 | 56 | |
| 35 | -public Integer getType() { | |
| 57 | + public Integer getType() { | |
| 36 | 58 | return type; |
| 37 | 59 | } |
| 38 | 60 | |
| 39 | 61 | |
| 40 | - | |
| 41 | 62 | public void setType(Integer type) { |
| 42 | 63 | this.type = type; |
| 43 | 64 | |
| 44 | 65 | } |
| 45 | 66 | |
| 46 | -public Integer getOrgId() { | |
| 67 | + public Integer getOrgId() { | |
| 47 | 68 | return orgId; |
| 48 | 69 | } |
| 49 | 70 | |
| 50 | 71 | |
| 51 | - | |
| 52 | 72 | public void setOrgId(Integer orgId) { |
| 53 | 73 | this.orgId = orgId; |
| 54 | 74 | |
| 55 | 75 | } |
| 56 | 76 | |
| 57 | -public Integer getDeptId() { | |
| 77 | + public Integer getDeptId() { | |
| 58 | 78 | return deptId; |
| 59 | 79 | } |
| 60 | 80 | |
| 61 | 81 | |
| 62 | - | |
| 63 | 82 | public void setDeptId(Integer deptId) { |
| 64 | 83 | this.deptId = deptId; |
| 65 | 84 | |
| 66 | 85 | } |
| 67 | 86 | |
| 68 | -public String getName() { | |
| 87 | + public String getName() { | |
| 69 | 88 | return name; |
| 70 | 89 | } |
| 71 | 90 | |
| 72 | 91 | |
| 73 | - | |
| 74 | 92 | public void setName(String name) { |
| 75 | 93 | this.name = name; |
| 76 | 94 | |
| 77 | 95 | } |
| 78 | 96 | |
| 79 | -public String getAccount() { | |
| 97 | + public String getAccount() { | |
| 80 | 98 | return account; |
| 81 | 99 | } |
| 82 | 100 | |
| 83 | 101 | |
| 84 | - | |
| 85 | 102 | public void setAccount(String account) { |
| 86 | 103 | this.account = account; |
| 87 | 104 | |
| 88 | 105 | } |
| 89 | 106 | |
| 90 | -public String getPwd() { | |
| 107 | + public String getPwd() { | |
| 91 | 108 | return pwd; |
| 92 | 109 | } |
| 93 | 110 | |
| 94 | 111 | |
| 95 | - | |
| 96 | 112 | public void setPwd(String pwd) { |
| 97 | 113 | this.pwd = pwd; |
| 98 | 114 | |
| 99 | 115 | } |
| 100 | 116 | |
| 101 | -public String getPhone() { | |
| 117 | + public String getPhone() { | |
| 102 | 118 | return phone; |
| 103 | 119 | } |
| 104 | 120 | |
| 105 | 121 | |
| 106 | - | |
| 107 | 122 | public void setPhone(String phone) { |
| 108 | 123 | this.phone = phone; |
| 109 | 124 | |
| 110 | 125 | } |
| 111 | 126 | |
| 112 | -public Integer getPublishId() { | |
| 127 | + public Integer getPublishId() { | |
| 113 | 128 | return publishId; |
| 114 | 129 | } |
| 115 | 130 | |
| 116 | 131 | |
| 117 | - | |
| 118 | 132 | public void setPublishId(Integer publishId) { |
| 119 | 133 | this.publishId = publishId; |
| 120 | 134 | |
| 121 | 135 | } |
| 122 | 136 | |
| 123 | -public String getPublishName() { | |
| 137 | + public String getPublishName() { | |
| 124 | 138 | return publishName; |
| 125 | 139 | } |
| 126 | 140 | |
| 127 | 141 | |
| 128 | - | |
| 129 | 142 | public void setPublishName(String publishName) { |
| 130 | 143 | this.publishName = publishName; |
| 131 | 144 | |
| 132 | 145 | } |
| 133 | 146 | |
| 134 | -public Integer getYn() { | |
| 147 | + public Integer getYn() { | |
| 135 | 148 | return yn; |
| 136 | 149 | } |
| 137 | 150 | |
| 138 | 151 | |
| 139 | - | |
| 140 | 152 | public void setYn(Integer yn) { |
| 141 | 153 | this.yn = yn; |
| 142 | 154 | |
| 143 | 155 | } |
| 144 | 156 | |
| 145 | -public Integer getEnable() { | |
| 157 | + public Integer getEnable() { | |
| 146 | 158 | return enable; |
| 147 | 159 | } |
| 148 | 160 | |
| 149 | 161 | |
| 150 | - | |
| 151 | 162 | public void setEnable(Integer enable) { |
| 152 | 163 | this.enable = enable; |
| 153 | 164 | |
| 154 | 165 | } |
| 155 | 166 | |
| 156 | -public Date getModified() { | |
| 167 | + public Date getModified() { | |
| 157 | 168 | return modified; |
| 158 | 169 | } |
| 159 | 170 | |
| 160 | 171 | |
| 161 | - | |
| 162 | 172 | public void setModified(Date modified) { |
| 163 | 173 | this.modified = modified; |
| 164 | 174 | |
| 165 | 175 | } |
| 166 | 176 | |
| 167 | -public Date getCreated() { | |
| 177 | + public Date getCreated() { | |
| 168 | 178 | return created; |
| 169 | 179 | } |
| 170 | 180 | |
| 171 | 181 | |
| 172 | - | |
| 173 | 182 | public void setCreated(Date created) { |
| 174 | 183 | this.created = created; |
| 175 | 184 | |
| 176 | 185 | } |
| 177 | 186 | |
| 178 | -public String getRemarks() { | |
| 187 | + public String getRemarks() { | |
| 179 | 188 | return remarks; |
| 180 | 189 | } |
| 181 | 190 | |
| 182 | 191 | |
| 183 | - | |
| 184 | 192 | public void setRemarks(String remarks) { |
| 185 | 193 | this.remarks = remarks; |
| 186 | 194 | |
| 187 | 195 | } |
| 188 | 196 | |
| 189 | -public Date getLastLoginTime() { | |
| 197 | + public Date getLastLoginTime() { | |
| 190 | 198 | return lastLoginTime; |
| 191 | 199 | } |
| 192 | - | |
| 193 | 200 | |
| 194 | 201 | |
| 195 | 202 | public void setLastLoginTime(Date lastLoginTime) { |
platform-biz-service/src/main/resources/mainOrm/Users.xml
View file @
56a7989
| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | <result column="type" property="type" jdbcType="INTEGER" /> |
| 9 | 9 | <result column="org_id" property="orgId" jdbcType="INTEGER" /> |
| 10 | 10 | <result column="dept_id" property="deptId" jdbcType="INTEGER" /> |
| 11 | + <result column="ks_id" property="ksId" jdbcType="INTEGER" /> | |
| 11 | 12 | <result column="name" property="name" jdbcType="VARCHAR" /> |
| 12 | 13 | <result column="account" property="account" jdbcType="VARCHAR" /> |
| 13 | 14 | <result column="pwd" property="pwd" jdbcType="VARCHAR" /> |
| ... | ... | @@ -25,7 +26,7 @@ |
| 25 | 26 | |
| 26 | 27 | |
| 27 | 28 | <insert id="addUsers" parameterType="com.lyms.platform.permission.model.Users"> |
| 28 | -insert into users (logincenter_id,type,org_id,dept_id,name,account,pwd,phone,publish_id,publish_name,yn,enable,modified,created,remarks,last_login_time) values (#{logincenterId},#{type},#{orgId},#{deptId},#{name},#{account},#{pwd},#{phone},#{publishId},#{publishName},#{yn},#{enable},#{modified},#{created},#{remarks},#{lastLoginTime}) | |
| 29 | +insert into users (logincenter_id,type,org_id,dept_id,name,account,pwd,phone,publish_id,publish_name,yn,enable,modified,created,remarks,last_login_time,ks_id) values (#{logincenterId},#{type},#{orgId},#{deptId},#{name},#{account},#{pwd},#{phone},#{publishId},#{publishName},#{yn},#{enable},#{modified},#{created},#{remarks},#{lastLoginTime},#{ksId}) | |
| 29 | 30 | </insert> |
| 30 | 31 | |
| 31 | 32 | |
| ... | ... | @@ -43,6 +44,9 @@ |
| 43 | 44 | <if test="deptId != null and deptId >= 0"> |
| 44 | 45 | dept_id = #{deptId,jdbcType=INTEGER}, |
| 45 | 46 | </if> |
| 47 | + <if test="ksId != null and ksId >= 0"> | |
| 48 | + ks_id = #{ksId,jdbcType=INTEGER}, | |
| 49 | + </if> | |
| 46 | 50 | <if test="name != null and name != ''"> |
| 47 | 51 | name = #{name,jdbcType=VARCHAR}, |
| 48 | 52 | </if> |
| 49 | 53 | |
| ... | ... | @@ -91,12 +95,12 @@ |
| 91 | 95 | |
| 92 | 96 | |
| 93 | 97 | <select id="getUsers" resultMap="UsersResultMap" parameterType="java.lang.Integer"> |
| 94 | -select id,logincenter_id,type,org_id,dept_id,name,account,pwd,phone,publish_id,publish_name,yn,enable,modified,created,remarks,last_login_time | |
| 98 | +select id,logincenter_id,type,org_id,dept_id,name,account,pwd,phone,publish_id,publish_name,yn,enable,modified,created,remarks,last_login_time, ks_id | |
| 95 | 99 | from users where id = #{id,jdbcType=INTEGER} |
| 96 | 100 | </select> |
| 97 | 101 | |
| 98 | 102 | <select id="getUsersByLoginCenterId" resultMap="UsersResultMap" parameterType="java.lang.Integer"> |
| 99 | - select id,logincenter_id,type,org_id,dept_id,name,account,pwd,phone,publish_id,publish_name,yn,enable,modified,created,remarks,last_login_time | |
| 103 | + select id,logincenter_id,type,org_id,dept_id,name,account,pwd,phone,publish_id,publish_name,yn,enable,modified,created,remarks,last_login_time, ks_id | |
| 100 | 104 | from users where logincenter_id = #{id,jdbcType=INTEGER} |
| 101 | 105 | </select> |
| 102 | 106 | |
| 103 | 107 | |
| ... | ... | @@ -128,8 +132,11 @@ |
| 128 | 132 | and org_id = #{orgId,jdbcType=INTEGER} |
| 129 | 133 | </if> |
| 130 | 134 | <if test="deptId != null and deptId >= 0"> |
| 131 | -and dept_id = #{deptId,jdbcType=INTEGER} | |
| 135 | + and dept_id = #{deptId,jdbcType=INTEGER} | |
| 132 | 136 | </if> |
| 137 | + <if test="ksId != null and ksId >= 0"> | |
| 138 | + and ks_id = #{ksId,jdbcType=INTEGER} | |
| 139 | + </if> | |
| 133 | 140 | <if test="name != null and name != ''"> |
| 134 | 141 | and name = #{name,jdbcType=VARCHAR} |
| 135 | 142 | </if> |
| ... | ... | @@ -172,7 +179,7 @@ |
| 172 | 179 | |
| 173 | 180 | |
| 174 | 181 | <select id="queryUsers" resultMap="UsersResultMap" parameterType="com.lyms.platform.permission.model.UsersQuery"> |
| 175 | -select id,logincenter_id,type,org_id,dept_id,name,account,pwd,phone,publish_id,publish_name,yn,enable,modified,created,remarks,last_login_time | |
| 182 | +select id,logincenter_id,type,org_id,dept_id,name,account,pwd,phone,publish_id,publish_name,yn,enable,modified,created,remarks,last_login_time, ks_id | |
| 176 | 183 | from users |
| 177 | 184 | <include refid="UsersCondition" /> |
| 178 | 185 | <include refid="orderAndLimit" /> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java
View file @
56a7989
| ... | ... | @@ -98,8 +98,8 @@ |
| 98 | 98 | * 获取用户列表 |
| 99 | 99 | */ |
| 100 | 100 | @RequestMapping(value = "/users", method = RequestMethod.GET) |
| 101 | - @ResponseBody | |
| 102 | 101 | @TokenRequired |
| 102 | + @ResponseBody | |
| 103 | 103 | public void getPermissions(HttpServletResponse response, |
| 104 | 104 | @RequestParam(value = "keyword", required = false) String keyword, |
| 105 | 105 | @RequestParam(value = "rolesId", required = false) Integer rolesId, |
| ... | ... | @@ -461,7 +461,7 @@ |
| 461 | 461 | |
| 462 | 462 | Departments departments = departmentsService.getDepartments(deptId); |
| 463 | 463 | |
| 464 | - if ( StringUtils.isBlank(roleIds) || StringUtils.isBlank(name) || StringUtils.isBlank(phone) || null == user || null == departments ) { | |
| 464 | + if ( StringUtils.isBlank(roleIds) || StringUtils.isBlank(phone) || null == user || null == departments ) { | |
| 465 | 465 | ResultUtils.buildParameterErrorResultAndWrite(response); |
| 466 | 466 | return; |
| 467 | 467 | } |