|
|
@@ -32,6 +32,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.time.OffsetDateTime;
|
|
|
+import java.time.ZoneId;
|
|
|
import java.time.ZoneOffset;
|
|
|
import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
|
@@ -214,11 +215,11 @@ public class BillHandler extends BaseNotifyHandler {
|
|
|
if (parsed != null) {
|
|
|
bill.setGmtBizCreate(parsed);
|
|
|
} else if (existing == null) {
|
|
|
- bill.setGmtBizCreate(OffsetDateTime.now());
|
|
|
+ bill.setGmtBizCreate(OffsetDateTime.now(ZONE_BEIJING));
|
|
|
log.warn("账单 gmt_biz_create 解析失败,使用当前时间兜底: pay_no={}, raw={}", payNo, gmtBizCreate);
|
|
|
}
|
|
|
} else if (existing == null) {
|
|
|
- bill.setGmtBizCreate(OffsetDateTime.now());
|
|
|
+ bill.setGmtBizCreate(OffsetDateTime.now(ZONE_BEIJING));
|
|
|
}
|
|
|
if (StrUtil.isNotBlank(gmtRecievePay)) bill.setGmtRecievePay(toOffsetDateTime(gmtRecievePay));
|
|
|
if (StrUtil.isNotBlank(peerPayAmount)) bill.setPeerPayAmount(toDecimal(peerPayAmount));
|
|
|
@@ -435,11 +436,13 @@ public class BillHandler extends BaseNotifyHandler {
|
|
|
try { return new BigDecimal(val); } catch (NumberFormatException e) { return null; }
|
|
|
}
|
|
|
|
|
|
+ private static final ZoneId ZONE_BEIJING = ZoneId.of("Asia/Shanghai");
|
|
|
+
|
|
|
private static java.time.OffsetDateTime toOffsetDateTime(String val) {
|
|
|
if (StrUtil.isBlank(val)) return null;
|
|
|
try {
|
|
|
return java.time.LocalDate.parse(val, java.time.format.DateTimeFormatter.ISO_LOCAL_DATE)
|
|
|
- .atStartOfDay(java.time.ZoneOffset.ofHours(8)).toOffsetDateTime();
|
|
|
+ .atStartOfDay(ZONE_BEIJING).toOffsetDateTime();
|
|
|
} catch (Exception e1) {
|
|
|
try {
|
|
|
return java.time.OffsetDateTime.parse(val,
|
|
|
@@ -448,7 +451,7 @@ public class BillHandler extends BaseNotifyHandler {
|
|
|
try {
|
|
|
return java.time.LocalDateTime.parse(val,
|
|
|
java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))
|
|
|
- .atOffset(java.time.ZoneOffset.ofHours(8));
|
|
|
+ .atZone(ZONE_BEIJING).toOffsetDateTime();
|
|
|
} catch (Exception e3) {
|
|
|
return null;
|
|
|
}
|