| | |
| | | import com.ruoyi.system.mapper.sys.SysDeptMapper; |
| | | import com.ruoyi.system.mapper.sys.SysDeptMenuMapper; |
| | | import com.ruoyi.system.mapper.sys.SysRoleMapper; |
| | | import com.ruoyi.system.service.staff.SysWxCpService; |
| | | import com.ruoyi.system.service.sys.ISysDeptService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Autowired |
| | | private SysDeptMenuMapper deptMenuMapper; |
| | | |
| | | @Autowired |
| | | private SysWxCpService sysWxCpService; |
| | | |
| | | /** |
| | | * 查询部门管理数据 |
| | |
| | | throw new ServiceException("部门停用,不允许新增"); |
| | | } |
| | | dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); |
| | | Long wxDeptId = sysWxCpService.addWxCpDept(1L,dept.getDeptName()); |
| | | dept.setWxDeptId(wxDeptId); |
| | | //新增部门 |
| | | int i = deptMapper.insertDept(dept); |
| | | if(dept.getMenuIds()!=null||dept.getStaffMenuIds()!=null){ |
| | |
| | | dept.setAncestors(newAncestors); |
| | | updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors); |
| | | } |
| | | if(oldDept.getWxDeptId()!=null&&!oldDept.getDeptName().equals(dept.getDeptName())){ |
| | | sysWxCpService.updateWxCpDept(oldDept.getWxDeptId(),dept.getDeptName()); |
| | | } |
| | | int result = deptMapper.updateDept(dept); |
| | | if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors()) |
| | | && !StringUtils.equals("0", dept.getAncestors())) |