# Business Logic — JKKUseStpRunCC.runUseStpProc() [350 LOC]

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

## 1. Role

### JKKUseStpRunCC.runUseStpProc()

This method is the **main business process for service suspension (利用停止メイン処理)** in the K-Opticom eo customer core system. It orchestrates the complete lifecycle of suspending a subscriber's service contracts — including the main service contract, option services, sub-option services, invoiced option services, and equipment provision services — all triggered by a single suspension request.

The method implements a **routing/dispatch design pattern**: it queries the billing account list, then iterates through each billing agreement to dispatch suspension processing to the appropriate handler method based on which service contract numbers are present (standard service, option, sub-option, equipment provision). It handles five distinct service type categories — main service (`svcKei_UseStp`), option service (`opSvcKei_UseStp`), sub-option service (`sbOpSvcKei_UseStp`), invoiced option service (`seiOpSvcKei_UseStp`), and equipment provision service (`kktkSvcKei_UseStp` / `kktkSvcKei_UseStp2`).

The method also performs several **pre-suspension eligibility gates**: it excludes mansion owner contracts (price group `99`), MI-NEO contracts (price group `51`), and EO Electricity contracts (price group `17`) from suspension processing. It runs a "suspension impossibility" check (`useStpFukaCheck`) to short-circuit if the service cannot be suspended (e.g., due to pending contracts or protected services). For Internet services, it checks whether all contracted services are already suspended before attempting invoiced option service suspension. After all per-contract suspensions complete, it registers progress status (`callEKK1091D010SC`), triggers service control suspension requests (`svcCtlUseStpReq`), and optionally updates the member ISP settlement code (`executeCtcMikstCdKoshin`).

This method serves as the **central orchestration hub** for the entire service suspension operation, called from `JKKUseStpRunCC.runUseStp()`. It is the shared utility that coordinates multiple subsidiary suspension handlers and service component queries.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["runUseStpProc params"])

    INIT["Initialize: statusCode, resultHash, hakkoSODDataList, seiOpSvcKeiNoList"]

    SET_FLG["Set svc_kei_use_stp_exec_flg = false"]
    GET_SVC["Get prm_svc_kei_no from requestParam"]

    CALL01["callEKK0081A010SC - Service contract agreement query"]

    CHECK01{statusCode != 0}
    EARLY1(["Return statusCode"])

    GET_HASH["Get eKK0081A010Hash from resultHash"]
    GET_PRC["Get prc_grp_cd from eKK0081A010Hash"]

    CHECK_MANSION{"prc_grp_cd = PRC_GRP_CD_MANSION_OYA"}
    CHECK_MINEO{"prc_grp_cd = PRC_GRP_CD_MINEO"}
    CHECK_EODENKI{"prc_grp_cd = PRC_GRP_CD_EODENKI"}

    CALL_FUKA["useStpFukaCheck - Suspension eligibility check"]
    SET_FUKA["wk_Fuka_flg = true"]

    CALL02["callEKK0861B002SC - Mansion info query"]
    CALL03["callEKK0321B002SC - Billing account list query"]

    GET_BILLING["Get eKK0321B002HashList"]
    CHECK_SIZE{HashList size == 0}

    LOOP_BILLING["Loop: each billing account"]

    CALL04["callEKK0321A010SC - Billing agreement query"]
    CHECK_NULL{eKK0321A010Hash == null}
    SKIP["Continue to next iteration"]

    EXTRACT["Extract svc_kei_no, kktk_svc_kei_no, op_svc_kei_no, sbop_svc_kei_no, seiopsvc_kei_no"]

    DIV1{"svc_kei_no exists"}
    CALL_SVC["svcKei_UseStp - Service contract suspension"]

    DIV2{"op_svc_kei_no exists AND sbop_svc_kei_no empty"}
    CALL_OP["opSvcKei_UseStp - Option service suspension"]

    DIV3{"sbop_svc_kei_no exists"}
    CALL_SBOP["sbOpSvcKei_UseStp - Sub-option service suspension"]

    ADD_SEI["Add seiopsvc_kei_no to seiOpSvcKeiNoList"]

    DIV4{"kktk_svc_kei_no exists"}
    CALL_KKTKE["kktkSvcKei_UseStp - Equipment provision suspension"]

    END_LOOP["End loop iteration"]

    CHECK_TEL{"SVC_CD = SVC_CD_TEL phone service"}
    CALL_KKTKE2["kktkSvcKei_UseStp2 - Equipment suspension for phone"]

    GET_SVC_CD["Get svc_cd from eKK0081A010Hash"]

    DIV5{"svc_cd = SVC_CD_NET internet"}
    CALL_NET["callEKK0081B526SC - All service contracts query"]

    CHECK_ALL["isSeikySvcAllUseStp = true"]
    CHECK_STAT{svcKeiStat = TKC or PAUSE}
    SET_INCOMPLETE["isSeikySvcAllUseStp = false"]
    BREAK_INCOMPLETE["Break loop"]

    CHECK_ALL_FIN{isSeikySvcAllUseStp}
    CALL_SEI_ALL["seiOpSvcKei_UseStp - Invoiced option suspension"]
    END_LOOP_INCOMPLETE["End loop"]

    CALL_PROGRESS["callEKK1091D010SC - Progress registration"]

    CHECK_EXEC{svc_kei_use_stp_exec_flg true}
    CALL_CTRL["svcCtlUseStpReq - Service control request"]

    GET_SYSID["Get sysid from eKK0081A010Hash"]
    CALL_SYSID["callEKK0081B004SC - Contract list by SYSID"]

    GET_SYSID_LIST["Get eKK0081B004HashList"]
    CHECK_SYSID{HashList null or empty}

    LOOP_SYSID["Loop: each SYSID contract"]
    GET_STAT["Get svcKeiStat"]
    CHECK_STAT2{svcKeiStat active status}
    SET_FLG_FALSE["CtcMikstCdKoshinFlg = false"]
    BREAK_SYSID["Break loop"]

    EXEC_CTC["executeCtcMikstCdKoshin - ISP code update"]

    END_NODE(["Return 0"])

    START --> INIT --> SET_FLG --> GET_SVC --> CALL01
    CALL01 --> CHECK01
    CHECK01 -->|true| EARLY1
    CHECK01 -->|false| GET_HASH
    GET_HASH --> GET_PRC --> CHECK_MANSION
    CHECK_MANSION -->|yes| EARLY1
    CHECK_MANSION -->|no| CHECK_MINEO
    CHECK_MINEO -->|yes| EARLY1
    CHECK_MINEO -->|no| CHECK_EODENKI
    CHECK_EODENKI -->|yes| EARLY1
    CHECK_EODENKI -->|no| CALL_FUKA
    CALL_FUKA --> CHECK_FUKA_DECIDED{useStpFukaCheck returns true}
    CHECK_FUKA_DECIDED -->|yes| SET_FUKA --> EARLY1
    CHECK_FUKA_DECIDED -->|no| CALL02 --> CALL03 --> GET_BILLING
    GET_BILLING --> CHECK_SIZE
    CHECK_SIZE -->|yes| END_NODE
    CHECK_SIZE -->|no| LOOP_BILLING

    LOOP_BILLING --> CALL04
    CALL04 --> CHECK_NULL
    CHECK_NULL -->|yes| SKIP --> END_LOOP --> LOOP_BILLING
    CHECK_NULL -->|no| EXTRACT
    EXTRACT --> DIV1
    DIV1 -->|yes| CALL_SVC --> DIV2
    DIV1 -->|no| DIV2
    CALL_SVC --> DIV2
    DIV2 -->|yes| CALL_OP --> DIV3
    DIV2 -->|no| DIV3
    DIV3 -->|yes| CALL_SBOP --> ADD_SEI
    DIV3 -->|no| ADD_SEI
    ADD_SEI --> DIV4
    DIV4 -->|yes| CALL_KKTKE --> END_LOOP
    DIV4 -->|no| END_LOOP
    END_LOOP --> LOOP_BILLING

    LOOP_BILLING --> CHECK_TEL
    CHECK_TEL -->|yes| CALL_KKTKE2 --> GET_SVC_CD
    CHECK_TEL -->|no| GET_SVC_CD
    GET_SVC_CD --> DIV5
    DIV5 -->|yes| CALL_NET --> CHECK_ALL --> CHECK_STAT
    CHECK_STAT -->|yes| SET_INCOMPLETE --> BREAK_INCOMPLETE --> CHECK_ALL_FIN
    CHECK_STAT -->|no| END_LOOP_INCOMPLETE --> CHECK_ALL_FIN
    CHECK_ALL_FIN -->|yes| CALL_SEI_ALL --> END_LOOP_INCOMPLETE --> CALL_PROGRESS
    CHECK_ALL_FIN -->|no| CALL_PROGRESS
    DIV5 -->|no| CALL_PROGRESS

    CALL_PROGRESS --> CHECK_EXEC
    CHECK_EXEC -->|yes| CALL_CTRL --> GET_SYSID --> CALL_SYSID --> GET_SYSID_LIST --> CHECK_SYSID
    CHECK_EXEC -->|no| END_NODE
    CHECK_SYSID -->|no| EXEC_CTC --> END_NODE
    CHECK_SYSID -->|yes| LOOP_SYSID
    LOOP_SYSID --> GET_STAT --> CHECK_STAT2
    CHECK_STAT2 -->|yes| SET_FLG_FALSE --> BREAK_SYSID --> EXEC_CTC
    CHECK_STAT2 -->|no| END_LOOP_SYSID --> LOOP_SYSID
    END_LOOP_SYSID --> LOOP_SYSID

    style START fill:#d4edda
    style END_NODE fill:#d4edda
    style EARLY1 fill:#fff3cd
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session manager handle carrying database connection, transaction context, and system resources required for all service component calls and data access operations. |
| 2 | `param` | `IRequestParameterReadWrite` | Request/response parameter object used to pass data between the calling screen and the processing logic. Contains model group data, control map configuration, and results from service component calls. |
| 3 | `requestParam` | `HashMap<String, Object>` | Request parameter map carrying business context: the target service contract number (`svc_kei_no`), the execution flag (`svc_kei_use_stp_exec_flg`), and populated results from all SC queries (e.g., `EKK0081A010`, `EKK0321B002`, etc.). |
| 4 | `fixedText` | `String` | User-defined arbitrary string passed through processing — reserved for future use or custom logging/debugging identifiers. Not actively consumed in this method. |
| 5 | `fukaUseStpTrgtLst` | `ArrayList<HashMap<String, Object>>` | List of "suspension-impossible targets" — services/contracts that are protected from suspension (e.g., due to pending contracts, NHK broadcast fees, or other restrictions). Used by `useStpFukaCheck` to short-circuit the entire process if suspension is not allowed. |

### Instance fields read by this method

| Field | Type | Business Description |
|-------|------|---------------------|
| `wk_Fuka_flg` | `boolean` | Suspension impossibility flag — set to `true` if `useStpFukaCheck` determines the service cannot be suspended. |

## 4. CRUD Operations / Called Services

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

The following methods are called within `runUseStpProc()`. Each is classified by its operation type based on method naming patterns, parameter signatures, and known SC/CBS conventions.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `callEKK0081A010SC` | EKK0081A010SC | KK_T_SVC_KEI (Service Contract) | Queries service contract agreement details for the target service contract number (prm_svc_kei_no). Returns pricing group code, service code, SYSID, etc. |
| R | `callEKK0861B002SC` | EKK0861B002SC | KK_T_MANSION (Mansion) | Queries mansion information associated with the service contract. |
| R | `callEKK0321B002SC` | EKK0321B002SC | KK_T_SEIKY_KEI / KK_T_SVC_KEI (Invoiced Contract / Service Contract) | Queries the list of billing accounts (billing agreement) associated with the invoiced contract number and service contract number. |
| R | `callEKK0321A010SC` | EKK0321A010SC | KK_T_SEIKY_KEI / KK_T_SVC_KEI / KK_T_KKTK_SVC_KEI / KK_T_OP_SVC_KEI / KK_T_SBOP_SVC_KEI (Billing / Service Contracts) | Queries billing agreement details — extracts main service contract number, equipment provision contract number, option service contract number, sub-option service contract number, and invoiced option service contract number for each billing account. |
| R | `callEKK0081B526SC` | EKK0081B526SC | KK_T_SVC_KEI (Service Contract) | Queries all service contracts within the invoiced contract to check if every service contract has been suspended (for Internet service finalization). |
| R | `callEKK1091D010SC` | EKK1091D010SC | KK_T_PRG_STAT (Progress Status) | Registers progress status indicating the suspension process has started, so other users see the service as being processed. |
| R | `callEKK0081B004SC` | EKK0081B004SC | KK_T_SVC_KEI (Service Contract) | Queries the list of service contracts associated with a SYSID (second inquiry). Used to check if any active contracts exist before updating ISP settlement code. |
| U | `svcCtlUseStpReq` | - | SVCCTL Management | Service control suspension request — triggers the service control mechanism to actually suspend the service at the network/system level. |
| U | `executeCtcMikstCdKoshin` | - | Member ISP Settlement | Updates the member ISP settlement status code after suspension completes, if no active service contracts remain. |
| - | `svcKei_UseStp` | - | Various KK_T_* | Core service contract suspension handler — processes the main service contract suspension. |
| - | `opSvcKei_UseStp` | - | Various KK_T_OP_SVC_KEI | Option service contract suspension handler — suspends the option service attached to the main contract. |
| - | `sbOpSvcKei_UseStp` | - | Various KK_T_SBOP_SVC_KEI | Sub-option service contract suspension handler — suspends sub-option services. |
| - | `seiOpSvcKei_UseStp` | - | Various KK_T_SEIOPSVC_KEI | Invoiced option service contract suspension handler — suspends invoiced option services (called only when all services under the invoiced contract are suspended for Internet). |
| - | `kktkSvcKei_UseStp` | - | Various KK_T_KKTK_SVC_KEI | Equipment provision service suspension handler — suspends equipment-related service contracts (e.g., routers, modems, V-ONU). |
| - | `kktkSvcKei_UseStp2` | - | Various KK_T_KKTK_SVC_KEI | Extended equipment provision service suspension — handles equipment (ONU/V-ONU) remaining after phone service is disconnected for eo light net + phone contracts. |
| - | `useStpFukaCheck` | - | Various KK_T_* | Suspension impossibility check — determines whether the service can be suspended at all, based on protected service types, pending contracts, etc. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JKKUseStpRunCC.runUseStp()` | `runUseStp()` -> `runUseStpProc(handle, param, requestParam, fixedText, fukaUseStpTrgtLst)` | `callEKK0081B004SC [R]`, `svcCtlUseStpReq [-]`, `callEKK1091D010SC [R]`, `seiOpSvcKei_UseStp [-]`, `callEKK0081B526SC [R]`, `kktkSvcKei_UseStp2 [-]`, `kktkSvcKei_UseStp [-]`, `sbOpSvcKei_UseStp [-]`, `opSvcKei_UseStp [-]`, `svcKei_UseStp [-]`, `callEKK0321A010SC [R]`, `callEKK0321B002SC [R]`, `callEKK0861B002SC [R]`, `useStpFukaCheck [-]`, `callEKK0081A010SC [R]`, `executeCtcMikstCdKoshin [-]` |

**Notes:**
- The sole direct caller is `JKKUseStpRunCC.runUseStp()`, which acts as the public entry point wrapping this private core method.
- No screen or batch entry points were found within 8 hops. This method is an internal orchestration component called by the higher-level `runUseStp()` wrapper.
- The terminal operations from this method span service component queries (all `callEKK*` methods classified as Read) and internal handler methods (suspension dispatch, service control, and ISP code update).

## 6. Per-Branch Detail Blocks

### Block 1 — [SET] Initialization (L586)

Business description: Sets up local variables and data structures needed throughout the method execution.

| # | Type | Code |
|---|------|------|
| 1 | SET | `statusCode = 0` // Status code initialization (success default) |
| 2 | SET | `resultHash = new HashMap<String, Object>()` // S-IF result container |
| 3 | SET | `requestParam.put(SVC_KEI_USE_STP_EXEC_FLG, false)` // Set service contract suspension execution flag to false [-> SVC_KEI_USE_STP_EXEC_FLG="svc_kei_use_stp_exec_flg"] |
| 4 | SET | `hakkoSODDataList = new ArrayList<HashMap<String,Object>>()` // ArrayList for SOD issuance data (SOD = Service Order Data) |
| 5 | SET | `seiOpSvcKeiNoList = new ArrayList<String>()` // List for invoiced option service contract numbers |
| 6 | SET | `prm_svc_kei_no = (String)requestParam.get(SVC_KEI_NO)` // Extract target service contract number [-> SVC_KEI_NO="svc_kei_no"] |

### Block 2 — [CALL] Service Contract Agreement Query (L603)

Business description: Queries the service contract agreement to obtain pricing group code, service code, and SYSID. This is the first gate — if this fails, return immediately.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0081A010SC(param, handle, requestParam, resultHash, prm_svc_kei_no)` // SC Code: EKK0081A010SC |
| 2 | CHECK | `if (statusCode != 0)` // Error check |

### Block 2.1 — [ELSE] Get Agreement Hash (L613)

Business description: On success, retrieve the service contract agreement result hash.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0081A010Hash = (HashMap<String, Object>)resultHash.get(TEMPLATE_ID_EKK0081A010)` // Template: EKK0081A010 |
| 2 | SET | `prc_grp_cd = (String)eKK0081A010Hash.get(EKK0081A010CBSMsg1List.PRC_GRP_CD)` // Get pricing group code |

### Block 2.2 — [IF] Mansion Owner Exclusion (L620) [CONSTANT: PRC_GRP_CD_MANSION_OYA = "99"]

Business description: If the pricing group code is "99" (Mansion / Owner), suspension processing is skipped entirely. Mansion owner contracts follow a different billing and suspension model.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (PRC_GRP_CD_MANSION_OYA.equals(prc_grp_cd))` [-> PRC_GRP_CD_MANSION_OYA="99" (Mansion Owner)] |
| 2 | RETURN | `return 0` // No processing — exit early |

### Block 2.3 — [IF] MI-NEO Exclusion (L630) [CONSTANT: PRC_GRP_CD_MINEO = "51"]

Business description: If the pricing group code is "51" (MI-NEO, a budget smartphone carrier brand by NTT Docomo), suspension processing is skipped.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (PRC_GRP_CD_MINEO.equals(prc_grp_cd))` [-> PRC_GRP_CD_MINEO="51" (MI-NEO)] |
| 2 | RETURN | `return 0` // No processing — exit early |

### Block 2.4 — [IF] EO Electricity Exclusion (L638) [CONSTANT: PRC_GRP_CD_EODENKI = "17"]

Business description: If the pricing group code is "17" (EO Electricity), suspension processing is skipped. This was added for electricity service support (ANK-2480-00-00).

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (PRC_GRP_CD_EODENKI.equals(prc_grp_cd))` [-> PRC_GRP_CD_EODENKI="17" (EO Electricity)] |
| 2 | RETURN | `return 0` // No processing — exit early |

### Block 3 — [IF] Suspension Impossibility Check (L645)

Business description: Calls `useStpFukaCheck` to determine if the service can be suspended at all. If certain protected conditions exist (e.g., pending contracts, NHK fees, or other restrictions), suspension is aborted. The instance field `wk_Fuka_flg` is set to `true` when suspension is impossible.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (useStpFukaCheck(fukaUseStpTrgtLst, requestParam, resultHash))` |
| 2 | SET | `wk_Fuka_flg = true` // Set instance field to indicate suspension impossible |
| 3 | RETURN | `return 0` // Exit — suspension cannot proceed |

### Block 4 — [CALL] Mansion Info and Billing Account List (L653–L659)

Business description: Queries mansion information and the billing account list (list of billing agreements under the invoiced contract).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0861B002SC(param, handle, requestParam, resultHash)` // SC: EKK0861B002SC |
| 2 | CHECK | `if (statusCode != 0) { return statusCode; }` |
| 3 | CALL | `statusCode = callEKK0321B002SC(param, handle, requestParam, resultHash)` // SC: EKK0321B002SC |
| 4 | CHECK | `if (statusCode != 0) { return statusCode; }` |

### Block 5 — [IF] Empty Billing Account List (L663)

Business description: If no billing accounts exist, there is nothing to suspend. Exit early.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0321B002HashList = (ArrayList<HashMap<String, Object>>)resultHash.get(TEMPLATE_ID_EKK0321B002)` // Template: EKK0321B002 |
| 2 | CHECK | `if (eKK0321B002HashList.size() == 0)` |
| 3 | RETURN | `return 0` // No billing accounts — nothing to process |

### Block 6 — [FOR] Billing Account Loop (L670)

Business description: Iterates over each billing account to dispatch service suspension processing. For each billing agreement, it queries the billing agreement details, extracts five service contract numbers (main, equipment provision, option, sub-option, invoiced option), and dispatches to the appropriate suspension handler.

| # | Type | Code |
|---|------|------|
| 1 | SET | `for (int i = 0; i < eKK0321B002HashList.size(); i++)` |
| 2 | SET | `eKK0321B002Hash = eKK0321B002HashList.get(i)` |

#### Block 6.1 — [CALL] Billing Agreement Query (L677)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0321A010SC(param, handle, eKK0321B002Hash, resultHash)` // SC: EKK0321A010SC |
| 2 | CHECK | `if (statusCode != 0) { return statusCode; }` |
| 3 | SET | `eKK0321A010Hash = (HashMap<String, Object>)resultHash.get(TEMPLATE_ID_EKK0321A010)` // Template: EKK0321A010 |

#### Block 6.1.1 — [IF] No Billing Agreement Result (L685)

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (eKK0321A010Hash == null)` |
| 2 | EXEC | `continue` // Skip to next iteration |

#### Block 6.1.2 — [SET] Extract Service Contract Numbers (L690–L698)

| # | Type | Code |
|---|------|------|
| 1 | SET | `svc_kei_no = (String)eKK0321A010Hash.get(EKK0321A010CBSMsg1List.SVC_KEI_NO)` // Main service contract number |
| 2 | SET | `kktk_svc_kei_no = (String)eKK0321A010Hash.get(EKK0321A010CBSMsg1List.KKTK_SVC_KEI_NO)` // Equipment provision service contract number |
| 3 | SET | `op_svc_kei_no = (String)eKK0321A010Hash.get(EKK0321A010CBSMsg1List.OP_SVC_KEI_NO)` // Option service contract number |
| 4 | SET | `seiopsvc_kei_no = (String)eKK0321A010Hash.get(EKK0321A010CBSMsg1List.SEIOPSVC_KEI_NO)` // Invoiced option service contract number |
| 5 | SET | `sbop_svc_kei_no = (String)eKK0321A010Hash.get(EKK0321A010CBSMsg1List.SBOP_SVC_KEI_NO)` // Sub-option service contract number |

#### Block 6.2 — [IF] Main Service Contract Suspension (L704)

Business description: If a main service contract number exists, dispatch to `svcKei_UseStp`.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (svc_kei_no != null && !"".equals(svc_kei_no))` |
| 2 | CALL | `statusCode = svcKei_UseStp(handle, param, requestParam, resultHash, hakkoSODDataList, prm_svc_kei_no)` |
| 3 | CHECK | `if (statusCode != 0) { return statusCode; }` |

#### Block 6.3 — [IF] Option Service Suspension (L717)

Business description: If an option service contract number exists AND no sub-option service contract number is attached, dispatch to `opSvcKei_UseStp`. The condition ensures option services without sub-options are processed separately from those with sub-options (which are handled in the next block).

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if ((op_svc_kei_no != null && !"".equals(op_svc_kei_no)) && (sbop_svc_kei_no == null || "".equals(sbop_svc_kei_no)))` |
| 2 | CALL | `statusCode = opSvcKei_UseStp(handle, param, requestParam, resultHash, prm_svc_kei_no)` |
| 3 | CHECK | `if (statusCode != 0) { return statusCode; }` |

#### Block 6.4 — [IF] Sub-Option Service Suspension (L735)

Business description: If a sub-option service contract number exists, dispatch to `sbOpSvcKei_UseStp`.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (sbop_svc_kei_no != null && !"".equals(sbop_svc_kei_no))` |
| 2 | CALL | `statusCode = sbOpSvcKei_UseStp(handle, param, requestParam, resultHash, prm_svc_kei_no)` |
| 3 | CHECK | `if (statusCode != 0) { return statusCode; }` |

#### Block 6.5 — [IF] Collect Invoiced Option Service Number (L751)

Business description: Accumulate invoiced option service contract numbers for potential later processing (only if all services are suspended for Internet).

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (seiopsvc_kei_no != null && !"".equals(seiopsvc_kei_no))` |
| 2 | EXEC | `seiOpSvcKeiNoList.add(seiopsvc_kei_no)` |

#### Block 6.6 — [IF] Equipment Provision Service Suspension (L759)

Business description: If an equipment provision service contract number exists, dispatch to `kktkSvcKei_UseStp` to suspend equipment-related services (e.g., routers, modems).

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (kktk_svc_kei_no != null && !"".equals(kktk_svc_kei_no))` |
| 2 | CALL | `statusCode = kktkSvcKei_UseStp(handle, param, requestParam, resultHash, prm_svc_kei_no, true)` |
| 3 | CHECK | `if (statusCode != 0) { return statusCode; }` |

### Block 7 — [IF] Phone Service — Extended Equipment Suspension (L772)

Business description: After the billing account loop, if the service agreement is for a phone service (`SVC_CD = "02"`), call `kktkSvcKei_UseStp2` to suspend additional equipment (ONU, V-DSL modems, etc.) that would otherwise be left behind when eo light net is disconnected first, then eo phone is disconnected.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (eKK0081A010Hash != null && SVC_CD_TEL.equals(eKK0081A010Hash.get(EKK0081A010CBSMsg1List.SVC_CD)))` [-> SVC_CD_TEL="02" (Phone)] |
| 2 | CALL | `statusCode = kktkSvcKei_UseStp2(handle, param, requestParam, resultHash, eKK0081A010Hash, prm_svc_kei_no)` |
| 3 | CHECK | `if (statusCode != 0) { return statusCode; }` |

### Block 8 — [IF] Internet Service — Final Invoiced Option Suspension (L783)

Business description: If the service code is Internet (`SVC_CD = "01"`), query all service contracts within the invoiced contract to check if every single service contract has been suspended. If so, iterate through the collected invoiced option service numbers and suspend them.

#### Block 8.1 — [SET] Get Service Code (L785)

| # | Type | Code |
|---|------|------|
| 1 | SET | `svc_cd = (String)eKK0081A010Hash.get(EKK0081A010CBSMsg1List.SVC_CD)` // Service code |

#### Block 8.2 — [IF] Internet Service Branch (L788) [CONSTANT: SVC_CD_NET = "01"]

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (SVC_CD_NET.equals(svc_cd))` [-> SVC_CD_NET="01" (Internet)] |
| 2 | CALL | `callEKK0081B526SC(handle, param, requestParam, resultHash)` // SC: EKK0081B526SC |
| 3 | SET | `eKK0081B526HashList = (ArrayList<HashMap<String, Object>>)resultHash.get(TEMPLATE_ID_EKK0081B526)` // Template: EKK0081B526 |
| 4 | SET | `isSeikySvcAllUseStp = true` // Assume all services are suspended |

#### Block 8.2.1 — [FOR] Check All Service Contracts Suspended (L794)

Business description: Iterate over all service contracts in the invoiced contract. If any service is still active (`svcKeiStat = "100"` / TKC — providing service, or `svcKeiStat = "210"` / PAUSE — paused), mark as incomplete.

| # | Type | Code |
|---|------|------|
| 1 | SET | `for (int i = 0; i < eKK0081B526HashList.size(); i++)` |
| 2 | SET | `eKK0081B526Hash = eKK0081B526HashList.get(i)` |
| 3 | SET | `svcKeiStat = (String)eKK0081B526Hash.get(EKK0081B526CBSMsg1List.SVC_KEI_STAT)` |
| 4 | CHECK | `if (SVC_KEI_STAT_TKC.equals(svcKeiStat) || SVC_KEI_STAT_PAUSE.equals(svcKeiStat))` [-> SVC_KEI_STAT_TKC="100" (Providing), SVC_KEI_STAT_PAUSE="210" (Paused)] |
| 5 | SET | `isSeikySvcAllUseStp = false` // Still not complete |
| 6 | EXEC | `break` // Exit loop early |

#### Block 8.2.2 — [IF] All Suspended — Suspend Invoiced Option Services (L808)

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (isSeikySvcAllUseStp)` // All service contracts suspended |
| 2 | SET | `for (int i = 0; i < seiOpSvcKeiNoList.size(); i++)` |
| 3 | CALL | `statusCode = seiOpSvcKei_UseStp(handle, param, requestParam, resultHash, seiOpSvcKeiNoList.get(i))` |
| 4 | CHECK | `if (statusCode != 0) { return statusCode; }` |

### Block 9 — [CALL] Progress Registration (L819)

Business description: Register progress status to indicate the suspension process is underway. This ensures other screens show the service as being processed (OM-2014-0002973 fix for "progress not registered during all-house suspension").

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK1091D010SC(param, handle, requestParam, resultHash, prm_svc_kei_no)` // SC: EKK1091D010SC |
| 2 | CHECK | `if (statusCode != 0) { return statusCode; }` |

### Block 10 — [IF] Service Control Suspension Request and ISP Code Update (L830)

Business description: If the service contract suspension execution flag (`svc_kei_use_stp_exec_flg`) is set to true, perform service control suspension and optionally update the member ISP settlement code.

#### Block 10.1 — [CALL] Service Control Suspension Request (L835)

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if ((Boolean)requestParam.get(SVC_KEI_USE_STP_EXEC_FLG))` [-> SVC_KEI_USE_STP_EXEC_FLG="svc_kei_use_stp_exec_flg"] |
| 2 | CALL | `statusCode = svcCtlUseStpReq(handle, param, requestParam, resultHash, hakkoSODDataList, prm_svc_kei_no)` |
| 3 | CHECK | `if (statusCode != 0) { return statusCode; }` |

#### Block 10.2 — [SET] ISP Code Update Preparation (L841–L846)

| # | Type | Code |
|---|------|------|
| 1 | SET | `sysid = (String)eKK0081A010Hash.get(EKK0081A010CBSMsg1List.SYSID)` // SYSID of the executing service contract |
| 2 | SET | `CtcMikstCdKoshinFlg = true` // ISP settlement code update flag — default to "perform" |

#### Block 10.3 — [CALL] Contract List by SYSID (L850)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `callEKK0081B004SC(handle, param, sysid, resultHash)` // SC: EKK0081B004SC |
| 2 | SET | `eKK0081B004HashList = (ArrayList<HashMap<String, Object>>)resultHash.get(TEMPLATE_ID_EKK0081B004)` // Template: EKK0081B004 |

#### Block 10.3.1 — [IF] Check for Active Contracts (L854)

Business description: If the SYSID contract list is not empty, iterate through each contract to check if any are in an active state. If so, skip the ISP settlement code update.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (eKK0081B004HashList != null && eKK0081B004HashList.size() > 0)` |
| 2 | SET | `for (int i = 0; i < eKK0081B004HashList.size(); i++)` |
| 3 | SET | `eKK0081B004Hash = eKK0081B004HashList.get(i)` |
| 4 | SET | `svcKeiStat = (String)eKK0081B004Hash.get(EKK0081B004CBSMsg1List.SVC_KEI_STAT)` |

#### Block 10.3.1.1 — [IF] Active Status Check (L862)

Business description: Check if the service contract status is one of the active statuses. If any contract is active, do NOT update the ISP settlement code. Active statuses are: "010" (Received), "020" (Under Review), "030" (Signed), "100" (Service Providing), "210" (Paused).

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (SVC_KEI_STAT_UKE.equals(svcKeiStat) \|\| SVC_KEI_STAT_SHOSA.equals(svcKeiStat) \|\| SVC_KEI_STAT_TEIK.equals(svcKeiStat) \|\| SVC_KEI_STAT_TKC.equals(svcKeiStat) \|\| SVC_KEI_STAT_PAUSE.equals(svcKeiStat))` [-> SVC_KEI_STAT_UKE="010" (Received), SVC_KEI_STAT_SHOSA="020" (Under Review), SVC_KEI_STAT_TEIK="030" (Signed), SVC_KEI_STAT_TKC="100" (Providing), SVC_KEI_STAT_PAUSE="210" (Paused)] |
| 2 | SET | `CtcMikstCdKoshinFlg = false` // Do NOT update ISP code |
| 3 | EXEC | `break` // Exit loop — found an active contract |

#### Block 10.4 — [IF] Execute ISP Settlement Code Update (L874)

Business description: If no active contracts were found (CtcMikstCdKoshinFlg remains true), execute the member ISP settlement code update.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (CtcMikstCdKoshinFlg)` |
| 2 | CALL | `executeCtcMikstCdKoshin(param, handle, requestParam)` // Update member ISP settlement status code |

### Block 11 — [RETURN] Normal Completion (L883)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return 0` // Normal completion |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `runUseStpProc` | Method | Service suspension main processing — orchestrates the complete service suspension lifecycle |
| `runUseStp` | Method | Public wrapper entry point that calls `runUseStpProc` |
| `JKKUseStpRunCC` | Class | Service Suspension Execution Common Component — handles all suspension-related business logic |
| `SVC_KEI_NO` | Constant | Service contract number — unique identifier for a service contract |
| `prm_svc_kei_no` | Variable | Parameter service contract number — the target service contract to be suspended |
| `svc_kei_use_stp_exec_flg` | Field | Service contract suspension execution flag — indicates whether suspension processing has been executed |
| `hakkoSODDataList` | Variable | SOD issuance data list — list of Service Order Data to be issued during suspension |
| `seiOpSvcKeiNoList` | Variable | Invoiced option service contract number list — accumulates invoiced option service numbers for batch suspension |
| `fukaUseStpTrgtLst` | Parameter | Suspension-impossible target list — list of services/contracts protected from suspension |
| `wk_Fuka_flg` | Field | Suspension impossibility flag — instance field set to true when suspension cannot proceed |
| `prc_grp_cd` | Variable | Pricing group code — classifies the billing arrangement type (e.g., mansion owner, MI-NEO, standard) |
| `PRC_GRP_CD_MANSION_OYA` | Constant | Pricing group "99" — Mansion Owner type; excluded from standard suspension processing |
| `PRC_GRP_CD_MINEO` | Constant | Pricing group "51" — MI-NEO (budget smartphone brand); excluded from suspension processing |
| `PRC_GRP_CD_EODENKI` | Constant | Pricing group "17" — EO Electricity type; excluded from suspension processing |
| `SVC_CD_NET` | Constant | Service code "01" — Internet service |
| `SVC_CD_TEL` | Constant | Service code "02" — Phone service |
| `SVC_KEI_STAT_TKC` | Constant | Service status "100" — Service Providing (actively providing service) |
| `SVC_KEI_STAT_PAUSE` | Constant | Service status "210" — Paused (service temporarily stopped) |
| `SVC_KEI_STAT_UKE` | Constant | Service status "010" — Received (order accepted) |
| `SVC_KEI_STAT_SHOSA` | Constant | Service status "020" — Under Review (being processed) |
| `SVC_KEI_STAT_TEIK` | Constant | Service status "030" — Signed (contract executed) |
| `kkTK_SVC_KEI_NO` | Variable | Equipment provision service contract number — contract for hardware/equipment services (routers, modems, etc.) |
| `op_svc_kei_no` | Variable | Option service contract number — optional add-on services (e.g., security, insurance) |
| `sbop_svc_kei_no` | Variable | Sub-option service contract number — secondary optional services under an option |
| `seiopsvc_kei_no` | Variable | Invoiced option service contract number — option services billed through the main invoice |
| `kktkSvcKei_UseStp` | Method | Equipment provision service suspension handler |
| `kktkSvcKei_UseStp2` | Method | Extended equipment provision service suspension — handles remaining equipment after phone disconnection |
| `svcKei_UseStp` | Method | Main service contract suspension handler |
| `opSvcKei_UseStp` | Method | Option service contract suspension handler |
| `sbOpSvcKei_UseStp` | Method | Sub-option service contract suspension handler |
| `seiOpSvcKei_UseStp` | Method | Invoiced option service contract suspension handler |
| `svcCtlUseStpReq` | Method | Service control suspension request — triggers actual network/system-level service suspension |
| `executeCtcMikstCdKoshin` | Method | Member ISP settlement code update — updates ISP settlement status after suspension |
| `useStpFukaCheck` | Method | Suspension impossibility check — determines if suspension is allowed |
| `callEKK0081A010SC` | Method | Service component: Service contract agreement query |
| `callEKK0081B002SC` | Method | Service component: Mansion information query |
| `callEKK0081B004SC` | Method | Service component: Service contract list query by SYSID |
| `callEKK0081B526SC` | Method | Service component: All service contracts within invoiced contract query |
| `callEKK0321A010SC` | Method | Service component: Billing agreement query |
| `callEKK0321B002SC` | Method | Service component: Billing account list query |
| `callEKK0861B002SC` | Method | Service component: Mansion info query |
| `callEKK1091D010SC` | Method | Service component: Progress status registration |
| SOD | Acronym | Service Order Data — telecom order fulfillment record |
| SC | Acronym | Service Component — a reusable service layer module for specific business operations |
| SYSID | Acronym | System ID — unique identifier for a service contract in the system |
| ONU | Acronym | Optical Network Unit — fiber optic termination equipment |
| V-ONU | Acronym | Vector ONU — vectoring-capable optical network unit for DSL services |
| eo light | Business term | eoひかり (eo Light) — NTT Docomo's fiber-optic broadband service brand |
| eo 電話 | Business term | eo Phone — NTT Docomo's VoIP/landline phone service bundled with eo light |
| 利用停止 | Japanese term | Service Suspension — the process of discontinuing a subscriber's contracted services |
| 請求 | Japanese term | Invoicing / Billing — refers to the invoiced contract (請求契約) that groups multiple service contracts under one bill |
| 課金先一覧 | Japanese term | Billing Account List — list of billing agreements under an invoiced contract |
| サービス契約 | Japanese term | Service Contract — the core business entity representing a contracted service |
| オプションサービス | Japanese term | Option Service — add-on services that extend the base service (security, insurance, etc.) |
| 機器提供サービス | Japanese term | Equipment Provision Service — contracts for hardware/equipment like routers, modems |
| 進捗登録 | Japanese term | Progress Registration — recording the current processing status to inform other users |
| 会員ISP決定 | Japanese term | Member ISP Settlement — ISP provider settlement status management |
| MI-NEO | Business term | MI-NEO (マイネオ) — NTT Docomo's MVNO budget smartphone brand |
| 全戸一斉 | Japanese term | All-Household Batch — mass suspension applied to all contracts simultaneously |
| NHK | Acronym | Nippon Hoso Kyokai — Japan Broadcasting Corporation; NHK fees may prevent suspension |
