...
|
...
|
@@ -141,18 +141,14 @@ public class InviteSettlementServiceImpl implements IInviteSettlementService { |
|
|
|
|
|
@VisibleForTesting
|
|
|
Pair<Integer, Integer> getTimeRangeOfMonth(String month) {
|
|
|
LocalDateTime requestMonth = null;
|
|
|
LocalDateTime start = null;
|
|
|
ZoneOffset zoneOffset = InviteSettlementUtils.zoneOffset();
|
|
|
try {
|
|
|
requestMonth = LocalDateTime.parse(month, DateTimeFormatter.ofPattern("yyyyMM"));
|
|
|
start = LocalDateTime.parse(month + "01 00:00:00", DateTimeFormatter.ofPattern("yyyyMMdd HH:mm:ss"));
|
|
|
} catch (Exception e) {
|
|
|
throwServiceException("日期格式不正确");
|
|
|
}
|
|
|
ZoneOffset zoneOffset = ZoneOffset.of("+8");
|
|
|
int startTime = (int) LocalDateTime.of(requestMonth.getYear(), requestMonth.getMonthValue(), 1, 0, 0, 0)
|
|
|
.toEpochSecond(zoneOffset);
|
|
|
int endTime = (int) LocalDateTime.of(requestMonth.getYear(), requestMonth.getMonthValue() + 1, 1, 0, 0, 0)
|
|
|
.toEpochSecond(zoneOffset) - 1;
|
|
|
return Pair.of(startTime, endTime);
|
|
|
return Pair.of((int) start.toEpochSecond(zoneOffset), (int) start.plusMonths(1).toEpochSecond(zoneOffset) - 1);
|
|
|
}
|
|
|
|
|
|
@Override
|
...
|
...
|
|