Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop

This commit is contained in:
duandongmei
2018-08-08 13:51:21 +08:00
10 changed files with 28 additions and 63 deletions

View File

@@ -173,7 +173,7 @@ public class RoleController extends BaseController {
public String checkName(String oldName, String name) {
if (name!=null && name.equals(oldName)) {
return "true";
} else if (name!=null && roleService.getRoleByName(name) == null) {
} else if (name!=null && roleService.getAllRoleByName(name) == null) {
return "true";
}
return "false";

View File

@@ -148,7 +148,7 @@ public class UserController extends BaseController{
public String checkLoginName(String oldLoginId, String loginId) {
if (loginId !=null && loginId.equals(oldLoginId)) {
return "true";
} else if (loginId !=null && systemService.getUserByLoginName(loginId) == null) {
} else if (loginId !=null && userService.getUserByLoginName(loginId) == null) {
return "true";
}
return "false";

View File

@@ -14,5 +14,7 @@ public interface SysRoleDao extends CrudDao<SysRole>{
void deleteRoleMenu(SysRole role);
List<SysUser> findUserByRole(SysRole role);
SysRole getAllRoleByName(SysRole r);
}

View File

@@ -36,6 +36,13 @@
FROM sys_role r
WHERE r.name = #{name} AND r.status = #{DEL_FLAG_NORMAL}
</select>
<!-- 新增时存在的无效名角色 校验也不可添加 -->
<select id="getAllRoleByName" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM sys_role r
WHERE r.name = #{name}
</select>
<select id="findAllList" resultMap="BaseResultMap">

View File

@@ -32,7 +32,13 @@ public class RoleService extends BaseService {
r.setName(name);
return roleDao.getByName(r);
}
//获取所有状态角色
public SysRole getAllRoleByName(String name) {
SysRole r = new SysRole();
r.setName(name);
return roleDao.getAllRoleByName(r);
}
public void saveOrUpdate(SysRole role) {
if (StringUtil.isEmpty(role.getId())){

View File

@@ -298,9 +298,8 @@ window.onresize=function(){
<li><a href="${ctx}/sys/user/info" target="mainFrame"><i class="icon-user"></i>&nbsp; <spring:message code="userInfo"></spring:message></a></li>
<li><a href="${ctx}/sys/user/modifyPwd" target="mainFrame"><i class="icon-lock"></i>&nbsp; <spring:message code="updatePwd"></spring:message></a></li>
<li><a href="${pageContext.request.contextPath }/logout"
title="退出登录"><i class="icon-key"></i> <spring:message
code="exit"></spring:message></a></li>
<li><a href="${pageContext.request.contextPath }/logout" >
<i class="icon-key"></i> <spring:message code="exit"></spring:message></a></li>
</ul></li>
<!-- END USER LOGIN DROPDOWN -->

View File

@@ -311,7 +311,7 @@
<li class="divider"></li>
<shiro:hasPermission name="sys:dict:edit">
<li><a href="${ctx}/sys/dict/form?id=${dict.id}" onclick="return confirmx('<spring:message code="dict_edit_info"/>', this.href)"><i class="icon-edit"></i> <spring:message code="edit"/></a></li>
<li><a href="${ctx}/sys/dict/form?id=${dict.id}" onclick="return confirmx('<spring:message code="dict_edit_info"/>', this.href)"><i class="fa fa-edit"></i> <spring:message code="edit"/></a></li>
<li class="divider"></li>
</shiro:hasPermission>
<shiro:hasPermission name="sys:dict:edit">

View File

@@ -71,20 +71,20 @@
class="required form-control" readonly="true" />
</div>
</div>
<div class="form-group">
<div class="form-group" hidden="hidden">
<label class="col-md-3 control-label"><spring:message code="mail"/>:</label>
<div class="col-md-4">
<form:input path="email" htmlEscape="false" maxlength="50"
<form:input path="email" htmlEscape="false" value="0" maxlength="50"
class="email form-control" />
</div>
</div>
<%--
<div class="form-group">
<label class="col-md-3 control-label"><spring:message code="department"/>:</label>
<div class="col-md-4">
<label class="lbl control-label">${user.office.name}</label>
</div>
</div>
</div> --%>
<div class="form-group">
@@ -101,6 +101,7 @@
<button id="btnSubmit" type="submit" class="btn btn-primary">
<spring:message code="submit"></spring:message>
</button>
<button type="button" class="btn btn-default" onclick="history.go(-1)"><spring:message code="cancel"/></button>
</div>
</div>
</div>

View File

@@ -54,15 +54,6 @@
</form>
</div>
<!-- <ul class="nav nav-tabs"> -->
<%-- <li class="active"><a href="${ctx}/sys/user/list">用户列表</a></li> --%>
<%-- <shiro:hasPermission name="sys:user:edit"></shiro:hasPermission> --%>
<%-- <li><a href="${ctx}/sys/user/form">用户添加</a></li> --%>
<!-- </ul> -->
<shiro:hasPermission name="sys:user:edit">
<div class="theme-panel hidden-xs hidden-sm">
<button type="button" class="btn btn-primary"
@@ -95,43 +86,13 @@
<div class="col-md-12 filter-action-select-panle"
style="background-color: transparent">
<div class="row">
<%-- <div class="col-md-2">
<div class="form-group">
<label><spring:message code="owner_company"/></label>
<sys:treeselect id="company" name="company.id"
value="${user.company.id}" labelName="company.name"
labelValue="${user.company.name}" title="company"
url="/sys/office/treeData?type=1" cssClass="form-control"
allowClear="true"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="owner_group"/></label>
<sys:treeselect id="office" name="office.id" value="${user.office.id}" labelName="office.name"
labelValue="${user.office.name}" title="group"
url="/sys/office/treeData?type=3" cssClass="form-control" allowClear="true"
notAllowSelectParent="true"/>
</div>
</div> --%>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="login_name"></spring:message></label>
<form:input path="loginId" htmlEscape="false" maxlength="50"
class="form-control" />
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="name"></spring:message></label>
@@ -147,19 +108,11 @@
<i class="fa fa-search"></i>
<spring:message code="search" />
</button>
</div>
</div>
</div>
</div>
</form:form>
</div>
</div>
<sys:message content="${message}" />
@@ -183,18 +136,14 @@
<tbody>
<c:forEach items="${page.list}" var="user">
<tr>
<%-- <td>${user.company.name}</td>
<td>${fns:getOfficeDesc(user.office.id)}</td> --%>
<td><a href="${ctx}/sys/user/form?id=${user.id}">${user.loginId}</a></td>
<td>${user.name}</td>
<%-- <td>${user.identity eq 1 ?'管理人员':'普通人员'}</td> --%>
<%-- <td>${user.email}</td> --%>
<td><fmt:formatDate value="${user.createTime}"
pattern="yyyy-MM-dd HH:mm:ss" /></td>
<shiro:hasPermission name="sys:user:edit"></shiro:hasPermission>
<td><a href="${ctx}/sys/user/form?id=${user.id}"><spring:message code="edit" /></a> <a
href="${ctx}/sys/user/delete?id=${user.id}"
onclick="return confirmx('确认要删除该用户吗?', this.href)"><spring:message code="delete" /></a></td>
onclick="return confirmx('<spring:message code="sure_delete"/>', this.href)"><spring:message code="delete" /></a></td>
</tr>
</c:forEach>
</tbody>

View File

@@ -76,6 +76,7 @@
<button id="btnSubmit" type="submit" class="btn btn-primary">
<spring:message code="submit"></spring:message>
</button>
<button type="button" class="btn btn-default" onclick="history.go(-1)"><spring:message code="cancel"/></button>
</div>
</div>
</div>