# Business Logic — JKKOrsjgsUseStpRunCC.runUseStpProc() [316 LOC]

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

## 1. Role

### JKKOrsjgsUseStpRunCC.runUseStpProc()

This method is the core **main processing routine for supplier business operator usage suspension** (利用停止メイン処理). It orchestrates the full lifecycle of deactivating a service contract in the Fujitsu Telecom (eo) customer infrastructure system. The method begins by querying the service contract agreement to determine the billing group classification, then **early-exits** for certain excluded billing groups (Mansion Primary, MiNEO, eo Electricity). For eligible contracts, it traverses the billing hierarchy — resolving billing contract numbers, billing line items, and their respective agreement details — to systematically apply usage suspension across all contract layers: main service contracts, optional services, sub-optional services, and equipment-provided services (KKTk).

The method implements a **pipeline dispatch design pattern**: it sequentially calls service components for data retrieval (read operations), then delegates to specialized suspension handlers for each service type (write operations), and finally performs progress registration and downstream supplier instruction registration. It also handles a special post-loop case for telephone services where ONU/VDSL equipment connected to the eo light network must be suspended independently. The `hakkoSODDataList` (SOD issuance data) collects pending order data for later service control management suspension processing.

**Role in the larger system:** This is a shared utility method called by `orsjgsRunUseStp()`, which serves as the entry point for the supplier business operator suspension screen (KKSV0004). The method ensures that all related service contracts under a given service agreement are consistently suspended, respecting contract dependencies (e.g., only suspending optional services when sub-optional services are absent).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["runUseStpProc Start"])
    INIT["Init: statusCode=0, resultHash, hakkoSODDataList, set SVC_KEI_USE_STP_EXEC_FLG=false, get prm_svc_kei_no"]
    INIT --> CALL_SA["callEKK0081A010SC: Service Contract Agreement Inquiry"]
    CALL_SA --> CHECK_SA_ERR{statusCode != 0?}
    CHECK_SA_ERR -->|Yes| EARLY_RET["Return statusCode"]
    CHECK_SA_ERR -->|No| GET_SA["Get eKK0081A010Hash from resultHash, Extract prc_grp_cd"]
    GET_SA --> CHECK_MANSION{prc_grp_cd == PRC_GRP_CD_MANSION_OYA = "99"}
    CHECK_MANSION -->|Yes| MANSION_RET["Return 0 - Mansion Primary skip"]
    CHECK_MANSION -->|No| CHECK_MINEO{prc_grp_cd == PRC_GRP_CD_MINEO = "51"}
    CHECK_MINEO -->|Yes| MINEO_RET["Return 0 - MiNEO skip"]
    CHECK_MINEO -->|No| CHECK_EODENKI{prc_grp_cd == PRC_GRP_CD_EODENKI = "17"}
    CHECK_EODENKI -->|Yes| EODENKI_RET["Return 0 - eo Electricity skip"]
    CHECK_EODENKI -->|No| CHECK_FUKA["useStpFukaCheck: Check usage suspension unavailability"]
    CHECK_FUKA -->|Unavailable| FUKA_RET["Set wk_Fuka_flg=true, Return 0"]
    CHECK_FUKA -->|Available| CALL_MANSION["callEKK0861B002SC: Mansion Info Lookup"]
    CALL_MANSION --> CHECK_MANS_ERR{statusCode != 0?}
    CHECK_MANS_ERR -->|Yes| RET_MANS["Return statusCode"]
    CHECK_MANS_ERR -->|No| CALL_BILL["callEKK0321B005SC: Billing Contract No Lookup"]
    CALL_BILL --> CHECK_BILL_ERR{statusCode != 0?}
    CHECK_BILL_ERR -->|Yes| RET_BILL["Return statusCode"]
    CHECK_BILL_ERR -->|No| CHECK_BILL_EMPTY{eKK0321B005HashList.size == 0?}
    CHECK_BILL_EMPTY -->|Yes| RET_NOBILL["Return 0 - no billing contract"]
    CHECK_BILL_EMPTY -->|No| GET_BILL["Get eKK0321B005Hash[0], Extract seikyu_kei_no"]
    GET_BILL --> CALL_BILLLINE["callEKK0321B002SC: Billing Line Inquiry"]
    CALL_BILLLINE --> CHECK_BL_ERR{statusCode != 0?}
    CHECK_BL_ERR -->|Yes| RET_BL["Return statusCode"]
    CHECK_BL_ERR -->|No| CHECK_BL_EMPTY{eKK0321B002HashList.size == 0?}
    CHECK_BL_EMPTY -->|Yes| RET_NOBL["Return 0 - no billing lines"]
    CHECK_BL_EMPTY -->|No| FOR_START["For each eKK0321B002Hash:"]
    FOR_START --> CALL_BLA["callEKK0321A010SC: Billing Line Agreement Inquiry"]
    CALL_BLA --> CHECK_BLA_ERR{statusCode != 0?}
    CHECK_BLA_ERR -->|Yes| RET_BLA["Return statusCode"]
    CHECK_BLA_ERR -->|No| CHECK_BLA_NULL{eKK0321A010Hash == null?}
    CHECK_BLA_NULL -->|Yes| CONT_LOOP["continue - skip this line"]
    CHECK_BLA_NULL -->|No| EXTRACT["Extract svc_kei_no, kktk_svc_kei_no, op_svc_kei_no, sbop_svc_kei_no"]
    EXTRACT --> CHECK_SVC{svc_kei_no not null and not empty?}
    CHECK_SVC -->|Yes| CALL_SVC_STP["svcKei_UseStp: Service Contract Suspension"]
    CHECK_SVC -->|No| CHECK_OP
    CALL_SVC_STP --> CHECK_SVC_STP_ERR{statusCode != 0?}
    CHECK_SVC_STP_ERR -->|Yes| RET_SVC["Return statusCode"]
    CHECK_SVC_STP_ERR -->|No| CHECK_OP{op_svc_kei_no not null/empty AND sbop_svc_kei_no null/empty?}
    CHECK_OP -->|Yes| CALL_OP_STP["opSvcKei_UseStp: Optional Service Suspension"]
    CHECK_OP -->|No| CHECK_SBOP{sbop_svc_kei_no not null/empty?}
    CHECK_SBOP -->|Yes| CALL_SBOP_STP["sbOpSvcKei_UseStp: Sub-Optional Service Suspension"]
    CHECK_SBOP -->|No| CHECK_KKTK{kktk_svc_kei_no not null/empty?}
    CHECK_KKTK -->|Yes| CALL_KKTK_STP["kktkSvcKei_UseStp: Equipment-Provided Service Suspension"]
    CHECK_KKTK -->|No| NEXT_ITER["Next loop iteration"]
    CALL_OP_STP --> CHECK_OP_STP_ERR{statusCode != 0?}
    CALL_SBOP_STP --> CHECK_SBOP_STP_ERR{statusCode != 0?}
    CALL_KKTK_STP --> CHECK_KKTK_STP_ERR{statusCode != 0?}
    CHECK_OP_STP_ERR -->|Yes| RET_OP["Return statusCode"]
    CHECK_SBOP_STP_ERR -->|Yes| RET_SBOP["Return statusCode"]
    CHECK_KKTK_STP_ERR -->|Yes| RET_KKTK["Return statusCode"]
    CHECK_OP_STP_ERR -->|No| NEXT_ITER
    CHECK_SBOP_STP_ERR -->|No| NEXT_ITER
    CHECK_KKTK_STP_ERR -->|No| NEXT_ITER
    NEXT_ITER --> CHECK_LOOP_END{"i < eKK0321B002HashList.size?"}
    CHECK_LOOP_END -->|Yes| FOR_START
    CHECK_LOOP_END -->|No| FOR_END["End loop"]
    FOR_END --> CHECK_TEL{eKK0081A010Hash != null AND SVC_CD == SVC_CD_TEL = "02"?}
    CHECK_TEL -->|Yes| CALL_KKTK2["kktkSvcKei_UseStp2: ONU/VDSL Equipment Suspension"]
    CHECK_TEL -->|No| CALL_PROGRESS["callEKK1091D010SC: Progress Registration"]
    CALL_KKTK2 --> CHECK_KKTK2_ERR{statusCode != 0?}
    CHECK_KKTK2_ERR -->|Yes| RET_KKTK2["Return statusCode"]
    CHECK_KKTK2_ERR -->|No| CALL_PROGRESS
    CALL_PROGRESS --> CHECK_PRG_ERR{statusCode != 0?}
    CHECK_PRG_ERR -->|Yes| RET_PRG["Return statusCode"]
    CHECK_PRG_ERR -->|No| CHECK_EXEC{SVC_KEI_USE_STP_EXEC_FLG == true?}
    CHECK_EXEC -->|Yes| CALL_SVC_CTL["svcCtlUseStpReq: Service Control Management Suspension Request"]
    CHECK_EXEC -->|No| CALL_DIR_REG["callEKK0081B546SC: Designated Registration Info Lookup"]
    CALL_SVC_CTL --> CHECK_SVC_CTL_ERR{statusCode != 0?}
    CHECK_SVC_CTL_ERR -->|Yes| RET_SVC_CTL["Return statusCode"]
    CHECK_SVC_CTL_ERR -->|No| CALL_DIR_REG
    CALL_DIR_REG --> CHECK_DIR_ERR{statusCode != 0?}
    CHECK_DIR_ERR -->|Yes| RET_DIR["Return statusCode"]
    CHECK_DIR_ERR -->|No| CHECK_DIR_EMPTY{eKK0081B546HashList != null AND size > 0?}
    CHECK_DIR_EMPTY -->|No| FINAL_RET["Return 0 - Success"]
    CHECK_DIR_EMPTY -->|Yes| GET_DIR["Get eKK0081B546Hash[0], Extract updUm"]
    GET_DIR --> CHECK_UPD{updUm == 1?}
    CHECK_UPD -->|Yes| GET_SYSID["Get sysid from eKK0081B546Hash"]
    GET_SYSID --> CALL_SHI["orsjgsrunUseStpAddShijisho11: Supplier Suspension Instruction Registration"]
    CALL_SHI --> CHECK_SHI_ERR{statusCode != 0?}
    CHECK_SHI_ERR -->|Yes| RET_SHI["Return statusCode"]
    CHECK_SHI_ERR -->|No| FINAL_RET
    CHECK_UPD -->|No| FINAL_RET
    START --> INIT
```

### Branch Summaries

1. **Billing Group Exclusion (Block 1-3):** If the service contract's billing group code matches `PRC_GRP_CD_MANSION_OYA` ("99" / Mansion Primary), `PRC_GRP_CD_MINEO` ("51" / MiNEO), or `PRC_GRP_CD_EODENKI` ("17" / eo Electricity), processing exits immediately with `0`.

2. **Unavailability Check (Block 4):** Calls `useStpFukaCheck` — if usage suspension is unavailable, sets `wk_Fuka_flg = true` and returns `0`.

3. **Hierarchy Resolution (Block 5-10):** Sequentially resolves mansion info, billing contract number, and billing line items. Each step returns early on error or empty results.

4. **Per-Line Suspension Loop (Block 11):** Iterates over billing line agreements. For each, applies suspension handlers for whichever service types are present (main service contract, optional, sub-optional, equipment-provided). Each handler is independent (not mutually exclusive).

5. **Telephone Equipment Suspension (Block 12):** If the service contract is a telephone type (`SVC_CD_TEL = "02"`), suspends ONU/VDSL equipment via `kktkSvcKei_UseStp2`.

6. **Progress Registration (Block 13):** Calls `callEKK1091D010SC` to register the progress state.

7. **Service Control Suspension (Block 14):** If `SVC_KEI_USE_STP_EXEC_FLG` was set to `true` during suspension processing, calls `svcCtlUseStpReq` to submit the service control management suspension request with the collected SOD issuance data.

8. **Supplier Instruction Registration (Block 15):** Calls `callEKK0081B546SC` to check for designated registration info. If `updUm` ("1" / has update), registers the supplier business operator suspension instruction via `orsjgsrunUseStpAddShijisho11`.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session manager handle carrying database connection, transaction context, and operational metadata. Used for all service component invocations and data retrieval. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object containing screen data, control maps, and template data maps. Provides read/write access to screen-level parameters and result containers. |
| 3 | `requestParam` | `HashMap<String, Object>` | Request parameter map carrying business input data. Contains the service contract number (`SVC_KEI_NO`), and serves as a shared accumulator for service component results. The method sets `SVC_KEI_USE_STP_EXEC_FLG` to track whether suspension was executed. |
| 4 | `fixedText` | `String` | User-defined arbitrary text string (from `orsjgsRunUseStp`). Used as a data map key to extract screen-specific input data. Not directly used within this method's body. |
| 5 | `fukaUseStpTrgtLst` | `ArrayList<HashMap<String, Object>>` | Usage suspension inapplicability target list. Contains service contracts that CANNOT be suspended (e.g., linked TV services, ongoing contracts). Used by `useStpFukaCheck` to determine if suspension should be blocked. |

### Instance Fields Read

| Field | Type | Business Description |
|-------|------|---------------------|
| `wk_Fuka_flg` | `boolean` | Suspension inapplicability flag. Set to `true` when `useStpFukaCheck` determines that usage suspension cannot be performed. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKOrsjgsUseStpRunCC.callEKK0081A010SC` | EKK0081A010SC | Service Contract Agreement (K_KET_YAKSOKU) | Inquiry of service contract agreement data for the given service contract number |
| R | `JKKOrsjgsUseStpRunCC.callEKK0861B002SC` | EKK0861B002SC | Mansion Info (K_KET_MANSION) | Lookup mansion information associated with the service contract |
| R | `JKKOrsjgsUseStpRunCC.callEKK0321B005SC` | EKK0321B005SC | Billing Contract / Service Contract (K_KET_SEIKYU) | Billing contract number and service contract number inquiry |
| R | `JKKOrsjgsUseStpRunCC.callEKK0321B002SC` | EKK0321B002SC | Billing Line (K_KET_SEIKYU_LINE) | Billing line item inquiry for a specific billing contract number and service contract number |
| R | `JKKOrsjgsUseStpRunCC.callEKK0321A010SC` | EKK0321A010SC | Billing Line Agreement (K_KET_SEIKYU_AGREEMENT) | Billing line agreement inquiry for individual billing line items |
| R | `JKKOrsjgsUseStpRunCC.callEKK1091D010SC` | EKK1091D010SC | Progress Registration (K_PROG_REG) | Progress registration — records the processing status update for the usage suspension |
| R | `JKKOrsjgsUseStpRunCC.callEKK0081B546SC` | EKK0081B546SC | Designated Registration Info (K_TORITAME_TEISHO) | Designated registration info lookup for supplier suspension instruction data |
| - | `JKKOrsjgsUseStpRunCC.kktkSvcKei_UseStp` | - | Equipment-Provided Service Contract (K_KET_KKTK) | Suspension processing for equipment-provided service contracts (e.g., multi-function routers) |
| - | `JKKOrsjgsUseStpRunCC.kktkSvcKei_UseStp2` | - | ONU/VDSL Equipment (K_KET_KKTK) | Suspension processing for ONU/VDSL equipment connected to eo light network (telephone service specific) |
| - | `JKKOrsjgsUseStpRunCC.opSvcKei_UseStp` | - | Optional Service Contract (K_KET_OPSVC) | Suspension processing for optional service contracts (applied only when sub-optional is absent) |
| - | `JKKOrsjgsUseStpRunCC.orsjgsrunUseStpAddShijisho11` | - | Supplier Business Operator (K_OTUSAKI_JGYOSHA) | Supplier business operator suspension instruction registration — notifies the external business operator of the suspension |
| - | `JKKOrsjgsUseStpRunCC.sbOpSvcKei_UseStp` | - | Sub-Optional Service Contract (K_KET_SBOPSVC) | Suspension processing for sub-optional service contracts |
| - | `JKKOrsjgsUseStpRunCC.svcCtlUseStpReq` | - | Service Control Management (K_CTL_SVC) | Service control management suspension request — submits pending SOD issuance data for processing |
| - | `JKKOrsjgsUseStpRunCC.svcKei_UseStp` | - | Service Contract (K_KET_SVC) | Core service contract usage suspension processing |
| - | `JKKOrsjgsUseStpRunCC.useStpFukaCheck` | - | Inapplicability Check Table | Checks whether usage suspension is inapplicable for the given service contracts |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Direct Caller: `orsjgsRunUseStp` in JKKOrsjgsUseStpRunCC | `orsjgsRunUseStp(handle, param, fixedText)` -> `runUseStpProc(handle, param, requestParam, fixedText, fukaUseStpTrgtLst)` | `orsjgsrunUseStpAddShijisho11 [C] K_OTUSAKI_JGYOSHA`, `callEKK0081B546SC [R] K_TORITAME_TEISHO`, `svcCtlUseStpReq [-] K_CTL_SVC`, `callEKK1091D010SC [R] K_PROG_REG`, `kktkSvcKei_UseStp2 [-] K_KET_KKTK`, `kktkSvcKei_UseStp [-] K_KET_KKTK`, `sbOpSvcKei_UseStp [-] K_KET_SBOPSVC`, `opSvcKei_UseStp [-] K_KET_OPSVC`, `svcKei_UseStp [-] K_KET_SVC`, `callEKK0321A010SC [R] K_KET_SEIKYU_AGREEMENT`, `callEKK0321B002SC [R] K_KET_SEIKYU_LINE`, `callEKK0321B005SC [R] K_KET_SEIKYU`, `callEKK0861B002SC [R] K_KET_MANSION`, `useStpFukaCheck [-] Inapplicability Check`, `callEKK0081A010SC [R] K_KET_YAKSOKU` |

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `(initialization) (L360)`

> Initialize processing variables and set up the shared result containers.

| # | Type | Code |
|---|------|------|
| 1 | SET | `statusCode = 0` // Status code (from 利用停止メイン処理) |
| 2 | SET | `resultHash = new HashMap<String, Object>()` // S-IF result storage (S-IF結果格納用) |
| 3 | SET | `requestParam.put(SVC_KEI_USE_STP_EXEC_FLG, false)` // Service contract usage suspension execution flag [-> SVC_KEI_USE_STP_EXEC_FLG="svc_kei_use_stp_exec_flg"] |
| 4 | SET | `hakkoSODDataList = new ArrayList<HashMap<String,Object>>()` // For SOD issuance (SOD発行用) |
| 5 | SET | `prm_svc_kei_no = (String)requestParam.get(SVC_KEI_NO)` // Service contract number to suspend [-> SVC_KEI_NO="svc_kei_no"] (利用停止対象サービス契約) |

**Block 2** — [CALL] `(service contract agreement inquiry) (L374)`

> Query the service contract agreement data using the service contract number.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0081A010SC(param, handle, requestParam, resultHash, prm_svc_kei_no)` // Service Contract Agreement Inquiry (サービス契約照合) |

**Block 3** — [IF] `(error check after service contract agreement inquiry) (L376)`

> Early return if the inquiry failed.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `statusCode` // if statusCode != 0 |

**Block 4** — [SET] `(extract service contract agreement result) (L381)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0081A010Hash = (HashMap<String, Object>)resultHash.get(TEMPLATE_ID_EKK0081A010)` // Service Contract Agreement result [-> TEMPLATE_ID_EKK0081A010="EKK0081A010"] |
| 2 | SET | `prc_grp_cd = (String)eKK0081A010Hash.get(EKK0081A010CBSMsg1List.PRC_GRP_CD)` // Billing group code (料金グループコード) |

**Block 5** — [IF] `(PRC_GRP_CD_MANSION_OYA = "99" / Mansion Primary) (L387)`

> If the billing group is Mansion Primary, skip all processing. Mansion/condominium primary contracts are excluded from individual supplier suspension. [-> PRC_GRP_CD_MANSION_OYA="99" (JKKOrsjgsUseStpRunCC.java)]

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `0` // Process skip — Mansion Primary (処理なし) |

**Block 6** — [IF] `(PRC_GRP_CD_MINEO = "51" / MiNEO) (L393)`

> If the billing group is MiNEO, skip all processing. [-> PRC_GRP_CD_MINEO="51" (JKKOrsjgsUseStpRunCC.java)]

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `0` // Process skip — MiNEO (処理なし) |

**Block 7** — [IF] `(PRC_GRP_CD_EODENKI = "17" / eo Electricity) (L399)`

> If the billing group is eo Electricity, skip all processing. [-> PRC_GRP_CD_EODENKI="17" (JKKOrsjgsUseStpRunCC.java)]

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `0` // Process skip — eo Electricity (処理なし) |

**Block 8** — [IF] `(usage suspension unavailability check) (L405)`

> Check if usage suspension is inapplicable for the service. The `useStpFukaCheck` method examines the `fukaUseStpTrgtLst` and `requestParam` to determine if any constraints prevent suspension (e.g., linked services, ongoing contracts).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `useStpFukaCheck(fukaUseStpTrgtLst, requestParam, resultHash)` // Check if usage suspension unavailable (利用停止可能判定処理) |
| 2 | SET | `wk_Fuka_flg = true` // Set suspension inapplicability flag (利用停止不可フラグ) |
| 3 | RETURN | `0` // Early exit if unavailability detected (利用停止不可の場合、終了) |

**Block 9** — [CALL] `(mansion info lookup) (L413)`

> Query mansion-related information for the service contract.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0861B002SC(param, handle, requestParam, resultHash)` // Mansion Info Lookup (マンション情報取得) |

**Block 10** — [IF] `(error check after mansion info lookup) (L415)`

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `statusCode` // if statusCode != 0 |

**Block 11** — [CALL] `(billing contract number lookup) (L421)`

> Query the billing contract number and service contract number association.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0321B005SC(param, handle, requestParam, resultHash)` // Billing Contract No. / Service Contract No. Lookup (請求契約番号取得 / 課金先一覧照会) |

**Block 12** — [IF] `(error check after billing contract lookup) (L423)`

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `statusCode` // if statusCode != 0 |

**Block 13** — [SET] `(extract billing contract result) (L427)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0321B005HashList = (ArrayList<HashMap<String, Object>>)resultHash.get(TEMPLATE_ID_EKK0321B005)` [-> TEMPLATE_ID_EKK0321B005="EKK0321B005"] |

**Block 14** — [IF] `(billing line result is empty) (L429)`

> If no billing contract items exist, there is nothing to suspend. End processing.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `0` // 0件の場合、終了 (0 items, end) |

**Block 15** — [SET] `(get first billing line item) (L433)`

> Since service contract number is set, get the first billing line item. Extract the billing contract number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0321B005Hash = eKK0321B005HashList.get(0)` // Get first item (1件目を取得) |
| 2 | SET | `seikyu_kei_no = (String)eKK0321B005Hash.get(EKK0321B005CBSMsg1List.SEIKYU_KEI_NO)` // Billing contract number (請求契約番号) |

**Block 16** — [CALL] `(billing line agreement inquiry) (L439)`

> Query billing line items for the billing contract number and service contract number.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0321B002SC(param, handle, requestParam, resultHash, seikyu_kei_no)` // Billing Line Inquiry (課金先一覧照会) |

**Block 17** — [IF] `(error check after billing line inquiry) (L441)`

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `statusCode` // if statusCode != 0 |

**Block 18** — [SET] `(extract billing line list) (L445)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0321B002HashList = (ArrayList<HashMap<String, Object>>)resultHash.get(TEMPLATE_ID_EKK0321B002)` [-> TEMPLATE_ID_EKK0321B002="EKK0321B002"] |

**Block 19** — [IF] `(billing line result is empty) (L450)`

> If no billing lines exist, end processing.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `0` // 0件の場合、終了 (0 items, end) |

**Block 20** — [FOR] `(iterate over billing line items) (L454)`

> Loop through each billing line to process suspension for each service contract layer.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0321B002Hash = eKK0321B002HashList.get(i)` |

**Block 20.1** — [CALL] `(billing line agreement inquiry per item) (L459)`

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0321A010SC(param, handle, eKK0321B002Hash, resultHash)` // Billing Line Agreement Inquiry (課金先一致照合) |

**Block 20.2** — [IF] `(error check after billing line agreement) (L461)`

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `statusCode` // if statusCode != 0 |

**Block 20.3** — [SET] `(extract billing line agreement result) (L466)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0321A010Hash = (HashMap<String, Object>)resultHash.get(TEMPLATE_ID_EKK0321A010)` [-> TEMPLATE_ID_EKK0321A010="EKK0321A010"] |

**Block 20.4** — [IF] `(billing line agreement result is null) (L469)`

> If the billing line agreement result does not exist, skip this line and continue to the next.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `continue` // Skip if no billing line agreement result (課金先一致照合結果が存在しない場合) |

**Block 20.5** — [SET] `(extract service contract numbers from billing line) (L473-L483)`

> Extract all four service contract numbers from the billing line agreement result. These represent different layers of the service hierarchy.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svc_kei_no = (String)eKK0321A010Hash.get(EKK0321A010CBSMsg1List.SVC_KEI_NO)` // Service contract number (サービス契約番号) |
| 2 | SET | `kktk_svc_kei_no = (String)eKK0321A010Hash.get(EKK0321A010CBSMsg1List.KKTK_SVC_KEI_NO)` // Equipment-provided service contract number (機器提供サービス契約番号) |
| 3 | SET | `op_svc_kei_no = (String)eKK0321A010Hash.get(EKK0321A010CBSMsg1List.OP_SVC_KEI_NO)` // Optional service contract number (オプションサービス契約番号) |
| 4 | SET | `sbop_svc_kei_no = (String)eKK0321A010Hash.get(EKK0321A010CBSMsg1List.SBOP_SVC_KEI_NO)` // Sub-optional service contract number (サブオプションサービス契約番号) |

**Block 20.6** — [IF] `(main service contract number present) (L487)`

> If a main service contract number exists, apply service contract usage suspension. [-> svc_kei_no check at L487]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = svcKei_UseStp(handle, param, requestParam, resultHash, hakkoSODDataList, prm_svc_kei_no)` // Service Contract Usage Suspension (サービス契約 利用停止処理) |

**Block 20.6.1** — [IF] `(error check after service contract suspension) (L497)`

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `statusCode` // if statusCode != 0 |

**Block 20.7** — [IF] `(optional service contract present without sub-optional) (L505)`

> Apply optional service suspension only when an optional service exists AND no sub-optional service is present. This ensures proper ordering — sub-optional services should be suspended before optional ones.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = opSvcKei_UseStp(handle, param, requestParam, resultHash, prm_svc_kei_no)` // Optional Service Contract Usage Suspension (オプションサービス契約 利用停止処理) |

**Block 20.7.1** — [IF] `(error check after optional service suspension) (L517)`

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `statusCode` // if statusCode != 0 |

**Block 20.8** — [IF] `(sub-optional service contract present) (L524)`

> Apply sub-optional service suspension. This is independent of the optional service check — a contract can have a sub-optional layer.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = sbOpSvcKei_UseStp(handle, param, requestParam, resultHash, prm_svc_kei_no)` // Sub-Optional Service Contract Usage Suspension (サブオプションサービス契約 利用停止処理) |

**Block 20.8.1** — [IF] `(error check after sub-optional service suspension) (L534)`

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `statusCode` // if statusCode != 0 |

**Block 20.9** — [IF] `(equipment-provided service contract present) (L541)`

> Apply equipment-provided service suspension. Equipment (multi-function routers, home gateways) has its own contract layer.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = kktkSvcKei_UseStp(handle, param, requestParam, resultHash, prm_svc_kei_no, true)` // Equipment-Provided Service Contract Usage Suspension (機器提供サービス契約 利用停止処理) |

**Block 20.9.1** — [IF] `(error check after equipment-provided service suspension) (L549)`

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `statusCode` // if statusCode != 0 |

**Block 21** — [IF] `(telephone service equipment suspension) (L557)`

> If the service contract agreement result is not null AND the service code indicates a telephone service (SVC_CD_TEL = "02"), suspend ONU/VDSL equipment connected to the eo light network. This handles the special case of fiber-optic terminal equipment that needs to be deactivated alongside the telephone service. [-> SVC_CD_TEL="02" (JKKOrsjgsUseStpRunCC.java)]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = kktkSvcKei_UseStp2(handle, param, requestParam, resultHash, eKK0081A010Hash, prm_svc_kei_no)` // ONU/VDSL Equipment Suspension (eo光ネットワーク側ONU or VDSLモデム etc. を利用停止する) |

**Block 21.1** — [IF] `(error check after equipment suspension) (L563)`

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `statusCode` // if statusCode != 0 |

**Block 22** — [CALL] `(progress registration) (L568)`

> Register the progress state update for the usage suspension process.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK1091D010SC(param, handle, requestParam, resultHash, prm_svc_kei_no)` // Progress Registration (進捗登録) |

**Block 23** — [IF] `(error check after progress registration) (L570)`

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `statusCode` // if statusCode != 0 |

**Block 24** — [IF] `(service contract usage suspension was executed) (L575)`

> If the `SVC_KEI_USE_STP_EXEC_FLG` flag was set to `true` during any of the suspension handler calls, execute the service control management suspension request with the collected SOD issuance data. [-> SVC_KEI_USE_STP_EXEC_FLG="svc_kei_use_stp_exec_flg"]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = svcCtlUseStpReq(handle, param, requestParam, resultHash, hakkoSODDataList, prm_svc_kei_no)` // Service Control Management Usage Suspension Request (サービス制御管理S 利用停止要求処理) |

**Block 24.1** — [IF] `(error check after service control suspension) (L581)`

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `statusCode` // if statusCode != 0 |

> The following commented-out code (L583-L652) describes a previously removed feature for member ISP decision status code update. It queried service contract status via `callEKK0081B004SC`, and if no active contracts were found, called `executeCtcMikstCdKoshin` to update the ISP customer determination status. This has been superseded by the `svcCtlUseStpReq` call above.

**Block 25** — [CALL] `(designated registration info lookup) (L660)`

> Query designated registration info to determine if a supplier suspension instruction needs to be registered.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0081B546SC(param, handle, requestParam, resultHash, prm_svc_kei_no)` // Designated Registration Info Lookup (指示書登録情報取得) |

**Block 26** — [IF] `(error check after designated registration info lookup) (L662)`

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `statusCode` // if statusCode != 0 |

**Block 27** — [IF] `(designated registration info exists) (L666)`

> If the designated registration info list is not null and contains entries, check if an update is pending.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0081B546Hash = eKK0081B546HashList.get(0)` // Get first item (1件目のデータを取得) |
| 2 | SET | `updUm = (String)eKK0081B546Hash.get(EKK0081B546CBSMsg1List.UPD_UM)` // Update presence flag (更新有無取得) |

**Block 27.1** — [IF] `(update present — has update = "1") (L671)`

> If `updUm` equals "1" (有), call the supplier business operator suspension instruction registration method. [-> "1" means has update (有)]

| # | Type | Code |
|---|------|------|
| 1 | SET | `sysid = (String)eKK0081B546Hash.get(EKK0081B546CBSMsg1List.SYSID)` // SYSID (SYSID取得) |
| 2 | CALL | `statusCode = orsjgsrunUseStpAddShijisho11(handle, param, requestParam, sysid)` // Supplier Business Operator Suspension Instruction Registration (卸先事業者利用停止指示書登録) |

**Block 27.1.1** — [IF] `(error check after supplier instruction registration) (L676)`

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `statusCode` // if statusCode != 0 |

**Block 28** — [RETURN] `(normal completion) (L680)`

> Return success status code.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `0` // 正常 (Normal completion) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `runUseStpProc` | Method | Usage Suspension Main Processing (利用停止メイン処理) — the core method for deactivating supplier business operator service contracts |
| `orsjgsRunUseStp` | Method | Supplier Business Operator Usage Suspension Entry Point (卸先事業者利用停止) — screen-level entry method that calls `runUseStpProc` |
| `JKKOrsjgsUseStpRunCC` | Class | Supplier Business Operator Usage Suspension Run Common Component (卸先事業者サービス契約利用停止) — a CC (Common Component) class handling suspension logic |
| `prc_grp_cd` | Field | Billing Group Code (料金グループコード) — classifies the customer's billing category (Mansion Primary, MiNEO, eo Electricity, etc.) |
| `SVC_KEI_NO` | Constant | Service Contract Number key ("svc_kei_no") — the primary service contract identifier used throughout the method |
| `svc_kei_no` | Field | Service Contract Number (サービス契約番号) — the main service contract identifier within a billing line |
| `seikyu_kei_no` | Field | Billing Contract Number (請求契約番号) — the billing contract identifier used to resolve billing line items |
| `op_svc_kei_no` | Field | Optional Service Contract Number (オプションサービス契約番号) — optional add-on service contract identifier |
| `sbop_svc_kei_no` | Field | Sub-Optional Service Contract Number (サブオプションサービス契約番号) — sub-layer optional service contract identifier |
| `kktk_svc_kei_no` | Field | Equipment-Provided Service Contract Number (機器提供サービス契約番号) — contract number for equipment (routers, ONU) provided by the operator |
| `hakkoSODDataList` | Field | SOD Issuance Data List (SOD発行用) — collects pending Service Order Data for later processing by `svcCtlUseStpReq` |
| `wk_Fuka_flg` | Field | Suspension Inapplicability Flag (処理結果フラグ) — set to `true` when usage suspension cannot be performed |
| `SVC_KEI_USE_STP_EXEC_FLG` | Constant | Service Contract Usage Suspension Execution Flag key ("svc_kei_use_stp_exec_flg") — tracks whether suspension was actually executed during processing |
| `SVC_CD_TEL` | Constant | Service Code for Telephone = "02" — identifies telephone-type service contracts requiring special ONU/VDSL equipment handling |
| `PRC_GRP_CD_MANSION_OYA` | Constant | Mansion Primary Billing Group = "99" — contracted customers in mansion/condominium buildings (parent contract); excluded from supplier suspension |
| `PRC_GRP_CD_MINEO` | Constant | MiNEO Billing Group = "51" — MiNEO prepaid service customers; excluded from supplier suspension |
| `PRC_GRP_CD_EODENKI` | Constant | eo Electricity Billing Group = "17" — electricity service customers; excluded from supplier suspension |
| `TEMPLATE_ID_EKK0081A010` | Constant | Service Contract Agreement Inquiry Template ID = "EKK0081A010" — template key for service contract agreement data |
| `TEMPLATE_ID_EKK0321B005` | Constant | Billing Contract/Service Contract Lookup Template ID = "EKK0321B005" — template key for billing contract number lookup |
| `TEMPLATE_ID_EKK0321B002` | Constant | Billing Line Inquiry Template ID = "EKK0321B002" — template key for billing line agreement list |
| `TEMPLATE_ID_EKK0321A010` | Constant | Billing Line Agreement Inquiry Template ID = "EKK0321A010" — template key for individual billing line agreement data |
| `TEMPLATE_ID_EKK0081B546` | Constant | Designated Registration Info Lookup Template ID = "EKK0081B546" — template key for supplier suspension instruction registration data |
| `TEMPLATE_ID_EKK1091D010` | Constant | Progress Registration Template ID = "EKK1091D010" — template key for progress state registration |
| `TEMPLATE_ID_EKK0861B002` | Constant | Mansion Info Lookup Template ID = "EKK0861B002" — template key for mansion information |
| EKK0081A010SC | SC Code | Service Contract Agreement Inquiry SC (サービス契約照合 SC) — queries the service contract agreement table |
| EKK0081B546SC | SC Code | Designated Registration Info Lookup SC (指示書登録情報照会 SC) — queries designated registration info for supplier instructions |
| EKK0321A010SC | SC Code | Billing Line Agreement Inquiry SC (課金先一致照合 SC) — queries billing line agreement data |
| EKK0321B002SC | SC Code | Billing Line Inquiry SC (課金先一覧照会 SC) — queries billing line items for a billing contract/service contract pair |
| EKK0321B005SC | SC Code | Billing Contract Number Lookup SC (課金先一覧照会 SC) — queries billing contract numbers by service contract number |
| EKK0861B002SC | SC Code | Mansion Info Lookup SC (マンション情報照会 SC) — queries mansion information records |
| EKK1091D010SC | SC Code | Progress Registration SC (進捗登録 SC) — registers processing status updates |
| `svcKei_UseStp` | Method | Service Contract Usage Suspension (サービス契約 利用停止処理) — suspends the main service contract |
| `opSvcKei_UseStp` | Method | Optional Service Contract Usage Suspension (オプションサービス契約 利用停止処理) — suspends optional add-on services |
| `sbOpSvcKei_UseStp` | Method | Sub-Optional Service Contract Usage Suspension (サブオプションサービス契約 利用停止処理) — suspends sub-layer optional services |
| `kktkSvcKei_UseStp` | Method | Equipment-Provided Service Usage Suspension (機器提供サービス契約 利用停止処理) — suspends equipment rental contracts (routers, home gateways) |
| `kktkSvcKei_UseStp2` | Method | ONU/VDSL Equipment Suspension (機器提供サービス契約 利用停止処理2) — suspends ONU or VDSL modem equipment on the eo light network side for telephone services |
| `svcCtlUseStpReq` | Method | Service Control Management Suspension Request (サービス制御管理S 利用停止要求処理) — submits service control suspension with collected SOD data |
| `useStpFukaCheck` | Method | Usage Suspension Inapplicability Check (利用停止可能判定処理) — determines if suspension can proceed without conflicts |
| `orsjgsrunUseStpAddShijisho11` | Method | Supplier Business Operator Suspension Instruction Registration (卸先事業者利用停止指示書登録) — registers suspension instructions to external business operators |
| SOD | Acronym | Service Order Data (サービスオーダーデータ) — telecom order fulfillment data for service provisioning/cancellation |
| SC | Acronym | Service Component (サービスコンポーネント) — a layer in the architecture responsible for data retrieval operations |
| CC | Acronym | Common Component (共通コンポーネント) — a shared business logic component called by screen/batch entry points |
| ONU | Acronym | Optical Network Unit — terminal equipment for fiber-optic broadband connections |
| VDSL | Acronym | Very-high-bit-rate Digital Subscriber Line — broadband over copper phone line technology |
| KKTK | Acronym | Kiki Teikyo (機器提供) — Equipment-Provided; service contracts for rented hardware (routers, modems) |
| `updUm` | Field | Update Presence Flag (更新有無) — "1" indicates the designated registration info has pending updates requiring supplier instruction processing |
| `sysid` | Field | System ID — the unique identifier for a business operator record, used in supplier suspension instruction registration |
| `fukaUseStpTrgtLst` | Field | Usage Suspension Inapplicability Target List (利用停止不可対象リスト) — list of service contracts that cannot be suspended |
| `SEIKYU_KEI_NO` | Constant | Billing Contract Number key ("seiky_kei_no") — HashMap key for billing contract number lookup |
| `RESULT_HASH` | Field | Result Hash Map (S-IF結果格納用) — shared HashMap for accumulating results from service component calls |
