# Business Logic - JBSbatKKKjClDataInTrn.execute() [1854 LOC]

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

## 1. Role

### JBSbatKKKjClDataInTrn.execute()

This method is the **central batch service processor for telecom service contract cancellations and modifications** within the K-Opticom (Ku-opl) NTT Docomo integrated billing system. It receives an input message via `JBSbatServiceInterfaceMap` containing service contract numbers, reservation details, work case information, and processing flags, then orchestrates a multi-stage data processing pipeline covering **fibre-to-the-home (FTTH) internet services**, **option service contracts (fixed-IP and multi-session ISPs)**, **equipment-provided service contracts (routers/HGWs)**, **service content cancellations**, **notification documents**, and **course-change-linked Netflix integration**.

The method implements a **routing/dispatch design pattern**: it branches on the service contract status (`svcKeiStat`) and service code (`svcCd`) to determine which processing path to follow. The primary branch handles services in "service providing" status (`SVC_KEI_STAT_SVCTK_CHU` / `"100"`) with internet service code (`"01"`) and work result code `"4"` (work cancellation), which covers the most complex flow including reservation updates, service content insertions, option service processing, equipment registration, and notification document updates.

The secondary branch handles non-active service statuses (e.g., services not currently being provided), processing reservation updates, service content updates, notification documents, and target object updates. This ensures all service-related data is properly synchronized regardless of the service lifecycle stage.

The method also implements **idempotent timestamp checking** over the `KK_T_IDO_RSV` (reservation) table to prevent concurrent processing from producing conflicting updates. When timestamp validation fails, the method exits early with an error log.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["execute(inMap)"])

    START --> INIT["Generate JBSbatOutputItem and local variables"]
    INIT --> GETIDO["Get idoDtm via getIdoDtmMax"]
    GETIDO --> CHKUCWK{"UcwkFlg (svcKeiUcwkNo1_151 not empty)"}

    CHKUCWK -->|false| UCWKFLG_FALSE["UcwkFlg = false"]
    UCWKFLG_FALSE --> DEBUG1["Debug log input fields"]

    CHKUCWK -->|true| UCWKFLG_TRUE["UcwkFlg = true"]
    UCWKFLG_TRUE --> DEBUG1

    DEBUG1 --> SEARCHIDORSV["SearchIDO: searchIdoRsv(idoRsvNo_151)"]
    SEARCHIDORSV --> TSCHK{"Timestamp check pass?"}

    TSCHK -->|false| ERR_TS["Log error, return null"]
    TSCHK -->|true| CHECKSTAT{"svcKeiStat == SVC_KEI_STAT_SVCTK_CHU"}

    CHECKSTAT -->|true - Service providing| BR1_01["svcCd == 01 AND kojiRslt == 4"]
    CHECKSTAT -->|false - other status| BR_OTHER["Handle non-active service case"]

    BR1_01 --> BR1_01_CHK2{"idoRsvNo2_151 not empty?"}
    BR1_01_CHK2 -->|true| BR1_TSCHK2{"Timestamp check 2 pass?"}
    BR1_TSCHK2 -->|false| ERR_TS2["Log error, return null"]
    BR1_TSCHK2 -->|true| BR1_SEARCH010["Search IDO_RSV KK_SELECT_010"]
    BR1_01_CHK2 -->|false| BR1_SEARCH010

    BR1_SEARCH010 --> BR1_IDO_CHK{"IdoRsvMap_010 not null?"}
    BR1_IDO_CHK -->|false| ERR_IDO["Throw BusinessException"]
    BR1_IDO_CHK -->|true| BR1_SEARCH106["Search SVC_KEI KK_SELECT_106"]

    BR1_SEARCH106 --> BR1_SVC_CHK{"SvcKeiMap_106 not null?"}
    BR1_SVC_CHK -->|false| ERR_SVC["Throw BusinessException"]
    BR1_SVC_CHK -->|true| BR1_UPDIDORSV["UpdateIdoRsv + UpdateIdoRsvTrgGaiData"]

    BR1_UPDIDORSV --> BR1_CHKUCWK2{"UcwkFlg is true?"}
    BR1_CHKUCWK2 -->|true| BR1_UCWK_BRANCH["Process with service content number"]
    BR1_CHKUCWK2 -->|false| BR1_NOUCWK_BRANCH["Process without service content number"]

    BR1_UCWK_BRANCH --> BR1_IDO014["Search IDO_RSV KK_SELECT_014"]
    BR1_IDO014 --> BR1_IDO014_CHK{"IdoRsvMap_014 not null?"}
    BR1_IDO014_CHK -->|false| LOG014["Log debug: no search result"]
    BR1_IDO014_CHK -->|true| BR1_UPDIDORSV2["UpdateIdoRsv2"]

    BR1_UPDIDORSV2 --> BR1_IDO039["Search IDO_RSV KK_SELECT_039"]
    BR1_IDO039 --> BR1_LOOP039{"While results exist"}
    BR1_LOOP039 -->|true| BR1_UPDIDORSV3["UpdateIdoRsv3(idoRsvNo)"]
    BR1_UPDIDORSV3 --> BR1_LOOP039
    BR1_LOOP039 -->|false| BR1_UCWK_PK["PKSearch svcKeiUcwk"]

    BR1_UCWK_PK --> BR1_UCWK_CHK{"ucwk1_map not null?"}
    BR1_UCWK_CHK -->|false| ERR_UCWK["Throw BusinessException"]
    BR1_UCWK_CHK -->|true| BR1_INSUCWK["InsertSvcKeiUcwk"]

    BR1_INSUCWK --> BR1_EOHNET["PKSearch SVKEIUW_EOH_NET"]
    BR1_EOHNET --> BR1_EOH_CHK{"Not empty?"}
    BR1_EOH_CHK -->|true| BR1_ODR["Generate ODR_HAKKO_JOKEN + Insert"]
    BR1_EOH_CHK -->|false| BR1_SKI

    BR1_ODR --> BR1_SKI["Set isISPninshoChg = true"]
    BR1_SKI --> BR1_OPSVC["Search OP_SVC_KEI KK_SELECT_035"]

    BR1_OPSVC --> BR1_OP_CHK{"opSvcKeiMap_035 not null?"}
    BR1_OP_CHK -->|false| LOG_OP["Log debug: no record"]
    BR1_OP_CHK -->|true| BR1_OP_LOOP{"While results exist"}

    BR1_OP_LOOP -->|true| BR1_OPISP["Search OP_SVKEI_ISP KK_SELECT_004"]
    BR1_OPISP --> BR1_OPISP_CHK{"opSvcKeiIspMap_004 not null?"}
    BR1_OPISP_CHK -->|false| LOG_ISP["Log debug + continue"]
    BR1_OPISP_CHK -->|true| BR1_OP_PROC["selectOpSvcKeiIspKotei + selectOpSvcKeiIspMulti + insertOpsvckei"]

    BR1_OP_PROC --> BR1_OP_LOOP
    BR1_OP_LOOP -->|false| BR1_KKTK258["Search KKTK_SVC_KEI KK_SELECT_258"]

    BR1_KKTK258 --> BR1_K258_CHK{"kktkSvcKeiMap258 not null?"}
    BR1_K258_CHK -->|true| BR1_ROUTER["insertHmpInKikiNewKiki + insertOrUpdateKktkSvcKeiDsl + updateHmpinKikiOldKiki"]
    BR1_K258_CHK -->|false| BR1_KKTK039

    BR1_ROUTER --> BR1_TEL045["Search SVKEIUW_EOH_TEL KK_SELECT_045"]
    BR1_TEL045 --> BR1_TEL_CHK{"svkeiuwEohTelMap045 not null?"}
    BR1_TEL_CHK -->|true| BR1_TEL_LOOP{"While + PKSearch + insertSvkeiUcwkTelnoHmdkUpd"}
    BR1_TEL_LOOP --> BR1_TEL_NEXT["Get next record"]
    BR1_TEL_NEXT --> BR1_TEL_LOOP
    BR1_TEL_CHK -->|false| BR1_KKTK039

    BR1_KKTK039["Search KKTK_SVC_KEI KK_SELECT_039"] --> BR1_K039_CHK{"kktkSvcKeiMap_039 not null?"}
    BR1_K039_CHK -->|true| BR1_K039_LOOP{"While results exist"}
    BR1_K039_LOOP -->|true| BR1_K039_PROC["Get fields + insertHmpInKikiNewKiki + insertOrUpdateKktkSvcKeiDsl + updateHmpinKikiOldKiki"]
    BR1_K039_PROC --> BR1_K039_NEXT["Get next record"]
    BR1_K039_NEXT --> BR1_K039_LOOP
    BR1_K039_CHK -->|false| LOG_K039

    BR1_K039_LOOP -->|false| BR1_TAKINO["Search KKTK_SVC_KEI KK_SELECT_163"]
    BR1_TAKINO --> BR1_TAK_CHK{"kktkSvcKeiMap_163 not null?"}
    BR1_TAK_CHK -->|true| BR1_TAK_LOOP{"While results exist"}
    BR1_TAK_LOOP -->|true| BR1_TAK_PROC["insertKktkSvcKeiTakinoRouter + check haisoStat"]

    BR1_TAK_PROC --> BR1_TAK_H001{"haisoStat == 001?"}
    BR1_TAK_H001 -->|true| BR1_UPDH["UpdateHaiso"]
    BR1_TAK_H001 -->|false| BR1_TAK_H002{"haisoStat == 002 or 003?"}

    BR1_TAK_H002 -->|true| BR1_INS_HMP["insertHmpInKiki"]
    BR1_TAK_H002 -->|false| BR1_TAK_H004{"haisoStat == 004?"}
    BR1_TAK_H004 -->|true| BR1_SETFIN["Set isHaisoStatFin = true + insertHmpInKiki"]
    BR1_TAK_H004 -->|false| BR1_TAK_NEXT["Get next record"]
    BR1_TAK_NEXT --> BR1_TAK_LOOP

    BR1_INS_HMP --> BR1_TAK_NEXT
    BR1_UPDH --> BR1_TAK_NEXT
    BR1_SETFIN --> BR1_TAK_NEXT

    BR1_TAK_LOOP -->|false| BR1_UPDOLD["UpdateHmpinKikiOldKaisenKiki"]
    BR1_UPDOLD --> BR1_K049["Search KKTK_SVC_KEI KK_SELECT_049"]
    BR1_K049 --> BR1_K049_CHK{"kktkSvcKeiMap_049 not null?"}
    BR1_K049_CHK -->|true| BR1_K049_LOOP{"While + update + insert + build output"}
    BR1_K049_LOOP --> BR1_K049_NEXT["Get next record"]
    BR1_K049_NEXT --> BR1_K049_LOOP
    BR1_K049_CHK -->|false| LOG_K049

    BR1_K049_LOOP -->|false| BR1_INETRANSFER["insertPrg + updateKicjkn + Netflix + equipmentOption"]
    BR1_INETRANSFER --> RETURN_MAIN["Return outputBean"]

    BR1_NOUCWK_BRANCH --> BR1_SEARCH131["Search SVC_KEI_UCWK KK_SELECT_131"]
    BR1_SEARCH131 --> BR1_131_CHK{"svcKeiUcwkMap131 not null?"}
    BR1_131_CHK -->|true| BR1_SEARCH124["Search OP_SVC_KEI KK_SELECT_124 for fixed IP"]
    BR1_131_CHK -->|false| BR1_K039
    BR1_SEARCH124 --> BR1_124_CHK{"opSvcKeiKoteiIpMap not null?"}
    BR1_124_CHK -->|true| BR1_SEARCH004["Search OP_SVKEI_ISP KK_SELECT_004 for multi-session"]
    BR1_124_CHK -->|false| BR1_K039
    BR1_SEARCH004 --> BR1_004_CHK{"opSvcKeiIspMap_004 not null?"}
    BR1_004_CHK -->|true| BR1_004_PROC["selectOpSvcKeiIspKotei + selectOpSvcKeiIspMulti + insertOpsvckei"]
    BR1_004_CHK -->|false| LOG_004
    BR1_004_PROC --> BR1_K039

    BR_OTHER --> BR_OTHER_CHK{"idoKojiakNo empty OR endDay == opt_date?"}
    BR_OTHER_CHK -->|true| BR_OTHER_SUB{"idoKojiakNo empty?"}
    BR_OTHER_SUB -->|true| BR_UPD_KOJI["UpdateIdoRsv_kojiAk"]
    BR_UPD_KOJI --> BR_LOG_ERR["Log business error EKKB1050CW"]
    BR_OTHER_SUB -->|false| BR_LOG_ERR
    BR_OTHER_CHK -->|false| BR_SKIP["Skip processing"]

    BR_LOG_ERR --> RETURN_MAIN
    BR_SKIP --> RETURN_MAIN
    ERR_TS --> RETURN_MAIN
    ERR_TS2 --> RETURN_MAIN
    ERR_IDO --> RETURN_MAIN
    ERR_SVC --> RETURN_MAIN
    ERR_UCWK --> RETURN_MAIN
    LOG014 --> BR1_UCWK_PK
    LOG_OP --> BR1_KKTK258
    LOG_ISP --> BR1_OP_LOOP
    LOG_K039 --> BR1_TAKINO
    LOG_004 --> BR1_K039
    LOG_K049 --> BR1_K039

    BR1_UPDIDORSV_NOUCWK_END["UpdateIdoRsv + UpdateIdoRsvTrgGaiData (NoUcwk branch)"] --> BR1_SEARCH040["Search IDO_RSV KK_SELECT_040"]
    BR1_SEARCH040 --> BR1_040_CHK{"idoRsvMap_040 not null?"}
    BR1_040_CHK -->|true| BR1_040_LOOP{"While updateIdoRsv2 per record"}
    BR1_040_LOOP --> BR1_040_NEXT["Get next"]
    BR1_040_NEXT --> BR1_040_LOOP
    BR1_040_CHK -->|false| LOG_040["Log debug: noIDO_RSV"]
    BR1_040_LOOP --> BR1_SVCUCWK041["Search SVC_KEI_UCWK KK_SELECT_041"]
    BR1_SVCUCWK041 --> BR1_041_CHK{"svcKeiUcwkMap_041 not null?"}
    BR1_041_CHK -->|true| BR1_041_LOOP{"While PKSearch + insertSvcKeiUcwk"}
    BR1_041_CHK -->|false| LOG_041["Log debug: noSvcKeiUcwk"]
    BR1_041_LOOP --> BR1_041_NEXT["Get next"]
    BR1_041_NEXT --> BR1_041_LOOP
    BR1_041_CHK --> BR1_INSUPDT["insertUpdateKktkSvcKeiTV"]
    BR1_INSUPDT --> BR1_TCHI003["Search TCHISHO KK_SELECT_003"]
    BR1_TCHI003 --> BR1_TCHI_CHK{"tchishoMap_003 not null?"}
    BR1_TCHI_CHK -->|true| BR1_TCHI_LOOP{"While updateTchisho + Search TCHI_TG_BPIN"}
    BR1_TCHI_LOOP --> BR1_TCHI_TG{"tchiTgBpinNo not empty?"}
    BR1_TCHI_TG -->|true| BR1_UPDTG["UpdateTchiTgBpin"]
    BR1_UPDTG --> BR1_TCHI_NEXT["Get next"]
    BR1_TCHI_NEXT --> BR1_TCHI_LOOP
    BR1_TCHI_CHK -->|false| LOG_TCHI

    END_NODE["Return outputBean / Next"]
    RETURN_MAIN --> END_NODE

    subgraph Internet Services
    BR1_01
    BR1_01_CHK2
    BR1_TSCHK2
    BR1_SEARCH010
    BR1_IDO_CHK
    BR1_SEARCH106
    BR1_SVC_CHK
    BR1_UPDIDORSV
    BR1_CHKUCWK2
    BR1_UCWK_BRANCH
    BR1_NOUCWK_BRANCH
    BR1_KKTK039
    BR1_UPDIDORSV_NOUCWK_END
    BR1_TAKINO
    BR1_K049
    BR1_INETRANSFER
    END_NODE
    end

    subgraph NonActive
    BR_OTHER
    BR_OTHER_CHK
    BR_UPD_KOJI
    BR_LOG_ERR
    BR_SKIP
    end
```

**CRITICAL Constant Resolution:**
- `SVC_KEI_STAT_SVCTK_CHU` - Service contract status "100" (Service Providing) [-> SVC_KEI_STAT_SVCTK_CHU="100" (Service Providing)]
- `SVC_CD_IN_SVC` - Service code "01" (Internet Service) [-> SVC_CD_IN_SVC="01"]
- `KKIFM151_KOJI_RSLT_4` - Work result code "4" (Work Cancellation) [-> KKIFM151_KOJI_RSLT_4="4"]
- `CD00009_HAISO_STAT_001` - Delivery status "001" (Received) [-> CD00009_HAISO_STAT_001="001"]
- `CD00009_HAISO_STAT_002` - Delivery status "002" (Designated) [-> CD00009_HAISO_STAT_002="002"]
- `CD00009_HAISO_STAT_003` - Delivery status "003" (Shipped) [-> CD00009_HAISO_STAT_003="003"]
- `CD00009_HAISO_STAT_004` - Delivery status "004" (Completed) [-> CD00009_HAISO_STAT_004="004"]
- `YOKYU_SBT_CD_DSL` - Supplementary service code for DSL [-> YOKYU_SBT_CD_DSL]
- `YOKYU_SBT_CD_DEL` - Supplementary service code for deletion [-> YOKYU_SBT_CD_DEL]
- `ORDER_NAIYO_CD_FTTH_NINSHO_DSL` - Order content code for FTTH Authentication DSL [-> ORDER_NAIYO_CD_FTTH_NINSHO_DSL]
- `ORDER_NAIYO_CD_FTTH_NINSHO_DEL` - Order content code for FTTH Authentication Deletion [-> ORDER_NAIYO_CD_FTTH_NINSHO_DEL]
- `OP_SVC_CD_FIXIPAD` - Option service code for Fixed-IP Address [-> OP_SVC_CD_FIXIPAD]
- `FUNC_CD_1` - Function code for Course Change [-> FUNC_CD_1]
- `COURSE_CHG_CANCEL_04` - Processing division for Course Change Cancellation [-> COURSE_CHG_CANCEL_04]

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `inMap` | `JBSbatServiceInterfaceMap` | Input message carrying service cancellation/modification parameters: service contract number (`SVC_KEI_NO`), reservation number (`IDO_RSV_NO`), update timestamps (`UPD_DTM1`/`UPD_DTM2`), service code (`SVC_CD`), service content numbers (`SVC_KEI_UCWK_NO1`/`SVC_KEI_UCWK_NO2`), registration timestamps, work result code (`KOJI_RSLT`), work case cancellation flag (`KOJIAK_STP_CANCEL_PRC_UM`), application detail number (`MSKM_DTL_NO`), movement division (`IDO_DIV`), work case number (`KOJIAK_NO`), work completion date (`KOJIAK_FIN_YMD`), service contract status (`SVC_KEI_STAT`), movement reservation detail code (`IDO_RSV_DTL_CD`), old price course code (`OLD_PCRS_CD`), new price course code (`NEW_PCRS_CD`) |

**Instance Fields read by this method:**
| Field | Type | Business Description |
|-------|------|---------------------|
| `super.commonItem` | `JCCBatCommonInterface` | Common batch item containing database connection and error flag |
| `super.opeDate` | `String` | Batch operation date (used as current date for data processing) |
| `super.logPrint` | `JBSbatLogUtil` | Logging utility for debug and business error logs |
| `db_KK_T_IDO_RSV` | `DB Interface` | Reservation table database access |
| `db_KK_T_SVC_KEI` | `DB Interface` | Service contract table database access |
| `db_KK_T_SVC_KEI_UCWK` | `DB Interface` | Service contract content table database access |
| `db_KK_T_SVKEIUW_EOH_NET` | `DB Interface` | Service content (EO Net) table database access |
| `db_KK_T_SVKEIUW_EOH_TEL` | `DB Interface` | Service content (EO Tel) table database access |
| `db_KK_T_OP_SVC_KEI` | `DB Interface` | Option service contract table database access |
| `db_KK_T_OPSVKEI_ISP` | `DB Interface` | Option service ISP table database access |
| `db_KK_T_KKTK_SVC_KEI` | `DB Interface` | Equipment-provided service contract table database access |
| `db_KK_T_TCHISHO` | `DB Interface` | Notification document table database access |
| `db_KK_T_TCHI_TG_BPIN` | `DB Interface` | Notification target object table database access |
| `db_KK_T_PRG` | `DB Interface` | Progress registration table database access |
| `db_KK_T_KICJKN` | `DB Interface` | Contract one-time fee table database access |
| `stmt` | `Statement` | Database statement for common table access |

## 4. CRUD Operations / Called Services

### Pre-computed evidence from code analysis graph:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `searchIdoRsv` | - | `KK_T_IDO_RSV` | Searches reservation by `IDO_RSV_NO` to obtain update timestamp for idempotency check |
| R | `getIdoDtmMax` | JKKBatCommon | `KK_T_IDO_RSV` | Gets maximum movement timestamp for concurrency control across the service contract |
| C | `updateIdoRsv` | - | `KK_T_IDO_RSV` | Updates reservation record (movement reservation update for cancellation) |
| U | `updateIdoRsvTrgGaiData` | - | `KK_T_IDO_RSV` | Updates target external data with application date (sets state code "04" for non-applicable) |
| C | `updateIdoRsv2` | - | `KK_T_IDO_RSV` | Batch updates multiple reservation records matched by service content number |
| C | `updateIdoRsv3` | - | `KK_T_IDO_RSV` | Iteratively updates reservation records linked to second service content (inner cancellation) |
| C | `updateIdoRsv_kojiAk` | - | `KK_T_IDO_RSV` | Updates reservation with work case number for non-active service cases |
| C | `insertSvcKeiUcwk` | - | `KK_T_SVC_KEI_UCWK` | Inserts new generation service contract content data (cancellation creates new generation data, not soft delete) |
| C | `insertOpsvckei` | - | `KK_T_OP_SVC_KEI` | Inserts new generation option service contract data |
| R | `selectOpSvcKeiIspKotei` | - | `KK_T_OPSVKEI_ISP`, `KK_T_ODR_HAKKO_JOKEN`, `KK_T_ODR_INF_SKSI_WK`, `DK_T_HMPIN_KIKI`, `KK_T_TCHISHO` | Handles fixed-IP address cancellation: creates ODR HAKKO JOKEN, ODR INF SKSI WK, updates HMPIN_KIKI, and updates notification documents |
| R | `selectOpSvcKeiIspMulti` | - | `KK_T_OPSVKEI_ISP`, `KK_T_ODR_HAKKO_JOKEN`, `KK_T_ODR_INF_SKSI_WK` | Handles multi-session authentication ID cancellation: creates ODR records and updates option service ISP |
| C | `insertHmpInKikiNewKiki` | - | `DK_T_HMPIN_KIKI` | Registers return equipment and updates new equipment delivery information |
| C | `insertOrUpdateKktkSvcKeiDsl` | - | `KK_T_KKTK_SVC_KEI` | Registers or updates equipment-provided service contract (DSL variant with optional ISP auth ID change) |
| C | `updateHmpinKikiOldKiki` | - | `DK_T_HMPIN_KIKI` | Processes return cancellation of old equipment (return equipment update) |
| C | `insertKktkSvcKeiTakinoRouter` | - | `KK_T_KKTK_SVC_KEI` | Registers equipment-provided service contract for multi-function router or HGW (cancellation) |
| C | `updateHaiso` | - | `DK_T_HAISO` | Processes in-transit delivery cancellation |
| C | `insertHmpInKiki` | - | `DK_T_HMPIN_KIKI` | Registers return equipment for delivery status 002/003/004 |
| C | `updateHmpinKikiOldKaisenKiki` | - | `DK_T_HMPIN_KIKI` | Processes return cancellation of old equipment linked to previous service line content number |
| C | `insertSvkeiUcwkTelnoHmdkUpd` | - | `KK_T_SVC_KEI_UCWK` | Updates service contract content with phone number attachment (insert) |
| C | `insertSvkeiuwEohTelHmdkUpd2` | - | `KK_T_SVKEIUW_EOH_TEL` | Updates service content (EO Tel) with phone number attachment (insert) |
| C | `insertPrg` | - | `KK_T_PRG` | Registers progress information for the cancellation processing |
| U | `updateKicjkn` | - | `KK_T_KICJKN` | Updates contract one-time fee information |
| R | `dslNetflixOption` | - | `KK_T_OP_SVC_KEI_056` (via db) | Processes Netflix option service for course change contract |
| R | `equipmentOptionServiceContract` | - | `KK_T_KKTK_SVC_KEI_269`, `KK_T_SVC_KEI_UCWK_139`, `KK_T_SVKEI_KAISEN_UW_063` | Processes equipment option service contract (new feature: ANK-4287) |
| R | `insertUpdateKktkSvcKeiTV` | - | `KK_T_KKTK_SVC_KEI` (TV) | Registers/updates equipment-provided service contract for TV service |
| U | `updateTchisho` | - | `KK_T_TCHISHO` | Updates notification document record |
| U | `updateTchiTgBpin` | - | `KK_T_TCHI_TG_BPIN` | Updates notification target object record |
| R | `getNextSeq` | JCCBatCommon | `SEQ_ODR_HAKKO_JOKEN_NO` | Generates next sequence number for ODR HAKKO JOKEN NO (12-digit padded) |
| R | `JBSbatInterface.getEndOfMonth` | - | - | Gets end-of-month date for non-active service processing |
| R | `JBSbatInterface.getSystemDateTimeStamp` | - | - | Gets current system timestamp |
| - | `JCCBatchEsbInterface.invokeService` | JCCBatchEsb | - | Invokes Netflix integration service for course change contracts |
| - | `JCCBatchEsbInterface.getReturnCode` | JCCBatchEsb | - | Gets return code from Netflix service invocation |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatKKKjClDataInTrn | Batch entry -> execute(inMap) | `updateIdoRsv [C] KK_T_IDO_RSV`, `insertSvcKeiUcwk [C] KK_T_SVC_KEI_UCWK`, `insertOpsvckei [C] KK_T_OP_SVC_KEI`, `insertOrUpdateKktkSvcKeiDsl [C] KK_T_KKTK_SVC_KEI`, `insertHmpInKikiNewKiki [C] DK_T_HMPIN_KIKI`, `updateHmpinKikiOldKiki [U] DK_T_HMPIN_KIKI`, `insertPrg [C] KK_T_PRG`, `updateKicjkn [U] KK_T_KICJKN` |
| 2 | (Self - terminal batch) | This is a terminal batch service entry point - invoked directly by the batch framework | All CRUD endpoints listed above |

**Notes:** This class is a terminal batch service invoked directly by the batch execution framework (not called from a screen or CBS). It processes service cancellation/modification requests received via input message format KKF151 and produces output message format KK164.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `(Variable Initialization) (L820)`

> Generates the output bean and initializes local variables.

| # | Type | Code |
|---|------|------|
| 1 | SET | `outputBean = new JBSbatOutputItem()` // Generate output common message |
| 2 | SET | `svcKeiNo_151 = ""` // Service contract number (course change application date update intermediate file) |
| 3 | SET | `idoRsvNo_151 = ""` // Movement reservation number |
| 4 | SET | `updDtm1_151 = ""` // Update date/time second 1 |
| 5 | SET | `svcCd_151 = ""` // Service code |
| 6 | SET | `svcKeiUcwkNo1_151 = ""` // Service contract content number 1 |
| 7 | SET | `geneAddDtm1_151 = ""` // Generation registration date 1 |
| 8 | SET | `svcKeiUcwkNo2_151 = ""` // Service contract content number 2 |
| 9 | SET | `geneAddDtm2_151 = ""` // Generation registration date 2 |
| 10 | SET | `idoRsvNo2_151 = ""` // Movement reservation number 2 |
| 11 | SET | `updDtm2_151 = ""` // Update date/time second 2 |
| 12 | SET | `kojiRslt_151 = ""` // Work result |
| 13 | SET | `kojiakStpCancelPrcUm = ""` // Work case middle stop cancellation fee presence/absence |
| 14 | SET | `mskmDtlNo_151 = ""` // Application detail number |
| 15 | SET | `idoDiv_151 = ""` // Movement division |
| 16 | SET | `kojiakNo_151 = ""` // Work case number |
| 17 | SET | `kojiakFinYmd_151 = ""` // Work completion date |
| 18 | SET | `UcwkFlg = true` // Content flag (true = has service contract content number) |
| 19 | SET | `isISPninshoChg = false` // ISP authentication ID change flag (OM-2013-0004822) |
| 20 | SET | Multiple `JBSbatCommonDBInterface` map instances // SQL execution result maps for each table |

**Block 2** — [SET] `(Input Data Extraction) (L940)`

> Extracts all input fields from the input map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiNo_151 = inMap.getString(JBSbatKKIFM151.SVC_KEI_NO)` |
| 2 | SET | `idoRsvNo_151 = inMap.getString(JBSbatKKIFM151.IDO_RSV_NO)` |
| 3 | SET | `updDtm1_151 = inMap.getString(JBSbatKKIFM151.UPD_DTM1)` |
| 4 | SET | `svcCd_151 = inMap.getString(JBSbatKKIFM151.SVC_CD)` |
| 5 | SET | `svcKeiUcwkNo1_151 = inMap.getString(JBSbatKKIFM151.SVC_KEI_UCWK_NO1)` |
| 6 | SET | `geneAddDtm1_151 = inMap.getString(JBSbatKKIFM151.GENE_ADD_DTM1)` |
| 7 | SET | `svcKeiUcwkNo2_151 = inMap.getString(JBSbatKKIFM151.SVC_KEI_UCWK_NO2)` |
| 8 | SET | `geneAddDtm2_151 = inMap.getString(JBSbatKKIFM151.GENE_ADD_DTM2)` |
| 9 | SET | `idoRsvNo2_151 = inMap.getString(JBSbatKKIFM151.IDO_RSV_NO2)` |
| 10 | SET | `updDtm2_151 = inMap.getString(JBSbatKKIFM151.UPD_DTM2)` |
| 11 | SET | `kojiRslt_151 = inMap.getString(JBSbatKKIFM151.KOJI_RSLT)` |
| 12 | SET | `kojiakStpCancelPrcUm = inMap.getString(JBSbatKKIFM151.KOJIAK_STP_CANCEL_PRC_UM)` |
| 13 | SET | `mskmDtlNo_151 = inMap.getString(JBSbatKKIFM151.MSKM_DTL_NO)` |
| 14 | SET | `idoDiv_151 = inMap.getString(JBSbatKKIFM151.IDO_DIV)` |
| 15 | SET | `kojiakNo_151 = inMap.getString(JBSbatKKIFM151.KOJIAK_NO)` |
| 16 | SET | `kojiakFinYmd_151 = inMap.getString(JBSbatKKIFM151.KOJIAK_FIN_YMD)` |
| 17 | SET | `svcKeiStat = inMap.getString(JBSbatKKIFM151.SVC_KEI_STAT)` |
| 18 | SET | `idoRsvDtlCd = inMap.getString(JBSbatKKIFM151.IDO_RSV_DTL_CD)` |
| 19 | SET | `opt_date = super.opeDate` // Batch operation date |
| 20 | SET | `idoDtm = JKKBatCommon.getIdoDtmMax(commonItem, svcKeiNo_151, idoDiv_151, stmt)` // Get max movement timestamp |

**Block 3** — [IF] `(UcwkFlg - has service content number?) (L985)` [ODR_NAIYO_CD_101="101" equivalent]

> Sets UcwkFlg to false if the first service content number is empty.

| # | Type | Code |
|---|------|------|
| 1 | SET | `if (isEmpty(svcKeiUcwkNo1_151)) { UcwkFlg = false }` |

**Block 4** — [IF] `(Debug log level check) (L1001)`

> Logs all input fields when debug mode is enabled.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `super.logPrint.chkLogLevel(JBSbatLogUtil.MODE_DEBUG)` |
| 2 | CALL | `super.logPrint.printDebugLog(...)` // Logs: service contract number, reservation number, service code, content numbers, dates, work result, etc. |

**Block 5** — [CALL + IF] `(ID Reservation Search and Timestamp Check) (L1015)`

> Searches the reservation table and validates timestamp for idempotency.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `haitaIdoRsv_map = searchIdoRsv(idoRsvNo_151)` // Search reservation by IDO_RSV_NO |
| 2 | SET | `idoLastUpdDtmAf = Rtrim(haitaIdoRsv_map.getString(JBSbatKK_T_IDO_RSV.UPD_DTM))` |
| 3 | SET | `idoKojiakNo = Rtrim(haitaIdoRsv_map.getString(JBSbatKK_T_IDO_RSV.KOJIAK_NO))` |
| 4 | IF | `null == idoTimeStampCheck(idoRsvNo_151, updDtm1_151, idoLastUpdDtmAf)` [-> Timestamp mismatch] |
| 5 | CALL | `super.logPrint.printBusinessErrorLog("EKKB0360KE", [...])` // Error: reservation not found |
| 6 | RETURN | `return null` // Early exit on timestamp validation failure |

**Block 6** — [IF] `(svcKeiStat == SVC_KEI_STAT_SVCTK_CHU - Service Providing) (L1031)` [SVC_KEI_STAT_SVCTK_CHU="100" (Service Providing)]

> Branches on service contract status. "100" means the service is currently being provided.

| # | Type | Code |
|---|------|------|
| 1 | IF | `JBSbatKKConst.SVC_KEI_STAT_SVCTK_CHU.equals(svcKeiStat)` // "100" = Service Providing |

**Block 6.1** — [IF] `(svcCd == 01 AND kojiRslt == 4 - Internet Service, Work Cancellation) (L1038)` [SVC_CD_IN_SVC="01", KKIFM151_KOJI_RSLT_4="4"]

> Handles the primary cancellation flow: internet service with work cancellation result.

| # | Type | Code |
|---|------|------|
| 1 | IF | `JBSbatKKConst.SVC_CD_IN_SVC.equals(svcCd_151) && JBSbatKKConst.KKIFM151_KOJI_RSLT_4.equals(kojiRslt_151)` // "01" = Internet, "4" = Work Cancellation |

**Block 6.1.1** — [IF] `(idoRsvNo2_151 not empty - Inner cancellation reservation) (L1044)`

> If a second movement reservation number exists (inner cancellation), validate it too.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!" ".equals(idoRsvNo2_151)` |
| 2 | CALL | `haitaIdoRsv_map2 = searchIdoRsv(idoRsvNo2_151)` |
| 3 | SET | `idoLastUpdDtmAf2 = Rtrim(haitaIdoRsv_map2.getString(JBSbatKK_T_IDO_RSV.UPD_DTM))` |
| 4 | IF | `null == idoTimeStampCheck(idoRsvNo2_151, updDtm2_151, idoLastUpdDtmAf2)` |
| 5 | CALL | `printBusinessErrorLog("EKKB0360KE", [...])` |
| 6 | RETURN | `return null` |

**Block 6.1.2** — [CALL] `(Search and Update IDO_RSV) (L1062)`

> Queries reservation table (KK_SELECT_010) and performs reservation update.

| # | Type | Code |
|---|------|------|
| 1 | SET | `whereParam = {idoRsvNo_151, svcKeiNo_151}` |
| 2 | CALL | `executeKK_T_IDO_RSV_KK_SELECT_010(whereParam)` // Search reservation |
| 3 | SET | `idoRsvMap_010 = db_KK_T_IDO_RSV.selectNext()` |
| 4 | IF | `idoRsvMap_010 == null` [-> Reservation not found] |
| 5 | THROW | `new JBSbatBusinessException(EKKB0210CE, ["Movement reservation", "number: " + idoRsvNo_151])` |
| 6 | CALL | `updateIdoRsv(idoRsvNo_151)` // Update reservation |
| 7 | CALL | `updateIdoRsvTrgGaiData(mskmDtlNo_151, super.opeDate)` // Set state code "04" (non-applicable) |

**Block 6.1.3** — [IF] `(UcwkFlg - has content number?) (L1098)`

> Branches on whether the service content number is provided.

| # | Type | Code |
|---|------|------|
| 1 | IF | `UcwkFlg` // true = has service contract content number (inner cancellation division) |

**Block 6.1.3.1** — [CALL] `(UCWK Branch: Process with service content number) (L1101)`

> Inner cancellation path: searches and updates second reservation (KK_SELECT_014), performs service content insert (new generation cancellation data), option service processing, equipment processing, and notification document updates.

| # | Type | Code |
|---|------|------|
| 1 | SET | `whereIdoParam = {idoRsvNo2_151, svcKeiUcwkNo2_151}` |
| 2 | CALL | `executeKK_T_IDO_RSV_KK_SELECT_014(whereIdoParam)` // Search second reservation |
| 3 | SET | `idoRsvMap_014 = db_KK_T_IDO_RSV_014.selectNext()` |
| 4 | IF | `idoRsvMap_014 != null` |
| 5 | CALL | `updateIdoRsv2(idoRsvNo2_151)` // Update second reservation |
| 6 | SET | `idoRsv_whereParam = {svcKeiUcwkNo2_151, this.opeDate, mskmDtlNo_151}` |
| 7 | CALL | `executeKK_T_IDO_RSV_KK_SELECT_039(idoRsv_whereParam)` |
| 8 | WHILE | `idoRsvMap_039 != null` |
| 9 | CALL | `updateIdoRsv3(idoRsvNo)` // Update linked reservations |
| 10 | CALL | `executeKK_T_SVC_KEI_UCWK_PKSELECT(ucwk1_param)` // PK search service content 1 |
| 11 | CALL | `insertSvcKeiUcwk(ucwk1_map)` // Insert new generation service content |
| 12 | CALL | `executeKK_T_SVKEIUW_EOH_NET_PKSELECT(svkeiUwEohNet_param)` // PK search EO Net |
| 13 | IF | `!isEmpty(ispNinshoId) && !isEmpty(svcKeiUcwkNo)` |
| 14 | CALL | `getNextSeq(..., SEQ_ODR_HAKKO_JOKEN_NO)` // Generate ODR sequence |
| 15 | CALL | `kkTOdrHakkoJokenInsert(..., YOKYU_SBT_CD_DSL)` // Register DSL supplementary service [-> YOKYU_SBT_CD_DSL] |
| 16 | CALL | `kkTOdrInfSksiWkInsert(..., ORDER_NAIYO_CD_FTTH_NINSHO_DSL)` // Register FTTH auth DSL order info [-> ORDER_NAIYO_CD_FTTH_NINSHO_DSL] |
| 17 | CALL | `kkTOdrHakkoJokenInsert(..., YOKYU_SBT_CD_DEL)` // Register deletion supplementary service [-> YOKYU_SBT_CD_DEL] |
| 18 | CALL | `kkTOdrInfSksiWkInsert(..., ORDER_NAIYO_CD_FTTH_NINSHO_DEL)` // Register FTTH auth deletion order info [-> ORDER_NAIYO_CD_FTTH_NINSHO_DEL] |
| 19 | SET | `isISPninshoChg = true` // Mark ISP auth ID change [-> OM-2013-0004822] |
| 20 | CALL | `executeKK_T_OP_SVC_KEI_KK_SELECT_035(opSvcKei_param)` |
| 21 | WHILE | `opSvcKeiMap_035 != null` |
| 22 | CALL | `executeKK_T_OPSVKEI_ISP_KK_SELECT_004(opSvcKeiIsp_param)` |
| 23 | CALL | `selectOpSvcKeiIspKotei(...)` // Fixed-IP cancellation processing |
| 24 | CALL | `selectOpSvcKeiIspMulti(..., ispNinshoId)` // Multi-session auth ID cancellation |
| 25 | CALL | `insertOpsvckei(opSvcKeiMap_035)` // Insert new option service contract |
| 26 | CALL | `executeKK_T_KKTK_SVC_KEI_KK_SELECT_258(kktkSvcKeiWhereParam258)` // KK_SELECT_258 (multi-function router, HGW exchange) |
| 27 | IF | `kktkSvcKeiMap258 != null` |
| 28 | CALL | `insertHmpInKikiNewKiki(...)` // Register return equipment + new equipment |
| 29 | CALL | `insertOrUpdateKktkSvcKeiDsl(..., isISPninshoChg)` // Register/update equipment-provided contract |
| 30 | CALL | `updateHmpinKikiOldKiki(...)` // Cancel old equipment return |
| 31 | CALL | `executeKK_T_SVKEIUW_EOH_TEL_KK_SELECT_045(...)` // Search EO Tel service content |
| 32 | WHILE | `svkeiuwEohTelMap045 != null` |
| 33 | CALL | `executeKK_T_SVC_KEI_UCWK_PKSELECT(...)` |
| 34 | CALL | `insertSvkeiUcwkTelnoHmdkUpd(...)` // Service content phone number attachment |
| 35 | CALL | `insertSvkeiuwEohTelHmdkUpd2(...)` |
| 36 | CALL | `executeKK_T_KKTK_SVC_KEI_KK_SELECT_039(kktkSvcKei_param)` // Search equipment-provided |
| 37 | WHILE | `kktkSvcKeiMap_039 != null` |
| 38 | CALL | `insertHmpInKikiNewKiki(...)` // Register return equipment |
| 39 | CALL | `insertOrUpdateKktkSvcKeiDsl(..., isISPninshoChg)` // Register/update equipment contract |
| 40 | CALL | `updateHmpinKikiOldKiki(...)` // Cancel old equipment |
| 41 | CALL | `executeKK_T_KKTK_SVC_KEI_KK_SELECT_163(...)` // Search multi-function router/HGW |
| 42 | WHILE | `kktkSvcKeiMap_163 != null` |
| 43 | CALL | `insertKktkSvcKeiTakinoRouter(...)` // Register router/HGW cancellation |
| 44 | IF | `haisoStat == CD00009_HAISO_STAT_001` [-> "001" Received] |
| 45 | CALL | `updateHaiso(...)` // Cancel in-transit delivery |
| 46 | IF | `haisoStat == CD00009_HAISO_STAT_002 || CD00009_HAISO_STAT_003` [-> "002" Designated / "003" Shipped] |
| 47 | CALL | `insertHmpInKiki(...)` // Register return equipment |
| 48 | IF | `haisoStat == CD00009_HAISO_STAT_004` [-> "004" Completed] |
| 49 | SET | `isHaisoStatFin = true` |
| 50 | CALL | `updateHmpinKikiOldKaisenKiki(...)` // Old equipment from previous service line |
| 51 | CALL | `executeKK_T_KKTK_SVC_KEI_KK_SELECT_049(...)` // Search previous service line equipment |
| 52 | WHILE | `kktkSvcKeiMap_049 != null` |
| 53 | CALL | `insertHmpInKikiNewKiki(...)` // Register new equipment |
| 54 | CALL | `insertOrUpdateKktkSvcKeiDsl(...)` // Register/update equipment contract |
| 55 | CALL | `executeKK_T_KKTK_SVC_KEI_PKSELECT(...)` // PK search equipment |
| 56 | CALL | `outmap.set(...)` // Build output data for KK164 |
| 57 | CALL | `outputBean.addOutMapList(outmap)` |

**Block 6.1.3.2** — [ELSE] `(UCWK Branch: Process WITHOUT service content number) (L1222)`

> Without service content number path: searches and updates service content 131, option service for fixed IP, notification document updates.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `executeKK_T_SVC_KEI_UCWK_KK_SELECT_131(svcKeiUcwkParam)` // Search service content 131 |
| 2 | IF | `svcKeiUcwkMap131 != null` |
| 3 | CALL | `executeKK_T_OP_SVC_KEI_KK_SELECT_124(opSvcKeiKoteiIpParam)` // Search fixed-IP option service [-> OP_SVC_CD_FIXIPAD] |
| 4 | IF | `opSvcKeiKoteiIpMap != null` |
| 5 | CALL | `executeKK_T_OPSVKEI_ISP_KK_SELECT_004(opSvcKeiIsp_param)` |
| 6 | CALL | `selectOpSvcKeiIspKotei(...)` |
| 7 | CALL | `selectOpSvcKeiIspMulti(...)` |
| 8 | CALL | `insertOpsvckei(...)` |
| 9 | CALL | `executeKK_T_KKTK_SVC_KEI_KK_SELECT_039(kktkSvcKei_param)` |
| 10-40 | (Same as Block 6.1.3.1 steps 36-40) | (Equipment-provided processing) |

**Block 6.1.4** — [CALL] `(Common Post-Processing for UCWK Branch) (L1640)`

> Inserts progress registration, updates contract one-time fee, invokes Netflix integration service, and processes equipment option service contract.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `insertPrg(mskmDtlNo_151, svcKeiNo_151, idoDiv_151, idoDtm)` |
| 2 | CALL | `updateKicjkn(svcKeiNo_151, kojiakNo_151, kojiakStpCancelPrcUm, mskmDtlNo_151)` |
| 3 | IF | `!JKKStringUtil.isNullBlank(svcKeiNo_151)` [-> ANK-3949-00-00] |
| 4 | SET | `paramMap.put(TELEGRAM_INFO_USECASE_ID, "KKSV0950")` |
| 5 | SET | `paramMap.put(TELEGRAM_INFO_OPERATION_ID, "KKSV0950OP")` |
| 6 | SET | `parentMap.put("func_code", FUNC_CD_1)` [-> FUNC_CD_1] |
| 7 | SET | `parentMap.put("syori_kbn", COURSE_CHG_CANCEL_04)` [-> COURSE_CHG_CANCEL_04] |
| 8 | SET | `parentMap.put("pcrs_cd", inMap.getString(OLD_PCRS_CD))` |
| 9 | SET | `parentMap.put("pcrs_after_cd", inMap.getString(NEW_PCRS_CD))` |
| 10 | CALL | `JCCBatchEsbInterface.invokeService(commonItem, paramMap, inputMap, outputMap)` // Netflix integration |
| 11 | IF | `!RETURN_CODE_SUCCESS.equals(returnCode)` |
| 12 | CALL | `printBusinessErrorLog(EKKB0010CW, [...])` |
| 13 | SET | `commonItem.setErrFlg(true)` |
| 14 | CALL | `dslNetflixOption(inMap, svcKeiNo_151, kojiakFinYmd_151)` // ANK-3987-00-00 |
| 15 | CALL | `equipmentOptionServiceContract(svcKeiKaisenUcwkNo, svcKeiGeneAddDtm, inMap, idoDtm)` // ANK-4287 |

**Block 6.2** — [ELSE] `(svcCd == 03 - TV Service, Work Cancellation) (L2040)`

> Alternative branch for TV service with work cancellation. Similar processing to Block 6.1 but for TV-specific tables.

| # | Type | Code |
|---|------|------|
| 1 | SET | `whereParam = {idoRsvNo_151, svcKeiNo_151}` |
| 2 | CALL | `executeKK_T_IDO_RSV_KK_SELECT_010(whereParam)` |
| 3 | CALL | `updateIdoRsv(idoRsvNo_151)` |
| 4 | CALL | `updateIdoRsvTrgGaiData(mskmDtlNo_151, super.opeDate)` |
| 5 | SET | `whereIdoParam = {mskmDtlNo_151}` |
| 6 | CALL | `executeKK_T_IDO_RSV_KK_SELECT_040(whereIdoParam)` |
| 7 | WHILE | `idoRsvMap_040 != null` |
| 8 | CALL | `updateIdoRsv2(idoRsvNo)` |
| 9 | CALL | `executeKK_T_SVC_KEI_UCWK_KK_SELECT_041(kktkSvcKeiUcwk_whereParam)` |
| 10 | WHILE | `svcKeiUcwkMap_041 != null` |
| 11 | CALL | `executeKK_T_SVC_KEI_UCWK_PKSELECT(ucwk1_param)` |
| 12 | CALL | `insertSvcKeiUcwk(ucwk1_map)` |
| 13 | CALL | `insertUpdateKktkSvcKeiTV(kojiakNo_151, svcKeiNo_151, mskmDtlNo_151, idoDtm, idoDiv_151, svcCd_151)` |
| 14 | CALL | `executeKK_T_TCHISHO_KK_SELECT_003(kkTTchisho_param)` // Search notification document |
| 15 | WHILE | `tchishoMap_003 != null` |
| 16 | CALL | `updateTchisho(tchishoNo)` // Update notification document |
| 17 | CALL | `executeKK_T_TCHI_TG_BPIN_KK_SELECT_002(kkTTchiTgBpin_param)` |
| 18 | WHILE | `tchiTgBpinMap_002 != null` |
| 19 | IF | `!isEmpty(tchiTgBpinNo)` |
| 20 | CALL | `updateTchiTgBpin(tchiTgBpinNo)` // Update notification target object |

**Block 7** — [ELSE] `(svcKeiStat != SVC_KEI_STAT_SVCTK_CHU - Non-active service) (L2161)`

> Handles service contract statuses other than "100" (Service Providing). Processes work case number updates and logs business errors.

| # | Type | Code |
|---|------|------|
| 1 | SET | `endDay = opt_date.substring(0, 6) + getEndOfMonth(opt_date.substring(0, 6))` |
| 2 | IF | `isEmpty(idoKojiakNo) || endDay.equals(opt_date)` [-> Month-end check] |
| 3 | IF | `isEmpty(idoKojiakNo)` |
| 4 | CALL | `updateIdoRsv_kojiAk(idoRsvNo_151, kojiakNo_151)` // Update reservation with work case number |
| 5 | CALL | `printBusinessErrorLog(EKKB1050CW, [...])` // Log: service contract number, status, reservation number, movement division, detail code |

**Block 8** — [RETURN] `(End of Method) (L2670)`

> Returns the generated output bean.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `printDebugLog("execute_END")` |
| 2 | RETURN | `return outputBean` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service contract number — unique identifier for a telecom service contract line |
| `ido_rsv_no` | Field | Movement reservation number — identifies a service migration/change reservation event |
| `ido_rsv_no2` | Field | Second movement reservation number — for inner cancellation reservations |
| `upd_dtm1` | Field | Update date/time second 1 — timestamp for first version of the update (idempotency check) |
| `upd_dtm2` | Field | Update date/time second 2 — timestamp for second version of the update (inner cancellation) |
| `svc_cd` | Field | Service code — classifies the type of service (e.g., "01" = Internet/FTTH, "03" = TV) |
| `svc_kei_ucwk_no1` | Field | Service contract content number 1 — internal tracking ID for the service detail/work item |
| `svc_kei_ucwk_no2` | Field | Service contract content number 2 — second content number for inner cancellation scenarios |
| `gene_add_dtm1` | Field | Generation registration date 1 — when the service content record was created/registered |
| `gene_add_dtm2` | Field | Generation registration date 2 — second generation registration timestamp |
| `koji_rslt` | Field | Work result — status of the physical installation work ("4" = Work Cancellation) |
| `kojiak_stp_cancel_prc_um` | Field | Work case middle stop cancellation fee presence/absence — flag for cancellation fee during work stop |
| `mskm_dtl_no` | Field | Application detail number — unique identifier for the service application detail |
| `ido_div` | Field | Movement division — classifies the type of service migration (e.g., new, change, cancellation) |
| `kojiak_no` | Field | Work case number — links to a physical installation work order/case |
| `kojiak_fin_ymd` | Field | Work completion date — date when the installation work was completed |
| `svc_kei_stat` | Field | Service contract status — lifecycle status of the service contract ("100" = Service Providing) |
| `ido_rsv_dtl_cd` | Field | Movement reservation detail code — detailed classification of the reservation type |
| `opt_date` | Field | Batch operation date — the processing date of the batch run |
| `UcwkFlg` | Field | Content flag — true when a service contract content number is present (true = has content number) |
| `isISPninshoChg` | Field | ISP authentication ID change flag — set to true when the ISP auth ID changes during processing |
| `idoDtm` | Field | Movement date/time — maximum timestamp from the reservation table for concurrency control |
| `kktk_svc_kei_no` | Field | Equipment-provided service contract number — identifies equipment-provided (router/HGW) service |
| `kiki_ninsho_id` | Field | Equipment authentication ID — unique identifier for the customer-owned equipment |
| `kiki_seizo_no` | Field | Equipment serial number — manufacturing serial number of the equipment |
| `taknkiki_model_cd` | Field | Indoor equipment model code — model code for the customer-provided equipment |
| `tchisho_no` | Field | Notification document number — identifies a billing/notification document sent to the customer |
| `tchi_tg_bpin_no` | Field | Notification target object number — identifies the specific target of a notification |
| `isp_ninsho_id` | Field | ISP authentication ID — authentication identifier for the ISP service (used in DSL auth) |
| `svc_kei_kaisen_ucwk_no` | Field | Service contract revision content number — tracks the previous/revision service content for line changes |
| `haiso_stat` | Field | Delivery status — shipment status of equipment ("001" = Received, "002" = Designated, "003" = Shipped, "004" = Completed) |
| `isHaisoStatFin` | Field | Delivery status complete flag — set to true when delivery status reaches "004" (Completed) |
| `svcKeiUcwkNo131` | Field | Service contract content number (131 query) — used in non-UCWK branch for SVC_KEI_UCWK table |
| `op_svc_kei_no` | Field | Option service contract number — identifies an option/add-on service contract |
| `kotei_ip_ad` | Field | Fixed IP address — static IP address assigned to the option service |
| `mltise_ninsho_id` | Field | Multi-session authentication ID — authentication ID for multi-session ISP option |
| SOD | Acronym | Service Order Data — telecom order fulfillment entity/table |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service |
| ISP | Business term | Internet Service Provider — the entity providing internet connectivity |
| HGW | Business term | Home Gateway — customer-provided residential gateway/router equipment |
| ONU | Business term | Optical Network Unit — fiber optic terminal equipment (mentioned in commented code) |
| DSL | Business term | Digital Subscriber Line — broadband over telephone line (used in order content codes) |
| KK_T_* | Table prefix | K-Opticom (Ku-opl) transaction tables — main operational data tables |
| DK_T_* | Table prefix | K-Opticom delivery/shipment tables — logistics and equipment delivery tables |
| ZM_T_* | Table prefix | K-Opticom aging/depreciation tables |
| KK_M_* | Table prefix | K-Opticom master/reference tables |
| KKIFM* | Message format | K-Opticom Input/Output Message Format codes (e.g., KKIFM151 = input, KK164 = output) |
| ODR_HAKKO_JOKEN | Table | Order issuance condition table — registers conditions for generating service orders |
| ODR_INF_SKSI_WK | Table | Order information creation work table — stores order information creation work data |
| JPCBatchMessageConstant | Class | Shared batch message constants — error code definitions (EKKB0210CE, EKKB1050CW, etc.) |
| JCCBatchEsbInterface | Class | JCC Batch ESB interface — handles external service invocation (Netflix integration) |
| COURSE_CHG_CANCEL_04 | Constant | Processing division for Course Change Cancellation — used in Netflix integration |
| FUNC_CD_1 | Constant | Function code 1 — identifies the Course Change function category |
| KK_SELECT_010 | SQL Key | Reservation search by reservation number + service contract number |
| KK_SELECT_014 | SQL Key | Second reservation search by second reservation number + second content number |
| KK_SELECT_039 | SQL Key | Equipment-provided reservation search by work case number + service contract number |
| KK_SELECT_040 | SQL Key | Reservation search by application detail number (TV service branch) |
| KK_SELECT_041 | SQL Key | Service content search by service contract number + application detail number |
| KK_SELECT_045 | SQL Key | EO Tel service content search by date range + revision content number |
| KK_SELECT_049 | SQL Key | Previous service line equipment search by work case number + revision content number |
| KK_SELECT_106 | SQL Key | Service contract search by date range + reservation number |
| KK_SELECT_124 | SQL Key | Fixed-IP option service search by content number + fixed-IP code + date |
| KK_SELECT_131 | SQL Key | Service content search by service contract number + date (non-UCWK branch) |
| KK_SELECT_163 | SQL Key | Multi-function router/HGW equipment search by work case number + revision content number |
| KK_SELECT_258 | SQL Key | Multi-function router/HGW search during contract change |
| KK_SELECT_259 | SQL Key | Equipment-provided search by equipment contract number + date |
| KK_SELECT_003 | SQL Key | Notification document search by application detail number + detail code |
| KK_SELECT_004 | SQL Key | Option service ISP search by option service contract number |
| KK_SELECT_035 | SQL Key | Option service contract search by service contract number + application detail number |
