fix(微信小程序确认收货提醒接口): 修复 #839 - received_time 时间戳单位错误(应为秒)

根据微信小程序接口要求,订单签收时间 received_time 应为秒级时间戳,但现有实现传入了毫秒,导致微信接口返回错误代码 10060029(签收时间不合理)。

新增 LocalDateUtils.toEpochSecond 方法,统一将 LocalDateTime 转换为秒级时间戳,用于接口参数转换。

BREAKING CHANGE: 无

Closes #839
This commit is contained in:
Ken
2025-05-20 12:57:33 +08:00
parent 501cfe5afa
commit 41b17d4faf
2 changed files with 16 additions and 2 deletions

View File

@@ -68,6 +68,7 @@ import java.util.Objects;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.util.collection.MapUtils.findAndThen;
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.UTC_MS_WITH_XXX_OFFSET_FORMATTER;
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.toEpochSecond;
import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString;
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
import static java.util.Collections.singletonList;
@@ -379,7 +380,7 @@ public class SocialClientServiceImpl implements SocialClientService {
WxMaService service = getWxMaService(userType);
WxMaOrderShippingInfoNotifyConfirmRequest request = WxMaOrderShippingInfoNotifyConfirmRequest.builder()
.transactionId(reqDTO.getTransactionId())
.receivedTime(LocalDateTimeUtil.toEpochMilli(reqDTO.getReceivedTime()))
.receivedTime(toEpochSecond(reqDTO.getReceivedTime()))
.build();
try {
WxMaOrderShippingInfoBaseResponse response = service.getWxMaOrderShippingService().notifyConfirmReceive(request);