Commit 7c38a32fc9be07d7c1ef8e1ceb64d750f948176c
1 parent
44548ee0
fix:【MALL 商城】小程序发货,uploadTime 不正确的问题
Showing
3 changed files
with
10 additions
and
4 deletions
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/LocalDateTimeUtils.java
| ... | ... | @@ -8,12 +8,16 @@ import cn.hutool.core.util.StrUtil; |
| 8 | 8 | import cn.iocoder.yudao.framework.common.enums.DateIntervalEnum; |
| 9 | 9 | |
| 10 | 10 | import java.time.*; |
| 11 | +import java.time.format.DateTimeFormatter; | |
| 11 | 12 | import java.time.format.DateTimeParseException; |
| 12 | 13 | import java.time.temporal.ChronoUnit; |
| 13 | 14 | import java.time.temporal.TemporalAdjusters; |
| 14 | 15 | import java.util.ArrayList; |
| 15 | 16 | import java.util.List; |
| 16 | 17 | |
| 18 | +import static cn.hutool.core.date.DatePattern.UTC_MS_WITH_XXX_OFFSET_PATTERN; | |
| 19 | +import static cn.hutool.core.date.DatePattern.createFormatter; | |
| 20 | + | |
| 17 | 21 | /** |
| 18 | 22 | * 时间工具类,用于 {@link java.time.LocalDateTime} |
| 19 | 23 | * |
| ... | ... | @@ -26,6 +30,8 @@ public class LocalDateTimeUtils { |
| 26 | 30 | */ |
| 27 | 31 | public static LocalDateTime EMPTY = buildTime(1970, 1, 1); |
| 28 | 32 | |
| 33 | + public static DateTimeFormatter UTC_MS_WITH_XXX_OFFSET_FORMATTER = createFormatter(UTC_MS_WITH_XXX_OFFSET_PATTERN); | |
| 34 | + | |
| 29 | 35 | /** |
| 30 | 36 | * 解析时间 |
| 31 | 37 | * | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/brokerage/BrokerageWithdrawServiceImpl.java
| ... | ... | @@ -136,7 +136,7 @@ public class BrokerageWithdrawServiceImpl implements BrokerageWithdrawService { |
| 136 | 136 | if (Objects.equal(withdraw.getType(), BrokerageWithdrawTypeEnum.ALIPAY_API.getType())) { |
| 137 | 137 | channelCode = PayChannelEnum.ALIPAY_PC.getCode(); |
| 138 | 138 | } else if (Objects.equal(withdraw.getType(), BrokerageWithdrawTypeEnum.WECHAT_API.getType())) { |
| 139 | - channelCode = PayChannelEnum.WX_LITE.getCode(); | |
| 139 | + channelCode = withdraw.getTransferChannelCode(); | |
| 140 | 140 | userAccount = withdraw.getUserAccount(); |
| 141 | 141 | // 特殊:微信需要有报备信息 |
| 142 | 142 | channelExtras = PayTransferCreateReqDTO.buildWeiXinChannelExtra1000("佣金提现", "佣金提现"); | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImpl.java
| ... | ... | @@ -60,14 +60,14 @@ import org.springframework.data.redis.core.StringRedisTemplate; |
| 60 | 60 | import org.springframework.stereotype.Service; |
| 61 | 61 | |
| 62 | 62 | import java.time.Duration; |
| 63 | -import java.time.LocalDateTime; | |
| 63 | +import java.time.ZonedDateTime; | |
| 64 | 64 | import java.util.List; |
| 65 | 65 | import java.util.Map; |
| 66 | 66 | import java.util.Objects; |
| 67 | 67 | |
| 68 | -import static cn.hutool.core.date.DatePattern.UTC_MS_WITH_XXX_OFFSET_PATTERN; | |
| 69 | 68 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 70 | 69 | import static cn.iocoder.yudao.framework.common.util.collection.MapUtils.findAndThen; |
| 70 | +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.UTC_MS_WITH_XXX_OFFSET_FORMATTER; | |
| 71 | 71 | import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString; |
| 72 | 72 | import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; |
| 73 | 73 | import static java.util.Collections.singletonList; |
| ... | ... | @@ -359,7 +359,7 @@ public class SocialClientServiceImpl implements SocialClientService { |
| 359 | 359 | .deliveryMode(1) // 统一发货 |
| 360 | 360 | .shippingList(shippingList) |
| 361 | 361 | .payer(PayerBean.builder().openid(reqDTO.getOpenid()).build()) |
| 362 | - .uploadTime(LocalDateTimeUtil.format(LocalDateTime.now(), UTC_MS_WITH_XXX_OFFSET_PATTERN)) | |
| 362 | + .uploadTime(ZonedDateTime.now().format(UTC_MS_WITH_XXX_OFFSET_FORMATTER)) | |
| 363 | 363 | .build(); |
| 364 | 364 | try { |
| 365 | 365 | WxMaOrderShippingInfoBaseResponse response = service.getWxMaOrderShippingService().upload(request); | ... | ... |