|
|
@@ -3,6 +3,7 @@ package com.xunmei.system.service.impl;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.xunmei.common.core.constant.CacheConstants;
|
|
|
@@ -260,20 +261,23 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public boolean saveOrUpdateOrg(SysOrg org) {
|
|
|
-
|
|
|
boolean isOk = false;
|
|
|
if (org.getId() != null) {
|
|
|
isOk = this.updateById(org);
|
|
|
} else {
|
|
|
+ SysOrg sysOrg = sysOrgMapper.selectById(org.getParentId());
|
|
|
+ org.setParentGuid(sysOrg.getGuid());
|
|
|
+ org.setDeleted(0);
|
|
|
+ long id = IdWorker.getId();
|
|
|
+ org.setId(id);
|
|
|
+ org.setPath(sysOrg.getPath()+id+"-");
|
|
|
isOk = this.save(org);
|
|
|
}
|
|
|
-
|
|
|
/*
|
|
|
* 重置缓存
|
|
|
*/
|
|
|
this.clearOrgCache();
|
|
|
this.loadingOrgCache();
|
|
|
-
|
|
|
return isOk;
|
|
|
}
|
|
|
|