From d2cbc715156a231d449108746b36ede97306d9ab Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期五, 13 十二月 2024 20:41:43 +0800
Subject: [PATCH] 1

---
 docker-compose/mysql/initdb/se_cloud_20241119.sql                                     |   13 +++---
 se-modules/se-system/src/main/java/com/se/system/domain/SysCtrlLog.java               |   25 ++++++++++--
 se-modules/se-system/src/main/java/com/se/system/controller/SysCtrlLogController.java |   28 +++++--------
 docker-compose/mysql/initdb/se_cloud_20241204.sql                                     |    2 
 se-modules/se-system/src/main/resources/mapper/system/SysCtrlLogMapper.xml            |   23 +++++++----
 5 files changed, 53 insertions(+), 38 deletions(-)

diff --git a/docker-compose/mysql/initdb/se_cloud_20241119.sql b/docker-compose/mysql/initdb/se_cloud_20241119.sql
index c9d6c1a..6c2cfa9 100644
--- a/docker-compose/mysql/initdb/se_cloud_20241119.sql
+++ b/docker-compose/mysql/initdb/se_cloud_20241119.sql
@@ -197,16 +197,17 @@
 drop table if exists sys_ctrl_log;
 create table sys_ctrl_log (
   log_id            bigint(20)      not null auto_increment    comment '鏃ュ織ID',
-  title             varchar(100)    not null                   comment '鏍囬',
-  type              char(1)         default '0'                comment '绫诲瀷',
+  tab_id            bigint(20)                                 comment '琛↖D',
+  title             varchar(200)    not null                   comment '鏍囬',
+  type              char(1)                                    comment '绫诲瀷锛坣-姝e父锛宔-閿欒锛�',
   ip                varchar(50)                                comment 'IP',
   url               varchar(4000)                              comment 'URL',
-  method            varchar(20)                                comment '鏂规硶',
+  method            varchar(50)                                comment '鏂规硶',
   args              varchar(4000)                              comment '鍙傛暟',
-  msg               varchar(2000)                              comment '娑堟伅',
-  oper              varchar(50)                                comment '鎿嶄綔鍛�',
+  msg               varchar(4000)                              comment '娑堟伅',
+  oper              varchar(100)                               comment '鎿嶄綔鍛�',
   time              datetime        default now()              comment '鎿嶄綔鏃堕棿',
-  remark            varchar(500)    default ''                 comment '澶囨敞',
+  remark            varchar(500)                               comment '澶囨敞',
   primary key (log_id)
 ) engine=innodb auto_increment=1 comment = '鎺у埗鏃ュ織琛�';
 select * from sys_ctrl_log order by log_id;
diff --git a/docker-compose/mysql/initdb/se_cloud_20241204.sql b/docker-compose/mysql/initdb/se_cloud_20241204.sql
index b34a00a..115d76d 100644
--- a/docker-compose/mysql/initdb/se_cloud_20241204.sql
+++ b/docker-compose/mysql/initdb/se_cloud_20241204.sql
@@ -108,4 +108,4 @@
 insert into sys_status_ctrl (sys_name,ip,url,method,order_num) values ('鐢ㄦ埛鍙婃潈闄愮鐞�','127.0.0.1','http://localhost:8080/system/health', 'GET',1);
 insert into sys_status_ctrl (sys_name,ip,url,method,order_num) values ('鏁版嵁绠$悊鍒嗙郴缁�','127.0.0.1','http://localhost:8080/gateway/health','GET',2);
 -- ----------------------------
-                                                                                                                                                                               
+                                                                                                                                                                             
diff --git a/se-modules/se-system/src/main/java/com/se/system/controller/SysCtrlLogController.java b/se-modules/se-system/src/main/java/com/se/system/controller/SysCtrlLogController.java
index c64e33d..f0d1f98 100644
--- a/se-modules/se-system/src/main/java/com/se/system/controller/SysCtrlLogController.java
+++ b/se-modules/se-system/src/main/java/com/se/system/controller/SysCtrlLogController.java
@@ -21,16 +21,16 @@
 import com.se.common.core.utils.poi.ExcelUtil;
 import com.se.common.core.web.page.TableDataInfo;
 
+
 /**
  * 鎺у埗鏃ュ織Controller
- * 
+ *
  * @author se
- * @date 2024-11-22
+ * @date 2024-12-13
  */
 @RestController
 @RequestMapping("/ctrlLog")
-public class SysCtrlLogController extends BaseController
-{
+public class SysCtrlLogController extends BaseController {
     @Autowired
     private ISysCtrlLogService sysCtrlLogService;
 
@@ -39,8 +39,7 @@
      */
     @RequiresPermissions("system:ctrlLog:list")
     @GetMapping("/list")
-    public TableDataInfo list(SysCtrlLog sysCtrlLog)
-    {
+    public TableDataInfo list(SysCtrlLog sysCtrlLog) {
         startPage();
         List<SysCtrlLog> list = sysCtrlLogService.selectSysCtrlLogList(sysCtrlLog);
         return getDataTable(list);
@@ -52,8 +51,7 @@
     @RequiresPermissions("system:ctrlLog:export")
     @Log(title = "鎺у埗鏃ュ織", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, SysCtrlLog sysCtrlLog)
-    {
+    public void export(HttpServletResponse response, SysCtrlLog sysCtrlLog) {
         List<SysCtrlLog> list = sysCtrlLogService.selectSysCtrlLogList(sysCtrlLog);
         ExcelUtil<SysCtrlLog> util = new ExcelUtil<SysCtrlLog>(SysCtrlLog.class);
         util.exportExcel(response, list, "鎺у埗鏃ュ織鏁版嵁");
@@ -64,8 +62,7 @@
      */
     @RequiresPermissions("system:ctrlLog:query")
     @GetMapping(value = "/{logId}")
-    public AjaxResult getInfo(@PathVariable("logId") Long logId)
-    {
+    public AjaxResult getInfo(@PathVariable("logId") Long logId) {
         return success(sysCtrlLogService.selectSysCtrlLogByLogId(logId));
     }
 
@@ -75,8 +72,7 @@
     @RequiresPermissions("system:ctrlLog:add")
     @Log(title = "鎺у埗鏃ュ織", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody SysCtrlLog sysCtrlLog)
-    {
+    public AjaxResult add(@RequestBody SysCtrlLog sysCtrlLog) {
         return toAjax(sysCtrlLogService.insertSysCtrlLog(sysCtrlLog));
     }
 
@@ -86,8 +82,7 @@
     @RequiresPermissions("system:ctrlLog:edit")
     @Log(title = "鎺у埗鏃ュ織", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody SysCtrlLog sysCtrlLog)
-    {
+    public AjaxResult edit(@RequestBody SysCtrlLog sysCtrlLog) {
         return toAjax(sysCtrlLogService.updateSysCtrlLog(sysCtrlLog));
     }
 
@@ -96,9 +91,8 @@
      */
     @RequiresPermissions("system:ctrlLog:remove")
     @Log(title = "鎺у埗鏃ュ織", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{logIds}")
-    public AjaxResult remove(@PathVariable Long[] logIds)
-    {
+    @DeleteMapping("/{logIds}")
+    public AjaxResult remove(@PathVariable Long[] logIds) {
         return toAjax(sysCtrlLogService.deleteSysCtrlLogByLogIds(logIds));
     }
 }
diff --git a/se-modules/se-system/src/main/java/com/se/system/domain/SysCtrlLog.java b/se-modules/se-system/src/main/java/com/se/system/domain/SysCtrlLog.java
index 837004f..c2b6bb8 100644
--- a/se-modules/se-system/src/main/java/com/se/system/domain/SysCtrlLog.java
+++ b/se-modules/se-system/src/main/java/com/se/system/domain/SysCtrlLog.java
@@ -3,15 +3,14 @@
 import java.util.Date;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.se.common.core.annotation.Excel;
-import com.se.common.core.web.domain.BaseEntity;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
 /**
  * 鎺у埗鏃ュ織瀵硅薄 sys_ctrl_log
- * 
+ *
  * @author se
- * @date 2024-11-22
+ * @date 2024-12-13
  */
 public class SysCtrlLog {
     private static final long serialVersionUID = 1L;
@@ -22,15 +21,21 @@
     private Long logId;
 
     /**
+     * 琛↖D
+     */
+    @Excel(name = "琛↖D")
+    private Long tabId;
+
+    /**
      * 鏍囬
      */
     @Excel(name = "鏍囬")
     private String title;
 
     /**
-     * 绫诲瀷
+     * 绫诲瀷锛坣-姝e父锛宔-閿欒锛�
      */
-    @Excel(name = "绫诲瀷")
+    @Excel(name = "绫诲瀷", readConverterExp = "n=-姝e父锛宔-閿欒")
     private String type;
 
     /**
@@ -79,6 +84,7 @@
     /**
      * 澶囨敞
      */
+    @Excel(name = "澶囨敞")
     private String remark;
 
     public void setLogId(Long logId) {
@@ -87,6 +93,14 @@
 
     public Long getLogId() {
         return logId;
+    }
+
+    public void setTabId(Long tabId) {
+        this.tabId = tabId;
+    }
+
+    public Long getTabId() {
+        return tabId;
     }
 
     public void setTitle(String title) {
@@ -173,6 +187,7 @@
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                 .append("logId", getLogId())
+                .append("tabId", getTabId())
                 .append("title", getTitle())
                 .append("type", getType())
                 .append("ip", getIp())
diff --git a/se-modules/se-system/src/main/resources/mapper/system/SysCtrlLogMapper.xml b/se-modules/se-system/src/main/resources/mapper/system/SysCtrlLogMapper.xml
index 8a9e2e2..680e457 100644
--- a/se-modules/se-system/src/main/resources/mapper/system/SysCtrlLogMapper.xml
+++ b/se-modules/se-system/src/main/resources/mapper/system/SysCtrlLogMapper.xml
@@ -1,11 +1,12 @@
 <?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.se.system.mapper.SysCtrlLogMapper">
-    
+
     <resultMap type="SysCtrlLog" id="SysCtrlLogResult">
         <result property="logId"    column="log_id"    />
+        <result property="tabId"    column="tab_id"    />
         <result property="title"    column="title"    />
         <result property="type"    column="type"    />
         <result property="ip"    column="ip"    />
@@ -19,12 +20,13 @@
     </resultMap>
 
     <sql id="selectSysCtrlLogVo">
-        select log_id, title, type, ip, url, method, args, msg, oper, time, remark from sys_ctrl_log
+        select log_id, tab_id, title, type, ip, url, method, args, msg, oper, time, remark from sys_ctrl_log
     </sql>
 
     <select id="selectSysCtrlLogList" parameterType="SysCtrlLog" resultMap="SysCtrlLogResult">
         <include refid="selectSysCtrlLogVo"/>
-        <where>  
+        <where>
+            <if test="tabId != null "> and tab_id = #{tabId}</if>
             <if test="title != null  and title != ''"> and title = #{title}</if>
             <if test="type != null  and type != ''"> and type = #{type}</if>
             <if test="ip != null  and ip != ''"> and ip = #{ip}</if>
@@ -36,7 +38,7 @@
             <if test="time != null "> and time = #{time}</if>
         </where>
     </select>
-    
+
     <select id="selectSysCtrlLogByLogId" parameterType="Long" resultMap="SysCtrlLogResult">
         <include refid="selectSysCtrlLogVo"/>
         where log_id = #{logId}
@@ -45,6 +47,7 @@
     <insert id="insertSysCtrlLog" parameterType="SysCtrlLog" useGeneratedKeys="true" keyProperty="logId">
         insert into sys_ctrl_log
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="tabId != null">tab_id,</if>
             <if test="title != null and title != ''">title,</if>
             <if test="type != null">type,</if>
             <if test="ip != null">ip,</if>
@@ -55,8 +58,9 @@
             <if test="oper != null">oper,</if>
             <if test="time != null">time,</if>
             <if test="remark != null">remark,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="tabId != null">#{tabId},</if>
             <if test="title != null and title != ''">#{title},</if>
             <if test="type != null">#{type},</if>
             <if test="ip != null">#{ip},</if>
@@ -67,12 +71,13 @@
             <if test="oper != null">#{oper},</if>
             <if test="time != null">#{time},</if>
             <if test="remark != null">#{remark},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateSysCtrlLog" parameterType="SysCtrlLog">
         update sys_ctrl_log
         <trim prefix="SET" suffixOverrides=",">
+            <if test="tabId != null">tab_id = #{tabId},</if>
             <if test="title != null and title != ''">title = #{title},</if>
             <if test="type != null">type = #{type},</if>
             <if test="ip != null">ip = #{ip},</if>
@@ -92,7 +97,7 @@
     </delete>
 
     <delete id="deleteSysCtrlLogByLogIds" parameterType="String">
-        delete from sys_ctrl_log where log_id in 
+        delete from sys_ctrl_log where log_id in
         <foreach item="logId" collection="array" open="(" separator="," close=")">
             #{logId}
         </foreach>

--
Gitblit v1.9.3