Commit af361b4359f54e85dd109f37185920e502713c94
Merge remote-tracking branch 'origin/master-jdk17' into master-jdk17
Showing
4 changed files
with
44 additions
and
5 deletions
yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/datasource/core/enums/DataSourceEnum.java
| ... | ... | @@ -5,8 +5,6 @@ package cn.iocoder.yudao.framework.datasource.core.enums; |
| 5 | 5 | * |
| 6 | 6 | * 通过在方法上,使用 {@link com.baomidou.dynamic.datasource.annotation.DS} 注解,设置使用的数据源。 |
| 7 | 7 | * 注意,默认是 {@link #MASTER} 数据源 |
| 8 | - * | |
| 9 | - * 对应官方文档为 http://dynamic-datasource.com/guide/customize/Annotation.html | |
| 10 | 8 | */ |
| 11 | 9 | public interface DataSourceEnum { |
| 12 | 10 | ... | ... |
yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java
| ... | ... | @@ -9,6 +9,7 @@ import org.springframework.util.StringUtils; |
| 9 | 9 | |
| 10 | 10 | import java.time.LocalDateTime; |
| 11 | 11 | import java.util.Collection; |
| 12 | +import java.util.function.Consumer; | |
| 12 | 13 | |
| 13 | 14 | /** |
| 14 | 15 | * 拓展 MyBatis Plus QueryWrapper 类,主要增加如下功能: |
| ... | ... | @@ -158,4 +159,40 @@ public class LambdaQueryWrapperX<T> extends LambdaQueryWrapper<T> { |
| 158 | 159 | return this; |
| 159 | 160 | } |
| 160 | 161 | |
| 162 | + @Override | |
| 163 | + public LambdaQueryWrapperX<T> exists(boolean condition, String existsSql, Object... values) { | |
| 164 | + super.exists(condition, existsSql, values); | |
| 165 | + return this; | |
| 166 | + } | |
| 167 | + | |
| 168 | + @Override | |
| 169 | + public LambdaQueryWrapperX<T> notExists(boolean condition, String existsSql, Object... values) { | |
| 170 | + super.notExists(condition, existsSql, values); | |
| 171 | + return this; | |
| 172 | + } | |
| 173 | + | |
| 174 | + @Override | |
| 175 | + public LambdaQueryWrapperX<T> and(boolean condition, Consumer<LambdaQueryWrapper<T>> consumer) { | |
| 176 | + super.and(condition, consumer); | |
| 177 | + return this; | |
| 178 | + } | |
| 179 | + | |
| 180 | + @Override | |
| 181 | + public LambdaQueryWrapperX<T> or(boolean condition, Consumer<LambdaQueryWrapper<T>> consumer) { | |
| 182 | + super.or(condition, consumer); | |
| 183 | + return this; | |
| 184 | + } | |
| 185 | + | |
| 186 | + @Override | |
| 187 | + public LambdaQueryWrapperX<T> nested(boolean condition, Consumer<LambdaQueryWrapper<T>> consumer) { | |
| 188 | + super.nested(condition, consumer); | |
| 189 | + return this; | |
| 190 | + } | |
| 191 | + | |
| 192 | + @Override | |
| 193 | + public LambdaQueryWrapperX<T> not(boolean condition, Consumer<LambdaQueryWrapper<T>> consumer) { | |
| 194 | + super.not(condition, consumer); | |
| 195 | + return this; | |
| 196 | + } | |
| 197 | + | |
| 161 | 198 | } | ... | ... |
yudao-module-pay/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/order/PayOrderDO.java
yudao-module-pay/src/main/java/cn/iocoder/yudao/module/pay/framework/pay/core/client/impl/alipay/AbstractAlipayPayClient.java
| ... | ... | @@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil; |
| 4 | 4 | import cn.hutool.core.date.LocalDateTimeUtil; |
| 5 | 5 | import cn.hutool.core.lang.Assert; |
| 6 | 6 | import cn.hutool.core.map.MapUtil; |
| 7 | +import cn.hutool.core.text.CharSequenceUtil; | |
| 7 | 8 | import cn.hutool.core.util.StrUtil; |
| 8 | 9 | import cn.hutool.http.HttpUtil; |
| 9 | 10 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
| ... | ... | @@ -92,9 +93,12 @@ public abstract class AbstractAlipayPayClient extends AbstractPayClient<AlipayPa |
| 92 | 93 | status = PayOrderStatusEnum.REFUND.getStatus(); |
| 93 | 94 | } |
| 94 | 95 | Assert.notNull(status, (Supplier<Throwable>) () -> { |
| 95 | - throw new IllegalArgumentException(StrUtil.format("body({}) 的 trade_status 不正确", body)); | |
| 96 | + throw new IllegalArgumentException(CharSequenceUtil.format("body({}) 的 trade_status 不正确", body)); | |
| 96 | 97 | }); |
| 97 | - return PayOrderRespDTO.of(status, bodyObj.get("trade_no"), bodyObj.get("seller_id"), parseTime(params.get("gmt_payment")), | |
| 98 | + // https://opendocs.alipay.com/open/00dn78?pathHash=fef00e6d#%E5%BC%82%E6%AD%A5%E9%80%9A%E7%9F%A5%E5%8F%82%E6%95%B0 | |
| 99 | + // buyer_id(buyer_open_id)买家支付宝用户号,seller_id 卖家支付宝用户号 | |
| 100 | + String channelUserId = CharSequenceUtil.nullToDefault(bodyObj.get("buyer_open_id"), bodyObj.get("buyer_id")); | |
| 101 | + return PayOrderRespDTO.of(status, bodyObj.get("trade_no"), channelUserId, parseTime(params.get("gmt_payment")), | |
| 98 | 102 | bodyObj.get("out_trade_no"), body); |
| 99 | 103 | } |
| 100 | 104 | ... | ... |