微信支付回调日期格式化

This commit is contained in:
gong
2026-01-15 15:17:57 +08:00
parent 9834c59fc7
commit aca48f84d9

View File

@@ -5,6 +5,9 @@ import com.czg.PayCst;
import com.czg.pay.PayNotifyRespDTO;
import lombok.Data;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
/**
* @author yjjie
* @date 2025/12/23 22:21
@@ -119,13 +122,16 @@ public class WechatPayNotifyDataDto {
}
public PayNotifyRespDTO convertToPayNotifyRespDTO() {
ZonedDateTime zonedDateTime = ZonedDateTime.parse(successTime);
DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String time = zonedDateTime.format(outputFormatter);
PayNotifyRespDTO respDTO = new PayNotifyRespDTO()
.setMchOrderNo(outTradeNo)
.setThirdOrderNo(transactionId)
.setAmount(getPayAmount())
.setPlatform(PayCst.Platform.WECHAT)
.setExtData(attach)
.setPaySuccessTime(successTime)
.setPaySuccessTime(time)
.setErrorMsg(tradeStateDesc);
switch (tradeState) {