Browse Source

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

gez 6 months ago
parent
commit
88dd19f7e8
30 changed files with 838 additions and 275 deletions
  1. 80 147
      base-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ip/IpUtils.java
  2. 21 0
      base-modules/service-system/service-system-api/src/main/java/com/usky/system/domain/SysOperLogVO.java
  3. 5 0
      base-modules/service-system/service-system-biz/pom.xml
  4. 4 2
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/SysLogininforController.java
  5. 31 4
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/SysMenuController.java
  6. 1 1
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/SysOperlogController.java
  7. 24 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/SysPlatformController.java
  8. 18 4
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/SysUserController.java
  9. 21 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/domain/SysOperLog.java
  10. 13 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/SysMenuMapper.java
  11. 7 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/SysPlatformMapper.java
  12. 9 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/SysTenantPlatformMapper.java
  13. 24 3
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/ISysMenuService.java
  14. 6 1
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/ISysUserService.java
  15. 8 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/SysPlatformService.java
  16. 184 4
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysMenuServiceImpl.java
  17. 14 2
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysPlatformServiceImpl.java
  18. 14 12
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysTenantPlatformServiceImpl.java
  19. 10 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysUserServiceImpl.java
  20. 75 5
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/util/AddressUtils.java
  21. 29 12
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/util/AsyncManager.java
  22. 41 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/vo/PlatformRouterVo.java
  23. 11 0
      base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/vo/SysOperLogExportVO.java
  24. 80 0
      base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysMenuMapper.xml
  25. 12 3
      base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysOperLogMapper.xml
  26. 27 0
      base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysPlatformMapper.xml
  27. 5 0
      base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysTenantPlatformMapper.xml
  28. 56 75
      usky-common/usky-common-log/src/main/java/com/usky/common/log/aspect/LogAspect.java
  29. 6 0
      usky-common/usky-common-log/src/main/java/com/usky/common/log/enums/BusinessType.java
  30. 2 0
      usky-common/usky-common-log/src/main/java/com/usky/common/log/service/AsyncLogService.java

+ 80 - 147
base-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ip/IpUtils.java

@@ -2,103 +2,103 @@ package com.ruoyi.common.core.utils.ip;
 
 import java.net.InetAddress;
 import java.net.UnknownHostException;
+import java.util.Objects;
 import javax.servlet.http.HttpServletRequest;
 import com.ruoyi.common.core.utils.StringUtils;
 
 /**
  * 获取IP方法
- * 
+ *
  * @author ruoyi
  */
-public class IpUtils
-{
-    /**
-     * 获取客户端IP
-     * 
-     * @param request 请求对象
-     * @return IP地址
-     */
-    public static String getIpAddr(HttpServletRequest request)
-    {
-        if (request == null)
-        {
+public final class IpUtils {
+
+    private IpUtils() {
+    }
+
+    public static String getIpAddr(HttpServletRequest request) {
+        if (request == null) {
             return "unknown";
         }
         String ip = request.getHeader("x-forwarded-for");
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
-        {
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
             ip = request.getHeader("Proxy-Client-IP");
         }
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
-        {
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
             ip = request.getHeader("X-Forwarded-For");
         }
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
-        {
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
             ip = request.getHeader("WL-Proxy-Client-IP");
         }
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
-        {
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
             ip = request.getHeader("X-Real-IP");
         }
-
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
-        {
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
             ip = request.getRemoteAddr();
         }
-
-        return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : getMultistageReverseProxyIp(ip);
+        if (ip == null || ip.isEmpty() || "unknown".equalsIgnoreCase(ip)) {
+            ip = request.getRemoteAddr();
+            if ("127.0.0.1".equals(ip) || "0:0:0:0:0:0:0:1".equals(ip)) {
+                // 根据网卡取本机配置的IP
+                InetAddress inet = null;
+                try {
+                    inet = InetAddress.getLocalHost();
+                } catch (UnknownHostException e) {
+                    e.printStackTrace();
+                }
+                assert inet != null;
+                ip = inet.getHostAddress();
+            }
+        }
+        if ("0:0:0:0:0:0:0:1".equals(ip)) {
+            ip = "127.0.0.1";
+        } else {
+            String[] split = ip.split(",");
+            if (split.length > 1) {
+                for (String strIp : split) {
+                    if (!"127.0.0.1".equals(strIp)) {
+                        ip = strIp;
+                        break;
+                    }
+                }
+            }
+        }
+        return ip;
     }
 
-    /**
-     * 检查是否为内部IP地址
-     * 
-     * @param ip IP地址
-     * @return 结果
-     */
-    public static boolean internalIp(String ip)
-    {
+    public static boolean internalIp(String ip) {
         byte[] addr = textToNumericFormatV4(ip);
         return internalIp(addr) || "127.0.0.1".equals(ip);
     }
 
-    /**
-     * 检查是否为内部IP地址
-     * 
-     * @param addr byte地址
-     * @return 结果
-     */
-    private static boolean internalIp(byte[] addr)
-    {
-        if (StringUtils.isNull(addr) || addr.length < 2)
-        {
+    private static boolean internalIp(byte[] addr) {
+        if (Objects.isNull(addr) || addr.length < 2) {
             return true;
         }
         final byte b0 = addr[0];
         final byte b1 = addr[1];
         // 10.x.x.x/8
-        final byte SECTION_1 = 0x0A;
+        final byte section1 = 0x0A;
         // 172.16.x.x/12
-        final byte SECTION_2 = (byte) 0xAC;
-        final byte SECTION_3 = (byte) 0x10;
-        final byte SECTION_4 = (byte) 0x1F;
+        final byte section2 = (byte) 0xAC;
+        final byte section3 = (byte) 0x10;
+        final byte section4 = (byte) 0x1F;
         // 192.168.x.x/16
-        final byte SECTION_5 = (byte) 0xC0;
-        final byte SECTION_6 = (byte) 0xA8;
-        switch (b0)
-        {
-            case SECTION_1:
+        final byte section5 = (byte) 0xC0;
+        final byte section6 = (byte) 0xA8;
+        switch (b0) {
+            case section1:
                 return true;
-            case SECTION_2:
-                if (b1 >= SECTION_3 && b1 <= SECTION_4)
-                {
+            case section2:
+                if (b1 >= section3 && b1 <= section4) {
                     return true;
                 }
-            case SECTION_5:
-                switch (b1)
-                {
-                    case SECTION_6:
+            case section5:
+                switch (b1) {
+                    case section6:
                         return true;
+                    default:
+                        return false;
                 }
             default:
                 return false;
@@ -107,29 +107,24 @@ public class IpUtils
 
     /**
      * 将IPv4地址转换成字节
-     * 
+     *
      * @param text IPv4地址
      * @return byte 字节
      */
-    public static byte[] textToNumericFormatV4(String text)
-    {
-        if (text.length() == 0)
-        {
+    public static byte[] textToNumericFormatV4(String text) {
+        if (text.length() == 0) {
             return null;
         }
 
         byte[] bytes = new byte[4];
         String[] elements = text.split("\\.", -1);
-        try
-        {
+        try {
             long l;
             int i;
-            switch (elements.length)
-            {
+            switch (elements.length) {
                 case 1:
                     l = Long.parseLong(elements[0]);
-                    if ((l < 0L) || (l > 4294967295L))
-                    {
+                    if ((l < 0L) || (l > 4294967295L)) {
                         return null;
                     }
                     bytes[0] = (byte) (int) (l >> 24 & 0xFF);
@@ -139,14 +134,12 @@ public class IpUtils
                     break;
                 case 2:
                     l = Integer.parseInt(elements[0]);
-                    if ((l < 0L) || (l > 255L))
-                    {
+                    if ((l < 0L) || (l > 255L)) {
                         return null;
                     }
                     bytes[0] = (byte) (int) (l & 0xFF);
                     l = Integer.parseInt(elements[1]);
-                    if ((l < 0L) || (l > 16777215L))
-                    {
+                    if ((l < 0L) || (l > 16777215L)) {
                         return null;
                     }
                     bytes[1] = (byte) (int) (l >> 16 & 0xFF);
@@ -154,29 +147,24 @@ public class IpUtils
                     bytes[3] = (byte) (int) (l & 0xFF);
                     break;
                 case 3:
-                    for (i = 0; i < 2; ++i)
-                    {
+                    for (i = 0; i < 2; ++i) {
                         l = Integer.parseInt(elements[i]);
-                        if ((l < 0L) || (l > 255L))
-                        {
+                        if ((l < 0L) || (l > 255L)) {
                             return null;
                         }
                         bytes[i] = (byte) (int) (l & 0xFF);
                     }
                     l = Integer.parseInt(elements[2]);
-                    if ((l < 0L) || (l > 65535L))
-                    {
+                    if ((l < 0L) || (l > 65535L)) {
                         return null;
                     }
                     bytes[2] = (byte) (int) (l >> 8 & 0xFF);
                     bytes[3] = (byte) (int) (l & 0xFF);
                     break;
                 case 4:
-                    for (i = 0; i < 4; ++i)
-                    {
+                    for (i = 0; i < 4; ++i) {
                         l = Integer.parseInt(elements[i]);
-                        if ((l < 0L) || (l > 255L))
-                        {
+                        if ((l < 0L) || (l > 255L)) {
                             return null;
                         }
                         bytes[i] = (byte) (int) (l & 0xFF);
@@ -185,80 +173,25 @@ public class IpUtils
                 default:
                     return null;
             }
-        }
-        catch (NumberFormatException e)
-        {
+        } catch (NumberFormatException e) {
             return null;
         }
         return bytes;
     }
 
-    /**
-     * 获取IP地址
-     * 
-     * @return 本地IP地址
-     */
-    public static String getHostIp()
-    {
-        try
-        {
+    public static String getHostIp() {
+        try {
             return InetAddress.getLocalHost().getHostAddress();
-        }
-        catch (UnknownHostException e)
-        {
+        } catch (UnknownHostException e) {
         }
         return "127.0.0.1";
     }
 
-    /**
-     * 获取主机名
-     * 
-     * @return 本地主机名
-     */
-    public static String getHostName()
-    {
-        try
-        {
+    public static String getHostName() {
+        try {
             return InetAddress.getLocalHost().getHostName();
-        }
-        catch (UnknownHostException e)
-        {
+        } catch (UnknownHostException e) {
         }
         return "未知";
     }
-
-    /**
-     * 从多级反向代理中获得第一个非unknown IP地址
-     *
-     * @param ip 获得的IP地址
-     * @return 第一个非unknown IP地址
-     */
-    public static String getMultistageReverseProxyIp(String ip)
-    {
-        // 多级反向代理检测
-        if (ip != null && ip.indexOf(",") > 0)
-        {
-            final String[] ips = ip.trim().split(",");
-            for (String subIp : ips)
-            {
-                if (false == isUnknown(subIp))
-                {
-                    ip = subIp;
-                    break;
-                }
-            }
-        }
-        return ip;
-    }
-
-    /**
-     * 检测给定字符串是否为未知,多用于检测HTTP请求相关
-     *
-     * @param checkString 被检测的字符串
-     * @return 是否未知
-     */
-    public static boolean isUnknown(String checkString)
-    {
-        return StringUtils.isBlank(checkString) || "unknown".equalsIgnoreCase(checkString);
-    }
 }

+ 21 - 0
base-modules/service-system/service-system-api/src/main/java/com/usky/system/domain/SysOperLogVO.java

@@ -63,6 +63,15 @@ public class SysOperLogVO extends BaseEntity
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date operTime;
 
+    /** 执行开始时间 */
+    private Date startTime;
+
+    /** 执行结束时间 */
+    private Date endTime;
+
+    /** 执行耗时时间(带单位) */
+    private String consumingTimeWithUnit;
+
     public Long getOperId()
     {
         return operId;
@@ -222,4 +231,16 @@ public class SysOperLogVO extends BaseEntity
     {
         this.operTime = operTime;
     }
+
+    public Date getStartTime() {return startTime;}
+
+    public void setStartTime(Date startTime) {this.startTime = startTime;}
+
+    public Date getEndTime() {return endTime;}
+
+    public void setEndTime(Date endTime) {this.endTime = endTime;}
+
+    public String getConsumingTimeWithUnit() {return consumingTimeWithUnit;}
+
+    public void setConsumingTimeWithUnit(String consumingTimeWithUnit) {this.consumingTimeWithUnit = consumingTimeWithUnit;}
 }

+ 5 - 0
base-modules/service-system/service-system-biz/pom.xml

@@ -59,6 +59,11 @@
             <artifactId>hutool-all</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>org.json</groupId>
+            <artifactId>json</artifactId>
+            <version>20210307</version>
+        </dependency>
     </dependencies>
 
     <build>

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

@@ -1,9 +1,10 @@
 package com.usky.system.controller.web;
 
 
-import com.ruoyi.common.core.annotation.Excel;
 import com.ruoyi.common.core.utils.poi.ExcelUtil;
 import com.usky.common.core.bean.ApiResult;
+import com.usky.common.log.annotation.Log;
+import com.usky.common.log.enums.BusinessType;
 import com.usky.system.controller.web.page.TableDataInfo;
 import com.usky.system.domain.SysLogininfor;
 import com.usky.system.service.ISysLogininforService;
@@ -27,7 +28,7 @@ public class SysLogininforController extends BaseController
     @Autowired
     private ISysLogininforService logininforService;
 
-
+    @Log(title = "查询登录日志", businessType = BusinessType.SELECT)
     @GetMapping("/list")
     public ApiResult<TableDataInfo> list(SysLogininfor logininfor)
     {
@@ -36,6 +37,7 @@ public class SysLogininforController extends BaseController
         return ApiResult.success(getDataTable(list));
     }
 
+    @Log(title = "导出登录日志", businessType = BusinessType.EXPORT)
     @PostMapping("/listExport")
     public void export(HttpServletResponse response,
                        @RequestParam(value = "exportTitle") String exportTitle,

+ 31 - 4
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/SysMenuController.java

@@ -2,6 +2,8 @@ package com.usky.system.controller.web;
 
 
 import com.usky.common.core.util.ServletUtils;
+import com.usky.common.log.annotation.Log;
+import com.usky.common.log.enums.BusinessType;
 import com.usky.common.security.service.TokenService;
 import com.usky.common.security.utils.SecurityUtils;
 import com.usky.common.core.bean.ApiResult;
@@ -68,11 +70,9 @@ public class SysMenuController extends BaseController
      * 获取菜单下拉树列表
      */
     @GetMapping("/treeselect")
-    public ApiResult treeselect(SysMenu menu)
+    public ApiResult treeselect()
     {
-//        Long userId = SecurityUtils.getUserId();
-        List<SysMenu> menus = menuService.selectMenuListTwo(menu);
-        return ApiResult.success(menuService.buildMenuTreeSelect(menus));
+        return ApiResult.success(menuService.selectRolePlatformMenu());
     }
 
     /**
@@ -90,6 +90,21 @@ public class SysMenuController extends BaseController
         return ApiResult.success(ajax);
     }
 
+    /**
+     * 加载对应角色菜单列表树
+     */
+    @GetMapping(value = "/roleMenuTreeselect1/{roleId}")
+    public ApiResult roleMenuTreeselect1(@PathVariable("roleId") Long roleId)
+    {
+//        Long userId = SecurityUtils.getUserId();
+        SysMenu menu = new SysMenu();
+        List<SysMenu> menus = menuService.selectMenuListTwo(menu);
+        Map<String,Object> ajax = new HashMap<>();
+        ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
+        ajax.put("menus", menuService.selectRolePlatformMenu());
+        return ApiResult.success(ajax);
+    }
+
     /**
      * 新增菜单
      */
@@ -150,6 +165,17 @@ public class SysMenuController extends BaseController
     }
 
 
+    /**
+     * 获取路由信息(应用级改造)
+     *
+     * @return 路由信息
+     */
+    @GetMapping("getRouters1")
+    public ApiResult getRouters1()
+    {
+        return ApiResult.success(menuService.buildPlatformMenus());
+    }
+
     /**
      * 获取路由信息
      *
@@ -192,6 +218,7 @@ public class SysMenuController extends BaseController
      * @param tenantMenu
      * @return
      */
+    @Log(title = "修改菜单昵称", businessType = BusinessType.UPDATE)
     @PutMapping("/updateTenantMenu")
     public ApiResult<Void> updateTenantMenu(@RequestBody SysTenantMenu tenantMenu)
     {

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

@@ -62,7 +62,7 @@ public class SysOperlogController extends BaseController
 
 
     @DeleteMapping("/clean")
-    @Log(title = "操作日志-清空", businessType = BusinessType.DELETE)
+    @Log(title = "操作日志-清空", businessType = BusinessType.CLEAN)
     public ApiResult<Void> clean()
     {
         operLogService.cleanOperLog();

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

@@ -3,10 +3,16 @@ package com.usky.system.controller.web;
 
 import com.usky.common.core.bean.ApiResult;
 import com.usky.common.core.bean.CommonPage;
+import com.usky.common.core.exception.BusinessErrorCode;
+import com.usky.common.core.exception.BusinessException;
+import com.usky.common.log.annotation.Log;
+import com.usky.common.log.enums.BusinessType;
 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.domain.constants.UserConstants;
+import com.usky.system.mapper.SysTenantPlatformMapper;
 import com.usky.system.service.ISysMenuService;
 import com.usky.system.service.SysPlatformService;
 import com.usky.system.service.vo.PlatformMenuVo;
@@ -34,6 +40,9 @@ public class SysPlatformController {
     @Autowired
     private ISysMenuService menuService;
 
+    @Autowired
+    private SysTenantPlatformMapper tenantPlatformMapper;
+
     /**
      * 平台挂管理-列表查询
      *
@@ -116,5 +125,20 @@ public class SysPlatformController {
         sysPlatformService.updateMobilePlatformMenu(mobilePlatformMenuVO);
         return ApiResult.success();
     }
+
+    /**
+     * 删除应用
+     */
+    @Log(title = "删除应用", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{platformId}")
+    public ApiResult<Void> remove(@PathVariable Integer platformId)
+    {
+        if (tenantPlatformMapper.checkPlatformUnique(platformId)>0)
+        {
+            return ApiResult.error("500", "删除应用失败,存在在用的租户单位");
+        }
+        sysPlatformService.deletePlatformById(platformId);
+        return ApiResult.success();
+    }
 }
 

+ 18 - 4
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/SysUserController.java

@@ -1,6 +1,8 @@
 package com.usky.system.controller.web;
 
 
+import com.usky.common.log.annotation.Log;
+import com.usky.common.log.enums.BusinessType;
 import com.usky.common.security.utils.SecurityUtils;
 import com.usky.common.core.bean.ApiResult;
 import com.usky.common.core.exception.BusinessErrorCode;
@@ -49,7 +51,7 @@ public class SysUserController extends BaseController
     /**
      * 获取用户列表
      */
-//    @Log(title = "用户管理", businessType = BusinessType.OTHER)
+    @Log(title = "用户列表", businessType = BusinessType.SELECT)
     @GetMapping("/list")
     public ApiResult<TableDataInfo> list(SysUser user)
     {
@@ -91,7 +93,7 @@ public class SysUserController extends BaseController
     /**
      * 新增用户
      */
-//    @Log(title = "用户管理", businessType = BusinessType.INSERT)
+    @Log(title = "新增用户", businessType = BusinessType.INSERT)
     @Transactional
     @PostMapping
     public ApiResult<Void> add(@Validated @RequestBody SysUser user)
@@ -144,7 +146,7 @@ public class SysUserController extends BaseController
     /**
      * 修改用户
      */
-//    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
+    @Log(title = "修改用户", businessType = BusinessType.UPDATE)
     @Transactional
     @PutMapping
     public ApiResult<Void> edit(@Validated @RequestBody SysUser user)
@@ -157,7 +159,7 @@ public class SysUserController extends BaseController
     /**
      * 删除用户
      */
-//    @Log(title = "用户管理", businessType = BusinessType.DELETE)
+    @Log(title = "删除用户", businessType = BusinessType.DELETE)
     @DeleteMapping("/{userIds}")
     public ApiResult<Void> remove(@PathVariable Long[] userIds)
     {
@@ -178,6 +180,7 @@ public class SysUserController extends BaseController
     /**
      * 重置密码
      */
+    @Log(title = "重置密码", businessType = BusinessType.UPDATE)
     @PutMapping("/resetPwd")
     public ApiResult<Void> resetPwd(@RequestBody SysUser user)
     {
@@ -221,4 +224,15 @@ public class SysUserController extends BaseController
         userService.insertUserAuth(userId, roleIds);
         return ApiResult.success();
     }
+
+    /**
+     * 根据用户编号获取授权角色
+     */
+    @GetMapping("/getUserInfo")
+    public ApiResult getUserInfo(@RequestParam(value = "phonenumber", required = false) String phonenumber,
+                                 @RequestParam(value = "userName", required = false) String userName,
+                                 @RequestParam(value = "email", required = false) String email)
+    {
+        return ApiResult.success(userService.selectUserOne(phonenumber,userName,email));
+    }
 }

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

@@ -86,6 +86,15 @@ public class SysOperLog extends BaseEntity
      */
     private String createBy;
 
+    /** 执行开始时间 */
+    private Date startTime;
+
+    /** 执行结束时间 */
+    private Date endTime;
+
+    /** 执行耗时时间(带单位) */
+    private String consumingTimeWithUnit;
+
     public String getSearchValue() {
         return searchValue;
     }
@@ -314,4 +323,16 @@ public class SysOperLog extends BaseEntity
     {
         this.createBy = createBy;
     }
+
+    public Date getStartTime() {return startTime;}
+
+    public void setStartTime(Date startTime) { this.startTime = startTime; }
+
+    public Date getEndTime() { return endTime; }
+
+    public void setEndTime(Date endTime) { this.endTime = endTime; }
+
+    public String getConsumingTimeWithUnit() { return consumingTimeWithUnit; }
+
+    public void setConsumingTimeWithUnit(String consumingTimeWithUnit) { this.consumingTimeWithUnit = consumingTimeWithUnit; }
 }

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

@@ -79,8 +79,19 @@ public interface SysMenuMapper extends CrudMapper<SysMenu> {
      */
     public List<SysMenu> selectMenuTreeByUserId(@Param("userId") Long userId);
 
+    /**
+     * 根据用户ID查询菜单
+     *
+     * @param userId 用户ID
+     * @param platformId 应用ID
+     * @return 应用级菜单列表
+     */
+    public List<SysMenu> selectMenuTreeByUserId1(@Param("userId") Long userId,@Param("platformId") Long platformId);
+
     public List<SysMenu> selectMenuTreeByUserIdOne(@Param("tenantId") Integer tenantId);
 
+    public List<SysMenu> selectMenuTreeByUserIdOne1(@Param("tenantId") Integer tenantId,@Param("platformId") Integer platformId);
+
     /**
      * 根据角色ID查询菜单树信息
      *
@@ -143,4 +154,6 @@ public interface SysMenuMapper extends CrudMapper<SysMenu> {
 
     public List<SysMenu> getSysMenuList(String menuType);
 
+    public List<SysMenu> getTenantPlatformMenuList(@Param("tenantId") Integer tenantId,@Param("platformId") Integer platformId);
+
 }

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

@@ -7,6 +7,7 @@ import com.usky.system.domain.SysPlatform;
 import com.usky.system.domain.SysPlatformMenu;
 import com.usky.system.service.vo.SysPlatformVo;
 import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
 
 import java.util.List;
 
@@ -18,6 +19,7 @@ import java.util.List;
  * @author ya
  * @since 2022-05-18
  */
+@Repository
 public interface SysPlatformMapper extends CrudMapper<SysPlatform> {
 
     List<SysPlatformVo> getPlatformList(@Param("platformName") String platformName,
@@ -40,4 +42,9 @@ public interface SysPlatformMapper extends CrudMapper<SysPlatform> {
 
     List<SysPlatformMenu> getMenuListOne(@Param("platformId") Long platformId,
                                          @Param("menuType")  String menuType);
+
+    List<SysPlatformVo> getRolePlatformList(@Param("tenantId") Integer tenantId,
+                                        @Param("roleId") Integer roleId);
+
+    List<SysPlatformVo> getTenantPlatformList(@Param("tenantId") Integer tenantId);
 }

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

@@ -3,6 +3,7 @@ package com.usky.system.mapper;
 import com.usky.common.mybatis.core.CrudMapper;
 import com.usky.system.domain.SysTenantMenu;
 import com.usky.system.domain.SysTenantPlatform;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 /**
@@ -15,4 +16,12 @@ import org.springframework.stereotype.Repository;
  */
 @Repository
 public interface SysTenantPlatformMapper extends CrudMapper<SysTenantPlatform> {
+
+    /**
+     * 校验应用是否在用
+     *
+     * @param platformId 用户名称
+     * @return 结果
+     */
+    public int checkPlatformUnique(@Param("platformId") Integer platformId);
 }

+ 24 - 3
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/ISysMenuService.java

@@ -5,12 +5,11 @@ import com.usky.common.mybatis.core.CrudService;
 import com.usky.system.domain.SysMenu;
 import com.usky.system.domain.SysMobileMenu;
 import com.usky.system.domain.SysTenantMenu;
-import com.usky.system.service.vo.RouterVo;
-import com.usky.system.service.vo.TreeMobileSelect;
-import com.usky.system.service.vo.TreeSelect;
+import com.usky.system.service.vo.*;
 import org.springframework.web.bind.annotation.RequestBody;
 
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 /**
@@ -66,8 +65,18 @@ public interface ISysMenuService extends CrudService<SysMenu>
      */
     public List<SysMenu> selectMenuTreeByUserId(Long userId);
 
+    /**
+     * 根据用户ID查询菜单树信息
+     *
+     * @param userId 用户ID
+     * @return 菜单列表
+     */
+    public List<SysMenu> selectMenuTreeByUserId1(Long userId,Long platformId);
+
     List<SysMenu> selectMenuTreeByUserIdOne(Integer tenantId);
 
+    List<SysMenu> selectMenuTreeByUserIdOne1(Integer tenantId,Integer platformId);
+
     List<SysTenantMenu> selectTenantMenuList(Integer tenantId);
 
     void updateTenantMenu(SysTenantMenu tenantMenu);
@@ -88,6 +97,12 @@ public interface ISysMenuService extends CrudService<SysMenu>
      */
     public List<RouterVo> buildMenus(List<SysMenu> menus);
 
+    /**
+     * 构建前端路由所需要的菜单(应用级)
+     * @return 路由列表
+     */
+    public List<PlatformRouterVo> buildPlatformMenus();
+
 
     /**
      * 构建前端所需要树结构
@@ -177,4 +192,10 @@ public interface ISysMenuService extends CrudService<SysMenu>
      * @return 结果
      */
     public String checkMenuNameUnique(SysMenu menu);
+
+    /**
+     * 根据角色ID查询应用菜单树信息
+     * @return 选中菜单列表
+     */
+    List<TenantPlatformMenuVo> selectRolePlatformMenu();
 }

+ 6 - 1
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/ISysUserService.java

@@ -5,6 +5,7 @@ import com.usky.common.mybatis.core.CrudService;
 import com.usky.system.domain.SysUser;
 import com.usky.system.model.LoginUser;
 import com.usky.system.service.vo.SysUserNewVO;
+import com.usky.system.service.vo.TenantPlatformMenuVo;
 
 import java.util.List;
 
@@ -263,5 +264,9 @@ public interface ISysUserService extends CrudService<SysUser> {
 
     public List<SysUser> userAllList();
 
-
+    /**
+     * 根据手机号、用户名、邮箱查询用户信息
+     * @return 用户列表
+     */
+    List<SysUser> selectUserOne(String phonenumber,String userName,String email);
 }

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

@@ -32,4 +32,12 @@ public interface SysPlatformService extends CrudService<SysPlatform> {
     void updateMobilePlatformMenu(MobilePlatformMenuVO mobilePlatformMenuV0);
 
     List<SysPlatformVo> getPlatformAllList();
+
+    /**
+     * 通过应用ID删除应用
+     *
+     * @param platformId 应用ID
+     * @return 结果
+     */
+    void deletePlatformById(Integer platformId);
 }

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

@@ -14,10 +14,7 @@ import com.usky.system.mapper.*;
 import com.usky.system.service.ISysMenuService;
 import com.usky.system.service.SysRoleMenuService;
 import com.usky.system.service.SysTenantMenuService;
-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 com.usky.system.service.vo.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -62,6 +59,9 @@ public class SysMenuServiceImpl extends AbstractCrudService<SysMenuMapper, SysMe
     @Autowired
     private SysUserMapper sysUserMapper;
 
+    @Autowired
+    private SysPlatformMapper sysPlatformMapper;
+
     /**
      * 根据用户查询系统菜单列表
      *
@@ -184,12 +184,38 @@ public class SysMenuServiceImpl extends AbstractCrudService<SysMenuMapper, SysMe
         return getChildPerms(menus, 0);
     }
 
+    /**
+     * 根据用户ID查询菜单
+     *
+     * @param userId 用户名称
+     * @return 菜单列表
+     */
+    @Override
+    public List<SysMenu> selectMenuTreeByUserId1(Long userId,Long platformId)
+    {
+        List<SysMenu> menus = null;
+        if (1L == userId)
+        {
+            menus = menuMapper.selectMenuTreeAll();
+        }
+        else
+        {
+            menus = menuMapper.selectMenuTreeByUserId1(userId,platformId);
+        }
+        return getChildPerms(menus, 0);
+    }
+
 
     public List<SysMenu> selectMenuTreeByUserIdOne(Integer tenantId){
         List<SysMenu> menus = menuMapper.selectMenuTreeByUserIdOne(tenantId);
         return getChildPerms(menus, 0);
     }
 
+    public List<SysMenu> selectMenuTreeByUserIdOne1(Integer tenantId,Integer platformId){
+        List<SysMenu> menus = menuMapper.selectMenuTreeByUserIdOne1(tenantId,platformId);
+        return getChildPerms(menus, 0);
+    }
+
     @Override
     public List<SysTenantMenu> selectTenantMenuList(Integer tenantId){
         List<SysTenantMenu> menus = tenantMenuMapper.selectTenantMenuList(tenantId);
@@ -265,6 +291,142 @@ public class SysMenuServiceImpl extends AbstractCrudService<SysMenuMapper, SysMe
         return routers;
     }
 
+    /**
+     * 构建前端路由所需要的菜单
+     * @return 路由列表
+     */
+    @Override
+    public List<PlatformRouterVo> buildPlatformMenus()
+    {
+        List<PlatformRouterVo> platformRouterVos = new LinkedList<PlatformRouterVo>();
+        if (SecurityUtils.getLoginUser().getSysUser().getUserType().equals("01")){
+            List<SysPlatformVo> sysPlatformVos = sysPlatformMapper.getTenantPlatformList(SecurityUtils.getTenantId());
+            if (CollectionUtils.isNotEmpty(sysPlatformVos)){
+                for (SysPlatformVo platformVo : sysPlatformVos)
+                {
+                    PlatformRouterVo platformRouterVo = new PlatformRouterVo();
+                    platformRouterVo.setPlatformId(platformVo.getId());
+                    platformRouterVo.setPlatformName(platformVo.getPlatformName());
+                    platformRouterVo.setIcon(platformVo.getIcon());
+                    List<SysMenu> menus1 = this.selectMenuTreeByUserIdOne1(SecurityUtils.getTenantId(),
+                            platformVo.getId());
+                    List<RouterVo> routers = new LinkedList<RouterVo>();
+                    for (SysMenu menu : menus1)
+                    {
+                        RouterVo router = new RouterVo();
+                        router.setHidden("1".equals(menu.getVisible()));
+                        router.setName(getRouteName(menu));
+                        router.setPath(getRouterPath(menu));
+                        router.setComponent(getComponent(menu));
+                        router.setMeta(new MetaVo(menu.getMenuName(), menu.getMenuAliasName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath(), menu.getIsFrame(), menu.getIsNew(), menu.getRemark()));
+                        List<SysMenu> cMenus = menu.getChildren();
+                        if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType()))
+                        {
+                            router.setAlwaysShow(true);
+                            router.setRedirect("noRedirect");
+                            router.setChildren(buildMenus(cMenus));
+                        }
+                        else if (isMenuFrame(menu))
+                        {
+                            router.setMeta(null);
+                            List<RouterVo> childrenList = new ArrayList<RouterVo>();
+                            RouterVo children = new RouterVo();
+                            children.setPath(menu.getPath());
+                            children.setComponent(menu.getComponent());
+                            children.setName(StringUtils.capitalize(menu.getPath()));
+                            children.setMeta(new MetaVo(menu.getMenuName(), menu.getMenuAliasName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath(), menu.getIsFrame(), menu.getIsNew(), menu.getRemark()));
+                            childrenList.add(children);
+                            router.setChildren(childrenList);
+                        }
+                        else if (menu.getParentId().intValue() == 0 && isInnerLink(menu))
+                        {
+                            router.setMeta(new MetaVo(menu.getMenuName(), menu.getMenuAliasName(), menu.getIcon(), menu.getIsFrame(), menu.getIsNew(), menu.getRemark()));
+                            router.setPath("/inner");
+                            List<RouterVo> childrenList = new ArrayList<RouterVo>();
+                            RouterVo children = new RouterVo();
+                            String routerPath = StringUtils.replaceEach(menu.getPath(), new String[] { Constants.HTTP, Constants.HTTPS }, new String[] { "", "" });
+                            children.setPath(routerPath);
+                            children.setComponent(UserConstants.INNER_LINK);
+                            children.setName(StringUtils.capitalize(routerPath));
+                            children.setMeta(new MetaVo(menu.getMenuName(), menu.getMenuAliasName(), menu.getIcon(), menu.getPath(), menu.getIsFrame(), menu.getIsNew(), menu.getRemark()));
+                            childrenList.add(children);
+                            router.setChildren(childrenList);
+                        }
+                        routers.add(router);
+                    }
+                    platformRouterVo.setRouterVos(routers);
+                    platformRouterVos.add(platformRouterVo);
+                }
+            }
+        }else {
+            LambdaQueryWrapper<SysUserRole> queryWrapper = Wrappers.lambdaQuery();
+            queryWrapper.in(SysUserRole::getUserId,SecurityUtils.getUserId());
+            List<SysUserRole> userRoleList = sysUserRoleMapper.selectList(queryWrapper);
+            if (CollectionUtils.isNotEmpty(userRoleList)){
+                List<SysPlatformVo> sysPlatformVos = sysPlatformMapper.getRolePlatformList(SecurityUtils.getTenantId(),
+                        userRoleList.get(0).getRoleId().intValue());
+                if (CollectionUtils.isNotEmpty(sysPlatformVos)){
+                    for (SysPlatformVo platformVo : sysPlatformVos)
+                    {
+                        PlatformRouterVo platformRouterVo = new PlatformRouterVo();
+                        platformRouterVo.setPlatformId(platformVo.getId());
+                        platformRouterVo.setPlatformName(platformVo.getPlatformName());
+                        platformRouterVo.setIcon(platformVo.getIcon());
+                        List<SysMenu> menus1 = this.selectMenuTreeByUserId1(SecurityUtils.getUserId(),
+                                platformVo.getId().longValue());
+                        List<RouterVo> routers = new LinkedList<RouterVo>();
+                        for (SysMenu menu : menus1)
+                        {
+                            RouterVo router = new RouterVo();
+                            router.setHidden("1".equals(menu.getVisible()));
+                            router.setName(getRouteName(menu));
+                            router.setPath(getRouterPath(menu));
+                            router.setComponent(getComponent(menu));
+                            router.setMeta(new MetaVo(menu.getMenuName(), menu.getMenuAliasName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath(), menu.getIsFrame(), menu.getIsNew(), menu.getRemark()));
+                            List<SysMenu> cMenus = menu.getChildren();
+                            if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType()))
+                            {
+                                router.setAlwaysShow(true);
+                                router.setRedirect("noRedirect");
+                                router.setChildren(buildMenus(cMenus));
+                            }
+                            else if (isMenuFrame(menu))
+                            {
+                                router.setMeta(null);
+                                List<RouterVo> childrenList = new ArrayList<RouterVo>();
+                                RouterVo children = new RouterVo();
+                                children.setPath(menu.getPath());
+                                children.setComponent(menu.getComponent());
+                                children.setName(StringUtils.capitalize(menu.getPath()));
+                                children.setMeta(new MetaVo(menu.getMenuName(), menu.getMenuAliasName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath(), menu.getIsFrame(), menu.getIsNew(), menu.getRemark()));
+                                childrenList.add(children);
+                                router.setChildren(childrenList);
+                            }
+                            else if (menu.getParentId().intValue() == 0 && isInnerLink(menu))
+                            {
+                                router.setMeta(new MetaVo(menu.getMenuName(), menu.getMenuAliasName(), menu.getIcon(), menu.getIsFrame(), menu.getIsNew(), menu.getRemark()));
+                                router.setPath("/inner");
+                                List<RouterVo> childrenList = new ArrayList<RouterVo>();
+                                RouterVo children = new RouterVo();
+                                String routerPath = StringUtils.replaceEach(menu.getPath(), new String[] { Constants.HTTP, Constants.HTTPS }, new String[] { "", "" });
+                                children.setPath(routerPath);
+                                children.setComponent(UserConstants.INNER_LINK);
+                                children.setName(StringUtils.capitalize(routerPath));
+                                children.setMeta(new MetaVo(menu.getMenuName(), menu.getMenuAliasName(), menu.getIcon(), menu.getPath(), menu.getIsFrame(), menu.getIsNew(), menu.getRemark()));
+                                childrenList.add(children);
+                                router.setChildren(childrenList);
+                            }
+                            routers.add(router);
+                        }
+                        platformRouterVo.setRouterVos(routers);
+                        platformRouterVos.add(platformRouterVo);
+                    }
+                }
+            }
+        }
+        return platformRouterVos;
+    }
+
     /**
      * 构建前端所需要树结构
      *
@@ -714,4 +876,22 @@ public class SysMenuServiceImpl extends AbstractCrudService<SysMenuMapper, SysMe
     {
         return getChildMobileList(list, t).size() > 0 ? true : false;
     }
+
+    @Override
+    public List<TenantPlatformMenuVo> selectRolePlatformMenu()
+    {
+        List<TenantPlatformMenuVo> list1 = new ArrayList<>();
+        List<SysPlatformVo> list = sysPlatformMapper.getTenantPlatformList(SecurityUtils.getTenantId());
+        if (CollectionUtils.isNotEmpty(list)){
+            for(int i=0;i<list.size();i++){
+                TenantPlatformMenuVo tenantPlatformMenuVo = new TenantPlatformMenuVo();
+                tenantPlatformMenuVo.setId(list.get(i).getId());
+                tenantPlatformMenuVo.setLabel(list.get(i).getPlatformName());
+                List<SysMenu> menus = baseMapper.getTenantPlatformMenuList(SecurityUtils.getTenantId(),list.get(i).getId());
+                tenantPlatformMenuVo.setChildren(this.buildMenuTreeSelect(menus));
+                list1.add(tenantPlatformMenuVo);
+            }
+        }
+        return list1;
+    }
 }

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

@@ -12,6 +12,7 @@ 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.mapper.SysTenantPlatformMapper;
 import com.usky.system.service.SysMobilePlatformMenuService;
 import com.usky.system.service.SysPlatformMenuService;
 import com.usky.system.service.SysPlatformService;
@@ -37,8 +38,6 @@ import java.util.Map;
 @Service
 public class SysPlatformServiceImpl extends AbstractCrudService<SysPlatformMapper, SysPlatform> implements SysPlatformService {
 
-    @Autowired
-    private SysMenuMapper menuMapper;
     @Autowired
     private SysPlatformMenuService sysPlatformMenuService;
     @Autowired
@@ -260,4 +259,17 @@ public class SysPlatformServiceImpl extends AbstractCrudService<SysPlatformMappe
         List<SysPlatformVo> list1 = baseMapper.getPlatformList(null, null, null, null, null, null);
         return list1;
     }
+
+    /**
+     * 通过应用ID删除应用
+     *
+     * @param platformId 应用ID
+     * @return 结果
+     */
+    @Override
+    @Transactional
+    public void deletePlatformById(Integer platformId) {
+        baseMapper.deleteById(platformId);
+    }
+
 }

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

@@ -54,6 +54,10 @@ public class SysTenantPlatformServiceImpl extends AbstractCrudService<SysTenantP
             queryWrapper.eq(SysTenantPlatform::getTenantId,tenantPlatformVo.getTenantId())
                     .eq(SysTenantPlatform::getIsDefault,1);
             this.remove(queryWrapper);
+            LambdaQueryWrapper<SysTenantPlatform> queryWrapper1 = Wrappers.lambdaQuery();
+            queryWrapper1.eq(SysTenantPlatform::getTenantId,tenantPlatformVo.getTenantId())
+                    .eq(SysTenantPlatform::getPlatformId,arr[0]);
+            this.remove(queryWrapper1);
             SysTenantPlatform sysTenantPlatform = new SysTenantPlatform();
             sysTenantPlatform.setTenantId(tenantPlatformVo.getTenantId());
             sysTenantPlatform.setPlatformId(arr[0]);
@@ -89,19 +93,17 @@ public class SysTenantPlatformServiceImpl extends AbstractCrudService<SysTenantP
         queryWrapper1.eq(SysTenantPlatform::getTenantId,tenantId);
         List<SysTenantPlatform> list = this.list(queryWrapper1);
         List<SysPlatformVo> list1 = sysPlatformService.getPlatformAllList();
-        if(CollectionUtils.isNotEmpty(list1)){
-            for(int i=0;i<list1.size();i++){
+        if(CollectionUtils.isNotEmpty(list)){
+            for(int i=0;i<list.size();i++){
                 TenantPlatformListVo tenantPlatformListVo = new TenantPlatformListVo();
-                tenantPlatformListVo.setPlatformName(list1.get(i).getPlatformName());
-                tenantPlatformListVo.setPlatformId(list1.get(i).getId());
-                tenantPlatformListVo.setIcon(list1.get(i).getIcon());
-                tenantPlatformListVo.setIsDefault(0);
-                tenantPlatformListVo.setIsSelected(0);
-                if(CollectionUtils.isNotEmpty(list)){
-                    for(int j=0;j<list.size();j++){
-                        if (list1.get(i).getId().equals(list.get(j).getPlatformId())){
-                            tenantPlatformListVo.setIsDefault(list.get(j).getIsDefault());
-                            tenantPlatformListVo.setIsSelected(1);
+                tenantPlatformListVo.setIsDefault(list.get(i).getIsDefault());
+                tenantPlatformListVo.setIsSelected(1);
+                if(CollectionUtils.isNotEmpty(list1)){
+                    for(int j=0;j<list1.size();j++){
+                        if (list1.get(j).getId().equals(list.get(i).getPlatformId())){
+                            tenantPlatformListVo.setPlatformName(list1.get(j).getPlatformName());
+                            tenantPlatformListVo.setPlatformId(list1.get(j).getId());
+                            tenantPlatformListVo.setIcon(list1.get(j).getIcon());
                         }
                     }
                 }

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

@@ -1,6 +1,8 @@
 package com.usky.system.service.impl;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.ruoyi.common.datascope.annotation.DataScope;
 import com.usky.common.security.utils.SecurityUtils;
 import com.usky.common.core.bean.CommonPage;
@@ -684,4 +686,12 @@ public class SysUserServiceImpl extends AbstractCrudService<SysUserMapper, SysUs
         List<SysUser> list = userMapper.userAllList();
         return list;
     }
+
+    public List<SysUser> selectUserOne(String phonenumber,String userName,String email) {
+        LambdaQueryWrapper<SysUser> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(StringUtils.isNotBlank(phonenumber),SysUser::getPhonenumber,phonenumber)
+                .eq(StringUtils.isNotBlank(userName),SysUser::getUserName,userName)
+                .eq(StringUtils.isNotBlank(email),SysUser::getEmail,email);
+        return this.list(queryWrapper);
+    }
 }

+ 75 - 5
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/util/AddressUtils.java

@@ -1,43 +1,113 @@
 package com.usky.system.service.util;
 
 import cn.hutool.http.HttpUtil;
+import com.alibaba.nacos.shaded.com.google.common.base.Strings;
 import com.ruoyi.common.core.utils.ip.IpUtils;
 import com.usky.system.domain.WjConfig;
+import org.json.JSONException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.util.StringUtils;
+import org.json.JSONObject;
 
-/**
+
+/*
  * 获取地址类
  *
  * @author xy
  */
+
+/*
 public class AddressUtils {
     private static final Logger log = LoggerFactory.getLogger(AddressUtils.class);
 
     // IP地址查询
-    public static  String IP_URL = "http://whois.pconline.com.cn/ip.jsp?ip=";
+    public static String IP_URL = "http://whois.pconline.com.cn/ip.jsp?ip=";
 
     // 未知地址
-    public static final String UNKNOWN = "未知地址";
+    public static final String UNKNOWN = "获取地理位置异常";
+
+    // 检查响应是否是503 Service Temporarily Unavailable
+    private static final String SERVICE_UNAVAILABLE_HTML = "503 Service Temporarily Unavailable";
 
     public static String getRealAddressByIP(String ip) {
         // 内网不查询
         if (IpUtils.internalIp(ip)) {
             return "内网IP";
         }
+        // 检查地址服务是否启用
         if (WjConfig.isAddressEnabled()) {
             try {
                 String url = IP_URL + ip;
                 String rspStr = HttpUtil.get(url);
                 log.info("ip is {}, repStr is {}, url is {}", ip, rspStr, url);
-                if (StringUtils.isEmpty(rspStr.trim())) {
+
+                // 检查响应是否为空或者503错误
+                if (Strings.isNullOrEmpty(rspStr) || rspStr.contains(SERVICE_UNAVAILABLE_HTML)) {
                     log.error("获取地理位置异常 {}, {}", ip, rspStr);
                     return UNKNOWN;
                 }
+                // 假设返回的字符串是直接的地理位置信息
                 return rspStr.trim();
             } catch (Exception e) {
-                log.error("获取地理位置异常 {}", ip);
+                log.error("获取地理位置异常 {}", ip, e);
+            }
+        }
+        return UNKNOWN;
+    }
+}
+*/
+
+public class AddressUtils {
+    private static final Logger log = LoggerFactory.getLogger(AddressUtils.class);
+
+    // 腾讯地图API URL
+    public static String IP_URL = "https://apis.map.qq.com/ws/location/v1/ip";
+    public static String API_KEY = "TSIBZ-NZSCU-H5SVQ-GUBLG-G6HFH-7LFSZ";
+
+    // 未知地址
+    public static final String UNKNOWN = "获取地理位置异常";
+
+    public static String getRealAddressByIP(String ip) {
+        // 内网不查询
+        if (IpUtils.internalIp(ip)) {
+            return "内网IP";
+        }
+        // 检查地址服务是否启用
+        if (WjConfig.isAddressEnabled()) {
+            try {
+                // 构建请求URL
+                String url = String.format("%s?ip=%s&key=%s", IP_URL, ip, API_KEY);
+                String rspStr = HttpUtil.get(url); // 使用GET请求发送数据
+                log.info("ip is {}, repStr is {}", ip, rspStr);
+
+                // 检查响应是否为空
+                if (rspStr == null || rspStr.isEmpty()) {
+                    log.error("获取地理位置异常 {}", ip);
+                    return UNKNOWN;
+                }
+
+                // 解析JSON响应
+                JSONObject jsonObject = new JSONObject(rspStr);
+                if (jsonObject.getInt("status") != 0) {
+                    log.error("获取地理位置失败: {}", jsonObject.getString("message"));
+                    return UNKNOWN;
+                }
+
+                // 提取地址信息
+                JSONObject adInfo = jsonObject.getJSONObject("result").getJSONObject("ad_info");
+                String nation = adInfo.getString("nation");
+                String province = adInfo.getString("province");
+                String city = adInfo.getString("city");
+                String district = adInfo.optString("district", "");
+
+                return String.format("%s%s%s%s", nation, province, city, district).trim();
+            } catch (JSONException e) {
+                log.error("JSON 解析异常", e);
+                return UNKNOWN;
+            } catch (Exception e) {
+                log.error("获取地理位置异常 {}", ip, e);
+                return UNKNOWN;
             }
         }
         return UNKNOWN;

+ 29 - 12
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/util/AsyncManager.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
 import org.springframework.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.ServletRequestAttributes;
 
+import javax.annotation.PreDestroy;
 import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
@@ -20,26 +21,42 @@ public class AsyncManager {
 
     private static final Logger logger = LoggerFactory.getLogger(AsyncManager.class);
 
-    /**
-     * 异步操作任务调度线程池
-     */
-
     private static final ThreadPoolExecutor executorEvent = new ThreadPoolExecutor(
             20, 30, 0L, TimeUnit.MILLISECONDS,
-            new ArrayBlockingQueue<Runnable>(1024),
+            new ArrayBlockingQueue<>(1024),
             new ThreadPoolExecutor.AbortPolicy()
     );
 
+    @PreDestroy
+    public void shutdown() {
+        executorEvent.shutdown();
+        try {
+            if (!executorEvent.awaitTermination(60, TimeUnit.SECONDS)) {
+                executorEvent.shutdownNow();
+            }
+        } catch (InterruptedException ex) {
+            executorEvent.shutdownNow();
+            Thread.currentThread().interrupt();
+        }
+    }
 
     public void insertLog(Integer tenantId, final String username, final String status, final String message, final Integer deptId) {
         ServletRequestAttributes sra = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
-        RequestContextHolder.setRequestAttributes(sra, true);
-        executorEvent.execute(() -> {
-            logger.info("new Log is {} , {}", username, message);
-            AsyncFactory.recordLoginInfo(tenantId, username, status, message, deptId);
-        });
+        if (sra != null) {
+            executorEvent.execute(() -> {
+                try {
+                    RequestContextHolder.setRequestAttributes(sra, true);
+                    logger.info("new Log is {} , {}", username, message);
+                    AsyncFactory.recordLoginInfo(tenantId, username, status, message, deptId);
+                } catch (Exception e) {
+                    logger.error("记录登录信息异常", e);
+                } finally {
+                    RequestContextHolder.resetRequestAttributes();
+                }
+            });
+        } else {
+            logger.warn("当前线程没有RequestContext,无法记录登录信息");
+        }
     }
-
-
 }
 

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

@@ -0,0 +1,41 @@
+package com.usky.system.service.vo;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import java.util.List;
+
+/**
+ * <p>
+ * 租户和应用关联表
+ * </p>
+ *
+ * @author han
+ * @since 2024-09-02
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class PlatformRouterVo {
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 应用ID
+     */
+    private Integer platformId;
+
+    /**
+     * 应用名称
+     */
+    private String platformName;
+
+    /**
+     * 应用图标
+     */
+    private String icon;
+
+    /**
+     * 路由集合
+     */
+    private List<RouterVo> RouterVos;
+}

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

@@ -59,4 +59,15 @@ public class SysOperLogExportVO {
     /** 操作时间 */
     @Excel(name = "操作时间")
     private LocalDateTime operTime;
+
+    /** 执行开始时间 */
+    @Excel(name = "执行开始时间")
+    private LocalDateTime startTime;
+
+    /** 执行结束时间 */
+    @Excel(name = "执行结束时间")
+    private LocalDateTime endTime;
+
+    /** 执行耗时时间(带单位) */
+    private String consumingTimeWithUnit;
 }

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

@@ -204,6 +204,39 @@
         order by m.parent_id, m.order_num
     </select>
 
+    <select id="selectMenuTreeByUserId1" parameterType="Long" resultMap="SysMenuResult">
+        select distinct m.menu_id,
+                        m.parent_id,
+                        m.menu_name,
+                        rm.menu_alias_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,
+                        m.remark,
+                        m.isNew
+        from sys_menu m
+                 left join sys_platform_menu pm ON m.menu_id = pm.menu_id
+                 left join sys_role_menu rm on pm.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
+                 left join sys_user u on u.user_id = ur.user_id
+                 left join sys_tenant_menu t on u.tenant_id = t.tenant_id
+        where u.user_id = #{userId}
+          and m.menu_type in ('M', 'C')
+          and m.status = 0
+          AND ro.status = 0
+          AND pm.platform_id=#{platformId}
+        order by m.parent_id, m.order_num
+    </select>
+
     <select id="selectMenuTreeByUserIdOne" resultMap="SysMenuResult">
         SELECT
             m.menu_id,
@@ -236,6 +269,39 @@
             m.order_num
     </select>
 
+    <select id="selectMenuTreeByUserIdOne1" resultMap="SysMenuResult">
+        SELECT
+            m.menu_id,
+            m.parent_id,
+            m.menu_name,
+            t.menu_alias_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,
+            m.remark,
+            m.isNew
+        FROM
+            sys_menu m
+                JOIN sys_tenant_menu t on m.menu_id = t.menu_id
+                JOIN sys_platform_menu p on t.menu_id = p.menu_id
+        WHERE
+          m.menu_type IN ('M', 'C')
+          AND m. STATUS = 0
+          AND t.tenant_id=#{tenantId}
+          AND p.platform_id=#{platformId}
+        ORDER BY
+            m.parent_id,
+            m.order_num
+    </select>
+
     <select id="selectMenuListByRoleId" resultType="Integer">
         select m.menu_id
         from sys_menu m
@@ -377,4 +443,18 @@
         order_num
     </select>
 
+    <select id="getTenantPlatformMenuList" resultType="com.usky.system.domain.SysMenu">
+        SELECT
+        	m.*
+        FROM
+        	sys_menu m
+        LEFT JOIN sys_tenant_menu tm ON m.menu_id = tm.menu_id
+        LEFT JOIN sys_platform_menu pm ON tm.menu_id = pm.menu_id
+        WHERE
+        	tm.tenant_id = #{tenantId}
+        AND pm.platform_id = #{platformId}
+        GROUP BY
+        	m.menu_id;
+    </select>
+
 </mapper> 

+ 12 - 3
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysOperLogMapper.xml

@@ -24,11 +24,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<result property="deptId"         column="dept_id"        />
 		<result property="tenantId"       column="tenant_id"      />
 		<result property="createBy"       column="create_by"      />
+		<result property="startTime"     column="start_time"    />
+		<result property="endTime"       column="end_time"      />
+		<result property="consumingTimeWithUnit"     column="consuming_time_with_unit"    />
 	</resultMap>
 
 	<sql id="selectOperLogVo">
-        select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time
-        from sys_oper_log d
+        select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time, start_time, end_time, consuming_time_with_unit
+		from sys_oper_log d
     </sql>
     
 	<insert id="insertOperlog" parameterType="com.usky.system.domain.SysOperLog">
@@ -52,6 +55,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="deptId != null"> dept_id, </if>
 			<if test="tenantId != null"> tenant_id, </if>
 			<if test="createBy != null"> create_by, </if>
+			<if test="startTime != null"> start_time, </if>
+			<if test="endTime != null"> end_time, </if>
+			<if test="consumingTimeWithUnit !=null"> consuming_time_with_unit, </if>
 		</trim>
 		values
 		<trim prefix="(" suffix=")" suffixOverrides=",">
@@ -73,6 +79,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="deptId != null"> #{deptId},</if>
 			<if test="tenantId != null"> #{tenantId},</if>
 			<if test="createBy != null"> #{createBy},</if>
+			<if test="startTime != null"> #{startTime},</if>
+		    <if test="endTime != null"> #{endTime},</if>
+		    <if test="consumingTimeWithUnit !=null"> #{consumingTimeWithUnit},</if>
 		</trim>
 	</insert>
 	
@@ -113,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</select>
 
 	<select id="selectOperLogListExport" parameterType="com.usky.system.domain.SysOperLog" resultType="com.usky.system.service.vo.SysOperLogExportVO">
-		SELECT oper_id, oper_ip, oper_name, title, (CASE business_type WHEN '0' THEN '其它' WHEN '1' THEN '新增' WHEN '2' THEN '修改' ELSE '删除' END) AS businessType, request_method, (CASE STATUS WHEN '0' THEN '成功' ELSE '失败' END) AS STATUS, oper_time
+		SELECT oper_id, oper_ip, oper_name, title, (CASE business_type WHEN '0' THEN '其它' WHEN '1' THEN '新增' WHEN '2' THEN '修改' ELSE '删除' END) AS businessType, request_method, (CASE STATUS WHEN '0' THEN '成功' ELSE '失败' END) AS STATUS, oper_time, start_time, end_time, consuming_time_with_unit
 		FROM sys_oper_log d
 		<where>
 			<if test="title != null and title != ''">

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

@@ -95,4 +95,31 @@
         </if>
     </select>
 
+    <select id="getRolePlatformList" resultType="com.usky.system.service.vo.SysPlatformVo">
+        SELECT
+        p.*
+        FROM
+        sys_platform p
+        LEFT JOIN sys_tenant_platform tp ON p.id=tp.platform_id
+        LEFT JOIN sys_platform_menu pm ON tp.platform_id=pm.platform_id
+        LEFT JOIN sys_role_menu rm ON pm.menu_id = rm.menu_id
+        WHERE
+        tp.tenant_id = #{tenantId}
+        AND rm.role_id = #{roleId}
+        GROUP BY
+        p.id
+    </select>
+
+    <select id="getTenantPlatformList" resultType="com.usky.system.service.vo.SysPlatformVo">
+        SELECT
+        p.*
+        FROM
+        sys_platform p
+        LEFT JOIN sys_tenant_platform tp ON p.id=tp.platform_id
+        WHERE
+        tp.tenant_id = #{tenantId}
+        GROUP BY
+        p.id
+    </select>
+
 </mapper>

+ 5 - 0
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysTenantPlatformMapper.xml

@@ -8,4 +8,9 @@
         <result column="platform_id" property="platformId" />
         <result column="is_default" property="isDefault" />
     </resultMap>
+
+    <select id="checkPlatformUnique" resultType="int">
+        select count(1) from sys_tenant_platform where platform_id = #{platformId} limit 1
+    </select>
+
 </mapper>

+ 56 - 75
usky-common/usky-common-log/src/main/java/com/usky/common/log/aspect/LogAspect.java

@@ -1,10 +1,13 @@
 package com.usky.common.log.aspect;//package com.ruoyi.common.log.aspect;
 
 import java.util.Collection;
+import java.util.Date;
 import java.util.Map;
 import java.util.Objects;
+import java.util.concurrent.TimeUnit;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import javax.xml.crypto.Data;
 
 import com.alibaba.fastjson.JSON;
 import com.usky.common.core.util.IpUtils;
@@ -16,9 +19,8 @@ import com.usky.common.log.service.AsyncLogService;
 import com.usky.common.security.utils.SecurityUtils;
 import com.usky.system.domain.SysOperLogVO;
 import org.aspectj.lang.JoinPoint;
-import org.aspectj.lang.annotation.AfterReturning;
-import org.aspectj.lang.annotation.AfterThrowing;
-import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,56 +36,49 @@ import org.springframework.web.multipart.MultipartFile;
  */
 @Aspect
 @Component
-public class LogAspect
-{
+public class LogAspect {
     private static final Logger log = LoggerFactory.getLogger(LogAspect.class);
 
     @Autowired
     private AsyncLogService asyncLogService;
 
-    /**
-     * 处理完请求后执行
-     *
-     * @param joinPoint 切点
-     */
-    @AfterReturning(pointcut = "@annotation(controllerLog)", returning = "jsonResult")
-    public void doAfterReturning(JoinPoint joinPoint, Log controllerLog, Object jsonResult)
-    {
-        handleLog(joinPoint, controllerLog, null, jsonResult);
+    @Pointcut("@annotation(controllerLog)")
+    public void logPointcut(Log controllerLog) {
     }
 
-    /**
-     * 拦截异常操作
-     *
-     * @param joinPoint 切点
-     * @param e 异常
-     */
-    @AfterThrowing(value = "@annotation(controllerLog)", throwing = "e")
-    public void doAfterThrowing(JoinPoint joinPoint, Log controllerLog, Exception e)
-    {
-        handleLog(joinPoint, controllerLog, e, null);
+    @Around("logPointcut(controllerLog)")
+    public Object aroundLog(ProceedingJoinPoint joinPoint, Log controllerLog) throws Throwable {
+        Date startTime = new Date();
+        Object result = null;
+        Exception exception = null;
+        try {
+            result = joinPoint.proceed();
+        } catch (Exception e) {
+            exception = e;
+            throw e;
+        } finally {
+            Date endTime = new Date();
+            long consumingTime = TimeUnit.MILLISECONDS.convert(endTime.getTime() - startTime.getTime(), TimeUnit.MILLISECONDS);
+            handleLog(joinPoint, controllerLog, exception, result, startTime, endTime, consumingTime);
+        }
+        return result;
     }
 
-    protected void handleLog(final JoinPoint joinPoint, Log controllerLog, final Exception e, Object jsonResult)
-    {
-        try
-        {
+    protected void handleLog(final JoinPoint joinPoint, Log controllerLog, final Exception e, Object jsonResult, Date startTime, Date endTime, long consumingTime) {
+        try {
             // *========数据库日志=========*//
             SysOperLogVO operLog = new SysOperLogVO();
-            operLog.setStatus(BusinessStatus.SUCCESS.ordinal());
+            operLog.setStatus(e == null ? BusinessStatus.SUCCESS.ordinal() : BusinessStatus.FAIL.ordinal());
             // 请求的地址
             String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
             operLog.setOperIp(ip);
             operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
             String username = SecurityUtils.getUsername();
-            if (StringUtils.isNotBlank(username))
-            {
+            if (StringUtils.isNotBlank(username)) {
                 operLog.setOperName(username);
             }
 
-            if (e != null)
-            {
-                operLog.setStatus(BusinessStatus.FAIL.ordinal());
+            if (e != null) {
                 operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000));
             }
             // 设置方法名称
@@ -94,11 +89,17 @@ public class LogAspect
             operLog.setRequestMethod(ServletUtils.getRequest().getMethod());
             // 处理设置注解上的参数
             getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult);
+            // 记录开始时间、结束时间与耗时
+            operLog.setStartTime(startTime);
+            operLog.setEndTime(endTime);
+
+            // 将耗时转换为带有单位"ms"的字符串
+            String consumingTimeWithUnit = consumingTime + "ms";
+            operLog.setConsumingTimeWithUnit(consumingTimeWithUnit); // 存储带有单位的字符串
+
             // 保存数据库
             asyncLogService.saveSysLog(operLog);
-        }
-        catch (Exception exp)
-        {
+        } catch (Exception exp) {
             // 记录本地异常日志
             log.error("==前置通知异常==");
             log.error("异常信息:{}", exp.getMessage());
@@ -113,8 +114,7 @@ public class LogAspect
      * @param operLog 操作日志
      * @throws Exception
      */
-    public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLogVO operLog, Object jsonResult) throws Exception
-    {
+    public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLogVO operLog, Object jsonResult) throws Exception {
         // 设置action动作
         operLog.setBusinessType(log.businessType().ordinal());
         // 设置标题
@@ -122,14 +122,12 @@ public class LogAspect
         // 设置操作人类别
         operLog.setOperatorType(log.operatorType().ordinal());
         // 是否需要保存request,参数和值
-        if (log.isSaveRequestData())
-        {
+        if (log.isSaveRequestData()) {
             // 获取参数的信息,传入到数据库中。
             setRequestValue(joinPoint, operLog);
         }
         // 是否需要保存response,参数和值
-        if (log.isSaveResponseData() && Objects.nonNull(jsonResult))
-        {
+        if (log.isSaveResponseData() && Objects.nonNull(jsonResult)) {
             operLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000));
         }
     }
@@ -140,11 +138,9 @@ public class LogAspect
      * @param operLog 操作日志
      * @throws Exception 异常
      */
-    private void setRequestValue(JoinPoint joinPoint, SysOperLogVO operLog) throws Exception
-    {
+    private void setRequestValue(JoinPoint joinPoint, SysOperLogVO operLog) throws Exception {
         String requestMethod = operLog.getRequestMethod();
-        if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod))
-        {
+        if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)) {
             String params = argsArrayToString(joinPoint.getArgs());
             operLog.setOperParam(StringUtils.substring(params, 0, 2000));
         }
@@ -153,22 +149,15 @@ public class LogAspect
     /**
      * 参数拼装
      */
-    private String argsArrayToString(Object[] paramsArray)
-    {
+    private String argsArrayToString(Object[] paramsArray) {
         String params = "";
-        if (paramsArray != null && paramsArray.length > 0)
-        {
-            for (Object o : paramsArray)
-            {
-                if (Objects.nonNull(o) && !isFilterObject(o))
-                {
-                    try
-                    {
+        if (paramsArray != null && paramsArray.length > 0) {
+            for (Object o : paramsArray) {
+                if (Objects.nonNull(o) && !isFilterObject(o)) {
+                    try {
                         Object jsonObj = JSON.toJSON(o);
                         params += jsonObj.toString() + " ";
-                    }
-                    catch (Exception e)
-                    {
+                    } catch (Exception e) {
                     }
                 }
             }
@@ -183,26 +172,18 @@ public class LogAspect
      * @return 如果是需要过滤的对象,则返回true;否则返回false。
      */
     @SuppressWarnings("rawtypes")
-    public boolean isFilterObject(final Object o)
-    {
+    public boolean isFilterObject(final Object o) {
         Class<?> clazz = o.getClass();
-        if (clazz.isArray())
-        {
+        if (clazz.isArray()) {
             return clazz.getComponentType().isAssignableFrom(MultipartFile.class);
-        }
-        else if (Collection.class.isAssignableFrom(clazz))
-        {
+        } else if (Collection.class.isAssignableFrom(clazz)) {
             Collection collection = (Collection) o;
-            for (Object value : collection)
-            {
+            for (Object value : collection) {
                 return value instanceof MultipartFile;
             }
-        }
-        else if (Map.class.isAssignableFrom(clazz))
-        {
+        } else if (Map.class.isAssignableFrom(clazz)) {
             Map map = (Map) o;
-            for (Object value : map.entrySet())
-            {
+            for (Object value : map.entrySet()) {
                 Map.Entry entry = (Map.Entry) value;
                 return entry.getValue() instanceof MultipartFile;
             }
@@ -210,4 +191,4 @@ public class LogAspect
         return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse
                 || o instanceof BindingResult;
     }
-}
+}

+ 6 - 0
usky-common/usky-common-log/src/main/java/com/usky/common/log/enums/BusinessType.java

@@ -56,4 +56,10 @@ public enum BusinessType
      * 清空数据
      */
     CLEAN,
+
+    /**
+     * 查询
+     */
+    SELECT,
+
 }

+ 2 - 0
usky-common/usky-common-log/src/main/java/com/usky/common/log/service/AsyncLogService.java

@@ -3,6 +3,7 @@ package com.usky.common.log.service;//package com.ruoyi.common.log.service;
 import com.usky.system.RemoteLogService;
 import com.usky.system.domain.SysOperLogVO;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
@@ -14,6 +15,7 @@ import org.springframework.stereotype.Service;
 @Service
 public class AsyncLogService
 {
+    @Qualifier("com.usky.system.RemoteLogService")
     @Autowired
     private RemoteLogService remoteLogService;