Browse Source

soc-modules-deploy模块后台代码迁移-日志模块机构筛选优化

humingshi-7@163.com 1 year ago
parent
commit
78f953ede3

+ 10 - 2
project_data/sql/0.1.1/soc/soc.sql

@@ -644,7 +644,7 @@ CREATE TABLE `deploy_operation_log`  (
   `user_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作人',
   `organize_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '所属机构',
   `path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '机构路径',
-  `org_id` int(0) NULL DEFAULT NULL COMMENT '机构ID',
+  `org_id` bigint(0) NULL DEFAULT NULL COMMENT '机构ID',
   `host_ip` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '主机IP',
   `host_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '主机名称',
   `host_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '主机ID',
@@ -686,4 +686,12 @@ where r.category_id = 3712199107215360;
 INSERT INTO `sys_config`(config_name,config_key,config_value,config_type,create_by,create_time,update_by,update_time,remark)
  VALUES ('部署中心:允许主机重新注册', 'DEPLOY_REGISTER_AGAIN', '1', 'Y', '超级管理员', '2024-07-02 10:25:25', '', null, '0:否,1:是');
 
-
+-- ----------------------------
+-- 菜单配置:部署中心菜单初始化
+-- ----------------------------
+INSERT INTO `sys_menu` VALUES ('01806204625679527938', '部署中心', '0', '5', 'deploy', null, null, '1', '0', 'M', '0', '0', '', '1', 'monitor', null, '超级管理员', '2024-06-27 13:55:15', '超级管理员', '2024-06-27 13:55:37', '');
+INSERT INTO `sys_menu` VALUES ('01806205123841208322', '主机管理', '1806204625679527938', '1', 'hostInfo', 'deploy/hostInfo/index', null, '1', '0', 'C', '0', '0', 'deploy:hostInfo:list', '1', 'monitor', null, '超级管理员', '2024-06-27 13:57:13', '', null, '');
+INSERT INTO `sys_menu` VALUES ('01806205680513429506', '升级包管理', '1806204625679527938', '2', 'package', 'deploy/package/index', null, '1', '0', 'C', '0', '0', 'deploy:package:list', '1', 'zip', null, '超级管理员', '2024-06-27 13:59:26', '', null, '');
+INSERT INTO `sys_menu` VALUES ('01806206030435823618', '升级状态查询', '1806204625679527938', '3', 'upgradeStatus', 'deploy/upgradeStatus/index', null, '1', '0', 'C', '0', '0', 'deploy:upgradeStatus:list', '1', 'documentation', null, '超级管理员', '2024-06-27 14:00:50', '', null, '');
+INSERT INTO `sys_menu` VALUES ('01806206236392927233', '白令海管理', '1806204625679527938', '4', 'bering', 'deploy/bering/index', null, '1', '0', 'C', '0', '0', 'deploy:bering:list', '1', 'component', null, '超级管理员', '2024-06-27 14:01:39', '', null, '');
+INSERT INTO `sys_menu` VALUES ('01808375108978040834', '日志', '1806204625679527938', '5', 'log', 'deploy/log/index', null, '1', '0', 'C', '0', '0', 'deploy:log:list', '1', 'log', null, '超级管理员', '2024-07-03 13:39:58', '', null, '');

+ 3 - 0
soc-modules/soc-modules-deploy/src/main/java/com/xunmei/deploy/domain/OperationLog.java

@@ -78,4 +78,7 @@ public class OperationLog implements Serializable {
     @TableField(exist = false)
     private String endDate;
 
+    @TableField(exist = false)
+    private Boolean checkSub = false;
+
 }

+ 13 - 4
soc-modules/soc-modules-deploy/src/main/resources/mapper/OperationLogDao.xml

@@ -3,15 +3,24 @@
 <mapper namespace="com.xunmei.deploy.dao.OperationLogDao">
 
     <select id="selectPage"  resultType="com.xunmei.deploy.domain.OperationLog">
-        select * from deploy_operation_log h where 1=1
+        select * from deploy_operation_log h
+        left join hv_org o on o.org_id = h.org_id
+        where 1=1
         <if test="info.startDate != null and info.startDate != ''">
-        and h.opera_time >= #{info.startDate}
+            and h.opera_time >= #{info.startDate}
         </if>
         <if test="info.endDate != null and info.endDate != ''">
             and h.opera_time &lt;= #{info.endDate}
         </if>
-        <if test="info.organizeName != '' and info.organizeName != null">
-            AND h.organize_name LIKE CONCAT('%', #{info.organizeName}, '%' )
+        <if test=" info.orgId != null ">
+            <choose>
+                <when test=" info.checkSub == true">
+                    and o.path like CONCAT('%', #{info.orgId}, '%' )
+                </when>
+                <otherwise>
+                    and o.org_id = #{info.orgId}
+                </otherwise>
+            </choose>
         </if>
         <if test="info.hostIp != '' and info.hostIp != null">
             AND h.host_ip LIKE CONCAT('%', #{info.hostIp}, '%' )