Explorar o código

租户增加parentid

dongxin hai 1 ano
pai
achega
9fbc87687b

+ 4 - 0
platform/src/main/java/com/jzg/entity/po/SysSystem.java

@@ -21,6 +21,10 @@ public class SysSystem extends BaseModel {
     @Schema(description = "租户id")
     private String id;
 
+    /** 租户父id */
+    @Schema(description = "租户父id")
+    private String parentId;
+
     @Schema(description = "是否是租户 0-否 1-是")
     private Integer isTenant;
 

+ 3 - 1
platform/src/main/java/com/jzg/service/impl/SysSystemServiceImpl.java

@@ -119,7 +119,8 @@ public class SysSystemServiceImpl extends ServiceImpl<SysSystemMapper, SysSystem
                         SysSystem::getContact, sysSystemVo.getContactValue()).or()
                 .eq(StringUtils.isNotEmpty(sysSystemVo.getContactValue()),
                         SysSystem::getTelephone, sysSystemVo.getContactValue())
-                .eq(SysSystem::getIsTenant, 1);
+                .eq(SysSystem::getIsTenant, 1)
+                .ne(SysSystem::getParentId, 0);
         Page<SysSystem> sysPage = page(page, wrapper);
         List<SysSystem> sysSystemList = sysPage.getRecords();
         if(CollUtil.isNotEmpty(sysSystemList)){
@@ -157,6 +158,7 @@ public class SysSystemServiceImpl extends ServiceImpl<SysSystemMapper, SysSystem
         BeanUtils.copyProperties(sysSystemVo, sysSystem);
         sysSystem.setIsTenant(1);
         sysSystem.setAvailable(1);
+        sysSystem.setParentId("1");
         this.save(sysSystem);
 
         /** 初始化租户管理员信息 */

+ 3 - 0
tenant/organization/src/main/java/com/jzg/organization/entity/vo/SysDeptVo.java

@@ -74,4 +74,7 @@ public class SysDeptVo implements Serializable {
 
     @Schema(description = "机构ids")
     private List<String> deptIds;
+
+    @Schema(description = "系统code")
+    private String systemCode;
 }