fix: 장후 15:35~19:30 실행시 정규장 마감스냅샷 및 텔레그램 발송 지원
This commit is contained in:
@@ -114,23 +114,41 @@ object TradingReportManager : TradingReportService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. 정규장 마감 리포트 (15:35 ~ 15:45)
|
// 2. 정규장 마감 리포트 (15:35 이후 ~ 19:30 이전, 당일 마감 미발송 시 자동 캡처)
|
||||||
val endKey = "${today}_END"
|
val endKey = "${today}_END"
|
||||||
if (now.isAfter(LocalTime.of(15, 34)) && now.isBefore(LocalTime.of(15, 45))) {
|
if (now.isAfter(LocalTime.of(15, 34)) && now.isBefore(LocalTime.of(19, 30))) {
|
||||||
if (!reportedSnapshotMap.containsKey(endKey)) {
|
if (!reportedSnapshotMap.containsKey(endKey)) {
|
||||||
reportedSnapshotMap[endKey] = true
|
val alreadyExistsInDb = transaction(DatabaseFactory.reportDb) {
|
||||||
println("🏁 [Report] 15:35 정규장 마감 스냅샷 및 텔레그램 리포트 자동 실행")
|
AssetSnapshotTable.select {
|
||||||
recordAssetSnapshot(SnapshotType.END, balance, "정규장 마감 운용 스냅샷")
|
(AssetSnapshotTable.date eq today) and (AssetSnapshotTable.snapshotType eq SnapshotType.END.name)
|
||||||
|
}.count() > 0
|
||||||
|
}
|
||||||
|
if (!alreadyExistsInDb) {
|
||||||
|
reportedSnapshotMap[endKey] = true
|
||||||
|
println("🏁 [Report] 정규장 마감 스냅샷 및 텔레그램 리포트 자동 실행 (시각: $now)")
|
||||||
|
recordAssetSnapshot(SnapshotType.END, balance, "정규장 마감 운용 스냅샷")
|
||||||
|
} else {
|
||||||
|
reportedSnapshotMap[endKey] = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. 애프터 마켓(시간외) 거래 종료 마감 결산 (19:30 ~ 19:45)
|
// 3. 애프터 마켓(시간외) 거래 종료 마감 결산 (19:30 이후 ~ 당일 업무 종료)
|
||||||
val afterKey = "${today}_AFTER_CLOSE"
|
val afterKey = "${today}_AFTER_CLOSE"
|
||||||
if (now.isAfter(LocalTime.of(19, 29)) && now.isBefore(LocalTime.of(19, 45))) {
|
if (now.isAfter(LocalTime.of(19, 29))) {
|
||||||
if (!reportedSnapshotMap.containsKey(afterKey)) {
|
if (!reportedSnapshotMap.containsKey(afterKey)) {
|
||||||
reportedSnapshotMap[afterKey] = true
|
val alreadyExistsInDb = transaction(DatabaseFactory.reportDb) {
|
||||||
println("🌙 [Report] 19:30 애프터마켓(시간외) 거래 종료 최종 스냅샷 및 텔레그램 리포트 자동 실행")
|
AssetSnapshotTable.select {
|
||||||
recordAssetSnapshot(SnapshotType.AFTER_CLOSE, balance, "애프터마켓 19:30 마감 최종 결산 스냅샷")
|
(AssetSnapshotTable.date eq today) and (AssetSnapshotTable.snapshotType eq SnapshotType.AFTER_CLOSE.name)
|
||||||
|
}.count() > 0
|
||||||
|
}
|
||||||
|
if (!alreadyExistsInDb) {
|
||||||
|
reportedSnapshotMap[afterKey] = true
|
||||||
|
println("🌙 [Report] 19:30 애프터마켓(시간외) 거래 종료 최종 스냅샷 및 텔레그램 리포트 자동 실행 (시각: $now)")
|
||||||
|
recordAssetSnapshot(SnapshotType.AFTER_CLOSE, balance, "애프터마켓 19:30 마감 최종 결산 스냅샷")
|
||||||
|
} else {
|
||||||
|
reportedSnapshotMap[afterKey] = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user