# Business Logic — JKKHakkoSODCC.kaihkOdrCtrl() [1726 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKHakkoSODCC` |
| Layer | CC/Common Component — shared business logic for order (SOD) creation and control |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKHakkoSODCC.kaihkOdrCtrl()

This method performs **recovery-order control processing** (`回復オーダ制御処理`) for the "eo" (Hikari/eo) family of telecommunications services. It is the central dispatch method that orchestrates the creation of Service Order Data (SOD) records when a customer's service is being **restored** (recovered) after a cancellation, suspension, or plan change.

The method handles **three major service categories**: (1) **Network services** (FTTH/eo Internet, eo ADSL), (2) **Mobile services** (eo Mobile, UQ WiMAX, SpotWiFi), and (3) **Telephone services** (eo Hikari Denwa / VoIP). Each category has its own complex branching logic that queries existing contract data, determines which options (email, MyHomePage, mail list, BBR router, multi-function router, etc.) are currently active, and generates the appropriate SOD records to restore those services.

The method implements a **routing/dispatch pattern** — it first determines the service kind (`svc_kind`) and then routes to one of three major processing branches. Within each branch, it uses a **builder pattern** — it accumulates service data into instance fields (`this.op_svc_kei_no_*`, `this.kktk_svc_kei_no`, etc.), then calls `addSOD()`, `addTakinoSOD()`, `tsuikabunAddSOD()`, etc. to register SODs.

Its **role in the larger system** is that of a shared business component called by `JKKHakkoSODCC.hakkoSOD()` (the main order issuance entry point). It sits between the screen/batch entry point and the low-level SC (Service Component) calls, acting as a business rules engine that translates service-contract state into concrete SOD issuance actions.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["kaihkOdrCtrl"])
    START --> EXTRACT["Extract SOD/SVC data from sodMap"]
    EXTRACT --> SVC_JUDGE["Determine svc_kind via jdgSvcKind"]
    SVC_JUDGE --> NET_CHK{svc_kind = NET<br/>or ADSL?}
    NET_CHK -->|Yes| NET_PROCESS["Process network service recovery"]
    NET_CHK -->|No| MOB_CHK{svc_kind = MOB?}
    MOB_CHK -->|Yes| MOB_PROCESS["Process mobile service recovery"]
    MOB_CHK -->|No| TEL_CHK{svc_kind = TEL?}
    TEL_CHK -->|Yes| TEL_PROCESS["Process telephone service recovery"]
    TEL_CHK -->|No| RETURN_RET["Return param"]
    NET_PROCESS --> NET_QUERY1["Query multi-session option contracts"]
    NET_QUERY1 --> NET_QUERY2["Query fixed IP address contracts"]
    NET_QUERY2 --> NET_QUERY3["Query option service contracts"]
    NET_QUERY3 --> NET_QUERY4["Query equipment provision contracts"]
    NET_QUERY4 --> NET_TAKINO["Check multi-function router"]
    NET_TAKINO --> NET_HAS_OP{Has option or eqpt?}
    NET_HAS_OP -->|Yes| NET_SAME_TRN["Get same processing number"]
    NET_HAS_OP -->|No| NET_NO_SAME["Clear same processing number"]
    NET_SAME_TRN --> NET_MANSION{Not mansion private?}
    NET_NO_SAME --> NET_MANSION
    NET_MANSION -->|Yes| NET_ADD_SOD1["FTTH auth recovery SOD"]
    NET_ADD_SOD1 --> NET_MULTI_CHECK{Has multi-session?}
    NET_MULTI_CHECK -->|Dynamic only| NET_ADD_SOD2["Multi-session change SOD"]
    NET_MULTI_CHECK -->|Static plus FixIP| NET_ADD_SOD3["Multi-session recovery and change SOD"]
    NET_MULTI_CHECK -->|FixIP only| NET_ADD_SOD4["Fixed IP address change SOD"]
    NET_MULTI_CHECK -->|Neither| NET_AUTH_ONLY["No action - auth ID only"]
    NET_AUTH_ONLY --> NET_LOOP_OPTIONS["Loop option contracts"]
    NET_ADD_SOD2 --> NET_LOOP_OPTIONS
    NET_ADD_SOD3 --> NET_LOOP_OPTIONS
    NET_ADD_SOD4 --> NET_LOOP_OPTIONS
    NET_LOOP_OPTIONS --> NET_BBR_CHECK{Has BBR eqpt?}
    NET_BBR_CHECK -->|Yes| NET_BBR_SOD["Router connection SOD"]
    NET_BBR_CHECK -->|No| NET_TAKINO_SVC{takino_flg value?}
    NET_BBR_SOD --> NET_TAKINO_SVC
    NET_TAKINO_SVC -->|2| NET_TAKINO_ADD["Multi-function router registration"]
    NET_TAKINO_SVC -->|4| NET_TAKINO_EDIT["Multi-function router change"]
    NET_TAKINO_SVC -->|0| NET_TOKI_SVC["Process service status"]
    NET_TOKI_SVC --> NET_PAUSE_CHK{Status = suspension?}
    NET_PAUSE_CHK -->|Yes pause 02| NET_STP["Stop order control"]
    NET_PAUSE_CHK -->|Yes other pause| NET_PAUSE["Pause order control"]
    NET_PAUSE_CHK -->|No| NET_IPV6_PROC["Process IPV6 list"]
    NET_IPV6_PROC --> NET_RETURN1["Return param"]
    NET_STP --> NET_RETURN1
    NET_PAUSE --> NET_RETURN1
    MOB_PROCESS --> MOB_RETURN["Return param"]
    TEL_PROCESS --> TEL_LOOP["Loop option contracts"]
    TEL_LOOP --> TEL_Z1_CHK{Z1 order sent?}
    TEL_Z1_CHK -->|No| TEL_NEW_SOD["Telephone new registration"]
    TEL_NEW_SOD --> TEL_RETURN["Return param"]
    TEL_Z1_CHK -->|Yes| TEL_OLS["OLS settings processing"]
    TEL_OLS --> TEL_SIP["SIP registration"]
    TEL_SIP --> TEL_TOKI["Transfer SOD registration"]
    TEL_TOKI --> TEL_N050{Has N050 number transfer?}
    TEL_N050 -->|Yes| TEL_N050_SOD["Number transfer registration"]
    TEL_N050 -->|No| TEL_EMERG["Emergency notification registration"]
    TEL_N050_SOD --> TEL_EMERG
    TEL_EMERG --> TEL_PAUSE_CHK2{Status = suspension?}
    TEL_PAUSE_CHK2 -->|Yes| TEL_PAUSE_CTRL["Pause order control"]
    TEL_PAUSE_CHK2 -->|No| TEL_RETURN
    TEL_PAUSE_CTRL --> TEL_FINAL["Return param"]
    RETURN_RET --> FINISH(["kaihkOdrCtrl end"])
    NET_RETURN1 --> FINISH
    MOB_RETURN --> FINISH
    TEL_RETURN --> FINISH
    TEL_FINAL --> FINISH

    style START fill:#e1f5ff
    style FINISH fill:#e1f5ff
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session handle containing session manager and other infrastructure needed for SC calls and database access |
| 2 | `param` | `IRequestParameterReadWrite` | Model group and control map container — carries business data through the processing chain; returned with updated SOD entries after each `addSOD` call |
| 3 | `fixedText` | `String` | User-defined arbitrary string — passed through to order control sub-methods for audit/debug purposes (e.g., `stpUkOdrCtrl`) |
| 4 | `sodMap` | `HashMap<String, Object>` | SOD (Service Order Data) map containing three nested maps: `SOD_KIHON_INFO` (basic info: sys_id, ido_div), `SVC_KEI_INFO` (service contract info: svc_kei_no), and `SVC_KEI_UCWK_INFO` (service contract details: svc_kei_ucwk_no, gene_add_dtm, flags) |

### Instance fields read by the method

| Field | Business Meaning |
|-------|------------------|
| `pcrs_cd` | Price/course code — identifies the specific tariff/plan the customer is on |
| `svc_kei_stat` | Service contract status — e.g., `100` (service provision), `210` (suspension/cancellation) |
| `pause_stp_cd` | Pause/stop code — `02` indicates "during suspension" state |
| `op_svc_kei_no_fixipad`, `op_gadtm_fixipad` | Option service contract number / generation registration datetime for fixed IP address |
| `op_svc_kei_no_mltise`, `op_gadtm_mltise` | Option service contract number / generation registration datetime for multi-session |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKHakkoSODCC.callEKK0351B002SC` | EKK0351B002SC | OP_SVC_CD (option service contract) | Query option service contracts list by service contract number — used across all three service type branches to find active email, HP, mail list, IPV6, and other options |
| R | `JKKHakkoSODCC.callEKK0351A010SC` | EKK0351A010SC | OP_SVC_KEI_NO (option service contract detail) | Query option service contract consent details — multi-session and fixed IP branches call this to resolve parent contract information |
| R | `JKKHakkoSODCC.callEKK0341B008SC` | EKK0341B008SC | KKTK_SVC_CD (equipment provision service contract) | Query equipment provision service contracts list — retrieves BBR router, VA home appliance, ONU, and other equipment data |
| R | `JKKHakkoSODCC.callEKK0341B008_02SC` | EKK0341B008_02SC | KKTK_SVC_CD | Query equipment provision for EG (Ethernet Gateway) switch consideration during VA appliance replacement |
| R | `JKKHakkoSODCC.callEKK0341B002SC` | EKK0341B002SC | KKTK_SVC_CD (equipment provision list) | Legacy equipment provision query for BBR (used in eo Mobile UQ WiMAX path) |
| R | `JKKHakkoSODCC.callEKK0361A010SC` | EKK0361A010SC | ISP contract details | Query option service contract ISP details — retrieves MLAD, URL_DOMAIN, URL_ACCOUNT for email and MyHomePage options |
| R | `JKKHakkoSODCC.callEKK0191A010SC` | EKK0191A010SC | SVC_KEI_UCWK (service contract details) | Query service contract details for eo Hikari Denwa — retrieves VA model code, telno_jun (line number), BMP_UM (phone number portability flag), ITENS flags |
| R | `JKKHakkoSODCC.callEKK0161A010SC` | EKK0161A010SC | SVC_KEI_UCWK | Query service contract consent — retrieves PCRS_CD (price code) for mobile services |
| R | `JKKHakkoSODCC.callEKK0251B001SC` | EKK0251B001SC | SVC_KEI_KAISEN_UCWK (service contract withdrawal details) | Query service contract withdrawal details — retrieves svc_kei_kaisen_ucwk_no for telephone services |
| R | `JKKHakkoSODCC.callEKK1081B001SC` | EKK1081B001SC | KK1081 (Z1 order) | Query whether Z1 order has been issued for telephone service |
| R | `JKKHakkoSODCC.getEKK0251B001SC` | EKK0251B001SC | SVC_KEI_KAISEN_UCWK | Wrapper to get service contract withdrawal list — telephone service path |
| C | `JKKHakkoSODCC.addSOD` | - | SOD (Service Order Data) | Create SOD — core creation method called throughout with different ODR_NAIYO_CD values (105=FTTH auth recovery, 120=email recovery, 128=WEB recovery, 133=mail list recovery, 134=dial-up registration, 142=multi-session change, 147=router connection registration, 153=fixed IP change, 161=multi-session recovery, 162=multi-session change, 206=Radius auth recovery, 207=OLS registration, 208=OLS+number addition, 211=caller ID registration, 218=SIP registration, 219=non-050 option registration, 223=SIP+temporary suspension, 225=SIP+phone number portability registration, 250=emergency notification, 265=ENUM setup, 301=WiFi spot registration, 302=WiFi spot change, 315=e-mobile pause cancellation, 316=WiMAX CUI recovery, 317=WiMAX DEV recovery, 318=050 number transfer registration, 401=multi-function router registration, 402=multi-function router change, 404=multi-function router change with line info change, 406=multi-function router registration with VA function, 407=multi-function router change with VA function, 408=multi-function router change with VA number addition, 413=multi-function router change with VA function and registration) |
| C | `JKKHakkoSODCC.add050AddSod` | - | 050 Number Transfer SOD | Create 050 number transfer order — handles number portability registration (ODR_NAIYO_CD_318) |
| C | `JKKHakkoSODCC.addSODTelNew` | - | Telephone new registration SOD | Create new telephone service registration order (eo Hikari Denwa new registration) |
| C | `JKKHakkoSODCC.addTakinoSOD` | - | Takino (multi-function router) SOD | Create multi-function router SOD — handles VA (video appliance) + router configuration |
| C | `JKKHakkoSODCC.tsuikabunAddSOD` | - | Additional/Separate SOD | Create supplementary SOD — used for WiMAX recovery (316, 317) and WiFi spot (301, 302) |
| U | `JKKHakkoSODCC.edit4OpSetOdrCtrl` | - | Option order control mapping | Map option setup data for transfer telephone option control |
| - | `JKKHakkoSODCC.pauseUkOdrCtrl` | - | Pause order control | Process pause-received order — creates pause orders when service status is suspension |
| - | `JKKHakkoSODCC.stpUkOdrCtrl` | - | Stop order control | Process stop-received order — creates stop orders when service status is suspension with pause code 02 |
| - | `JKKHakkoSODCC.opSetOdrCtrl` | - | Option order control | Process option setup order — creates option orders for transfer telephone |
| R | `JKKHakkoSODCC.countUpWiFiSpotSessions` | - | WiFi spot session count | Count active WiFi spot sessions — determines if WiFi spot is registration or change |
| R | `JKKHakkoSODCC.getSame_trn_no` | - | Same processing number | Retrieve same processing number for multi-service coordination |
| R | `JKKHakkoSODCC.findZ1OrderHasBeenSentSvcKeiUcwk` | - | Z1 order check | Check if Z1 order has already been issued (prevents duplicate orders) |
| - | `JKKHakkoSODCC.checkTakinoRT` | - | Multi-function router check | Check if multi-function router is applicable — returns flg (0=no router, 2=router present, 4=router change needed, 9=not applicable) |
| - | `JKKHakkoSODCC.chgSvcKeiJdg` | - | Service contract change judgment | Judge whether the service contract number differs from the previous record |
| - | `JKKHakkoSODCC.isMansionPrvate` | - | Mansion private check | Check if the address is a private mansion type (excludes certain SOD issuances) |
| - | `JKKHakkoSODCC.isEmobile` | - | e-Mobile check | Check if the price code corresponds to e-Mobile plans |
| - | `JKKHakkoSODCC.isBlank` | - | Blank check | Utility to check if a string is blank/null |
| - | `JKKHakkoSODCC.isBmpOpenZumi` | - | Phone number portability completed check | Check if phone number portability work has been completed |
| - | `JKKHakkoSODCC.isTajgsTelNo` | - | Other-company phone number check | Check if the phone number belongs to another carrier (for portability detection) |
| - | `JKKHakkoSODCC.isMonaiBmp` | - | No-phone-number portability check | Check if the phone number does not require portability work |
| - | `JKKHakkoSODCC.getOldVrsbIdgSvcDtlCd` | - | Old verifiable ID service detail code | Retrieve old service verification detail code |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JKKHakkoSODCC.hakkoSOD` | `hakkoSOD` → `kaihkOdrCtrl` | `addSOD [C] SOD`, `addTakinoSOD [C] SOD_TAKINO`, `tsuikabunAddSOD [C] SOD`, `add050AddSod [C] SOD_050`, `addSODTelNew [C] SOD_TEL_NEW`, `callEKK0351B002SC [R] OP_SVC`, `callEKK0341B008SC [R] KKTK_SVC`, `callEKK0361A010SC [R] ISP_CONTRACT`, `callEKK0191A010SC [R] SVC_KEI_UCWK`, `callEKK0161A010SC [R] SVC_KEI_UCWK`, `callEKK0251B001SC [R] SVC_KEI_KAISEN`, `callEKK1081B001SC [R] KK1081_Z1`, `pauseUkOdrCtrl [-]`, `stpUkOdrCtrl [-]`, `opSetOdrCtrl [-]`, `countUpWiFiSpotSessions [R] WIFI_SPOT`, `getSame_trn_no [-]`, `findZ1OrderHasBeenSentSvcKeiUcwk [R] Z1_ORDER` |

## 6. Per-Branch Detail Blocks

**Block 1** — IF/ELSE branch (service kind routing) `(svc_kind = NET or ADSL)` (L7220)

> Branch for network services (eo Internet, eo ADSL). This is the largest and most complex branch.

| # | Type | Code |
|---|------|------|
| 1 | SET | `getSameTrnNoFlg = false` // Same processing number presence flag [L7224] |
| 2 | SET | `eKK0351B002SCHashListMltise = new ArrayList()` // Multi-session option contract list [L7225] |
| 3 | SET | `eKK0351B002SCHashListFixipad = new ArrayList()` // Fixed IP address option contract list [L7227] |
| 4 | SET | `eKK0351B002SCHashListOp = new ArrayList()` // Option service contract list [L7228] |
| 5 | SET | `ipv6OpSvcList = new ArrayList()` // IPv6 option service info list [L7233] |
| 6 | EXEC | `callEKK0351B002SC(param, handle, inHashMltise, resultHashMltise, FUNC_CODE_1)` // Query multi-session option contracts [L7247] |
| 7 | IF | `statusCode != 0` → throw CCException [L7249] |
| 8 | FOR | Loop over `msgEKK0351B002SCList` — filter by status and match parent `svc_kei_ucwk_no` [L7252–L7293] |
| 9 | EXEC | `callEKK0351A010SC(...)` // Query option contract consent for multi-session [L7272] |
| 10 | SET | `eKK0351B002SCHashListMltise.add(eKK0351A010SCHash)` [L7291] |
| 11 | EXEC | `callEKK0351B002SC(param, handle, inHashFixipad, resultHashFixipad, FUNC_CODE_1)` // Query fixed IP address contracts [L7302] |
| 12 | FOR | Loop over fixed IP address results — match status and extract contract numbers [L7305–L7340] |
| 13 | SET | `this.op_svc_kei_no_fixipad = ...` [L7333] |
| 14 | SET | `this.op_gadtm_fixipad = ...` [L7334] |
| 15 | EXEC | `callEKK0351B002SC(param, handle, inHashMltise, resultHashMltise, FUNC_CODE_1)` // Query option service contracts [L7357] |
| 16 | FOR | Loop over option contracts, filter by status `020/030/100/210` and option code [L7363–L7390] |
| 17 | SET | `eKK0351B002SCHashListOp.add(eKK0351B002SCHash)` [L7387] |
| 18 | SET | `getSameTrnNoFlg = true` [L7388] |
| 19 | EXEC | `callEKK0341B008SC(param, handle, inHashKktk, resultHashKktk, FUNC_CODE_1)` // Query equipment provision (BBR) [L7402] |
| 20 | FOR | Loop over equipment provision results — filter for BBR code `C014` with status `100/210/030` [L7412–L7457] |
| 21 | SET | `this.kktk_svc_kei_no[0] = ...` // Equipment contract number [L7436] |
| 22 | SET | `this.taknkiki_model_cd[0] = ...` // Home appliance model code [L7439] |
| 23 | SET | `this.kiki_seizo_no[0] = ...` // Equipment serial number [L7441] |
| 24 | SET | `getSameTrnNoFlg = true` [L7442] |
| 25 | EXEC | `checkTakinoRT(handle, param)` // Check multi-function router [L7453] |
| 26 | SET | `getSameTrnNoFlg = true` // If takino_flg != 0 and != 9 [L7458] |
| 27 | IF | `getSameTrnNoFlg || svc_kei_stat = 210` → `getSame_trn_no()` [L7471] |
| 28 | SET | `this.svc_kei_ucwk_no[0] = svc_kei_ucwk_no` [L7478] |
| 29 | SET | `this.svc_kei_ucwk_gadtm[0] = chaf_svc_kei_ucwk_gene_add_dtm` [L7481] |
| 30 | IF | Not ADSL or eo ADSL FURETTSU → check mansion [L7486] |
| 31 | IF | Not mansion private → process option SODs [L7490] |
| 32 | IF | Has multi-session → set op info, check status `100/210/030` [L7495] |
| 33 | SET | `this.old_vrsb_jdg_svc_dtl_cd = getOldVrsbIdgSvcDtlCd(...)` [L7519] |
| 34 | CALL | `addSOD(handle, param, ODR_NAIYO_CD_105)` // FTTH auth recovery [L7522] |
| 35 | EXEC | `callEKK0091A010_SC(...)` // Get KOTEI_IP_AD_8_DIV [L7525] |
| 36 | IF | Multi-session dynamic → `addSOD(..., ODR_NAIYO_CD_142)` // Multi-session change [L7529] |
| 37 | ELSE-IF | Multi-session static + FixIP → `addSOD(..., ODR_NAIYO_CD_161)` + `addSOD(..., ODR_NAIYO_CD_162)` [L7534] |
| 38 | ELSE-IF | FixIP only or KOTEI_IP_AD_8_DIV → `addSOD(..., ODR_NAIYO_CD_153)` // Fixed IP change [L7541] |
| 39 | FOR | Loop over option contracts → handle email (B001), HP (B002), mailing list (B003), dial-up (B020), femto cell (B075), IPV6 (B070) [L7551–L7653] |
| 40 | IF | Option email → `callEKK0361A010SC()` + `addSOD(..., ODR_NAIYO_CD_120)` [L7563–L7587] |
| 41 | IF | Option MyHomePage → `callEKK0361A010SC()`, check URL/domain → `addSOD(..., ODR_NAIYO_CD_128)` [L7594–L7620] |
| 42 | IF | Option mailing list → `addSOD(..., ODR_NAIYO_CD_133)` [L7631–L7636] |
| 43 | IF | Option dial-up → `addSOD(..., ODR_NAIYO_CD_134)` [L7645–L7649] |
| 44 | IF | Option femto cell → `addSOD(..., ODR_NAIYO_CD_165)` [L7657–L7661] |
| 45 | IF | Option IPV6 → add to `ipv6OpSvcList` [L7668–L7674] |
| 46 | IF | Has BBR equipment (`tmp_kiki_seizo_no`) → not mansion → `addSOD(..., ODR_NAIYO_CD_147)` or `ODR_NAIYO_CD_163` [L7796–L7842] |
| 47 | ELSE-IF | `takino_flg == 2` → `addTakinoSOD(..., ODR_NAIYO_CD_401)` or `ODR_NAIYO_CD_404` [L7852–L7862] |
| 48 | ELSE-IF | `takino_flg == 4` → `addTakinoSOD(..., ODR_NAIYO_CD_402)` or `ODR_NAIYO_CD_404` [L7870–L7880] |
| 49 | FOR | Process IPV6 list → `jdgIpv6EKK0361A010()` [L7893–L7901] |
| 50 | IF | `svc_kei_stat = 210 && pause_stp_cd != 02` → `pauseUkOdrCtrl()` [L7908–L7940] |
| 51 | ELSE-IF | `svc_kei_stat = 210 && pause_stp_cd = 02` → `stpUkOdrCtrl()` [L7945–L7952] |

**Block 2** — ELSE-IF branch `(svc_kind = MOB)` (L7957)

> Branch for mobile services (eo Mobile, UQ WiMAX, SpotWiFi, Mail address).

| # | Type | Code |
|---|------|------|
| 1 | IF | `pcrs_cd = WIFISPOT ("PA3001")` → clear `same_trn_no` [L7963] |
| 2 | ELSE-IF | `chgSvcKeiJdg(svc_kei_no)` → `getSame_trn_no()` [L7967] |
| 3 | IF | Not mail address PCRS_CD → `callEKK0161A010SC()` to get `ucwkPcrsCd` [L7977–L7997] |
| 4 | IF | `isEmobile()` → `addSOD(..., ODR_NAIYO_CD_315)` e-mobile pause cancellation [L8011] |
| 5 | EXEC | `callEKK0351B002SC()` // Query option contracts for e-mobile [L8014] |
| 6 | FOR | Loop over options → email (120), HP (128), mail list (133) with status check [L8018–L8086] |
| 7 | IF | `ucwkPcrs_cd = WIMAX ("A46")` → handle WiMAX recovery [L8093] |
| 8 | IF | `pcrs_cd = UQWIMAX_B ("A28")` → `callEKK0341B002SC()` for UQ equipment [L8097] |
| 9 | SET | `this.kktk_svc_kei_no[0] = ...` // Equipment contract number [L8111] |
| 10 | CALL | `tsuikabunAddSOD(handle, param, ODR_NAIYO_CD_316)` // WiMAX CUI recovery [L8127] |
| 11 | CALL | `tsuikabunAddSOD(handle, param, ODR_NAIYO_CD_317)` // WiMAX DEV recovery [L8129] |
| 12 | FOR | Loop over option contracts → email (120), HP (128), mail list (133) [L8136–L8188] |
| 13 | IF | `ucwkPcrs_cd = FREE_WIFI` or `WIFISPOT` → WiFi spot handling [L8197] |
| 14 | EXEC | `countUpWiFiSpotSessions()` // Count active WiFi spot sessions [L8203] |
| 15 | IF | `wifiSpotCnt > 0` → `tsuikabunAddSOD(..., ODR_NAIYO_CD_302)` // WiFi spot change [L8208] |
| 16 | ELSE | `tsuikabunAddSOD(..., ODR_NAIYO_CD_301)` // WiFi spot registration [L8218] |
| 17 | IF | `pcrs_cd = MAILADDRESS` → email (120) and mail list (133) recovery [L8229–L8285] |
| 18 | SET | `this.mae_recode_ch_svc_kei_no = svc_kei_no` [L8293] |

**Block 3** — ELSE-IF branch `(svc_kind = TEL)` (L8298)

> Branch for telephone services (eo Hikari Denwa / VoIP).

| # | Type | Code |
|---|------|------|
| 1 | SET | `isFirstAproach = false` // First approach flag [L8302] |
| 2 | SET | `this.svc_kei_ucwk_no[0] = svc_kei_ucwk_no` [L8310] |
| 3 | EXEC | `getEKK0251B001SC()` // Query service contract withdrawal details [L8315] |
| 4 | SET | `svcKeiKaisenUcwkNo = ...` // Service contract withdrawal details number [L8318] |
| 5 | EXEC | `searchSvcKeiUcwk()` // Query service contract consent [L8324] |
| 6 | SET | `svcKeiUcwkMskmDtlNo = ...` // Service contract application detail number [L8327] |
| 7 | EXEC | `callEKK0351B002SC()` // Query option service contracts [L8333] |
| 8 | SET | `no050Um = false`, `telOpUm = false`, `htbTchUm = false`, `tensoUm = false` // Option flags [L8340–L8343] |
| 9 | FOR | Loop over option contracts → check N050 (050 number transfer), DSP (caller ID), TENSO (transfer) [L8349–L8388] |
| 10 | IF | `op_svc_cd = N050 ("050")` → set `op_svc_kei_no_tikan`, `no050Um = true` [L8372–L8377] |
| 11 | IF | `op_svc_cd = DSP_ME` → `htbTchUm = true` (caller ID notification) [L8380–L8386] |
| 12 | IF | `op_svc_cd = TENSO` → `tensoUm = true` (transfer telephone option) [L8389–L8393] |
| 13 | EXEC | `findZ1OrderHasBeenSentSvcKeiUcwk()` // Check Z1 order status [L8398] |
| 14 | IF | Not Z1 ordered → handle transfer option (`opSetOdrCtrl`) or new registration (`addSODTelNew`) [L8402–L8417] |
| 15 | EXEC | `callEKK1081B001SC()` // Query Z1 order status for new registration [L8412] |
| 16 | IF | No Z1 → `addSODTelNew()` // Telephone new registration [L8415] |
| 17 | RETURN | `return param` [L8417] |
| 18 | EXEC | `callEKK0191A010SC()` // Query service contract details for OLS processing [L8428] |
| 19 | EXEC | `callEKK0341B008SC()` + `callEKK0341B008_02SC()` // Query equipment provision, EG switch consideration [L8446–L8471] |
| 20 | FOR | Loop over equipment → `isRegalVaKiki()` check → set `kktk_svc_kei_no`, `kiki_seizo_no`, etc. [L8473–L8518] |
| 21 | EXEC | `checkTakinoRT()` // Check multi-function router [L8525] |
| 22 | IF | `chgSvcKeiJdg()` → `getSame_trn_no()`, `addSOD(..., ODR_NAIYO_CD_206)` // Radius auth recovery [L8535–L8553] |
| 23 | IF | Equipment info present → handle OLS settings [L8561] |
| 24 | IF | `telno_jun = "2"` (line 2) → `addSOD(..., ODR_NAIYO_CD_208)` or `addTakinoSOD(..., ODR_NAIYO_CD_408)` [L8571–L8587] |
| 25 | ELSE | Line 1 → `addSOD(..., ODR_NAIYO_CD_207)` or `addTakinoSOD(..., ODR_NAIYO_CD_406/407)` [L8592–L8603] |
| 26 | CALL | `addSOD(..., ODR_NAIYO_CD_218)` // SIP registration [L8610] |
| 27 | IF | `eKK0191A010Hash == null` → `callEKK0191A010SC()` [L8615–L8632] |
| 28 | IF | `BMP_UM = ARI` → check portability → `addSOD(..., ODR_NAIYO_CD_225)` (portability registration) or `ODR_NAIYO_CD_223` (temporary suspension) [L8638–L8693] |
| 29 | IF | Not portability → check `isMonaiBmp()` → `addSOD(..., ODR_NAIYO_CD_225)` + `ODR_NAIYO_CD_265` (ENUM) [L8700–L8711] |
| 30 | IF | `telOpUm` → `addSOD(..., ODR_NAIYO_CD_219)` [L8715] |
| 31 | CALL | `addTokiSOD(handle, param, this.ido_div, null)` // Transfer SOD registration [L8750] |
| 32 | IF | `no050Um` → `add050AddSod()` // Number transfer registration [L8755–L8767] |
| 33 | CALL | `addSOD(..., ODR_NAIYO_CD_250)` // Emergency notification registration [L8772] |
| 34 | IF | `svc_kei_stat = 210` → `pauseUkOdrCtrl()` [L8778–L8810] |
| 35 | IF | `isFirstAproach` → `this.mae_recode_ch_svc_kei_no = svc_kei_no` [L8815–L8820] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| SOD | Acronym | Service Order Data — the core order entity used to create telecom service activation requests |
| kaihkOdrCtrl | Field | Recovery order control — the business operation of restoring service after cancellation or suspension |
| svc_kind | Field | Service kind classification code: `1` = NET (Internet), `2` = TEL (Telephone), `4` = MOB (Mobile), `5` = ADSL, `99` = ELSE |
| ODR_NAIYO_CD | Field | Order content code — a numeric code that determines what type of SOD to issue (e.g., 105 = FTTH auth recovery, 120 = email recovery) |
| OP_SVC_CD | Field | Option service code — identifies an option service: `B001` = Email, `B002` = MyHomePage, `B003` = Mailing List, `B020` = Dial-up, `B070` = IPV6, `B075` = Femto Cell, `050` = N050 number transfer, `DSP_ME` = Caller ID notification, `TENSO` = Transfer telephone |
| KKTK_SVC_CD | Field | Equipment provision service code — identifies home equipment: `C004` = HTel VA, `C006` = Split, `C008` = iFilter, `C009` = STB, `C010` = BCAS, `C011` = CCAS, `C012` = ONU, `C013` = vONU, `C014` = BBR, `C016` = e-mobile, `C017` = UQ mobile, `C020` = e-mobile cradle, `C021` = Tablet, `C022` = Cradle, `C024` = Takino Router, `C025` = HGW |
| SVC_KEI_STAT | Field | Service contract status: `010` = Pending, `020` = Agreed, `030` = Terminated (pending), `100` = Service provision (active), `110` = In progress, `210` = Suspension/cancellation, `910` = Suspended (mid-term), `920` = Pending cancellation |
| PCRS_CD | Field | Price/course code — identifies the specific tariff plan (e.g., `A03` = 100M, `A28` = UQ WiMAX B, `A30` = WiFi spot, `A46` = WiMAX, `PA3001` = WiFi spot plan, `PA4501` = WiFi free plan) |
| PPLAN_CD | Field | Plan code — higher-level plan classification (e.g., `PA3001` = WiFi spot, `PA4501` = WiFi free, `PC3001` = UQ router, `PC3101` = UQ USB) |
| PRC_GRP_CD | Field | Price group code — groups pricing categories (e.g., `02` = NET Home, `03` = NET City, `04` = NET MT, `05` = E-Access, `06` = FLET, `07` = Mobile WiFi, `08` = Mobile eMobile, `09` = Mobile UQ, `10` = Telephone) |
| SVC_FLG | Field | Service flag codes (`03`, `04`, `05`) — used to identify service feature flags |
| SVC_CD_NET/TTEL/TV/HS | Field | Service channel codes: `01` = Network, `02` = Telephone, `03` = TV, `04` = Home Shopping |
| ido_div | Field | Move classification — identifies the type of service change operation (e.g., `00067` = EG switch, `000` = new registration) |
| svc_kei_no | Field | Service contract number — unique identifier for a service line item |
| svc_kei_ucwk_no | Field | Service contract detail number — internal tracking ID for service contract line items |
| gene_add_dtm | Field | Generation registration datetime — timestamp when the contract record was created (format: `yyyyMMddHHmmss`) |
| kktk_svc_kei_no | Field | Equipment provision service contract number — ID for the equipment (router, VA, etc.) contract |
| kiki_seizo_no | Field | Equipment serial number — hardware serial identifier |
| taknkiki_model_cd | Field | Home appliance model code — identifies the type of equipment (router, VA, etc.) |
| takino_flg | Field | Multi-function router flag returned by `checkTakinoRT`: `0` = no router, `2` = router present, `4` = router change needed, `9` = not applicable |
| same_trn_no | Field | Same processing number — shared transaction number for coordinating multi-service recovery |
| mae_recode_ch_svc_kei_no | Field | Previous record changed service contract number — tracks contract number changes for audit |
| op_svc_kei_no_mltise / op_gadtm_mltise | Field | Option service contract number / datetime for multi-session |
| op_svc_kei_no_fixipad / op_gadtm_fixipad | Field | Option service contract number / datetime for fixed IP address |
| op_svc_kei_no_ml / op_gadtm_ml | Field | Option service contract number / datetime for email service |
| op_svc_kei_no_hp / op_gadtm_hp | Field | Option service contract number / datetime for MyHomePage (WEB) service |
| op_svc_kei_no_mlist / op_gadtm_mlist | Field | Option service contract number / datetime for mailing list service |
| op_svc_kei_no_dial / op_gadtm_dial | Field | Option service contract number / datetime for dial-up connection |
| op_svc_kei_no_fmtcel / op_gadtm_fmtcel | Field | Option service contract number / datetime for femto cell service |
| op_svc_kei_no_ipv6 / op_gadtm_ipv6 | Field | Option service contract number / datetime for IPV6 service |
| op_svc_kei_no_tikan / op_gadtm_tikan | Field | Option service contract number / datetime for N050 number transfer |
| sameTrnNoFlg | Field | Same processing number presence flag — true when option or equipment contracts exist |
| no050Um | Field | 050 number option presence flag |
| telOpUm | Field | Telephone option (non-050) presence flag |
| htbTchUm | Field | Caller ID notification option presence flag |
| tensoUm | Field | Transfer telephone option presence flag |
| isZ1Ordered | Field | Z1 order already issued flag — prevents duplicate orders |
| isFirstAproach | Field | First approach flag — tracks whether the first service contract detail has been processed (eo Hikari Denwa recovery dispatch) |
| oyaSvcKeiUcwkNo | Field | Parent service contract detail number — used to match multi-session contracts to the current contract |
| mlad | Field | Mail address — the email address from ISP contract details |
| url_domain / url_account | Field | URL domain and account for MyHomePage — if blank, no SOD is issued |
| isMansionPrvate | Method | Checks if the service address is a private mansion type (excludes certain SOD issuance) |
| isEmobile | Method | Checks if the price code corresponds to e-Mobile plans |
| isBmpOpenZumi | Method | Checks if phone number portability work has been completed |
| isTajgsTelNo | Method | Checks if the phone number belongs to another carrier |
| isMonaiBmp | Method | Checks if the phone number does not require portability work |
| checkTakinoRT | Method | Checks if a multi-function router is applicable; returns status code |
| chgSvcKeiJdg | Method | Judges whether the service contract number differs from the previous record |
| getSame_trn_no | Method | Retrieves the same processing number for multi-service coordination |
| pauseUkOdrCtrl | Method | Processes pause-received orders — creates pause orders for suspended services |
| stpUkOdrCtrl | Method | Processes stop-received orders — creates stop orders for services with suspension code 02 |
| opSetOdrCtrl | Method | Processes option setup orders — creates orders for transfer telephone options |
| addSOD | Method | Core SOD creation method — creates a service order with the specified order content code |
| addTakinoSOD | Method | Creates multi-function router SOD — handles VA + router configuration |
| addSODTelNew | Method | Creates new telephone service registration SOD |
| add050AddSod | Method | Creates 050 number transfer registration SOD |
| tsuikabunAddSOD | Method | Creates supplementary/separate SOD — used for WiMAX and WiFi spot recovery |
| jdgSvcKind | Method | Determines the service kind (NET, TEL, MOB, ADSL, etc.) |
| jdgSvcKind_PcrsCd | Method | Alternative method for service kind determination based on price code (deprecated) |
| shkkaMap | Method | Copies/clears a HashMap — used to initialize the three SOD information maps |
| shkkaChr | Method | Clears a character/string value — used to trim equipment service codes |
| edit4OpSetOdrCtrl | Method | Maps option setup data for order control processing |
| callEKK0351B002SC | SC | Query option service contracts list |
| callEKK0351A010SC | SC | Query option service contract consent details |
| callEKK0341B008SC | SC | Query equipment provision service contracts |
| callEKK0341B008_02SC | SC | Query equipment provision with EG switch consideration |
| callEKK0341B002SC | SC | Query equipment provision list (legacy) |
| callEKK0361A010SC | SC | Query option service contract ISP details |
| callEKK0191A010SC | SC | Query service contract details for telephone |
| callEKK0161A010SC | SC | Query service contract consent |
| callEKK0251B001SC | SC | Query service contract withdrawal details |
| callEKK1081B001SC | SC | Query Z1 order status |
| callETU0011B010SC | SC | Query work list for phone number portability (commented out) |
| callEKK0091A010_SC | SC | Get fixed IP address (8-digit) division code |
| searchSvcKeiUcwk | Method | Search service contract details |
| countUpWiFiSpotSessions | Method | Count active WiFi spot sessions |
| findZ1OrderHasBeenSentSvcKeiUcwk | Method | Check if Z1 order has been issued |
| getOldVrsbIdgSvcDtlCd | Method | Get old verifiable ID service detail code |
| jdgIpv6EKK0361A010 | Method | Judge and process IPV6 service via EKK0361A010SC |
| legalTelSod | Method | Determine if a telephone option SOD should be issued |
| isRegalVaKiki | Method | Judge if the VA (video appliance) equipment is eligible — handles repair replacement logic |
| FTTH | Business term | Fiber To The Home — fiber-optic internet service (eo Hikari) |
| BBR | Business term | Broadband Router — home network routing equipment provided by the carrier |
| VA | Business term | Video Appliance — home appliance equipment for telephone/TV services (eo Hikari Denwa) |
| OLS | Business term | Online Local Service — settings for telephone number registration and VoIP configuration |
| ENUM | Business term | E.164 Number Mapping — maps telephone numbers to SIP URIs for VoIP calling |
| SIP | Business term | Session Initiation Protocol — VoIP signaling protocol for telephone services |
| WiMAX | Business term | Worldwide Interoperability for Microwave Access — mobile broadband wireless service (UQ) |
| SpotWiFi | Business term | WiFi spot service — shared public WiFi access plan |
| e-mobile | Business term | e-Mobile mobile carrier service brand (now part of SoftBank) |
| UQ | Business term | UQ Communications — mobile carrier brand offering WiMAX and mobile data services |
| Z1 | Field | Z1 order — a primary order type for telephone service registration |
| EG | Field | Ethernet Gateway — network gateway device that may need switching during VA replacement |
| IPV6 | Business term | Internet Protocol version 6 — next-generation internet protocol |
| MLAD | Field | Mail address — the email address associated with ISP option service |
| BMP | Field | Phone number portability (bangou hikiki) — work identifier for number portability |
| PCRS_CD_MAILADDRESS | Field | Mail address plan code — price code for email address add-on service |
| NEW_CRS_FLAG | Field | New course flag — indicates a course change is in progress (for forced cancellation during plan changes) |
| OLD_CRS_AV_FLG | Field | Old course available flag — indicates the old course is still active during a plan change |
| TARGET_SVC_KEI_UCWK_CNT | Field | Target service contract detail count — count of service details to process (for address changes) |
| AD_CHG_ADD_FLAG | Field | Address change add flag — flag for address change processing |
| PAUSE_STP_CD_02 | Constant | Pause stop code `02` — indicates "during suspension" state (stop orders vs. pause orders) |
| ODR_HAKKO_JOKEN_CD_CHIEN_HAKKO | Constant | Order issuance condition code for full issuance |
| ODR_HAKKO_JOKEN_CD_TEL_SVC_START_JOKEN | Constant | Order issuance condition code for telephone service start condition |
| ORDER_SBT_CD_TEL | Constant | Order subject code for telephone |
| SVC_ORDER_CD_EOH_TEL_NEW_KEI_ODR | Constant | Service order code for eo Hikari Denwa new contract order |
| FUNC_CODE_1 / FUNC_CODE_2 / FUNC_CODE_4 | Constants | Function codes used in SC calls to distinguish processing modes |
| TEMPLATE_ID_EKK0351B002 | Constant | Template ID for EKK0351B002SC response |
| TEMPLATE_ID_EKK0351A010 | Constant | Template ID for EKK0351A010SC response |
| TEMPLATE_ID_EKK0341B022 | Constant | Template ID for EKK0341B008SC/EKK0341B008_02SC response |
| TEMPLATE_ID_EKK0361A010 | Constant | Template ID for EKK0361A010SC response |
| TEMPLATE_ID_EKK0191A010 | Constant | Template ID for EKK0191A010SC response |
| TEMPLATE_ID_EKK0161A010 | Constant | Template ID for EKK0161A010SC response |
| FUNC_CODE_1 | Constant | Function code value for standard processing in SC calls |
| FUNC_CODE_2 | Constant | Function code value for secondary processing in SC calls |
| FUNC_CODE_4 | Constant | Function code value for EG switch processing in SC calls |
| SOD_KIHON_INFO | Constant | Map key for SOD basic information in sodMap |
| SVC_KEI_INFO | Constant | Map key for service contract information in sodMap |
| SVC_KEI_UCWK_INFO | Constant | Map key for service contract detail information in sodMap |
| INFO_SYSID | Constant | Map key for system ID |
| INFO_IDO_DIV | Constant | Map key for move classification |
| INFO_SVC_KEI_NO | Constant | Map key for service contract number |
| INFO_SVC_KEI_UCWK_NO | Constant | Map key for service contract detail number |
| INFO_CHAF_SVC_KEI_UCWK_GENE_ADD_DTM | Constant | Map key for generation registration datetime |
| INFO_NEW_CRS_FLAG | Constant | Map key for new course flag |
| IS_OLD_CRS_AV_FLG | Constant | Map key for old course available flag |
| BMP_UM_ARI | Constant | Portability present flag value (ARI = "present/available") |
| BMP_KOJI_STAT_KOJIFIN | Constant | Work status "work completed" |
| ITENS_OPAF_TOKI_KIBO_UM | Constant | Field key for transfer request presence |
| ITENS_OPAF_TOKI_ADD_CD | Constant | Field key for transfer registration code |