From 8f6484e47085fde953e4e7c725da6fa56228322b Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期三, 12 一月 2022 21:22:26 +0800
Subject: [PATCH] [重磅更新] 重写项目整体结构 数据处理下沉至 Mapper 符合 MVC 规范 减少循环依赖

---
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java
index 9371d5a..63378d3 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java
@@ -6,7 +6,6 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.core.domain.PageQuery;
 import com.ruoyi.common.core.domain.dto.OperLogDTO;
-import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.core.service.OperLogService;
 import com.ruoyi.common.utils.StringUtils;
@@ -14,6 +13,7 @@
 import com.ruoyi.system.domain.SysOperLog;
 import com.ruoyi.system.mapper.SysOperLogMapper;
 import com.ruoyi.system.service.ISysOperLogService;
+import lombok.RequiredArgsConstructor;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
@@ -27,8 +27,11 @@
  *
  * @author Lion Li
  */
+@RequiredArgsConstructor
 @Service
-public class SysOperLogServiceImpl extends ServicePlusImpl<SysOperLogMapper, SysOperLog, SysOperLog> implements ISysOperLogService, OperLogService {
+public class SysOperLogServiceImpl implements ISysOperLogService, OperLogService {
+
+    private final SysOperLogMapper baseMapper;
 
     /**
      * 鎿嶄綔鏃ュ織璁板綍
@@ -64,7 +67,7 @@
         if(StringUtils.isBlank(pageQuery.getOrderByColumn())) {
             pageQuery.setOrderByColumn("oper_id").setIsAsc("desc");
         }
-        Page<SysOperLog> page = page(pageQuery.build(), lqw);
+        Page<SysOperLog> page = baseMapper.selectPage(pageQuery.build(), lqw);
         return TableDataInfo.build(page);
     }
 
@@ -76,7 +79,7 @@
     @Override
     public void insertOperlog(SysOperLog operLog) {
         operLog.setOperTime(new Date());
-        save(operLog);
+        baseMapper.insert(operLog);
     }
 
     /**
@@ -88,7 +91,7 @@
     @Override
     public List<SysOperLog> selectOperLogList(SysOperLog operLog) {
         Map<String, Object> params = operLog.getParams();
-        return list(new LambdaQueryWrapper<SysOperLog>()
+        return baseMapper.selectList(new LambdaQueryWrapper<SysOperLog>()
             .like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle())
             .eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0,
                 SysOperLog::getBusinessType, operLog.getBusinessType())
@@ -124,7 +127,7 @@
      */
     @Override
     public SysOperLog selectOperLogById(Long operId) {
-        return getById(operId);
+        return baseMapper.selectById(operId);
     }
 
     /**
@@ -132,6 +135,6 @@
      */
     @Override
     public void cleanOperLog() {
-        remove(new LambdaQueryWrapper<>());
+        baseMapper.delete(new LambdaQueryWrapper<>());
     }
 }

--
Gitblit v1.9.3