mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 17:38:48 +08:00
使用mpj进行查询
This commit is contained in:
parent
83b8543f18
commit
6edf618b6c
@ -21,8 +21,8 @@ import org.dromara.common.mail.utils.MailUtils;
|
|||||||
import org.dromara.common.redis.annotation.RateLimiter;
|
import org.dromara.common.redis.annotation.RateLimiter;
|
||||||
import org.dromara.common.redis.enums.LimitType;
|
import org.dromara.common.redis.enums.LimitType;
|
||||||
import org.dromara.common.redis.utils.RedisUtils;
|
import org.dromara.common.redis.utils.RedisUtils;
|
||||||
import org.dromara.common.web.core.WaveAndCircleCaptcha;
|
|
||||||
import org.dromara.common.web.config.properties.CaptchaProperties;
|
import org.dromara.common.web.config.properties.CaptchaProperties;
|
||||||
|
import org.dromara.common.web.core.WaveAndCircleCaptcha;
|
||||||
import org.dromara.sms4j.api.SmsBlend;
|
import org.dromara.sms4j.api.SmsBlend;
|
||||||
import org.dromara.sms4j.api.entity.SmsResponse;
|
import org.dromara.sms4j.api.entity.SmsResponse;
|
||||||
import org.dromara.sms4j.core.factory.SmsFactory;
|
import org.dromara.sms4j.core.factory.SmsFactory;
|
||||||
|
|||||||
@ -3,7 +3,6 @@ package org.dromara.web.service;
|
|||||||
|
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.SpringUtils;
|
import org.dromara.common.core.utils.SpringUtils;
|
||||||
import org.dromara.system.domain.SysClient;
|
|
||||||
import org.dromara.system.domain.vo.SysClientVo;
|
import org.dromara.system.domain.vo.SysClientVo;
|
||||||
import org.dromara.web.domain.vo.LoginVo;
|
import org.dromara.web.domain.vo.LoginVo;
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@ package org.dromara.web.service.impl;
|
|||||||
import cn.dev33.satoken.stp.StpUtil;
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import cn.dev33.satoken.stp.parameter.SaLoginParameter;
|
import cn.dev33.satoken.stp.parameter.SaLoginParameter;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.constant.Constants;
|
import org.dromara.common.core.constant.Constants;
|
||||||
@ -101,7 +101,7 @@ public class EmailAuthStrategy implements IAuthStrategy {
|
|||||||
* @return 用户信息
|
* @return 用户信息
|
||||||
*/
|
*/
|
||||||
private SysUserVo loadUserByEmail(String email) {
|
private SysUserVo loadUserByEmail(String email) {
|
||||||
SysUserVo user = userMapper.selectVoOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getEmail, email));
|
SysUserVo user = userMapper.selectVoOne(new MPJLambdaWrapper<SysUser>().eq(SysUser::getEmail, email));
|
||||||
if (ObjectUtil.isNull(user)) {
|
if (ObjectUtil.isNull(user)) {
|
||||||
log.info("登录用户:{} 不存在.", email);
|
log.info("登录用户:{} 不存在.", email);
|
||||||
throw new UserException("user.not.exists", email);
|
throw new UserException("user.not.exists", email);
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import cn.dev33.satoken.stp.StpUtil;
|
|||||||
import cn.dev33.satoken.stp.parameter.SaLoginParameter;
|
import cn.dev33.satoken.stp.parameter.SaLoginParameter;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.crypto.digest.BCrypt;
|
import cn.hutool.crypto.digest.BCrypt;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.constant.Constants;
|
import org.dromara.common.core.constant.Constants;
|
||||||
@ -118,7 +118,7 @@ public class PasswordAuthStrategy implements IAuthStrategy {
|
|||||||
* @return 用户信息
|
* @return 用户信息
|
||||||
*/
|
*/
|
||||||
private SysUserVo loadUserByUsername(String username) {
|
private SysUserVo loadUserByUsername(String username) {
|
||||||
SysUserVo user = userMapper.selectVoOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUserName, username));
|
SysUserVo user = userMapper.selectVoOne(new MPJLambdaWrapper<SysUser>().eq(SysUser::getUserName, username));
|
||||||
if (ObjectUtil.isNull(user)) {
|
if (ObjectUtil.isNull(user)) {
|
||||||
log.info("登录用户:{} 不存在.", username);
|
log.info("登录用户:{} 不存在.", username);
|
||||||
throw new UserException("user.not.exists", username);
|
throw new UserException("user.not.exists", username);
|
||||||
|
|||||||
@ -3,7 +3,7 @@ package org.dromara.web.service.impl;
|
|||||||
import cn.dev33.satoken.stp.StpUtil;
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import cn.dev33.satoken.stp.parameter.SaLoginParameter;
|
import cn.dev33.satoken.stp.parameter.SaLoginParameter;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.constant.Constants;
|
import org.dromara.common.core.constant.Constants;
|
||||||
@ -101,7 +101,7 @@ public class SmsAuthStrategy implements IAuthStrategy {
|
|||||||
* @return 用户信息
|
* @return 用户信息
|
||||||
*/
|
*/
|
||||||
private SysUserVo loadUserByPhoneNumber(String phoneNumber) {
|
private SysUserVo loadUserByPhoneNumber(String phoneNumber) {
|
||||||
SysUserVo user = userMapper.selectVoOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getPhoneNumber, phoneNumber));
|
SysUserVo user = userMapper.selectVoOne(new MPJLambdaWrapper<SysUser>().eq(SysUser::getPhoneNumber, phoneNumber));
|
||||||
if (ObjectUtil.isNull(user)) {
|
if (ObjectUtil.isNull(user)) {
|
||||||
log.info("登录用户:{} 不存在.", phoneNumber);
|
log.info("登录用户:{} 不存在.", phoneNumber);
|
||||||
throw new UserException("user.not.exists", phoneNumber);
|
throw new UserException("user.not.exists", phoneNumber);
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
package org.dromara.common.core.exception.base;
|
package org.dromara.common.core.exception.base;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.dromara.common.core.utils.MessageUtils;
|
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.dromara.common.core.utils.MessageUtils;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,10 @@ import lombok.NoArgsConstructor;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 线程工具
|
* 线程工具
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
package org.dromara.common.core.utils.reflect;
|
package org.dromara.common.core.utils.reflect;
|
||||||
|
|
||||||
import cn.hutool.core.util.ReflectUtil;
|
import cn.hutool.core.util.ReflectUtil;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,10 @@ package org.dromara.common.core.validate.enums;
|
|||||||
import jakarta.validation.Constraint;
|
import jakarta.validation.Constraint;
|
||||||
import jakarta.validation.Payload;
|
import jakarta.validation.Payload;
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
import java.lang.annotation.Documented;
|
||||||
|
import java.lang.annotation.Repeatable;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
import static java.lang.annotation.ElementType.*;
|
import static java.lang.annotation.ElementType.*;
|
||||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package org.dromara.common.core.xss;
|
|||||||
|
|
||||||
import jakarta.validation.Constraint;
|
import jakarta.validation.Constraint;
|
||||||
import jakarta.validation.Payload;
|
import jakarta.validation.Payload;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package org.dromara.common.core.xss;
|
|||||||
|
|
||||||
import cn.hutool.core.util.ReUtil;
|
import cn.hutool.core.util.ReUtil;
|
||||||
import cn.hutool.http.HtmlUtil;
|
import cn.hutool.http.HtmlUtil;
|
||||||
|
|
||||||
import jakarta.validation.ConstraintValidator;
|
import jakarta.validation.ConstraintValidator;
|
||||||
import jakarta.validation.ConstraintValidatorContext;
|
import jakarta.validation.ConstraintValidatorContext;
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
package org.dromara.common.encrypt.core;
|
package org.dromara.common.encrypt.core;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||||
import org.dromara.common.encrypt.enums.EncodeType;
|
import org.dromara.common.encrypt.enums.EncodeType;
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加密上下文 用于encryptor传递必要的参数。
|
* 加密上下文 用于encryptor传递必要的参数。
|
||||||
|
|||||||
@ -7,7 +7,10 @@ import jakarta.servlet.http.HttpServletResponse;
|
|||||||
import jakarta.servlet.http.HttpServletResponseWrapper;
|
import jakarta.servlet.http.HttpServletResponseWrapper;
|
||||||
import org.dromara.common.encrypt.utils.EncryptUtils;
|
import org.dromara.common.encrypt.utils.EncryptUtils;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStreamWriter;
|
||||||
|
import java.io.PrintWriter;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
package org.dromara.common.encrypt.properties;
|
package org.dromara.common.encrypt.properties;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||||
import org.dromara.common.encrypt.enums.EncodeType;
|
import org.dromara.common.encrypt.enums.EncodeType;
|
||||||
import lombok.Data;
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -3,18 +3,18 @@ package org.dromara.common.excel.convert;
|
|||||||
import cn.hutool.core.annotation.AnnotationUtil;
|
import cn.hutool.core.annotation.AnnotationUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.fesod.sheet.converters.Converter;
|
import org.apache.fesod.sheet.converters.Converter;
|
||||||
import org.apache.fesod.sheet.enums.CellDataTypeEnum;
|
import org.apache.fesod.sheet.enums.CellDataTypeEnum;
|
||||||
import org.apache.fesod.sheet.metadata.GlobalConfiguration;
|
import org.apache.fesod.sheet.metadata.GlobalConfiguration;
|
||||||
import org.apache.fesod.sheet.metadata.data.ReadCellData;
|
import org.apache.fesod.sheet.metadata.data.ReadCellData;
|
||||||
import org.apache.fesod.sheet.metadata.data.WriteCellData;
|
import org.apache.fesod.sheet.metadata.data.WriteCellData;
|
||||||
import org.apache.fesod.sheet.metadata.property.ExcelContentProperty;
|
import org.apache.fesod.sheet.metadata.property.ExcelContentProperty;
|
||||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
|
||||||
import org.dromara.common.core.service.DictService;
|
import org.dromara.common.core.service.DictService;
|
||||||
import org.dromara.common.core.utils.SpringUtils;
|
import org.dromara.common.core.utils.SpringUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package org.dromara.common.excel.convert;
|
|||||||
import cn.hutool.core.annotation.AnnotationUtil;
|
import cn.hutool.core.annotation.AnnotationUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.fesod.sheet.converters.Converter;
|
import org.apache.fesod.sheet.converters.Converter;
|
||||||
import org.apache.fesod.sheet.enums.CellDataTypeEnum;
|
import org.apache.fesod.sheet.enums.CellDataTypeEnum;
|
||||||
import org.apache.fesod.sheet.metadata.GlobalConfiguration;
|
import org.apache.fesod.sheet.metadata.GlobalConfiguration;
|
||||||
@ -11,7 +12,6 @@ import org.apache.fesod.sheet.metadata.data.WriteCellData;
|
|||||||
import org.apache.fesod.sheet.metadata.property.ExcelContentProperty;
|
import org.apache.fesod.sheet.metadata.property.ExcelContentProperty;
|
||||||
import org.dromara.common.core.utils.reflect.ReflectUtils;
|
import org.dromara.common.core.utils.reflect.ReflectUtils;
|
||||||
import org.dromara.common.excel.annotation.ExcelEnumFormat;
|
import org.dromara.common.excel.annotation.ExcelEnumFormat;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|||||||
@ -3,10 +3,10 @@ package org.dromara.common.excel.core;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ReflectUtil;
|
import cn.hutool.core.util.ReflectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import lombok.SneakyThrows;
|
||||||
import org.apache.fesod.sheet.annotation.ExcelIgnore;
|
import org.apache.fesod.sheet.annotation.ExcelIgnore;
|
||||||
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
||||||
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
||||||
import lombok.SneakyThrows;
|
|
||||||
import org.apache.poi.ss.util.CellRangeAddress;
|
import org.apache.poi.ss.util.CellRangeAddress;
|
||||||
import org.dromara.common.core.utils.reflect.ReflectUtils;
|
import org.dromara.common.core.utils.reflect.ReflectUtils;
|
||||||
import org.dromara.common.excel.annotation.CellMerge;
|
import org.dromara.common.excel.annotation.CellMerge;
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
package org.dromara.common.excel.core;
|
package org.dromara.common.excel.core;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import jakarta.validation.ConstraintViolation;
|
||||||
|
import jakarta.validation.ConstraintViolationException;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.fesod.sheet.context.AnalysisContext;
|
import org.apache.fesod.sheet.context.AnalysisContext;
|
||||||
import org.apache.fesod.sheet.event.AnalysisEventListener;
|
import org.apache.fesod.sheet.event.AnalysisEventListener;
|
||||||
import org.apache.fesod.sheet.exception.ExcelAnalysisException;
|
import org.apache.fesod.sheet.exception.ExcelAnalysisException;
|
||||||
@ -8,10 +12,6 @@ import org.apache.fesod.sheet.exception.ExcelDataConvertException;
|
|||||||
import org.dromara.common.core.utils.StreamUtils;
|
import org.dromara.common.core.utils.StreamUtils;
|
||||||
import org.dromara.common.core.utils.ValidatorUtils;
|
import org.dromara.common.core.utils.ValidatorUtils;
|
||||||
import org.dromara.common.json.utils.JsonUtils;
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
import jakarta.validation.ConstraintViolation;
|
|
||||||
import jakarta.validation.ConstraintViolationException;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|||||||
@ -6,13 +6,13 @@ import cn.hutool.core.util.ArrayUtil;
|
|||||||
import cn.hutool.core.util.EnumUtil;
|
import cn.hutool.core.util.EnumUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.fesod.sheet.metadata.FieldCache;
|
import org.apache.fesod.sheet.metadata.FieldCache;
|
||||||
import org.apache.fesod.sheet.metadata.FieldWrapper;
|
import org.apache.fesod.sheet.metadata.FieldWrapper;
|
||||||
import org.apache.fesod.sheet.util.ClassUtils;
|
import org.apache.fesod.sheet.util.ClassUtils;
|
||||||
import org.apache.fesod.sheet.write.handler.SheetWriteHandler;
|
import org.apache.fesod.sheet.write.handler.SheetWriteHandler;
|
||||||
import org.apache.fesod.sheet.write.metadata.holder.WriteSheetHolder;
|
import org.apache.fesod.sheet.write.metadata.holder.WriteSheetHolder;
|
||||||
import org.apache.fesod.sheet.write.metadata.holder.WriteWorkbookHolder;
|
import org.apache.fesod.sheet.write.metadata.holder.WriteWorkbookHolder;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.*;
|
||||||
import org.apache.poi.ss.util.CellRangeAddressList;
|
import org.apache.poi.ss.util.CellRangeAddressList;
|
||||||
import org.apache.poi.ss.util.WorkbookUtil;
|
import org.apache.poi.ss.util.WorkbookUtil;
|
||||||
|
|||||||
@ -3,17 +3,17 @@ package org.dromara.common.excel.utils;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.io.resource.ClassPathResource;
|
import cn.hutool.core.io.resource.ClassPathResource;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import org.apache.fesod.sheet.FesodSheet;
|
import jakarta.servlet.ServletOutputStream;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import org.apache.fesod.sheet.ExcelWriter;
|
import org.apache.fesod.sheet.ExcelWriter;
|
||||||
|
import org.apache.fesod.sheet.FesodSheet;
|
||||||
import org.apache.fesod.sheet.write.builder.ExcelWriterSheetBuilder;
|
import org.apache.fesod.sheet.write.builder.ExcelWriterSheetBuilder;
|
||||||
import org.apache.fesod.sheet.write.metadata.WriteSheet;
|
import org.apache.fesod.sheet.write.metadata.WriteSheet;
|
||||||
import org.apache.fesod.sheet.write.metadata.fill.FillConfig;
|
import org.apache.fesod.sheet.write.metadata.fill.FillConfig;
|
||||||
import org.apache.fesod.sheet.write.metadata.fill.FillWrapper;
|
import org.apache.fesod.sheet.write.metadata.fill.FillWrapper;
|
||||||
import org.apache.fesod.sheet.write.style.column.LongestMatchColumnWidthStyleStrategy;
|
import org.apache.fesod.sheet.write.style.column.LongestMatchColumnWidthStyleStrategy;
|
||||||
import jakarta.servlet.ServletOutputStream;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import lombok.AccessLevel;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.utils.file.FileUtils;
|
import org.dromara.common.core.utils.file.FileUtils;
|
||||||
import org.dromara.common.excel.convert.ExcelBigNumberConvert;
|
import org.dromara.common.excel.convert.ExcelBigNumberConvert;
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
package org.dromara.common.log.event;
|
package org.dromara.common.log.event;
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|||||||
@ -1,25 +1,21 @@
|
|||||||
package org.dromara.common.mybatis.core.mapper;
|
package org.dromara.common.mybatis.core.mapper;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.reflect.GenericTypeUtils;
|
import com.baomidou.mybatisplus.core.toolkit.reflect.GenericTypeUtils;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.baomidou.mybatisplus.extension.toolkit.Db;
|
import com.baomidou.mybatisplus.extension.toolkit.Db;
|
||||||
import com.github.yulichang.base.MPJBaseMapper;
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import org.apache.ibatis.logging.Log;
|
import org.apache.ibatis.logging.Log;
|
||||||
import org.apache.ibatis.logging.LogFactory;
|
import org.apache.ibatis.logging.LogFactory;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StreamUtils;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.function.Function;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义 Mapper 接口, 实现 自定义扩展
|
* 自定义 Mapper 接口, 实现 自定义扩展
|
||||||
@ -58,7 +54,7 @@ public interface BaseMapperPlus<T, V> extends MPJBaseMapper<T> {
|
|||||||
* @return 返回查询结果的列表
|
* @return 返回查询结果的列表
|
||||||
*/
|
*/
|
||||||
default List<T> selectList() {
|
default List<T> selectList() {
|
||||||
return this.selectList(new QueryWrapper<>());
|
return this.selectList(new MPJLambdaWrapper<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -143,11 +139,11 @@ public interface BaseMapperPlus<T, V> extends MPJBaseMapper<T> {
|
|||||||
* @return 查询到的单个VO对象,经过转换为指定的VO类后返回
|
* @return 查询到的单个VO对象,经过转换为指定的VO类后返回
|
||||||
*/
|
*/
|
||||||
default <C> C selectVoById(Serializable id, Class<C> voClass) {
|
default <C> C selectVoById(Serializable id, Class<C> voClass) {
|
||||||
T obj = this.selectById(id);
|
TableInfo tableInfo = TableInfoHelper.getTableInfo(currentModelClass());
|
||||||
if (ObjectUtil.isNull(obj)) {
|
return selectJoinOne(voClass, new MPJLambdaWrapper<>(this.currentModelClass())
|
||||||
return null;
|
.selectAsClass(this.currentModelClass(), voClass)
|
||||||
}
|
.eq(tableInfo.getKeyColumn(), id)
|
||||||
return MapstructUtils.convert(obj, voClass);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -169,11 +165,11 @@ public interface BaseMapperPlus<T, V> extends MPJBaseMapper<T> {
|
|||||||
* @return 查询到的VO对象列表,经过转换为指定的VO类后返回
|
* @return 查询到的VO对象列表,经过转换为指定的VO类后返回
|
||||||
*/
|
*/
|
||||||
default <C> List<C> selectVoByIds(Collection<? extends Serializable> idList, Class<C> voClass) {
|
default <C> List<C> selectVoByIds(Collection<? extends Serializable> idList, Class<C> voClass) {
|
||||||
List<T> list = this.selectByIds(idList);
|
TableInfo tableInfo = TableInfoHelper.getTableInfo(currentModelClass());
|
||||||
if (CollUtil.isEmpty(list)) {
|
return selectJoinList(voClass, new MPJLambdaWrapper<>(this.currentModelClass())
|
||||||
return CollUtil.newArrayList();
|
.selectAsClass(this.currentModelClass(), voClass)
|
||||||
}
|
.in(tableInfo.getKeyColumn(), idList)
|
||||||
return MapstructUtils.convert(list, voClass);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -208,48 +204,9 @@ public interface BaseMapperPlus<T, V> extends MPJBaseMapper<T> {
|
|||||||
* @param wrapper 查询条件Wrapper
|
* @param wrapper 查询条件Wrapper
|
||||||
* @return 查询到的单个VO对象
|
* @return 查询到的单个VO对象
|
||||||
*/
|
*/
|
||||||
default V selectVoOne(Wrapper<T> wrapper) {
|
default V selectVoOne(MPJLambdaWrapper<T> wrapper) {
|
||||||
return selectVoOne(wrapper, this.currentVoClass());
|
wrapper.selectAsClass(this.currentModelClass(), this.currentVoClass());
|
||||||
}
|
return selectJoinOne(this.currentVoClass(), wrapper);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据条件查询单个VO对象,并根据需要决定是否抛出异常
|
|
||||||
*
|
|
||||||
* @param wrapper 查询条件Wrapper
|
|
||||||
* @param throwEx 是否抛出异常的标志
|
|
||||||
* @return 查询到的单个VO对象
|
|
||||||
*/
|
|
||||||
default V selectVoOne(Wrapper<T> wrapper, boolean throwEx) {
|
|
||||||
return selectVoOne(wrapper, this.currentVoClass(), throwEx);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据条件查询单个VO对象,并指定返回的VO对象的类型
|
|
||||||
*
|
|
||||||
* @param wrapper 查询条件Wrapper
|
|
||||||
* @param voClass 返回的VO对象的Class对象
|
|
||||||
* @param <C> 返回的VO对象的类型
|
|
||||||
* @return 查询到的单个VO对象,经过类型转换为指定的VO类后返回
|
|
||||||
*/
|
|
||||||
default <C> C selectVoOne(Wrapper<T> wrapper, Class<C> voClass) {
|
|
||||||
return selectVoOne(wrapper, voClass, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据条件查询单个实体对象,并将其转换为指定的VO对象
|
|
||||||
*
|
|
||||||
* @param wrapper 查询条件Wrapper
|
|
||||||
* @param voClass 要转换的VO类的Class对象
|
|
||||||
* @param throwEx 是否抛出异常的标志
|
|
||||||
* @param <C> VO类的类型
|
|
||||||
* @return 查询到的单个VO对象,经过转换为指定的VO类后返回
|
|
||||||
*/
|
|
||||||
default <C> C selectVoOne(Wrapper<T> wrapper, Class<C> voClass, boolean throwEx) {
|
|
||||||
T obj = this.selectOne(wrapper, throwEx);
|
|
||||||
if (ObjectUtil.isNull(obj)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return MapstructUtils.convert(obj, voClass);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -258,7 +215,7 @@ public interface BaseMapperPlus<T, V> extends MPJBaseMapper<T> {
|
|||||||
* @return 查询到的VO对象列表
|
* @return 查询到的VO对象列表
|
||||||
*/
|
*/
|
||||||
default List<V> selectVoList() {
|
default List<V> selectVoList() {
|
||||||
return selectVoList(new QueryWrapper<>(), this.currentVoClass());
|
return this.selectJoinList(this.currentVoClass(), new MPJLambdaWrapper<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -267,24 +224,14 @@ public interface BaseMapperPlus<T, V> extends MPJBaseMapper<T> {
|
|||||||
* @param wrapper 查询条件Wrapper
|
* @param wrapper 查询条件Wrapper
|
||||||
* @return 查询到的VO对象列表
|
* @return 查询到的VO对象列表
|
||||||
*/
|
*/
|
||||||
default List<V> selectVoList(Wrapper<T> wrapper) {
|
default List<V> selectVoList(MPJLambdaWrapper<T> wrapper) {
|
||||||
return selectVoList(wrapper, this.currentVoClass());
|
wrapper.selectAsClass(this.currentModelClass(), this.currentVoClass());
|
||||||
|
return this.selectJoinList(this.currentVoClass(), wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
default List<V> selectVoList(MPJLambdaWrapper<T> wrapper,Class<V> voClass) {
|
||||||
* 根据条件查询实体对象列表,并将其转换为指定的VO对象列表
|
wrapper.selectAsClass(this.currentModelClass(), voClass);
|
||||||
*
|
return this.selectJoinList(voClass, wrapper);
|
||||||
* @param wrapper 查询条件Wrapper
|
|
||||||
* @param voClass 要转换的VO类的Class对象
|
|
||||||
* @param <C> VO类的类型
|
|
||||||
* @return 查询到的VO对象列表,经过转换为指定的VO类后返回
|
|
||||||
*/
|
|
||||||
default <C> List<C> selectVoList(Wrapper<T> wrapper, Class<C> voClass) {
|
|
||||||
List<T> list = this.selectList(wrapper);
|
|
||||||
if (CollUtil.isEmpty(list)) {
|
|
||||||
return CollUtil.newArrayList();
|
|
||||||
}
|
|
||||||
return MapstructUtils.convert(list, voClass);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -294,80 +241,14 @@ public interface BaseMapperPlus<T, V> extends MPJBaseMapper<T> {
|
|||||||
* @param wrapper 查询条件Wrapper
|
* @param wrapper 查询条件Wrapper
|
||||||
* @return 查询到的VO对象分页列表
|
* @return 查询到的VO对象分页列表
|
||||||
*/
|
*/
|
||||||
default <P extends IPage<V>> P selectVoPage(IPage<T> page, Wrapper<T> wrapper) {
|
|
||||||
return selectVoPage(page, wrapper, this.currentVoClass());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据条件分页查询实体对象列表,并将其转换为指定的VO对象分页列表
|
|
||||||
*
|
|
||||||
* @param page 分页信息
|
|
||||||
* @param wrapper 查询条件Wrapper
|
|
||||||
* @param voClass 要转换的VO类的Class对象
|
|
||||||
* @param <C> VO类的类型
|
|
||||||
* @param <P> VO对象分页列表的类型
|
|
||||||
* @return 查询到的VO对象分页列表,经过转换为指定的VO类后返回
|
|
||||||
*/
|
|
||||||
default <C, P extends IPage<C>> P selectVoPage(IPage<T> page, Wrapper<T> wrapper, Class<C> voClass) {
|
|
||||||
// 根据条件分页查询实体对象列表
|
|
||||||
List<T> list = this.selectList(page, wrapper);
|
|
||||||
// 创建一个新的VO对象分页列表,并设置分页信息
|
|
||||||
IPage<C> voPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal());
|
|
||||||
if (CollUtil.isEmpty(list)) {
|
|
||||||
return (P) voPage;
|
|
||||||
}
|
|
||||||
voPage.setRecords(MapstructUtils.convert(list, voClass));
|
|
||||||
return (P) voPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据条件查询符合条件的对象,并将其转换为指定类型的对象列表
|
|
||||||
*
|
|
||||||
* @param wrapper 查询条件Wrapper
|
|
||||||
* @param mapper 转换函数,用于将查询到的对象转换为指定类型的对象
|
|
||||||
* @param <C> 要转换的对象的类型
|
|
||||||
* @return 查询到的符合条件的对象列表,经过转换为指定类型的对象后返回
|
|
||||||
*/
|
|
||||||
default <C> List<C> selectObjs(Wrapper<T> wrapper, Function<? super Object, C> mapper) {
|
|
||||||
return StreamUtils.toList(this.selectObjs(wrapper), mapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据条件查询单个VO对象(MPJ版本可减少非VO字段查询)
|
|
||||||
*
|
|
||||||
* @param wrapper MPJ查询条件Wrapper
|
|
||||||
* @return 查询到的单个VO对象
|
|
||||||
* @author LukewarmMe
|
|
||||||
*/
|
|
||||||
default V selectVoOne(MPJLambdaWrapper<T> wrapper) {
|
|
||||||
// 查询两个类的交集字段
|
|
||||||
wrapper.selectAsClass(this.currentModelClass(), this.currentVoClass());
|
|
||||||
return selectJoinOne(this.currentVoClass(), wrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据条件查询VO对象列表(MPJ版本可减少非VO字段查询)
|
|
||||||
*
|
|
||||||
* @param wrapper MPJ查询条件Wrapper
|
|
||||||
* @return 查询到的VO对象列表
|
|
||||||
* @author LukewarmMe
|
|
||||||
*/
|
|
||||||
default List<V> selectVoList(MPJLambdaWrapper<T> wrapper) {
|
|
||||||
wrapper.selectAsClass(this.currentModelClass(), this.currentVoClass());
|
|
||||||
return this.selectJoinList(this.currentVoClass(), wrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据条件分页查询VO对象列表(MPJ版本可减少非VO字段查询)
|
|
||||||
*
|
|
||||||
* @param page 分页信息
|
|
||||||
* @param wrapper MPJ查询条件Wrapper
|
|
||||||
* @return 查询到的VO对象分页列表
|
|
||||||
* @author LukewarmMe
|
|
||||||
*/
|
|
||||||
default <P extends IPage<V>> P selectVoPage(P page, MPJLambdaWrapper<T> wrapper) {
|
default <P extends IPage<V>> P selectVoPage(P page, MPJLambdaWrapper<T> wrapper) {
|
||||||
wrapper.selectAsClass(this.currentModelClass(), this.currentVoClass());
|
wrapper.selectAsClass(this.currentModelClass(), this.currentVoClass());
|
||||||
return this.selectJoinPage(page, this.currentVoClass(), wrapper);
|
return this.selectJoinPage(page, this.currentVoClass(), wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default <P extends IPage<V>> P selectVoPage(P page, MPJLambdaWrapper<T> wrapper, Class<V> voClass) {
|
||||||
|
wrapper.selectAsClass(this.currentModelClass(), voClass);
|
||||||
|
return this.selectJoinPage(page, voClass, wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,9 +8,9 @@ import com.baomidou.mybatisplus.core.plugins.IgnoreStrategy;
|
|||||||
import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper;
|
import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.dromara.common.mybatis.core.domain.DataPermissionAccess;
|
|
||||||
import org.dromara.common.core.utils.reflect.ReflectUtils;
|
import org.dromara.common.core.utils.reflect.ReflectUtils;
|
||||||
import org.dromara.common.mybatis.annotation.DataPermission;
|
import org.dromara.common.mybatis.annotation.DataPermission;
|
||||||
|
import org.dromara.common.mybatis.core.domain.DataPermissionAccess;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
package org.dromara.common.security.handler;
|
package org.dromara.common.security.handler;
|
||||||
|
|
||||||
import cn.hutool.core.util.ReUtil;
|
import cn.hutool.core.util.ReUtil;
|
||||||
import org.dromara.common.core.utils.SpringUtils;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.dromara.common.core.utils.SpringUtils;
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
import org.springframework.web.method.HandlerMethod;
|
import org.springframework.web.method.HandlerMethod;
|
||||||
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
|
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
|
||||||
|
|||||||
@ -4,7 +4,10 @@ import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
|
|||||||
import org.dromara.common.translation.core.handler.TranslationHandler;
|
import org.dromara.common.translation.core.handler.TranslationHandler;
|
||||||
import tools.jackson.databind.annotation.JsonSerialize;
|
import tools.jackson.databind.annotation.JsonSerialize;
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用翻译注解
|
* 通用翻译注解
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
package org.dromara.common.translation.core.impl;
|
package org.dromara.common.translation.core.impl;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import org.dromara.common.core.service.DeptService;
|
import org.dromara.common.core.service.DeptService;
|
||||||
import org.dromara.common.translation.annotation.TranslationType;
|
import org.dromara.common.translation.annotation.TranslationType;
|
||||||
import org.dromara.common.translation.constant.TransConstant;
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
import org.dromara.common.translation.core.TranslationInterface;
|
import org.dromara.common.translation.core.TranslationInterface;
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门翻译实现
|
* 部门翻译实现
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
package org.dromara.common.translation.core.impl;
|
package org.dromara.common.translation.core.impl;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import org.dromara.common.core.service.DictService;
|
import org.dromara.common.core.service.DictService;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.translation.annotation.TranslationType;
|
import org.dromara.common.translation.annotation.TranslationType;
|
||||||
import org.dromara.common.translation.constant.TransConstant;
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
import org.dromara.common.translation.core.TranslationInterface;
|
import org.dromara.common.translation.core.TranslationInterface;
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典翻译实现
|
* 字典翻译实现
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
package org.dromara.common.translation.core.impl;
|
package org.dromara.common.translation.core.impl;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import org.dromara.common.core.service.OssService;
|
import org.dromara.common.core.service.OssService;
|
||||||
import org.dromara.common.translation.annotation.TranslationType;
|
import org.dromara.common.translation.annotation.TranslationType;
|
||||||
import org.dromara.common.translation.constant.TransConstant;
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
import org.dromara.common.translation.core.TranslationInterface;
|
import org.dromara.common.translation.core.TranslationInterface;
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OSS翻译实现
|
* OSS翻译实现
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
package org.dromara.common.translation.core.impl;
|
package org.dromara.common.translation.core.impl;
|
||||||
|
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import org.dromara.common.core.service.UserService;
|
import org.dromara.common.core.service.UserService;
|
||||||
import org.dromara.common.translation.annotation.TranslationType;
|
import org.dromara.common.translation.annotation.TranslationType;
|
||||||
import org.dromara.common.translation.constant.TransConstant;
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
import org.dromara.common.translation.core.TranslationInterface;
|
import org.dromara.common.translation.core.TranslationInterface;
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名翻译实现
|
* 用户名翻译实现
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
package org.dromara.common.web.core;
|
package org.dromara.common.web.core;
|
||||||
|
|
||||||
import org.springframework.web.servlet.LocaleResolver;
|
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.web.servlet.LocaleResolver;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
package org.dromara.common.web.filter;
|
package org.dromara.common.web.filter;
|
||||||
|
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
|
|
||||||
import jakarta.servlet.*;
|
import jakarta.servlet.*;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,13 +1,12 @@
|
|||||||
package org.dromara.common.web.filter;
|
package org.dromara.common.web.filter;
|
||||||
|
|
||||||
import cn.hutool.core.io.IoUtil;
|
import cn.hutool.core.io.IoUtil;
|
||||||
import org.dromara.common.core.constant.Constants;
|
|
||||||
|
|
||||||
import jakarta.servlet.ReadListener;
|
import jakarta.servlet.ReadListener;
|
||||||
import jakarta.servlet.ServletInputStream;
|
import jakarta.servlet.ServletInputStream;
|
||||||
import jakarta.servlet.ServletResponse;
|
import jakarta.servlet.ServletResponse;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletRequestWrapper;
|
import jakarta.servlet.http.HttpServletRequestWrapper;
|
||||||
|
import org.dromara.common.core.constant.Constants;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
package org.dromara.common.web.filter;
|
package org.dromara.common.web.filter;
|
||||||
|
|
||||||
|
import jakarta.servlet.*;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import org.dromara.common.core.utils.SpringUtils;
|
import org.dromara.common.core.utils.SpringUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.web.config.properties.XssProperties;
|
import org.dromara.common.web.config.properties.XssProperties;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
|
|
||||||
import jakarta.servlet.*;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
package org.dromara.demo.controller;
|
package org.dromara.demo.controller;
|
||||||
|
|
||||||
import cn.hutool.core.thread.ThreadUtil;
|
import cn.hutool.core.thread.ThreadUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.constant.CacheNames;
|
import org.dromara.common.core.constant.CacheNames;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.redis.utils.RedisUtils;
|
import org.dromara.common.redis.utils.RedisUtils;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
import org.springframework.cache.annotation.CachePut;
|
import org.springframework.cache.annotation.CachePut;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
|
|||||||
@ -5,8 +5,8 @@ import com.baomidou.lock.LockInfo;
|
|||||||
import com.baomidou.lock.LockTemplate;
|
import com.baomidou.lock.LockTemplate;
|
||||||
import com.baomidou.lock.annotation.Lock4j;
|
import com.baomidou.lock.annotation.Lock4j;
|
||||||
import com.baomidou.lock.executor.RedissonLockExecutor;
|
import com.baomidou.lock.executor.RedissonLockExecutor;
|
||||||
import org.dromara.common.core.domain.R;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
package org.dromara.demo.controller;
|
package org.dromara.demo.controller;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.redis.utils.RedisUtils;
|
import org.dromara.common.redis.utils.RedisUtils;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
package org.dromara.demo.controller;
|
package org.dromara.demo.controller;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.redis.annotation.RateLimiter;
|
import org.dromara.common.redis.annotation.RateLimiter;
|
||||||
import org.dromara.common.redis.enums.LimitType;
|
import org.dromara.common.redis.enums.LimitType;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
package org.dromara.demo.controller;
|
package org.dromara.demo.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.web.core.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.demo.domain.TestDemo;
|
import org.dromara.demo.domain.TestDemo;
|
||||||
import org.dromara.demo.mapper.TestDemoMapper;
|
import org.dromara.demo.mapper.TestDemoMapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|||||||
@ -1,36 +1,36 @@
|
|||||||
package org.dromara.demo.controller;
|
package org.dromara.demo.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.common.core.domain.PageResult;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.ValidatorUtils;
|
import org.dromara.common.core.utils.ValidatorUtils;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import org.dromara.common.core.validate.QueryGroup;
|
import org.dromara.common.core.validate.QueryGroup;
|
||||||
import org.dromara.common.web.core.BaseController;
|
|
||||||
import org.dromara.common.redis.annotation.RepeatSubmit;
|
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
||||||
import org.dromara.common.core.domain.PageResult;
|
|
||||||
import org.dromara.common.excel.core.ExcelResult;
|
import org.dromara.common.excel.core.ExcelResult;
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.common.redis.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.demo.domain.TestDemo;
|
import org.dromara.demo.domain.TestDemo;
|
||||||
import org.dromara.demo.domain.bo.TestDemoBo;
|
import org.dromara.demo.domain.bo.TestDemoBo;
|
||||||
import org.dromara.demo.domain.vo.TestDemoImportVo;
|
import org.dromara.demo.domain.vo.TestDemoImportVo;
|
||||||
import org.dromara.demo.domain.vo.TestDemoVo;
|
import org.dromara.demo.domain.vo.TestDemoVo;
|
||||||
import org.dromara.demo.service.ITestDemoService;
|
import org.dromara.demo.service.ITestDemoService;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import java.util.Arrays;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import java.util.List;
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,17 +1,16 @@
|
|||||||
package org.dromara.demo.controller;
|
package org.dromara.demo.controller;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.utils.MessageUtils;
|
import org.dromara.common.core.utils.MessageUtils;
|
||||||
import lombok.Data;
|
|
||||||
import org.hibernate.validator.constraints.Range;
|
import org.hibernate.validator.constraints.Range;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测试国际化
|
* 测试国际化
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
package org.dromara.demo.controller;
|
package org.dromara.demo.controller;
|
||||||
|
|
||||||
import org.dromara.common.core.domain.R;
|
|
||||||
import org.dromara.common.web.core.BaseController;
|
|
||||||
import org.dromara.common.sensitive.annotation.Sensitive;
|
|
||||||
import org.dromara.common.sensitive.core.SensitiveStrategy;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.sensitive.annotation.Sensitive;
|
||||||
import org.dromara.common.sensitive.core.SensitiveService;
|
import org.dromara.common.sensitive.core.SensitiveService;
|
||||||
|
import org.dromara.common.sensitive.core.SensitiveStrategy;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|||||||
@ -1,25 +1,25 @@
|
|||||||
package org.dromara.demo.controller;
|
package org.dromara.demo.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import org.dromara.common.core.validate.QueryGroup;
|
import org.dromara.common.core.validate.QueryGroup;
|
||||||
import org.dromara.common.web.core.BaseController;
|
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import org.dromara.common.redis.annotation.RepeatSubmit;
|
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.redis.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.demo.domain.bo.TestTreeBo;
|
import org.dromara.demo.domain.bo.TestTreeBo;
|
||||||
import org.dromara.demo.domain.vo.TestTreeVo;
|
import org.dromara.demo.domain.vo.TestTreeVo;
|
||||||
import org.dromara.demo.service.ITestTreeService;
|
import org.dromara.demo.service.ITestTreeService;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
package org.dromara.demo.controller;
|
package org.dromara.demo.controller;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.websocket.dto.WebSocketMessageDTO;
|
import org.dromara.common.websocket.dto.WebSocketMessageDTO;
|
||||||
import org.dromara.common.websocket.utils.WebSocketUtils;
|
import org.dromara.common.websocket.utils.WebSocketUtils;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
package org.dromara.demo.controller.queue;
|
package org.dromara.demo.controller.queue;
|
||||||
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import org.dromara.common.core.domain.R;
|
|
||||||
import org.dromara.common.redis.utils.QueueUtils;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.redis.utils.QueueUtils;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
package org.dromara.demo.domain;
|
package org.dromara.demo.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import org.dromara.common.encrypt.annotation.EncryptField;
|
|
||||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.dromara.common.encrypt.annotation.EncryptField;
|
||||||
|
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
package org.dromara.demo.domain.vo;
|
package org.dromara.demo.domain.vo;
|
||||||
|
|
||||||
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
|
||||||
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
||||||
import org.dromara.common.core.enums.UserStatus;
|
import org.dromara.common.core.enums.UserStatus;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
|||||||
@ -1,11 +1,10 @@
|
|||||||
package org.dromara.demo.domain.vo;
|
package org.dromara.demo.domain.vo;
|
||||||
|
|
||||||
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
||||||
import org.dromara.demo.domain.TestDemo;
|
import org.dromara.demo.domain.TestDemo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package org.dromara.demo.domain.vo;
|
package org.dromara.demo.domain.vo;
|
||||||
|
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
||||||
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
||||||
import org.apache.fesod.sheet.annotation.format.DateTimeFormat;
|
import org.apache.fesod.sheet.annotation.format.DateTimeFormat;
|
||||||
@ -8,8 +10,6 @@ import org.dromara.common.excel.annotation.ExcelRequired;
|
|||||||
import org.dromara.common.translation.annotation.Translation;
|
import org.dromara.common.translation.annotation.Translation;
|
||||||
import org.dromara.common.translation.constant.TransConstant;
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
import org.dromara.demo.domain.TestDemo;
|
import org.dromara.demo.domain.TestDemo;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
package org.dromara.demo.domain.vo;
|
package org.dromara.demo.domain.vo;
|
||||||
|
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
||||||
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
||||||
import org.dromara.demo.domain.TestTree;
|
import org.dromara.demo.domain.TestTree;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.dromara.common.mybatis.annotation.DataColumn;
|
import org.dromara.common.mybatis.annotation.DataColumn;
|
||||||
import org.dromara.common.mybatis.annotation.DataPermission;
|
import org.dromara.common.mybatis.annotation.DataPermission;
|
||||||
@ -31,10 +32,10 @@ public interface TestDemoMapper extends BaseMapperPlus<TestDemo, TestDemoVo> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@DataPermission({
|
@DataPermission({
|
||||||
@DataColumn(key = "deptName", value = "dept_id"),
|
@DataColumn(key = "deptName", value = "t.dept_id"),
|
||||||
@DataColumn(key = "userName", value = "user_id")
|
@DataColumn(key = "userName", value = "t.user_id")
|
||||||
})
|
})
|
||||||
default <P extends IPage<TestDemoVo>> P selectVoPage(IPage<TestDemo> page, Wrapper<TestDemo> wrapper) {
|
default <P extends IPage<TestDemoVo>> P selectVoPage(P page, MPJLambdaWrapper<TestDemo> wrapper) {
|
||||||
return selectVoPage(page, wrapper, this.currentVoClass());
|
return selectVoPage(page, wrapper, this.currentVoClass());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +44,7 @@ public interface TestDemoMapper extends BaseMapperPlus<TestDemo, TestDemoVo> {
|
|||||||
@DataColumn(key = "deptName", value = "dept_id"),
|
@DataColumn(key = "deptName", value = "dept_id"),
|
||||||
@DataColumn(key = "userName", value = "user_id")
|
@DataColumn(key = "userName", value = "user_id")
|
||||||
})
|
})
|
||||||
default List<TestDemoVo> selectVoList(Wrapper<TestDemo> wrapper) {
|
default List<TestDemoVo> selectVoList(MPJLambdaWrapper<TestDemo> wrapper) {
|
||||||
return selectVoList(wrapper, this.currentVoClass());
|
return selectVoList(wrapper, this.currentVoClass());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package org.dromara.demo.service;
|
package org.dromara.demo.service;
|
||||||
|
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
||||||
import org.dromara.common.core.domain.PageResult;
|
import org.dromara.common.core.domain.PageResult;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.demo.domain.TestDemo;
|
import org.dromara.demo.domain.TestDemo;
|
||||||
import org.dromara.demo.domain.bo.TestDemoBo;
|
import org.dromara.demo.domain.bo.TestDemoBo;
|
||||||
import org.dromara.demo.domain.vo.TestDemoVo;
|
import org.dromara.demo.domain.vo.TestDemoVo;
|
||||||
|
|||||||
@ -2,10 +2,10 @@ package org.dromara.demo.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import org.apache.fesod.sheet.write.metadata.WriteSheet;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.fesod.sheet.write.metadata.WriteSheet;
|
||||||
import org.dromara.common.core.constant.SystemConstants;
|
import org.dromara.common.core.constant.SystemConstants;
|
||||||
import org.dromara.common.core.utils.StreamUtils;
|
import org.dromara.common.core.utils.StreamUtils;
|
||||||
import org.dromara.common.core.utils.file.FileUtils;
|
import org.dromara.common.core.utils.file.FileUtils;
|
||||||
|
|||||||
@ -1,13 +1,11 @@
|
|||||||
package org.dromara.demo.service.impl;
|
package org.dromara.demo.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.PageResult;
|
import org.dromara.common.core.domain.PageResult;
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.demo.domain.TestDemo;
|
import org.dromara.demo.domain.TestDemo;
|
||||||
import org.dromara.demo.domain.bo.TestDemoBo;
|
import org.dromara.demo.domain.bo.TestDemoBo;
|
||||||
@ -45,28 +43,28 @@ public class TestDemoServiceImpl implements ITestDemoService {
|
|||||||
/**
|
/**
|
||||||
* 分页查询测试单表列表。
|
* 分页查询测试单表列表。
|
||||||
*
|
*
|
||||||
* @param bo 查询条件
|
* @param bo 查询条件
|
||||||
* @param pageQuery 分页参数
|
* @param pageQuery 分页参数
|
||||||
* @return 分页结果
|
* @return 分页结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<TestDemoVo> queryPageList(TestDemoBo bo, PageQuery pageQuery) {
|
public PageResult<TestDemoVo> queryPageList(TestDemoBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<TestDemo> lqw = buildQueryWrapper(bo);
|
MPJLambdaWrapper<TestDemo> wrapper = buildQueryWrapper(bo);
|
||||||
Page<TestDemoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<TestDemoVo> result = baseMapper.selectVoPage(pageQuery.build(), wrapper);
|
||||||
return PageResult.build(result.getRecords(), result.getTotal());
|
return PageResult.build(result.getRecords(), result.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过自定义 SQL 分页查询测试单表列表。
|
* 通过自定义 SQL 分页查询测试单表列表。
|
||||||
*
|
*
|
||||||
* @param bo 查询条件
|
* @param bo 查询条件
|
||||||
* @param pageQuery 分页参数
|
* @param pageQuery 分页参数
|
||||||
* @return 分页结果
|
* @return 分页结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<TestDemoVo> customPageList(TestDemoBo bo, PageQuery pageQuery) {
|
public PageResult<TestDemoVo> customPageList(TestDemoBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<TestDemo> lqw = buildQueryWrapper(bo);
|
MPJLambdaWrapper<TestDemo> wrapper = buildQueryWrapper(bo);
|
||||||
Page<TestDemoVo> result = baseMapper.customPageList(pageQuery.build(), lqw);
|
Page<TestDemoVo> result = baseMapper.customPageList(pageQuery.build(), wrapper);
|
||||||
return PageResult.build(result.getRecords(), result.getTotal());
|
return PageResult.build(result.getRecords(), result.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,14 +85,14 @@ public class TestDemoServiceImpl implements ITestDemoService {
|
|||||||
* @param bo 查询条件
|
* @param bo 查询条件
|
||||||
* @return 查询条件包装器
|
* @return 查询条件包装器
|
||||||
*/
|
*/
|
||||||
private LambdaQueryWrapper<TestDemo> buildQueryWrapper(TestDemoBo bo) {
|
private MPJLambdaWrapper<TestDemo> buildQueryWrapper(TestDemoBo bo) {
|
||||||
LambdaQueryWrapper<TestDemo> lqw = Wrappers.lambdaQuery();
|
MPJLambdaWrapper<TestDemo> wrapper = new MPJLambdaWrapper<>();
|
||||||
lqw.eq(bo.getDeptId() != null, TestDemo::getDeptId, bo.getDeptId());
|
wrapper.eqIfExists(TestDemo::getDeptId, bo.getDeptId());
|
||||||
lqw.eq(bo.getUserId() != null, TestDemo::getUserId, bo.getUserId());
|
wrapper.eqIfExists(TestDemo::getUserId, bo.getUserId());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getTestKey()), TestDemo::getTestKey, bo.getTestKey());
|
wrapper.likeIfExists(TestDemo::getTestKey, bo.getTestKey());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getValue()), TestDemo::getValue, bo.getValue());
|
wrapper.eqIfExists(TestDemo::getValue, bo.getValue());
|
||||||
lqw.orderByAsc(TestDemo::getId);
|
wrapper.orderByAsc(TestDemo::getId);
|
||||||
return lqw;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -139,7 +137,7 @@ public class TestDemoServiceImpl implements ITestDemoService {
|
|||||||
/**
|
/**
|
||||||
* 按主键集合删除测试单表数据,并按需执行删除前校验。
|
* 按主键集合删除测试单表数据,并按需执行删除前校验。
|
||||||
*
|
*
|
||||||
* @param ids 主键集合
|
* @param ids 主键集合
|
||||||
* @param isValid 是否执行删除校验
|
* @param isValid 是否执行删除校验
|
||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
package org.dromara.demo.service.impl;
|
package org.dromara.demo.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
import org.dromara.demo.domain.TestTree;
|
import org.dromara.demo.domain.TestTree;
|
||||||
import org.dromara.demo.domain.bo.TestTreeBo;
|
import org.dromara.demo.domain.bo.TestTreeBo;
|
||||||
import org.dromara.demo.domain.vo.TestTreeVo;
|
import org.dromara.demo.domain.vo.TestTreeVo;
|
||||||
@ -40,6 +38,7 @@ public class TestTreeServiceImpl implements ITestTreeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @DS("slave") // 切换从库查询
|
// @DS("slave") // 切换从库查询
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询符合条件的测试树表列表。
|
* 查询符合条件的测试树表列表。
|
||||||
*
|
*
|
||||||
@ -48,8 +47,8 @@ public class TestTreeServiceImpl implements ITestTreeService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<TestTreeVo> queryList(TestTreeBo bo) {
|
public List<TestTreeVo> queryList(TestTreeBo bo) {
|
||||||
LambdaQueryWrapper<TestTree> lqw = buildQueryWrapper(bo);
|
MPJLambdaWrapper<TestTree> wrapper = buildQueryWrapper(bo);
|
||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -58,13 +57,13 @@ public class TestTreeServiceImpl implements ITestTreeService {
|
|||||||
* @param bo 查询条件
|
* @param bo 查询条件
|
||||||
* @return 查询条件包装器
|
* @return 查询条件包装器
|
||||||
*/
|
*/
|
||||||
private LambdaQueryWrapper<TestTree> buildQueryWrapper(TestTreeBo bo) {
|
private MPJLambdaWrapper<TestTree> buildQueryWrapper(TestTreeBo bo) {
|
||||||
LambdaQueryWrapper<TestTree> lqw = Wrappers.lambdaQuery();
|
MPJLambdaWrapper<TestTree> wrapper = new MPJLambdaWrapper<>();
|
||||||
lqw.eq(bo.getDeptId() != null, TestTree::getDeptId, bo.getDeptId());
|
wrapper.eqIfExists(TestTree::getDeptId, bo.getDeptId());
|
||||||
lqw.eq(bo.getUserId() != null, TestTree::getUserId, bo.getUserId());
|
wrapper.eqIfExists(TestTree::getUserId, bo.getUserId());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getTreeName()), TestTree::getTreeName, bo.getTreeName());
|
wrapper.likeIfExists(TestTree::getTreeName, bo.getTreeName());
|
||||||
lqw.orderByAsc(TestTree::getId);
|
wrapper.orderByAsc(TestTree::getId);
|
||||||
return lqw;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -109,7 +108,7 @@ public class TestTreeServiceImpl implements ITestTreeService {
|
|||||||
/**
|
/**
|
||||||
* 按主键集合删除测试树表数据,并按需执行删除前校验。
|
* 按主键集合删除测试树表数据,并按需执行删除前校验。
|
||||||
*
|
*
|
||||||
* @param ids 主键集合
|
* @param ids 主键集合
|
||||||
* @param isValid 是否执行删除校验
|
* @param isValid 是否执行删除校验
|
||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -6,13 +6,13 @@ import cn.hutool.core.io.IoUtil;
|
|||||||
import com.baomidou.lock.annotation.Lock4j;
|
import com.baomidou.lock.annotation.Lock4j;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.common.core.domain.PageResult;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.redis.annotation.RepeatSubmit;
|
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.core.domain.PageResult;
|
|
||||||
import org.dromara.common.mybatis.helper.DataBaseHelper;
|
import org.dromara.common.mybatis.helper.DataBaseHelper;
|
||||||
|
import org.dromara.common.redis.annotation.RepeatSubmit;
|
||||||
import org.dromara.common.web.core.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.generator.domain.GenTable;
|
import org.dromara.generator.domain.GenTable;
|
||||||
import org.dromara.generator.domain.GenTableColumn;
|
import org.dromara.generator.domain.GenTableColumn;
|
||||||
|
|||||||
@ -4,13 +4,13 @@ import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
|
||||||
import org.dromara.generator.constant.GenConstants;
|
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.dromara.generator.constant.GenConstants;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package org.dromara.generator.service;
|
package org.dromara.generator.service;
|
||||||
|
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
||||||
import org.dromara.common.core.domain.PageResult;
|
import org.dromara.common.core.domain.PageResult;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.generator.domain.GenTable;
|
import org.dromara.generator.domain.GenTable;
|
||||||
import org.dromara.generator.domain.GenTableColumn;
|
import org.dromara.generator.domain.GenTableColumn;
|
||||||
|
|
||||||
|
|||||||
@ -56,8 +56,8 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<${ClassName}Vo> queryPageList(${ClassName}Bo bo, PageQuery pageQuery) {
|
public PageResult<${ClassName}Vo> queryPageList(${ClassName}Bo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<${ClassName}> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<${ClassName}> wrapper = buildQueryWrapper(bo);
|
||||||
Page<${ClassName}Vo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<${ClassName}Vo> result = baseMapper.selectVoPage(pageQuery.build(), wrapper);
|
||||||
return PageResult.build(result.getRecords(), result.getTotal());
|
return PageResult.build(result.getRecords(), result.getTotal());
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
@ -70,13 +70,13 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<${ClassName}Vo> queryList(${ClassName}Bo bo) {
|
public List<${ClassName}Vo> queryList(${ClassName}Bo bo) {
|
||||||
LambdaQueryWrapper<${ClassName}> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<${ClassName}> wrapper = buildQueryWrapper(bo);
|
||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
private LambdaQueryWrapper<${ClassName}> buildQueryWrapper(${ClassName}Bo bo) {
|
private LambdaQueryWrapper<${ClassName}> buildQueryWrapper(${ClassName}Bo bo) {
|
||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<${ClassName}> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<${ClassName}> wrapper = Wrappers.lambdaQuery();
|
||||||
#foreach($column in $columns)
|
#foreach($column in $columns)
|
||||||
#if($column.query)
|
#if($column.query)
|
||||||
#set($queryType=$column.queryType)
|
#set($queryType=$column.queryType)
|
||||||
@ -91,18 +91,18 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service {
|
|||||||
#else
|
#else
|
||||||
#set($condition='bo.get'+$AttrName+'() != null')
|
#set($condition='bo.get'+$AttrName+'() != null')
|
||||||
#end
|
#end
|
||||||
lqw.$mpMethod($condition, ${ClassName}::get$AttrName, bo.get$AttrName());
|
wrapper.$mpMethod($condition, ${ClassName}::get$AttrName, bo.get$AttrName());
|
||||||
#else
|
#else
|
||||||
lqw.between(params.get("begin$AttrName") != null && params.get("end$AttrName") != null,
|
wrapper.between(params.get("begin$AttrName") != null && params.get("end$AttrName") != null,
|
||||||
${ClassName}::get$AttrName ,params.get("begin$AttrName"), params.get("end$AttrName"));
|
${ClassName}::get$AttrName ,params.get("begin$AttrName"), params.get("end$AttrName"));
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
#if($column.isPk==1)
|
#if($column.isPk==1)
|
||||||
lqw.orderByAsc(${ClassName}::get$AttrName);
|
wrapper.orderByAsc(${ClassName}::get$AttrName);
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
return lqw;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import { AxiosPromise } from 'axios';
|
import {AxiosPromise} from 'axios';
|
||||||
import { ${BusinessName}VO, ${BusinessName}Form, ${BusinessName}Query } from '@/api/${moduleName}/${businessName}/types';
|
import {${BusinessName}Form, ${BusinessName}Query, ${BusinessName}VO} from '@/api/';
|
||||||
import { PageResult } from '@/api/types';
|
import {PageResult} from '@/api/types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询${functionName}列表
|
* 查询${functionName}列表
|
||||||
|
|||||||
@ -269,10 +269,17 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="${BusinessName}" lang="ts">
|
<script setup name="${BusinessName}" lang="ts">
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
import {
|
||||||
import { ${BusinessName}VO, ${BusinessName}Query, ${BusinessName}Form } from '@/api/${moduleName}/${businessName}/types';
|
add${BusinessName},
|
||||||
|
${BusinessName}Form,
|
||||||
|
get${BusinessName},
|
||||||
|
list${BusinessName},
|
||||||
|
${BusinessName}Query,
|
||||||
|
update${BusinessName},
|
||||||
|
${BusinessName}VO
|
||||||
|
} from "@/api/";
|
||||||
|
|
||||||
type ${BusinessName}Option = {
|
type ${BusinessName}Option = {
|
||||||
${treeCode}: number;
|
${treeCode}: number;
|
||||||
${treeName}: string;
|
${treeName}: string;
|
||||||
children?: ${BusinessName}Option[];
|
children?: ${BusinessName}Option[];
|
||||||
|
|||||||
@ -249,10 +249,17 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="${BusinessName}" lang="ts">
|
<script setup name="${BusinessName}" lang="ts">
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from '@/api/${moduleName}/${businessName}';
|
import {
|
||||||
import { ${BusinessName}VO, ${BusinessName}Query, ${BusinessName}Form } from '@/api/${moduleName}/${businessName}/types';
|
add${BusinessName},
|
||||||
|
${BusinessName}Form,
|
||||||
|
get${BusinessName},
|
||||||
|
list${BusinessName},
|
||||||
|
${BusinessName}Query,
|
||||||
|
update${BusinessName},
|
||||||
|
${BusinessName}VO
|
||||||
|
} from '@/api/';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
#if(${dicts} != '')
|
#if(${dicts} != '')
|
||||||
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
||||||
const { ${dictsNoSymbol} } = toRefs<any>(proxy?.useDict(${dicts}));
|
const { ${dictsNoSymbol} } = toRefs<any>(proxy?.useDict(${dicts}));
|
||||||
|
|||||||
@ -1,14 +1,13 @@
|
|||||||
package org.dromara.system.mapper;
|
package org.dromara.system.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.github.yulichang.toolkit.JoinWrappers;
|
import com.github.yulichang.toolkit.JoinWrappers;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import org.dromara.common.core.utils.StreamUtils;
|
import org.dromara.common.core.utils.StreamUtils;
|
||||||
import org.dromara.common.mybatis.annotation.DataColumn;
|
import org.dromara.common.mybatis.annotation.DataColumn;
|
||||||
import org.dromara.common.mybatis.annotation.DataPermission;
|
import org.dromara.common.mybatis.annotation.DataPermission;
|
||||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
import org.dromara.common.mybatis.helper.DataBaseHelper;
|
|
||||||
import org.dromara.system.domain.SysDept;
|
import org.dromara.system.domain.SysDept;
|
||||||
import org.dromara.system.domain.SysRole;
|
import org.dromara.system.domain.SysRole;
|
||||||
import org.dromara.system.domain.SysRoleDept;
|
import org.dromara.system.domain.SysRoleDept;
|
||||||
@ -33,9 +32,9 @@ public interface SysDeptMapper extends BaseMapperPlus<SysDept, SysDeptVo> {
|
|||||||
* @return 部门信息集合
|
* @return 部门信息集合
|
||||||
*/
|
*/
|
||||||
@DataPermission({
|
@DataPermission({
|
||||||
@DataColumn(key = "deptName", value = "dept_id")
|
@DataColumn(key = "deptName", value = "t.dept_id")
|
||||||
})
|
})
|
||||||
default List<SysDeptVo> selectDeptList(Wrapper<SysDept> queryWrapper) {
|
default List<SysDeptVo> selectDeptList(MPJLambdaWrapper<SysDept> queryWrapper) {
|
||||||
return this.selectVoList(queryWrapper);
|
return this.selectVoList(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,9 +46,9 @@ public interface SysDeptMapper extends BaseMapperPlus<SysDept, SysDeptVo> {
|
|||||||
* @return 部门信息集合
|
* @return 部门信息集合
|
||||||
*/
|
*/
|
||||||
@DataPermission({
|
@DataPermission({
|
||||||
@DataColumn(key = "deptName", value = "dept_id"),
|
@DataColumn(key = "deptName", value = "t.dept_id")
|
||||||
})
|
})
|
||||||
default Page<SysDeptVo> selectPageDeptList(Page<SysDept> page, Wrapper<SysDept> queryWrapper) {
|
default Page<SysDeptVo> selectPageDeptList(Page page, MPJLambdaWrapper<SysDept> queryWrapper) {
|
||||||
return this.selectVoPage(page, queryWrapper);
|
return this.selectVoPage(page, queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,11 +72,13 @@ public interface SysDeptMapper extends BaseMapperPlus<SysDept, SysDeptVo> {
|
|||||||
* @return 包含子部门的列表
|
* @return 包含子部门的列表
|
||||||
*/
|
*/
|
||||||
default List<SysDept> selectListByParentId(Long parentId) {
|
default List<SysDept> selectListByParentId(Long parentId) {
|
||||||
return this.selectList(new LambdaQueryWrapper<SysDept>()
|
return this.selectList(new MPJLambdaWrapper<SysDept>()
|
||||||
.select(SysDept::getDeptId)
|
.select(SysDept::getDeptId)
|
||||||
.apply(DataBaseHelper.findInSet(parentId, "ancestors")));
|
.findInSet(SysDept::getAncestors, parentId));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询某个部门及其所有子部门ID(含自身)
|
* 查询某个部门及其所有子部门ID(含自身)
|
||||||
*
|
*
|
||||||
@ -106,8 +107,7 @@ public interface SysDeptMapper extends BaseMapperPlus<SysDept, SysDeptVo> {
|
|||||||
.leftJoin(SysRole.class, "sr", SysRole::getRoleId, SysRoleDept::getRoleId)
|
.leftJoin(SysRole.class, "sr", SysRole::getRoleId, SysRoleDept::getRoleId)
|
||||||
.eq("srd", SysRoleDept::getRoleId, roleId)
|
.eq("srd", SysRoleDept::getRoleId, roleId)
|
||||||
.eq("sr", SysRole::getStatus, "0")
|
.eq("sr", SysRole::getStatus, "0")
|
||||||
.orderByAsc("d", SysDept::getParentId)
|
.orderByAsc("d", SysDept::getParentId));
|
||||||
.orderByAsc("d", SysDept::getOrderNum));
|
|
||||||
Set<Long> parentIds = deptCheckStrictly ? new HashSet<>(StreamUtils.toList(depts, SysDept::getParentId)) : Collections.emptySet();
|
Set<Long> parentIds = deptCheckStrictly ? new HashSet<>(StreamUtils.toList(depts, SysDept::getParentId)) : Collections.emptySet();
|
||||||
return depts.stream()
|
return depts.stream()
|
||||||
.map(SysDept::getDeptId)
|
.map(SysDept::getDeptId)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
package org.dromara.system.mapper;
|
package org.dromara.system.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
import org.dromara.system.domain.SysDictData;
|
import org.dromara.system.domain.SysDictData;
|
||||||
import org.dromara.system.domain.vo.SysDictDataVo;
|
import org.dromara.system.domain.vo.SysDictDataVo;
|
||||||
@ -22,7 +22,7 @@ public interface SysDictDataMapper extends BaseMapperPlus<SysDictData, SysDictDa
|
|||||||
*/
|
*/
|
||||||
default List<SysDictDataVo> selectDictDataByType(String dictType) {
|
default List<SysDictDataVo> selectDictDataByType(String dictType) {
|
||||||
return selectVoList(
|
return selectVoList(
|
||||||
new LambdaQueryWrapper<SysDictData>()
|
new MPJLambdaWrapper<SysDictData>()
|
||||||
.eq(SysDictData::getDictType, dictType)
|
.eq(SysDictData::getDictType, dictType)
|
||||||
.orderByAsc(SysDictData::getDictSort));
|
.orderByAsc(SysDictData::getDictSort));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -96,12 +96,12 @@ public interface SysMenuMapper extends BaseMapperPlus<SysMenu, SysMenuVo> {
|
|||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
default List<SysMenu> selectMenuTreeAll() {
|
default List<SysMenu> selectMenuTreeAll() {
|
||||||
LambdaQueryWrapper<SysMenu> lqw = new LambdaQueryWrapper<SysMenu>()
|
LambdaQueryWrapper<SysMenu> wrapper = new LambdaQueryWrapper<SysMenu>()
|
||||||
.in(SysMenu::getMenuType, SystemConstants.TYPE_DIR, SystemConstants.TYPE_MENU)
|
.in(SysMenu::getMenuType, SystemConstants.TYPE_DIR, SystemConstants.TYPE_MENU)
|
||||||
.eq(SysMenu::getStatus, SystemConstants.NORMAL)
|
.eq(SysMenu::getStatus, SystemConstants.NORMAL)
|
||||||
.orderByAsc(SysMenu::getParentId)
|
.orderByAsc(SysMenu::getParentId)
|
||||||
.orderByAsc(SysMenu::getOrderNum);
|
.orderByAsc(SysMenu::getOrderNum);
|
||||||
return this.selectList(lqw);
|
return this.selectList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -119,8 +119,7 @@ public interface SysMenuMapper extends BaseMapperPlus<SysMenu, SysMenuVo> {
|
|||||||
.leftJoin(SysRole.class, "sr", SysRole::getRoleId, SysRoleMenu::getRoleId)
|
.leftJoin(SysRole.class, "sr", SysRole::getRoleId, SysRoleMenu::getRoleId)
|
||||||
.eq("srm", SysRoleMenu::getRoleId, roleId)
|
.eq("srm", SysRoleMenu::getRoleId, roleId)
|
||||||
.eq("sr", SysRole::getStatus, SystemConstants.NORMAL)
|
.eq("sr", SysRole::getStatus, SystemConstants.NORMAL)
|
||||||
.orderByAsc("m", SysMenu::getParentId)
|
.orderByAsc("m", SysMenu::getParentId));
|
||||||
.orderByAsc("m", SysMenu::getOrderNum));
|
|
||||||
Set<Long> parentIds = menuCheckStrictly ? new HashSet<>(StreamUtils.toList(menus, SysMenu::getParentId)) : Collections.emptySet();
|
Set<Long> parentIds = menuCheckStrictly ? new HashSet<>(StreamUtils.toList(menus, SysMenu::getParentId)) : Collections.emptySet();
|
||||||
return menus.stream()
|
return menus.stream()
|
||||||
.map(SysMenu::getMenuId)
|
.map(SysMenu::getMenuId)
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
package org.dromara.system.mapper;
|
package org.dromara.system.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.github.yulichang.toolkit.JoinWrappers;
|
import com.github.yulichang.toolkit.JoinWrappers;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import org.dromara.common.mybatis.annotation.DataColumn;
|
import org.dromara.common.mybatis.annotation.DataColumn;
|
||||||
import org.dromara.common.mybatis.annotation.DataPermission;
|
import org.dromara.common.mybatis.annotation.DataPermission;
|
||||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
@ -29,10 +29,10 @@ public interface SysPostMapper extends BaseMapperPlus<SysPost, SysPostVo> {
|
|||||||
* @return 包含岗位信息的分页结果
|
* @return 包含岗位信息的分页结果
|
||||||
*/
|
*/
|
||||||
@DataPermission({
|
@DataPermission({
|
||||||
@DataColumn(key = "deptName", value = "dept_id"),
|
@DataColumn(key = "deptName", value = "t.dept_id"),
|
||||||
@DataColumn(key = "userName", value = "create_by")
|
@DataColumn(key = "userName", value = "t.create_by")
|
||||||
})
|
})
|
||||||
default Page<SysPostVo> selectPagePostList(Page<SysPost> page, Wrapper<SysPost> queryWrapper) {
|
default Page<SysPostVo> selectPagePostList(Page page, MPJLambdaWrapper<SysPost> queryWrapper) {
|
||||||
return this.selectVoPage(page, queryWrapper);
|
return this.selectVoPage(page, queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,10 +43,10 @@ public interface SysPostMapper extends BaseMapperPlus<SysPost, SysPostVo> {
|
|||||||
* @return 岗位信息列表
|
* @return 岗位信息列表
|
||||||
*/
|
*/
|
||||||
@DataPermission({
|
@DataPermission({
|
||||||
@DataColumn(key = "deptName", value = "dept_id"),
|
@DataColumn(key = "deptName", value = "t.dept_id"),
|
||||||
@DataColumn(key = "userName", value = "create_by")
|
@DataColumn(key = "userName", value = "t.create_by")
|
||||||
})
|
})
|
||||||
default List<SysPostVo> selectPostList(Wrapper<SysPost> queryWrapper) {
|
default List<SysPostVo> selectPostList(MPJLambdaWrapper<SysPost> queryWrapper) {
|
||||||
return this.selectVoList(queryWrapper);
|
return this.selectVoList(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
package org.dromara.system.mapper;
|
package org.dromara.system.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.github.yulichang.toolkit.JoinWrappers;
|
import com.github.yulichang.toolkit.JoinWrappers;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.dromara.common.mybatis.annotation.DataColumn;
|
import org.dromara.common.mybatis.annotation.DataColumn;
|
||||||
import org.dromara.common.mybatis.annotation.DataPermission;
|
import org.dromara.common.mybatis.annotation.DataPermission;
|
||||||
@ -31,10 +31,10 @@ public interface SysRoleMapper extends BaseMapperPlus<SysRole, SysRoleVo> {
|
|||||||
* @return 包含角色信息的分页结果
|
* @return 包含角色信息的分页结果
|
||||||
*/
|
*/
|
||||||
@DataPermission({
|
@DataPermission({
|
||||||
@DataColumn(key = "deptName", value = "create_dept"),
|
@DataColumn(key = "deptName", value = "t.create_dept"),
|
||||||
@DataColumn(key = "userName", value = "create_by")
|
@DataColumn(key = "userName", value = "t.create_by")
|
||||||
})
|
})
|
||||||
default Page<SysRoleVo> selectPageRoleList(@Param("page") Page<SysRole> page, @Param(Constants.WRAPPER) Wrapper<SysRole> queryWrapper) {
|
default Page<SysRoleVo> selectPageRoleList(@Param("page") Page page, @Param(Constants.WRAPPER) MPJLambdaWrapper<SysRole> queryWrapper) {
|
||||||
return this.selectVoPage(page, queryWrapper);
|
return this.selectVoPage(page, queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,10 +45,10 @@ public interface SysRoleMapper extends BaseMapperPlus<SysRole, SysRoleVo> {
|
|||||||
* @return 角色数据集合信息
|
* @return 角色数据集合信息
|
||||||
*/
|
*/
|
||||||
@DataPermission({
|
@DataPermission({
|
||||||
@DataColumn(key = "deptName", value = "create_dept"),
|
@DataColumn(key = "deptName", value = "t.create_dept"),
|
||||||
@DataColumn(key = "userName", value = "create_by")
|
@DataColumn(key = "userName", value = "t.create_by")
|
||||||
})
|
})
|
||||||
default List<SysRoleVo> selectRoleList(@Param(Constants.WRAPPER) Wrapper<SysRole> queryWrapper) {
|
default List<SysRoleVo> selectRoleList(@Param(Constants.WRAPPER) MPJLambdaWrapper<SysRole> queryWrapper) {
|
||||||
return this.selectVoList(queryWrapper);
|
return this.selectVoList(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,8 +73,8 @@ public interface SysRoleMapper extends BaseMapperPlus<SysRole, SysRoleVo> {
|
|||||||
* @return 对应的角色信息
|
* @return 对应的角色信息
|
||||||
*/
|
*/
|
||||||
@DataPermission({
|
@DataPermission({
|
||||||
@DataColumn(key = "deptName", value = "create_dept"),
|
@DataColumn(key = "deptName", value = "t.create_dept"),
|
||||||
@DataColumn(key = "userName", value = "create_by")
|
@DataColumn(key = "userName", value = "t.create_by")
|
||||||
})
|
})
|
||||||
default SysRoleVo selectRoleById(Long roleId) {
|
default SysRoleVo selectRoleById(Long roleId) {
|
||||||
return this.selectVoById(roleId);
|
return this.selectVoById(roleId);
|
||||||
|
|||||||
@ -37,10 +37,10 @@ public interface SysUserMapper extends BaseMapperPlus<SysUser, SysUserVo> {
|
|||||||
* @return 分页的用户信息
|
* @return 分页的用户信息
|
||||||
*/
|
*/
|
||||||
@DataPermission({
|
@DataPermission({
|
||||||
@DataColumn(key = "deptName", value = "dept_id"),
|
@DataColumn(key = "deptName", value = "t.dept_id"),
|
||||||
@DataColumn(key = "userName", value = "create_by")
|
@DataColumn(key = "userName", value = "t.create_by")
|
||||||
})
|
})
|
||||||
default Page<SysUserVo> selectPageUserList(Page<SysUser> page, Wrapper<SysUser> queryWrapper) {
|
default Page<SysUserVo> selectPageUserList(Page page, MPJLambdaWrapper<SysUser> queryWrapper) {
|
||||||
return this.selectVoPage(page, queryWrapper);
|
return this.selectVoPage(page, queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,10 +51,10 @@ public interface SysUserMapper extends BaseMapperPlus<SysUser, SysUserVo> {
|
|||||||
* @return 用户信息集合
|
* @return 用户信息集合
|
||||||
*/
|
*/
|
||||||
@DataPermission({
|
@DataPermission({
|
||||||
@DataColumn(key = "deptName", value = "dept_id"),
|
@DataColumn(key = "deptName", value = "t.dept_id"),
|
||||||
@DataColumn(key = "userName", value = "create_by")
|
@DataColumn(key = "userName", value = "t.create_by")
|
||||||
})
|
})
|
||||||
default List<SysUserVo> selectUserList(Wrapper<SysUser> queryWrapper) {
|
default List<SysUserVo> selectUserList(MPJLambdaWrapper<SysUser> queryWrapper) {
|
||||||
return this.selectVoList(queryWrapper);
|
return this.selectVoList(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,8 +5,8 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import cn.hutool.crypto.SecureUtil;
|
import cn.hutool.crypto.SecureUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.constant.CacheNames;
|
import org.dromara.common.core.constant.CacheNames;
|
||||||
@ -61,7 +61,7 @@ public class SysClientServiceImpl implements ISysClientService {
|
|||||||
@Cacheable(cacheNames = CacheNames.SYS_CLIENT, key = "#clientId")
|
@Cacheable(cacheNames = CacheNames.SYS_CLIENT, key = "#clientId")
|
||||||
@Override
|
@Override
|
||||||
public SysClientVo queryByClientId(String clientId) {
|
public SysClientVo queryByClientId(String clientId) {
|
||||||
return baseMapper.selectVoOne(new LambdaQueryWrapper<SysClient>().eq(SysClient::getClientId, clientId));
|
return baseMapper.selectVoOne(new MPJLambdaWrapper<SysClient>().eq(SysClient::getClientId, clientId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -73,8 +73,8 @@ public class SysClientServiceImpl implements ISysClientService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<SysClientVo> queryPageList(SysClientBo bo, PageQuery pageQuery) {
|
public PageResult<SysClientVo> queryPageList(SysClientBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<SysClient> lqw = buildQueryWrapper(bo);
|
MPJLambdaWrapper<SysClient> wrapper = buildQueryWrapper(bo);
|
||||||
Page<SysClientVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<SysClientVo> result = baseMapper.selectVoPage(pageQuery.build(), wrapper);
|
||||||
result.getRecords().forEach(r -> r.setGrantTypeList(StringUtils.splitList(r.getGrantType())));
|
result.getRecords().forEach(r -> r.setGrantTypeList(StringUtils.splitList(r.getGrantType())));
|
||||||
return PageResult.build(result.getRecords(), result.getTotal());
|
return PageResult.build(result.getRecords(), result.getTotal());
|
||||||
}
|
}
|
||||||
@ -87,8 +87,8 @@ public class SysClientServiceImpl implements ISysClientService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysClientVo> queryList(SysClientBo bo) {
|
public List<SysClientVo> queryList(SysClientBo bo) {
|
||||||
LambdaQueryWrapper<SysClient> lqw = buildQueryWrapper(bo);
|
MPJLambdaWrapper<SysClient> wrapper = buildQueryWrapper(bo);
|
||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -97,14 +97,14 @@ public class SysClientServiceImpl implements ISysClientService {
|
|||||||
* @param bo 客户端筛选条件
|
* @param bo 客户端筛选条件
|
||||||
* @return 包含 clientId、clientKey、状态等条件的查询包装器
|
* @return 包含 clientId、clientKey、状态等条件的查询包装器
|
||||||
*/
|
*/
|
||||||
private LambdaQueryWrapper<SysClient> buildQueryWrapper(SysClientBo bo) {
|
private MPJLambdaWrapper<SysClient> buildQueryWrapper(SysClientBo bo) {
|
||||||
LambdaQueryWrapper<SysClient> lqw = Wrappers.lambdaQuery();
|
MPJLambdaWrapper<SysClient> wrapper = new MPJLambdaWrapper<SysClient>();
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getClientId()), SysClient::getClientId, bo.getClientId());
|
wrapper.eqIfExists(SysClient::getClientId, bo.getClientId());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getClientKey()), SysClient::getClientKey, bo.getClientKey());
|
wrapper.eqIfExists(SysClient::getClientKey, bo.getClientKey());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getClientSecret()), SysClient::getClientSecret, bo.getClientSecret());
|
wrapper.eqIfExists(SysClient::getClientSecret, bo.getClientSecret());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysClient::getStatus, bo.getStatus());
|
wrapper.eqIfExists(SysClient::getStatus, bo.getStatus());
|
||||||
lqw.orderByAsc(SysClient::getId);
|
wrapper.orderByAsc(SysClient::getId);
|
||||||
return lqw;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -4,8 +4,8 @@ import cn.hutool.core.convert.Convert;
|
|||||||
import cn.hutool.core.lang.Dict;
|
import cn.hutool.core.lang.Dict;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.constant.CacheNames;
|
import org.dromara.common.core.constant.CacheNames;
|
||||||
import org.dromara.common.core.constant.SystemConstants;
|
import org.dromara.common.core.constant.SystemConstants;
|
||||||
@ -52,8 +52,8 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<SysConfigVo> selectPageConfigList(SysConfigBo config, PageQuery pageQuery) {
|
public PageResult<SysConfigVo> selectPageConfigList(SysConfigBo config, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<SysConfig> lqw = buildQueryWrapper(config);
|
MPJLambdaWrapper<SysConfig> wrapper = buildQueryWrapper(config);
|
||||||
Page<SysConfigVo> page = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<SysConfigVo> page = baseMapper.selectVoPage(pageQuery.build(), wrapper);
|
||||||
return PageResult.build(page.getRecords(), page.getTotal());
|
return PageResult.build(page.getRecords(), page.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,8 +100,8 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysConfigVo> selectConfigList(SysConfigBo config) {
|
public List<SysConfigVo> selectConfigList(SysConfigBo config) {
|
||||||
LambdaQueryWrapper<SysConfig> lqw = buildQueryWrapper(config);
|
MPJLambdaWrapper<SysConfig> wrapper = buildQueryWrapper(config);
|
||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -110,16 +110,15 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService {
|
|||||||
* @param bo 参数配置筛选条件
|
* @param bo 参数配置筛选条件
|
||||||
* @return 包含名称、键名、类型与时间区间的查询包装器
|
* @return 包含名称、键名、类型与时间区间的查询包装器
|
||||||
*/
|
*/
|
||||||
private LambdaQueryWrapper<SysConfig> buildQueryWrapper(SysConfigBo bo) {
|
private MPJLambdaWrapper<SysConfig> buildQueryWrapper(SysConfigBo bo) {
|
||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<SysConfig> lqw = Wrappers.lambdaQuery();
|
MPJLambdaWrapper<SysConfig> wrapper = new MPJLambdaWrapper<SysConfig>();
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getConfigName()), SysConfig::getConfigName, bo.getConfigName());
|
wrapper.likeIfExists(SysConfig::getConfigName, bo.getConfigName());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getConfigType()), SysConfig::getConfigType, bo.getConfigType());
|
wrapper.eqIfExists(SysConfig::getConfigType, bo.getConfigType());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getConfigKey()), SysConfig::getConfigKey, bo.getConfigKey());
|
wrapper.likeIfExists(SysConfig::getConfigKey, bo.getConfigKey());
|
||||||
lqw.between(params.get("beginTime") != null && params.get("endTime") != null,
|
wrapper.betweenIfExists(SysConfig::getCreateTime, params.get("beginTime"), params.get("endTime"));
|
||||||
SysConfig::getCreateTime, params.get("beginTime"), params.get("endTime"));
|
wrapper.orderByAsc(SysConfig::getConfigId);
|
||||||
lqw.orderByAsc(SysConfig::getConfigId);
|
return wrapper;
|
||||||
return lqw;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -7,8 +7,8 @@ import cn.hutool.core.lang.tree.Tree;
|
|||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.constant.CacheNames;
|
import org.dromara.common.core.constant.CacheNames;
|
||||||
import org.dromara.common.core.constant.SystemConstants;
|
import org.dromara.common.core.constant.SystemConstants;
|
||||||
@ -72,8 +72,8 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysDeptVo> selectDeptList(SysDeptBo dept) {
|
public List<SysDeptVo> selectDeptList(SysDeptBo dept) {
|
||||||
LambdaQueryWrapper<SysDept> lqw = buildQueryWrapper(dept);
|
MPJLambdaWrapper<SysDept> wrapper = buildQueryWrapper(dept);
|
||||||
return baseMapper.selectDeptList(lqw);
|
return baseMapper.selectDeptList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -84,8 +84,8 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Tree<Long>> selectDeptTreeList(SysDeptBo bo) {
|
public List<Tree<Long>> selectDeptTreeList(SysDeptBo bo) {
|
||||||
LambdaQueryWrapper<SysDept> lqw = buildQueryWrapper(bo);
|
MPJLambdaWrapper<SysDept> wrapper = buildQueryWrapper(bo);
|
||||||
List<SysDeptVo> depts = baseMapper.selectDeptList(lqw);
|
List<SysDeptVo> depts = baseMapper.selectDeptList(wrapper);
|
||||||
return buildDeptTreeSelect(depts);
|
return buildDeptTreeSelect(depts);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,29 +95,40 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
|
|||||||
* @param bo 部门筛选条件
|
* @param bo 部门筛选条件
|
||||||
* @return 包含树级过滤、状态、分类和时间区间的查询包装器
|
* @return 包含树级过滤、状态、分类和时间区间的查询包装器
|
||||||
*/
|
*/
|
||||||
private LambdaQueryWrapper<SysDept> buildQueryWrapper(SysDeptBo bo) {
|
private MPJLambdaWrapper<SysDept> buildQueryWrapper(SysDeptBo bo) {
|
||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<SysDept> lqw = Wrappers.lambdaQuery();
|
MPJLambdaWrapper<SysDept> wrapper = new MPJLambdaWrapper<SysDept>();
|
||||||
lqw.eq(SysDept::getDelFlag, SystemConstants.NORMAL);
|
wrapper.eqIfExists(SysDept::getDeptId, bo.getDeptId());
|
||||||
lqw.eq(ObjectUtil.isNotNull(bo.getDeptId()), SysDept::getDeptId, bo.getDeptId());
|
wrapper.eqIfExists(SysDept::getParentId, bo.getParentId());
|
||||||
lqw.eq(ObjectUtil.isNotNull(bo.getParentId()), SysDept::getParentId, bo.getParentId());
|
wrapper.likeIfExists(SysDept::getDeptName, bo.getDeptName());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getDeptName()), SysDept::getDeptName, bo.getDeptName());
|
wrapper.likeIfExists(SysDept::getDeptCategory, bo.getDeptCategory());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getDeptCategory()), SysDept::getDeptCategory, bo.getDeptCategory());
|
wrapper.eqIfExists(SysDept::getStatus, bo.getStatus());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysDept::getStatus, bo.getStatus());
|
wrapper.betweenIfExists(SysDept::getCreateTime, params.get("beginTime"), params.get("endTime"));
|
||||||
lqw.between(params.get("beginTime") != null && params.get("endTime") != null,
|
wrapper.orderByAsc(SysDept::getAncestors);
|
||||||
SysDept::getCreateTime, params.get("beginTime"), params.get("endTime"));
|
wrapper.orderByAsc(SysDept::getParentId);
|
||||||
lqw.orderByAsc(SysDept::getAncestors);
|
wrapper.orderByAsc(SysDept::getOrderNum);
|
||||||
lqw.orderByAsc(SysDept::getParentId);
|
wrapper.orderByAsc(SysDept::getDeptId);
|
||||||
lqw.orderByAsc(SysDept::getOrderNum);
|
|
||||||
lqw.orderByAsc(SysDept::getDeptId);
|
|
||||||
if (ObjectUtil.isNotNull(bo.getBelongDeptId())) {
|
if (ObjectUtil.isNotNull(bo.getBelongDeptId())) {
|
||||||
//部门树搜索
|
//部门树搜索
|
||||||
lqw.and(x -> {
|
wrapper.and(x -> {
|
||||||
List<Long> deptIds = baseMapper.selectDeptAndChildById(bo.getBelongDeptId());
|
List<Long> deptIds = baseMapper.selectDeptAndChildById(bo.getBelongDeptId());
|
||||||
x.in(SysDept::getDeptId, deptIds);
|
x.in(SysDept::getDeptId, deptIds);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// //部门树搜索
|
||||||
|
// wrapper.in(SysUser::getDeptId, SysDept.class,
|
||||||
|
// in -> in
|
||||||
|
// .select(SysDept::getDeptId)
|
||||||
|
// .and(q -> q
|
||||||
|
// .eq(SysDept::getDeptId, bo.getBelongDeptId())
|
||||||
|
// .or()
|
||||||
|
// .findInSetIfExists(SysDept::getAncestors, bo.getDeptId())
|
||||||
|
// )
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
return lqw;
|
|
||||||
|
|
||||||
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -169,7 +180,7 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
|
|||||||
if (ObjectUtil.isNull(dept)) {
|
if (ObjectUtil.isNull(dept)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SysDeptVo parentDept = baseMapper.selectVoOne(new LambdaQueryWrapper<SysDept>()
|
SysDeptVo parentDept = baseMapper.selectVoOne(new MPJLambdaWrapper<SysDept>()
|
||||||
.select(SysDept::getDeptName).eq(SysDept::getDeptId, dept.getParentId()));
|
.select(SysDept::getDeptName).eq(SysDept::getDeptId, dept.getParentId()));
|
||||||
dept.setParentName(ObjectUtils.notNullGetter(parentDept, SysDeptVo::getDeptName));
|
dept.setParentName(ObjectUtils.notNullGetter(parentDept, SysDeptVo::getDeptName));
|
||||||
return dept;
|
return dept;
|
||||||
@ -183,7 +194,7 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysDeptVo> selectDeptByIds(Collection<Long> deptIds) {
|
public List<SysDeptVo> selectDeptByIds(Collection<Long> deptIds) {
|
||||||
return baseMapper.selectDeptList(new LambdaQueryWrapper<SysDept>()
|
return baseMapper.selectDeptList(new MPJLambdaWrapper<SysDept>()
|
||||||
.select(SysDept::getDeptId, SysDept::getDeptName, SysDept::getLeader)
|
.select(SysDept::getDeptId, SysDept::getDeptName, SysDept::getLeader)
|
||||||
.eq(SysDept::getStatus, SystemConstants.NORMAL)
|
.eq(SysDept::getStatus, SystemConstants.NORMAL)
|
||||||
.in(CollUtil.isNotEmpty(deptIds), SysDept::getDeptId, deptIds));
|
.in(CollUtil.isNotEmpty(deptIds), SysDept::getDeptId, deptIds));
|
||||||
@ -226,7 +237,7 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<DeptDTO> selectDeptsByList() {
|
public List<DeptDTO> selectDeptsByList() {
|
||||||
List<SysDeptVo> list = baseMapper.selectDeptList(new LambdaQueryWrapper<SysDept>()
|
List<SysDeptVo> list = baseMapper.selectDeptList(new MPJLambdaWrapper<SysDept>()
|
||||||
.select(SysDept::getDeptId, SysDept::getDeptName, SysDept::getParentId)
|
.select(SysDept::getDeptId, SysDept::getDeptName, SysDept::getParentId)
|
||||||
.eq(SysDept::getStatus, SystemConstants.NORMAL));
|
.eq(SysDept::getStatus, SystemConstants.NORMAL));
|
||||||
return BeanUtil.copyToList(list, DeptDTO.class);
|
return BeanUtil.copyToList(list, DeptDTO.class);
|
||||||
@ -240,9 +251,9 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public long selectNormalChildrenDeptById(Long deptId) {
|
public long selectNormalChildrenDeptById(Long deptId) {
|
||||||
return baseMapper.selectCount(new LambdaQueryWrapper<SysDept>()
|
return baseMapper.selectCount(new MPJLambdaWrapper<SysDept>()
|
||||||
.eq(SysDept::getStatus, SystemConstants.NORMAL)
|
.eq(SysDept::getStatus, SystemConstants.NORMAL)
|
||||||
.apply(DataBaseHelper.findInSet(deptId, "ancestors")));
|
.findInSet(SysDept::getAncestors, deptId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -2,8 +2,8 @@ package org.dromara.system.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.constant.CacheNames;
|
import org.dromara.common.core.constant.CacheNames;
|
||||||
import org.dromara.common.core.domain.PageResult;
|
import org.dromara.common.core.domain.PageResult;
|
||||||
@ -43,8 +43,8 @@ public class SysDictDataServiceImpl implements ISysDictDataService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<SysDictDataVo> selectPageDictDataList(SysDictDataBo dictData, PageQuery pageQuery) {
|
public PageResult<SysDictDataVo> selectPageDictDataList(SysDictDataBo dictData, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<SysDictData> lqw = buildQueryWrapper(dictData);
|
MPJLambdaWrapper<SysDictData> wrapper = buildQueryWrapper(dictData);
|
||||||
Page<SysDictDataVo> page = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<SysDictDataVo> page = baseMapper.selectVoPage(pageQuery.build(), wrapper);
|
||||||
return PageResult.build(page.getRecords(), page.getTotal());
|
return PageResult.build(page.getRecords(), page.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,23 +56,17 @@ public class SysDictDataServiceImpl implements ISysDictDataService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysDictDataVo> selectDictDataList(SysDictDataBo dictData) {
|
public List<SysDictDataVo> selectDictDataList(SysDictDataBo dictData) {
|
||||||
LambdaQueryWrapper<SysDictData> lqw = buildQueryWrapper(dictData);
|
MPJLambdaWrapper<SysDictData> wrapper = buildQueryWrapper(dictData);
|
||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private MPJLambdaWrapper<SysDictData> buildQueryWrapper(SysDictDataBo bo) {
|
||||||
* 构造字典数据列表查询条件。
|
MPJLambdaWrapper<SysDictData> wrapper = new MPJLambdaWrapper<>(SysDictData.class);
|
||||||
*
|
wrapper.eq(bo.getDictSort() != null, SysDictData::getDictSort, bo.getDictSort());
|
||||||
* @param bo 字典数据筛选条件
|
wrapper.like(StringUtils.isNotBlank(bo.getDictLabel()), SysDictData::getDictLabel, bo.getDictLabel());
|
||||||
* @return 包含排序号、标签和字典类型条件的查询包装器
|
wrapper.eq(StringUtils.isNotBlank(bo.getDictType()), SysDictData::getDictType, bo.getDictType());
|
||||||
*/
|
wrapper.orderByAsc(SysDictData::getDictSort, SysDictData::getDictCode);
|
||||||
private LambdaQueryWrapper<SysDictData> buildQueryWrapper(SysDictDataBo bo) {
|
return wrapper;
|
||||||
LambdaQueryWrapper<SysDictData> lqw = Wrappers.lambdaQuery();
|
|
||||||
lqw.eq(bo.getDictSort() != null, SysDictData::getDictSort, bo.getDictSort());
|
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getDictLabel()), SysDictData::getDictLabel, bo.getDictLabel());
|
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getDictType()), SysDictData::getDictType, bo.getDictType());
|
|
||||||
lqw.orderByAsc(SysDictData::getDictSort, SysDictData::getDictCode);
|
|
||||||
return lqw;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -5,8 +5,8 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.constant.CacheNames;
|
import org.dromara.common.core.constant.CacheNames;
|
||||||
import org.dromara.common.core.domain.PageResult;
|
import org.dromara.common.core.domain.PageResult;
|
||||||
@ -57,8 +57,8 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<SysDictTypeVo> selectPageDictTypeList(SysDictTypeBo dictType, PageQuery pageQuery) {
|
public PageResult<SysDictTypeVo> selectPageDictTypeList(SysDictTypeBo dictType, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<SysDictType> lqw = buildQueryWrapper(dictType);
|
MPJLambdaWrapper<SysDictType> wrapper = buildQueryWrapper(dictType);
|
||||||
Page<SysDictTypeVo> page = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<SysDictTypeVo> page = baseMapper.selectVoPage(pageQuery.build(), wrapper);
|
||||||
return PageResult.build(page.getRecords(), page.getTotal());
|
return PageResult.build(page.getRecords(), page.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,8 +70,8 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysDictTypeVo> selectDictTypeList(SysDictTypeBo dictType) {
|
public List<SysDictTypeVo> selectDictTypeList(SysDictTypeBo dictType) {
|
||||||
LambdaQueryWrapper<SysDictType> lqw = buildQueryWrapper(dictType);
|
MPJLambdaWrapper<SysDictType> wrapper = buildQueryWrapper(dictType);
|
||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -80,12 +80,12 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
|
|||||||
* @param bo 字典类型筛选条件
|
* @param bo 字典类型筛选条件
|
||||||
* @return 包含名称、类型与创建时间区间的查询包装器
|
* @return 包含名称、类型与创建时间区间的查询包装器
|
||||||
*/
|
*/
|
||||||
private LambdaQueryWrapper<SysDictType> buildQueryWrapper(SysDictTypeBo bo) {
|
private MPJLambdaWrapper<SysDictType> buildQueryWrapper(SysDictTypeBo bo) {
|
||||||
LambdaQueryWrapper<SysDictType> lqw = Wrappers.lambdaQuery();
|
MPJLambdaWrapper<SysDictType> wrapper = new MPJLambdaWrapper<SysDictType>();
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getDictName()), SysDictType::getDictName, bo.getDictName());
|
wrapper.likeIfExists(SysDictType::getDictName, bo.getDictName());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getDictType()), SysDictType::getDictType, bo.getDictType());
|
wrapper.likeIfExists( SysDictType::getDictType, bo.getDictType());
|
||||||
lqw.orderByAsc(SysDictType::getDictId);
|
wrapper.orderByAsc(SysDictType::getDictId);
|
||||||
return lqw;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -131,7 +131,8 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
|
|||||||
@Cacheable(cacheNames = CacheNames.SYS_DICT_TYPE, key = "#dictType")
|
@Cacheable(cacheNames = CacheNames.SYS_DICT_TYPE, key = "#dictType")
|
||||||
@Override
|
@Override
|
||||||
public SysDictTypeVo selectDictTypeByType(String dictType) {
|
public SysDictTypeVo selectDictTypeByType(String dictType) {
|
||||||
return baseMapper.selectVoOne(new LambdaQueryWrapper<SysDictType>().eq(SysDictType::getDictType, dictType));
|
return baseMapper.selectVoOne(new MPJLambdaWrapper<SysDictType>()
|
||||||
|
.eq(SysDictType::getDictType, dictType));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import cn.hutool.http.useragent.UserAgent;
|
|||||||
import cn.hutool.http.useragent.UserAgentUtil;
|
import cn.hutool.http.useragent.UserAgentUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -123,16 +124,16 @@ public class SysLoginInfoServiceImpl implements ISysLoginInfoService {
|
|||||||
@Override
|
@Override
|
||||||
public PageResult<SysLoginInfoVo> selectPageLoginInfoList(SysLoginInfoBo loginInfo, PageQuery pageQuery) {
|
public PageResult<SysLoginInfoVo> selectPageLoginInfoList(SysLoginInfoBo loginInfo, PageQuery pageQuery) {
|
||||||
Map<String, Object> params = loginInfo.getParams();
|
Map<String, Object> params = loginInfo.getParams();
|
||||||
LambdaQueryWrapper<SysLoginInfo> lqw = new LambdaQueryWrapper<SysLoginInfo>()
|
MPJLambdaWrapper<SysLoginInfo> wrapper = new MPJLambdaWrapper<SysLoginInfo>()
|
||||||
.like(StringUtils.isNotBlank(loginInfo.getIpaddr()), SysLoginInfo::getIpaddr, loginInfo.getIpaddr())
|
.likeIfExists(SysLoginInfo::getIpaddr, loginInfo.getIpaddr())
|
||||||
.eq(StringUtils.isNotBlank(loginInfo.getStatus()), SysLoginInfo::getStatus, loginInfo.getStatus())
|
.eqIfExists(SysLoginInfo::getStatus, loginInfo.getStatus())
|
||||||
.like(StringUtils.isNotBlank(loginInfo.getUserName()), SysLoginInfo::getUserName, loginInfo.getUserName())
|
.likeIfExists(SysLoginInfo::getUserName, loginInfo.getUserName())
|
||||||
.between(params.get("beginTime") != null && params.get("endTime") != null,
|
.betweenIfExists(
|
||||||
SysLoginInfo::getLoginTime, params.get("beginTime"), params.get("endTime"));
|
SysLoginInfo::getLoginTime, params.get("beginTime"), params.get("endTime"));
|
||||||
if (StringUtils.isBlank(pageQuery.getOrderByColumn())) {
|
if (StringUtils.isBlank(pageQuery.getOrderByColumn())) {
|
||||||
lqw.orderByDesc(SysLoginInfo::getInfoId);
|
wrapper.orderByDesc(SysLoginInfo::getInfoId);
|
||||||
}
|
}
|
||||||
Page<SysLoginInfoVo> page = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<SysLoginInfoVo> page = baseMapper.selectVoPage(pageQuery.build(), wrapper);
|
||||||
return PageResult.build(page.getRecords(), page.getTotal());
|
return PageResult.build(page.getRecords(), page.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,12 +158,11 @@ public class SysLoginInfoServiceImpl implements ISysLoginInfoService {
|
|||||||
@Override
|
@Override
|
||||||
public List<SysLoginInfoVo> selectLoginInfoList(SysLoginInfoBo loginInfo) {
|
public List<SysLoginInfoVo> selectLoginInfoList(SysLoginInfoBo loginInfo) {
|
||||||
Map<String, Object> params = loginInfo.getParams();
|
Map<String, Object> params = loginInfo.getParams();
|
||||||
return baseMapper.selectVoList(new LambdaQueryWrapper<SysLoginInfo>()
|
return baseMapper.selectVoList(new MPJLambdaWrapper<SysLoginInfo>()
|
||||||
.like(StringUtils.isNotBlank(loginInfo.getIpaddr()), SysLoginInfo::getIpaddr, loginInfo.getIpaddr())
|
.likeIfExists(SysLoginInfo::getIpaddr, loginInfo.getIpaddr())
|
||||||
.eq(StringUtils.isNotBlank(loginInfo.getStatus()), SysLoginInfo::getStatus, loginInfo.getStatus())
|
.eqIfExists(SysLoginInfo::getStatus, loginInfo.getStatus())
|
||||||
.like(StringUtils.isNotBlank(loginInfo.getUserName()), SysLoginInfo::getUserName, loginInfo.getUserName())
|
.likeIfExists(SysLoginInfo::getUserName, loginInfo.getUserName())
|
||||||
.between(params.get("beginTime") != null && params.get("endTime") != null,
|
.betweenIfExists(SysLoginInfo::getLoginTime, params.get("beginTime"), params.get("endTime"))
|
||||||
SysLoginInfo::getLoginTime, params.get("beginTime"), params.get("endTime"))
|
|
||||||
.orderByDesc(SysLoginInfo::getInfoId));
|
.orderByDesc(SysLoginInfo::getInfoId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.lang.tree.Tree;
|
import cn.hutool.core.lang.tree.Tree;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.constant.Constants;
|
import org.dromara.common.core.constant.Constants;
|
||||||
@ -65,12 +66,12 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
|||||||
// 管理员显示所有菜单信息 不是管理员 按用户id过滤菜单
|
// 管理员显示所有菜单信息 不是管理员 按用户id过滤菜单
|
||||||
if (LoginHelper.isSuperAdmin(userId)) {
|
if (LoginHelper.isSuperAdmin(userId)) {
|
||||||
return baseMapper.selectVoList(
|
return baseMapper.selectVoList(
|
||||||
new LambdaQueryWrapper<SysMenu>()
|
new MPJLambdaWrapper<SysMenu>()
|
||||||
.like(StringUtils.isNotBlank(menu.getMenuName()), SysMenu::getMenuName, menu.getMenuName())
|
.likeIfExists(SysMenu::getMenuName, menu.getMenuName())
|
||||||
.eq(StringUtils.isNotBlank(menu.getVisible()), SysMenu::getVisible, menu.getVisible())
|
.eqIfExists(SysMenu::getVisible, menu.getVisible())
|
||||||
.eq(StringUtils.isNotBlank(menu.getStatus()), SysMenu::getStatus, menu.getStatus())
|
.eqIfExists(SysMenu::getStatus, menu.getStatus())
|
||||||
.eq(StringUtils.isNotBlank(menu.getMenuType()), SysMenu::getMenuType, menu.getMenuType())
|
.eqIfExists(SysMenu::getMenuType, menu.getMenuType())
|
||||||
.eq(ObjectUtil.isNotNull(menu.getParentId()), SysMenu::getParentId, menu.getParentId())
|
.eqIfExists(SysMenu::getParentId, menu.getParentId())
|
||||||
.orderByAsc(SysMenu::getParentId)
|
.orderByAsc(SysMenu::getParentId)
|
||||||
.orderByAsc(SysMenu::getOrderNum));
|
.orderByAsc(SysMenu::getOrderNum));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
package org.dromara.system.service.impl;
|
package org.dromara.system.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.PageResult;
|
import org.dromara.common.core.domain.PageResult;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
@ -43,8 +42,8 @@ public class SysNoticeServiceImpl implements ISysNoticeService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<SysNoticeVo> selectPageNoticeList(SysNoticeBo notice, PageQuery pageQuery) {
|
public PageResult<SysNoticeVo> selectPageNoticeList(SysNoticeBo notice, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<SysNotice> lqw = buildQueryWrapper(notice);
|
MPJLambdaWrapper<SysNotice> wrapper = buildQueryWrapper(notice);
|
||||||
Page<SysNoticeVo> page = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<SysNoticeVo> page = baseMapper.selectVoPage(pageQuery.build(), wrapper);
|
||||||
return PageResult.build(page.getRecords(), page.getTotal());
|
return PageResult.build(page.getRecords(), page.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,8 +66,8 @@ public class SysNoticeServiceImpl implements ISysNoticeService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysNoticeVo> selectNoticeList(SysNoticeBo notice) {
|
public List<SysNoticeVo> selectNoticeList(SysNoticeBo notice) {
|
||||||
LambdaQueryWrapper<SysNotice> lqw = buildQueryWrapper(notice);
|
MPJLambdaWrapper<SysNotice> wrapper = buildQueryWrapper(notice);
|
||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -77,16 +76,16 @@ public class SysNoticeServiceImpl implements ISysNoticeService {
|
|||||||
* @param bo 公告筛选条件
|
* @param bo 公告筛选条件
|
||||||
* @return 包含标题、类型、创建人和排序条件的查询包装器
|
* @return 包含标题、类型、创建人和排序条件的查询包装器
|
||||||
*/
|
*/
|
||||||
private LambdaQueryWrapper<SysNotice> buildQueryWrapper(SysNoticeBo bo) {
|
private MPJLambdaWrapper<SysNotice> buildQueryWrapper(SysNoticeBo bo) {
|
||||||
LambdaQueryWrapper<SysNotice> lqw = Wrappers.lambdaQuery();
|
MPJLambdaWrapper<SysNotice> wrapper = new MPJLambdaWrapper<SysNotice>();
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getNoticeTitle()), SysNotice::getNoticeTitle, bo.getNoticeTitle());
|
wrapper.likeIfExists(SysNotice::getNoticeTitle, bo.getNoticeTitle());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getNoticeType()), SysNotice::getNoticeType, bo.getNoticeType());
|
wrapper.eqIfExists(SysNotice::getNoticeType, bo.getNoticeType());
|
||||||
if (StringUtils.isNotBlank(bo.getCreateByName())) {
|
if (StringUtils.isNotBlank(bo.getCreateByName())) {
|
||||||
SysUserVo sysUser = userMapper.selectVoOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUserName, bo.getCreateByName()));
|
SysUserVo sysUser = userMapper.selectVoOne(new MPJLambdaWrapper<SysUser>().eq(SysUser::getUserName, bo.getCreateByName()));
|
||||||
lqw.eq(SysNotice::getCreateBy, ObjectUtils.notNullGetter(sysUser, SysUserVo::getUserId));
|
wrapper.eq(SysNotice::getCreateBy, ObjectUtils.notNullGetter(sysUser, SysUserVo::getUserId));
|
||||||
}
|
}
|
||||||
lqw.orderByAsc(SysNotice::getNoticeId);
|
wrapper.orderByAsc(SysNotice::getNoticeId);
|
||||||
return lqw;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package org.dromara.system.service.impl;
|
|||||||
import cn.hutool.core.util.ArrayUtil;
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.PageResult;
|
import org.dromara.common.core.domain.PageResult;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
@ -58,11 +59,11 @@ public class SysOperLogServiceImpl implements ISysOperLogService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<SysOperLogVo> selectPageOperLogList(SysOperLogBo operLog, PageQuery pageQuery) {
|
public PageResult<SysOperLogVo> selectPageOperLogList(SysOperLogBo operLog, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<SysOperLog> lqw = buildQueryWrapper(operLog);
|
MPJLambdaWrapper<SysOperLog> wrapper = buildQueryWrapper(operLog);
|
||||||
if (StringUtils.isBlank(pageQuery.getOrderByColumn())) {
|
if (StringUtils.isBlank(pageQuery.getOrderByColumn())) {
|
||||||
lqw.orderByDesc(SysOperLog::getOperId);
|
wrapper.orderByDesc(SysOperLog::getOperId);
|
||||||
}
|
}
|
||||||
Page<SysOperLogVo> page = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<SysOperLogVo> page = baseMapper.selectVoPage(pageQuery.build(), wrapper);
|
||||||
return PageResult.build(page.getRecords(), page.getTotal());
|
return PageResult.build(page.getRecords(), page.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,11 +73,11 @@ public class SysOperLogServiceImpl implements ISysOperLogService {
|
|||||||
* @param operLog 操作日志筛选条件
|
* @param operLog 操作日志筛选条件
|
||||||
* @return 包含业务类型、状态、操作人和时间区间的查询包装器
|
* @return 包含业务类型、状态、操作人和时间区间的查询包装器
|
||||||
*/
|
*/
|
||||||
private LambdaQueryWrapper<SysOperLog> buildQueryWrapper(SysOperLogBo operLog) {
|
private MPJLambdaWrapper<SysOperLog> buildQueryWrapper(SysOperLogBo operLog) {
|
||||||
Map<String, Object> params = operLog.getParams();
|
Map<String, Object> params = operLog.getParams();
|
||||||
return new LambdaQueryWrapper<SysOperLog>()
|
return new MPJLambdaWrapper<SysOperLog>()
|
||||||
.like(StringUtils.isNotBlank(operLog.getOperIp()), SysOperLog::getOperIp, operLog.getOperIp())
|
.likeIfExists(SysOperLog::getOperIp, operLog.getOperIp())
|
||||||
.like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle())
|
.likeIfExists(SysOperLog::getTitle, operLog.getTitle())
|
||||||
.eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0,
|
.eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0,
|
||||||
SysOperLog::getBusinessType, operLog.getBusinessType())
|
SysOperLog::getBusinessType, operLog.getBusinessType())
|
||||||
.func(f -> {
|
.func(f -> {
|
||||||
@ -84,11 +85,9 @@ public class SysOperLogServiceImpl implements ISysOperLogService {
|
|||||||
f.in(SysOperLog::getBusinessType, Arrays.asList(operLog.getBusinessTypes()));
|
f.in(SysOperLog::getBusinessType, Arrays.asList(operLog.getBusinessTypes()));
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.eq(operLog.getStatus() != null,
|
.eqIfExists(SysOperLog::getStatus, operLog.getStatus())
|
||||||
SysOperLog::getStatus, operLog.getStatus())
|
.likeIfExists(SysOperLog::getOperName, operLog.getOperName())
|
||||||
.like(StringUtils.isNotBlank(operLog.getOperName()), SysOperLog::getOperName, operLog.getOperName())
|
.betweenIfExists(SysOperLog::getOperTime, params.get("beginTime"), params.get("endTime"));
|
||||||
.between(params.get("beginTime") != null && params.get("endTime") != null,
|
|
||||||
SysOperLog::getOperTime, params.get("beginTime"), params.get("endTime"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -111,8 +110,8 @@ public class SysOperLogServiceImpl implements ISysOperLogService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysOperLogVo> selectOperLogList(SysOperLogBo operLog) {
|
public List<SysOperLogVo> selectOperLogList(SysOperLogBo operLog) {
|
||||||
LambdaQueryWrapper<SysOperLog> lqw = buildQueryWrapper(operLog);
|
MPJLambdaWrapper<SysOperLog> wrapper = buildQueryWrapper(operLog);
|
||||||
return baseMapper.selectVoList(lqw.orderByDesc(SysOperLog::getOperId));
|
return baseMapper.selectVoList(wrapper.orderByDesc(SysOperLog::getOperId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -4,8 +4,8 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.constant.CacheNames;
|
import org.dromara.common.core.constant.CacheNames;
|
||||||
@ -81,8 +81,8 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<SysOssConfigVo> queryPageList(SysOssConfigBo bo, PageQuery pageQuery) {
|
public PageResult<SysOssConfigVo> queryPageList(SysOssConfigBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<SysOssConfig> lqw = buildQueryWrapper(bo);
|
MPJLambdaWrapper<SysOssConfig> wrapper = buildQueryWrapper(bo);
|
||||||
Page<SysOssConfigVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<SysOssConfigVo> result = baseMapper.selectVoPage(pageQuery.build(), wrapper);
|
||||||
return PageResult.build(result.getRecords(), result.getTotal());
|
return PageResult.build(result.getRecords(), result.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,13 +93,13 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
|
|||||||
* @param bo 配置筛选条件
|
* @param bo 配置筛选条件
|
||||||
* @return 包含配置标识、桶名称和状态条件的查询包装器
|
* @return 包含配置标识、桶名称和状态条件的查询包装器
|
||||||
*/
|
*/
|
||||||
private LambdaQueryWrapper<SysOssConfig> buildQueryWrapper(SysOssConfigBo bo) {
|
private MPJLambdaWrapper<SysOssConfig> buildQueryWrapper(SysOssConfigBo bo) {
|
||||||
LambdaQueryWrapper<SysOssConfig> lqw = Wrappers.lambdaQuery();
|
MPJLambdaWrapper<SysOssConfig> wrapper = new MPJLambdaWrapper<SysOssConfig>();
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getConfigKey()), SysOssConfig::getConfigKey, bo.getConfigKey());
|
wrapper.eqIfExists(SysOssConfig::getConfigKey, bo.getConfigKey());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getBucketName()), SysOssConfig::getBucketName, bo.getBucketName());
|
wrapper.likeIfExists(SysOssConfig::getBucketName, bo.getBucketName());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysOssConfig::getStatus, bo.getStatus());
|
wrapper.eqIfExists(SysOssConfig::getStatus, bo.getStatus());
|
||||||
lqw.orderByAsc(SysOssConfig::getOssConfigId);
|
wrapper.orderByAsc(SysOssConfig::getOssConfigId);
|
||||||
return lqw;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -3,9 +3,8 @@ package org.dromara.system.service.impl;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.constant.CacheNames;
|
import org.dromara.common.core.constant.CacheNames;
|
||||||
@ -21,10 +20,10 @@ import org.dromara.common.core.utils.file.FileUtils;
|
|||||||
import org.dromara.common.json.utils.JsonUtils;
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.oss.client.OssClient;
|
import org.dromara.common.oss.client.OssClient;
|
||||||
|
import org.dromara.common.oss.enums.AccessPolicy;
|
||||||
import org.dromara.common.oss.factory.OssFactory;
|
import org.dromara.common.oss.factory.OssFactory;
|
||||||
import org.dromara.common.oss.model.GetObjectResult;
|
import org.dromara.common.oss.model.GetObjectResult;
|
||||||
import org.dromara.common.oss.model.PutObjectResult;
|
import org.dromara.common.oss.model.PutObjectResult;
|
||||||
import org.dromara.common.oss.enums.AccessPolicy;
|
|
||||||
import org.dromara.common.oss.util.S3ObjectUtil;
|
import org.dromara.common.oss.util.S3ObjectUtil;
|
||||||
import org.dromara.system.domain.SysOss;
|
import org.dromara.system.domain.SysOss;
|
||||||
import org.dromara.system.domain.SysOssExt;
|
import org.dromara.system.domain.SysOssExt;
|
||||||
@ -66,8 +65,8 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<SysOssVo> queryPageList(SysOssBo bo, PageQuery pageQuery) {
|
public PageResult<SysOssVo> queryPageList(SysOssBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<SysOss> lqw = buildQueryWrapper(bo);
|
MPJLambdaWrapper<SysOss> wrapper = buildQueryWrapper(bo);
|
||||||
Page<SysOssVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<SysOssVo> result = baseMapper.selectVoPage(pageQuery.build(), wrapper);
|
||||||
List<SysOssVo> filterResult = StreamUtils.toList(result.getRecords(), this::matchingUrl);
|
List<SysOssVo> filterResult = StreamUtils.toList(result.getRecords(), this::matchingUrl);
|
||||||
result.setRecords(filterResult);
|
result.setRecords(filterResult);
|
||||||
return PageResult.build(result.getRecords(), result.getTotal());
|
return PageResult.build(result.getRecords(), result.getTotal());
|
||||||
@ -151,19 +150,18 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
|
|||||||
* @param bo 文件筛选条件
|
* @param bo 文件筛选条件
|
||||||
* @return 包含文件名、后缀、归属服务和创建时间区间的查询包装器
|
* @return 包含文件名、后缀、归属服务和创建时间区间的查询包装器
|
||||||
*/
|
*/
|
||||||
private LambdaQueryWrapper<SysOss> buildQueryWrapper(SysOssBo bo) {
|
private MPJLambdaWrapper<SysOss> buildQueryWrapper(SysOssBo bo) {
|
||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<SysOss> lqw = Wrappers.lambdaQuery();
|
MPJLambdaWrapper<SysOss> wrapper = new MPJLambdaWrapper<SysOss>();
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getFileName()), SysOss::getFileName, bo.getFileName());
|
wrapper.likeIfExists(SysOss::getFileName, bo.getFileName());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getOriginalName()), SysOss::getOriginalName, bo.getOriginalName());
|
wrapper.likeIfExists(SysOss::getOriginalName, bo.getOriginalName());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getFileSuffix()), SysOss::getFileSuffix, bo.getFileSuffix());
|
wrapper.eqIfExists(SysOss::getFileSuffix, bo.getFileSuffix());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getUrl()), SysOss::getUrl, bo.getUrl());
|
wrapper.eqIfExists(SysOss::getUrl, bo.getUrl());
|
||||||
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
wrapper.betweenIfExists(SysOss::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||||
SysOss::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime"));
|
wrapper.eqIfExists(SysOss::getCreateBy, bo.getCreateBy());
|
||||||
lqw.eq(ObjectUtil.isNotNull(bo.getCreateBy()), SysOss::getCreateBy, bo.getCreateBy());
|
wrapper.eqIfExists(SysOss::getService, bo.getService());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getService()), SysOss::getService, bo.getService());
|
wrapper.orderByAsc(SysOss::getOssId);
|
||||||
lqw.orderByAsc(SysOss::getOssId);
|
return wrapper;
|
||||||
return lqw;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -3,8 +3,8 @@ package org.dromara.system.service.impl;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.constant.SystemConstants;
|
import org.dromara.common.core.constant.SystemConstants;
|
||||||
import org.dromara.common.core.domain.PageResult;
|
import org.dromara.common.core.domain.PageResult;
|
||||||
@ -12,7 +12,6 @@ import org.dromara.common.core.exception.ServiceException;
|
|||||||
import org.dromara.common.core.service.PostService;
|
import org.dromara.common.core.service.PostService;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StreamUtils;
|
import org.dromara.common.core.utils.StreamUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.system.domain.SysPost;
|
import org.dromara.system.domain.SysPost;
|
||||||
import org.dromara.system.domain.SysUserPost;
|
import org.dromara.system.domain.SysUserPost;
|
||||||
@ -83,15 +82,14 @@ public class SysPostServiceImpl implements ISysPostService, PostService {
|
|||||||
* @param bo 查询条件对象
|
* @param bo 查询条件对象
|
||||||
* @return 构建好的查询包装器
|
* @return 构建好的查询包装器
|
||||||
*/
|
*/
|
||||||
private LambdaQueryWrapper<SysPost> buildQueryWrapper(SysPostBo bo) {
|
private MPJLambdaWrapper<SysPost> buildQueryWrapper(SysPostBo bo) {
|
||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<SysPost> wrapper = new LambdaQueryWrapper<>();
|
MPJLambdaWrapper<SysPost> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.like(StringUtils.isNotBlank(bo.getPostCode()), SysPost::getPostCode, bo.getPostCode())
|
wrapper.likeIfExists(SysPost::getPostCode, bo.getPostCode())
|
||||||
.like(StringUtils.isNotBlank(bo.getPostCategory()), SysPost::getPostCategory, bo.getPostCategory())
|
.likeIfExists(SysPost::getPostCategory, bo.getPostCategory())
|
||||||
.like(StringUtils.isNotBlank(bo.getPostName()), SysPost::getPostName, bo.getPostName())
|
.likeIfExists(SysPost::getPostName, bo.getPostName())
|
||||||
.eq(StringUtils.isNotBlank(bo.getStatus()), SysPost::getStatus, bo.getStatus())
|
.eqIfExists(SysPost::getStatus, bo.getStatus())
|
||||||
.between(params.get("beginTime") != null && params.get("endTime") != null,
|
.betweenIfExists(SysPost::getCreateTime, params.get("beginTime"), params.get("endTime"))
|
||||||
SysPost::getCreateTime, params.get("beginTime"), params.get("endTime"))
|
|
||||||
.orderByAsc(SysPost::getPostSort);
|
.orderByAsc(SysPost::getPostSort);
|
||||||
if (ObjectUtil.isNotNull(bo.getDeptId())) {
|
if (ObjectUtil.isNotNull(bo.getDeptId())) {
|
||||||
//优先单部门搜索
|
//优先单部门搜索
|
||||||
@ -113,7 +111,7 @@ public class SysPostServiceImpl implements ISysPostService, PostService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysPostVo> selectPostAll() {
|
public List<SysPostVo> selectPostAll() {
|
||||||
return baseMapper.selectVoList(new QueryWrapper<>());
|
return baseMapper.selectVoList(new MPJLambdaWrapper<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -147,7 +145,7 @@ public class SysPostServiceImpl implements ISysPostService, PostService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysPostVo> selectPostByIds(Collection<Long> postIds) {
|
public List<SysPostVo> selectPostByIds(Collection<Long> postIds) {
|
||||||
return baseMapper.selectVoList(new LambdaQueryWrapper<SysPost>()
|
return baseMapper.selectVoList(new MPJLambdaWrapper<SysPost>()
|
||||||
.select(SysPost::getPostId, SysPost::getPostName, SysPost::getPostCode)
|
.select(SysPost::getPostId, SysPost::getPostName, SysPost::getPostCode)
|
||||||
.eq(SysPost::getStatus, SystemConstants.NORMAL)
|
.eq(SysPost::getStatus, SystemConstants.NORMAL)
|
||||||
.in(CollUtil.isNotEmpty(postIds), SysPost::getPostId, postIds));
|
.in(CollUtil.isNotEmpty(postIds), SysPost::getPostId, postIds));
|
||||||
|
|||||||
@ -5,11 +5,10 @@ import cn.dev33.satoken.stp.StpUtil;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.constant.CacheNames;
|
import org.dromara.common.core.constant.CacheNames;
|
||||||
import org.dromara.common.core.constant.SystemConstants;
|
import org.dromara.common.core.constant.SystemConstants;
|
||||||
@ -83,16 +82,16 @@ public class SysRoleServiceImpl implements ISysRoleService, RoleService {
|
|||||||
* @param bo 角色筛选条件
|
* @param bo 角色筛选条件
|
||||||
* @return 包含名称、权限字符、状态和创建时间区间的查询包装器
|
* @return 包含名称、权限字符、状态和创建时间区间的查询包装器
|
||||||
*/
|
*/
|
||||||
private Wrapper<SysRole> buildQueryWrapper(SysRoleBo bo) {
|
private MPJLambdaWrapper<SysRole> buildQueryWrapper(SysRoleBo bo) {
|
||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<SysRole> wrapper = Wrappers.lambdaQuery();
|
MPJLambdaWrapper<SysRole> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.eq(ObjectUtil.isNotNull(bo.getRoleId()), SysRole::getRoleId, bo.getRoleId())
|
wrapper.eq(ObjectUtil.isNotNull(bo.getRoleId()), SysRole::getRoleId, bo.getRoleId())
|
||||||
.like(StringUtils.isNotBlank(bo.getRoleName()), SysRole::getRoleName, bo.getRoleName())
|
.eqIfExists(SysRole::getRoleId, bo.getRoleId())
|
||||||
.eq(StringUtils.isNotBlank(bo.getStatus()), SysRole::getStatus, bo.getStatus())
|
.likeIfExists(SysRole::getRoleName, bo.getRoleName())
|
||||||
.like(StringUtils.isNotBlank(bo.getRoleKey()), SysRole::getRoleKey, bo.getRoleKey())
|
.eqIfExists(SysRole::getStatus, bo.getStatus())
|
||||||
.between(params.get("beginTime") != null && params.get("endTime") != null,
|
.likeIfExists(SysRole::getRoleKey, bo.getRoleKey())
|
||||||
SysRole::getCreateTime, params.get("beginTime"), params.get("endTime"))
|
.betweenIfExists(SysRole::getCreateTime, params.get("beginTime"), params.get("endTime"))
|
||||||
.orderByAsc(SysRole::getRoleSort).orderByAsc(SysRole::getCreateTime);
|
.orderByAsc(SysRole::getRoleSort, SysRole::getCreateTime);
|
||||||
return wrapper;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,9 +185,9 @@ public class SysRoleServiceImpl implements ISysRoleService, RoleService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysRoleVo> selectRoleByIds(Collection<Long> roleIds) {
|
public List<SysRoleVo> selectRoleByIds(Collection<Long> roleIds) {
|
||||||
return baseMapper.selectRoleList(new LambdaQueryWrapper<SysRole>()
|
return baseMapper.selectRoleList(new MPJLambdaWrapper<SysRole>()
|
||||||
.eq(SysRole::getStatus, SystemConstants.NORMAL)
|
.eq(SysRole::getStatus, SystemConstants.NORMAL)
|
||||||
.in(CollUtil.isNotEmpty(roleIds), SysRole::getRoleId, roleIds));
|
.inIfExists(SysRole::getRoleId, roleIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
package org.dromara.system.service.impl;
|
package org.dromara.system.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
import org.dromara.system.domain.SysSocial;
|
import org.dromara.system.domain.SysSocial;
|
||||||
import org.dromara.system.domain.bo.SysSocialBo;
|
import org.dromara.system.domain.bo.SysSocialBo;
|
||||||
import org.dromara.system.domain.vo.SysSocialVo;
|
import org.dromara.system.domain.vo.SysSocialVo;
|
||||||
@ -46,11 +44,11 @@ public class SysSocialServiceImpl implements ISysSocialService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysSocialVo> queryList(SysSocialBo bo) {
|
public List<SysSocialVo> queryList(SysSocialBo bo) {
|
||||||
LambdaQueryWrapper<SysSocial> lqw = new LambdaQueryWrapper<SysSocial>()
|
MPJLambdaWrapper<SysSocial> wrapper = new MPJLambdaWrapper<SysSocial>()
|
||||||
.eq(ObjectUtil.isNotNull(bo.getUserId()), SysSocial::getUserId, bo.getUserId())
|
.eqIfExists(SysSocial::getUserId, bo.getUserId())
|
||||||
.eq(StringUtils.isNotBlank(bo.getAuthId()), SysSocial::getAuthId, bo.getAuthId())
|
.eqIfExists(SysSocial::getAuthId, bo.getAuthId())
|
||||||
.eq(StringUtils.isNotBlank(bo.getSource()), SysSocial::getSource, bo.getSource());
|
.eqIfExists(SysSocial::getSource, bo.getSource());
|
||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -61,7 +59,7 @@ public class SysSocialServiceImpl implements ISysSocialService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysSocialVo> queryListByUserId(Long userId) {
|
public List<SysSocialVo> queryListByUserId(Long userId) {
|
||||||
return baseMapper.selectVoList(new LambdaQueryWrapper<SysSocial>().eq(SysSocial::getUserId, userId));
|
return baseMapper.selectVoList(new MPJLambdaWrapper<SysSocial>().eq(SysSocial::getUserId, userId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -129,7 +127,7 @@ public class SysSocialServiceImpl implements ISysSocialService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysSocialVo> selectByAuthId(String authId) {
|
public List<SysSocialVo> selectByAuthId(String authId) {
|
||||||
return baseMapper.selectVoList(new LambdaQueryWrapper<SysSocial>().eq(SysSocial::getAuthId, authId));
|
return baseMapper.selectVoList(new MPJLambdaWrapper<SysSocial>().eq(SysSocial::getAuthId, authId));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,11 +5,10 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.util.ArrayUtil;
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.constant.CacheNames;
|
import org.dromara.common.core.constant.CacheNames;
|
||||||
@ -86,25 +85,22 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
|||||||
* @param user 用户筛选条件
|
* @param user 用户筛选条件
|
||||||
* @return 叠加部门、状态、时间区间等条件的查询包装器
|
* @return 叠加部门、状态、时间区间等条件的查询包装器
|
||||||
*/
|
*/
|
||||||
private Wrapper<SysUser> buildQueryWrapper(SysUserBo user) {
|
private MPJLambdaWrapper<SysUser> buildQueryWrapper(SysUserBo user) {
|
||||||
Map<String, Object> params = user.getParams();
|
Map<String, Object> params = user.getParams();
|
||||||
LambdaQueryWrapper<SysUser> wrapper = Wrappers.lambdaQuery();
|
MPJLambdaWrapper<SysUser> wrapper = new MPJLambdaWrapper<>();
|
||||||
wrapper.eq(SysUser::getDelFlag, SystemConstants.NORMAL)
|
wrapper.eqIfExists(SysUser::getUserId, user.getUserId())
|
||||||
.eq(ObjectUtil.isNotNull(user.getUserId()), SysUser::getUserId, user.getUserId())
|
.inIfExists(SysUser::getUserId, StringUtils.splitTo(user.getUserIds(), Convert::toLong))
|
||||||
.in(StringUtils.isNotBlank(user.getUserIds()), SysUser::getUserId, StringUtils.splitTo(user.getUserIds(), Convert::toLong))
|
.likeIfExists(SysUser::getUserName, user.getUserName())
|
||||||
.like(StringUtils.isNotBlank(user.getUserName()), SysUser::getUserName, user.getUserName())
|
.likeIfExists(SysUser::getNickName, user.getNickName())
|
||||||
.like(StringUtils.isNotBlank(user.getNickName()), SysUser::getNickName, user.getNickName())
|
.eqIfExists(SysUser::getStatus, user.getStatus())
|
||||||
.eq(StringUtils.isNotBlank(user.getStatus()), SysUser::getStatus, user.getStatus())
|
.likeIfExists(SysUser::getPhoneNumber, user.getPhoneNumber())
|
||||||
.like(StringUtils.isNotBlank(user.getPhoneNumber()), SysUser::getPhoneNumber, user.getPhoneNumber())
|
.betweenIfExists(SysUser::getCreateTime, params.get("beginTime"), params.get("endTime"))
|
||||||
.between(params.get("beginTime") != null && params.get("endTime") != null,
|
|
||||||
SysUser::getCreateTime, params.get("beginTime"), params.get("endTime"))
|
|
||||||
.and(ObjectUtil.isNotNull(user.getDeptId()), w -> {
|
.and(ObjectUtil.isNotNull(user.getDeptId()), w -> {
|
||||||
List<Long> ids = deptMapper.selectDeptAndChildById(user.getDeptId());
|
List<Long> ids = deptMapper.selectDeptAndChildById(user.getDeptId());
|
||||||
w.in(SysUser::getDeptId, ids);
|
w.in(SysUser::getDeptId, ids);
|
||||||
}).orderByAsc(SysUser::getUserId);
|
}).orderByAsc(SysUser::getUserId);
|
||||||
if (StringUtils.isNotBlank(user.getExcludeUserIds())) {
|
wrapper.notInIfExists(SysUser::getUserId, StringUtils.splitTo(user.getExcludeUserIds(), Convert::toLong));
|
||||||
wrapper.notIn(SysUser::getUserId, StringUtils.splitTo(user.getExcludeUserIds(), Convert::toLong));
|
|
||||||
}
|
|
||||||
return wrapper;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +137,7 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysUserVo selectUserByUserName(String userName) {
|
public SysUserVo selectUserByUserName(String userName) {
|
||||||
return baseMapper.selectVoOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUserName, userName));
|
return baseMapper.selectVoOne(new MPJLambdaWrapper<SysUser>().eq(SysUser::getUserName, userName));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -152,7 +148,7 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysUserVo selectUserByPhoneNumber(String phoneNumber) {
|
public SysUserVo selectUserByPhoneNumber(String phoneNumber) {
|
||||||
return baseMapper.selectVoOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getPhoneNumber, phoneNumber));
|
return baseMapper.selectVoOne(new MPJLambdaWrapper<SysUser>().eq(SysUser::getPhoneNumber, phoneNumber));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -180,11 +176,11 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysUserVo> selectUserByIds(Collection<Long> userIds, Long deptId) {
|
public List<SysUserVo> selectUserByIds(Collection<Long> userIds, Long deptId) {
|
||||||
return baseMapper.selectUserList(new LambdaQueryWrapper<SysUser>()
|
return baseMapper.selectUserList(new MPJLambdaWrapper<SysUser>()
|
||||||
.select(SysUser::getUserId, SysUser::getUserName, SysUser::getNickName)
|
.select(SysUser::getUserId, SysUser::getUserName, SysUser::getNickName)
|
||||||
.eq(SysUser::getStatus, SystemConstants.NORMAL)
|
.eq(SysUser::getStatus, SystemConstants.NORMAL)
|
||||||
.eq(ObjectUtil.isNotNull(deptId), SysUser::getDeptId, deptId)
|
.eqIfExists(SysUser::getDeptId, deptId)
|
||||||
.in(CollUtil.isNotEmpty(userIds), SysUser::getUserId, userIds));
|
.inIfExists(SysUser::getUserId, userIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -563,10 +559,10 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysUserVo> selectUserListByDept(Long deptId) {
|
public List<SysUserVo> selectUserListByDept(Long deptId) {
|
||||||
LambdaQueryWrapper<SysUser> lqw = Wrappers.lambdaQuery();
|
MPJLambdaWrapper<SysUser> wrapper = new MPJLambdaWrapper<>();
|
||||||
lqw.eq(SysUser::getDeptId, deptId);
|
wrapper.eq(SysUser::getDeptId, deptId);
|
||||||
lqw.orderByAsc(SysUser::getUserId);
|
wrapper.orderByAsc(SysUser::getUserId);
|
||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -652,14 +648,14 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
|||||||
if (CollUtil.isEmpty(userIds)) {
|
if (CollUtil.isEmpty(userIds)) {
|
||||||
return List.of();
|
return List.of();
|
||||||
}
|
}
|
||||||
List<SysUserVo> list = baseMapper.selectVoList(new LambdaQueryWrapper<SysUser>()
|
List<UserDTO> list = baseMapper.selectJoinList(UserDTO.class, new MPJLambdaWrapper<SysUser>()
|
||||||
.select(SysUser::getUserId, SysUser::getDeptId, SysUser::getUserName,
|
.select(SysUser::getUserId, SysUser::getDeptId, SysUser::getUserName,
|
||||||
SysUser::getNickName, SysUser::getUserType, SysUser::getEmail,
|
SysUser::getNickName, SysUser::getUserType, SysUser::getEmail,
|
||||||
SysUser::getPhoneNumber, SysUser::getGender, SysUser::getStatus,
|
SysUser::getPhoneNumber, SysUser::getGender, SysUser::getStatus,
|
||||||
SysUser::getCreateTime)
|
SysUser::getCreateTime)
|
||||||
.eq(SysUser::getStatus, SystemConstants.NORMAL)
|
.eq(SysUser::getStatus, SystemConstants.NORMAL)
|
||||||
.in(SysUser::getUserId, userIds));
|
.in(SysUser::getUserId, userIds));
|
||||||
return BeanUtil.copyToList(list, UserDTO.class);
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -711,7 +707,7 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
|||||||
if (CollUtil.isEmpty(deptIds)) {
|
if (CollUtil.isEmpty(deptIds)) {
|
||||||
return List.of();
|
return List.of();
|
||||||
}
|
}
|
||||||
List<SysUserVo> list = baseMapper.selectVoList(new LambdaQueryWrapper<SysUser>()
|
List<UserDTO> list = baseMapper.selectJoinList(UserDTO.class, new MPJLambdaWrapper<SysUser>()
|
||||||
.select(SysUser::getUserId, SysUser::getUserName, SysUser::getNickName, SysUser::getEmail, SysUser::getPhoneNumber)
|
.select(SysUser::getUserId, SysUser::getUserName, SysUser::getNickName, SysUser::getEmail, SysUser::getPhoneNumber)
|
||||||
.eq(SysUser::getStatus, SystemConstants.NORMAL)
|
.eq(SysUser::getStatus, SystemConstants.NORMAL)
|
||||||
.in(SysUser::getDeptId, deptIds));
|
.in(SysUser::getDeptId, deptIds));
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
package org.dromara.workflow.domain.vo;
|
package org.dromara.workflow.domain.vo;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.dromara.common.core.utils.DateUtils;
|
|
||||||
import org.dromara.common.translation.annotation.Translation;
|
import org.dromara.common.translation.annotation.Translation;
|
||||||
import org.dromara.common.translation.constant.TransConstant;
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
import org.dromara.warm.flow.core.entity.User;
|
import org.dromara.warm.flow.core.entity.User;
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import cn.hutool.core.convert.Convert;
|
|||||||
import cn.hutool.core.lang.tree.Tree;
|
import cn.hutool.core.lang.tree.Tree;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.constant.SystemConstants;
|
import org.dromara.common.core.constant.SystemConstants;
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
@ -78,8 +78,8 @@ public class FlwCategoryServiceImpl implements IFlwCategoryService, CategoryServ
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<FlowCategoryVo> queryList(FlowCategoryBo bo) {
|
public List<FlowCategoryVo> queryList(FlowCategoryBo bo) {
|
||||||
LambdaQueryWrapper<FlowCategory> lqw = buildQueryWrapper(bo);
|
MPJLambdaWrapper<FlowCategory> wrapper = buildQueryWrapper(bo);
|
||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -167,17 +167,17 @@ public class FlwCategoryServiceImpl implements IFlwCategoryService, CategoryServ
|
|||||||
* @param bo 查询条件
|
* @param bo 查询条件
|
||||||
* @return 查询条件包装器
|
* @return 查询条件包装器
|
||||||
*/
|
*/
|
||||||
private LambdaQueryWrapper<FlowCategory> buildQueryWrapper(FlowCategoryBo bo) {
|
private MPJLambdaWrapper<FlowCategory> buildQueryWrapper(FlowCategoryBo bo) {
|
||||||
LambdaQueryWrapper<FlowCategory> lqw = Wrappers.lambdaQuery();
|
MPJLambdaWrapper<FlowCategory> wrapper = new MPJLambdaWrapper<>();
|
||||||
lqw.eq(FlowCategory::getDelFlag, SystemConstants.NORMAL);
|
wrapper.eq(FlowCategory::getDelFlag, SystemConstants.NORMAL);
|
||||||
lqw.eq(ObjectUtil.isNotNull(bo.getCategoryId()), FlowCategory::getCategoryId, bo.getCategoryId());
|
wrapper.eqIfExists(FlowCategory::getCategoryId, bo.getCategoryId());
|
||||||
lqw.eq(ObjectUtil.isNotNull(bo.getParentId()), FlowCategory::getParentId, bo.getParentId());
|
wrapper.eqIfExists(FlowCategory::getParentId, bo.getParentId());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getCategoryName()), FlowCategory::getCategoryName, bo.getCategoryName());
|
wrapper.likeIfExists(FlowCategory::getCategoryName, bo.getCategoryName());
|
||||||
lqw.orderByAsc(FlowCategory::getAncestors);
|
wrapper.orderByAsc(FlowCategory::getAncestors);
|
||||||
lqw.orderByAsc(FlowCategory::getParentId);
|
wrapper.orderByAsc(FlowCategory::getParentId);
|
||||||
lqw.orderByAsc(FlowCategory::getOrderNum);
|
wrapper.orderByAsc(FlowCategory::getOrderNum);
|
||||||
lqw.orderByAsc(FlowCategory::getCategoryId);
|
wrapper.orderByAsc(FlowCategory::getCategoryId);
|
||||||
return lqw;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -3,8 +3,8 @@ package org.dromara.workflow.service.impl;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.constant.SystemConstants;
|
import org.dromara.common.core.constant.SystemConstants;
|
||||||
@ -63,8 +63,8 @@ public class FlwSpelServiceImpl implements IFlwSpelService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<FlowSpelVo> queryPageList(FlowSpelBo bo, PageQuery pageQuery) {
|
public PageResult<FlowSpelVo> queryPageList(FlowSpelBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<FlowSpel> lqw = buildQueryWrapper(bo);
|
MPJLambdaWrapper<FlowSpel> wrapper = buildQueryWrapper(bo);
|
||||||
Page<FlowSpelVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<FlowSpelVo> result = baseMapper.selectVoPage(pageQuery.build(), wrapper);
|
||||||
return PageResult.build(result.getRecords(), result.getTotal());
|
return PageResult.build(result.getRecords(), result.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,8 +76,8 @@ public class FlwSpelServiceImpl implements IFlwSpelService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<FlowSpelVo> queryList(FlowSpelBo bo) {
|
public List<FlowSpelVo> queryList(FlowSpelBo bo) {
|
||||||
LambdaQueryWrapper<FlowSpel> lqw = buildQueryWrapper(bo);
|
MPJLambdaWrapper<FlowSpel> wrapper = buildQueryWrapper(bo);
|
||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,16 +86,16 @@ public class FlwSpelServiceImpl implements IFlwSpelService {
|
|||||||
* @param bo 页面筛选参数
|
* @param bo 页面筛选参数
|
||||||
* @return 包含排序和筛选条件的查询包装器
|
* @return 包含排序和筛选条件的查询包装器
|
||||||
*/
|
*/
|
||||||
private LambdaQueryWrapper<FlowSpel> buildQueryWrapper(FlowSpelBo bo) {
|
private MPJLambdaWrapper<FlowSpel> buildQueryWrapper(FlowSpelBo bo) {
|
||||||
LambdaQueryWrapper<FlowSpel> lqw = Wrappers.lambdaQuery();
|
MPJLambdaWrapper<FlowSpel> wrapper = new MPJLambdaWrapper<>();
|
||||||
lqw.orderByAsc(FlowSpel::getId);
|
wrapper.orderByAsc(FlowSpel::getId);
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getComponentName()), FlowSpel::getComponentName, bo.getComponentName());
|
wrapper.likeIfExists( FlowSpel::getComponentName, bo.getComponentName());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getMethodName()), FlowSpel::getMethodName, bo.getMethodName());
|
wrapper.likeIfExists(FlowSpel::getMethodName, bo.getMethodName());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getMethodParams()), FlowSpel::getMethodParams, bo.getMethodParams());
|
wrapper.eqIfExists(FlowSpel::getMethodParams, bo.getMethodParams());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getViewSpel()), FlowSpel::getViewSpel, bo.getViewSpel());
|
wrapper.eqIfExists(FlowSpel::getViewSpel, bo.getViewSpel());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), FlowSpel::getStatus, bo.getStatus());
|
wrapper.eqIfExists(FlowSpel::getStatus, bo.getStatus());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getRemark()), FlowSpel::getRemark, bo.getRemark());
|
wrapper.likeIfExists(FlowSpel::getRemark, bo.getRemark());
|
||||||
return lqw;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -5,9 +5,8 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.domain.PageResult;
|
import org.dromara.common.core.domain.PageResult;
|
||||||
@ -86,8 +85,8 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<TestLeaveVo> queryPageList(TestLeaveBo bo, PageQuery pageQuery) {
|
public PageResult<TestLeaveVo> queryPageList(TestLeaveBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<TestLeave> lqw = buildQueryWrapper(bo);
|
MPJLambdaWrapper<TestLeave> wrapper = buildQueryWrapper(bo);
|
||||||
Page<TestLeaveVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<TestLeaveVo> result = baseMapper.selectVoPage(pageQuery.build(), wrapper);
|
||||||
return PageResult.build(result.getRecords(), result.getTotal());
|
return PageResult.build(result.getRecords(), result.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,8 +98,8 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<TestLeaveVo> queryList(TestLeaveBo bo) {
|
public List<TestLeaveVo> queryList(TestLeaveBo bo) {
|
||||||
LambdaQueryWrapper<TestLeave> lqw = buildQueryWrapper(bo);
|
MPJLambdaWrapper<TestLeave> wrapper = buildQueryWrapper(bo);
|
||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -109,13 +108,13 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
|
|||||||
* @param bo 查询参数
|
* @param bo 查询参数
|
||||||
* @return 包含请假类型、天数区间和排序条件的查询包装器
|
* @return 包含请假类型、天数区间和排序条件的查询包装器
|
||||||
*/
|
*/
|
||||||
private LambdaQueryWrapper<TestLeave> buildQueryWrapper(TestLeaveBo bo) {
|
private MPJLambdaWrapper<TestLeave> buildQueryWrapper(TestLeaveBo bo) {
|
||||||
LambdaQueryWrapper<TestLeave> lqw = Wrappers.lambdaQuery();
|
MPJLambdaWrapper<TestLeave> wrapper = new MPJLambdaWrapper<>();
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getLeaveType()), TestLeave::getLeaveType, bo.getLeaveType());
|
wrapper.eqIfExists(TestLeave::getLeaveType, bo.getLeaveType());
|
||||||
lqw.ge(bo.getStartLeaveDays() != null, TestLeave::getLeaveDays, bo.getStartLeaveDays());
|
wrapper.geIfExists(TestLeave::getLeaveDays, bo.getStartLeaveDays());
|
||||||
lqw.le(bo.getEndLeaveDays() != null, TestLeave::getLeaveDays, bo.getEndLeaveDays());
|
wrapper.leIfExists(TestLeave::getLeaveDays, bo.getEndLeaveDays());
|
||||||
lqw.orderByDesc(BaseEntity::getCreateTime);
|
wrapper.orderByDesc(BaseEntity::getCreateTime);
|
||||||
return lqw;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -14,7 +14,6 @@ import org.dromara.workflow.common.enums.MessageTypeEnum;
|
|||||||
import org.dromara.workflow.domain.FlowInstanceBizExt;
|
import org.dromara.workflow.domain.FlowInstanceBizExt;
|
||||||
import org.dromara.workflow.domain.bo.CompleteTaskBo;
|
import org.dromara.workflow.domain.bo.CompleteTaskBo;
|
||||||
import org.dromara.workflow.domain.bo.StartProcessBo;
|
import org.dromara.workflow.domain.bo.StartProcessBo;
|
||||||
import org.dromara.workflow.service.IFlwDefinitionService;
|
|
||||||
import org.dromara.workflow.service.IFlwInstanceService;
|
import org.dromara.workflow.service.IFlwInstanceService;
|
||||||
import org.dromara.workflow.service.IFlwTaskService;
|
import org.dromara.workflow.service.IFlwTaskService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -35,7 +34,6 @@ import java.util.Map;
|
|||||||
public class WorkflowServiceImpl implements WorkflowService {
|
public class WorkflowServiceImpl implements WorkflowService {
|
||||||
|
|
||||||
private final IFlwInstanceService flwInstanceService;
|
private final IFlwInstanceService flwInstanceService;
|
||||||
private final IFlwDefinitionService flwDefinitionService;
|
|
||||||
private final IFlwTaskService flwTaskService;
|
private final IFlwTaskService flwTaskService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user