1
13693261870
2024-12-13 d2cbc715156a231d449108746b36ede97306d9ab
1
已修改5个文件
91 ■■■■■ 文件已修改
docker-compose/mysql/initdb/se_cloud_20241119.sql 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docker-compose/mysql/initdb/se_cloud_20241204.sql 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
se-modules/se-system/src/main/java/com/se/system/controller/SysCtrlLogController.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
se-modules/se-system/src/main/java/com/se/system/domain/SysCtrlLog.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
se-modules/se-system/src/main/resources/mapper/system/SysCtrlLogMapper.xml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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 '表ID',
  title             varchar(200)    not null                   comment '标题',
  type              char(1)                                    comment '类型(n-正常,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;
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);
-- ----------------------------
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));
    }
}
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;
    /**
     * 表ID
     */
    @Excel(name = "表ID")
    private Long tabId;
    /**
     * 标题
     */
    @Excel(name = "标题")
    private String title;
    /**
     * 类型
     * 类型(n-正常,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())
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>