doum
2025-09-11 7298d5354963a88643a543b51b90192dc9fc934c
server/system_service/src/main/java/com/doumee/config/mybatis/MyBatisInterceptor.java
@@ -1,6 +1,6 @@
package com.doumee.config.mybatis;
import com.doumee.core.model.LoginUserInfo;
import com.doumee.service.business.third.model.LoginUserInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.binding.MapperMethod;
import org.apache.ibatis.executor.Executor;
@@ -50,13 +50,13 @@
        if (target == null)
            return invocation.proceed();
        // 创建语句
//        if (SqlCommandType.INSERT == sqlCommandType) {
//            this.handleOperaStatement(target, CREATE_TIME, CREATE_USER);
//        }
//        // 更新语句
//        else if (SqlCommandType.UPDATE == sqlCommandType) {
//            this.handleOperaStatement(target, UPDATE_TIME, UPDATE_USER);
//        }
        if (SqlCommandType.INSERT == sqlCommandType) {
            this.handleOperaStatement(target, CREATE_TIME, CREATE_USER);
        }
        // 更新语句
        else if (SqlCommandType.UPDATE == sqlCommandType) {
            this.handleOperaStatement(target, UPDATE_TIME, UPDATE_USER);
        }
        return invocation.proceed();
    }
@@ -79,14 +79,14 @@
                this.setFieldValue(operaTimeField, target, new Date());
            }
        }
        // 操作人
       /* // 操作人
        Field operaUserField = ReflectionUtils.findField(target.getClass(), fieldNames[1]);
        if (operaUserField != null) {
            Object operaUser = this.getFieldValue(operaUserField, target);
            if (operaUser == null && this.getLoginUser()!=null)  {
                this.setFieldValue(operaUserField, target, this.getLoginUser().getId());
            }
        }
        }*/
    }
    /**