|
|
@@ -4,6 +4,7 @@ import java.util.List;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.xunmei.common.core.utils.DateUtils;
|
|
|
+import com.xunmei.common.core.utils.StringUtils;
|
|
|
import com.xunmei.system.api.domain.SysOrg;
|
|
|
import com.xunmei.system.dto.SysOrgExtendDto;
|
|
|
import com.xunmei.system.mapper.SysOrgMapper;
|
|
|
@@ -120,10 +121,33 @@ public class SysOrgExtendServiceImpl extends ServiceImpl<SysOrgExtendMapper, Sys
|
|
|
// sysOrgExtend.setParentGuid(sysOrg.getParentGuid());
|
|
|
SysOrg org = new SysOrg();
|
|
|
BeanUtils.copyProperties(sysOrgExtend,org);
|
|
|
- orgService.saveOrUpdateOrg(org);
|
|
|
+ boolean isOk = false;
|
|
|
+ if (org.getId() != null) {
|
|
|
+ if (StringUtils.isEmpty(org.getManagerPhone())) {
|
|
|
+ org.setManagerPhone(org.getPhone());
|
|
|
+ }
|
|
|
+ isOk = orgService.updateById(org);
|
|
|
+ } else {
|
|
|
+ SysOrg sysOrg = orgMapper.selectById(org.getParentId());
|
|
|
+ org.setParentGuid(sysOrg.getGuid());
|
|
|
+ org.setDeleted(0);
|
|
|
+ long id = IdWorker.getId();
|
|
|
+ org.setId(id);
|
|
|
+ org.setPath(sysOrg.getPath() + id + "-");
|
|
|
+ if (StringUtils.isEmpty(org.getManagerPhone())) {
|
|
|
+ org.setManagerPhone(org.getPhone());
|
|
|
+ }
|
|
|
+ isOk = orgService.save(org);
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ * 重置缓存
|
|
|
+ */
|
|
|
+ orgService.clearOrgCache();
|
|
|
+ orgService.loadingOrgCache();
|
|
|
+// orgService.saveOrUpdateOrg(org);
|
|
|
|
|
|
SysOrgExtend extend = new SysOrgExtend();
|
|
|
- extend.setOrgId(sysOrgExtend.getId());
|
|
|
+ extend.setOrgId(org.getId());
|
|
|
extend.setCreateTime(DateUtils.getNowDate());
|
|
|
extend.setDetachedLobbyEquipment(sysOrgExtend.getDetachedLobbyEquipment());
|
|
|
extend.setDetachedWallPenetratingEquipment(sysOrgExtend.getDetachedWallPenetratingEquipment());
|