refactor(KIN09/KIN08): align Java to COBOL
- KIN09CSV: FULL outputs daily detail only; SHORT additionally emits monthly summary (matches cbl:160) - KIN08DBU: RESET deletes MONTHLY_ABSENCE only; DAILY_RECORDS preserved via plain INSERT (matches cbl:486-497) - Design docs updated to reflect COBOL-correct behavior - COBOL investigation record: remove the two design self-contradiction items (KIN09 #1, KIN08 #2) and related references
This commit is contained in:
@@ -183,8 +183,8 @@ public class Kin08DbuMain {
|
||||
// 主処理 2000MAJSOR
|
||||
// *****************************************************************
|
||||
private void majProc() {
|
||||
// 設計書(使用DBテーブル): RESET = DELETE + INSERT
|
||||
// → DAILY_RECORDS 挿入前に既存レコードを削除(stpProc 後だと PK 違反)
|
||||
// COBOL 通り: RESET は MONTHLY_ABSENCE のみ DELETE(DAILY_RECORDS は削除せず通常 INSERT)
|
||||
// ※RESET 再実行時に DAILY_RECORDS 既存行は PK 違反の可能性(COBOL も同様/運用上は事前クリア想定)
|
||||
if (resetMode) {
|
||||
resetDelete();
|
||||
}
|
||||
@@ -293,17 +293,8 @@ public class Kin08DbuMain {
|
||||
return null;
|
||||
}
|
||||
|
||||
/** RESET 時の既存レコード削除(DAILY_RECORDS + MONTHLY_ABSENCE、対象年月のみ). */
|
||||
/** RESET 時の既存レコード削除(COBOL 通り MONTHLY_ABSENCE のみ。DAILY_RECORDS は削除せず通常 INSERT). */
|
||||
private void resetDelete() {
|
||||
try (PreparedStatement ps = conn.prepareStatement(
|
||||
"DELETE FROM DAILY_RECORDS WHERE TARGET_DATE LIKE ?")) {
|
||||
ps.setString(1, yearMonth + "%");
|
||||
int n = ps.executeUpdate();
|
||||
cunDbxDel += n;
|
||||
} catch (Exception e) {
|
||||
dbError(e);
|
||||
return;
|
||||
}
|
||||
try (PreparedStatement ps = conn.prepareStatement(
|
||||
"DELETE FROM MONTHLY_ABSENCE WHERE YEAR_MONTH = ?")) {
|
||||
ps.setString(1, yearMonth);
|
||||
@@ -311,6 +302,7 @@ public class Kin08DbuMain {
|
||||
cunDbxDel += n;
|
||||
} catch (Exception e) {
|
||||
dbError(e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user