新增公司
This commit is contained in:
parent
66cf195033
commit
8c6494baef
|
|
@ -70,6 +70,7 @@ public class SysDeptController extends BaseController
|
||||||
List<SysDept> deptList = new ArrayList<>();
|
List<SysDept> deptList = new ArrayList<>();
|
||||||
try{
|
try{
|
||||||
startPage();
|
startPage();
|
||||||
|
dept.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||||
deptList = deptService.getDeptList(dept);
|
deptList = deptService.getDeptList(dept);
|
||||||
return getDataTable(deptList);
|
return getDataTable(deptList);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
|
|
||||||
|
|
@ -301,7 +301,6 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||||
dept.setAncestors("0");
|
dept.setAncestors("0");
|
||||||
dept.setStatus("0");//默认启用
|
dept.setStatus("0");//默认启用
|
||||||
dept.setMenuTemplateId(1L);//TODO 将来用前端传的模版ID
|
dept.setMenuTemplateId(1L);//TODO 将来用前端传的模版ID
|
||||||
//dept.setInitPassword(dept.getSysUser().getPassword());
|
|
||||||
int result = deptMapper.insertDept(dept);
|
int result = deptMapper.insertDept(dept);
|
||||||
if (systemConfig.isAddRootCompany() && result > 0) {
|
if (systemConfig.isAddRootCompany() && result > 0) {
|
||||||
if (StringUtils.isNotNull(dept.getSysUser()) && !userService.checkUserNameUnique(dept.getSysUser())) {
|
if (StringUtils.isNotNull(dept.getSysUser()) && !userService.checkUserNameUnique(dept.getSysUser())) {
|
||||||
|
|
@ -507,7 +506,6 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||||
private void updateCompanyAdminUserAndRole(SysDept dept) {
|
private void updateCompanyAdminUserAndRole(SysDept dept) {
|
||||||
SysUser oldCompanyAdmin = deptMapper.selectCompanyAdminByDept(dept.getDeptId());
|
SysUser oldCompanyAdmin = deptMapper.selectCompanyAdminByDept(dept.getDeptId());
|
||||||
SysUser user = dept.getSysUser();
|
SysUser user = dept.getSysUser();
|
||||||
user.setPassword(SecurityUtils.encryptPassword(dept.getInitPassword()));
|
|
||||||
user.setUpdateBy(SecurityUtils.getUsername());
|
user.setUpdateBy(SecurityUtils.getUsername());
|
||||||
user.setUpdateTime(DateUtils.getNowDate());
|
user.setUpdateTime(DateUtils.getNowDate());
|
||||||
user.setDeptId(dept.getDeptId());
|
user.setDeptId(dept.getDeptId());
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="getDeptList" resultType="com.bonus.system.api.domain.SysDept">
|
<select id="getDeptList" resultType="com.bonus.system.api.domain.SysDept">
|
||||||
select * from sys_dept sd where parent_id='0' and del_flag='0'
|
select * from sys_dept sd where parent_id='0' and del_flag='0'
|
||||||
|
<if test="companyId != null and companyId != 0">
|
||||||
|
AND dept_id != #{companyId}
|
||||||
|
</if>
|
||||||
<if test="keyWord != null and keyWord != ''">
|
<if test="keyWord != null and keyWord != ''">
|
||||||
and sd.dept_name like concat('%', #{keyWord}, '%')
|
and sd.dept_name like concat('%', #{keyWord}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue