Преглед изворни кода

Merge branch 'system-zyj' of uskycloud/usky-cloud into master

gez пре 2 година
родитељ
комит
4cc733e0ee
35 измењених фајлова са 1625 додато и 103 уклоњено
  1. 57 1
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/AuthorityConfigController.java
  2. 101 7
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/SysMobileMenuController.java
  3. 21 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/SysMobilePlatformMenuController.java
  4. 36 2
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/SysPlatformController.java
  5. 192 40
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/domain/SysMobileMenu.java
  6. 32 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/domain/SysMobilePlatformMenu.java
  7. 3 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/SysMenuMapper.java
  8. 79 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/SysMobileMenuMapper.java
  9. 16 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/SysMobilePlatformMenuMapper.java
  10. 6 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/SysPlatformMapper.java
  11. 9 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/SysPlatformMenuMapper.java
  12. 3 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/SysTenantMapper.java
  13. 21 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/ISysMenuService.java
  14. 2 2
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/SysLoginService.java
  15. 72 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/SysMobileMenuService.java
  16. 16 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/SysMobilePlatformMenuService.java
  17. 8 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/SysPlatformMenuService.java
  18. 5 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/SysPlatformService.java
  19. 2 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/SysTenantService.java
  20. 101 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysMenuServiceImpl.java
  21. 161 8
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysMobileMenuServiceImpl.java
  22. 20 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysMobilePlatformMenuServiceImpl.java
  23. 110 21
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysPlatformMenuServiceImpl.java
  24. 126 17
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysPlatformServiceImpl.java
  25. 14 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysTenantServiceImpl.java
  26. 39 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/vo/MobilePlatformMenuVO.java
  27. 33 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/vo/MobileTenantMenuVO.java
  28. 5 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/vo/SysTenantOneVo.java
  29. 78 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/vo/TreeMobileSelect.java
  30. 29 0
      base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysMenuMapper.xml
  31. 141 1
      base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysMobileMenuMapper.xml
  32. 11 0
      base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysMobilePlatformMenuMapper.xml
  33. 21 0
      base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysPlatformMapper.xml
  34. 42 4
      base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysPlatformMenuMapper.xml
  35. 13 0
      base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysTenantMapper.xml

+ 57 - 1
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/AuthorityConfigController.java

@@ -3,9 +3,13 @@ package com.usky.system.controller.web;
 
 import com.usky.common.core.bean.ApiResult;
 import com.usky.system.domain.SysMenu;
+import com.usky.system.domain.SysMobileMenu;
+import com.usky.system.domain.SysTenant;
 import com.usky.system.service.ISysMenuService;
 import com.usky.system.service.SysPlatformMenuService;
+import com.usky.system.service.SysTenantService;
 import com.usky.system.service.vo.TenantMenuVo;
+import com.usky.system.service.vo.MobileTenantMenuVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -29,6 +33,9 @@ public class AuthorityConfigController {
     @Autowired
     private ISysMenuService menuService;
 
+    @Autowired
+    private SysTenantService sysTenantService;
+
 
     /**
      * 租户管理-权限配置-目录查询
@@ -45,7 +52,7 @@ public class AuthorityConfigController {
 
 
     /**
-     * 租户管理-权限配置-目录查询
+     * PC租户管理-权限配置-目录查询
      *
      * @param platformId 平台ID
      * @param tenantId   租户ID
@@ -61,6 +68,42 @@ public class AuthorityConfigController {
         return ApiResult.success(ajax);
     }
 
+    /**
+     * 移动端租户管理-权限配置-目录查询
+     *
+     * @param platformId 平台ID
+     * @param tenantId   租户ID
+     * @return
+     */
+    @GetMapping("getMobileConfigMenuList")
+    public ApiResult<Map<String, Object>> getMobileConfigMenuList(@RequestParam(value = "platformId") Integer platformId,
+                                                                     @RequestParam(value = "tenantId") Integer tenantId) {
+        List<SysMobileMenu> menus =sysPlatformMenuService.getMobilePlatformMenuList(platformId);
+        Map<String, Object> ajax = new HashMap<>();
+        ajax.put("checkedKeys", sysPlatformMenuService.selectMobilePlatformMenu(tenantId));
+        ajax.put("menus", menuService.buildMobileMenuTreeSelect(menus));
+        return ApiResult.success(ajax);
+    }
+
+    /**
+     * 手机端APP租户管理-权限配置-目录查询
+     *
+     * @param domain 域名
+     * @return
+     */
+    @GetMapping("getAppConfigMenuList")
+    public ApiResult<Map<String, Object>> getAppConfigMenuList(@RequestParam(value = "domain") String domain) {
+        List<SysTenant> list = sysTenantService.getAppData(domain);
+
+        Integer tenantId = list.get(0).getId();
+        String platformId = list.get(0).getSystemName();
+        List<SysMobileMenu> menus =sysPlatformMenuService.getMobilePlatformMenuList(Integer.parseInt(platformId));
+        Map<String, Object> ajax = new HashMap<>();
+        ajax.put("checkedKeys", sysPlatformMenuService.selectMobilePlatformMenu(tenantId));
+        ajax.put("menus", menuService.buildMobileMenuTreeSelect(menus));
+        return ApiResult.success(ajax);
+    }
+
     /**
      * 租户管理-权限配置-目录保存
      *
@@ -74,6 +117,19 @@ public class AuthorityConfigController {
         return ApiResult.success();
     }
 
+    /**
+     * 移动端租户管理-权限配置-目录保存
+     *
+     * @param mobileTenantMenuVO
+     * @return
+     */
+//    @Log(title = "权限配置", businessType = BusinessType.UPDATE)
+    @PostMapping("updateMobileMenu")
+    public ApiResult<Void> updateMobileMenu(@RequestBody MobileTenantMenuVO mobileTenantMenuVO) {
+        sysPlatformMenuService.updateMobileMenu(mobileTenantMenuVO);
+        return ApiResult.success();
+    }
+
 
 }
 

+ 101 - 7
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/SysMobileMenuController.java

@@ -2,21 +2,25 @@ package com.usky.system.controller.web;
 
 
 import com.usky.common.core.bean.ApiResult;
+import com.usky.common.core.constants.CommonConst;
+import com.usky.common.core.exception.BusinessErrorCode;
+import com.usky.common.core.util.ServletUtils;
+import com.usky.common.core.util.StringUtils;
+import com.usky.common.security.service.TokenService;
 import com.usky.common.security.utils.SecurityUtils;
-import com.usky.system.domain.SysMenu;
 import com.usky.system.domain.SysMobileMenu;
-import com.usky.system.domain.SysUser;
+import com.usky.system.domain.constants.UserConstants;
+import com.usky.system.model.LoginUser;
 import com.usky.system.service.SysMobileMenuService;
-import com.usky.system.service.impl.SysMenuServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
 
 import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RestController;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
 
 /**
  * <p>
@@ -28,11 +32,14 @@ import java.util.List;
  */
 @RestController
 @RequestMapping("/sysMobileMenu")
-public class SysMobileMenuController {
+public class SysMobileMenuController  extends BaseController {
 
     @Autowired
     private SysMobileMenuService sysMobileMenuService;
 
+    @Autowired
+    private TokenService tokenService;
+
     @GetMapping("getRouters")
     public ApiResult getRouters()
     {
@@ -40,5 +47,92 @@ public class SysMobileMenuController {
         return ApiResult.success(menus);
     }
 
+    @GetMapping("getAppRouters")
+    public ApiResult getAppRouters(@RequestParam(value = "domain") String domain)
+    {
+        List<SysMobileMenu> menus = sysMobileMenuService.moveAppRoute(domain);
+        return ApiResult.success(menus);
+    }
+
+    /**
+     * 移动端系统管理-菜单管理-列表展示
+     */
+    @GetMapping("/list")
+    public ApiResult list(SysMobileMenu menu)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUserid();
+        List<SysMobileMenu> menus = sysMobileMenuService.selectMobileMenuList(menu, userId);
+        return ApiResult.success(menus);
+    }
+
+    /**
+     * 移动端系统管理-菜单管理-根据菜单编号获取详细信息
+     */
+    @GetMapping(value = "/{menuId}")
+    public ApiResult getInfo(@PathVariable Long menuId)
+    {
+        return ApiResult.success(sysMobileMenuService.selectMenuById(menuId));
+    }
+
+    /**
+     * 移动端系统管理-菜单管理-新增菜单
+     */
+    @PostMapping
+    public ApiResult add(@Validated @RequestBody SysMobileMenu menu)
+    {
+        if (UserConstants.NOT_UNIQUE.equals(sysMobileMenuService.checkMenuNameUnique(menu)))
+        {
+            return ApiResult.error(BusinessErrorCode.BIZ_BUSINESS_ERROR.getCode(), "新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
+        }
+        else if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
+                && !StringUtils.startsWithAny(menu.getPath(), CommonConst.HTTP_PREFIX, CommonConst.HTTPS_PREFIX))
+        {
+            return ApiResult.error(BusinessErrorCode.BIZ_BUSINESS_ERROR.getCode(), "新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
+        }
+        menu.setCreateBy(SecurityUtils.getUsername());
+        return toAjax(sysMobileMenuService.insertMobileMenu(menu));
+    }
+
+    /**
+     * 移动端系统管理-菜单管理-修改菜单
+     */
+    @PutMapping
+    public ApiResult edit(@Validated @RequestBody SysMobileMenu menu)
+    {
+        if (UserConstants.NOT_UNIQUE.equals(sysMobileMenuService.checkMenuNameUnique(menu)))
+        {
+            return ApiResult.error(BusinessErrorCode.BIZ_BUSINESS_ERROR.getCode(), "修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
+        }
+        else if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
+                && !StringUtils.startsWithAny(menu.getPath(), CommonConst.HTTP_PREFIX, CommonConst.HTTPS_PREFIX))
+        {
+            return ApiResult.error(BusinessErrorCode.BIZ_BUSINESS_ERROR.getCode(), "新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
+        }
+        else if (Objects.equals(menu.getMenuId(), menu.getParentId()))
+        {
+            return ApiResult.error(BusinessErrorCode.BIZ_BUSINESS_ERROR.getCode(), "新增菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
+        }
+        menu.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax(sysMobileMenuService.updateMenu(menu));
+    }
+
+    /**
+     * 移动端系统管理-菜单管理-删除菜单
+     */
+    @DeleteMapping("/{menuId}")
+    public ApiResult remove(@PathVariable("menuId") Long menuId)
+    {
+        if (sysMobileMenuService.hasChildByMenuId(menuId))
+        {
+            return ApiResult.error(BusinessErrorCode.BIZ_BUSINESS_ERROR.getCode(), "存在子菜单,不允许删除");
+        }
+        if (sysMobileMenuService.checkMenuExistRole(menuId))
+        {
+            return ApiResult.error(BusinessErrorCode.BIZ_BUSINESS_ERROR.getCode(), "菜单已分配,不允许删除");
+        }
+        return toAjax(sysMobileMenuService.deleteMenuById(menuId));
+    }
+
 }
 

+ 21 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/SysMobilePlatformMenuController.java

@@ -0,0 +1,21 @@
+package com.usky.system.controller.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ * 移动端_平台和菜单关联表 前端控制器
+ * </p>
+ *
+ * @author JCB
+ * @since 2023-02-16
+ */
+@Controller
+@RequestMapping("/sysMobilePlatformMenu")
+public class SysMobilePlatformMenuController {
+
+}
+

+ 36 - 2
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/SysPlatformController.java

@@ -5,9 +5,12 @@ import com.usky.common.core.bean.ApiResult;
 import com.usky.common.core.bean.CommonPage;
 import com.usky.common.security.utils.SecurityUtils;
 import com.usky.system.domain.SysMenu;
+import com.usky.system.domain.SysMobileMenu;
+import com.usky.system.domain.SysMobilePlatformMenu;
 import com.usky.system.service.ISysMenuService;
 import com.usky.system.service.SysPlatformService;
 import com.usky.system.service.vo.PlatformMenuVo;
+import com.usky.system.service.vo.MobilePlatformMenuVO;
 import com.usky.system.service.vo.SysPlatformVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -53,7 +56,7 @@ public class SysPlatformController {
     }
 
     /**
-     * 平台管理-菜单查询
+     * PC平台管理-菜单查询
      *
      * @param platformId 平台ID
      * @return
@@ -69,9 +72,26 @@ public class SysPlatformController {
         return ApiResult.success(ajax);
     }
 
+    /**
+     * 移动端平台管理-菜单查询
+     *
+     * @param platformId 平台ID
+     * @return
+     */
+    @GetMapping("/getMobilePlatformMenu")
+    public ApiResult<Map<String, Object>> getMobilePlatformMenu(@RequestParam Long platformId) {
+
+        Long userId = SecurityUtils.getUserId();
+        List<SysMobileMenu> menus = menuService.selectMobileMenuListOne(userId);
+        Map<String,Object> ajax = new HashMap<>();
+        ajax.put("checkedKeys", sysPlatformService.getMobilePlatformMenu(platformId));
+        ajax.put("menus", menuService.buildMobileMenuTreeSelect(menus));
+        return ApiResult.success(ajax);
+    }
+
 
     /**
-     * 平台挂管理-菜单编辑
+     * PC平台管理-菜单编辑
      *
      * @param platformMenuVo
      * @return
@@ -82,5 +102,19 @@ public class SysPlatformController {
         sysPlatformService.updatePlatformMenu(platformMenuVo);
         return ApiResult.success();
     }
+
+
+    /**
+     * 移动端平台管理-菜单编辑
+     *
+     * @param mobilePlatformMenuVO
+     * @return
+     */
+//    @Log(title = "平台挂管理", businessType = BusinessType.INSERT)
+    @PostMapping("updateMobilePlatformMenu")
+    public ApiResult<Void> updateMobilePlatformMenu(@RequestBody MobilePlatformMenuVO mobilePlatformMenuVO) {
+        sysPlatformService.updateMobilePlatformMenu(mobilePlatformMenuVO);
+        return ApiResult.success();
+    }
 }
 

+ 192 - 40
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/domain/SysMobileMenu.java

@@ -1,14 +1,12 @@
 package com.usky.system.domain;
 
-import com.baomidou.mybatisplus.annotation.IdType;
+import com.usky.common.core.bean.BaseEntity;
 import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 
-import java.io.Serializable;
-import java.time.LocalDateTime;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -20,24 +18,24 @@ import java.util.List;
  * @author JCB
  * @since 2022-08-11
  */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-public class SysMobileMenu implements Serializable {
+public class SysMobileMenu extends BaseEntity {
 
     private static final long serialVersionUID = 1L;
 
     /**
      * 菜单ID
      */
-    @TableId(value = "menu_id", type = IdType.AUTO)
-    private Integer menuId;
+    private long menuId;
 
     /**
      * 菜单名称
      */
     private String menuName;
 
+    /** 父菜单名称 */
+    @TableField(exist = false)
+    private String parentName;
+
     /**
      * 父菜单ID
      */
@@ -46,7 +44,7 @@ public class SysMobileMenu implements Serializable {
     /**
      * 显示顺序
      */
-    private Integer orderNum;
+    private String orderNum;
 
     /**
      * 路由地址
@@ -66,12 +64,12 @@ public class SysMobileMenu implements Serializable {
     /**
      * 是否为外链(0是 1否)
      */
-    private Integer isFrame;
+    private String isFrame;
 
     /**
      * 是否缓存(0缓存 1不缓存)
      */
-    private Integer isCache;
+    private String isCache;
 
     /**
      * 菜单类型(M目录 C菜单 F按钮)
@@ -79,7 +77,7 @@ public class SysMobileMenu implements Serializable {
     private String menuType;
 
     /**
-     * 菜单状态(0显示 1隐藏)
+     * 显示状态(0显示 1隐藏)
      */
     private String visible;
 
@@ -99,35 +97,189 @@ public class SysMobileMenu implements Serializable {
     private String icon;
 
     /**
-     * 创建者
+     * 子菜单
      */
-    private String createBy;
+    @TableField(exist = false)
+    private List<SysMobileMenu> children = new ArrayList<SysMobileMenu>();
 
-    /**
-     * 创建时间
-     */
-    private LocalDateTime createTime;
+    public long getMenuId()
+    {
+        return menuId;
+    }
 
-    /**
-     * 更新者
-     */
-    private String updateBy;
+    public void setMenuId(long menuId)
+    {
+        this.menuId = menuId;
+    }
 
-    /**
-     * 更新时间
-     */
-    private LocalDateTime updateTime;
+    @NotBlank(message = "菜单名称不能为空")
+    @Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符")
+    public String getMenuName()
+    {
+        return menuName;
+    }
 
-    /**
-     * 备注
-     */
-    private String remark;
+    public void setMenuName(String menuName)
+    {
+        this.menuName = menuName;
+    }
 
-    /**
-     * 子菜单
-     */
-    @TableField(exist = false)
-    private List<SysMobileMenu> children = new ArrayList<SysMobileMenu>();
+    public String getParentName()
+    {
+        return parentName;
+    }
+
+    public void setParentName(String parentName)
+    {
+        this.parentName = parentName;
+    }
+
+    public Long getParentId()
+    {
+        return parentId;
+    }
+
+    public void setParentId(Long parentId)
+    {
+        this.parentId = parentId;
+    }
+
+    @NotBlank(message = "显示顺序不能为空")
+    public String getOrderNum()
+    {
+        return orderNum;
+    }
+
+    public void setOrderNum(String orderNum)
+    {
+        this.orderNum = orderNum;
+    }
+
+    @Size(min = 0, max = 200, message = "路由地址不能超过200个字符")
+    public String getPath()
+    {
+        return path;
+    }
+
+    public void setPath(String path)
+    {
+        this.path = path;
+    }
+
+    @Size(min = 0, max = 200, message = "组件路径不能超过255个字符")
+    public String getComponent()
+    {
+        return component;
+    }
+
+    public void setComponent(String component)
+    {
+        this.component = component;
+    }
+
+    public String getIsFrame()
+    {
+        return isFrame;
+    }
+
+    public void setIsFrame(String isFrame)
+    {
+        this.isFrame = isFrame;
+    }
+
+    public String getIsCache()
+    {
+        return isCache;
+    }
+
+    public void setIsCache(String isCache)
+    {
+        this.isCache = isCache;
+    }
+
+    @NotBlank(message = "菜单类型不能为空")
+    public String getMenuType()
+    {
+        return menuType;
+    }
+
+    public void setMenuType(String menuType)
+    {
+        this.menuType = menuType;
+    }
+
+    public String getVisible()
+    {
+        return visible;
+    }
+
+    public void setVisible(String visible)
+    {
+        this.visible = visible;
+    }
+
+    public String getStatus()
+    {
+        return status;
+    }
+
+    public void setStatus(String status)
+    {
+        this.status = status;
+    }
+
+    @Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符")
+    public String getPerms()
+    {
+        return perms;
+    }
+
+    public void setPerms(String perms)
+    {
+        this.perms = perms;
+    }
+
+    public String getIcon()
+    {
+        return icon;
+    }
+
+    public void setIcon(String icon)
+    {
+        this.icon = icon;
+    }
+
+    public List<SysMobileMenu> getChildren()
+    {
+        return children;
+    }
 
+    public void setChildren(List<SysMobileMenu> children)
+    {
+        this.children = children;
+    }
 
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("menuId", getMenuId())
+                .append("menuName", getMenuName())
+                .append("parentId", getParentId())
+                .append("orderNum", getOrderNum())
+                .append("path", getPath())
+                .append("component", getComponent())
+                .append("isFrame", getIsFrame())
+                .append("IsCache", getIsCache())
+                .append("menuType", getMenuType())
+                .append("visible", getVisible())
+                .append("status ", getStatus())
+                .append("perms", getPerms())
+                .append("icon", getIcon())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
+    }
 }

+ 32 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/domain/SysMobilePlatformMenu.java

@@ -0,0 +1,32 @@
+package com.usky.system.domain;
+
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 移动端_平台和菜单关联表
+ * </p>
+ *
+ * @author JCB
+ * @since 2023-02-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class SysMobilePlatformMenu implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 平台ID
+     */
+    private Integer platformId;
+
+    /**
+     * 菜单ID
+     */
+    private Integer menuId;
+
+
+}

+ 3 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/SysMenuMapper.java

@@ -3,6 +3,7 @@ package com.usky.system.mapper;
 
 import com.usky.common.mybatis.core.CrudMapper;
 import com.usky.system.domain.SysMenu;
+import com.usky.system.domain.SysMobileMenu;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
@@ -51,6 +52,8 @@ public interface SysMenuMapper extends CrudMapper<SysMenu> {
 
     public List<SysMenu> selectMenuListByUserIdOne(@Param("userId") Long userId);
 
+    public List<SysMobileMenu> selectMobileMenuListByUserIdOne(@Param("userId") Long userId);
+
     /**
      * 根据用户ID查询权限
      *

+ 79 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/SysMobileMenuMapper.java

@@ -1,7 +1,12 @@
 package com.usky.system.mapper;
 
+import com.usky.system.domain.SysMenu;
 import com.usky.system.domain.SysMobileMenu;
 import com.usky.common.mybatis.core.CrudMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
 
 /**
  * <p>
@@ -11,6 +16,80 @@ import com.usky.common.mybatis.core.CrudMapper;
  * @author JCB
  * @since 2022-08-11
  */
+@Repository
 public interface SysMobileMenuMapper extends CrudMapper<SysMobileMenu> {
 
+    /**
+     * 查询菜单使用数量
+     *
+     * @param menuId 菜单ID
+     * @return 结果
+     */
+    public int checkMenuExistRole(@Param("menuId") Long menuId);
+
+    /**
+     * 查询系统菜单列表
+     *
+     * @param menu 菜单信息
+     * @return 菜单列表
+     */
+    public List<SysMobileMenu> selectMobileMenuList(SysMobileMenu menu);
+
+    /**
+     * 根据菜单ID查询信息
+     *
+     * @param menuId 菜单ID
+     * @return 菜单信息
+     */
+    public SysMobileMenu selectMenuById(@Param("menuId") Long menuId);
+
+    /**
+     * 根据用户查询系统菜单列表
+     *
+     * @param menu 菜单信息
+     * @return 菜单列表
+     */
+    public List<SysMobileMenu> selectMobileMenuListByUserId(SysMobileMenu menu);
+
+    /**
+     * 校验菜单名称是否唯一
+     *
+     * @param menuName 菜单名称
+     * @param parentId 父菜单ID
+     * @return 结果
+     */
+    public SysMobileMenu checkMobileMenuNameUnique(@Param("menuName") String menuName,
+                                       @Param("parentId") Long parentId);
+
+    /**
+     * 是否存在菜单子节点
+     *
+     * @param menuId 菜单ID
+     * @return 结果
+     */
+    public int hasChildByMenuId(@Param("menuId") Long menuId);
+
+    /**
+     * 新增菜单信息
+     *
+     * @param menu 菜单信息
+     * @return 结果
+     */
+    public int insertMobileMenu(SysMobileMenu menu);
+
+    /**
+     * 修改菜单信息
+     *
+     * @param menu 菜单信息
+     * @return 结果
+     */
+    public int updateMenu(SysMobileMenu menu);
+
+    /**
+     * 删除菜单管理信息
+     *
+     * @param menuId 菜单ID
+     * @return 结果
+     */
+    public int deleteMenuById(@Param("menuId") Long menuId);
 }

+ 16 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/SysMobilePlatformMenuMapper.java

@@ -0,0 +1,16 @@
+package com.usky.system.mapper;
+
+import com.usky.system.domain.SysMobilePlatformMenu;
+import com.usky.common.mybatis.core.CrudMapper;
+
+/**
+ * <p>
+ * 移动端_平台和菜单关联表 Mapper 接口
+ * </p>
+ *
+ * @author JCB
+ * @since 2023-02-16
+ */
+public interface SysMobilePlatformMenuMapper extends CrudMapper<SysMobilePlatformMenu> {
+
+}

+ 6 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/SysPlatformMapper.java

@@ -2,6 +2,7 @@ package com.usky.system.mapper;
 
 import com.usky.common.mybatis.core.CrudMapper;
 import com.usky.system.domain.SysMenu;
+import com.usky.system.domain.SysMobileMenu;
 import com.usky.system.domain.SysPlatform;
 import com.usky.system.domain.SysPlatformMenu;
 import com.usky.system.service.vo.SysPlatformVo;
@@ -29,8 +30,13 @@ public interface SysPlatformMapper extends CrudMapper<SysPlatform> {
     List<SysMenu> getMenuIdListOne(@Param("menuIds") Long[] menuIds,
                                    @Param("menuType") String menuType);
 
+    List<SysMobileMenu> getMobileMenuIdListOne(@Param("menuIds") Long[] menuIds,
+                                   @Param("menuType") String menuType);
+
     int deletePlatformMenuBy(@Param("platformId") Long platformId);
 
+    int deleteMobilePlatformMenuBy(@Param("platformId") Long platformId);
+
 
     List<SysPlatformMenu> getMenuListOne(@Param("platformId") Long platformId,
                                          @Param("menuType")  String menuType);

+ 9 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/SysPlatformMenuMapper.java

@@ -2,6 +2,7 @@ package com.usky.system.mapper;
 
 import com.usky.common.mybatis.core.CrudMapper;
 import com.usky.system.domain.SysMenu;
+import com.usky.system.domain.SysMobileMenu;
 import com.usky.system.domain.SysPlatformMenu;
 import com.usky.system.domain.SysTenantMenu;
 import org.apache.ibatis.annotations.Param;
@@ -21,11 +22,19 @@ public interface SysPlatformMenuMapper extends CrudMapper<SysPlatformMenu> {
     List<SysMenu> getMenuList(@Param("platformId") Integer platformId,
                               @Param("menuType") String menuType);
 
+    List<SysMobileMenu> getMobileMenuList(@Param("platformId") Integer platformId,
+                              @Param("menuType") String menuType);
+
     List<SysMenu> getMenuIdList(@Param("menuIds") Long[] menuIds,
                                 @Param("menuType") String menuType);
 
+    List<SysMobileMenu> getMobileMenuIdList(@Param("menuIds") Long[] menuIds,
+                                @Param("menuType") String menuType);
+
     int deleteTenantMenuBy(@Param("tenantId") Long tenantId);
 
+    int deleteMobileTenantMenuBy(@Param("tenantId") Long tenantId);
+
     List<SysTenantMenu> getMenuListOne(@Param("tenantId") Integer tenantId,
                                        @Param("menuType") String menuType);
 }

+ 3 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/SysTenantMapper.java

@@ -20,10 +20,13 @@ public interface SysTenantMapper extends CrudMapper<SysTenant> {
 
     List<SysTenantVo> getUserData(@Param("userId") int userId);
 
+    List<SysTenant> getAppData(@Param("domain") String domain);
+
     List<SysTenantTwoVo> getTenantData(@Param("tenantName") String tenantName,
                                        @Param("tenantManager") String tenantManager,
                                        @Param("tenantType") String tenantType,
                                        @Param("status") String status,
+                                       @Param("platformName") String platformName,
                                        @Param("startTime") String startTime,
                                        @Param("endTime") String endTime,
                                        @Param("current") Integer current,

+ 21 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/ISysMenuService.java

@@ -3,7 +3,9 @@ package com.usky.system.service;
 
 import com.usky.common.mybatis.core.CrudService;
 import com.usky.system.domain.SysMenu;
+import com.usky.system.domain.SysMobileMenu;
 import com.usky.system.service.vo.RouterVo;
+import com.usky.system.service.vo.TreeMobileSelect;
 import com.usky.system.service.vo.TreeSelect;
 
 import java.util.List;
@@ -42,6 +44,8 @@ public interface ISysMenuService extends CrudService<SysMenu>
 
     List<SysMenu> selectMenuListOne(Long userId);
 
+    List<SysMobileMenu> selectMobileMenuListOne(Long userId);
+
     /**
      * 根据用户ID查询权限
      * 
@@ -87,6 +91,15 @@ public interface ISysMenuService extends CrudService<SysMenu>
      */
     public List<SysMenu> buildMenuTree(List<SysMenu> menus);
 
+
+    /**
+     * 构建移动端前端所需要树结构
+     *
+     * @param menus 菜单列表
+     * @return 树结构列表
+     */
+    public List<SysMobileMenu> buildMobileMenuTree(List<SysMobileMenu> menus);
+
     /**
      * 构建前端所需要下拉树结构
      * 
@@ -95,6 +108,14 @@ public interface ISysMenuService extends CrudService<SysMenu>
      */
     public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus);
 
+    /**
+     * 构建移动端前端所需要下拉树结构
+     *
+     * @param menus 菜单列表
+     * @return 下拉树结构列表
+     */
+    public List<TreeMobileSelect> buildMobileMenuTreeSelect(List<SysMobileMenu> menus);
+
     /**
      * 根据菜单ID查询信息
      * 

+ 2 - 2
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/SysLoginService.java

@@ -95,8 +95,8 @@ public class SysLoginService {
             String status = list.get(0).getStatus();
             String domain = list.get(0).getDomain();
             if(status.equals("1")){
-                recordLogininfor(username, Constants.LOGIN_FAIL, "租户已停用,请联系管理员");
-                throw new BusinessException("对不起,租户已停用,请联系管理员");
+                recordLogininfor(username, Constants.LOGIN_FAIL, "系统已停用,请联系管理员");
+                throw new BusinessException("对不起,系统已停用,请联系管理员");
             }
         }
 

+ 72 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/SysMobileMenuService.java

@@ -1,5 +1,6 @@
 package com.usky.system.service;
 
+import com.usky.system.domain.SysMenu;
 import com.usky.system.domain.SysMobileMenu;
 import com.usky.common.mybatis.core.CrudService;
 
@@ -20,4 +21,75 @@ public interface SysMobileMenuService extends CrudService<SysMobileMenu> {
      * @return
      */
     List<SysMobileMenu> moveRoute();
+
+    /**
+     * 手机APP-首页路由
+     * @return
+     */
+    List<SysMobileMenu> moveAppRoute(String domain);
+
+    /**
+     * 根据用户查询系统菜单列表
+     *
+     * @param menu 菜单信息
+     * @param userId 用户ID
+     * @return 菜单列表
+     */
+    public List<SysMobileMenu> selectMobileMenuList(SysMobileMenu menu, Long userId);
+
+    /**
+     * 根据菜单ID查询信息
+     *
+     * @param menuId 菜单ID
+     * @return 菜单信息
+     */
+    public SysMobileMenu selectMenuById(Long menuId);
+
+    /**
+     * 校验菜单名称是否唯一
+     *
+     * @param menu 菜单信息
+     * @return 结果
+     */
+    public String checkMenuNameUnique(SysMobileMenu menu);
+
+    /**
+     * 新增保存菜单信息
+     *
+     * @param menu 菜单信息
+     * @return 结果
+     */
+    public int insertMobileMenu(SysMobileMenu menu);
+
+    /**
+     * 修改保存菜单信息
+     *
+     * @param menu 菜单信息
+     * @return 结果
+     */
+    public int updateMenu(SysMobileMenu menu);
+
+    /**
+     * 删除菜单管理信息
+     *
+     * @param menuId 菜单ID
+     * @return 结果
+     */
+    public int deleteMenuById(Long menuId);
+
+    /**
+     * 是否存在菜单子节点
+     *
+     * @param menuId 菜单ID
+     * @return 结果 true 存在 false 不存在
+     */
+    public boolean hasChildByMenuId(Long menuId);
+
+    /**
+     * 查询菜单是否存在角色
+     *
+     * @param menuId 菜单ID
+     * @return 结果 true 存在 false 不存在
+     */
+    public boolean checkMenuExistRole(Long menuId);
 }

+ 16 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/SysMobilePlatformMenuService.java

@@ -0,0 +1,16 @@
+package com.usky.system.service;
+
+import com.usky.system.domain.SysMobilePlatformMenu;
+import com.usky.common.mybatis.core.CrudService;
+
+/**
+ * <p>
+ * 移动端_平台和菜单关联表 服务类
+ * </p>
+ *
+ * @author JCB
+ * @since 2023-02-16
+ */
+public interface SysMobilePlatformMenuService extends CrudService<SysMobilePlatformMenu> {
+
+}

+ 8 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/SysPlatformMenuService.java

@@ -2,8 +2,10 @@ package com.usky.system.service;
 
 import com.usky.common.mybatis.core.CrudService;
 import com.usky.system.domain.SysMenu;
+import com.usky.system.domain.SysMobileMenu;
 import com.usky.system.domain.SysPlatformMenu;
 import com.usky.system.service.vo.TenantMenuVo;
+import com.usky.system.service.vo.MobileTenantMenuVO;
 
 import java.util.List;
 import java.util.Map;
@@ -20,9 +22,15 @@ public interface SysPlatformMenuService extends CrudService<SysPlatformMenu> {
 
     List<SysMenu> getPlatformMenuList(Integer platformId);
 
+    List<SysMobileMenu> getMobilePlatformMenuList(Integer platformId);
+
     Long[] selectPlatformMenu(Integer tenantId);
 
+    Long[] selectMobilePlatformMenu(Integer tenantId);
+
     Map<String, Object> getMenuList(Integer platformId, Integer tenantId);
 
     void updateMenu(TenantMenuVo tenantMenuVo);
+
+    void updateMobileMenu(MobileTenantMenuVO mobileTenantMenuVO);
 }

+ 5 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/SysPlatformService.java

@@ -4,6 +4,7 @@ import com.usky.common.core.bean.CommonPage;
 import com.usky.common.mybatis.core.CrudService;
 import com.usky.system.domain.SysPlatform;
 import com.usky.system.service.vo.PlatformMenuVo;
+import com.usky.system.service.vo.MobilePlatformMenuVO;
 import com.usky.system.service.vo.SysPlatformVo;
 
 import java.util.List;
@@ -24,5 +25,9 @@ public interface SysPlatformService extends CrudService<SysPlatform> {
 
     Long[] getPlatformMenu(Long platformId);
 
+    Long[] getMobilePlatformMenu(Long platformId);
+
     void updatePlatformMenu(PlatformMenuVo platformMenuVo);
+
+    void updateMobilePlatformMenu(MobilePlatformMenuVO mobilePlatformMenuV0);
 }

+ 2 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/SysTenantService.java

@@ -20,6 +20,8 @@ import java.util.List;
 public interface SysTenantService extends CrudService<SysTenant> {
     List<SysTenantVo> getUserData();
 
+    List<SysTenant> getAppData(String domain);
+
     CommonPage<SysTenantTwoVo> getTenantData(SysTenantOneVo sysTenantOneVo);
 
     void addTenantData(SysTenant sysTenant);

+ 101 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysMenuServiceImpl.java

@@ -5,6 +5,7 @@ import com.usky.common.core.util.StringUtils;
 import com.usky.common.mybatis.core.AbstractCrudService;
 import com.usky.common.security.utils.SecurityUtils;
 import com.usky.system.domain.SysMenu;
+import com.usky.system.domain.SysMobileMenu;
 import com.usky.system.domain.SysRole;
 import com.usky.system.domain.SysUserVO;
 import com.usky.system.domain.constants.UserConstants;
@@ -15,6 +16,7 @@ import com.usky.system.service.ISysMenuService;
 import com.usky.system.service.vo.MetaVo;
 import com.usky.system.service.vo.RouterVo;
 import com.usky.system.service.vo.TreeSelect;
+import com.usky.system.service.vo.TreeMobileSelect;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -91,6 +93,14 @@ public class SysMenuServiceImpl extends AbstractCrudService<SysMenuMapper, SysMe
         return menuList;
     }
 
+
+    @Override
+    public List<SysMobileMenu> selectMobileMenuListOne(Long userId)
+    {
+        List<SysMobileMenu> menuList = menuMapper.selectMobileMenuListByUserIdOne(userId);
+        return menuList;
+    }
+
     /**
      * 根据用户ID查询权限
      *
@@ -262,6 +272,38 @@ public class SysMenuServiceImpl extends AbstractCrudService<SysMenuMapper, SysMe
         return returnList;
     }
 
+    /**
+     * 构建移动端前端所需要树结构
+     *
+     * @param menus 菜单列表
+     * @return 树结构列表
+     */
+    @Override
+    public List<SysMobileMenu> buildMobileMenuTree(List<SysMobileMenu> menus)
+    {
+        List<SysMobileMenu> returnList = new ArrayList<SysMobileMenu>();
+        List<Long> tempList = new ArrayList<Long>();
+        for (SysMobileMenu dept : menus)
+        {
+            tempList.add(dept.getMenuId());
+        }
+        for (Iterator<SysMobileMenu> iterator = menus.iterator(); iterator.hasNext();)
+        {
+            SysMobileMenu menu = (SysMobileMenu) iterator.next();
+            // 如果是顶级节点, 遍历该父节点的所有子节点
+            if (!tempList.contains(menu.getParentId()))
+            {
+                recursionMobileFn(menus, menu);
+                returnList.add(menu);
+            }
+        }
+        if (returnList.isEmpty())
+        {
+            returnList = menus;
+        }
+        return returnList;
+    }
+
     /**
      * 构建前端所需要下拉树结构
      *
@@ -275,6 +317,19 @@ public class SysMenuServiceImpl extends AbstractCrudService<SysMenuMapper, SysMe
         return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
     }
 
+    /**
+     * 构建移动端前端所需要下拉树结构
+     *
+     * @param menus 菜单列表
+     * @return 下拉树结构列表
+     */
+    @Override
+    public List<TreeMobileSelect> buildMobileMenuTreeSelect(List<SysMobileMenu> menus)
+    {
+        List<SysMobileMenu> menuTrees = buildMobileMenuTree(menus);
+        return menuTrees.stream().map(TreeMobileSelect::new).collect(Collectors.toList());
+    }
+
     /**
      * 根据菜单ID查询信息
      *
@@ -513,6 +568,26 @@ public class SysMenuServiceImpl extends AbstractCrudService<SysMenuMapper, SysMe
         }
     }
 
+    /**
+     * 移动端递归列表
+     *
+     * @param list
+     * @param t
+     */
+    private void recursionMobileFn(List<SysMobileMenu> list, SysMobileMenu t)
+    {
+        // 得到子节点列表
+        List<SysMobileMenu> childList = getChildMobileList(list, t);
+        t.setChildren(childList);
+        for (SysMobileMenu tChild : childList)
+        {
+            if (hasMobileChild(list, tChild))
+            {
+                recursionMobileFn(list, tChild);
+            }
+        }
+    }
+
     /**
      * 得到子节点列表
      */
@@ -531,6 +606,24 @@ public class SysMenuServiceImpl extends AbstractCrudService<SysMenuMapper, SysMe
         return tlist;
     }
 
+    /**
+     * 得到移动端子节点列表
+     */
+    private List<SysMobileMenu> getChildMobileList(List<SysMobileMenu> list, SysMobileMenu t)
+    {
+        List<SysMobileMenu> tlist = new ArrayList<SysMobileMenu>();
+        Iterator<SysMobileMenu> it = list.iterator();
+        while (it.hasNext())
+        {
+            SysMobileMenu n = (SysMobileMenu) it.next();
+            if (n.getParentId().longValue() == t.getMenuId())
+            {
+                tlist.add(n);
+            }
+        }
+        return tlist;
+    }
+
     /**
      * 判断是否有子节点
      */
@@ -538,4 +631,12 @@ public class SysMenuServiceImpl extends AbstractCrudService<SysMenuMapper, SysMe
     {
         return getChildList(list, t).size() > 0 ? true : false;
     }
+
+    /**
+     * 判断移动端是否有子节点
+     */
+    private boolean hasMobileChild(List<SysMobileMenu> list, SysMobileMenu t)
+    {
+        return getChildMobileList(list, t).size() > 0 ? true : false;
+    }
 }

+ 161 - 8
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysMobileMenuServiceImpl.java

@@ -7,23 +7,20 @@ import com.usky.common.core.constants.Constants;
 import com.usky.common.core.util.StringUtils;
 import com.usky.common.security.utils.SecurityUtils;
 import com.usky.system.controller.web.SysMenuController;
-import com.usky.system.domain.SysMenu;
-import com.usky.system.domain.SysMobileMenu;
-import com.usky.system.domain.SysMobileTenantMenu;
+import com.usky.system.domain.*;
 import com.usky.system.domain.constants.UserConstants;
 import com.usky.system.mapper.SysMobileMenuMapper;
+import com.usky.system.mapper.SysRoleMenuMapper;
 import com.usky.system.service.SysMobileMenuService;
 import com.usky.common.mybatis.core.AbstractCrudService;
 import com.usky.system.service.SysMobileTenantMenuService;
+import com.usky.system.service.SysTenantService;
 import com.usky.system.service.vo.MetaVo;
 import com.usky.system.service.vo.RouterVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
+import java.util.*;
 
 /**
  * <p>
@@ -36,9 +33,107 @@ import java.util.List;
 @Service
 public class SysMobileMenuServiceImpl extends AbstractCrudService<SysMobileMenuMapper, SysMobileMenu> implements SysMobileMenuService {
 
+    @Autowired
+    private SysMobileMenuMapper sysMobileMenuMapper;
+
+    @Autowired
+    private SysRoleMenuMapper sysRoleMenuMapper;
+
     @Autowired
     private SysMobileTenantMenuService sysMobileTenantMenuService;
 
+    @Autowired
+    private SysTenantService sysTenantService;
+
+    /**
+     * 查询系统菜单列表
+     *
+     * @param menu 菜单信息
+     * @return 菜单列表
+     */
+    @Override
+    public List<SysMobileMenu> selectMobileMenuList(SysMobileMenu menu, Long userId)
+    {
+        List<SysMobileMenu> menuList = null;
+        // 管理员显示所有菜单信息
+        if (SysUserVO.isAdmin(userId))
+        {
+            menuList = sysMobileMenuMapper.selectMobileMenuList(menu);
+        }
+        else
+        {
+            menu.getParams().put("userId", userId);
+            menuList = sysMobileMenuMapper.selectMobileMenuListByUserId(menu);
+        }
+        return menuList;
+    }
+
+    /**
+     * 根据菜单ID查询信息
+     *
+     * @param menuId 菜单ID
+     * @return 菜单信息
+     */
+    @Override
+    public SysMobileMenu selectMenuById(Long menuId)
+    {
+        return sysMobileMenuMapper.selectMenuById(menuId);
+    }
+
+    /**
+     * 修改保存菜单信息
+     *
+     * @param menu 菜单信息
+     * @return 结果
+     */
+    @Override
+    public int updateMenu(SysMobileMenu menu)
+    {
+        return sysMobileMenuMapper.updateMenu(menu);
+    }
+
+    /**
+     * 删除菜单管理信息
+     *
+     * @param menuId 菜单ID
+     * @return 结果
+     */
+    @Override
+    public int deleteMenuById(Long menuId)
+    {
+        return sysMobileMenuMapper.deleteMenuById(menuId);
+    }
+
+    /**
+     * 校验菜单名称是否唯一
+     *
+     * @param menu 菜单信息
+     * @return 结果
+     */
+    @Override
+    public String checkMenuNameUnique(SysMobileMenu menu)
+    {
+        Long menuId = Objects.isNull(menu.getMenuId()) ? -1L : menu.getMenuId();
+        SysMobileMenu info = sysMobileMenuMapper.checkMobileMenuNameUnique(menu.getMenuName(), menu.getParentId());
+        if (Objects.nonNull(info) && info.getMenuId() != menuId.longValue())
+        {
+            return UserConstants.NOT_UNIQUE;
+        }
+        return UserConstants.UNIQUE;
+    }
+
+    /**
+     * 新增保存菜单信息
+     *
+     * @param menu 菜单信息
+     * @return 结果
+     */
+    @Override
+    public int insertMobileMenu(SysMobileMenu menu)
+    {
+        return sysMobileMenuMapper.insertMobileMenu(menu);
+    }
+
     @Override
     public List<SysMobileMenu> moveRoute(){
         List<SysMobileMenu> list = new ArrayList<>();
@@ -61,6 +156,64 @@ public class SysMobileMenuServiceImpl extends AbstractCrudService<SysMobileMenuM
         return list;
     }
 
+    @Override
+    public List<SysMobileMenu> moveAppRoute(String domain){
+        List<SysMobileMenu> list = new ArrayList<>();
+        List<SysTenant> list1 = sysTenantService.getAppData(domain);
+
+        if(CollectionUtils.isNotEmpty(list1)){
+            Integer tenantId = list1.get(0).getId();
+            String platformId = list1.get(0).getSystemName();
+            LambdaQueryWrapper<SysMobileTenantMenu> query = Wrappers.lambdaQuery();
+            query.eq(SysMobileTenantMenu::getTenantId, tenantId);
+            List<SysMobileTenantMenu> tenantMenuList = sysMobileTenantMenuService.list(query);
+            if (CollectionUtils.isNotEmpty(tenantMenuList)){
+                List<Long> menuIdList = new ArrayList<>();
+                for (int i = 0; i < tenantMenuList.size(); i++) {
+                    menuIdList.add(tenantMenuList.get(i).getMenuId());
+                }
+                LambdaQueryWrapper<SysMobileMenu> queryOne = Wrappers.lambdaQuery();
+                queryOne.select(SysMobileMenu::getMenuId,SysMobileMenu::getMenuName,SysMobileMenu::getParentId,SysMobileMenu::getOrderNum,
+                        SysMobileMenu::getPath,SysMobileMenu::getComponent,SysMobileMenu::getIsFrame,SysMobileMenu::getIsCache,SysMobileMenu::getMenuType,
+                        SysMobileMenu::getVisible,SysMobileMenu::getStatus,SysMobileMenu::getPerms,SysMobileMenu::getIcon,SysMobileMenu::getCreateBy,
+                        SysMobileMenu::getCreateTime,SysMobileMenu::getUpdateBy,SysMobileMenu::getUpdateTime,SysMobileMenu::getRemark)
+                        .in(SysMobileMenu::getMenuId, menuIdList)
+                        .eq(SysMobileMenu::getVisible,0)
+                        .eq(SysMobileMenu::getStatus,0);
+                queryOne.orderByAsc(SysMobileMenu::getOrderNum);
+                List<SysMobileMenu> menuList = this.list(queryOne);
+                list = getChildPerms(menuList, 0);
+            }
+        }
+        return list;
+    }
+
+    /**
+     * 是否存在菜单子节点
+     *
+     * @param menuId 菜单ID
+     * @return 结果
+     */
+    @Override
+    public boolean hasChildByMenuId(Long menuId)
+    {
+        int result = sysMobileMenuMapper.hasChildByMenuId(menuId);
+        return result > 0 ? true : false;
+    }
+
+    /**
+     * 查询菜单使用数量
+     *
+     * @param menuId 菜单ID
+     * @return 结果
+     */
+    @Override
+    public boolean checkMenuExistRole(Long menuId)
+    {
+        int result = sysRoleMenuMapper.checkMenuExistRole(menuId);
+        return result > 0 ? true : false;
+    }
+
     /**
      * 根据父节点的ID获取所有子节点
      *
@@ -115,7 +268,7 @@ public class SysMobileMenuServiceImpl extends AbstractCrudService<SysMobileMenuM
         while (it.hasNext())
         {
             SysMobileMenu n = (SysMobileMenu) it.next();
-            if (n.getParentId().longValue() == t.getMenuId().longValue())
+            if (n.getParentId().longValue() == t.getMenuId())
             {
                 tlist.add(n);
             }

+ 20 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysMobilePlatformMenuServiceImpl.java

@@ -0,0 +1,20 @@
+package com.usky.system.service.impl;
+
+import com.usky.system.domain.SysMobilePlatformMenu;
+import com.usky.system.mapper.SysMobilePlatformMenuMapper;
+import com.usky.system.service.SysMobilePlatformMenuService;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 移动端_平台和菜单关联表 服务实现类
+ * </p>
+ *
+ * @author JCB
+ * @since 2023-02-16
+ */
+@Service
+public class SysMobilePlatformMenuServiceImpl extends AbstractCrudService<SysMobilePlatformMenuMapper, SysMobilePlatformMenu> implements SysMobilePlatformMenuService {
+
+}

+ 110 - 21
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysPlatformMenuServiceImpl.java

@@ -4,15 +4,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.usky.common.mybatis.core.AbstractCrudService;
 import com.usky.system.domain.SysMenu;
+import com.usky.system.domain.SysMobileMenu;
 import com.usky.system.domain.SysPlatformMenu;
 import com.usky.system.domain.SysTenantMenu;
+import com.usky.system.domain.SysMobileTenantMenu;
 import com.usky.system.mapper.SysPlatformMenuMapper;
+import com.usky.system.service.SysMobileTenantMenuService;
 import com.usky.system.service.SysPlatformMenuService;
 import com.usky.system.service.SysTenantMenuService;
-import com.usky.system.service.vo.SysMenuOneVo;
-import com.usky.system.service.vo.SysMenuTwoVo;
-import com.usky.system.service.vo.SysMenuVo;
-import com.usky.system.service.vo.TenantMenuVo;
+import com.usky.system.service.vo.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -36,11 +36,17 @@ public class SysPlatformMenuServiceImpl extends AbstractCrudService<SysPlatformM
     @Autowired
     private SysTenantMenuService sysTenantMenuService;
 
+    @Autowired
+    private SysMobileTenantMenuService sysMobileTenantMenuService;
 
     public List<SysMenu> getPlatformMenuList(Integer platformId){
         return baseMapper.getMenuList(platformId, null);
     }
 
+    public List<SysMobileMenu> getMobilePlatformMenuList(Integer platformId){
+        return baseMapper.getMobileMenuList(platformId, null);
+    }
+
     public Long[] selectPlatformMenu(Integer tenantId){
         LambdaQueryWrapper<SysTenantMenu> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(SysTenantMenu::getTenantId, tenantId);
@@ -52,6 +58,17 @@ public class SysPlatformMenuServiceImpl extends AbstractCrudService<SysPlatformM
         return arr;
     }
 
+    public Long[] selectMobilePlatformMenu(Integer tenantId){
+        LambdaQueryWrapper<SysMobileTenantMenu> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(SysMobileTenantMenu::getTenantId, tenantId);
+        List<SysMobileTenantMenu> menuList = sysMobileTenantMenuService.list(queryWrapper);
+        Long[] arr = new Long[menuList.size()];
+        for (int i = 0; i < menuList.size(); i++) {
+            arr[i] = menuList.get(i).getMenuId();
+        }
+        return arr;
+    }
+
 
     public Map<String, Object> getMenuList(Integer platformId, Integer tenantId) {
         //全部目录查询
@@ -178,6 +195,7 @@ public class SysPlatformMenuServiceImpl extends AbstractCrudService<SysPlatformM
     @Override
     @Transactional
     public void updateMenu(TenantMenuVo tenantMenuVo) {
+        List arr3 = new ArrayList();
         Long[] arr = tenantMenuVo.getMenuIds();
         //菜单ID
         List<SysMenu> menuIdList = baseMapper.getMenuIdList(arr, "F");
@@ -186,25 +204,39 @@ public class SysPlatformMenuServiceImpl extends AbstractCrudService<SysPlatformM
             arr1[i] = menuIdList.get(i).getParentId();
         }
         //目录ID
-        List<SysMenu> menuIdListOne = baseMapper.getMenuIdList(arr1, "C");
-        Long arr2[] = new Long[menuIdListOne.size()];
-        for (int i = 0; i < menuIdListOne.size(); i++) {
-            arr2[i] = menuIdListOne.get(i).getParentId();
-        }
-        List<SysMenu> menuIdListTwo = baseMapper.getMenuIdList(arr, "C");
-        Long arr4[] = new Long[menuIdListTwo.size()];
-        for (int i = 0; i < menuIdListTwo.size(); i++) {
-            arr4[i] = menuIdListTwo.get(i).getParentId();
-        }
-        Long[] arr5 = arrayMerge(arr1, arr2);
-        Long[] arr6 = arrayMerge(arr5, arr4);
-        Long[] arr7 = arrayMerge(arr6, arr);
-        List arr3 = new ArrayList();
-        for (int i = 0; i < arr7.length; i++) {
-            if (!arr3.contains(arr7[i])) {
-                arr3.add(arr7[i]);
+        if(arr1.length > 0){
+            List<SysMenu> menuIdListOne = baseMapper.getMenuIdList(arr1, "C");
+            Long arr2[] = new Long[menuIdListOne.size()];
+            for (int i = 0; i < menuIdListOne.size(); i++) {
+                arr2[i] = menuIdListOne.get(i).getParentId();
+            }
+            List<SysMenu> menuIdListTwo = baseMapper.getMenuIdList(arr, "C");
+            Long arr4[] = new Long[menuIdListTwo.size()];
+            for (int i = 0; i < menuIdListTwo.size(); i++) {
+                arr4[i] = menuIdListTwo.get(i).getParentId();
+            }
+            Long[] arr5 = arrayMerge(arr1, arr2);
+            Long[] arr6 = arrayMerge(arr5, arr4);
+            Long[] arr7 = arrayMerge(arr6, arr);
+            for (int i = 0; i < arr7.length; i++) {
+                if (!arr3.contains(arr7[i])) {
+                    arr3.add(arr7[i]);
+                }
+            }
+        }else{
+            List<SysMenu> menuIdListTwo = baseMapper.getMenuIdList(arr, "C");
+            Long arr4[] = new Long[menuIdListTwo.size()];
+            for (int i = 0; i < menuIdListTwo.size(); i++) {
+                arr4[i] = menuIdListTwo.get(i).getParentId();
+            }
+            Long[] arr7 = arrayMerge(arr4, arr);
+            for (int i = 0; i < arr7.length; i++) {
+                if (!arr3.contains(arr7[i])) {
+                    arr3.add(arr7[i]);
+                }
             }
         }
+
 //        Long[] arr3 =ifRepeat2(arr6);
 //        Long arr3[] = new Long[arr1.length+arr2.length+arr.length];
 //        for (int i=0;i<arr1.length;i++){
@@ -230,6 +262,63 @@ public class SysPlatformMenuServiceImpl extends AbstractCrudService<SysPlatformM
         }
     }
 
+    @Transactional
+    public void updateMobileMenu(MobileTenantMenuVO mobileTenantMenuVO) {
+        List arr3 = new ArrayList();
+        Long[] arr = mobileTenantMenuVO.getMenuIds();
+        //菜单ID
+        List<SysMobileMenu> menuIdList = baseMapper.getMobileMenuIdList(arr, "F");
+        Long arr1[] = new Long[menuIdList.size()];
+        for (int i = 0; i < menuIdList.size(); i++) {
+            arr1[i] = menuIdList.get(i).getParentId();
+        }
+        //目录ID
+        if(arr1.length > 0){
+            List<SysMobileMenu> menuIdListOne = baseMapper.getMobileMenuIdList(arr1, "C");
+            Long arr2[] = new Long[menuIdListOne.size()];
+            for (int i = 0; i < menuIdListOne.size(); i++) {
+                arr2[i] = menuIdListOne.get(i).getParentId();
+            }
+            List<SysMobileMenu> menuIdListTwo = baseMapper.getMobileMenuIdList(arr, "C");
+            Long arr4[] = new Long[menuIdListTwo.size()];
+            for (int i = 0; i < menuIdListTwo.size(); i++) {
+                arr4[i] = menuIdListTwo.get(i).getParentId();
+            }
+            Long[] arr5 = arrayMerge(arr1, arr2);
+            Long[] arr6 = arrayMerge(arr5, arr4);
+            Long[] arr7 = arrayMerge(arr6, arr);
+            for (int i = 0; i < arr7.length; i++) {
+                if (!arr3.contains(arr7[i])) {
+                    arr3.add(arr7[i]);
+                }
+            }
+        }else{
+            List<SysMobileMenu> menuIdListTwo = baseMapper.getMobileMenuIdList(arr, "C");
+            Long arr4[] = new Long[menuIdListTwo.size()];
+            for (int i = 0; i < menuIdListTwo.size(); i++) {
+                arr4[i] = menuIdListTwo.get(i).getParentId();
+            }
+            Long[] arr7 = arrayMerge(arr4, arr);
+            for (int i = 0; i < arr7.length; i++) {
+                if (!arr3.contains(arr7[i])) {
+                    arr3.add(arr7[i]);
+                }
+            }
+        }
+
+        // 删除租户菜单关联
+        baseMapper.deleteMobileTenantMenuBy(mobileTenantMenuVO.getTenantId());
+        //新增菜单
+        if (arr3.size() > 0) {
+            for (int i = 0; i < arr3.size(); i++) {
+                SysMobileTenantMenu sysMobileTenantMenu = new SysMobileTenantMenu();
+                sysMobileTenantMenu.setMenuId((Long) arr3.get(i));
+                sysMobileTenantMenu.setTenantId(mobileTenantMenuVO.getTenantId());
+                sysMobileTenantMenuService.save(sysMobileTenantMenu);
+            }
+        }
+    }
+
     public Long[] arrayMerge(Long[] arr1, Long[] arr2) {
         Long arr3[] = new Long[arr1.length + arr2.length];
         for (int i = 0; i < arr1.length; i++) {

+ 126 - 17
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysPlatformServiceImpl.java

@@ -6,10 +6,13 @@ import com.usky.common.security.utils.SecurityUtils;
 import com.usky.common.core.bean.CommonPage;
 import com.usky.common.mybatis.core.AbstractCrudService;
 import com.usky.system.domain.SysMenu;
+import com.usky.system.domain.SysMobileMenu;
 import com.usky.system.domain.SysPlatform;
 import com.usky.system.domain.SysPlatformMenu;
+import com.usky.system.domain.SysMobilePlatformMenu;
 import com.usky.system.mapper.SysMenuMapper;
 import com.usky.system.mapper.SysPlatformMapper;
+import com.usky.system.service.SysMobilePlatformMenuService;
 import com.usky.system.service.SysPlatformMenuService;
 import com.usky.system.service.SysPlatformService;
 import com.usky.system.service.vo.*;
@@ -38,6 +41,8 @@ public class SysPlatformServiceImpl extends AbstractCrudService<SysPlatformMappe
     private SysMenuMapper menuMapper;
     @Autowired
     private SysPlatformMenuService sysPlatformMenuService;
+    @Autowired
+    private SysMobilePlatformMenuService sysMobilePlatformMenuService;
 
     @Override
     public List<SysPlatform> getPlatformBoxList() {
@@ -75,6 +80,18 @@ public class SysPlatformServiceImpl extends AbstractCrudService<SysPlatformMappe
         return arr;
     }
 
+    @Override
+    public Long[] getMobilePlatformMenu(Long platformId) {
+        LambdaQueryWrapper<SysMobilePlatformMenu> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(SysMobilePlatformMenu::getPlatformId, platformId);
+        List<SysMobilePlatformMenu> menuList = sysMobilePlatformMenuService.list(queryWrapper);
+        Long[] arr = new Long[menuList.size()];
+        for (int i = 0; i < menuList.size(); i++) {
+            arr[i] = menuList.get(i).getMenuId().longValue();
+        }
+        return arr;
+    }
+
 
     @Override
     @Transactional
@@ -90,9 +107,12 @@ public class SysPlatformServiceImpl extends AbstractCrudService<SysPlatformMappe
         }else {
             sysPlatform.setId(platformMenuVo.getPlatformId().intValue());
             sysPlatform.setPlatformName(platformMenuVo.getPlatformName());
+            sysPlatform.setUpdateBy(SecurityUtils.getUsername());
+            sysPlatform.setUpdateTime(LocalDateTime.now());
             this.updateById(sysPlatform);
         }
 
+        List arr3 = new ArrayList();
         Long[] arr = platformMenuVo.getMenuIds();
         //菜单ID
         List<SysMenu> menuIdList = baseMapper.getMenuIdListOne(arr, "F");
@@ -101,24 +121,38 @@ public class SysPlatformServiceImpl extends AbstractCrudService<SysPlatformMappe
             arr1[i] = menuIdList.get(i).getParentId();
         }
         //目录ID
-        List<SysMenu> menuIdListOne = baseMapper.getMenuIdListOne(arr1, "C");
-        Long arr2[] = new Long[menuIdListOne.size()];
-        for (int i = 0; i < menuIdListOne.size(); i++) {
-            arr2[i] = menuIdListOne.get(i).getParentId();
-        }
-        List<SysMenu> menuIdListTwo = baseMapper.getMenuIdListOne(arr, "C");
-        Long arr4[] = new Long[menuIdListTwo.size()];
-        for (int i = 0; i < menuIdListTwo.size(); i++) {
-            arr4[i] = menuIdListTwo.get(i).getParentId();
-        }
+        if(arr1.length > 0){
+            List<SysMenu> menuIdListOne = baseMapper.getMenuIdListOne(arr1, "C");
+            Long arr2[] = new Long[menuIdListOne.size()];
+            for (int i = 0; i < menuIdListOne.size(); i++) {
+                arr2[i] = menuIdListOne.get(i).getParentId();
+            }
+            List<SysMenu> menuIdListTwo = baseMapper.getMenuIdListOne(arr, "C");
+            Long arr4[] = new Long[menuIdListTwo.size()];
+            for (int i = 0; i < menuIdListTwo.size(); i++) {
+                arr4[i] = menuIdListTwo.get(i).getParentId();
+            }
 
-        Long[] arr5 = arrayMerge(arr1, arr2);
-        Long[] arr6 = arrayMerge(arr5, arr4);
-        Long[] arr7 = arrayMerge(arr6, arr);
-        List arr3 = new ArrayList();
-        for (int i = 0; i < arr7.length; i++) {
-            if (!arr3.contains(arr7[i])) {
-                arr3.add(arr7[i]);
+            Long[] arr5 = arrayMerge(arr1, arr2);
+            Long[] arr6 = arrayMerge(arr5, arr4);
+            Long[] arr7 = arrayMerge(arr6, arr);
+            for (int i = 0; i < arr7.length; i++) {
+                if (!arr3.contains(arr7[i])) {
+                    arr3.add(arr7[i]);
+                }
+            }
+        }else{
+            List<SysMenu> menuIdListTwo = baseMapper.getMenuIdListOne(arr, "C");
+            Long arr4[] = new Long[menuIdListTwo.size()];
+            for (int i = 0; i < menuIdListTwo.size(); i++) {
+                arr4[i] = menuIdListTwo.get(i).getParentId();
+            }
+
+            Long[] arr7 = arrayMerge(arr4, arr);
+            for (int i = 0; i < arr7.length; i++) {
+                if (!arr3.contains(arr7[i])) {
+                    arr3.add(arr7[i]);
+                }
             }
         }
         // 删除租户菜单关联
@@ -135,6 +169,81 @@ public class SysPlatformServiceImpl extends AbstractCrudService<SysPlatformMappe
 
     }
 
+    @Transactional
+    public void updateMobilePlatformMenu(MobilePlatformMenuVO mobilePlatformMenuVO) {
+        SysPlatform sysPlatform = new SysPlatform();
+        if (mobilePlatformMenuVO.getPlatformId().intValue() == 0) {
+            sysPlatform.setPlatformName(mobilePlatformMenuVO.getPlatformName());
+            sysPlatform.setCreateBy(SecurityUtils.getUsername());
+            sysPlatform.setCreateTime(LocalDateTime.now());
+            this.save(sysPlatform);
+            Integer fid = sysPlatform.getId();
+            mobilePlatformMenuVO.setPlatformId(fid.longValue());
+        }else {
+            sysPlatform.setId(mobilePlatformMenuVO.getPlatformId().intValue());
+            sysPlatform.setPlatformName(mobilePlatformMenuVO.getPlatformName());
+            sysPlatform.setUpdateBy(SecurityUtils.getUsername());
+            sysPlatform.setUpdateTime(LocalDateTime.now());
+            this.updateById(sysPlatform);
+        }
+
+        List arr3 = new ArrayList();
+        Long[] arr = mobilePlatformMenuVO.getMenuIds();
+        //菜单ID
+        List<SysMobileMenu> menuIdList = baseMapper.getMobileMenuIdListOne(arr, "F");
+        Long arr1[] = new Long[menuIdList.size()];
+        for (int i = 0; i < menuIdList.size(); i++) {
+            arr1[i] = menuIdList.get(i).getParentId();
+        }
+        //目录ID
+        if(arr1.length > 0){
+            List<SysMobileMenu> menuIdListOne = baseMapper.getMobileMenuIdListOne(arr1, "C");
+            Long arr2[] = new Long[menuIdListOne.size()];
+            for (int i = 0; i < menuIdListOne.size(); i++) {
+                arr2[i] = menuIdListOne.get(i).getParentId();
+            }
+            List<SysMobileMenu> menuIdListTwo = baseMapper.getMobileMenuIdListOne(arr, "C");
+            Long arr4[] = new Long[menuIdListTwo.size()];
+            for (int i = 0; i < menuIdListTwo.size(); i++) {
+                arr4[i] = menuIdListTwo.get(i).getParentId();
+            }
+
+            Long[] arr5 = arrayMerge(arr1, arr2);
+            Long[] arr6 = arrayMerge(arr5, arr4);
+            Long[] arr7 = arrayMerge(arr6, arr);
+            for (int i = 0; i < arr7.length; i++) {
+                if (!arr3.contains(arr7[i])) {
+                    arr3.add(arr7[i]);
+                }
+            }
+        }else{
+            List<SysMobileMenu> menuIdListTwo = baseMapper.getMobileMenuIdListOne(arr, "C");
+            Long arr4[] = new Long[menuIdListTwo.size()];
+            for (int i = 0; i < menuIdListTwo.size(); i++) {
+                arr4[i] = menuIdListTwo.get(i).getParentId();
+            }
+            Long[] arr7 = arrayMerge(arr4, arr);
+            for (int i = 0; i < arr7.length; i++) {
+                if (!arr3.contains(arr7[i])) {
+                    arr3.add(arr7[i]);
+                }
+            }
+        }
+
+        // 删除租户菜单关联
+        baseMapper.deleteMobilePlatformMenuBy(mobilePlatformMenuVO.getPlatformId());
+        //新增菜单
+        if (arr3.size() > 0) {
+            for (int i = 0; i < arr3.size(); i++) {
+                SysMobilePlatformMenu sysMobilePlatformMenu = new SysMobilePlatformMenu();
+                sysMobilePlatformMenu.setMenuId(((Long) arr3.get(i)).intValue());
+                sysMobilePlatformMenu.setPlatformId(mobilePlatformMenuVO.getPlatformId().intValue());
+                sysMobilePlatformMenuService.save(sysMobilePlatformMenu);
+            }
+        }
+
+    }
+
     public Long[] arrayMerge(Long[] arr1, Long[] arr2) {
         Long arr3[] = new Long[arr1.length + arr2.length];
         for (int i = 0; i < arr1.length; i++) {

+ 14 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysTenantServiceImpl.java

@@ -33,6 +33,18 @@ public class SysTenantServiceImpl extends AbstractCrudService<SysTenantMapper, S
         return list;
     }
 
+    /**
+     * 手机端APP租户管理-权限配置-目录查询
+     *
+     * @param domain
+     * @return
+     */
+    @Override
+    public List<SysTenant> getAppData(String domain){
+        List<SysTenant> list = baseMapper.getAppData(domain);
+        return list;
+    }
+
     /**
      * 租户管理-租户列表查询
      *
@@ -48,6 +60,7 @@ public class SysTenantServiceImpl extends AbstractCrudService<SysTenantMapper, S
                 sysTenantOneVo.getTenantManager(),
                 sysTenantOneVo.getTenantType(),
                 sysTenantOneVo.getStatus(),
+                sysTenantOneVo.getPlatformName(),
                 sysTenantOneVo.getStartTime(),
                 sysTenantOneVo.getEndTime(), null, null, sysTenantOneVo.getId());
         int total = 0;
@@ -62,6 +75,7 @@ public class SysTenantServiceImpl extends AbstractCrudService<SysTenantMapper, S
                 sysTenantOneVo.getTenantManager(),
                 sysTenantOneVo.getTenantType(),
                 sysTenantOneVo.getStatus(),
+                sysTenantOneVo.getPlatformName(),
                 sysTenantOneVo.getStartTime(),
                 sysTenantOneVo.getEndTime(),
                 current,

+ 39 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/vo/MobilePlatformMenuVO.java

@@ -0,0 +1,39 @@
+package com.usky.system.service.vo;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 租户和菜单关联表
+ * </p>
+ *
+ * @author ya
+ * @since 2022-05-18
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class MobilePlatformMenuVO implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 平台ID
+     */
+    private Long platformId;
+
+    /**
+     * 平台名称
+     */
+    private String platformName;
+
+    /**
+     * 菜单ID
+     */
+    private Long[] menuIds;
+
+}

+ 33 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/vo/MobileTenantMenuVO.java

@@ -0,0 +1,33 @@
+package com.usky.system.service.vo;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 租户和菜单关联表
+ * </p>
+ *
+ * @author zyj
+ * @since 2023-02-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class MobileTenantMenuVO {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 租户ID
+     */
+    private Long tenantId;
+
+    /**
+     * 菜单ID
+     */
+    private Long[] menuIds;
+}

+ 5 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/vo/SysTenantOneVo.java

@@ -54,6 +54,11 @@ public class SysTenantOneVo implements Serializable {
      */
     private String status;
 
+    /**
+     * 系统名称
+     */
+    private String platformName;
+
     /**
      * 当前页
      */

+ 78 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/vo/TreeMobileSelect.java

@@ -0,0 +1,78 @@
+package com.usky.system.service.vo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.usky.system.domain.SysDept;
+import com.usky.system.domain.SysMobileMenu;
+
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * Treeselect树结构实体类
+ *
+ * @author yq
+ */
+public class TreeMobileSelect {
+    private static final long serialVersionUID = 1L;
+
+    /** 节点ID */
+    private Long id;
+
+    /** 节点名称 */
+    private String label;
+
+    /** 子节点 */
+    @JsonInclude(JsonInclude.Include.NON_EMPTY)
+    private List<TreeMobileSelect> children;
+
+    public TreeMobileSelect()
+    {
+
+    }
+
+    public TreeMobileSelect(SysDept dept)
+    {
+        this.id = dept.getDeptId();
+        this.label = dept.getDeptName();
+        this.children = dept.getChildren().stream().map(TreeMobileSelect::new).collect(Collectors.toList());
+    }
+
+    public TreeMobileSelect(SysMobileMenu menu)
+    {
+        this.id = menu.getMenuId();
+        this.label = menu.getMenuName();
+        this.children = menu.getChildren().stream().map(TreeMobileSelect::new).collect(Collectors.toList());
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public String getLabel()
+    {
+        return label;
+    }
+
+    public void setLabel(String label)
+    {
+        this.label = label;
+    }
+
+    public List<TreeMobileSelect> getChildren()
+    {
+        return children;
+    }
+
+    public void setChildren(List<TreeMobileSelect> children)
+    {
+        this.children = children;
+    }
+}

+ 29 - 0
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysMenuMapper.xml

@@ -26,6 +26,28 @@
         <result property="remark" column="remark"/>
     </resultMap>
 
+    <resultMap type="com.usky.system.domain.SysMobileMenu" id="SysMobileMenuResult">
+        <id property="menuId" column="menu_id"/>
+        <result property="menuName" column="menu_name"/>
+        <result property="parentName" column="parent_name"/>
+        <result property="parentId" column="parent_id"/>
+        <result property="orderNum" column="order_num"/>
+        <result property="path" column="path"/>
+        <result property="component" column="component"/>
+        <result property="isFrame" column="is_frame"/>
+        <result property="isCache" column="is_cache"/>
+        <result property="menuType" column="menu_type"/>
+        <result property="visible" column="visible"/>
+        <result property="status" column="status"/>
+        <result property="perms" column="perms"/>
+        <result property="icon" column="icon"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="remark" column="remark"/>
+    </resultMap>
+
     <sql id="selectMenuVo">
         select menu_id,
                menu_name,
@@ -138,6 +160,13 @@
         order by m.parent_id, m.order_num
     </select>
 
+    <select id="selectMobileMenuListByUserIdOne" resultMap="SysMobileMenuResult">
+        select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status,
+        ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
+        from sys_mobile_menu m
+        order by m.parent_id, m.order_num
+    </select>
+
 
     <select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
         select distinct m.menu_id,

+ 141 - 1
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysMobileMenuMapper.xml

@@ -10,7 +10,6 @@
         <result column="order_num" property="orderNum" />
         <result column="path" property="path" />
         <result column="component" property="component" />
-        <result column="query" property="query" />
         <result column="is_frame" property="isFrame" />
         <result column="is_cache" property="isCache" />
         <result column="menu_type" property="menuType" />
@@ -25,4 +24,145 @@
         <result column="remark" property="remark" />
     </resultMap>
 
+    <sql id="selectMobileMenuVo">
+        select menu_id,
+               menu_name,
+               parent_id,
+               order_num,
+               path,
+               component,
+               is_frame,
+               is_cache,
+               menu_type,
+               visible,
+               status,
+               ifnull(perms, '') as perms,
+               icon,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from sys_mobile_menu
+    </sql>
+
+    <select id="selectMobileMenuList" parameterType="com.usky.system.domain.SysMobileMenu" resultMap="BaseResultMap">
+        <include refid="selectMobileMenuVo"/>
+        <where>
+            <if test="menuName != null and menuName != ''">
+                AND menu_name like concat('%', #{menuName}, '%')
+            </if>
+            <if test="visible != null and visible != ''">
+                AND visible = #{visible}
+            </if>
+            <if test="status != null and status != ''">
+                AND status = #{status}
+            </if>
+        </where>
+        order by parent_id, order_num
+    </select>
+
+
+    <select id="selectMenuById" parameterType="Long" resultMap="BaseResultMap">
+        <include refid="selectMobileMenuVo"/>
+        where menu_id = #{menuId}
+    </select>
+
+    <select id="selectMobileMenuListByUserId" parameterType="com.usky.system.domain.SysMobileMenu" resultMap="BaseResultMap">
+        select distinct m.menu_id, m.menu_name, m.parent_id, m.order_num, m.path, m.component, m.is_frame, m.is_cache, m.menu_type, m.visible, m.status,
+        ifnull(m.perms,'') as perms, m.icon, m.create_by, m.create_time, m.update_by, m.update_time, m.remark
+        from sys_mobile_menu m
+        left join sys_role_menu rm on m.menu_id = rm.menu_id
+        left join sys_user_role ur on rm.role_id = ur.role_id
+        left join sys_role ro on ur.role_id = ro.role_id
+        where ur.user_id = #{params.userId}
+        <if test="menuName != null and menuName != ''">
+            AND menu_name like concat('%', #{menuName}, '%')
+        </if>
+        <if test="visible != null and visible != ''">
+            AND visible = #{visible}
+        </if>
+        <if test="status != null and status != ''">
+            AND status = #{status}
+        </if>
+        order by m.parent_id, m.order_num
+    </select>
+
+    <select id="checkMobileMenuNameUnique" parameterType="com.usky.system.domain.SysMobileMenu" resultMap="BaseResultMap">
+        <include refid="selectMobileMenuVo"/>
+        where menu_name=#{menuName} and parent_id = #{parentId} limit 1
+    </select>
+
+    <select id="hasChildByMenuId" resultType="Integer">
+        select count(1)
+        from sys_mobile_menu
+        where parent_id = #{menuId}
+    </select>
+
+    <insert id="insertMobileMenu" parameterType="com.usky.system.domain.SysMobileMenu">
+        insert into sys_mobile_menu(
+        <if test="menuId != null and menuId != 0">menu_id,</if>
+        <if test="parentId != null and parentId != 0">parent_id,</if>
+        <if test="menuName != null and menuName != ''">menu_name,</if>
+        <if test="orderNum != null and orderNum != ''">order_num,</if>
+        <if test="path != null and path != ''">path,</if>
+        <if test="component != null and component != ''">component,</if>
+        <if test="isFrame != null and isFrame != ''">is_frame,</if>
+        <if test="isCache != null and isCache != ''">is_cache,</if>
+        <if test="menuType != null and menuType != ''">menu_type,</if>
+        <if test="visible != null">visible,</if>
+        <if test="status != null">status,</if>
+        <if test="perms !=null and perms != ''">perms,</if>
+        <if test="icon != null and icon != ''">icon,</if>
+        <if test="remark != null and remark != ''">remark,</if>
+        <if test="createBy != null and createBy != ''">create_by,</if>
+        create_time
+        )values(
+        <if test="menuId != null and menuId != 0">#{menuId},</if>
+        <if test="parentId != null and parentId != 0">#{parentId},</if>
+        <if test="menuName != null and menuName != ''">#{menuName},</if>
+        <if test="orderNum != null and orderNum != ''">#{orderNum},</if>
+        <if test="path != null and path != ''">#{path},</if>
+        <if test="component != null and component != ''">#{component},</if>
+        <if test="isFrame != null and isFrame != ''">#{isFrame},</if>
+        <if test="isCache != null and isCache != ''">#{isCache},</if>
+        <if test="menuType != null and menuType != ''">#{menuType},</if>
+        <if test="visible != null">#{visible},</if>
+        <if test="status != null">#{status},</if>
+        <if test="perms !=null and perms != ''">#{perms},</if>
+        <if test="icon != null and icon != ''">#{icon},</if>
+        <if test="remark != null and remark != ''">#{remark},</if>
+        <if test="createBy != null and createBy != ''">#{createBy},</if>
+        sysdate()
+        )
+    </insert>
+
+    <update id="updateMenu" parameterType="com.usky.system.domain.SysMobileMenu">
+        update sys_mobile_menu
+        <set>
+            <if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
+            <if test="parentId != null">parent_id = #{parentId},</if>
+            <if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
+            <if test="path != null and path != ''">path = #{path},</if>
+            <if test="component != null">component = #{component},</if>
+            <if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if>
+            <if test="isCache != null and isCache != ''">is_cache = #{isCache},</if>
+            <if test="menuType != null and menuType != ''">menu_type = #{menuType},</if>
+            <if test="visible != null">visible = #{visible},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="perms !=null">perms = #{perms},</if>
+            <if test="icon !=null and icon != ''">icon = #{icon},</if>
+            <if test="remark != null and remark != ''">remark = #{remark},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            update_time = sysdate()
+        </set>
+        where menu_id = #{menuId}
+    </update>
+
+    <delete id="deleteMenuById" parameterType="Long">
+        delete
+        from sys_mobile_menu
+        where menu_id = #{menuId}
+    </delete>
+
 </mapper>

+ 11 - 0
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysMobilePlatformMenuMapper.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usky.system.mapper.SysMobilePlatformMenuMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.system.domain.SysMobilePlatformMenu">
+        <id column="platform_id" property="platformId" />
+        <result column="menu_id" property="menuId" />
+    </resultMap>
+
+</mapper>

+ 21 - 0
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysPlatformMapper.xml

@@ -55,10 +55,31 @@
         </foreach>
     </select>
 
+    <select id="getMobileMenuIdListOne" resultType="com.usky.system.domain.SysMobileMenu">
+        SELECT
+        *
+        FROM
+        sys_mobile_menu
+        WHERE
+        status = 0
+        AND visible = 0
+        AND menu_type = #{menuType}
+        <if test="menuIds != null and menuIds.length > 0">
+            AND menu_id IN
+            <foreach collection="menuIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
     <delete id="deletePlatformMenuBy" parameterType="Long">
         delete from sys_platform_menu where platform_id=#{platformId}
     </delete>
 
+    <delete id="deleteMobilePlatformMenuBy" parameterType="Long">
+        delete from sys_mobile_platform_menu where platform_id=#{platformId}
+    </delete>
+
 
     <select id="getMenuListOne"  resultType="com.usky.system.domain.SysPlatformMenu" >
         SELECT

+ 42 - 4
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysPlatformMenuMapper.xml

@@ -21,6 +21,19 @@
         </if>
     </select>
 
+    <select id="getMobileMenuList"  resultType="com.usky.system.domain.SysMobileMenu" >
+        SELECT
+        a.*
+        FROM
+        sys_mobile_menu AS a
+        JOIN sys_mobile_platform_menu AS b ON a.menu_id = b.menu_id
+        WHERE
+        b.platform_id = #{platformId}
+        <if test="menuType != null and menuType != ''">
+            AND a.menu_type = #{menuType}
+        </if>
+    </select>
+
     <select id="getMenuIdList" resultType="com.usky.system.domain.SysMenu">
         SELECT
         a.*
@@ -31,10 +44,31 @@
         a.status = 0
         AND a.visible = 0
         AND a.menu_type = #{menuType}
-        AND a.menu_id IN
-        <foreach collection="menuIds" item="item" open="(" separator="," close=")">
-            #{item}
-        </foreach>
+        <if test="menuIds != null and menuIds.length > 0">
+            AND a.menu_id IN
+            <foreach collection="menuIds" item="item" open="(" separator="," close=")">
+                ${item}
+            </foreach>
+        </if>
+        group by a.menu_id
+    </select>
+
+    <select id="getMobileMenuIdList" resultType="com.usky.system.domain.SysMobileMenu">
+        SELECT
+        a.*
+        FROM
+        sys_mobile_menu AS a
+        JOIN sys_mobile_platform_menu AS b ON a.menu_id = b.menu_id
+        WHERE
+        a.status = 0
+        AND a.visible = 0
+        AND a.menu_type = #{menuType}
+        <if test="menuIds != null and menuIds.length > 0">
+            AND a.menu_id IN
+            <foreach collection="menuIds" item="item" open="(" separator="," close=")">
+                ${item}
+            </foreach>
+        </if>
         group by a.menu_id
     </select>
 
@@ -42,6 +76,10 @@
         delete from sys_tenant_menu where tenant_id=#{tenantId}
     </delete>
 
+    <delete id="deleteMobileTenantMenuBy" parameterType="Long">
+        delete from sys_mobile_tenant_menu where tenant_id=#{tenantId}
+    </delete>
+
 
     <select id="getMenuListOne"  resultType="com.usky.system.domain.SysTenantMenu" >
         SELECT

+ 13 - 0
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysTenantMapper.xml

@@ -35,6 +35,16 @@
         </where>
     </select>
 
+    <select id="getAppData" resultType="com.usky.system.domain.SysTenant">
+        SELECT
+        a.*
+        FROM
+        sys_tenant AS a
+        <where>
+            a.domain = #{domain}
+        </where>
+    </select>
+
     <select id="getTenantData" resultType="com.usky.system.service.vo.SysTenantTwoVo">
         SELECT
         a.*,b.platform_name
@@ -53,6 +63,9 @@
             <if test="tenantType != null and tenantType != ''">
                 and a.tenant_type = #{tenantType}
             </if>
+            <if test="platformName != null and platformName != ''">
+                and b.platform_name LIKE CONCAT(CONCAT('%', #{platformName}), '%')
+            </if>
             <if test="status != null and status != ''">
                 and a.status = #{status}
             </if>