# Business Logic — JKKAdchgCancelHakkoSODCC.kktkDslOdrCtrl() [228 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKAdchgCancelHakkoSODCC` |
| Layer | CC / Common Component (Business Common Component) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKAdchgCancelHakkoSODCC.kktkDslOdrCtrl()

This method performs **Equipment Cancellation Order Control Processing** (機器解約オーダ制御処理) — it is a central router and orchestrator that coordinates the issuance of Service Order Data (SOD) when an equipment is being canceled in the K-Opticom telecom billing system. It operates within the context of a residential change (住所変更) workflow, specifically handling the downstream side effects of equipment cancellation.

The method iterates over a target data list (`kkop_trgt_data_list`) extracted from the `sodMap` parameter. For each target equipment service contract, it performs a series of validation lookups: fetching service contract details, retrieving equipment model and serial numbers, checking order eligibility via an SC call, and validating the request type code. Only if all preconditions pass does it proceed to determine which order path to take.

The core design pattern is a **conditional dispatch/routing** based on two dimensions: (1) the "Multi-function Router Last Flag" (`takino_dsl_flg`) combined with iteration position (whether this is the final item in the target list), and (2) the "Equipment Option Service Contract Code" (`kkopSvcCd`), which identifies whether the service is a Broad Band Router (BBR, code `G01`) or Voice over IP / VA (code `G02`). This produces four distinct processing paths: Router Last (BBR/VA) and Multi-function Change (BBR/VA), each issuing specific SODs with different order content codes.

It is called by the `cancel()` method of the same class, which is the primary entry point for SOD cancellation processing triggered by a residential change. This method serves as a **shared component** invoked by the screen workflow, not a screen entry point itself.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["kktkDslOdrCtrl"])
    START --> GET_TRN["getSameTrnNo"]
    GET_TRN --> GET_LIST["Get kkop_trgt_data_list from sodMap"]
    GET_LIST --> CHECK_LIST{kkop_trgt_data_list == null?}
    CHECK_LIST -->|Yes| RETURN_P["Return param"]
    CHECK_LIST -->|No| LOOP["Loop over kkop_trgt_data_list"]

    LOOP --> CHECK_MAP{kkopMap == null or empty?}
    CHECK_MAP -->|Yes| NEXT_ITER["Continue to next iteration"]
    CHECK_MAP -->|No| GET_SVC_NO["Get kkopSvcKeiNo"]
    GET_SVC_NO --> CALL_2811["runEKK2811A010 - Get Equipment Option Service Contract"]
    CALL_2811 --> CHECK_2811{result == null or empty?}
    CHECK_2811 -->|Yes| NEXT_ITER
    CHECK_2811 -->|No| CALL_0341["runEKK0341A010Current - Get Service Contract Info"]
    CALL_0341 --> CHECK_0341{result == null or empty?}
    CHECK_0341 -->|Yes| NEXT_ITER
    CHECK_0341 -->|No| CHECK_MODEL["Check taknkikiModelCd and kikiSeizoNo"]
    CHECK_MODEL -->|Empty Model or Serial| NEXT_ITER
    CHECK_MODEL -->|Valid| CALL_1041["callEKK1041B001SC - Check Order Settings"]
    CALL_1041 --> CHECK_1041{result == null or empty?}
    CHECK_1041 -->|Yes| CONT_ROuter["Continue - Router holding, order not issued"]
    CONT_ROuter --> NEXT_ITER
    CHECK_1041 -->|No| CHECK_RCNT{rcntYokyuSbtCd matches 03 or 08?}
    CHECK_RCNT -->|Yes| NEXT_ITER
    CHECK_RCNT -->|No| ASSIGN_KAISEN["Assign svc_kei_kaisen_ucwk_no"]
    ASSIGN_KAISEN --> CALL_0251["runEKK0251A010 - Get Service Contract Modification"]
    CALL_0251 --> CHECK_0251{result == null or empty?}
    CHECK_0251 -->|Yes| NEXT_ITER
    CHECK_0251 -->|No| CHECK_SVCNO{Has svcKeiNo?}
    CHECK_SVCNO -->|Yes| GET_SVCKEI["getSvcKeiInfo - Get Service Contract Info"]
    GET_SVCKEI --> FILL_WORKMAP["Fill dataMap with svc_kei_no, gene_add_dtm, mskm_dtl_no, prc_grp_cd, pcrs_cd, svc_kei_stat, pplan_cd"]
    FILL_WORKMAP --> SET_DATA["setData(HAKKOSODCCWORKMAP, dataMap)"]
    SET_DATA --> GET_KKOP_SVC_CD["Get kkopSvcCd"]
    GET_SVCKEI --> GET_KKOP_SVC_CD
    CHECK_SVCNO -->|No| GET_KKOP_SVC_CD

    GET_KKOP_SVC_CD --> CHECK_ROUTER_LAST{"takino_dsl_flg == 1 AND is last item?"}
    CHECK_ROUTER_LAST -->|Yes - Router Last Item| CHECK_KKOP_TYPE{KKOP_SVC_CD == G01 or G02?}
    CHECK_ROUTER_LAST -->|No - Multi-function Change| CHECK_OTHER_TYPE{KKOP_SVC_CD == G01 or G02?}

    CHECK_KKOP_TYPE -->|G01 BBR Router| ROUTER_BBR_LAST["getSvcKeiUtwkListForAdd"]
    ROUTER_BBR_LAST --> STORE_ROUTER_LAST["Store router data to instance vars"]
    STORE_ROUTER_LAST --> ADD_ODR_419["addSOD ODR_NAIYO_CD_419 - Router Setup/Cancel"]
    ADD_ODR_419 --> ADD_ODR_420["addSOD ODR_NAIYO_CD_420 - Router Setup/Cancellation"]
    ADD_ODR_420 --> NEXT_ITER

    CHECK_KKOP_TYPE -->|G02 VA| VA_HANDLER["getSvcKeiUtwkListForAdd"]
    VA_HANDLER --> STORE_VA_LAST["Store VA data to instance vars"]
    STORE_VA_LAST --> ADD_ODR_421["addSOD ODR_NAIYO_CD_421 - VA Cancel"]
    ADD_ODR_421 --> ADD_ODR_422["addSOD ODR_NAIYO_CD_422 - VA Cancellation"]
    ADD_ODR_422 --> NEXT_ITER

    CHECK_OTHER_TYPE -->|G01 BBR Router| ROUTER_OTHER["getSvcKeiUtwkListForAdd"]
    ROUTER_OTHER --> STORE_ROUTER_OTHER["Store router data to instance vars"]
    STORE_ROUTER_OTHER --> ADD_BBR_FUNC["addSodBbrFuncToMfr - BBR Router SOD"]
    ADD_BBR_FUNC --> NEXT_ITER

    CHECK_OTHER_TYPE -->|G02 VA| VA_OTHER["getSvcKeiUtwkListForAdd"]
    VA_OTHER --> STORE_VA_OTHER["Store VA data to instance vars"]
    STORE_VA_OTHER --> ADD_ODR_417["addSOD ODR_NAIYO_CD_417 - VA Cancel"]
    ADD_ODR_417 --> NEXT_ITER

    NEXT_ITER --> LOOP
    RETURN_P --> END_X(["Return param"])
```

**CRITICAL - Constant Resolution:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|------------------|
| `KKOP_SVC_CD_BBR` | `"G01"` | Equipment Option Service Code = Broad Band Router |
| `KKOP_SVC_CD_VA` | `"G02"` | Equipment Option Service Code = Voice/VA |
| `ODR_NAIYO_CD_419` | `"419"` | Multi-function Router Setup/Cancel (Router Function/Cancel) |
| `ODR_NAIYO_CD_420` | `"420"` | Multi-function Router Setup/Cancellation (Router Function/Cancellation) |
| `ODR_NAIYO_CD_421` | `"421"` | Multi-function Router Setup/Cancel (VA Function/Cancel) |
| `ODR_NAIYO_CD_422` | `"422"` | Multi-function Router Setup/Cancellation (VA Function/Cancellation) |
| `ODR_NAIYO_CD_417` | `"417"` | Multi-function Router Setup/Cancel (VA Function/Cancel) - non-last-item path |
| `ORDER_SBT_CD_TEL` | `"1"` | Order Sub-service Type = TEL (from JKKHakkoSODConstCC) |
| `SVC_ORDER_CD_MRT` | `"MRT"` | Service Order Code = MRT |
| `KKTK_SVC_CD_MFR` | `"C024"` | Equipment Provider Service Code = Multi-function Router |
| `TAKNKIKI_SBT_CD_MFR` | `"R0"` | Home Equipment Type Code = Multi-function Router |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session manager handle carrying database connection context, transaction state, and thread-local session context. Used to execute SC calls and data lookups against the telecom billing database. |
| 2 | `param` | `IRequestParameterReadWrite` | Parameter object containing the model group data map and control map (return codes, messages). It is read, modified, and returned to carry SOD work maps (e.g., `svc_kei_no`, `gene_add_dtm`, `prc_grp_cd`, `pcrs_cd`, `pplan_cd`, `mskm_dtl_no`) populated during service contract info retrieval. |
| 3 | `fixedText` | `String` | User-defined arbitrary string - passed through for tracing/debugging; used as a key in the caller to locate user data in the param data map. |
| 4 | `sodMap` | `HashMap<String, Object>` | SOD (Service Order Data) map carrying the cancellation context. Key `KKOP_TRGT_DATA_LIST` contains an `ArrayList<HashMap>` of target equipment option service contract data items to be processed for cancellation. |

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

| Field | Type | Business Description |
|-------|------|---------------------|
| `svc_kei_kaisen_ucwk_no` | `String` | Service contract line item number (回線内線番号) - internal tracking for service contract modifications |
| `kktk_svc_kei_no[]` | `String[]` | Equipment provider service contract number - the service contract assigned by the equipment vendor |
| `kktk_svc_kei_gadtm[]` | `String[]` | Equipment provider service contract generation registration datetime |
| `taknkiki_model_cd[]` | `String[]` | Home equipment model code - identifies the physical router/ONT model |
| `kiki_seizo_no[]` | `String[]` | Equipment serial number - unique manufacturing identifier for the physical device |
| `kkop_svc_kei_router[]` | `String[]` | Equipment option service contract number (Router) - the router-related service contract |
| `kkop_svc_kei_router_gadtm[]` | `String[]` | Equipment option service contract (Router) generation datetime |
| `kkop_svc_kei_va[]` | `String[]` | Equipment option service contract number (VA) - the VA service contract |
| `kkop_svc_kei_va_gadtm[]` | `String[]` | Equipment option service contract (VA) generation datetime |
| `svc_kei_kaisen_ucwk_gadtm` | `String` | Service contract line item generation datetime |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKAdchgCancelHakkoSODCC.getSameTrnNo` | N/A | N/A | Calls `getSameTrnNo` to obtain a unified processing number for deduplication |
| R | `runEKK2811A010` | EKK2811A010SC | KK_T_KKOP_SVC_KEI (Equipment Option Service Contract) | Calls `runEKK2811A010` to retrieve equipment option service contract data by service key number |
| R | `runEKK0341A010Current` | EKK0341A010SC | KK_T_KKTK_SVC_KEI (Equipment Provider Service Contract) | Calls `runEKK0341A010Current` to retrieve equipment provider service contract info including model code and serial number |
| R | `callEKK1041B001SC` | EKK1041B001SC | KK_T_ODR_HAKKOU_JOKEN (Order Issuance Conditions) | Calls SC to check order eligibility; returns required type code (RCNT_YOKYU_SBT_CD) for order processing |
| R | `runEKK0251A010` | EKK0251A010SC | KK_T_SVC_KEI_KAISEN_UCWK (Service Contract Line Item) | Calls `runEKK0251A010` to get service contract modification data |
| R | `JKKAdchgCancelHakkoSODCC.getSvcKeiInfo` | N/A | KK_T_SVC_KEI (Service Contract) | Calls `getSvcKeiInfo` to retrieve service contract agreement details (generation datetime, price group code, cost code, status, pricing plan) |
| - | `JKKAdchgCancelHakkoSODCC.isBlank` | N/A | N/A | Utility call to check if a string is null or blank |
| - | `setData` (HAKKOSODCCWORKMAP) | N/A | N/A | Sets the work map with service contract info including `gene_add_dtm`, `mskm_dtl_no`, `prc_grp_cd`, `pcrs_cd`, `svc_kei_stat`, `pplan_cd` |
| R | `JKKAdchgCancelHakkoSODCC.getSvcKeiUtwkListForAdd` | N/A | KK_T_SVC_KEI_UCWK (Service Contract Line Items) | Calls `getSvcKeiUtwkListForAdd` to retrieve the service contract line item list for SOD preparation |
| C | `JKKAdchgCancelHakkoSODCC.addSOD` | N/A | KK_T_SVC_ORDER (Service Order Data) | Calls `addSOD` to create/register SODs with specific order content codes (419, 420, 421, 422, 417) |
| C | `JKKAdchgCancelHakkoSODCC.addSodBbrFuncToMfr` | N/A | KK_T_SVC_ORDER (Service Order Data) | Calls `addSodBbrFuncToMfr` to generate SOD for BBR Multi-function Router equipment |

**How to classify:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `getSameTrnNo` | N/A | N/A | Read unified processing number for deduplication |
| R | `runEKK2811A010` | EKK2811A010SC | KK_T_KKOP_SVC_KEI | Read equipment option service contract data |
| R | `runEKK0341A010Current` | EKK0341A010SC | KK_T_KKTK_SVC_KEI | Read equipment provider service contract info with model/serial |
| R | `callEKK1041B001SC` | EKK1041B001SC | KK_T_ODR_HAKKOU_JOKEN | Read order eligibility check for TEL service type |
| R | `runEKK0251A010` | EKK0251A010SC | KK_T_SVC_KEI_KAISEN_UCWK | Read service contract modification data |
| R | `getSvcKeiInfo` | N/A | KK_T_SVC_KEI | Read service contract agreement details with generation timestamp |
| - | `setData(HAKKOSODCCWORKMAP)` | N/A | N/A | Set parameter work map with contract metadata |
| R | `getSvcKeiUtwkListForAdd` | N/A | KK_T_SVC_KEI_UCWK | Read service contract line item list for SOD preparation |
| C | `addSOD` | N/A | KK_T_SVC_ORDER | Create SOD records for router/VA cancellation orders |
| C | `addSodBbrFuncToMfr` | N/A | KK_T_SVC_ORDER | Create BBR multi-function router SOD records |

## 5. Dependency Trace

### Callers:

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | JKKAdchgCancelHakkoSODCC.cancel() | `cancel` -> `kktkDslOdrCtrl(handle, param, fixedText, sodMap)` | `addSOD [C] KK_T_SVC_ORDER`, `addSodBbrFuncToMfr [C] KK_T_SVC_ORDER`, `getSvcKeiUtwkListForAdd [R] KK_T_SVC_KEI_UCWK`, `runEKK2811A010 [R] KK_T_KKOP_SVC_KEI`, `runEKK0341A010Current [R] KK_T_KKTK_SVC_KEI`, `callEKK1041B001SC [R] KK_T_ODR_HAKKOU_JOKEN`, `runEKK0251A010 [R] KK_T_SVC_KEI_KAISEN_UCWK`, `getSvcKeiInfo [R] KK_T_SVC_KEI` |

**Terminal operations from this method:**
`addSOD` [C], `getSvcKeiUtwkListForAdd` [R], `addSodBbrFuncToMfr` [C], `addSOD` [C], `addSOD` [C], `getSvcKeiUtwkListForAdd` [R], `addSOD` [C], `addSOD` [C], `getSvcKeiUtwkListForAdd` [R], `addSOD` [C], `setData` [-], `getSvcKeiInfo` [R], `isBlank` [-]

This method is called from within the `cancel()` method of `JKKAdchgCancelHakkoSODCC` itself (same class, line ~22854). No external screen or batch entry points were found within 8 hops. The `cancel()` method is the entry point for residential change SOD cancellation processing, invoked by the broader workflow when a customer's address change triggers equipment cancellation.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET/INIT] (L22886)

| # | Type | Code |
|---|------|------|
| 1 | SET | `statusCode = 0` // Service interaction phase execution status |
| 2 | CALL | `getSameTrnNo(handle, param)` // Obtain unified processing number for deduplication [L22891] |

**Block 2** — [CAST/GET] Extract target data list (L22894)

| # | Type | Code |
|---|------|------|
| 1 | SET | `kkop_trgt_data_list = (ArrayList<HashMap>) sodMap.get(JKKAdchgHakkoSODConstCC.KKOP_TRGT_DATA_LIST)` // Equipment Option Service Contract target data list |
| 2 | IF-ELSE | If `kkop_trgt_data_list` is null -> return param immediately [L22896] |

**Block 3** — [FOR LOOP] Iterate over `kkop_trgt_data_list` (L22898)

| # | Type | Code |
|---|------|------|
| 1 | SET | `cnt = 0` // Loop counter [L22899] |
| 2 | SET | `cnt++` // Increment per iteration [L22902] |
| 3 | IF | If `kkopMap == null || kkopMap.isEmpty()` -> continue [L22904] |

**Block 3.1** — [SET/CALL] Get Equipment Option Service Contract (L22909)

| # | Type | Code |
|---|------|------|
| 1 | SET | `kkopSvcKeiNo = kkopMap.get(JKKAdchgHakkoSODConstCC.INFO_CHBF_KKOPSVKEI_NO)` // Equipment option service contract number |
| 2 | CALL | `kkop_svc_kei_map = runEKK2811A010(param, handle, kkopSvcKeiNo)` // Get Equipment Option Service Contract [L22910] |
| 3 | IF | If `kkop_svc_kei_map` is null/empty -> continue [L22911] |

**Block 3.2** — [CALL] Get Equipment Provider Service Contract (L22916)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `kktkSvcKeiMap = runEKK0341A010Current(param, handle, kkop_svc_kei_map.get(KKTK_SVC_KEI_NO))` // Get Service Contract Info [L22917] |
| 2 | IF | If `kktkSvcKeiMap` is null/empty -> continue [L22918] |

**Block 3.3** — [IF] Check Model and Serial Number (L22923)

> 型番・製造番未設定は対象外 (Equipment without model number or serial number is excluded)

| # | Type | Code |
|---|------|------|
| 1 | SET | `taknkikiModelCd = kktkSvcKeiMap.get(TAKNKIKI_MODEL_CD)` // Home equipment model code |
| 2 | SET | `kikiSeizoNo = kktkSvcKeiMap.get(KIKI_SEIZO_NO)` // Equipment serial number |
| 3 | IF | If `isEmpty(taknkikiModelCd) || isEmpty(kikiSeizoNo)` -> continue [L22925] |

**Block 3.4** — [CALL] Check Order Settings (L22929)

| # | Type | Code |
|---|------|------|
| 1 | SET | `resultOdrSet = new ArrayList<HashMap>()` [L22930] |
| 2 | CALL | `resultOdrSet = callEKK1041B001SC(param, handle, ORDER_SBT_CD_TEL, SVC_ORDER_CD_MRT, null, null, taknkikiModelCd, kikiSeizoNo)` // Check TEL service order settings [L22932] |
| 3 | IF | If `resultOdrSet` is null/empty -> continue (多機能ルーター保持で、オーダーが発行される前 = Router holding, order not yet issued) [L22936] |

**Block 3.5** — [IF] Check Request Type Code (L22941)

> 最新要求種類コードが解約・消去は処理対象外 (Latest request type code of cancel/deletion is not a processing target)

| # | Type | Code |
|---|------|------|
| 1 | SET | `rcntYokyuSbtCd = resultOdrSet.get(0).get(RCNT_YOKYU_SBT_CD)` // Latest request type code |
| 2 | IF | If `rcntYokyuSbtCd` matches `"0[38]"` (code `03` or `08`) -> continue [L22943] |

**Block 3.6** — [SET/CALL] Assign Kaisen (Line) Number (L22948)

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.svc_kei_kaisen_ucwk_no = kktkSvcKeiMap.get(SVC_KEI_KAISEN_UCWK_NO)` // Service contract line item number [L22948] |
| 2 | CALL | `ekk0251a010Map = runEKK0251A010(param, handle, svc_kei_kaisen_ucwk_no)` // Get Service Contract Modification [L22949] |
| 3 | IF | If `ekk0251a010Map` is null/empty -> continue [L22950] |

**Block 3.7** — [IF-ELSE] Has svcKeiNo (L22955)

> サービス契約情報を取得 / Get Service Contract Information

| # | Type | Code |
|---|------|------|
| 1 | IF | If `!isBlank(kkopMap.get("svcKeiNo"))` [L22955] |
| 2 | SET | `dataMap = param.getData(HAKKOSODCCWORKMAP)` |
| 3 | SET | `dataMap.put("svc_kei_no", kkopMap.get("svcKeiNo"))` |
| 4 | CALL | `svckeiMap = getSvcKeiInfo(handle, param)` // Service contract agreement processing [L22960] |
| 5 | SET | `dataMap.put("svkei_gadtm", svckeiMap.get("gene_add_dtm"))` // Service contract generation registration datetime [L22961] |
| 6 | SET | `this.mskm_dtl_no = svckeiMap.get(INFO_MSKM_DTL_NO)` // Application detail number [L22962] |
| 7 | SET | `this.prc_grp_cd = svckeiMap.get("prc_grp_cd")` // Price group code [L22963] |
| 8 | SET | `this.pcrs_cd = svckeiMap.get("pcrs_cd")` // Price cost code [L22964] |
| 9 | SET | `this.svc_kei_stat = svckeiMap.get("svc_kei_stat")` // Service contract status [L22965] |
| 10 | SET | `this.svc_kei_no1 = kkopMap.get("svcKeiNo")` // Service contract number [L22966] |
| 11 | SET | `this.pplan_cd = svckeiMap.get("pplan_cd")` // Price plan code (ANK-2765 ADD) [L22968] |
| 12 | EXEC | `param.setData(HAKKOSODCCWORKMAP, dataMap)` [L22970] |

**Block 3.8** — [GET] Extract `kkopSvcCd` (L22974)

| # | Type | Code |
|---|------|------|
| 1 | SET | `kkopSvcCd = kkop_svc_kei_map.get(KKOP_SVC_CD)` [L22974] |

**Block 4** — [IF-ELSE] Main Routing Decision (L22978)

> 多機能解約フラグON かつ 最終データの場合、多機能解約オーダ / When multi-function cancel flag is ON and last data, issue multi-function cancel order

| # | Type | Code |
|---|------|------|
| 1 | IF | If `takino_dsl_flg == "1" AND cnt == kkop_trgt_data_list.size()` -> Router Last Item Path (L22978) |
| 2 | ELSE | Multi-function Change Order Path (L22999) |

### Block 4.1 — Router Last Item Path (L22978)

**Block 4.1.1** — [IF] BBR Router Check (`KKOP_SVC_CD_BBR` == `"G01"`) (L22982)

> ルーター機能 / Router function

| # | Type | Code |
|---|------|------|
| 1 | IF | `KKOP_SVC_CD_BBR.equals(kkopSvcCd)` [L22982] |
| 2 | CALL | `param = getSvcKeiUtwkListForAdd(handle, param)` // Service contract line item list reference [L22985] |
| 3 | SET | `this.kktk_svc_kei_no[0] = kktkSvcKeiMap.get(KKTK_SVC_KEI_NO)` // Equipment provider service contract number [L22987] |
| 4 | SET | `this.kktk_svc_kei_gadtm[0] = kktkSvcKeiMap.get(GENE_ADD_DTM)` // Generation registration datetime [L22988] |
| 5 | SET | `this.taknkiki_model_cd[0] = kktkSvcKeiMap.get(TAKNKIKI_MODEL_CD)` // Home equipment model code [L22989] |
| 6 | SET | `this.kiki_seizo_no[0] = kktkSvcKeiMap.get(KIKI_SEIZO_NO)` // Equipment serial number [L22990] |
| 7 | SET | `this.kkop_svc_kei_router[0] = kkop_svc_kei_map.get(KKOP_SVC_KEI_NO)` // Equipment option service contract number (Router) [L22993] |
| 8 | SET | `this.kkop_svc_kei_router_gadtm[0] = kkop_svc_kei_map.get(GENE_ADD_DTM)` // Router generation datetime [L22995] |
| 9 | SET | `this.kkop_svc_kei_va[0] = ""` // Equipment option service contract number (VA) - cleared [L22997] |
| 10 | SET | `this.kkop_svc_kei_va_gadtm[0] = ""` // VA generation datetime - cleared [L22999] |
| 11 | SET | `this.svc_kei_kaisen_ucwk_no = kktkSvcKeiMap.get(SVC_KEI_KAISEN_UCWK_NO)` // Service contract line item number [L23001] |
| 12 | SET | `this.svc_kei_kaisen_ucwk_gadtm = ekk0251a010Map.get(GENE_ADD_DTM)` // Line item generation datetime [L23002] |
| 13 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_419)` // Multi-function Router Setup/Cancel (Router/Cancel) [L23005] |
| 14 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_420)` // Multi-function Router Setup/Cancellation (Router/Cancellation) [L23007] |

**Block 4.1.2** — [IF-ELSE] VA Function (`KKOP_SVC_CD_VA` == `"G02"`) (L23010)

> VA機能 / VA function

| # | Type | Code |
|---|------|------|
| 1 | IF | `KKOP_SVC_CD_VA.equals(kkopSvcCd)` [L23010] |
| 2 | CALL | `param = getSvcKeiUtwkListForAdd(handle, param)` [L23013] |
| 3 | SET | `this.kktk_svc_kei_no = new String[1]` [L23015] |
| 4 | SET | `this.kktk_svc_kei_no[0] = kktkSvcKeiMap.get(KKTK_SVC_KEI_NO)` [L23016] |
| 5 | SET | `this.kktk_svc_kei_gadtm = new String[1]` [L23017] |
| 6 | SET | `this.kktk_svc_kei_gadtm[0] = kktkSvcKeiMap.get(GENE_ADD_DTM)` [L23018] |
| 7 | SET | `this.taknkiki_model_cd = new String[1]` [L23019] |
| 8 | SET | `this.taknkiki_model_cd[0] = kktkSvcKeiMap.get(TAKNKIKI_MODEL_CD)` [L23020] |
| 9 | SET | `this.kiki_seizo_no = new String[1]` [L23021] |
| 10 | SET | `this.kiki_seizo_no[0] = kktkSvcKeiMap.get(KIKI_SEIZO_NO)` [L23022] |
| 11 | SET | `this.kkop_svc_kei_router[0] = ""` // Router - cleared [L23024] |
| 12 | SET | `this.kkop_svc_kei_router_gadtm[0] = ""` // Router generation - cleared [L23026] |
| 13 | SET | `this.kkop_svc_kei_va[0] = kkop_svc_kei_map.get(KKOP_SVC_KEI_NO)` // VA contract number [L23028] |
| 14 | SET | `this.kkop_svc_kei_va_gadtm[0] = kkop_svc_kei_map.get(GENE_ADD_DTM)` // VA generation datetime [L23030] |
| 15 | SET | `this.svc_kei_kaisen_ucwk_no = kktkSvcKeiMap.get(SVC_KEI_KAISEN_UCWK_NO)` [L23032] |
| 16 | SET | `this.svc_kei_kaisen_ucwk_gadtm = ekk0251a010Map.get(GENE_ADD_DTM)` [L23034] |
| 17 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_421)` // OLS Setup/Cancel [L23038] |
| 18 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_422)` // OLS Setup/Cancellation [L23039] |

### Block 5 — Multi-function Change Order Path (else) (L22999)

> 以外は多機能変更オーダ / Otherwise: multi-function change order

**Block 5.1** — [IF] BBR Router Check (`KKOP_SVC_CD_BBR` == `"G01"`) (L23003)

> ルーター機能 / Router function

| # | Type | Code |
|---|------|------|
| 1 | IF | `KKOP_SVC_CD_BBR.equals(kkopSvcCd)` [L23003] |
| 2 | CALL | `param = getSvcKeiUtwkListForAdd(handle, param)` // Service contract line item list reference [L23006] |
| 3 | SET | `this.kkop_svc_kei_router[0] = kkop_svc_kei_map.get(KKOP_SVC_KEI_NO)` // Router contract number [L23009] |
| 4 | SET | `this.kkop_svc_kei_router_gadtm[0] = kkop_svc_kei_map.get(GENE_ADD_DTM)` // Router generation datetime [L23011] |
| 5 | SET | `this.kkop_svc_kei_va[0] = ""` // VA - cleared [L23013] |
| 6 | SET | `this.kkop_svc_kei_va_gadtm[0] = ""` // VA generation - cleared [L23015] |
| 7 | SET | `this.svc_kei_kaisen_ucwk_no = kktkSvcKeiMap.get(SVC_KEI_KAISEN_UCWK_NO)` // Line item number [L23017] |
| 8 | SET | `this.kktk_svc_kei_no[0] = kktkSvcKeiMap.get(KKTK_SVC_KEI_NO)` // Equipment provider service contract number [L23019] |
| 9 | SET | `this.kktk_svc_kei_gadtm[0] = kktkSvcKeiMap.get(GENE_ADD_DTM)` [L23020] |
| 10 | SET | `this.taknkiki_model_cd[0] = kktkSvcKeiMap.get(TAKNKIKI_MODEL_CD)` [L23021] |
| 11 | SET | `this.kiki_seizo_no[0] = kktkSvcKeiMap.get(KIKI_SEIZO_NO)` [L23022] |
| 12 | CALL | `addSodBbrFuncToMfr(handle, param)` // Generate SOD for BBR multi-function router [L23025] |
| 13 | SET | `this.kkop_svc_kei_router[0] = ""` // Clear router [L23028] |
| 14 | SET | `this.kkop_svc_kei_router_gadtm[0] = ""` // Clear router generation datetime [L23030] |

**Block 5.2** — [IF-ELSE] VA Function (`KKOP_SVC_CD_VA` == `"G02"`) (L23033)

> VA機能 / VA function

| # | Type | Code |
|---|------|------|
| 1 | IF | `KKOP_SVC_CD_VA.equals(kkopSvcCd)` [L23033] |
| 2 | CALL | `param = getSvcKeiUtwkListForAdd(handle, param)` [L23036] |
| 3 | SET | `this.kktk_svc_kei_no = new String[1]` [L23038] |
| 4 | SET | `this.kktk_svc_kei_no[0] = kktkSvcKeiMap.get(KKTK_SVC_KEI_NO)` [L23039] |
| 5 | SET | `this.kktk_svc_kei_gadtm = new String[1]` [L23040] |
| 6 | SET | `this.kktk_svc_kei_gadtm[0] = kktkSvcKeiMap.get(GENE_ADD_DTM)` [L23041] |
| 7 | SET | `this.taknkiki_model_cd = new String[1]` [L23042] |
| 8 | SET | `this.taknkiki_model_cd[0] = kktkSvcKeiMap.get(TAKNKIKI_MODEL_CD)` [L23043] |
| 9 | SET | `this.kiki_seizo_no = new String[1]` [L23044] |
| 10 | SET | `this.kiki_seizo_no[0] = kktkSvcKeiMap.get(KIKI_SEIZO_NO)` [L23045] |
| 11 | SET | `this.kkop_svc_kei_router[0] = ""` // Router - cleared [L23047] |
| 12 | SET | `this.kkop_svc_kei_router_gadtm[0] = ""` // Router generation - cleared [L23049] |
| 13 | SET | `this.kkop_svc_kei_va[0] = kkop_svc_kei_map.get(KKOP_SVC_KEI_NO)` // VA contract number [L23051] |
| 14 | SET | `this.kkop_svc_kei_va_gadtm[0] = kkop_svc_kei_map.get(GENE_ADD_DTM)` // VA generation datetime [L23053] |
| 15 | SET | `this.svc_kei_kaisen_ucwk_no = kktkSvcKeiMap.get(SVC_KEI_KAISEN_UCWK_NO)` [L23055] |
| 16 | SET | `this.svc_kei_kaisen_ucwk_gadtm = ekk0251a010Map.get(GENE_ADD_DTM)` [L23057] |
| 17 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_417)` // Multi-function Router Setup/Cancel (VA/Cancel) [L23060] |

**Block 6** — [RETURN] (L23065)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `param` // Return updated parameter object [L23065] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `kkop_trgt_data_list` | Field | Equipment Option Service Contract target data list - list of service contracts to process for cancellation |
| `kkopSvcKeiNo` | Field | Equipment option service contract number - internal identifier for an equipment-related service contract |
| `kkopSvcCd` | Field | Equipment option service contract code - classifies the type of equipment option service (G01 = BBR Router, G02 = VA) |
| `kkop_svc_kei_router` | Field | Equipment option service contract number (Router) - router-related service contract number |
| `kkop_svc_kei_router_gadtm` | Field | Equipment option service contract (Router) generation registration datetime |
| `kkop_svc_kei_va` | Field | Equipment option service contract number (VA) - VA service contract number |
| `kkop_svc_kei_va_gadtm` | Field | Equipment option service contract (VA) generation registration datetime |
| `taknkiki_model_cd` | Field | Home equipment model code (宅内機器型式コード) - identifies the physical router/ONT model type |
| `kiki_seizo_no` | Field | Equipment serial number (機器製造番号) - unique manufacturing identifier for the physical device |
| `kktk_svc_kei_no` | Field | Equipment provider service contract number (機器提供サービス契約番号) - service contract assigned by the equipment vendor |
| `kktk_svc_kei_gadtm` | Field | Equipment provider service contract generation registration datetime |
| `svc_kei_kaisen_ucwk_no` | Field | Service contract line item number (サービス契約回線内線番号) - internal tracking for service contract modifications |
| `svc_kei_kaisen_ucwk_gadtm` | Field | Service contract line item generation datetime |
| `svc_kei_no` | Field | Service contract number (サービス契約番号) - the primary service contract identifier |
| `svc_kei_stat` | Field | Service contract status (サービス契約ステータス) - current state of the service contract |
| `gene_add_dtm` | Field | Generation registration datetime (世代登録年月日時刻) - audit timestamp for service contract records |
| `mskm_dtl_no` | Field | Application detail number (申請詳細番号) - internal detail number for the service application |
| `prc_grp_cd` | Field | Price group code (料金グループコード) - pricing category code for the service |
| `pcrs_cd` | Field | Price cost code (料金コースコード) - specific pricing tier/code |
| `pplan_cd` | Field | Price plan code (料金プランコード) - subscription plan code |
| `takino_dsl_flg` | Field | Multi-function cancel flag (多機能解約フラグ) - indicates whether this is a final multi-function router cancellation item |
| `rcntYokyuSbtCd` | Field | Latest request type code (最新要求種類コード) - identifies the type of request; `03` or `08` means cancel/deletion (not processed here) |
| KKOP_SVC_CD_BBR | Constant | Equipment Option Service Code = G01 (Broad Band Router) |
| KKOP_SVC_CD_VA | Constant | Equipment Option Service Code = G02 (Voice/VA) |
| ODR_NAIYO_CD_419 | Constant | Order content code = 419: Multi-function Router Setup/Cancel (Router Function/Cancel) |
| ODR_NAIYO_CD_420 | Constant | Order content code = 420: Multi-function Router Setup/Cancellation (Router Function/Cancellation) |
| ODR_NAIYO_CD_421 | Constant | Order content code = 421: Multi-function Router Setup/Cancel (VA Function/Cancel) |
| ODR_NAIYO_CD_422 | Constant | Order content code = 422: Multi-function Router Setup/Cancellation (VA Function/Cancellation) |
| ODR_NAIYO_CD_417 | Constant | Order content code = 417: Multi-function Router Setup/Cancel (VA Function/Cancel) - non-last-item path |
| ODR_NAIYO_CD_401-424 | Constant | Order content codes for multi-function router operations (setup, change, cancel, cancellation, equipment return) |
| SOD | Acronym | Service Order Data - telecom order fulfillment entity representing a service order record |
| SODCC | Acronym | Service Order Data Cancel Component - component handling SOD cancellation |
| SC | Acronym | Service Component - enterprise service layer for database and business operations |
| CBS | Acronym | CBS (Central Business System) - core billing/telecom system |
| VA | Business term | Voice/VA (Value Added) service - VoIP and value-added telecommunication service |
| BBR | Business term | Broad Band Router - broadband router equipment provided by the operator |
| OLS | Business term | OLS (Optical Line Server/Service) - related to VA/cable services |
| FTTH | Business term | Fiber To The Home - fiber-optic internet service |
| G01 | Domain | Equipment Option Service Code for Broad Band Router |
| G02 | Domain | Equipment Option Service Code for VA service |
| EKK2811A010 | SC Code | Equipment Option Service Contract Inquiry SC |
| EKK0341A010 | SC Code | Equipment Provider Service Contract Inquiry SC |
| EKK1041B001 | SC Code | Order Settings Check SC |
| EKK0251A010 | SC Code | Service Contract Modification Inquiry SC |
| HAKKOSODCCWORKMAP | Constant | Work map key name in param data for cancellation SOD processing |
| KK_T_KKOP_SVC_KEI | Entity | Equipment Option Service Contract table |
| KK_T_KKTK_SVC_KEI | Entity | Equipment Provider Service Contract table |
| KK_T_SVC_KEI | Entity | Service Contract table |
| KK_T_SVC_KEI_UCWK | Entity | Service Contract Line Item table |
| KK_T_SVC_KEI_KAISEN_UCWK | Entity | Service Contract Line Modification table |
| KK_T_SVC_ORDER | Entity | Service Order Data table |
| KK_T_ODR_HAKKOU_JOKEN | Entity | Order Issuance Conditions table |
| SessionHandle | Technical | Database session/context handle for transaction management |
| IRequestParameterReadWrite | Technical | Interface for parameter passing between components (data map + control map) |
| runEKK2811A010 | Method | Retrieves equipment option service contract data |
| runEKK0341A010Current | Method | Retrieves current equipment provider service contract info |
| callEKK1041B001SC | Method | Checks order eligibility for TEL service type |
| runEKK0251A010 | Method | Retrieves service contract modification data |
| getSvcKeiInfo | Method | Retrieves detailed service contract agreement information |
| getSvcKeiUtwkListForAdd | Method | Retrieves service contract line item list for SOD preparation |
| addSOD | Method | Creates/registers a Service Order Data (SOD) record |
| addSodBbrFuncToMfr | Method | Generates SOD specifically for BBR multi-function router equipment |
| getSameTrnNo | Method | Obtains a unified processing number to prevent duplicate processing |
| isBlank | Method | Utility to check if a string is null or blank |
| 住所変更 | Business term | Residential Change - customer address change process |
| 機器解約 | Business term | Equipment Cancellation - cancellation of equipment-related service contracts |
| オーダ制御処理 | Business term | Order Control Processing - orchestrating and routing order issuance |
