Prechádzať zdrojové kódy

客户端租户信息、工程部署菜单移至工具端,修改租户默认菜单数据,查询子级租户信息接口

xuezizhuo 1 rok pred
rodič
commit
0bee2e0212

+ 1 - 0
zkqy-admin/src/main/java/com/zkqy/web/controller/system/SysEngineeringController.java

@@ -60,6 +60,7 @@ public class SysEngineeringController extends BaseController {
     @ApiOperation(value = "查询工程部署列表")
     public TableDataInfo list(SysEngineering sysEngineering) {
         startPage();
+        sysEngineering.setTenantId(getTenantId());
         List<SysEngineering> list = sysEngineeringService.selectSysEngineeringList(sysEngineering);
         return getDataTable(list);
     }

+ 8 - 0
zkqy-admin/src/main/java/com/zkqy/web/controller/system/SysTenantController.java

@@ -153,4 +153,12 @@ public class SysTenantController extends BaseController {
         return sysTenantService.activationOperation(tenantId, activationCode);
     }
 
+    /**
+     * 租户树信息
+     */
+    @GetMapping("/tenantTree")
+    public AjaxResult tenantTree() {
+        return AjaxResult.success(sysTenantService.selectTenantTree(getTenantId()));
+    }
+
 }

+ 8 - 0
zkqy-system/src/main/java/com/zkqy/system/mapper/SysTenantMapper.java

@@ -82,4 +82,12 @@ public interface SysTenantMapper {
      * @return 结果
      */
     public int deleteSysTenantByTenantIds(Long[] tenantIds);
+
+
+    /**
+     * 查询租户树信息
+     * @param tenantId
+     * @return
+     */
+    List<SysTenant> selectTenantTree(Long tenantId);
 }

+ 7 - 0
zkqy-system/src/main/java/com/zkqy/system/service/ISysTenantService.java

@@ -99,4 +99,11 @@ public interface ISysTenantService {
      * 激活租户
      */
     AjaxResult activationOperation(String tenantId, String activationCode) throws Exception;
+
+    /**
+     * 查询租户树信息
+     * @param tenantId
+     * @return
+     */
+    List<SysTenant> selectTenantTree(Long tenantId);
 }

+ 35 - 2
zkqy-system/src/main/java/com/zkqy/system/service/impl/SysTenantServiceImpl.java

@@ -127,6 +127,9 @@ public class SysTenantServiceImpl implements ISysTenantService {
 
     @Override
     public List<SysTenant> selectSysTenantAllList(SysTenant sysTenant) {
+
+
+
         return sysTenantMapper.selectSysTenantAllList(sysTenant);
     }
 
@@ -221,7 +224,7 @@ public class SysTenantServiceImpl implements ISysTenantService {
                 "        \"menuId\": 9080,\n" +
                 "        \"menuName\": \"租户信息\",\n" +
                 "        \"parentName\": null,\n" +
-                "        \"parentId\": 1,\n" +
+                "        \"parentId\": 9764,\n" +
                 "        \"orderNum\": 8,\n" +
                 "        \"path\": \"tenant_info\",\n" +
                 "        \"component\": \"system/tenant/tenantIndex\",\n" +
@@ -1396,7 +1399,7 @@ public class SysTenantServiceImpl implements ISysTenantService {
                 "        \"menuId\": 5008,\n" +
                 "        \"menuName\": \"工程部署\",\n" +
                 "        \"parentName\": null,\n" +
-                "        \"parentId\": 1,\n" +
+                "        \"parentId\": 9764,\n" +
                 "        \"orderNum\": 7,\n" +
                 "        \"path\": \"engineering\",\n" +
                 "        \"component\": \"system/engineeringManage/index\",\n" +
@@ -1711,6 +1714,31 @@ public class SysTenantServiceImpl implements ISysTenantService {
                 "        \"children\": [],\n" +
                 "        \"tenantName\": null,\n" +
                 "        \"tenantId\": null\n" +
+                "    },\n" +
+                "    {\n" +
+                "        \"createBy\": null,\n" +
+                "        \"createTime\": \"2023-07-07 14:04:16\",\n" +
+                "        \"updateBy\": null,\n" +
+                "        \"updateTime\": null,\n" +
+                "        \"remark\": null,\n" +
+                "        \"menuId\": 9764,\n" +
+                "        \"menuName\": \"后台管理\",\n" +
+                "        \"parentName\": null,\n" +
+                "        \"parentId\": 0,\n" +
+                "        \"orderNum\": 8,\n" +
+                "        \"path\": \"htgl\",\n" +
+                "        \"component\": null,\n" +
+                "        \"query\": null,\n" +
+                "        \"isFrame\": \"1\",\n" +
+                "        \"isCache\": \"0\",\n" +
+                "        \"menuType\": \"M\",\n" +
+                "        \"visible\": \"0\",\n" +
+                "        \"status\": \"0\",\n" +
+                "        \"perms\": \"\",\n" +
+                "        \"icon\": \"monitor\",\n" +
+                "        \"children\": [],\n" +
+                "        \"tenantName\": null,\n" +
+                "        \"tenantId\": null\n" +
                 "    }\n" +
                 "]";
         List<SysMenu> list = new ArrayList<>();
@@ -1871,6 +1899,11 @@ public class SysTenantServiceImpl implements ISysTenantService {
         return AjaxResult.success();
     }
 
+    @Override
+    public List<SysTenant> selectTenantTree(Long tenantId) {
+        return sysTenantMapper.selectTenantTree(tenantId);
+    }
+
     /**
      * 从当前时间往后续期租户时间
      *

+ 4 - 4
zkqy-system/src/main/resources/mapper/system/SysMenuMapper.xml

@@ -106,8 +106,8 @@
         from sys_menu m
                  left join sys_tenant_menu tm on tm.menu_id = m.menu_id
         where tm.tenant_id = #{tenantId}
-          and m.menu_name not in ('数据引擎', '流程引擎', '表单引擎','移动端引擎')
-          and parent_id not in (select menu_id from sys_menu where menu_name in ("数据引擎", "流程引擎", "表单引擎","移到端引擎"))
+          and m.menu_name not in ('数据引擎', '流程引擎', '表单引擎','移动端引擎','后台管理')
+          and parent_id not in (select menu_id from sys_menu where menu_name in ("数据引擎", "流程引擎", "表单引擎","移到端引擎","后台管理"))
         order by parent_id, order_num
 
     </select>
@@ -157,7 +157,7 @@
         where m.menu_type in ('M', 'C')
           and m.status = 0
           and tm.tenant_id = #{tenantId}
-          and m.menu_name in ('数据引擎', '流程引擎', '表单引擎','移动端引擎')
+          and m.menu_name in ('数据引擎', '流程引擎', '表单引擎','移动端引擎','后台管理')
 
 
         UNION
@@ -186,7 +186,7 @@
           and tm.tenant_id = #{tenantId}
           and m.parent_id in (select menu_id
                               from sys_menu
-                              where menu_name in ("数据引擎", "流程引擎", "表单引擎","移动端引擎"))
+                              where menu_name in ("数据引擎", "流程引擎", "表单引擎","移动端引擎","后台管理"))
 
     </select>
 

+ 8 - 0
zkqy-system/src/main/resources/mapper/system/SysTenantMapper.xml

@@ -54,8 +54,10 @@
         <if test="isDel != null  and isDel != ''">and is_del = #{isDel}</if>
         order by tenant_id desc
     </select>
+
     <select id="selectSysTenantAllList" parameterType="SysTenant" resultMap="SysTenantResult">
         <include refid="selectSysTenantVo"/>
+        <if test="tenantParentId != null  and tenantParentId != ''">and tenant_parent_id = #{tenantParentId}</if>
         <if test="tenantName != null  and tenantName != ''">and tenant_name like concat('%', #{tenantName}, '%')</if>
         <if test="tenantCode != null  and tenantCode != ''">and tenant_code = #{tenantCode}</if>
         <if test="owner != null  and owner != ''">and owner = #{owner}</if>
@@ -144,4 +146,10 @@
             #{tenantId}
         </foreach>
     </update>
+
+    <select id="selectTenantTree" resultMap="SysTenantResult">
+        <include refid="selectSysTenantVo"/>
+        and tenant_parent_id = #{tenantId} or tenant_id = #{tenantId}
+    </select>
+
 </mapper>

+ 27 - 2
zkqy-system/src/main/resources/sql/initialize_sys_tenant_menu.json

@@ -33,7 +33,7 @@
         "menuId": 9080,
         "menuName": "租户信息",
         "parentName": null,
-        "parentId": 1,
+        "parentId": 9764,
         "orderNum": 8,
         "path": "tenant_info",
         "component": "system/tenant/tenantIndex",
@@ -1208,7 +1208,7 @@
         "menuId": 5008,
         "menuName": "工程部署",
         "parentName": null,
-        "parentId": 1,
+        "parentId": 9764,
         "orderNum": 7,
         "path": "engineering",
         "component": "system/engineeringManage/index",
@@ -1523,5 +1523,30 @@
         "children": [],
         "tenantName": null,
         "tenantId": null
+    },
+    {
+        "createBy": null,
+        "createTime": "2023-07-07 14:04:16",
+        "updateBy": null,
+        "updateTime": null,
+        "remark": null,
+        "menuId": 9764,
+        "menuName": "后台管理",
+        "parentName": null,
+        "parentId": 0,
+        "orderNum": 8,
+        "path": "htgl",
+        "component": null,
+        "query": null,
+        "isFrame": "1",
+        "isCache": "0",
+        "menuType": "M",
+        "visible": "0",
+        "status": "0",
+        "perms": "",
+        "icon": "monitor",
+        "children": [],
+        "tenantName": null,
+        "tenantId": null
     }
 ]