mirror of
https://gitee.com/dromara/dax-pay
synced 2026-08-11 15:15:33 +08:00
ref 升级脚手架依赖
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>cn.bootx.platform</groupId>
|
||||
<artifactId>bootx-platform-common</artifactId>
|
||||
<version>3.0.0.beta5</version>
|
||||
<version>3.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>common-config</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>cn.bootx.platform</groupId>
|
||||
<artifactId>bootx-platform-common</artifactId>
|
||||
<version>3.0.0.beta5</version>
|
||||
<version>3.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>common-exception-handler</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>cn.bootx.platform</groupId>
|
||||
<artifactId>bootx-platform-common</artifactId>
|
||||
<version>3.0.0.beta5</version>
|
||||
<version>3.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>common-header-holder</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>cn.bootx.platform</groupId>
|
||||
<artifactId>bootx-platform-common</artifactId>
|
||||
<version>3.0.0.beta5</version>
|
||||
<version>3.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>common-jackson</artifactId>
|
||||
|
||||
@@ -8,6 +8,7 @@ import lombok.experimental.UtilityClass;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* jackson常用工具类封装
|
||||
@@ -130,4 +131,24 @@ public class JacksonUtil {
|
||||
throw new RuntimeException("json反序列化失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 对象转为map
|
||||
*/
|
||||
public Map<String, Object> parseObj(Object mchApply) {
|
||||
return parseObj(mchApply,true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map<String, Object> parseObj(Object mchApply, boolean ignoreNull) {
|
||||
try {
|
||||
if (ignoreNull) {
|
||||
return ignoreNullObjectMapper.convertValue(mchApply, Map.class);
|
||||
}
|
||||
return objectMapper.convertValue(mchApply, Map.class);
|
||||
} catch (IllegalArgumentException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new RuntimeException("json反序列化失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>cn.bootx.platform</groupId>
|
||||
<artifactId>bootx-platform-common</artifactId>
|
||||
<version>3.0.0.beta5</version>
|
||||
<version>3.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>common-log</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>cn.bootx.platform</groupId>
|
||||
<artifactId>bootx-platform-common</artifactId>
|
||||
<version>3.0.0.beta5</version>
|
||||
<version>3.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>common-mybatis-plus</artifactId>
|
||||
@@ -63,6 +63,17 @@
|
||||
<artifactId>common-spring</artifactId>
|
||||
<version>${bootx-platform.version}</version>
|
||||
</dependency>
|
||||
<!-- hutool 组件 -->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-db</artifactId>
|
||||
<version>${hutool.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-http</artifactId>
|
||||
<version>${hutool.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package cn.bootx.platform.common.mybatisplus.handler;
|
||||
|
||||
import cn.bootx.platform.core.util.JsonUtil;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
import org.apache.ibatis.type.MappedJdbcTypes;
|
||||
@@ -35,13 +35,13 @@ public class IntegerListTypeHandler extends AbstractJsonTypeHandler<List<Integer
|
||||
@Override
|
||||
public List<Integer> parse(String json) {
|
||||
if (StrUtil.isNotBlank(json)){
|
||||
return JsonUtil.toBean(json, new TypeReference<>() {}, false);
|
||||
return JSONUtil.toBean(json, new TypeReference<>() {}, false);
|
||||
}
|
||||
return List.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toJson(List<Integer> obj) {
|
||||
return JsonUtil.toJsonStr(obj);
|
||||
return JSONUtil.toJsonStr(obj);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package cn.bootx.platform.common.mybatisplus.handler;
|
||||
import cn.bootx.platform.core.util.JsonUtil;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
import org.apache.ibatis.type.MappedJdbcTypes;
|
||||
@@ -30,13 +31,13 @@ public class LongListTypeHandler extends AbstractJsonTypeHandler<List<Long>> {
|
||||
@Override
|
||||
public List<Long> parse(String json) {
|
||||
if (StrUtil.isNotBlank(json)){
|
||||
return JsonUtil.toBean(json, new TypeReference<>() {}, false);
|
||||
return JSONUtil.toBean(json, new TypeReference<>() {}, false);
|
||||
}
|
||||
return List.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toJson(List<Long> obj) {
|
||||
return JsonUtil.toJsonStr(obj);
|
||||
return JSONUtil.toJsonStr(obj);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,6 @@ public class StringListTypeHandler extends AbstractJsonTypeHandler<List<String>>
|
||||
|
||||
@Override
|
||||
public String toJson(List<String> obj) {
|
||||
return JsonUtil.toJsonStr(obj);
|
||||
return JSONUtil.toJsonStr(obj);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,13 @@ package cn.bootx.platform.common.mybatisplus.util;
|
||||
|
||||
import cn.bootx.platform.common.mybatisplus.function.ToResult;
|
||||
import cn.bootx.platform.core.annotation.BigField;
|
||||
import cn.bootx.platform.core.exception.BizException;
|
||||
import cn.bootx.platform.core.rest.param.PageParam;
|
||||
import cn.bootx.platform.core.rest.result.PageResult;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableFieldInfo;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
|
||||
@@ -20,7 +22,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import org.apache.ibatis.reflection.property.PropertyNamer;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.lang.reflect.Method;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@@ -159,4 +164,17 @@ public class MpUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前数据库类型, 别忘了关闭, 不然会连接池泄露
|
||||
*/
|
||||
public String getDbType(){
|
||||
try {
|
||||
try (Connection connection = SpringUtil.getBean(DataSource.class).getConnection()) {
|
||||
return connection.getMetaData().getDatabaseProductName();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
throw new BizException("获取数据库类型失败");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,312 @@
|
||||
package cn.bootx.platform.common.mybatisplus.util;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.db.Db;
|
||||
import cn.hutool.db.Entity;
|
||||
import cn.hutool.db.handler.BeanHandler;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.hutool.http.HtmlUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.AbstractWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.enums.SqlMethod;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ExceptionUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.PropertyPlaceholderHelper;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* 数据库工具类
|
||||
*
|
||||
* @author nn200433
|
||||
* @date 2024-03-28 09:32:34
|
||||
*/
|
||||
@Slf4j
|
||||
public class MybatisDbUtil {
|
||||
|
||||
private static final String PARAM_KEY_PRE = "ew.paramNameValuePairs.";
|
||||
private static final String UPDATE_SET_PREFIX = "SET";
|
||||
private static final String SQL_PREFIX_AND_SUFFIX = "'";
|
||||
public static final String PLACEHOLDER_PREFIX = "#{";
|
||||
private static final String PLACEHOLDER_SUFFIX = "}";
|
||||
private static final PropertyPlaceholderHelper PLACEHOLDER_HELPER = new PropertyPlaceholderHelper(PLACEHOLDER_PREFIX, PLACEHOLDER_SUFFIX);
|
||||
|
||||
/**
|
||||
* 物理删除
|
||||
*
|
||||
* @param tableClz 数据表实体类型
|
||||
* @param ids 主键
|
||||
* @return int 影响行数
|
||||
* @author nn200433
|
||||
*/
|
||||
public static int delete(Class<?> tableClz, String... ids) {
|
||||
final TableInfo tableInfo = getTableInfo(tableClz);
|
||||
final String tableName = tableInfo.getTableName();
|
||||
final String keyColumn = tableInfo.getKeyColumn();
|
||||
Assert.notBlank(keyColumn, "{} 未设置 @TableId 注解!", tableClz);
|
||||
int count = 0;
|
||||
try {
|
||||
count = Db.use(dataSource()).del(Entity.create(tableName).set(keyColumn, ids));
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 物理删除
|
||||
*
|
||||
* <p>
|
||||
* 请使用{@link com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper}构造wrapper
|
||||
* </p>
|
||||
*
|
||||
* @param wrapper 包装物
|
||||
* @return int 影响行数
|
||||
* @author nn200433
|
||||
*/
|
||||
public static <T> int delete(AbstractWrapper<T, ?, ?> wrapper) {
|
||||
final Class<T> entityClass = (Class<T>) getEntityClass(wrapper);
|
||||
final TableInfo tableInfo = getTableInfo(entityClass);
|
||||
final String whereSql = wrapper.getCustomSqlSegment();
|
||||
final String tableName = tableInfo.getTableName();
|
||||
final Map<String, Object> paramNameValuePairs = wrapper.getParamNameValuePairs();
|
||||
int count = 0;
|
||||
try {
|
||||
final String sql = getSql(SqlMethod.DELETE, tableName, StrUtil.EMPTY, StrUtil.EMPTY, whereSql, null, paramNameValuePairs);
|
||||
count = Db.use(dataSource()).execute(sql);
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过ID查询数据(忽略逻辑删除)
|
||||
*
|
||||
* @param id 主键id值
|
||||
* @param entityClass 返回的实体类型
|
||||
* @return {@link T }
|
||||
* @author nn200433
|
||||
*/
|
||||
public static <T> T selectById(Object id, Class<T> entityClass) {
|
||||
final TableInfo tableInfo = getTableInfo(entityClass);
|
||||
final String keyColumn = tableInfo.getKeyColumn();
|
||||
final QueryWrapper<T> wrapper = new QueryWrapper<T>().eq(keyColumn, id);
|
||||
final String tableName = tableInfo.getTableName();
|
||||
final String whereSql = wrapper.getCustomSqlSegment();
|
||||
final Map<String, Object> paramNameValuePairs = wrapper.getParamNameValuePairs();
|
||||
T result = null;
|
||||
try {
|
||||
final String sql = getSql(SqlMethod.SELECT_BY_MAP, tableName, StrUtil.EMPTY, tableInfo.getAllSqlSelect(), whereSql, null, paramNameValuePairs);
|
||||
result = Db.use(dataSource()).query(sql, new BeanHandler<T>(entityClass));
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表(忽略逻辑删除)
|
||||
*
|
||||
* <p>
|
||||
* 请使用{@link com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper}构造wrapper。
|
||||
* <br/>
|
||||
* 举例:new LambdaQueryWrapper<SmsTemplate>(Entity.class).eq(Entity::getCode, "2");
|
||||
* </p>
|
||||
*
|
||||
* @param wrapper 包装物
|
||||
* @return {@link List }<{@link T }>
|
||||
* @author nn200433
|
||||
*/
|
||||
public static <T> List<T> selectList(AbstractWrapper<T, ?, ?> wrapper) {
|
||||
List<T> resultList = new ArrayList<T>();
|
||||
final Class<T> entityClass = (Class<T>) getEntityClass(wrapper);
|
||||
final TableInfo tableInfo = getTableInfo(entityClass);
|
||||
final String whereSql = wrapper.getCustomSqlSegment();
|
||||
final String columnSql = wrapper.getSqlSelect();
|
||||
final String tableName = tableInfo.getTableName();
|
||||
final Map<String, Object> paramNameValuePairs = wrapper.getParamNameValuePairs();
|
||||
try {
|
||||
final String sql = getSql(SqlMethod.SELECT_LIST, tableName, StrUtil.EMPTY, StrUtil.blankToDefault(columnSql, tableInfo.getAllSqlSelect()), whereSql, null, paramNameValuePairs);
|
||||
resultList = Db.use(dataSource()).query(sql, entityClass);
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新(忽略逻辑删除)
|
||||
*
|
||||
* @param entity 实体类
|
||||
* @return int 影响行数
|
||||
* @author nn200433
|
||||
*/
|
||||
public static <T> int update(T entity) {
|
||||
return update(entity, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过条件更新数据(忽略逻辑删除)
|
||||
* <p>
|
||||
* 请使用{@link com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper}构造wrapper
|
||||
* </p>
|
||||
*
|
||||
* @param entity 实体类
|
||||
* @param wrapper 包装物
|
||||
* @return int 影响行数
|
||||
* @author nn200433
|
||||
*/
|
||||
public static <T> int update(T entity, AbstractWrapper<T, ?, ?> wrapper) {
|
||||
final TableInfo tableInfo = getTableInfo(entity.getClass());
|
||||
final String tableName = tableInfo.getTableName();
|
||||
if (null == wrapper) {
|
||||
final String keyProperty = tableInfo.getKeyProperty();
|
||||
Assert.notBlank(keyProperty, "{} 未设置 @TableId 注解!", keyProperty);
|
||||
wrapper = new UpdateWrapper<T>(entity).eq(keyProperty, ReflectUtil.getFieldValue(entity, keyProperty));
|
||||
}
|
||||
final String whereSql = wrapper.getCustomSqlSegment();
|
||||
final Map<String, Object> paramNameValuePairs = wrapper.getParamNameValuePairs();
|
||||
int count = 0;
|
||||
try {
|
||||
final String sql = getSql(SqlMethod.UPDATE, tableName, StrUtil.EMPTY, tableInfo.getAllSqlSet(Boolean.TRUE, StrUtil.EMPTY), whereSql, BeanUtil.beanToMap(entity), paramNameValuePairs);
|
||||
count = Db.use(dataSource()).execute(sql);
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取sql
|
||||
*
|
||||
* @param method SQL方法
|
||||
* @param tableName 数据库表名称
|
||||
* @param firstSql firtSql
|
||||
* @param columnSql 字段sql
|
||||
* @param whereSql where条件sql
|
||||
* @param setMap set参数
|
||||
* @param paramNameValuePairs where条件值
|
||||
* @return {@link String }
|
||||
* @author nn200433
|
||||
*/
|
||||
private static String getSql(SqlMethod method, String tableName, String firstSql, String columnSql, String whereSql,
|
||||
Map<String, Object> setMap, Map<String, Object> paramNameValuePairs) {
|
||||
final Map<String, Object> paramMap = new HashMap<String, Object>(paramNameValuePairs.size());
|
||||
for (final Map.Entry<String, Object> entry : paramNameValuePairs.entrySet()) {
|
||||
paramMap.put(PARAM_KEY_PRE + entry.getKey(), entry.getValue());
|
||||
}
|
||||
if (CollUtil.isNotEmpty(setMap)) {
|
||||
paramMap.putAll(setMap);
|
||||
}
|
||||
// 害人不浅,包了这么标签
|
||||
String originalSql = null;
|
||||
switch (method) {
|
||||
case DELETE:
|
||||
originalSql = String.format(method.getSql(), tableName, whereSql, StrUtil.EMPTY);
|
||||
break;
|
||||
case UPDATE:
|
||||
columnSql = StrUtil.addPrefixIfNot(columnSql, UPDATE_SET_PREFIX + StrUtil.SPACE);
|
||||
columnSql = StrUtil.removeSuffix(columnSql, StrUtil.COMMA);
|
||||
originalSql = String.format(method.getSql(), tableName, columnSql, whereSql, StrUtil.EMPTY);
|
||||
break;
|
||||
case SELECT_LIST:
|
||||
// 判断个锤子OrderBy注解,麻烦
|
||||
originalSql = String.format(method.getSql(), firstSql, columnSql, tableName, whereSql, StrUtil.EMPTY, StrUtil.EMPTY);
|
||||
break;
|
||||
case SELECT_BY_MAP:
|
||||
// 垃圾 SELECT_BY_ID ,限制那么多
|
||||
originalSql = String.format(method.getSql(), columnSql, tableName, whereSql, StrUtil.EMPTY);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
final String preSql = StrUtil.trim(HtmlUtil.cleanHtmlTag(originalSql));
|
||||
return resolveParams(preSql, paramMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从wrapper中尝试获取实体类型
|
||||
*
|
||||
* @param queryWrapper 条件构造器
|
||||
* @param <T> 实体类型
|
||||
* @return 实体类型
|
||||
*/
|
||||
private static <T> Class<T> getEntityClass(AbstractWrapper<T, ?, ?> queryWrapper) {
|
||||
Class<T> entityClass = queryWrapper.getEntityClass();
|
||||
if (entityClass == null) {
|
||||
T entity = queryWrapper.getEntity();
|
||||
if (entity != null) {
|
||||
entityClass = (Class<T>) entity.getClass();
|
||||
}
|
||||
}
|
||||
Assert.notNull(entityClass, "error: can not get entityClass from wrapper");
|
||||
return entityClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取表信息,获取不到报错提示
|
||||
*
|
||||
* @param entityClass 实体类
|
||||
* @param <T> 实体类型
|
||||
* @return 对应表信息
|
||||
*/
|
||||
private static <T> TableInfo getTableInfo(Class<T> entityClass) {
|
||||
return Optional.ofNullable(TableInfoHelper.getTableInfo(entityClass))
|
||||
.orElseThrow(() -> ExceptionUtils.mpe("error: can not find TableInfo from Class: \"%s\".", entityClass.getName()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析参数
|
||||
*
|
||||
* @param str 包含要替换的占位符的值
|
||||
* @param param 参数
|
||||
* @return @return {@link String }
|
||||
* @author nn200433
|
||||
*/
|
||||
private static String resolveParams(String str, Map<String, Object> param) {
|
||||
return PLACEHOLDER_HELPER.replacePlaceholders(str, key -> {
|
||||
// final String v = MapUtil.(param, key);
|
||||
final Object v = param.get(key);
|
||||
if (null == v) {
|
||||
return "null";
|
||||
}
|
||||
final Class<?> clz = v.getClass();
|
||||
if (clz.equals(Date.class)) {
|
||||
final Date vd = (Date) v;
|
||||
return StrUtil.wrap(DateUtil.format(vd, DatePattern.NORM_DATETIME_FORMAT), SQL_PREFIX_AND_SUFFIX);
|
||||
} else if (clz.equals(LocalDateTime.class)) {
|
||||
final LocalDateTime vd = (LocalDateTime) v;
|
||||
return StrUtil.wrap(DateUtil.formatLocalDateTime(vd), SQL_PREFIX_AND_SUFFIX);
|
||||
}
|
||||
return StrUtil.wrap(Convert.toStr(v), SQL_PREFIX_AND_SUFFIX);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据源
|
||||
*
|
||||
* @return {@link DataSource }
|
||||
* @author nn200433
|
||||
*/
|
||||
private static DataSource dataSource() {
|
||||
return SpringUtil.getBean(DataSource.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>cn.bootx.platform</groupId>
|
||||
<artifactId>bootx-platform-common</artifactId>
|
||||
<version>3.0.0.beta5</version>
|
||||
<version>3.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>common-redis</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>cn.bootx.platform</groupId>
|
||||
<artifactId>bootx-platform-common</artifactId>
|
||||
<version>3.0.0.beta5</version>
|
||||
<version>3.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>common-spring</artifactId>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.bootx.platform.common.spring.configuration;
|
||||
|
||||
import cn.bootx.platform.core.util.JsonUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||
@@ -39,7 +40,7 @@ public class AsyncExecutorConfiguration implements AsyncConfigurer {
|
||||
@Override
|
||||
public void handleUncaughtException(Throwable throwable, Method method, Object... objects) {
|
||||
|
||||
log.error("异步方法中发生异常,方法:{},参数:{},异常:{}", method.getName(), JsonUtil.toJsonStr(objects),
|
||||
log.error("异步方法中发生异常,方法:{},参数:{},异常:{}", method.getName(), JSONUtil.toJsonStr(objects),
|
||||
throwable.getMessage());
|
||||
log.error("详细异常信息", throwable);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>cn.bootx.platform</groupId>
|
||||
<artifactId>bootx-platform-common</artifactId>
|
||||
<version>3.0.0.beta5</version>
|
||||
<version>3.0.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>common-swagger</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>cn.bootx.platform</groupId>
|
||||
<artifactId>bootx-platform</artifactId>
|
||||
<version>3.0.0.beta5</version>
|
||||
<version>3.0.0</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
Reference in New Issue
Block a user