From 4d6f931422788582f056e18d3cabd44ad1e5485c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com> Date: Wed, 19 Jul 2023 14:39:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=BA=94=E7=94=A8=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzims/common/logs/consumer/SysLogConsumer.java | 2 +- .../java/com/hnac/hzims/common/logs/consumer/SysLogQueue.java | 2 +- .../main/java/com/hnac/hzims/middle/systemlog/entity/SysLog.java | 9 +++------ .../java/com/hnac/hzims/middle/systemlog/mapper/SysLogMapper.xml | 3 ++- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogConsumer.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogConsumer.java index 8916128..83d30b2 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogConsumer.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogConsumer.java @@ -27,7 +27,7 @@ public class SysLogConsumer implements Runnable { /** * 默认16 */ - private static final int DEFAULT_BATCH_SIZE = 16; + private static final int DEFAULT_BATCH_SIZE = 1000; @Resource private SysLogQueue auditLogQueue; diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogQueue.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogQueue.java index 1424a74..5185582 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogQueue.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogQueue.java @@ -27,7 +27,7 @@ public class SysLogQueue { * @param auditLog */ public void add(SysLogTo auditLog) { - blockingQueue.add(auditLog); + blockingQueue.offer(auditLog); } /** diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/SysLog.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/SysLog.java index d9e5131..92d7419 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/SysLog.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/entity/SysLog.java @@ -1,14 +1,10 @@ package com.hnac.hzims.middle.systemlog.entity; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import java.time.LocalDateTime; import java.sql.Blob; -import com.baomidou.mybatisplus.annotation.TableField; - import java.io.Serializable; import com.fasterxml.jackson.annotation.JsonFormat; @@ -232,7 +228,8 @@ public class SysLog implements Serializable { */ @ApiModelProperty("逻辑删除") @TableField("is_deleted") - private Integer isDeleted; + @TableLogic(value = "0",delval = "1") + private Integer deleted; } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/SysLogMapper.xml b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/SysLogMapper.xml index 2ad6ef4..c059325 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/SysLogMapper.xml +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/SysLogMapper.xml @@ -15,7 +15,8 @@ module_name, count(module_name) moduleNameCount from hzims_sys_log - where to_days(operation_time) = to_days(now()) + where is_deleted = 0 + and to_days(operation_time) = to_days(now()) group by module_name;