# Business Logic — JKKHakkoSODCC.jdgIpv6() [336 LOC]

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

## 1. Role

### JKKHakkoSODCC.jdgIpv6()

This method is the core **IPv6 Service Order Data (SOD) dispatch and filtering engine** within the Fujitsu Futurity billing/ordering system. Its business purpose is to determine whether an IPv6-capable device should trigger a new SOD issuance (shipment order) by reviewing all active equipment-provisioning service contracts and matching them against IPv6-specific criteria.

The method handles a **routing/dispatch pattern**: it fetches equipment-provisioning service contract records via a service call (`callEKK0341B008SC`), then iterates through each record in reverse order (highest service number first), applying a multi-layer filter chain. It filters by: (1) service code must be BBR (BBRouter), MRT (Multi-Function Router), or HGW (Home Gateway); (2) contract status must be Active (not Cancelled/Rescinded); (3) for non-new-contract scenarios, the optional service contract number must match the incoming parameter; (4) the device must have a valid serial number and model code; and (5) the device model must support IPv6.

When all filters pass, the method aggregates device information (serial numbers, model codes), determines IPv6 adaptation status by consulting a device model reference table (`getTaknkikiM`), and ultimately dispatches an IPv6 SOD issuance via `hakkouIpv6`. It also sets a flag (`bbr_mrt_skbt_flg`) distinguishing between BBR-only (flag=1) and multi-function router (flag=2) deployments, which affects downstream order registration behavior.

This is a **shared utility** method — called by `jdgIpv6EKK0361A010` (for optional service ISP inquiry flows) and `opSetOdrCtrl` (for optional service control setting flows). It operates within the larger service order fulfillment workflow, acting as a gatekeeper between data acquisition and actual SOD creation.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["Start jdgIpv6"]) --> SETUP["Set statusCode = 0"]
    SETUP --> GET_IPV6["Get ipv6AdIfid from eKK0361A010Info"]
    GET_IPV6 --> CHECK_IPV6{ipv6AdIfid != null<br>&amp;&amp; not blank?}
    CHECK_IPV6 -->|Yes| SET_OP_ADDR["Set this.op_addr_ipv6 = ipv6AdIfid"]
    CHECK_IPV6 -->|No| SET_NULL["Set this.op_addr_ipv6 = null"]
    SET_OP_ADDR --> CALL_EKK0341["Call callEKK0341B008SC"]
    SET_NULL --> CALL_EKK0341
    CALL_EKK0341 --> CHECK_STATUS{statusCode != 0?}
    CHECK_STATUS -->|Yes| THROW_ERROR["Throw CCException"]
    CHECK_STATUS -->|No| GET_RESULT["Get msgEKK0341B002SCList from result"]
    THROW_ERROR --> END_METHOD(["End / Return"])
    GET_RESULT --> CHECK_LIST{msgList != null?}
    CHECK_LIST -->|No| END_METHOD
    CHECK_LIST -->|Yes| INIT_LOOP["Initialize loop i = length - 1 down to 0"]
    INIT_LOOP --> LOOP_CHECK{i >= 0?}
    LOOP_CHECK -->|No| END_METHOD
    LOOP_CHECK -->|Yes| GET_ITEM["Get msgEKK0341B002SCList[i].msgData"]
    GET_ITEM --> GET_KKTK_SVC_CD["Get kktkSvcCd from hash"]
    GET_KKTK_SVC_CD --> FILTER_SERVICE{kktkSvcCd is BBR<br>or MRT or HGW?}
    FILTER_SERVICE -->|No| NEXT_ITER1["continue"]
    FILTER_SERVICE -->|Yes| GET_KKTK_STAT["Get kktkStat from hash"]
    GET_KKTK_STAT --> CHECK_SOD_PATTERN{sod_pattern_ipv6 != 3?}
    CHECK_SOD_PATTERN -->|Yes| CHECK_STAT{Stat is 010/020/030/100?}
    CHECK_SOD_PATTERN -->|No| GET_OP_KEI_NO["Get check_op_kei_no"]
    GET_STAT -->|No| NEXT_ITER2["continue"]
    GET_STAT -->|Yes| GET_OP_KEI_NO
    CHECK_STAT -->|No| NEXT_ITER2
    GET_OP_KEI_NO --> CHECK_IDO_DIV{ido_div != NEW?}
    CHECK_IDO_DIV -->|No| GET_BASIC_INFO["Get temp kktk_svc_kei_no<br>&amp;&amp; GENE_ADD_DTM"]
    CHECK_IDO_DIV -->|Yes| CHECK_OPSETTE{ido_div == OPSETTE?}
    CHECK_OPSETTE -->|No| GET_BASIC_INFO
    CHECK_OPSETTE -->|Yes| CHECK_OP_MATCH{op_kei_no matches param?}
    CHECK_OP_MATCH -->|No| NEXT_ITER3["continue"]
    CHECK_OP_MATCH -->|Yes| GET_BASIC_INFO
    GET_BASIC_INFO --> GET_SEIZO["Get kiki_seizo_no<br>&amp;&amp; taknkiki_model_cd"]
    GET_SEIZO --> CHECK_BLANK{kiki_seizo_no<br>or model blank?}
    CHECK_BLANK -->|Yes| NEXT_ITER4["continue"]
    CHECK_BLANK -->|No| SET_IPV6_FIELDS["Set ipv6_kktk_svc_kei_no<br>&amp;&amp; ipv6_kktk_svc_kei_gadtm"]
    SET_IPV6_FIELDS --> INIT_ARRAYS["Initialize kiki_seizo_no[0]<br>&amp;&amp; taknkiki_model_cd[0]"]
    INIT_ARRAYS --> GET_TANKM["Call getTaknkikiM for model data"]
    GET_TANKM --> CHECK_TANK{taknkiki data != null?}
    CHECK_TANK -->|Yes| SET_TAIO["Set kiki_ipv6_taio_flg from model"]
    CHECK_TANK -->|No| SET_OPR_KAKU["Set op_addr_kakutei_ipv6"]
    SET_TAIO --> SET_OPR_KAKU
    SET_OPR_KAKU --> CHECK_OPR_ADDR{op_addr_ipv6 blank?}
    CHECK_OPR_ADDR -->|Yes| SET_FALSE["Set op_addr_kakutei = false"]
    CHECK_OPR_ADDR -->|No| SET_TRUE["Set op_addr_kakutei = true"]
    SET_FALSE --> CHECK_SHUPPA{kiki_seizo_no valid<br>&amp;&amp; taio_flg == TAIO?}
    SET_TRUE --> CHECK_SHUPPA
    CHECK_SHUPPA -->|Yes| SET_SHUPPA_TRUE["Set kiki_shukka_sumi_ipv6 = true"]
    CHECK_SHUPPA -->|No| SET_SHUPPA_FALSE["Set kiki_shukka_sumi_ipv6 = false"]
    SET_SHUPPA_TRUE --> CHECK_SHUPPA_FLG{kiki_shukka_sumi == true?}
    SET_SHUPPA_FALSE --> CHECK_SHUPPA_FLG
    CHECK_SHUPPA_FLG -->|No| NEXT_ITER5["continue"]
    CHECK_SHUPPA_FLG -->|Yes| CHECK_FLG_INIT{bbr_mrt_skbt_flg == 0?}
    CHECK_FLG_INIT -->|No| SET_FLG_ZERO["Set bbr_mrt_skbt_flg = 0"]
    CHECK_FLG_INIT -->|Yes| SET_FLG_ZERO
    SET_FLG_ZERO --> CHECK_TAKINO{takino_flg == 0?}
    CHECK_TAKINO -->|Yes| SET_FLG_1["Set bbr_mrt_skbt_flg = 1"]
    CHECK_TAKINO -->|No| CHECK_TAKINO9{takino_flg != 9?}
    CHECK_TAKINO9 -->|Yes| SET_FLG_2["Set bbr_mrt_skbt_flg = 2"]
    CHECK_TAKINO9 -->|No| SKIP_HAKKO["Skip hakkouIpv6"]
    SET_FLG_1 --> CALL_HAKKO["Call hakkouIpv6"]
    SET_FLG_2 --> CALL_HAKKO
    SKIP_HAKKO --> BREAK_LOOP["break"]
    CALL_HAKKO --> BREAK_LOOP
    BREAK_LOOP --> NEXT_ITER6["next iteration"]
    NEXT_ITER1 --> LOOP_CHECK
    NEXT_ITER2 --> LOOP_CHECK
    NEXT_ITER3 --> LOOP_CHECK
    NEXT_ITER4 --> LOOP_CHECK
    NEXT_ITER5 --> LOOP_CHECK
    NEXT_ITER6 --> LOOP_CHECK
```

**CRITICAL — Constant Resolution:**

The following constants from `JKKHakkoSODConstCC` are used as filter values:

| Constant | Resolved Value | Business Meaning |
|----------|---------------|------------------|
| `KKTK_SVC_CD_BBR` | `"C014"` | BB Router — broadband router service code |
| `KKTK_SVC_CD_MRT` | *(not in extracted list, inferred from code)* | Multi-Function Router |
| `KKTK_SVC_CD_HGW` | `"C025"` | Home Gateway |
| `SVC_KEI_STAT_010` | `"010"` | Accepted (Received) |
| `SVC_KEI_STAT_020` | `"020"` | Approved |
| `SVC_KEI_STAT_030` | `"030"` | Contracted |
| `SVC_KEI_STAT_100` | `"100"` | Service In Progress (Active) |
| `IDO_DIV_NEW` | *(not in extracted list, inferred)* | New Contract separation type |
| `IDO_DIV_OPSETTE` | *(not in extracted list, inferred)* | Optional Setting separation type |
| `IPV6_TAIO_FLG_TAIO` | *(not in extracted list, inferred)* | IPv6 adaptation flag = supported |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session management handle carrying database connection, transaction context, and security identity. Used for all downstream service calls. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object containing model groups and control maps. Passed through to service calls for routing and control flag delivery. |
| 3 | `kei_ucwk_no_param` | `String` | Service detail work number (internal contract line item tracking number) — used only for filtering in non-new-contract scenarios (currently commented out but parameter preserved for legacy inheritance flows). |
| 4 | `op_svc_kei_no_param` | `String` | Optional service contract number — when the separation type is "optional setting" (`IDO_DIV_OPSETTE`), this value is matched against the optional service contract number in the inquiry results to restrict processing to only the target contract line. |
| 5 | `eKK0361A010Info` | `HashMap<String, Object>` | One-to-one inquiry result map for Optional Service Contract <ISP>. Contains the IPv6 address interface ID (`IPV6_AD_IFID`) and optional service contract number (`OP_SVC_KEI_NO`). Acts as the source of truth for IPv6 address assignment status. |

**Instance fields read/written by this method:**

| Field | Direction | Business Meaning |
|-------|-----------|-----------------|
| `this.svc_kei_no1` | Read | Service contract number — used as input to the equipment-provisioning inquiry |
| `this.op_addr_ipv6` | Write | IPv6 address assigned to the optional service — set from inquiry result or null |
| `this.sod_pattern_ipv6` | Read | IPv6 SOD pattern code — determines whether to filter by active or cancelled status |
| `this.ido_div` | Read | Separation type — distinguishes new contracts from transfers and optional settings |
| `this.kiki_seizo_no` | Write | Equipment serial number array — stores up to 3 device serial numbers |
| `this.taknkiki_model_cd` | Write | Indoor device model code array — stores up to 3 device model codes |
| `this.kiki_ipv6_taio_flg` | Write | Device IPv6 adaptation flag — indicates whether the device supports IPv6 |
| `this.op_addr_kakutei_ipv6` | Write | IPv6 address finalization flag — true when IPv6 address is assigned |
| `this.kiki_shukka_sumi_ipv6` | Write | Device shipment completion flag for IPv6 — true when IPv6-capable device is shipped |
| `this.ipv6_kktk_svc_kei_no` | Write | Equipment-provisioning service contract number for IPv6 |
| `this.ipv6_kktk_svc_kei_gadtm` | Write | Equipment-provisioning service contract registration timestamp for IPv6 |
| `this.kiki_seizo_no_ipv6` | Local | Intermediate: IPv6 device serial number extracted from inquiry |
| `this.taknkiki_model_cd_ipv6` | Local | Intermediate: IPv6 device model code extracted from inquiry |
| `this.ipv6_svc_kei_ucwk_no` | Write | IPv6 service detail work number |
| `this.ipv6_svc_kei_ucwk_gadtm` | Write | IPv6 service detail work registration timestamp |
| `this.checkUcwkMap` | Read | Deduplication map (commented out code path) |
| `this.taishouIdx` | Read | Processing target index counter (commented out) |
| `bbr_mrt_skbt_flg` | Write | BBR/Multi-function router distinction flag — 0=unset, 1=BBR, 2=Multi-function router |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `callEKK0341B008SC` | EKK0341B008SC | KK_T_EKK_TK_SVC (Equipment Provisioning Service Contract) | Reads equipment-provisioning service contract list for the given service contract number. Replaced older EKK0341B002 query due to legacy record removal issues. Returns CAANMsg array of type EKK0341B022. |
| - | `checkTakinoRT` | (internal) | - | Checks whether the customer has a multi-function router (Takino RT = 多機能ルータ). Returns an integer flag (0=not multi-function, 9=indeterminate, other=value). |
| R | `getTaknkikiM` | (internal SC) | EZM table (Indoor Device Model Master) | Reads device model master data for the given model code to determine IPv6 adaptation capability. Returns HashMap with IPV6_TAIO_FLG field. |
| - | `hakkouIpv6` | (internal CBS) | KK_T_OPSVKEI_ISP / KK_T_ODR_HAKKO_JOKEN (Order Shipment/Release) | Core IPv6 SOD issuance method. Creates service order data records for IPv6 device shipment. Uses bbr_mrt_skbt_flg to distinguish BBR vs multi-function router routing. |
| - | `shkkaChr` | (utility) | - | Null-safe character extraction utility. Strips null or whitespace from string values. Used throughout the method to safely extract hash map values. |
| - | `isBlank` | (utility) | - | Checks if a string is null or empty. Used for validation throughout the filter chain. |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 14 methods.
Terminal operations from this method: `hakkouIpv6` [-], `shkkaChr` [-], `isBlank` [-], `isBlank` [-], `shkkaChr` [-], `getTaknkikiM` [R], `isBlank` [-], `isBlank` [-], `shkkaChr` [-], `shkkaChr` [-], `shkkaChr` [-], `shkkaChr` [-], `shkkaChr` [-], `shkkaChr` [-], `shkkaChr` [-], `shkkaChr` [-], `checkTakinoRT` [-], `callEKK0341B008SC` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JKKHakkoSODCC.jdgIpv6EKK0361A010` | jdgIpv6EKK0361A010 -> jdgIpv6 | `callEKK0341B008SC [R] KK_T_EKK_TK_SVC`, `hakkouIpv6 [C] KK_T_ODR_HAKKO_JOKEN` |
| 2 | `JKKHakkoSODCC.opSetOdrCtrl` | opSetOdrCtrl -> jdgIpv6 | `callEKK0341B008SC [R] KK_T_EKK_TK_SVC`, `hakkouIpv6 [C] KK_T_ODR_HAKKO_JOKEN` |

**Notes:** Both callers are internal methods within `JKKHakkoSODCC` itself. `jdgIpv6EKK0361A010` is invoked during optional service ISP one-to-one inquiry flows (EKK0361A010). `opSetOdrCtrl` handles optional service order control settings. The terminal operations reach `callEKK0341B008SC` (Read from equipment provisioning tables) and `hakkouIpv6` (Create: generates IPv6 shipment orders).

## 6. Per-Branch Detail Blocks

### Block 1 — IF (IPv6 Address Extraction) (L30095)

> Extract IPv6 address interface ID from the ISP inquiry result HashMap. Initialize `op_addr_ipv6` field. Handle null/empty case by setting to null rather than causing NPE.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | GET | `ipv6AdIfid = eKK0361A010Info.get(IPV6_AD_IFID)` | Retrieve IPv6 address interface ID from ISP inquiry result |
| 2 | IF | `null != ipv6AdIfid && !"".equals(ipv6AdIfid.toString())` | Check if IPv6 address was assigned and is non-blank |

#### Block 1.1 — IF branch (IPv6 address present) (L30097)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `this.op_addr_ipv6 = ipv6AdIfid.toString()` | Assign extracted IPv6 address to instance field |

#### Block 1.2 — ELSE branch (no IPv6 address) (L30101)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `this.op_addr_ipv6 = null` | Clear IPv6 address — contract not yet finalized |

---

### Block 2 — EXEC (Equipment Provisioning Inquiry) (L30114)

> Create input/output HashMaps and call the service to fetch equipment-provisioning service contract records.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `inHashKktk = new HashMap<>()` | Initialize input hash for inquiry |
| 2 | SET | `resultHashKktk = new HashMap<>()` | Initialize result hash for inquiry |
| 3 | SET | `inHashKktk.put(SVC_KEI_NO, this.svc_kei_no1)` | Set service contract number as inquiry key |
| 4 | CALL | `callEKK0341B008SC(param, handle, inHashKktk, resultHashKktk, FUNC_CODE_1)` | Query equipment-provisioning service contract list (replaced older EKK0341B002) |

### Block 3 — IF (Status Code Check) (L30120)

> Throw exception if service call returned an error status.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `0 != statusCode` | Service call returned non-zero (error) status |
| 2 | EXEC | `throw new CCException("", new SCCallException("", String.valueOf(statusCode), statusCode))` | Wrap and propagate service call exception |

#### Block 3.1 — ELSE branch (success)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | GET | `msgEKK0341B002SCList = (CAANMsg[])resultHashKktk.get(TEMPLATE_ID_EKK0341B022)` | Cast and retrieve equipment-provisioning inquiry results |

---

### Block 4 — EXEC (Multi-function Router Check) (L30126)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `takino_flg = checkTakinoRT(handle, param)` | Determine if customer has a multi-function router (2014 Feb project addition) |

---

### Block 5 — IF (Result List Not Empty) (L30129)

> Main processing loop. Condition was simplified in 2016 (OM-2016-0000004) — `takino_flg` check removed because `checkTakinoRT` now correctly returns 9 for indeterminate cases, and `hakkouIpv6` handles it.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `null != msgEKK0341B002SCList` | Check if any equipment-provisioning records were returned |

#### Block 5.1 — FOR LOOP (Reverse Iteration) (L30136)

> Iterate through results in reverse order (highest service number first). Modified in 2013 (SOD defect No.30) to process from the end, ensuring higher-numbered service contracts are handled first.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `for(int i = msgEKK0341B002SCList.length - 1; i >= 0; i--)` | Reverse-ordered loop for processing |

##### Block 5.1.1 — Loop Body: Get Item Data (L30138)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | GET | `eKK0341B002Hash = msgEKK0341B002SCList[i].getMsgData()` | Extract HashMap from current CAANMsg entry |

###### Block 5.1.2 — Loop Body: Extract Service Code (L30145)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `kktkSvcCd = shkkaChr((String)eKK0341B002Hash.get(KKTK_SVC_CD))` | Extract equipment-provisioning service code (null-safe) |

###### Block 5.1.3 — IF (Service Code Filter) (L30149)

> Only process records whose service code is BBR (BBRouter), MRT (Multi-function Router), or HGW (Home Gateway). All other equipment types are skipped.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `!BBR.equals(kktkSvcCd) && !MRT.equals(kktkSvcCd) && !HGW.equals(kktkSvcCd)` | Filter: only BBR/MRT/HGW are target |
| 2 | EXEC | `continue` | Skip non-target equipment types |

###### Block 5.1.4 — Loop Body: Extract Status (L30155)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `kktkStat = shkkaChr((String)eKK0341B002Hash.get(KKTK_SVC_KEI_STAT))` | Extract equipment-provisioning service status code |

###### Block 5.1.5 — IF (SOD Pattern Branch) (L30158)

> When `sod_pattern_ipv6 != 3` (not cancellation pattern), filter to active statuses only. Status 3 pattern was for cancellation handling (commented out code path).

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `3 != this.sod_pattern_ipv6` | Non-cancellation pattern: enforce active status filter |
| 2 | IF | `!SVC_KEI_STAT_100.equals(kktkStat) && !SVC_KEI_STAT_010.equals(kktkStat) && !SVC_KEI_STAT_020.equals(kktkStat) && !SVC_KEI_STAT_030.equals(kktkStat)` | Status not 010(Accepted)/020(Approved)/030(Contracted)/100(In Progress) |
| 3 | EXEC | `continue` | Skip non-active contract status |

###### Block 5.1.6 — Loop Body: Extract Optional Service Contract Number (L30188)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `check_op_kei_no = shkkaChr((String)eKK0361A010Info.get(OP_SVC_KEI_NO))` | Extract optional service contract number from ISP inquiry result |

###### Block 5.1.7 — IF (Separation Type Filter) (L30202)

> For non-new-contract scenarios, restrict processing to the specific optional service contract that matches the parameter. For new contracts, no filtering is needed.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `!IDO_DIV_NEW.equals(this.ido_div)` | Separation type is not new contract |
| 2 | IF | `IDO_DIV_OPSETTE.equals(this.ido_div)` (L30213) | Separation type IS optional setting |
| 3 | IF | `!check_op_kei_no.equals(shkkaChr(op_svc_kei_no_param))` (L30216) | Optional service contract number does NOT match parameter |
| 4 | EXEC | `continue` | Skip: only the target optional contract line should be processed |

###### Block 5.1.8 — Loop Body: Extract Basic Info (L30223)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `temp_ipv6_kktk_svc_kei_no = shkkaChr((String)eKK0341B002Hash.get(KKTK_SVC_KEI_NO))` | Extract equipment-provisioning service contract number |
| 2 | CALL | `temp_ipv6_kktk_svc_kei_gadtm = shkkaChr((String)eKK0341B002Hash.get(GENE_ADD_DTM))` | Extract equipment-provisioning service contract registration timestamp |

###### Block 5.1.9 — Loop Body: Extract Device Info (L30229)

> Device serial number and model code are now read directly from the inquiry result (EKK0341B002), eliminating the previous need for a secondary EKK0341A010 inquiry call.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `this.kiki_seizo_no_ipv6 = shkkaChr((String)eKK0341B002Hash.get(KIKI_SEIZO_NO))` | Extract device serial number from inquiry result |
| 2 | CALL | `this.taknkiki_model_cd_ipv6 = shkkaChr((String)eKK0341B002Hash.get(TAKNKIKI_MODEL_CD))` | Extract indoor device model code from inquiry result |

###### Block 5.1.10 — IF (Device Info Blank Check) (L30237)

> Skip records where serial number or model code is blank — incomplete device information cannot be processed.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `isBlank(this.kiki_seizo_no_ipv6) \|\| isBlank(this.taknkiki_model_cd_ipv6)` | Device serial or model code is blank/missing |
| 2 | EXEC | `continue` | Skip: incomplete device data |

###### Block 5.1.11 — Loop Body: Set IPv6 Fields (L30245)

> This point means the record passed all filters. Set the IPv6-specific service contract number and timestamp fields.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `this.ipv6_kktk_svc_kei_no = temp_ipv6_kktk_svc_kei_no` | Store equipment-provisioning service contract number for IPv6 |
| 2 | SET | `this.ipv6_kktk_svc_kei_gadtm = temp_ipv6_kktk_svc_kei_gadtm` | Store equipment-provisioning contract registration timestamp for IPv6 |

###### Block 5.1.12 — Loop Body: Initialize Serial Number Array (L30251)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `null == this.kiki_seizo_no \|\| 0 == this.kiki_seizo_no.length` | Serial number array not yet initialized |
| 2 | SET | `this.kiki_seizo_no = new String[3]` | Allocate 3-element array for serial numbers (up to 3 devices) |
| 3 | SET | `this.kiki_seizo_no[0] = this.kiki_seizo_no_ipv6` | Store first serial number |

###### Block 5.1.13 — Loop Body: Initialize Model Code Array (L30256)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `null == this.taknkiki_model_cd \|\| 0 == this.taknkiki_model_cd.length` | Model code array not yet initialized |
| 2 | SET | `this.taknkiki_model_cd = new String[3]` | Allocate 3-element array for model codes |
| 3 | SET | `this.taknkiki_model_cd[0] = this.taknkiki_model_cd_ipv6` | Store first model code |

###### Block 5.1.14 — Loop Body: Query Device Model Data (L30263)

> Call internal method to retrieve device model master data, which includes the IPv6 adaptation capability flag.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `taknkiki_model_m = getTaknkikiM(handle, param, this.taknkiki_model_cd_ipv6)` | Retrieve device model master data for IPv6 adaptation check |
| 2 | IF | `null != taknkiki_model_m` (L30265) | Model data was successfully retrieved |
| 3 | SET | `this.kiki_ipv6_taio_flg = shkkaChr((String)taknkiki_model_m.get(IPV6_TAIO_FLG))` | Set device IPv6 adaptation flag from model master data |

###### Block 5.1.15 — IF (IPv6 Address Finalization Flag) (L30272)

> Set the IPv6 address finalization flag based on whether an IPv6 address is assigned.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `isBlank(this.op_addr_ipv6)` | IPv6 address not assigned |
| 2 | SET | `this.op_addr_kakutei_ipv6 = false` | Address not yet finalized |

#### Block 5.1.15.1 — ELSE (IPv6 address assigned)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `this.op_addr_kakutei_ipv6 = true` | Address is finalized |

###### Block 5.1.16 — IF (Shipment Completion Judgment) (L30282)

> Determine whether the IPv6 device is considered "shipped" (ready for SOD issuance). Requires both a valid serial number AND the device model supporting IPv6.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `!isBlank(this.kiki_seizo_no_ipv6) && IPV6_TAIO_FLG_TAIO.equals(shkkaChr(this.kiki_ipv6_taio_flg))` | Device has serial number AND model supports IPv6 |
| 2 | SET | `this.kiki_shukka_sumi_ipv6 = true` | IPv6 device shipment considered complete |

#### Block 5.1.16.1 — ELSE (device not IPv6-capable or no serial)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `this.kiki_shukka_sumi_ipv6 = false` | IPv6 device not shipped/cannot be shipped |

###### Block 5.1.17 — IF (IPv6 SOD Issuance) (L30292)

> Core decision point: only issue SOD if the device is confirmed as shipped (IPv6-capable with valid serial).

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `kiki_shukka_sumi_ipv6` | Device is confirmed IPv6-capable and shipped |

####### Block 5.1.17.1 — Nested: Set Service Contract Arrays (L30296)

> Initialize and populate the service contract number and timestamp arrays for IPv6.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `null == this.kktk_svc_kei_no \|\| 1 > this.kktk_svc_kei_no.length` | Contract number array not initialized |
| 2 | SET | `this.kktk_svc_kei_no = new String[1]` | Allocate 1-element array |
| 3 | SET | `this.kktk_svc_kei_no[0] = this.ipv6_kktk_svc_kei_no` | Store IPv6 contract number |
| 4 | IF | `null == this.kktk_svc_kei_gadtm \|\| 1 > this.kktk_svc_kei_gadtm.length` | Contract timestamp array not initialized |
| 5 | SET | `this.kktk_svc_kei_gadtm = new String[1]` | Allocate 1-element array |
| 6 | SET | `this.kktk_svc_kei_gadtm[0] = this.ipv6_kktk_svc_kei_gadtm` | Store IPv6 contract timestamp |

####### Block 5.1.17.2 — Nested: Set Service Detail Work Arrays (L30310)

> Initialize and populate the service detail work number and timestamp arrays.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `null == this.svc_kei_ucwk_no \|\| 1 > this.svc_kei_ucwk_no.length` | Work number array not initialized |
| 2 | SET | `this.svc_kei_ucwk_no = new String[1]` | Allocate 1-element array |
| 3 | SET | `this.svc_kei_ucwk_no[0] = this.ipv6_svc_kei_ucwk_no` | Store IPv6 work number (from field, not from hash) |
| 4 | IF | `null == this.svc_kei_ucwk_gadtm \|\| 1 > this.svc_kei_ucwk_gadtm.length` | Work timestamp array not initialized |
| 5 | SET | `this.svc_kei_ucwk_gadtm = new String[1]` | Allocate 1-element array |
| 6 | SET | `this.svc_kei_ucwk_gadtm[0] = this.ipv6_svc_kei_ucwk_gadtm` | Store IPv6 work timestamp |

####### Block 5.1.17.3 — Nested: BBR/Multi-function Router Flag Setup (L30325)

> Initialize and set the BBR vs multi-function router distinction flag before SOD issuance. This flag controls routing behavior in `hakkouIpv6`.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `bbr_mrt_skbt_flg = 0` | Reset flag to zero (initial state) |
| 2 | IF | `takino_flg == 0` (L30331) | Not a multi-function router |
| 3 | SET | `bbr_mrt_skbt_flg = 1` | Flag = 1: BBR (BBRouter) type |

#### Block 5.1.17.3.1 — ELSE IF (Multi-function Router)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `takino_flg != 9` (L30334) | Not indeterminate (9 = checkTakinoRT could not determine) |
| 2 | SET | `bbr_mrt_skbt_flg = 2` | Flag = 2: Multi-function router type |

####### Block 5.1.17.4 — Nested: Issue IPv6 SOD (L30340)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `hakkouIpv6(handle, param, eKK0361A010Info)` | Issue IPv6 Service Order Data with BBR/MRT flag set |

####### Block 5.1.17.5 — Nested: Break Loop (L30344)

> After successfully issuing the SOD, break out of the loop. Modified in 2013 (SOD defect No.30) to prevent multiple IPv6 SOD issues from the same processing run.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `break` | Exit loop — SOD issuance complete for this record |

#### Block 5.1.17.5.1 — ELSE (shipment not complete, skip SOD issuance)

> Device does not qualify for IPv6 SOD issuance. Continue to next record.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `ipv6AdIfid` | Field | IPv6 Address Interface ID — the IPv6 address assigned to the customer's line, stored in the optional service contract ISP inquiry result |
| `kktkSvcCd` | Field | Equipment Provisioning Service Code — code identifying the type of equipment service (BBR=BBRouter, MRT=Multi-function Router, HGW=Home Gateway, etc.) |
| `kktkStat` | Field | Equipment Provisioning Service Status — contract status code (010=Accepted, 020=Approved, 030=Contracted, 100=In Progress, 910=Cancelled) |
| `op_svc_kei_no_param` | Field | Optional Service Contract Number — the specific optional service line item number used for filtering in non-new-contract scenarios |
| `kei_ucwk_no_param` | Field | Service Detail Work Number — internal line item tracking number for service contract details (used in legacy inheritance code paths) |
| `sod_pattern_ipv6` | Field | IPv6 SOD Pattern Code — determines the SOD filtering behavior: pattern 3 = cancellation handling; other values = active contract handling |
| `ido_div` | Field | Separation Type — distinguishes between new contracts (`IDO_DIV_NEW`), transfers, and optional settings (`IDO_DIV_OPSETTE`) |
| `kiki_seizo_no` | Field | Equipment Serial Number Array — stores up to 3 device serial numbers for this processing session |
| `taknkiki_model_cd` | Field | Indoor Device Model Code Array — stores up to 3 device model codes |
| `kiki_ipv6_taio_flg` | Field | Device IPv6 Adaptation Flag — indicates whether the device hardware supports IPv6 |
| `op_addr_kakutei_ipv6` | Field | IPv6 Address Finalization Flag — true when an IPv6 address has been assigned; false when not yet set |
| `kiki_shukka_sumi_ipv6` | Field | IPv6 Device Shipment Completion Flag — true when an IPv6-capable device is ready for shipment (SOD issuance) |
| `bbr_mrt_skbt_flg` | Field | BBR/Multi-function Router Distinction Flag — 0=unset, 1=BBR (BBRouter), 2=Multi-function Router; controls SOD routing behavior |
| `ipv6_kktk_svc_kei_no` | Field | IPv6 Equipment-provisioning Service Contract Number — the specific service contract number for the IPv6 equipment line |
| `ipv6_kktk_svc_kei_gadtm` | Field | IPv6 Equipment-provisioning Service Contract Registration Timestamp |
| `ipv6_svc_kei_ucwk_no` | Field | IPv6 Service Detail Work Number |
| `ipv6_svc_kei_ucwk_gadtm` | Field | IPv6 Service Detail Work Registration Timestamp |
| `takino_flg` | Field | Multi-function Router Check Flag — 0=not multi-function, 9=indeterminate (added 2014 Feb project) |
| SOD | Acronym | Service Order Data — a shipment/release order record in the Fujitsu billing system |
| BBR | Acronym | BB Router — broadband router service (service code C014) |
| MRT | Acronym | Multi-function Router — a router with additional features beyond basic broadband |
| HGW | Acronym | Home Gateway — home gateway service (service code C025) |
| EKK0341B008SC | Acronym | Service Component for Equipment Provisioning Service Contract Inquiry — queries the equipment-provisioning service contract list |
| EKK0341B022CBSMsg1List | Acronym | Message list for Equipment Provisioning Service Contract List Inquiries (EKK0341B022) |
| EKK0361A010CBSMsg1List | Acronym | Message list for Optional Service Contract <ISP> One-to-One Inquiry (EKK0361A010) |
| EZM0411A010CBSMsg1List | Acronym | Message list for Indoor Device Model Data Inquiry (EZM0411A010) |
| KKTK_SVC_CD | Constant | KK/Tokyo Service Code — equipment provisioning service code field key |
| KKTK_SVC_KEI_STAT | Constant | KK/Tokyo Service Contract Status — service contract status field key |
| GENE_ADD_DTM | Constant | General Addition Date/Time — contract registration timestamp field key |
| KIKI_SEIZO_NO | Constant | Equipment Manufacturing Number — device serial number field key |
| TAKNKIKI_MODEL_CD | Constant | Indoor Device Model Code — device model identification code |
| IPV6_AD_IFID | Constant | IPv6 Address Interface ID — the IPv6 interface identifier |
| IPV6_TAIO_FLG | Constant | IPv6 Adaptation Flag — device IPv6 support capability flag |
| OP_SVC_KEI_NO | Constant | Optional Service Contract Number |
| SVC_KEI_NO | Constant | Service Contract Number |
| FUNC_CODE_1 | Constant | Function code 1 — standard processing mode for service calls |
| TEMPLATE_ID_EKK0341B022 | Constant | Template identifier for EKK0341B022 inquiry results |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service (contextual, not directly in this method) |
| TAKINO RT | Business term | Multi-function router (多機能ルータ) — Japanese billing term for routers with advanced features (DNS, firewall, etc.) |
| 多機能ルータ | Japanese | Multi-function router — Japanese term for MRT |
| IPV6アドレス | Japanese | IPv6 Address — the IPv6 network address assigned to a customer line |
| 機器提供サービス | Japanese | Equipment Provisioning Service — service type for equipment rental/lease contracts |
| サービス契約 | Japanese | Service Contract — the customer's service subscription record |
| 受付済 | Japanese | Accepted — contract status 010, meaning the order has been received |
| 承認済 | Japanese | Approved — contract status 020, meaning the order has been approved |
| 結合済 | Japanese | Contracted — contract status 030, meaning the contract is now active |
| サービス提供中 | Japanese | Service In Progress — contract status 100, meaning the service is currently active |
| 解約済 | Japanese | Cancelled — contract status 910, meaning the contract has been cancelled |
| 出荷済 | Japanese | Shipped — device has been shipped to the customer |
| IPv6対応 | Japanese | IPv6 Adaptation — whether the device supports IPv6 protocol |
| optional service contract <ISP> | Japanese | オプションサービス契約<ISP> — optional ISP-related service contract (e.g., IPv6 address assignment, DNS service) |
| 一意照会結果 | Japanese | One-to-one inquiry result — result of a unique record lookup query |
