Skip to content

Commit

Permalink
v6.5.2
Browse files Browse the repository at this point in the history
v6.5.2
  • Loading branch information
839128 committed Jun 22, 2022
2 parents 2d6fc37 + 43a0787 commit 8763472
Show file tree
Hide file tree
Showing 101 changed files with 612 additions and 684 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</p>
<p align="center">
<a target="_blank" href="https://search.maven.org/search?q=org.aoju">
<img src="https://img.shields.io/badge/maven--central-v6.5.1-blue.svg?label=Maven%20Central" />
<img src="https://img.shields.io/badge/maven--central-v6.5.2-blue.svg?label=Maven%20Central" />
</a>
<a target="_blank" href="https://travis-ci.org/aoju/bus">
<img src="https://travis-ci.com/aoju/bus.svg?branch=main">
Expand Down Expand Up @@ -97,7 +97,7 @@ Bus (应用/服务总线) 是一个基础框架、服务套件,它基于Java17
<dependency>
<groupId>org.aoju</groupId>
<artifactId>bus-all</artifactId>
<version>6.5.1</version>
<version>6.5.2</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion bus-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.aoju</groupId>
<artifactId>bus-all</artifactId>
<version>6.5.1</version>
<version>6.5.2</version>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
Expand Down
2 changes: 1 addition & 1 deletion bus-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.aoju</groupId>
<artifactId>bus-base</artifactId>
<version>6.5.1</version>
<version>6.5.2</version>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ public class BaseEntity extends Tracer {
*/
protected String modified;

/**
* 搜索参数
*/
@Transient
protected transient String params;

/**
* 分页页码
*/
Expand Down
22 changes: 17 additions & 5 deletions bus-base/src/main/java/org/aoju/bus/base/entity/OAuth2.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,30 +58,42 @@ public class OAuth2 extends Entity {
* 当前用户角色
*/
@Transient
private String x_role_id;
protected String x_role_id;

/**
* 当前用户职称
*/
@Transient
private String x_duty_id;
protected String x_duty_id;

/**
* 当前用户组织
*/
@Transient
private String x_org_id;
protected String x_org_id;

/**
* 当前用户设备
*/
@Transient
private String x_device_id;
protected String x_device_id;

/**
* 当前应用
*/
@Transient
protected String x_app_id;

/**
* 当前租户
*/
@Transient
protected String x_tenant_id;

/**
* 扩展参数信息
*/
@Transient
private String x_extension;
protected String x_extension;

}
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public interface BaseService<T> extends Service {
* @param entity 对象参数
* @return 操作结果
*/
Long selectCount(T entity);
int selectCount(T entity);

/**
* 通用:查询统计数据
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ public int selectCountByWhere(Object object) {
}

@Override
public Long selectCount(T entity) {
return new Long(mapper.selectCount(entity));
public int selectCount(T entity) {
return mapper.selectCount(entity);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion bus-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.aoju</groupId>
<artifactId>bus-bom</artifactId>
<version>6.5.1</version>
<version>6.5.2</version>
<packaging>pom</packaging>

<name>${project.artifactId}</name>
Expand Down
6 changes: 3 additions & 3 deletions bus-cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.aoju</groupId>
<artifactId>bus-cache</artifactId>
<version>6.5.1</version>
<version>6.5.2</version>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
Expand Down Expand Up @@ -48,11 +48,11 @@
<jedis.version>4.2.2</jedis.version>
<xmemcached.version>2.4.7</xmemcached.version>
<ehcache.version>3.9.4</ehcache.version>
<curator.version>4.3.0</curator.version>
<curator.version>5.2.1</curator.version>
<guava.version>30.1.1-jre</guava.version>
<hession.version>4.0.65</hession.version>
<druid.version>1.2.8</druid.version>
<mysql.version>8.0.28</mysql.version>
<mysql.version>8.0.29</mysql.version>
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion bus-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<dependency>
<groupId>org.aoju</groupId>
<artifactId>bus-core</artifactId>
<version>6.5.1</version>
<version>6.5.2</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion bus-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.aoju</groupId>
<artifactId>bus-core</artifactId>
<version>6.5.1</version>
<version>6.5.2</version>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
Expand Down
2 changes: 1 addition & 1 deletion bus-core/src/main/java/org/aoju/bus/core/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class Version {
* @return 项目的版本号
*/
public static String get() {
return "6.5.1.RELEASE";
return "6.5.2.RELEASE";
}

/**
Expand Down
83 changes: 52 additions & 31 deletions bus-core/src/main/java/org/aoju/bus/core/beans/PathExpression.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,13 @@ public Object get(final Object bean) {
}

/**
* 设置表达式指定位置(或filed对应)的值
* 若表达式指向一个List则设置其坐标对应位置的值,若指向Map则put对应key的值,Bean则设置字段的值
* 注意:
*
* <pre>
* 1. 如果为List,如果下标不大于List长度,则替换原有值,否则追加值
* 2. 如果为数组,如果下标不大于数组长度,则替换原有值,否则追加值
* </pre>
* 判断path列表中末尾的标记是否为数字
*
* @param bean Bean、Map或List
* @param value 值
* @param patternParts path列表
* @return 是否为数字
*/
public void set(final Object bean, final Object value) {
set(bean, this.patternParts, value);
private static boolean lastIsNumber(List<String> patternParts) {
return MathKit.isInteger(patternParts.get(patternParts.size() - 1));
}

@Override
Expand All @@ -190,27 +183,13 @@ public String toString() {
}

/**
* 设置表达式指定位置(或filed对应)的值
* 若表达式指向一个List则设置其坐标对应位置的值,若指向Map则put对应key的值,Bean则设置字段的值
* 注意:
*
* <pre>
* 1. 如果为List,如果下标不大于List长度,则替换原有值,否则追加值
* 2. 如果为数组,如果下标不大于数组长度,则替换原有值,否则追加值
* </pre>
* 获取父级路径列表
*
* @param bean Bean、Map或List
* @param patternParts 表达式块列表
* @param value 值
* @param patternParts 路径列表
* @return 父级路径列表
*/
private void set(final Object bean, final List<String> patternParts, final Object value) {
Object subBean = get(patternParts, bean, true);
if (null == subBean) {
set(bean, patternParts.subList(0, patternParts.size() - 1), new HashMap<>());
//set中有可能做过转换,因此此处重新获取bean
subBean = get(patternParts, bean, true);
}
BeanKit.setFieldValue(subBean, patternParts.get(patternParts.size() - 1), value);
private static List<String> getParentParts(List<String> patternParts) {
return patternParts.subList(0, patternParts.size() - 1);
}

/**
Expand Down Expand Up @@ -314,4 +293,46 @@ private void init(final String expression) {
this.patternParts = CollKit.unmodifiable(localPatternParts);
}

/**
* 设置表达式指定位置(或filed对应)的值
* 若表达式指向一个List则设置其坐标对应位置的值,若指向Map则put对应key的值,Bean则设置字段的值
* 注意:
*
* <pre>
* 1. 如果为List,如果下标不大于List长度,则替换原有值,否则追加值
* 2. 如果为数组,如果下标不大于数组长度,则替换原有值,否则追加值
* </pre>
*
* @param bean Bean、Map或List
* @param value 值
*/
public void set(final Object bean, final Object value) {
set(bean, this.patternParts, lastIsNumber(this.patternParts), value);
}

/**
* 设置表达式指定位置(或filed对应)的值
* 若表达式指向一个List则设置其坐标对应位置的值,若指向Map则put对应key的值,Bean则设置字段的值
* 注意:
*
* <pre>
* 1. 如果为List,如果下标不大于List长度,则替换原有值,否则追加值
* 2. 如果为数组,如果下标不大于数组长度,则替换原有值,否则追加值
* </pre>
*
* @param bean Bean、Map或List
* @param patternParts 表达式块列表
* @param value 值
*/
private void set(Object bean, List<String> patternParts, boolean nextNumberPart, Object value) {
Object subBean = this.get(patternParts, bean, true);
if (null == subBean) {
final List<String> parentParts = getParentParts(patternParts);
this.set(bean, parentParts, lastIsNumber(parentParts), nextNumberPart ? new ArrayList<>() : new HashMap<>());
//set中有可能做过转换,因此此处重新获取bean
subBean = this.get(patternParts, bean, true);
}
BeanKit.setFieldValue(subBean, patternParts.get(patternParts.size() - 1), value);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class BeanToMapCopier extends AbstractCopier<Object, Map> {
* 构造
*
* @param source 来源Map
* @param target 目标Bean对象
* @param target 目标Map对象
* @param targetType 目标泛型类型
* @param copyOptions 拷贝选项
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ public CopyOptions ignoreCase() {

/**
* 设置拷贝属性的字段映射,用于不同的属性之前拷贝做对应表用
* 需要注意的是,当使用ValueProvider作为数据提供者时,这个映射是相反的,即fieldMapping中key为目标Bean的名称,而value是提供者中的key
*
* @param fieldMapping 拷贝属性的字段映射,用于不同的属性之前拷贝做对应表用
* @return this
Expand All @@ -261,6 +262,7 @@ public CopyOptions setFieldMapping(Map<String, String> fieldMapping) {
* 设置字段属性编辑器,用于自定义属性转换规则,例如驼峰转下划线等
* 此转换器只针对源端的字段做转换,请确认转换后与目标端字段一致
* 当转换后的字段名为null时忽略这个字段
* 需要注意的是,当使用ValueProvider作为数据提供者时,这个映射是相反的,即fieldMapping中key为目标Bean的名称,而value是提供者中的key
*
* @param fieldNameEditor 字段属性编辑器,用于自定义属性转换规则,例如驼峰转下划线等
* @return this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public T copy() {
}

// 检查目标字段可写性
PropertyDesc tDesc = findPropertyDesc(targetPropertyDescMap, sKeyStr);
final PropertyDesc tDesc = findPropertyDesc(targetPropertyDescMap, sKeyStr);
if (null == tDesc || false == tDesc.isWritable(this.copyOptions.transientSupport)) {
// 字段不可写,跳过之
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ public T copy() {
return;
}

tFieldName = copyOptions.editFieldName(tFieldName);
// 对key做转换,转换后为null的跳过
if (null == tFieldName) {
return;
}

// 无字段内容跳过
if (false == source.containsKey(tFieldName)) {
return;
Expand Down
Loading

0 comments on commit 8763472

Please sign in to comment.