TRX 1 rok temu
rodzic
commit
3f13d5a984

+ 12 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/org/OrganizationServiceImpl.java

@@ -22,6 +22,7 @@ import com.zhongshu.card.server.core.dao.org.*;
 import com.zhongshu.card.server.core.dataConfig.CardDefault;
 import com.zhongshu.card.server.core.domain.org.*;
 import com.zhongshu.card.server.core.service.base.SuperService;
+import com.zhongshu.card.server.core.service.sync.ProjectSyncIotCenterService;
 import com.zhongshu.card.server.core.util.*;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ObjectUtils;
@@ -88,6 +89,9 @@ public class OrganizationServiceImpl extends SuperService implements Organizatio
     @Autowired
     OrganizationRelationDao organizationRelationDao;
 
+    @Autowired
+    ProjectSyncIotCenterService projectSyncIotCenterService;
+
     /**
      * 添加机构 (只是添加、没得编辑)
      *
@@ -160,6 +164,11 @@ public class OrganizationServiceImpl extends SuperService implements Organizatio
             initOrganization(organization, param.getPassword());
         }
 
+        // 同步项目信息
+        if (authType == AuthType.Project) {
+            projectSyncIotCenterService.noticeSyncProject(organization);
+        }
+
         return ResultContent.buildSuccess(organization);
     }
 
@@ -183,6 +192,9 @@ public class OrganizationServiceImpl extends SuperService implements Organizatio
         }
         BeanUtils.copyProperties(param, organization);
         organizationDao.save(organization);
+        if (organization.getAuthType() == AuthType.Project) {
+            projectSyncIotCenterService.noticeSyncProject(organization);
+        }
         return ResultContent.buildSuccess();
     }