新增公司

This commit is contained in:
sxu 2025-01-05 12:13:36 +08:00
parent 66cf195033
commit 8c6494baef
3 changed files with 4 additions and 2 deletions

View File

@ -70,6 +70,7 @@ public class SysDeptController extends BaseController
List<SysDept> deptList = new ArrayList<>();
try{
startPage();
dept.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
deptList = deptService.getDeptList(dept);
return getDataTable(deptList);
}catch (Exception e){

View File

@ -301,7 +301,6 @@ public class SysDeptServiceImpl implements ISysDeptService
dept.setAncestors("0");
dept.setStatus("0");//默认启用
dept.setMenuTemplateId(1L);//TODO 将来用前端传的模版ID
//dept.setInitPassword(dept.getSysUser().getPassword());
int result = deptMapper.insertDept(dept);
if (systemConfig.isAddRootCompany() && result > 0) {
if (StringUtils.isNotNull(dept.getSysUser()) && !userService.checkUserNameUnique(dept.getSysUser())) {
@ -507,7 +506,6 @@ public class SysDeptServiceImpl implements ISysDeptService
private void updateCompanyAdminUserAndRole(SysDept dept) {
SysUser oldCompanyAdmin = deptMapper.selectCompanyAdminByDept(dept.getDeptId());
SysUser user = dept.getSysUser();
user.setPassword(SecurityUtils.encryptPassword(dept.getInitPassword()));
user.setUpdateBy(SecurityUtils.getUsername());
user.setUpdateTime(DateUtils.getNowDate());
user.setDeptId(dept.getDeptId());

View File

@ -81,6 +81,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getDeptList" resultType="com.bonus.system.api.domain.SysDept">
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 != ''">
and sd.dept_name like concat('%', #{keyWord}, '%')
</if>