幸运数字-结算-endTime带时区格式化
This commit is contained in:
@@ -61,7 +61,6 @@ public class DateTimeUtil {
|
||||
public static final DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern(DateTimeUtil.DEFAULT_DATE_PATTERN);
|
||||
public static final DateTimeFormatter datetimeFormatter = DateTimeFormatter.ofPattern(DateTimeUtil.DEFAULT_DATETIME_PATTERN);
|
||||
public static final DateTimeFormatter dateHourFormatter = DateTimeFormatter.ofPattern(DateTimeUtil.DEFAULT_DATE_MINUTE_PATTERN);
|
||||
public static final DateTimeFormatter zoneDatetimeFormatter = DateTimeFormatter.ofPattern(DateTimeUtil.ZONE_DATETIME_PATTERN);
|
||||
public static final DateTimeFormatter hoursFormatter = DateTimeFormatter.ofPattern(DateTimeUtil.DATE_HOUR_PATTERN);
|
||||
|
||||
public static final DateTimeFormatter yyyyMMdd = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||
|
@@ -50,6 +50,8 @@ public class LuckyNumberActRoundService extends ServiceImpl<LuckyNumberActRoundM
|
||||
round.setJackpot(BigDecimal.ZERO);
|
||||
round.setLastJackpot(BigDecimal.ZERO);
|
||||
round.setLuckyNumber(null);
|
||||
round.setLuckyPlayerNumber(null);
|
||||
round.setEndTime(null);
|
||||
round.setCreateTime(now);
|
||||
round.setUpdateTime(now);
|
||||
|
||||
|
@@ -48,6 +48,7 @@ import org.springframework.util.StringUtils;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.*;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -128,7 +129,7 @@ public class LuckyNumberActService {
|
||||
vo.setPartitionId(round.getPartitionId());
|
||||
vo.setLuckyNumber(round.getLuckyNumber());
|
||||
|
||||
ZonedDateTime zdt = ZonedDateTime.parse(round.getEndTime(), DateTimeUtil.zoneDatetimeFormatter);
|
||||
ZonedDateTime zdt = ZonedDateTime.parse(round.getEndTime(), DateTimeFormatter.ISO_ZONED_DATE_TIME);
|
||||
vo.setEndTime(zdt.format(DateTimeUtil.dateHourFormatter));
|
||||
|
||||
return vo;
|
||||
@@ -157,7 +158,7 @@ public class LuckyNumberActService {
|
||||
LuckyNumberActRoundInputVo vo = new LuckyNumberActRoundInputVo();
|
||||
vo.setDate(record.getDate());
|
||||
|
||||
ZonedDateTime zdt = ZonedDateTime.parse(round.getEndTime(), DateTimeUtil.zoneDatetimeFormatter);
|
||||
ZonedDateTime zdt = ZonedDateTime.parse(round.getEndTime(), DateTimeFormatter.ISO_ZONED_DATE_TIME);
|
||||
vo.setEndTime(zdt.format(DateTimeUtil.dateHourFormatter));
|
||||
|
||||
vo.setLuckyNumber(round.getLuckyNumber());
|
||||
@@ -327,7 +328,7 @@ public class LuckyNumberActService {
|
||||
}
|
||||
|
||||
String endTime = LocalDateTime.of(LocalDate.parse(date, DateTimeUtil.dateFormatter), config.getRoundEndTime())
|
||||
.atZone(ZoneId.of(partitionEnum.getZoneId())).format(DateTimeUtil.zoneDatetimeFormatter);
|
||||
.atZone(ZoneId.of(partitionEnum.getZoneId())).format(DateTimeFormatter.ISO_ZONED_DATE_TIME);
|
||||
if (!roundService.saveLuckyNumber(date, partitionId, luckyNumber, luckyerMap.size(), endTime)){
|
||||
log.error("[luckyNumber] saveLuckyNumber failure !!! date {} partitionId {} luckyNumber {}", luckyNumber, date, partitionId);
|
||||
throw new ServiceException(BusiStatus.SERVERBUSY);
|
||||
|
Reference in New Issue
Block a user