# Business Logic — JBSbatKKDelSavePrdKikData.execute() [3076 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKDelSavePrdKikData` |
| Layer | Batch Service |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKDelSavePrdKikData.execute()

This method implements the core batch processing routine for **physically deleting expired data** from the K-Opticom customer base system. It is a batch-oriented data retention management service that systematically purges personal information and related contractual, billing, and logistical data whose storage period has elapsed. The method operates in a two-phase approach: first it gathers all deletion target keys from the staging table `KK_T_KJNIFDEL_WK`, then it traverses the entire related data graph to locate and physically delete every child record across **50+ database tables**. The method uses a **routing/dispatch pattern** where each relational table is queried through generated SQL access methods, and a **delegation pattern** where it delegates physical deletion to helper methods (`deleteSchema`, `delSqlRun`, `delRecOutput`). It processes data in multi-thread-safe branches using a maximum duplicate processing branch number (`tran_SeqMax`), and enforces execution time limits via `chkTrnLimitTime()`. The method plays a critical role in the larger system as the primary GDPR/personal data compliance mechanism — ensuring that when a contract cancellation is confirmed, all traces of the customer's personal information are purged across the entire operational database, while logging deletion results into the major item deletion record table `KK_T_MAJOR_KMK_DLJSK` for audit purposes.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["execute()"])
    START --> CHECK_TIME["chkTrnLimitTime()"]
    CHECK_TIME -->|exceeded| RETURN1["return null"]
    CHECK_TIME -->|ok| MAIN_LOOP["for i=0 to tran_SeqMax"]
    MAIN_LOOP --> INIT["Initialize key ArrayLists"]
    INIT --> DEL_CHK["executeKK_T_KOJIN_INFO_DEL_KK_SELECT_023"]
    DEL_CHK --> IS_DEL{"delete target already deleted?"}
    IS_DEL -->|Yes| SKIP["deletedFlag=true"]
    IS_DEL -->|No| CHK_UPD["chkUpdTime()"]
    CHK_UPD --> NEXT_FLG{"nextFlag?"}
    NEXT_FLG -->|true| SKIP
    NEXT_FLG -->|false| FETCH_KEYS["Fetch deletion keys from KK_T_KJNIFDEL_WK"]
    FETCH_KEYS --> KEY_CHAIN["Get keys for all ~50+ related tables"]
    KEY_CHAIN --> REL_CHECKS["delPsbChk relational checks"]
    REL_CHECKS --> MAJOR_REC["Create deletion records"]
    MAJOR_REC --> EXPORT["CreateHeader + CSV output"]
    EXPORT --> PHYS_DEL["Physical deletion: deleteSchema + delSqlRun"]
    PHYS_DEL --> UPDATE_DEL["Update KK_T_KOJIN_INFO_DEL status"]
    UPDATE_DEL --> CHECK_TIME2["chkTrnLimitTime()"]
    CHECK_TIME2 -->|exceeded| RETURN2["return null"]
    CHECK_TIME2 -->|ok| LOOP_END{"loop complete?"}
    LOOP_END -->|no| INIT
    LOOP_END -->|yes| COMMIT["super.commit()"]
    COMMIT --> END(["END"])
```

**CRITICAL — Constant Resolution:**

| Constant | Actual Value | Business Meaning |
|----------|-------------|-----------------|
| `DEL_STAT_END` | `"100"` | Personal Info Deletion Status: Deleted (complete) |
| `DEL_STAT_NOT_END` | `"030"` | Personal Info Deletion Status: Not Deleted (in progress) |
| `DELSTOP_CD` | `"1"` | DB Insert/Update/Delete Prevention Code: Prevention Enabled |
| `MAJOR_MSKM_CD` | `"01"` | Major Item Type Code: Subscription Number |
| `MAJOR_KOJIAK_CD` | `"02"` | Major Item Type Code: Work Case Number |
| `MSKM_CANCEL_CD` | `"920"` | Subscription Detail Status: Cancelled |
| `MSKM_HAKI_CD` | `"10"` | Subscription Cancel Reason Code: Application Rejection |
| `MSKM_TRKS_CD` | `"20"` | Subscription Cancel Reason Code: Cancellation (Correct) |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no parameters; it reads instance fields set by `initial()` and inherited base class state |

**Instance fields and external state read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `super.commonItem` | `JBSbatCommonItem` | Batch common parameter document - carries operation date, user ID, work parameters |
| `tran_No` | `String` | Multi-thread processing number - thread-safe branch identifier from free items |
| `tran_SeqMax` | `int` | Maximum duplicate processing branch number - max number of parallel processing branches |
| `strTrnLimit` | `String` | Deletion process upper limit time (in minutes) - max execution duration per batch run |
| `runCnt` | `String` | Run count from 4th free item parameter - used for multiple daily batch execution support |
| `delStopFlg` | `boolean` | Deletion prevention flag - when true, skips all destructive DB operations |
| `deletedFlag` | `boolean` | Per-branch deletion complete flag - tracks whether this branch's data was already deleted |
| `nextFlag` | `boolean` | Next process flag - used to skip branches that should advance to next |
| `super.opeDate` | `String` | Batch operation date - the processing date for all operations |
| `batchUserId` | `String` | Batch user ID - the operator account for audit trail |
| `delRecordOutFile` | `JBSbatBusinessFileUtil` | Physical deletion record export file - CSV file for logging deleted records |
| `excludeKktkSvcKeiNoList` | `ArrayList<String>` | Exclude machine provision service contract number list - for OM-2021-0000292 machine inheritance support |

## 4. CRUD Operations / Called Services

### Pre-computed evidence from code analysis:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `executeKK_T_KOJIN_INFO_DEL_KK_SELECT_023` | - | `KK_T_KOJIN_INFO_DEL` | Check deletion status of personal info deletion work |
| D | `executeKK_T_KOJIN_INFO_DEL_PKDELETE` | - | `KK_T_KOJIN_INFO_DEL` | Delete deletion target data from personal info deletion table (guarded by delStopFlg) |
| R | `executeKK_T_KJNIFDEL_WK_KK_SELECT_001` | - | `KK_T_KJNIFDEL_WK` | Fetch all deletion target data keys from work table |
| R | `executeKK_T_KJNIFDEL_WK_KK_SELECT_003` | - | `KK_T_KJNIFDEL_WK` | Fetch max duplicate processing branch number |
| R | `executeKK_T_KJNIFDEL_WK_KK_SELECT_004` | - | `KK_T_KJNIFDEL_WK` | Fetch service contract numbers |
| R | `executeKK_T_KJNIFDEL_WK_KK_SELECT_005` | - | `KK_T_KJNIFDEL_WK` | Fetch billing contract numbers (non-zero) |
| R | `executeKK_T_KJNIFDEL_WK_KK_SELECT_006` | - | `KK_T_KJNIFDEL_WK` | Fetch SYSID values (non-zero) |
| R | `executeKK_T_KJNIFDEL_WK_KK_SELECT_007` | - | `KK_T_KJNIFDEL_WK` | Fetch billing contract + service contract pairs |
| R | `executeAC_T_HAPIEPOINT_HKAT_KK_SELECT_002` | - | `AC_T_HAPIEPOINT_HKAT` | Fetch happy e-point assignment review numbers |
| R | `executeAC_T_HAPIEPOINT_UCWK_KK_SELECT_001` | - | `AC_T_HAPIEPOINT_UCWK` | Fetch happy e-point contract numbers |
| R | `executeCH_T_SAIKEN_KK_SELECT_001` | - | `CH_T_SAIKEN` | Fetch collateral (guarantee) numbers |
| R | `executeCH_T_JUTO_KK_SELECT_001` | - | `CH_T_JUTO` | Fetch payment account numbers via collateral |
| R | `executeCH_T_SEIKY_SKN_KNRN_KK_SELECT_001` | - | `CH_T_SEIKY_SKN_KNRN` | Fetch billing numbers via collateral |
| R | `executeCH_T_TOKUSK_SKN_KNRN_KK_SELECT_001` | - | `CH_T_TOKUSK_SKN_KNRN` | Fetch collection numbers via collateral |
| R | `executeCR_T_TAIO_KIROK_KK_SELECT_001` | - | `CR_T_TAIO_KIROK` | Fetch response record numbers |
| R | `executeKK_T_SVC_KEI_UCWK_KK_SELECT_080` | - | `KK_T_SVC_KEI_UCWK` | Fetch service contract detail numbers |
| R | `executeKK_T_KKTK_SVC_KEI_KK_SELECT_100` | - | `KK_T_KKTK_SVC_KEI` | Fetch machine provision service contract numbers |
| R | `executeKK_T_KKTK_SVC_KEI_KK_SELECT_121` | - | `KK_T_KKTK_SVC_KEI` | Fetch machine provision service contract numbers via kaisen ucwk |
| R | `executeKK_T_KKTK_SVC_KEI_KK_SELECT_122` | - | `KK_T_KKTK_SVC_KEI` | Fetch machine provision service contract numbers (alternate) |
| R | `executeKK_T_KAISEN_TG_SVKEI_KK_SELECT_025` | - | `KK_T_KAISEN_TG_SVKEI` | Fetch service contract withdrawal detail numbers |
| R | `executeKK_T_SVKEI_GRP_SETE_KK_SELECT_001` | - | `KK_T_SVKEI_GRP_SETE` | Fetch service contract group settings |
| R | `executeKK_T_OP_SVC_KEI_KK_SELECT_078` | - | `KK_T_OP_SVC_KEI` | Fetch option service contract numbers |
| R | `executeKK_T_OP_SVC_KEI_KK_SELECT_079` | - | `KK_T_OP_SVC_KEI` | Fetch option service contract numbers (with detail) |
| R | `executeKK_T_SBOP_SVC_KEI_KK_SELECT_020` | - | `KK_T_SBOP_SVC_KEI` | Fetch sub-option service contract numbers |
| R | `executeKK_T_SBOP_SVC_KEI_KK_SELECT_021` | - | `KK_T_SBOP_SVC_KEI` | Fetch sub-option service contract numbers (with detail) |
| R | `executeKK_T_SEIOPSVC_KEI_KK_SELECT_014` | - | `KK_T_SEIOPSVC_KEI` | Fetch billing option service contract numbers |
| R | `executeKK_T_SEIOPSVC_KEI_KK_SELECT_015` | - | `KK_T_SEIOPSVC_KEI` | Fetch billing option service contract numbers (with detail) |
| R | `executeKK_T_KKOP_SVC_KEI_KK_SELECT_016` | - | `KK_T_KKOP_SVC_KEI` | Fetch machine option service contract numbers |
| R | `executeKK_T_KKOP_SVC_KEI_KK_SELECT_017` | - | `KK_T_KKOP_SVC_KEI` | Fetch machine option service contract numbers (with detail) |
| R | `executeKK_T_DCHSKMST_TG_KEI_KK_SELECT_007` | - | `KK_T_DCHSKMST_TG_KEI` | Fetch data extraction item setting target contract numbers |
| R | `executeKK_T_HAPIE_POINT_KEI_KK_SELECT_008` | - | `KK_T_HAPIE_POINT_KEI` | Fetch happy e-point contract numbers via SYSID |
| R | `executeKK_T_JUDGE_KK_SELECT_005` | - | `KK_T_JUDGE` | Fetch review/audit numbers |
| R | `executeKK_T_SEIKY_KEI_KK_SELECT_053` | - | `KK_T_SEIKY_KEI` | Fetch billing contract numbers (payment methods) |
| R | `executeKK_T_SEIKY_KEI_KK_SELECT_057` | - | `KK_T_SEIKY_KEI` | Fetch billing subscription detail numbers |
| R | `executeKK_T_SEIKY_KEI_KK_SELECT_058` | - | `KK_T_SEIKY_KEI` | Fetch migration division from billing contract |
| R | `executeKK_T_SEIKY_KEI_KK_SELECT_221` | - | `KK_T_SVC_KEI` | Fetch migration division from service contract |
| R | `executeKK_T_SUPPORT_KK_SELECT_003` | - | `KK_T_SUPPORT` | Fetch support numbers |
| R | `executeKK_T_TAJGSWKEI_TGKEI_KK_SELECT_004` | - | `KK_T_TAJGSWKEI_TGKEI` | Fetch other business provider discount contract target numbers |
| R | `executeKK_T_TAJGS_WRIB_KEI_KK_SELECT_002` | - | `KK_T_TAJGS_WRIB_KEI` | Fetch other business provider discount contract numbers |
| R | `executeKK_T_TCHI_TG_BPIN_KK_SELECT_006` | - | `KK_T_TCHI_TG_BPIN` | Fetch notification target object numbers |
| R | `executeKK_T_WRISVC_TG_KEI_KK_SELECT_028` | - | `KK_T_WRISVC_TG_KEI` | Fetch discount service target contract numbers |
| R | `executeKK_T_WRIB_SVC_KEI_KK_SELECT_037` | - | `KK_T_WRIB_SVC_KEI` | Fetch discount service contract numbers |
| R | `executeKK_T_KAP_KEI_KK_SELECT_009` | - | `KK_T_KAP_KEI` | Fetch franchise contract numbers |
| R | `executeDK_T_BTRYHOZN_KK_SELECT_001` | - | `DK_T_BTRYHOZN` | Fetch logistics preservation numbers |
| R | `executeDK_T_HAISO_TG_BPIN_KK_SELECT_004` | - | `DK_T_HAISO_TG_BPIN` | Fetch delivery target product numbers |
| R | `executeDK_T_HAISO_TG_DOHUBT_KK_SELECT_002` | - | `DK_T_HAISO_TG_DOHUBT` | Fetch delivery target package numbers |
| R | `executeDK_T_HIS_SJI_REQ_DTL_KK_SELECT_001` | - | `DK_T_HIS_SJI_REQ_DTL` | Fetch delivery instruction request detail numbers |
| R | `executeDK_T_SHKA_KIHON_INFO_KK_SELECT_001` | - | `DK_T_SHKA_KIHON_INFO` | Fetch shipment route (basic info) numbers |
| R | `executeDK_T_SHKA_FIN_DTL_KK_SELECT_001` | - | `DK_T_SHKA_FIN_DTL` | Fetch shipment completion detail numbers |
| R | `executeDK_T_MKHMPIN_KK_SELECT_001` | - | `DK_T_MKHMPIN` | Fetch memo return numbers |
| R | `executeKU_T_SVKEI_KOJIAK_KK_SELECT_011` | - | `KU_T_SVKEI_KOJIAK` | Fetch service contract_ work case numbers |
| R | `executeKU_T_KOJIAK_KK_SELECT_021` | - | `KU_T_KOJIAK` | Fetch work case detail info |
| R | `executeTU_T_DNWACHOMSK_KK_SELECT_002` | - | `TU_T_DNWACHOMSK` | Fetch phone bill subscription numbers |
| R | `executeKK_T_ADCHG_KK_SELECT_022` | - | `KK_T_ADCHG` | Fetch address change numbers |
| R | `executeKK_T_SVC_KEI_KK_SELECT_217` | - | `KK_T_SVC_KEI` | Fetch service contract subscription detail numbers |
| R | `executeKK_T_SVC_KEI_KK_SELECT_221` | - | `KK_T_SVC_KEI` | Fetch migration division from service contract |
| R | `executeKK_T_SVC_KEI_UCWK_KK_SELECT_081` | - | `KK_T_SVC_KEI_UCWK` | Fetch service contract detail subscription detail numbers |
| R | `executeKK_T_SVKEI_KAISEN_UW_KK_SELECT_034` | - | `KK_T_SVKEI_KAISEN_UW` | Fetch service contract withdrawal detail subscription detail numbers |
| R | `executeKK_T_MSKM_KK_SELECT_010` | - | `KK_T_MSKM` | Fetch subscription numbers |
| R | `executeKK_T_KJNIFDEL_WK_KK_SELECT_001` | - | `KK_T_KJNIFDEL_WK` | Fetch deletion target data keys (final update) |
| U | `executeKK_T_KOJIN_INFO_DEL_KK_UPDATE_004` | - | `KK_T_KOJIN_INFO_DEL` | Update deletion status to completed (guarded by delStopFlg) |
| C | `executeKK_T_MAJOR_KMK_DLJSK_PKINSERT` | - | `KK_T_MAJOR_KMK_DLJSK` | Insert major item deletion record (guarded by delStopFlg) |
| C | `addShijishoInf` | - | `CK_T_SJISHO` | Register instruction notice information |
| - | `deleteSchema` | - | `KK_M_KJNIFDEL_TGSCM` | Get schema info for physical deletion |
| - | `delSqlRun` | - | Various | Execute physical deletion SQL across all schemas |
| - | `createHeader` | - | - | Create CSV export header |
| - | `delPsbChk` | - | - | Relational check - remove keys without referenced data |
| - | `delPsbChkSvcKeiKaisenUcwkNo` | - | - | Service contract withdrawal ucwk no relational check |
| - | `delPsbChkKktkSvcKeiNo` | - | - | Machine provision service contract no relational check |
| - | `mskmdelPsbChk` | - | - | Subscription detail number exclusion check |
| - | `JKKBatCommon.getFormatedNextSeq` | JCCBatCommon | - | Generate formatted next sequence number |
| - | `JKKBatCommon.getSysDateTimeStamp` | JCCBatCommon | - | Get system date-time stamp |
| - | `JCCBatCommon.createBusinessFileUtil` | JCCBatCommon | - | Create business file utility for CSV export |
| - | `JCCBatCommon.printBusinessFileUtil` | JCCBatCommon | - | Print business file header row |
| - | `JBSbatBusinessService.commit` | JBSbatBusinessService | JBSbatBusiness | Commit DB transaction |
| - | `chkTrnLimitTime` | JBSbatKKDelSavePrdKikData | - | Check if processing time limit exceeded |
| - | `chkUpdTime` | JBSbatKKDelSavePrdKikData | - | Check update timestamp |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatKKDelSavePrdKikData | (Entry point - batch scheduler) | ~50+ table deletions + KK_T_MAJOR_KMK_DLJSK insert |

This method is a **batch entry point** invoked directly by the batch scheduler. It is not called from any screen or CBS. It is part of the "saved period expired data physical deletion" batch job (v1.00.00 - 2012/09/20).

## 6. Per-Branch Detail Blocks

**Block 1** — IF (time limit check) (L~1130)

Check if processing time limit exceeded. If yes, exit early.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `chkTrnLimitTime()` // Check if deletion processing time limit exceeded |
| 2 | RETURN | `return null` // Exit batch if time limit exceeded [-> DEL_RUN_UPPL_TIM="KK_DEL_RUNUPPL_TIME"] |

**Block 2** — FOR LOOP (multi-thread processing branches) (L~1136)

Main processing loop iterating over all duplicate processing branches (0 to `tran_SeqMax`).

| # | Type | Code |
|---|------|------|
| 1 | SET | `tran_No = JPCEditString.fillZero(tran_No, 2, false)` // Zero-padded transaction number [-> SEQ_LEN_SEQ_SEIKY_NO=12] |
| 2 | EXEC | `executeKK_T_KJNIFDEL_WK_KK_SELECT_003(edaNoParam)` // Get max duplicate branch number |
| 3 | SET | `tran_SeqMax = Integer.parseInt(edaNoList.getString(...))` // Max branch number from work table |
| 4 | EXEC | `delRecordOutFile = JCCBatCommon.createBusinessFileUtil(...)` // Create CSV output file |
| 5 | IF | `freeItems[1].equals(DELSTOP_CD)` // Check deletion prevention flag [-> DELSTOP_CD="1"] |

**Block 2.1** — FOR BODY: Initialization (L~1160)

Initialize key ArrayLists for collecting deletion target keys from each table.

| # | Type | Code |
|---|------|------|
| 1 | SET | `key_svc_kei_no = new ArrayList<String>()` // Service contract numbers |
| 2 | SET | `key_seiky_kei_no = new ArrayList<String>()` // Billing contract numbers |
| 3 | SET | `key_sysid = new ArrayList<String>()` // SYSID |
| 4 | SET | `nextFlag = false` // Reset next process flag |
| 5 | SET | `deletedFlag = false` // Reset deletion flag |
| 6 | SET | `excludeKktkSvcKeiNoList = new ArrayList<String>()` // [OM-2021-0000292] |

**Block 2.2** — IF: Already Deleted Check (L~1200)

Check if the deletion target data has already been deleted.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `executeKK_T_KOJIN_INFO_DEL_KK_SELECT_023(delChkParam)` // Query deletion status [-> DEL_STAT_NOT_END="030"] |
| 2 | IF | `db_KK_T_KOJIN_INFO_DEL.selectNext() == null` // Check if no record found (already deleted) |
| 3 | SET | `deletedFlag = true` // Mark as already deleted |
| 4 | ELSE | Skip to next branch [-> DEL_STAT_END="100"] |

**Block 2.3** — IF: Update Time Check (L~1205)

If not deleted, check if the record can be updated (not already updated by another process).

| # | Type | Code |
|---|------|------|
| 1 | IF | `deletedFlag == false` |
| 2 | CALL | `nextFlag = chkUpdTime(kjnifdelParam)` // Check update timestamp |
| 3 | SET | `kjnifdelParam[0] = svc_kei_no, [1] = seiky_kei_no, [2] = sysid` // Build deletion key params |

**Block 2.4** — IF: Delete Personal Info Records (nextFlag=true path) (L~1210)

When nextFlag is true, delete the personal info deletion work records directly.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `executeKK_T_KOJIN_INFO_DEL_PKDELETE(kjnDelParam)` // Delete deletion target [-> delStopFlg check] |
| 2 | CALL | `super.commit()` // Commit the deletion |
| 3 | IF | `!delStopFlg` // Guarded by deletion prevention flag [-> DELSTOP_CD="1"] |

**Block 2.5** — ELSE: Fetch Deletion Keys (L~1230)

Main key fetching logic: extracts keys from `KK_T_KJNIFDEL_WK` and all related tables.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `executeKK_T_KJNIFDEL_WK_KK_SELECT_004(kjnifdelParam)` // Get SVC_KEI_NO |
| 2 | CALL | `executeKK_T_KJNIFDEL_WK_KK_SELECT_005(kjnifdelParam)` // Get SEIKY_KEI_NO |
| 3 | CALL | `executeKK_T_KJNIFDEL_WK_KK_SELECT_006(kjnifdelParam)` // Get SYSID |
| 4 | CALL | `executeKK_T_KJNIFDEL_WK_KK_SELECT_007(kjnifdelParam_2)` // Get SEIKY+SVC pairs |
| 5 | EXEC | `JCCBatCommon.printBusinessFileUtil(delRecordOutFile, createHeader(...))` // Write CSV header |

**Block 2.6** — RELATIONAL KEY FETCH (L~1280-2500)

Fetch keys from ~50+ related tables in a chain pattern. Each follows the same structure:

| # | Type | Code |
|---|------|------|
| 1 | FOR | Loop over `key_svc_kei_no` or derived list |
| 2 | CALL | `execute<TABLE>_KK_SELECT_XXX(keyParam)` |
| 3 | WHILE | `db_<TABLE>.selectNext() != null` |
| 4 | SET | `key_<name>.add(selList.getString(...))` |
| 5 | SET | `super.logPrint.printDebugLog(...)` |

Sub-blocks for each table category:
- **Block 2.6.1**: Happy e-point assignment review (`AC_T_HAPIEPOINT_HKAT`)
- **Block 2.6.2**: Happy e-point contract (`AC_T_HAPIEPOINT_UCWK`)
- **Block 2.6.3**: Collateral (`CH_T_SAIKEN`)
- **Block 2.6.4**: Payment (`CH_T_JUTO`)
- **Block 2.6.5**: Billing collateral (`CH_T_SEIKY_SKN_KNRN`)
- **Block 2.6.6**: Collection (`CH_T_TOKUSK_SKN_KNRN`)
- **Block 2.6.7**: Response record (`CR_T_TAIO_KIROK`)
- **Block 2.6.8**: Service contract detail (`KK_T_SVC_KEI_UCWK`)
- **Block 2.6.9**: Machine provision (`KK_T_KKTK_SVC_KEI`)
- **Block 2.6.10**: Service contract withdrawal (`KK_T_KAISEN_TG_SVKEI`)
- **Block 2.6.11**: Option service (`KK_T_OP_SVC_KEI`)
- **Block 2.6.12**: Sub-option service (`KK_T_SBOP_SVC_KEI`)
- **Block 2.6.13**: Billing option service (`KK_T_SEIOPSVC_KEI`)
- **Block 2.6.14**: Machine option service (`KK_T_KKOP_SVC_KEI`)
- **Block 2.6.15**: Data extraction target (`KK_T_DCHSKMST_TG_KEI`)
- **Block 2.6.16**: Happy e-point contract (`KK_T_HAPIE_POINT_KEI`)
- **Block 2.6.17**: Review (`KK_T_JUDGE`)
- **Block 2.6.18**: Billing contract (`KK_T_SEIKY_KEI`)
- **Block 2.6.19**: Support (`KK_T_SUPPORT`)
- **Block 2.6.20**: Other business discount (`KK_T_TAJGS_WRIB_KEI`)
- **Block 2.6.21**: Notification target (`KK_T_TCHI_TG_BPIN`)
- **Block 2.6.22**: Discount service (`KK_T_WRISVC_TG_KEI`)
- **Block 2.6.23**: Logistics (`DK_T_BTRYHOZN`)
- **Block 2.6.24**: Delivery (`DK_T_HAISO_TG_BPIN`)
- **Block 2.6.25**: Delivery target package (`DK_T_HAISO_TG_DOHUBT`)
- **Block 2.6.26**: Delivery instruction (`DK_T_HIS_SJI_REQ_DTL`)
- **Block 2.6.27**: Shipment route (`DK_T_SHKA_KIHON_INFO`)
- **Block 2.6.28**: Memo return (`DK_T_MKHMPIN`)
- **Block 2.6.29**: Shipment completion (`DK_T_SHKA_FIN_DTL`)
- **Block 2.6.30**: Work case (`KU_T_SVKEI_KOJIAK`)
- **Block 2.6.31**: Phone bill (`TU_T_DNWACHOMSK`)
- **Block 2.6.32**: Address change (`KK_T_ADCHG`)

**Block 2.7** — RELATIONAL CHECKS (L~1490-1510)

Remove keys that have no corresponding referenced data. Each follows:

| # | Type | Code |
|---|------|------|
| 1 | IF | `key_<name>.size() != 0` |
| 2 | SET | `key_<name> = delPsbChk(key_<name>, key_<parent>, rel_db_<table>, rel_clm_<parent>)` |
| 3 | IF | `key_kktk_svc_kei_no.size() != 0` |
| 4 | SET | `key_kktk_svc_kei_no = delPsbChkKktkSvcKeiNo(key_kktk_svc_kei_no)` // [OM-2021-0000292] |

**Block 2.8** — MAJOR ITEM DELETION RECORD: Path 1 (L~1820)

Create deletion records for billing contract-based subscription detail numbers.

| # | Type | Code |
|---|------|------|
| 1 | FOR | Loop over `key_seiky_kei_no_svc_kei_no` pairs |
| 2 | CALL | `executeKK_T_SEIKY_KEI_KK_SELECT_058(idoParam)` // Get migration division |
| 3 | CALL | `executeKK_T_SEIKY_KEI_KK_SELECT_057(seiParam)` // Get subscription detail |
| 4 | CALL | `executeKK_T_SEIOPSVC_KEI_KK_SELECT_015(seiParam)` // Get billing option subscription |
| 5 | FOR | Nested loops for discount service + data extraction items |
| 6 | SET | `Collections.sort(main_mskm_ido)` // Sort by subscription detail + migration |
| 7 | CALL | `mskmdelPsbChk(main_mskm_ido, ..., D_TBL_NAME_KK_T_SVC_KEI, "SVC_KEI_NO")` // [IT2-2015-0000020] |
| 8 | IF | `!delStopFlg` [-> DELSTOP_CD="1"] |
| 9 | CALL | `insertKK_T_MAJOR_KMK_DLJSK(main_mskm_ido, ...)` // Insert major item record |
| 10 | SET | `mskmCnt++` // Increment subscription record counter |

**Block 2.9** — MAJOR ITEM DELETION RECORD: Path 2 (L~1900)

Create deletion records for service contract-based subscription detail numbers.

| # | Type | Code |
|---|------|------|
| 1 | FOR | Loop over `key_svc_kei_no` |
| 2 | CALL | `executeKK_T_SVC_KEI_KK_SELECT_221(idoParam)` // Get migration division |
| 3 | CALL | `executeKK_T_SVC_KEI_KK_SELECT_217(svcParam)` // Get service contract subscription detail |
| 4 | CALL | `executeKK_T_SVC_KEI_UCWK_KK_SELECT_081(svcParam)` // Get service contract detail subscription |
| 5 | CALL | `executeKU_T_KOJIAK_KK_SELECT_021(mainParam)` // Get work case detail |
| 6 | FOR | Nested loops for all contract types: service, detail, withdrawal, machine provision, option, sub-option, billing option, discount, data extraction, other discount, franchise |
| 7 | SET | `Collections.sort(main_mskm_ido)` // Sort |
| 8-21 | CALL | `mskmdelPsbChk(main_mskm_ido, ..., <TABLE>, "<COL>")` for ~14 exclusion tables [IT2-2015-0000020] |
| 22 | IF | `!delStopFlg` [-> DELSTOP_CD="1"] |
| 23 | CALL | `executeKK_T_MAJOR_KMK_DLJSK_PKINSERT(inParam)` // Insert major item deletion record |
| 24 | SET | `kojiCnt++` // Increment work case record counter |

**Block 2.10** — PHYSICAL DELETION (L~2520-3100)

Systematically delete records across all schemas based on collected keys.

| # | Type | Code |
|---|------|------|
| 1 | SET | `delSchemaList = deleteSchema(tgtSchParam)` // Get schema for MSKM_DTL_NO |
| 2 | CALL | `delSqlRun(delSchemaList, key_mskm_dtl_no)` // Execute physical deletion |
| 3 | FOR | Loop over `key_mskm_no_cnt` to get subscription numbers |
| 4 | CALL | `executeKK_T_MSKM_KK_SELECT_010(keyParam)` // Get subscription numbers |
| 5 | CALL | `addShijishoInf(key_sysid, ...)` // Register instruction notice [ANK-2711-00-00] |
| 6 | CALL | `executeKK_T_ADCHG_KK_SELECT_022(...)` // Get address change numbers [IT1-2015-0000054] |

**Block 2.10.1** — Schema-based deletions (repeated ~30+ times)

Each follows the same pattern:

| # | Type | Code |
|---|------|------|
| 1 | SET | `searchParam[0] = "<COLUMN_NAME>"` // Column to search by |
| 2 | SET | `searchParam[5] = opeDate` // Batch operation date |
| 3 | CALL | `deleteSchema(searchParam)` // Get deletion schema |
| 4 | CALL | `delSqlRun(delSchemaList, key_<name>_no)` // Execute physical deletion |

Key deletion targets: `MSKM_NO`, `SYSID`, `GRP_LEADER_SYSID`, `OP_SVC_KEI_NO`, `SVC_KEI_KAISEN_UCWK_NO`, `SVC_KEI_UCWK_NO`, `SVC_KEI_NO`, `SBOP_SVC_KEI_NO`, `SUPPORT_NO`, `DCHSKMST_NO`, `HAPIEPOINT_HKSI_NO`, `HAPIEPOINT_KEI_NO`, `HAPIE_POINT_KEI_NO`, `MKRHMPIN_NO`, `WRIB_SVC_KEI_NO`, `KKTK_SVC_KEI_NO`, `KNK_NO`, `KOJIAK_NO`, `SAIKEN_NO`, `SHUKKA_LOT_NO`, `SHUKKA_FIN_NO`, `JUDGE_NO`, `SEIOPSVC_KEI_NO`, `SEIKY_KEI_NO`, `SEIKY_WAY_NO_CRECARD`, `SEIKY_WAY_NO_KOZA`, `TAJGS_WRIB_KEI_NO`, `TAIO_KIROK_NO`, `TCHISHO_NO`, `DNWACHO_MSKM_NO`, `TOKUSOKU_NO`, `NYUKIN_NO`, `HAISO_NO`, `HAISO_SJI_REQ_NO`, `BTRYHOZN_NO`, `RENKEI_DATA_3`, `SEIKY_NO`, `HIKIATE_SVC_KEI_NO`, `MAP_CUST_PST_DTL_SKVAL`, `KKOP_SVC_KEI_NO`, `ADCHG_NO`

**Block 2.11** — Final Status Update (L~3100)

After all physical deletions, update the personal info deletion work table status to "deleted".

| # | Type | Code |
|---|------|------|
| 1 | CALL | `executeKK_T_KJNIFDEL_WK_KK_SELECT_001(kjnifdelParam)` // Re-fetch deletion targets |
| 2 | WHILE | `delList != null` |
| 3 | SET | `upParam[0] = DEL_STAT_END` // Status = "100" (deleted) |
| 4 | SET | `upParam[1] = opeDate` // Operation date |
| 5 | SET | `upParam[2] = JKKBatCommon.getSysDateTimeStamp()` // Timestamp |
| 6 | IF | `!delStopFlg` [-> DELSTOP_CD="1"] |
| 7 | CALL | `executeKK_T_KOJIN_INFO_DEL_KK_UPDATE_004(upParam)` // Update status |
| 8 | SET | `kjnCnt++` // Increment personal info deletion count |
| 9 | CALL | `super.commit()` // Final commit |
| 10 | IF | `chkTrnLimitTime()` [-> DEL_RUN_UPPL_TIM="KK_DEL_RUNUPPL_TIME"] |
| 11 | RETURN | `return null` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service Contract Number — primary identifier for a customer's service contract (e.g., fiber, mobile, TV subscription) |
| `seiky_kei_no` | Field | Billing Contract Number — identifier for a billing arrangement associated with service contracts |
| `sysid` | Field | SYSID — unique system identifier for a customer, used as a primary link across personal data tables |
| `mskm_dtl_no` | Field | Subscription Detail Number — detailed identifier for a subscription line item within a subscription |
| `mskm_no` | Field | Subscription Number — primary identifier for a subscription |
| `kojia_no` | Field | Work Case Number — identifier for a service work case (installation, repair, etc.) |
| `saiken_no` | Field | Collateral/Guarantee Number — identifier for a financial guarantee/collateral record |
| `jukin_no` | Field | Payment Account Number — identifier for a bank payment account |
| `seiky_no` | Field | Billing Number — identifier for an individual billing invoice |
| `tokusoku_no` | Field | Collection Number — identifier for a collection record (late payment follow-up) |
| `kktk_svc_kei_no` | Field | Machine Provision Service Contract Number — contract number for device/machine rental services (e.g., set-top box, router) |
| `kkop_svc_kei_no` | Field | Machine Option Service Contract Number — contract number for optional machine-related services |
| `op_svc_kei_no` | Field | Option Service Contract Number — contract number for optional add-on services |
| `sbop_svc_kei_no` | Field | Sub-Option Service Contract Number — contract number for sub-option (nested) services |
| `seiopsvc_kei_no` | Field | Billing Option Service Contract Number — contract number for billing-related optional services |
| `wrib_svc_kei_no` | Field | Discount Service Contract Number — contract number for discount/price-reduction agreements |
| `haiso_no` | Field | Delivery Number — identifier for a delivery record |
| `shukka_lot_no` | Field | Shipment Route/Lot Number — identifier for a shipment batch |
| `shukka_fin_no` | Field | Shipment Completion Detail Number — identifier for shipment completion records |
| `btryhozn_no` | Field | Logistics Preservation Number — identifier for logistics custody records |
| `mkrimp_no` | Field | Memo Return Number — identifier for memo return records (equipment returns) |
| `tchi_no` | Field | Notification Target Number — identifier for notification target objects |
| `adchg_no` | Field | Address Change Number — identifier for address change records |
| `hapi_point_kei_no` | Field | Happy e-Point Contract Number — contract number for loyalty point rewards program |
| `hapi_point_hksi_no` | Field | Happy e-Point Assignment Review Number — review identifier for point assignment |
| `taio_kirok_no` | Field | Response Record Number — identifier for customer response/contact records |
| `seiky_way_no_koza` | Field | Payment Method Number (Bank Account) — payment method: bank transfer account |
| `seiky_way_no_crecard` | Field | Payment Method Number (Credit Card) — payment method: credit card |
| `dchskmst_no` | Field | Data Extraction Item Setting Number — configuration for data extraction criteria |
| `judge_no` | Field | Review/Audit Number — identifier for review/audit records |
| `support_no` | Field | Support Number — identifier for customer support records |
| `tajgs_wrib_kei_no` | Field | Other Business Provider Discount Contract Number — discount contract for third-party service partnerships |
| `svc_kei_ucwk_no` | Field | Service Contract Detail Number — detailed identifier for a service contract line |
| `svc_kei_kaisen_ucwk_no` | Field | Service Contract Withdrawal Detail Number — detail for withdrawal/cancellation lines |
| `grp_leader_sysid` | Field | Group Leader SYSID — SYSID of the group leader in a customer group |
| `del_stat` | Field | Deletion Status — "100" = deleted, "030" = not deleted (pending) |
| `tran_seq` | Field | Transaction Sequence Number — branch number within a multi-thread processing batch |
| `del_stop_flg` | Field | Deletion Prevention Flag — when set, prevents all destructive DB operations (for compliance hold) |
| `KK_T_KJNIFDEL_WK` | Table | Personal Info Deletion Work Table — staging table holding deletion targets |
| `KK_T_KOJIN_INFO_DEL` | Table | Personal Info Deletion Table — tracks deletion status of personal info |
| `KK_T_SVC_KEI` | Table | Service Contract Table — primary service contract master |
| `KK_T_MAJOR_KMK_DLJSK` | Table | Major Item Deletion Record Table — audit trail for major item deletion operations |
| `KK_M_KJNIFDEL_TGSCM` | Table | Personal Info Deletion Target Schema Table — defines which schemas to delete from |
| `CK_T_SJISHO` | Table | Instruction Notice Table — instruction/directive notice records |
| `AC_T_HAPIEPOINT_HKAT` | Table | Happy e-Point Assignment Table |
| `AC_T_HAPIEPOINT_UCWK` | Table | Happy e-Point Contract Detail Table |
| `CH_T_SAIKEN` | Table | Collateral/Guarantee Table |
| `CH_T_JUTO` | Table | Payment/Charge Table |
| `DK_T_BTRYHOZN` | Table | Logistics Preservation Table |
| `DK_T_HAISO_TG_BPIN` | Table | Delivery Target Product Table |
| `KU_T_KOJIAK` | Table | Work Case Table |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service |
| Happy e-Point | Business term | Loyalty point rewards program operated by K-Opticom customers |
| Batch Operation Date (opeDate) | Field | The processing date of the batch job, used as a filter in all queries |
| Batch User ID (batchUserId) | Field | The operator account that executed the batch, used for audit trail |
| Physical Deletion | Business term | Direct SQL DELETE operation that permanently removes data from database tables |
| Data Retention Management | Business term | Regulatory compliance process for removing personal data after its retention period expires |
| Relational Check (delPsbChk) | Technical term | Validation step that removes keys from the deletion list if no corresponding data exists in the referenced table |
| Multi-thread Processing (Taju Kidou) | Technical term | Parallel batch processing mechanism where multiple branches process different customer subsets simultaneously |
