|
@@ -64,8 +64,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional
|
|
@Transactional
|
|
|
public void createDept(Dept dept) {
|
|
public void createDept(Dept dept) {
|
|
|
- Long parentId = dept.getParentId();
|
|
|
|
|
- if (parentId == null)
|
|
|
|
|
|
|
+ if (dept.getParentId() == null)
|
|
|
dept.setParentId(0L);
|
|
dept.setParentId(0L);
|
|
|
dept.setCreateTime(new Date());
|
|
dept.setCreateTime(new Date());
|
|
|
this.save(dept);
|
|
this.save(dept);
|
|
@@ -74,6 +73,8 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional
|
|
@Transactional
|
|
|
public void updateDept(Dept dept) {
|
|
public void updateDept(Dept dept) {
|
|
|
|
|
+ if (dept.getParentId() == null)
|
|
|
|
|
+ dept.setParentId(0L);
|
|
|
dept.setModifyTime(new Date());
|
|
dept.setModifyTime(new Date());
|
|
|
this.baseMapper.updateById(dept);
|
|
this.baseMapper.updateById(dept);
|
|
|
}
|
|
}
|