Commit f19dae16 authored by lizhichao's avatar lizhichao

所属企业 改为string;deptid 改为String

parent 485129a4
......@@ -49,14 +49,14 @@ public class SysDeptController extends BaseController
* 查询部门列表(排除节点)
*/
@GetMapping("/list/exclude/{deptId}")
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) String deptId)
{
List<SysDept> depts = deptService.selectDeptList(new SysDept());
Iterator<SysDept> it = depts.iterator();
while (it.hasNext())
{
SysDept d = (SysDept) it.next();
if (d.getDeptId().intValue() == deptId
if (d.getDeptId() == deptId
|| ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""))
{
it.remove();
......@@ -69,7 +69,7 @@ public class SysDeptController extends BaseController
* 根据部门编号获取详细信息
*/
@GetMapping(value = "/{deptId}")
public AjaxResult getInfo(@PathVariable Long deptId)
public AjaxResult getInfo(@PathVariable String deptId)
{
return AjaxResult.success(deptService.selectDeptById(deptId));
}
......@@ -128,7 +128,7 @@ public class SysDeptController extends BaseController
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
}
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())
&& deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0)
&& deptService.selectNormalChildrenDeptById(dept.getDeptId()) != "0")
{
return AjaxResult.error("该部门包含未停用的子部门!");
}
......@@ -141,7 +141,7 @@ public class SysDeptController extends BaseController
*/
@Log(title = "部门管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{deptId}")
public AjaxResult remove(@PathVariable Long deptId)
public AjaxResult remove(@PathVariable String deptId)
{
if (deptService.hasChildByDeptId(deptId))
{
......
......@@ -17,7 +17,7 @@ public class TreeSelect implements Serializable
private static final long serialVersionUID = 1L;
/** 节点ID */
private Long id;
private String id;
/** 节点名称 */
private String label;
......@@ -40,17 +40,17 @@ public class TreeSelect implements Serializable
public TreeSelect(SysMenu menu)
{
this.id = menu.getMenuId();
this.id = menu.getMenuId().toString();
this.label = menu.getMenuName();
this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
}
public Long getId()
public String getId()
{
return id;
}
public void setId(Long id)
public void setId(String id)
{
this.id = id;
}
......
......@@ -19,10 +19,10 @@ public class SysDept extends BaseEntity
private static final long serialVersionUID = 1L;
/** 部门ID */
private Long deptId;
private String deptId;
/** 父部门ID */
private Long parentId;
private String parentId;
/** 祖级列表 */
private String ancestors;
......@@ -54,22 +54,22 @@ public class SysDept extends BaseEntity
/** 子部门 */
private List<SysDept> children = new ArrayList<SysDept>();
public Long getDeptId()
public String getDeptId()
{
return deptId;
}
public void setDeptId(Long deptId)
public void setDeptId(String deptId)
{
this.deptId = deptId;
}
public Long getParentId()
public String getParentId()
{
return parentId;
}
public void setParentId(Long parentId)
public void setParentId(String parentId)
{
this.parentId = parentId;
}
......
......@@ -57,7 +57,7 @@ public class SysRole extends BaseEntity
private Long[] menuIds;
/** 部门组(数据权限) */
private Long[] deptIds;
private String[] deptIds;
public SysRole()
{
......@@ -194,12 +194,12 @@ public class SysRole extends BaseEntity
this.menuIds = menuIds;
}
public Long[] getDeptIds()
public String[] getDeptIds()
{
return deptIds;
}
public void setDeptIds(Long[] deptIds)
public void setDeptIds(String[] deptIds)
{
this.deptIds = deptIds;
}
......
......@@ -94,7 +94,7 @@ public class SysUser extends BaseEntity
private Long[] roleIds;
/** 岗位组 */
private Long[] postIds;
private String[] postIds;
private String enterpriseId;
......@@ -304,12 +304,12 @@ public class SysUser extends BaseEntity
this.roleIds = roleIds;
}
public Long[] getPostIds()
public String[] getPostIds()
{
return postIds;
}
public void setPostIds(Long[] postIds)
public void setPostIds(String[] postIds)
{
this.postIds = postIds;
}
......
......@@ -14,7 +14,7 @@ public class SysRoleDept
private Long roleId;
/** 部门ID */
private Long deptId;
private String deptId;
public Long getRoleId()
{
......@@ -26,12 +26,12 @@ public class SysRoleDept
this.roleId = roleId;
}
public Long getDeptId()
public String getDeptId()
{
return deptId;
}
public void setDeptId(Long deptId)
public void setDeptId(String deptId)
{
this.deptId = deptId;
}
......
......@@ -14,7 +14,7 @@ public class SysUserPost
private Long userId;
/** 岗位ID */
private Long postId;
private String postId;
public Long getUserId()
{
......@@ -26,12 +26,12 @@ public class SysUserPost
this.userId = userId;
}
public Long getPostId()
public String getPostId()
{
return postId;
}
public void setPostId(Long postId)
public void setPostId(String postId)
{
this.postId = postId;
}
......
......@@ -34,7 +34,7 @@ public interface SysDeptMapper
* @param deptId 部门ID
* @return 部门信息
*/
public SysDept selectDeptById(Long deptId);
public SysDept selectDeptById(String deptId);
/**
* 根据ID查询所有子部门
......@@ -42,7 +42,7 @@ public interface SysDeptMapper
* @param deptId 部门ID
* @return 部门列表
*/
public List<SysDept> selectChildrenDeptById(Long deptId);
public List<SysDept> selectChildrenDeptById(String deptId);
/**
* 根据ID查询所有子部门(正常状态)
......@@ -50,7 +50,7 @@ public interface SysDeptMapper
* @param deptId 部门ID
* @return 子部门数
*/
public int selectNormalChildrenDeptById(Long deptId);
public String selectNormalChildrenDeptById(String deptId);
/**
* 是否存在子节点
......@@ -58,7 +58,7 @@ public interface SysDeptMapper
* @param deptId 部门ID
* @return 结果
*/
public int hasChildByDeptId(Long deptId);
public int hasChildByDeptId(String deptId);
/**
* 查询部门是否存在用户
......@@ -66,7 +66,7 @@ public interface SysDeptMapper
* @param deptId 部门ID
* @return 结果
*/
public int checkDeptExistUser(Long deptId);
public int checkDeptExistUser(String deptId);
/**
* 校验部门名称是否唯一
......@@ -75,7 +75,7 @@ public interface SysDeptMapper
* @param parentId 父部门ID
* @return 结果
*/
public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") String parentId);
/**
* 新增部门信息
......@@ -114,5 +114,5 @@ public interface SysDeptMapper
* @param deptId 部门ID
* @return 结果
*/
public int deleteDeptById(Long deptId);
public int deleteDeptById(String deptId);
}
......@@ -32,7 +32,7 @@ public interface SysRoleDeptMapper
* @param deptId 部门ID
* @return 结果
*/
public int selectCountRoleDeptByDeptId(Long deptId);
public int selectCountRoleDeptByDeptId(String deptId);
/**
* 批量新增角色部门信息
......
......@@ -49,7 +49,7 @@ public interface ISysDeptService
* @param deptId 部门ID
* @return 部门信息
*/
public SysDept selectDeptById(Long deptId);
public SysDept selectDeptById(String deptId);
/**
* 根据ID查询所有子部门(正常状态)
......@@ -57,7 +57,7 @@ public interface ISysDeptService
* @param deptId 部门ID
* @return 子部门数
*/
public int selectNormalChildrenDeptById(Long deptId);
public String selectNormalChildrenDeptById(String deptId);
/**
* 是否存在部门子节点
......@@ -65,7 +65,7 @@ public interface ISysDeptService
* @param deptId 部门ID
* @return 结果
*/
public boolean hasChildByDeptId(Long deptId);
public boolean hasChildByDeptId(String deptId);
/**
* 查询部门是否存在用户
......@@ -73,7 +73,7 @@ public interface ISysDeptService
* @param deptId 部门ID
* @return 结果 true 存在 false 不存在
*/
public boolean checkDeptExistUser(Long deptId);
public boolean checkDeptExistUser(String deptId);
/**
* 校验部门名称是否唯一
......@@ -105,5 +105,5 @@ public interface ISysDeptService
* @param deptId 部门ID
* @return 结果
*/
public int deleteDeptById(Long deptId);
public int deleteDeptById(String deptId);
}
......@@ -54,7 +54,7 @@ public class SysDeptServiceImpl implements ISysDeptService
public List<SysDept> buildDeptTree(List<SysDept> depts)
{
List<SysDept> returnList = new ArrayList<SysDept>();
List<Long> tempList = new ArrayList<Long>();
List<String> tempList = new ArrayList<String>();
for (SysDept dept : depts)
{
tempList.add(dept.getDeptId());
......@@ -109,7 +109,7 @@ public class SysDeptServiceImpl implements ISysDeptService
* @return 部门信息
*/
@Override
public SysDept selectDeptById(Long deptId)
public SysDept selectDeptById(String deptId)
{
return deptMapper.selectDeptById(deptId);
}
......@@ -121,7 +121,7 @@ public class SysDeptServiceImpl implements ISysDeptService
* @return 子部门数
*/
@Override
public int selectNormalChildrenDeptById(Long deptId)
public String selectNormalChildrenDeptById(String deptId)
{
return deptMapper.selectNormalChildrenDeptById(deptId);
}
......@@ -133,7 +133,7 @@ public class SysDeptServiceImpl implements ISysDeptService
* @return 结果
*/
@Override
public boolean hasChildByDeptId(Long deptId)
public boolean hasChildByDeptId(String deptId)
{
int result = deptMapper.hasChildByDeptId(deptId);
return result > 0 ? true : false;
......@@ -146,7 +146,7 @@ public class SysDeptServiceImpl implements ISysDeptService
* @return 结果 true 存在 false 不存在
*/
@Override
public boolean checkDeptExistUser(Long deptId)
public boolean checkDeptExistUser(String deptId)
{
int result = deptMapper.checkDeptExistUser(deptId);
return result > 0 ? true : false;
......@@ -161,9 +161,9 @@ public class SysDeptServiceImpl implements ISysDeptService
@Override
public String checkDeptNameUnique(SysDept dept)
{
Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId();
String deptId = StringUtils.isNull(dept.getDeptId()) ? "-1" : dept.getDeptId();
SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId());
if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue())
if (StringUtils.isNotNull(info) && !info.getDeptId().equals( deptId))
{
return UserConstants.NOT_UNIQUE;
}
......@@ -236,7 +236,7 @@ public class SysDeptServiceImpl implements ISysDeptService
* @param newAncestors 新的父ID集合
* @param oldAncestors 旧的父ID集合
*/
public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors)
public void updateDeptChildren(String deptId, String newAncestors, String oldAncestors)
{
List<SysDept> children = deptMapper.selectChildrenDeptById(deptId);
for (SysDept child : children)
......@@ -256,7 +256,7 @@ public class SysDeptServiceImpl implements ISysDeptService
* @return 结果
*/
@Override
public int deleteDeptById(Long deptId)
public int deleteDeptById(String deptId)
{
return deptMapper.deleteDeptById(deptId);
}
......@@ -288,7 +288,7 @@ public class SysDeptServiceImpl implements ISysDeptService
while (it.hasNext())
{
SysDept n = (SysDept) it.next();
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue())
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId() == t.getDeptId())
{
tlist.add(n);
}
......
......@@ -269,7 +269,7 @@ public class SysRoleServiceImpl implements ISysRoleService
int rows = 1;
// 新增角色与部门(数据权限)管理
List<SysRoleDept> list = new ArrayList<SysRoleDept>();
for (Long deptId : role.getDeptIds())
for (String deptId : role.getDeptIds())
{
SysRoleDept rd = new SysRoleDept();
rd.setRoleId(role.getRoleId());
......
......@@ -351,12 +351,12 @@ public class SysUserServiceImpl implements ISysUserService
*/
public void insertUserPost(SysUser user)
{
Long[] posts = user.getPostIds();
String[] posts = user.getPostIds();
if (StringUtils.isNotNull(posts))
{
// 新增用户与岗位管理
List<SysUserPost> list = new ArrayList<SysUserPost>();
for (Long postId : posts)
for (String postId : posts)
{
SysUserPost up = new SysUserPost();
up.setUserId(user.getUserId());
......
......@@ -204,7 +204,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN sys_user_post up ON u.user_id = up.user_id
LEFT JOIN sys_post p ON up.post_id = p.post_id
<where>
<if test="enterpriseId != null and enterpriseId != 0">
<if test="enterpriseId != null">
AND u.dept_id = #{enterpriseId}
</if>
<if test="postCode !=null and postCode != ''">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment