|
|
@@ -43,7 +43,6 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
|
|
private SysUserMapper sysUserMapper;
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 项目启动时,缓存机构数据
|
|
|
*/
|
|
|
@@ -65,7 +64,7 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
|
|
page = new Page<>();
|
|
|
}
|
|
|
Long parentId = org.getParentId();
|
|
|
- if(parentId == null){
|
|
|
+ if (parentId == null) {
|
|
|
parentId = SecurityUtils.getLoginUser().getSysUser().getOrgId();
|
|
|
}
|
|
|
SysOrg sysOrg = sysOrgMapper.selectById(parentId);
|
|
|
@@ -77,7 +76,7 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
|
|
if (org.getCheckSub()) {
|
|
|
query.lambda().likeRight(SysOrg::getPath, sysOrg.getPath());
|
|
|
} else {
|
|
|
- query.lambda().eq(SysOrg::getPath,sysOrg.getPath());
|
|
|
+ query.lambda().eq(SysOrg::getPath, sysOrg.getPath());
|
|
|
}
|
|
|
//模糊查询
|
|
|
if (StringUtils.isNotNull(org.getName())) {
|
|
|
@@ -264,6 +263,9 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
|
|
public boolean saveOrUpdateOrg(SysOrg org) {
|
|
|
boolean isOk = false;
|
|
|
if (org.getId() != null) {
|
|
|
+ if (StringUtils.isEmpty(org.getManagerPhone())) {
|
|
|
+ org.setManagerPhone(org.getPhone());
|
|
|
+ }
|
|
|
isOk = this.updateById(org);
|
|
|
} else {
|
|
|
SysOrg sysOrg = sysOrgMapper.selectById(org.getParentId());
|
|
|
@@ -271,7 +273,10 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
|
|
org.setDeleted(0);
|
|
|
long id = IdWorker.getId();
|
|
|
org.setId(id);
|
|
|
- org.setPath(sysOrg.getPath()+id+"-");
|
|
|
+ org.setPath(sysOrg.getPath() + id + "-");
|
|
|
+ if (StringUtils.isEmpty(org.getManagerPhone())) {
|
|
|
+ org.setManagerPhone(org.getPhone());
|
|
|
+ }
|
|
|
isOk = this.save(org);
|
|
|
}
|
|
|
/*
|