|
|
@@ -27,6 +27,7 @@ import com.fs.common.utils.spring.SpringUtils;
|
|
|
import com.fs.system.mapper.SysDeptMapper;
|
|
|
import com.fs.system.mapper.SysRoleMapper;
|
|
|
import com.fs.system.service.ISysDeptService;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
/**
|
|
|
* 部门管理 服务实现
|
|
|
@@ -198,6 +199,7 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public int insertDept(SysDept dept) {
|
|
|
SysDept info = deptMapper.selectDeptById(dept.getParentId());
|
|
|
// 如果父节点不为正常状态,则不允许新增子节点
|
|
|
@@ -205,7 +207,12 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
|
|
throw new ServiceException("部门停用,不允许新增");
|
|
|
}
|
|
|
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
|
|
- return deptMapper.insertDept(dept);
|
|
|
+ if(deptMapper.insertDept(dept) > 0){
|
|
|
+ SysDeptConfig config =new SysDeptConfig();
|
|
|
+ config.setDeptId(dept.getDeptId());
|
|
|
+ sysDeptConfigMapper.insertSysDeptConfig(config);
|
|
|
+ }
|
|
|
+ return 1;
|
|
|
}
|
|
|
|
|
|
/**
|