# Business Logic — JKKAdchgHakkoSODCC.kikiDslOdrCtrl() [213 LOC]

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

## 1. Role

### JKKAdchgHakkoSODCC.kikiDslOdrCtrl()

This method implements the **equipment contract cancellation (解約) order control processing** for FTTH (Fiber To The Home) service lines within the Fujitsu telecom BSS platform. It is invoked as part of the broader `hakkoSODNet` flow when the equipment change type is "keep" (継続) or "modify" (変更) and the order execution division is "cancellation completion" (撤去完了).

The method performs a **routing/dispatch pattern** over the equipment provider service code (KKTK_SVC_CD) to handle three distinct scenarios: (1) **BBR (Broadband Router) cancellation**, where it checks whether an existing router order is already present and, if not, creates cancellation/deletion orders for the router connection info; (2) **Multi-Function Router (MRT) / Home Gateway (HGW) cancellation**, where it queries the equipment option service contracts for an embedded BBR service, performs a line consent meeting reconciliation, and generates multi-router setting/cancellation or setting/deletion orders depending on whether a prior MRT order exists; and (3) **early-exit paths** where the equipment is not a DSL-type cancellation, the equipment provider service is neither BBR nor MRT/HGW, or required fields (e.g., serial number) are missing.

In the MRT/HGW path, there is a special **service contract cancellation branch** triggered when `makeNaiyoCode405Flg` is set — this occurs when the device is not itself a DSL cancellation but the overall service contract is being cancelled. In that case, a single order with code 405 (Multi-Router Setting/Cancellation — Router Function, Cancellation) is created instead of separate 419/420 orders.

This method acts as a **shared utility** called from two entry points within `hakkoSODNet`, serving as the order-generation orchestration layer between the high-level change classification (`hakkoSODNet`) and the concrete `addSOD` order-creation calls. It does not directly access databases; all data operations go through the `addSOD` method and intermediate SC/CBS calls (`callEKK0341A010SC`, `runEKK2811B010`, `runEKK0251A010`, `getNetUcwkInfo`).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["kikiDslOdrCtrl handle param fixedText sodMap"])

    START --> EXTRACT["Extract SOD Maps from sodMap<br/>sod_kihon_info svc_kei_info kktsvkei_info"]

    EXTRACT --> SHKKA["shkkaMap Resolve map references"]

    SHKKA --> GET_PARAMS["Extract params sys_id ido_div svc_kei_no chbf_kktsvkei_no"]

    GET_PARAMS --> BLANK_CHK["chbf_kktsvkei_no isBlank?"]

    BLANK_CHK -- "true" --> EARLY_RET1["Return param skip no equipment service"]

    BLANK_CHK -- "false" --> KIKI_DSL_CHK["isKikiDsl param sodMap chbf_kktsvkei_no"]

    KIKI_DSL_CHK -- "false not kiki DSL" --> TAKINOU_CHK["isTakinouRouter AND isKkopSvcDsl"]

    KIKI_DSL_CHK -- "true is kiki DSL" --> SVC_KIND_CHK["jdgSvcKind get svc_kind"]

    TAKINOU_CHK -- "false" --> EARLY_RET1

    TAKINOU_CHK -- "true" --> SET_405["Set makeNaiyoCode405Flg=true<br/>Service contract cancellation"]

    SET_405 --> SVC_KIND_CHK

    SVC_KIND_CHK --> NET_CHK["svc_kind equals SVC_KIND_NET EO Light Network"]

    NET_CHK -- "false" --> FINAL_RET["Return param"]

    NET_CHK -- "true" --> CALL_EKK0341["callEKK0341A010SC Equipment provider service consent meeting"]

    CALL_EKK0341 --> EKK0341_ERR{"statusCode not equal 0"}

    EKK0341_ERR -- "true" --> THROW_ERR["Throw CCException SC call failure"]

    EKK0341_ERR -- "false" --> EXTRACT_RESULT["Extract result EKK0341A010SCHash"]

    EXTRACT_RESULT --> BBR_CHK{"tmp_kktk_svc_cd BBR C014<br/>AND not makeNaiyoCode405Flg"}

    BBR_CHK -- "true" --> SEIZO_CHK{"kk_kiki_seizo_no isBlank"}

    SEIZO_CHK -- "true" --> EARLY_RET1

    SEIZO_CHK -- "false" --> DSL_EXIST_CHK["isDslOrderExist2 SVC_ORDER_CD_ROUTER"]

    DSL_EXIST_CHK -- "false no router order" --> ADD_149["addSOD ODR_NAIYO_CD_149 Router connection cancellation"]

    ADD_149 --> ADD_150["addSOD ODR_NAIYO_CD_150 Router connection deletion"]

    ADD_150 --> CONTINUE

    DSL_EXIST_CHK -- "true router order exists" --> CONTINUE

    BBR_CHK -- "false" --> MFR_CHK{"tmp_kktk_svc_cd MFR OR HGW C025"}

    MFR_CHK -- "false" --> CONTINUE

    MFR_CHK -- "true" --> MANS_CHK{"isMansHhsSwchflg empty"}

    MANS_CHK -- "true not maintenance" --> RUN_EKK2811["runEKK2811B010 Equipment option service contract list"]

    RUN_EKK2811 --> GET_KKOP["getKkOpSvcRec msgList KKOP_SVC_CD_BBR"]

    GET_KKOP --> KKOP_NULL{"ekk2811b010Map not null"}

    KKOP_NULL -- "null no BBR service" --> CONTINUE

    KKOP_NULL -- "not null BBR exists" --> KKOP_SEIZO_CHK{"kk_kiki_seizo_no isBlank"}

    KKOP_SEIZO_CHK -- "true" --> EARLY_RET1

    KKOP_SEIZO_CHK -- "false" --> EXTRACT_KKOP["Extract kktk and kkop fields from hash maps"]

    EXTRACT_KKOP --> RUN_EKK0251["runEKK0251A010 Line consent meeting"]

    RUN_EKK0251 --> GET_NET_UCWK["getNetUcwkInfo param fixedText adchg_no"]

    GET_NET_UCWK --> NET_UCWK_RESULT{"netUcwkInfoMap not null and not empty"}

    NET_UCWK_RESULT -- "true" --> SET_UCWK["Set svc_kei_ucwk_no and svc_kei_ucwk_gadtm"]

    SET_UCWK --> MAKE_405_CHK{"makeNaiyoCode405Flg true"}

    MAKE_405_CHK -- "true" --> ADD_405["addSOD ODR_NAIYO_CD_405 Multi-router setting cancellation"]

    ADD_405 --> CONTINUE

    MAKE_405_CHK -- "false" --> MRT_EXIST_CHK["isDslOrderExist2 SVC_ORDER_CD_MRT"]

    MRT_EXIST_CHK -- "false no MRT order" --> ADD_419["addSOD ODR_NAIYO_CD_419 Multi-router cancellation"]

    ADD_419 --> ADD_420["addSOD ODR_NAIYO_CD_420 Multi-router deletion"]

    ADD_420 --> CONTINUE

    MRT_EXIST_CHK -- "true MRT order exists" --> CONTINUE

    CONTINUE --> FINAL_RET
    THROW_ERR --> FINAL_RET

    style START fill:#e1f5fe
    style FINAL_RET fill:#c8e6c9
    style EARLY_RET1 fill:#c8e6c9
    style THROW_ERR fill:#ffcdd2
```

**CRITICAL — Constant Resolution:**

| Constant | Value | Business Meaning |
|----------|-------|-----------------|
| `SVC_KIND_NET` | `"1"` | Service type = EO Light Network (FTTH broadband) |
| `KKTK_SVC_CD_BBR` | `"C014"` | Equipment provider service code = BBR (Broadband Router) |
| `KKTK_SVC_CD_MFR` | (see constant file) | Equipment provider service code = Multi-Function Router |
| `KKTK_SVC_CD_HGW` | `"C025"` | Equipment provider service code = EO Home Gateway |
| `KKOP_SVC_CD_BBR` | (see constant file) | Equipment option service code = BBR router service |
| `ODR_NAIYO_CD_149` | (resolved from constant file) | Order content code: Router connection info — cancellation |
| `ODR_NAIYO_CD_150` | (resolved from constant file) | Order content code: Router connection info — deletion |
| `ODR_NAIYO_CD_405` | (resolved from constant file) | Order content code: Multi-Router Setting/Cancellation (router function, cancellation) |
| `ODR_NAIYO_CD_419` | (resolved from constant file) | Order content code: Multi-Router Setting/Cancellation (router function, cancellation) |
| `ODR_NAIYO_CD_420` | (resolved from constant file) | Order content code: Multi-Router Setting/Deletion (router function, cancellation) |
| `SVC_ORDER_CD_ROUTER` | (resolved from constant file) | Service order code for router-type orders |
| `SVC_ORDER_CD_MRT` | (resolved from constant file) | Service order code for MRT-type orders |
| `FUNC_CODE_1` | (resolved from constant file) | Function code = 1 for SC invocations |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session manager handle carrying the application context, database connections, and transaction state. Used to invoke SC/CBS calls and pass through to `addSOD` for order creation. |
| 2 | `param` | `IRequestParameterReadWrite` | Parameter object containing the model group and control map. It carries the full request context including service order parameters, control flags, and business data. It is both read from (for control maps) and written to (return value updated by `addSOD` calls). |
| 3 | `fixedText` | `String` | User-specified free-text string. Passed to `isTakinouRouter`, `isKkopSvcDsl`, `getNetUcwkInfo` for additional routing decisions and network work info lookups. |
| 4 | `sodMap` | `HashMap<String, Object>` | SOD (Service Order Data) map containing nested sub-maps for SOD basic info, service contract info, and equipment provider service contract info. Acts as the primary data source for extracting business fields (sysid, service contract number, equipment service numbers, timestamps). |

**External State / Instance Fields Read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `kktk_svc_kei_no` | `String[1]` | Equipment provider service contract number — holds the reference to the provider service line being cancelled |
| `kktk_svc_kei_gadtm` | `String[1]` | Equipment provider service contract generation registration timestamp — epoch for the provider service |
| `taknkiki_model_cd` | `String[1]` | In-house equipment model code — identifies the router/hardware model type |
| `kiki_seizo_no` | `String[1]` | Equipment manufacturing serial number — unique hardware identifier |
| `kkop_svc_kei_router` | `String[1]` | Equipment option service contract number (Router) — the router service contract within the option service |
| `kkop_svc_kei_router_gadtm` | `String[1]` | Equipment option service contract (Router) generation timestamp |
| `kkop_svc_kei_va` | `String[1]` | Equipment option service contract number (VA) — set to empty string, reserved for Virtual Adapter |
| `kkop_svc_kei_va_gadtm` | `String[1]` | Equipment option service contract (VA) generation timestamp |
| `svc_kei_kaisen_ucwk_no` | `String` | Service contract line detail number — internal tracking ID for the service line agreement |
| `svc_kei_kaisen_ucwk_gadtm` | `String` | Line detail agreement generation timestamp |
| `svc_kei_ucwk_no` | `String[1]` | Service contract detail number (post-change) — the new detail number after network work |
| `svc_kei_ucwk_gadtm` | `String[1]` | Service contract detail generation timestamp (post-change) |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `callEKK0341A010SC` | EKK0341A010SC | Equipment Provider Service Contract (KK_T_KKTSVKEI) | Queries equipment provider service contract consent meeting data for the pre-change equipment service using the service contract number and generation timestamp. Returns service code (BBR/MRT/HGW), serial number, model code, and contract details. |
| C | `addSOD` | (internal) | SOD (Service Order Data) table | Creates a service order data record with the specified order content code (149, 150, 405, 419, or 420). Called up to 2 times per branch for generating cancellation/deletion orders. |
| R | `runEKK2811B010` | EKK2811B010CBS | Equipment Option Service Contract (KK_T_KKOPSVKEI) | Retrieves the equipment option service contract list for a given provider service contract number. Returns CAANMsg array containing option service records. |
| R | `getKkOpSvcRec` | (internal) | Equipment Option Service data | Filters the EKK2811B010 result to extract records matching the BBR service code (KKOP_SVC_CD_BBR). Returns a map with router contract number and timestamp if found, null otherwise. |
| R | `runEKK0251A010` | EKK0251A010CBS | Service Contract Line Detail (KK_T_SVC_KEI_UCWK) | Performs line consent meeting reconciliation — queries the service contract line detail agreement to get the generation timestamp for the current line. |
| R | `getNetUcwkInfo` | (internal) | Network Work Information tables | Retrieves post-change network work information (svc_kei_ucwk_no, svc_kei_ucwk_dtm) using the change number (adchg_no). Fills the service contract detail number and generation timestamp. |
| - | `isBlank` | (internal) | - | Utility method checking if a String is null or empty. Used for validation of chbf_kktsvkei_no and kk_kiki_seizo_no. |
| - | `isKikiDsl` | (internal) | - | Determines if the equipment is a DSL-type cancellation based on service contract and parameter data. |
| - | `isTakinouRouter` | (internal) | - | Checks whether the equipment is a standalone router (takinou) by evaluating the equipment model and service contract. |
| - | `isKkopSvcDsl` | (internal) | - | Checks whether the equipment option service is DSL-type. |
| - | `isMansHhsSwchflg` | (internal) | - | Returns the maintenance fiber switch flag. An empty string indicates this is NOT a maintenance fiber swap (which would be an exclusion case for multi-function router handling). |
| - | `isDslOrderExist2` | (internal) | - | Checks whether an existing DSL order already exists for the given service/order parameters. Used to avoid duplicate order generation. |
| - | `jdgSvcKind` | (internal) | - | Determines the service type code (NET=1, TEL=2, MOB=4, etc.). Returns "1" for EO Light Network (FTTH). |
| - | `shkkaMap` | (internal) | - | Map resolution utility that dereferences SOD sub-maps. Ensures correct map object references. |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods (both within the same class `JKKAdchgHakkoSODCC`).
Terminal operations from this method: `addSOD` [C], `addSOD` [C], `isDslOrderExist2` [-], `addSOD` [C], `getNetUcwkInfo` [R], `runEKK0251A010` [-], `isBlank` [-], `getKkOpSvcRec` [R], `runEKK2811B010` [-], `isMansHhsSwchflg` [-], `addSOD` [C], `addSOD` [C], `isDslOrderExist2` [-], `isBlank` [-], `callEKK0341A010SC` [R], `jdgSvcKind` [-], `isKkopSvcDsl` [-], `isTakinouRouter` [-], `isKikiDsl` [-], `isBlank` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CC: `JKKAdchgHakkoSODCC.hakkoSODNet` (keep path) | `hakkoSODNet` -> `setParamKikiDslOdr` -> `kikiDslOdrCtrl` | `addSOD [C] SOD table` x5, `callEKK0341A010SC [R] KK_T_KKTSVKEI`, `runEKK2811B010 [R] KK_T_KKOPSVKEI`, `runEKK0251A010 [R] KK_T_SVC_KEI_UCWK`, `getNetUcwkInfo [R] Network Work tables` |
| 2 | CC: `JKKAdchgHakkoSODCC.hakkoSODNet` (modify path) | `hakkoSODNet` -> `setParamKikiDslOdr` -> `kikiDslOdrCtrl` | Same terminal operations as #1 |

Both callers are within the same class `JKKAdchgHakkoSODCC`, invoked from the `hakkoSODNet` method under two different branches:
- **Keep path (継続)**: When `jdgChgDivNet` equals `AD_CHG_CMT_KEEP` and `odr_exec_div` equals `ODR_EXEC_DIV_DSL_END` (cancellation completion).
- **Modify path (変更)**: When `jdgChgDivNet` equals `AD_CHG_CMT_MODIFY` and `odr_exec_div` equals `ODR_EXEC_DIV_DSL_END` (cancellation completion).

## 6. Per-Branch Detail Blocks

### Block 1 — EXTRACT (L25590)

> Extract SOD maps and resolve references. This prepares the data layer for all subsequent processing.

| # | Type | Code |
|---|------|------|
| 1 | EXTRACT | `sod_kihon_info_Map = (HashMap)sodMap.get(JKKHakkoSODConstCC.SOD_KIHON_INFO)` // SOD basic info [-> "sod_kihon_info"] |
| 2 | EXTRACT | `svc_kei_info_Map = (HashMap)sodMap.get(JKKHakkoSODConstCC.SVC_KEI_INFO)` // Service contract info [-> "svc_kei_info"] |
| 3 | EXTRACT | `kktsvkei_info_Map = (HashMap)sodMap.get(JKKHakkoSODConstCC.KKTSVKEI_INFO)` // Equipment provider service contract info [-> "kktsvkei_info"] |
| 4 | EXEC | `sod_kihon_info_Map = shkkaMap(sod_kihon_info_Map)` // Resolve map reference |
| 5 | EXEC | `svc_kei_info_Map = shkkaMap(svc_kei_info_Map)` // Resolve map reference |
| 6 | EXEC | `kktsvkei_info_Map = shkkaMap(kktsvkei_info_Map)` // Resolve map reference |

### Block 2 — PARAM EXTRACTION (L25602–25607)

> Extract specific business fields from the resolved maps. These form the input for all conditional branching.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sys_id = (String)sod_kihon_info_Map.get(JKKHakkoSODConstCC.INFO_SYSID)` // SYSID [-> "sysid"] |
| 2 | SET | `ido_div = (String)sod_kihon_info_Map.get(JKKHakkoSODConstCC.INFO_IDO_DIV)` // Move division [-> "ido_div"] |
| 3 | SET | `svc_kei_no = (String)svc_kei_info_Map.get(JKKHakkoSODConstCC.INFO_SVC_KEI_NO)` // Service contract number [-> "svc_kei_no"] |
| 4 | SET | `chbf_kktsvkei_no = (String)kktsvkei_info_Map.get(JKKHakkoSODConstCC.INFO_CHBF_KKTSVKEI_NO)` // Pre-change equipment provider service contract number [-> "chbf_kktsvkei_no"] |
| 5 | SET | `chbf_kktksvkei_gene_add_dtm = (String)kktsvkei_info_Map.get(JKKHakkoSODConstCC.INFO_CHBF_KKTSVKEI_GENE_ADD_DTM)` // Pre-change registration timestamp [-> "chbf_kktsvkei_gene_add_dtm"] |

### Block 3 — EARLY EXIT: NO EQUIPMENT SERVICE (L25617–25619)

> If the pre-change equipment provider service contract number is blank, skip processing entirely — this is not an equipment service line.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isBlank(chbf_kktsvkei_no)` // Equipment provider service not present |
| 2 | RETURN | `return param` // Skip processing |

### Block 4 — KIKI DSL CHECK (L25622–25636)

> Determine if this is a DSL-type equipment cancellation (機器解約). If NOT a kiki DSL, further check whether it is a router or equipment option DSL cancellation. This handles the case where the service contract is being cancelled but the device itself is not a DSL cancellation — in which case a code 405 order is needed.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!isKikiDsl(param, sodMap, chbf_kktsvkei_no)` // Not a DSL equipment cancellation |
| 2 | IF | `!isTakinouRouter(param, fixedText, chbf_kktsvkei_no) \|\| !isKkopSvcDsl(param, fixedText, handle, sodMap, chbf_kktsvkei_no)` // Not a standalone router OR not an equipment option DSL |
| 3 | RETURN | `return param` // Skip processing |
| 4 | ELSE | Set `makeNaiyoCode405Flg = true` // Service contract cancellation → create 405 order |
| 5 | ELSE_EXIT | Fall through to `jdgSvcKind()` |

### Block 5 — SERVICE TYPE DETERMINATION (L25642–25644)

> Determine the service type code. Since IT2-2016-0000004, uses `jdgSvcKind()` instead of the deprecated `jdgSvcKind_PcrsCd()`. This determines whether we are dealing with FTTH network (1), telephone (2), mobile (4), or other services.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `svc_kind = jdgSvcKind()` // Service type determination |

### Block 6 — EO LIGHT NETWORK BRANCH (L25647–25649)

> This entire processing block only executes for EO Light Network (FTTH) service type (SVC_KIND_NET = "1").

| # | Type | Code |
|---|------|------|
| 1 | IF | `JKKHakkoSODConstCC.SVC_KIND_NET.equals(svc_kind)` // EO Light Network (FTTH) |
| 2 | IF_EXIT | Enter Block 7 (BBR path) and Block 10 (MRT/HGW path) |
| 3 | ELSE | Fall through to final `return param` |

### Block 7 — BBR PATH: EQUIPMENT PROVIDER SERVICE CONSENT MEETING (L25651–25663)

> Call the equipment provider service consent meeting SC (EKK0341A010SC) to retrieve the equipment provider service details. This is the critical data source that determines which sub-branch to follow.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inHashKktk2 = new HashMap()` // Input map for SC call |
| 2 | SET | `resultHashKktk2 = new HashMap()` // Result map for SC call |
| 3 | EXEC | `inHashKktk2.put(JKKHakkoSODConstCC.KKTK_SVC_KEI_NO, chbf_kktsvkei_no)` // Pre-change equipment service number |
| 4 | EXEC | `inHashKktk2.put(JKKHakkoSODConstCC.GENE_ADD_DTM, chbf_kktksvkei_gene_add_dtm)` // Generation timestamp |
| 5 | CALL | `statusCode = callEKK0341A010SC(param, handle, inHashKktk2, resultHashKktk2, JKKHakkoSODConstCC.FUNC_CODE_1)` // SC call |
| 6 | IF | `statusCode != 0` // SC call failed |
| 7 | THROW | `throw new CCException("", new SCCallException("", String.valueOf(statusCode), statusCode))` |
| 8 | EXEC | `eKK0341A010SCHash = (HashMap)resultHashKktk2.get(JKKHakkoSODConstCC.TEMPLATE_ID_EKK0341A010)` // Extract result |

### Block 8 — BBR DEVICE CHECK (L25666–25676)

> Check if the equipment provider service code is BBR (C014) AND this is NOT a service-contract-level cancellation (makeNaiyoCode405Flg is false). If the serial number is blank, skip processing.

| # | Type | Code |
|---|------|------|
| 1 | IF | `JKKHakkoSODConstCC.KKTK_SVC_CD_BBR.equals(tmp_kktk_svc_cd) && !makeNaiyoCode405Flg` // BBR (C014) and not service cancellation route |
| 2 | SET | `kk_kiki_seizo_no = (String)eKK0341A010SCHash.get(EKK0341A010CBSMsg1List.KIKI_SEIZO_NO)` // Equipment serial number |
| 3 | IF | `isBlank(kk_kiki_seizo_no)` // Serial number not set |
| 4 | RETURN | `return param` // Skip processing |
| 5 | IF | `eKK0341A010SCHash != null` // Hash map is valid |
| 6 | SET | `kktk_svc_kei_no[0] = ...` // Extract equipment service contract number |
| 7 | SET | `kktk_svc_kei_gadtm[0] = ...` // Extract generation timestamp |
| 8 | SET | `taknkiki_model_cd[0] = ...` // Extract in-house equipment model code |
| 9 | SET | `kiki_seizo_no[0] = ...` // Extract equipment serial number |

### Block 9 — BBR PATH: ROUTER ORDER EXISTENCE CHECK (L25678–25690)

> Check whether a router order already exists. If NOT, create cancellation (149) and deletion (150) orders for the router connection info. This prevents duplicate order generation.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!isDslOrderExist2(param, handle, JKKHakkoSODConstCC.SVC_ORDER_CD_ROUTER, kktk_svc_kei_no[0], taknkiki_model_cd[0], kiki_seizo_no[0])` // No existing router order |
| 2 | CALL | `param = addSOD(handle, param, JKKHakkoSODConstCC.ODR_NAIYO_CD_149)` // Router connection info — cancellation (解約) |
| 3 | CALL | `param = addSOD(handle, param, JKKHakkoSODConstCC.ODR_NAIYO_CD_150)` // Router connection info — deletion (消去) |
| 4 | ELSE_EXIT | Fall through (router order exists, no new orders needed) |

### Block 10 — MRT/HGW PATH (L25693–25698)

> Check if the equipment provider service code is MRT (Multi-Function Router) or HGW (Home Gateway). If it is a maintenance fiber swap (isMansHhsSwchflg is not empty), skip processing as per IT1-2019-0000081.

| # | Type | Code |
|---|------|------|
| 1 | IF | `KKTK_SVC_CD_MFR.equals(tmp_kktk_svc_cd) \|\| KKTK_SVC_CD_HGW.equals(tmp_kktk_svc_cd)` // MRT or Home Gateway |
| 2 | IF | `"".equals(isMansHhsSwchflg(handle, param, sodMap))` // Not a maintenance fiber swap |

### Block 11 — MRT/HGW: EQUIPMENT OPTION SERVICE QUERY (L25700–25710)

> Query the equipment option service contract list and check if BBR service exists within the options.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktkSvcKeiNo = (String)eKK0341A010SCHash.get(EKK0341A010CBSMsg1List.KKTK_SVC_KEI_NO)` |
| 2 | CALL | `msgList = runEKK2811B010(param, handle, JKKHakkoSODConstCC.FUNC_CODE_1, kktkSvcKeiNo)` // Equipment option service contract list |
| 3 | CALL | `ekk2811b010Map = getKkOpSvcRec(msgList, KKOP_SVC_CD_BBR, true)` // Filter for BBR service in options |
| 4 | IF | `ekk2811b010Map != null` // BBR service found in option contracts |

#### Block 11.1 — MRT/HGW: BBR EXISTS — SERIAL NUMBER CHECK (L25713–25716)

> Verify the serial number is set. If blank, skip processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kk_kiki_seizo_no = (String)eKK0341A010SCHash.get(EKK0341A010CBSMsg1List.KIKI_SEIZO_NO)` |
| 2 | IF | `isBlank(kk_kiki_seizo_no)` |
| 3 | RETURN | `return param` |

#### Block 11.2 — MRT/HGW: BBR EXISTS — EXTRACT FIELDS (L25720–25750)

> Extract equipment and option service contract fields. Then perform line consent meeting and network work info lookups.

| # | Type | Code |
|---|------|------|
| 1 | IF | `eKK0341A010SCHash != null` |
| 2 | SET | `kktk_svc_kei_no[0] = ...` // Equipment provider service contract number |
| 3 | SET | `kktk_svc_kei_gadtm[0] = ...` // Generation timestamp |
| 4 | SET | `taknkiki_model_cd[0] = ...` // In-house equipment model code |
| 5 | SET | `kiki_seizo_no[0] = ...` // Equipment serial number |
| 6 | SET | `kkop_svc_kei_router[0] = ...` // Equipment option service contract number (Router) |
| 7 | SET | `kkop_svc_kei_router_gadtm[0] = ...` // Router generation timestamp |
| 8 | SET | `kkop_svc_kei_va[0] = ""` // Equipment option service contract number (VA) — set empty |
| 9 | SET | `kkop_svc_kei_va_gadtm[0] = ""` // VA generation timestamp — set empty |
| 10 | SET | `svc_kei_kaisen_ucwk_no = (String)eKK0341A010SCHash.get(EKK0341A010CBSMsg1List.SVC_KEI_KAISEN_UCWK_NO)` // Line detail agreement number |
| 11 | CALL | `ekk0251a010Map = runEKK0251A010(param, handle, svc_kei_kaisen_ucwk_no)` // Line consent meeting |
| 12 | SET | `svc_kei_kaisen_ucwk_gadtm = (String)ekk0251a010Map.get(EKK0251A010CBSMsg1List.GENE_ADD_DTM)` // Line detail generation timestamp |
| 13 | SET | `adchgNo = (String)sodMap.get("adchg_no")` // Change number from SOD map |
| 14 | CALL | `netUcwkInfoMap = getNetUcwkInfo(param, fixedText, adchgNo)` // Network work info |
| 15 | IF | `netUcwkInfoMap != null && !netUcwkInfoMap.isEmpty()` |
| 16 | SET | `svc_kei_ucwk_no[0] = (String)netUcwkInfoMap.get("svc_kei_ucwk_no")` |
| 17 | SET | `svc_kei_ucwk_gadtm[0] = (String)netUcwkInfoMap.get("svc_kei_ucwk_dtm")` |

#### Block 11.3 — MRT/HGW: ORDER CREATION (L25754–25771)

> Decide which order codes to create based on the makeNaiyoCode405Flg flag and MRT order existence.

| # | Type | Code |
|---|------|------|
| 1 | IF | `makeNaiyoCode405Flg` // Service contract cancellation route |
| 2 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_405)` // Multi-Router Setting/Cancellation (router function, cancellation) |
| 3 | ELSE |
| 4 | IF | `!isDslOrderExist2(param, handle, JKKHakkoSODConstCC.SVC_ORDER_CD_MRT, kktk_svc_kei_no[0], taknkiki_model_cd[0], kiki_seizo_no[0])` // No existing MRT order |
| 5 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_419)` // Multi-Router Setting/Cancellation (router function, cancellation) |
| 6 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_420)` // Multi-Router Setting/Deletion (router function, cancellation) |
| 7 | ELSE_EXIT | MRT order exists, no new orders needed |

### Block 12 — FINAL RETURN (L25773)

> Return the (potentially updated) param object.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return param` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `kikiDslOdrCtrl` | Method | Equipment Contract Cancellation Order Control — the core order orchestration method for FTTH equipment cancellation |
| SOD | Acronym | Service Order Data — the central entity storing service order records in the telecom BSS |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service offered by EO (Nortel/NTT) |
| 機器契約変更（解約） | Japanese | Equipment Contract Change (Cancellation) — the business operation this method implements |
| `chbf_kktsvkei_no` | Field | Pre-change Equipment Provider Service Contract Number — the service line number before cancellation |
| `chbf_kktsvkei_gene_add_dtm` | Field | Pre-change Equipment Provider Service Contract Generation Registration Timestamp — when the service line was registered |
| `svc_kei_no` | Field | Service Contract Number — unique identifier for the customer's service contract |
| `svc_kind` | Field | Service Type Code — determines service category (NET=1, TEL=2, MOB=4, ADSL=5, ELSE=99) |
| BBR | Acronym | Broadband Router — the standard EO broadband router equipment |
| MRT | Acronym | Multi-Function Router — router equipment with additional features (e.g., VPN, parental controls) |
| HGW | Acronym | Home Gateway — EO Home Gateway equipment (C025) |
| KKTK_SVC_CD | Field | Equipment Provider Service Code — classifies the type of provider service (BBR=C014, MRT=C024, HGW=C025, etc.) |
| KKOP_SVC_CD | Field | Equipment Option Service Code — classifies option services bundled with equipment (RT=G01, BBR=embedded in options) |
| `kk_kiki_seizo_no` | Field | Equipment Manufacturing Serial Number — unique hardware serial identifier |
| `taknkiki_model_cd` | Field | In-House Equipment Model Code — internal model classification for customer premise equipment |
| `kktk_svc_kei_no` | Field | Equipment Provider Service Contract Number — reference to the provider service line |
| `kkop_svc_kei_router` | Field | Equipment Option Service Contract Number (Router) — the router-specific option service contract |
| `svc_kei_kaisen_ucwk_no` | Field | Service Contract Line Detail Number — internal tracking ID for the service line agreement |
| `svc_kei_ucwk_no` | Field | Service Contract Detail Number (post-change) — the new detail number after network work completion |
| ODR_NAIYO_CD | Field | Order Content Code — classifies the type of order to be generated |
| ODR_NAIYO_CD_149 | Constant | Router Connection Info — Cancellation (解約) — order for removing router connection |
| ODR_NAIYO_CD_150 | Constant | Router Connection Info — Deletion (消去) — order for fully deleting router connection data |
| ODR_NAIYO_CD_405 | Constant | Multi-Router Setting/Cancellation (Router Function, Cancellation) — used when the overall service contract is being cancelled |
| ODR_NAIYO_CD_419 | Constant | Multi-Router Setting/Cancellation (Router Function, Cancellation) — order for MRT router function cancellation |
| ODR_NAIYO_CD_420 | Constant | Multi-Router Setting/Deletion (Router Function, Cancellation) — order for MRT router function deletion |
| SVC_ORDER_CD_ROUTER | Constant | Service Order Code for Router-type orders |
| SVC_ORDER_CD_MRT | Constant | Service Order Code for MRT-type orders |
| SVC_KIND_NET | Constant | "1" — Service type code for EO Light Network (FTTH) |
| KKTK_SVC_CD_BBR | Constant | "C014" — Equipment provider service code for BBR |
| KKTK_SVC_CD_HGW | Constant | "C025" — Equipment provider service code for EO Home Gateway |
| KKOP_SVC_CD_BBR | Constant | BBR service code within equipment option service contracts |
| `makeNaiyoCode405Flg` | Field | Flag indicating whether to use order code 405 (service contract cancellation route) |
| `isMansHhsSwchflg` | Field | Maintenance Fiber Switch Flag — indicates if this is a maintenance fiber swap operation (should be excluded from MRT handling) |
| EKK0341A010SC | SC | Equipment Provider Service Contract Consent Meeting — service component for querying provider service contract data |
| EKK2811B010CBS | CBS | Equipment Option Service Contract List — CBS for retrieving equipment option service records |
| EKK0251A010CBS | CBS | Service Contract Line Detail Consent Meeting — CBS for line detail agreement reconciliation |
| addSOD | Method | Service Order Data creation — generates SOD records with specified order content codes |
| shkkaMap | Method | Map resolution utility — dereferences SOD sub-map references |
| isBlank | Method | Null/empty string check utility |
| isKikiDsl | Method | DSL equipment cancellation type checker |
| isTakinouRouter | Method | Standalone router type checker |
| isKkopSvcDsl | Method | Equipment option DSL service type checker |
| isDslOrderExist2 | Method | Existing DSL order existence checker — prevents duplicate order generation |
| jdgSvcKind | Method | Service type code determination |
| getNetUcwkInfo | Method | Network work information retrieval |
| hakkoSODNet | Method | Parent method — FTTH Service Order Generation Processing that dispatches to kikiDslOdrCtrl |
| AD_CHG_CMT_KEEP | Constant | "keep" — Equipment change type: keep (continue existing equipment) |
| AD_CHG_CMT_MODIFY | Constant | "modify" — Equipment change type: modify (change equipment) |
| ODR_EXEC_DIV_DSL_END | Constant | "撤去完了" (cancellation completion) — Order execution division: removal completed |
