# Business Logic — JKKOrsjgsUseStpRunCC.orsjgsRunUseStp() [79 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.orsjgsRunUseStp()

This method executes the **service use stop processing** for designated service contracts within the K-Opticom eo light customer core system. Specifically, it handles use stop cancellations (利用停止) for services tied to wholesale business customers (卸事業者). Upon entry, the method determines the service type, queries the service contract status, retrieves associated billing information, and then dispatches to the appropriate use stop processing path based on the contract type — main service contract, optional service contract, sub-optional service contract, or equipment provider (機器提供) service contract.

The method implements a **delegation pattern** with conditional dispatch: it first checks if the incoming service ID corresponds to a wholesale customer scenario (SERVICE_ID_WSALE021 = "wsale021"), and if so, performs a prerequisite related-item check (`orsjgsUseStpKanrencheck`) to determine whether any dependent items would be blocked by the use stop. This check acts as a gatekeeper — if the related check returns anything other than CHECK_OK, the method short-circuits and returns early.

The core processing is delegated to `runUseStpProc`, which orchestrates a multi-step service chain: it queries the service contract agreement, filters out services that should not be stopped (Mansion Parent, MI NEEO, eo Electric pricing groups), validates that the service is not on the "use stop inapplicable" list, retrieves billing-related data, and then iterates through billing-first contract items to execute per-contract use stop handling. After all use stop processing, it submits advance registration and invokes service control use stop requests if applicable.

This is a **shared utility component** called by multiple screens (e.g., KKSV0899) as part of the wholesale customer service cancellation workflow. It does not directly manipulate database tables itself but acts as a orchestrator, delegating all data operations to Service Components (SCs).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["orsjgsRunUseStp Start"])
    INIT["statusCode = 0"]

    GET_DATE["oPE_DATE = JCCBPCommon.getOpeDate null"]
    GET_DATA["use_stp_map = param.getData fixedText"]
    INIT_LIST["fukaUseStpTrgtLst = new ArrayList"]
    INIT_FLG["wk_Fuka_flg = false"]

    CHECK_SERVICE["SERVICE_ID_WSALE021 equals use_stp_map"]
    CALL_KANREN["call this.orsjgsUseStpKanrencheck"]
    CHECK_OK["CHECK_OK equals checkRslt"]

    MAKE_PARAM["paramHash = new HashMap; paramHash.put SVC_KEI_NO"]
    RUN_PROC["statusCode = runUseStpProc handle, param, paramHash, fixedText"]
    FORMAT_STATUS["formatStatus = String.format format code, statusCode"]

    CHECK_FUKA["wk_Fuka_flg equals true"]
    SET_FUKA_RESULT["use_stp_map.put SYORI_RESULT_FUKA; put RETURN_CD_9000"]
    SET_OK_RESULT["use_stp_map.put SYORI_RESULT_OK"]
    CHECK_FORMAT["CHECK_OK equals formatStatus"]
    SET_ERR_RESULT["use_stp_map.put RETURN_CD_9000; put RETURN_MESSAGE_SYSTEM_ERROR"]
    SET_SUCCESS_RESULT["use_stp_map.put CHECK_OK; put RETURN_MESSAGE null"]
    SET_DATA["param.setData fixedText, use_stp_map"]

    CATCH_EX["catch Exception e"]
    SET_ERR_DATA["put RETURN_CD_9000; put RETURN_MESSAGE_SYSTEM_ERROR; param.setData"]
    RETURN_PARAM["return param"]
    END_NODE(["orsjgsRunUseStp End"])

    START --> INIT
    INIT --> GET_DATE
    GET_DATE --> GET_DATA
    GET_DATA --> INIT_LIST
    INIT_LIST --> INIT_FLG
    INIT_FLG --> CHECK_SERVICE
    CHECK_SERVICE -- yes --> CALL_KANREN
    CHECK_SERVICE -- no --> MAKE_PARAM
    CALL_KANREN --> CHECK_OK
    CHECK_OK -- no --> RETURN_PARAM
    CHECK_OK -- yes --> MAKE_PARAM
    MAKE_PARAM --> RUN_PROC
    RUN_PROC --> FORMAT_STATUS
    FORMAT_STATUS --> CHECK_FUKA
    CHECK_FUKA -- yes --> SET_FUKA_RESULT
    CHECK_FUKA -- no --> SET_OK_RESULT
    SET_FUKA_RESULT --> SET_DATA
    SET_OK_RESULT --> CHECK_FORMAT
    CHECK_FORMAT -- no --> SET_ERR_RESULT
    CHECK_FORMAT -- yes --> SET_SUCCESS_RESULT
    SET_DATA --> END_NODE
    CHECK_SERVICE -- Exception --> CATCH_EX
    CATCH_EX --> SET_ERR_DATA
    SET_ERR_DATA --> RETURN_PARAM
    RETURN_PARAM --> END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session handler carrying database connection context and transaction management information. It is used by called Service Components to access the correct database connection and manage SQL execution within the transaction scope. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object that carries business data and control maps. It contains the use stop map (keyed by `fixedText`), and is populated with processing results (return code, return message, processing result flag) before being returned. Acts as the primary data transfer container throughout the processing chain. |
| 3 | `fixedText` | `String` | User-defined string that serves as the map key to retrieve and store the use stop processing data from `param`. It identifies the specific data section within the parameter object where `use_stp_map` data is stored. |

### Instance Fields Read by the Method

| Field | Type | Business Description |
|-------|------|---------------------|
| `oPE_DATE` | `String` | Operating date — the current business date obtained via `JCCBPCommon.getOpeDate()`, used as a timestamp for processing audit purposes. |
| `wk_Fuka_flg` | `boolean` | Use stop inapplicable flag — set to `true` by `runUseStpProc` when the service cannot be stopped (e.g., due to dependent contracts or cancellation processing), triggering a failure result code. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JCCBPCommon.getOpeDate` | JCCBPCommon | - | Calls `getOpeDate` in `JCCBPCommon` to retrieve the current operating date. |
| - | `JKKOrsjgsUseStpRunCC.orsjgsUseStpKanrencheck` | JKKOrsjgsUseStpRunCC | - | Calls `orsjgsUseStpKanrencheck` to perform the related-item dependency check for wholesale customer use stop. |
| R | `callEKK0081A010SC` | EKK0081A010SC | KK_T_SVC_KEI (Service Contract) | Service contract agreement — queries service contract details including pricing group code, service code, and service contract status. Called multiple times for main contract and billing-first contract lookups. |
| R | `callEKK0861B002SC` | EKK0861B002SC | - | Mansion info retrieval — queries mansion (apartment building) related information. |
| R | `callEKK0321B005SC` | EKK0321B005SC | KK_T_SEIKY_KEI (Billing Contract) | Billing-first list (by service contract number) — retrieves the list of billing contracts associated with the given service contract number. |
| R | `callEKK0321B002SC` | EKK0321B002SC | KK_T_SEIKY_KEI, KK_T_SVC_KEI | Billing-first list (by billing contract number / service contract number) — retrieves detailed billing-first contract items including main service contract number, optional service contract number, sub-optional service contract number, and equipment provider service contract number. |
| R | `callEKK0321A010SC` | EKK0321A010SC | KK_T_SEIKY_KEI_AGREE (Billing First Agreement) | Billing-first agreement — queries the billing-first agreement details for each billing-first item in the loop. |
| C/R | `svcKei_UseStp` | - | KK_T_SVC_KEI, KK_T_SVC_KEI_HIN, KK_T_ODR_HAKKO_JOKEN | Main service contract use stop processing — checks contract status, generates SOD (Service Order Data) for use stop, and processes the cancellation. |
| C/R | `opSvcKei_UseStp` | - | KK_T_OP_SVC_KEI, KK_T_OP_SVC_KEI_HIN | Optional service contract use stop processing — handles use stop for optional (add-on) services. |
| C/R | `sbOpSvcKei_UseStp` | - | KK_T_SBOP_SVC_KEI | Sub-optional service contract use stop processing — handles use stop for sub-optional services. |
| C/R | `kktkSvcKei_UseStp` | - | KK_T_KKTK_SVC_KEI | Equipment provider service contract use stop processing — handles use stop for K-Opticom equipment provider contracts. |
| C/R | `kktkSvcKei_UseStp2` | - | KK_T_KKTK_SVC_KEI, KK_T_EQUIP (Equipment) | Equipment provider service contract use stop (type 2) — specifically for ONU/VDSL models linked to telephone services, performs secondary equipment use stop. |
| C | `callEKK1091D010SC` | EKK1091D010SC | KK_T_SHINHAN_TOROKU (Advance Registration) | Advance registration submission — registers the use stop advance processing in the system. |
| R | `svcCtlUseStpReq` | - | SVC_CTL_USE_STP (Service Control) | Service control use stop request — sends the use stop request to the service control management system. |
| R | `callEKK0081B546SC` | EKK0081B546SC | - | Pointer registration data retrieval — retrieves pointer registration information for wholesale customer use stop. |
| C | `orsjgsrunUseStpAddShijisho11` | - | - | Wholesale customer use stop pointer registration — adds/shijisho (指先登録) pointer registration for wholesale customer use stop. |

**Note:** The pre-computed evidence table provided in the specification (JBSbat* and other entities) does not correspond to the actual method calls in `orsjgsRunUseStp`. The table above reflects the actual methods called within this method as extracted from the source code.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0899 | `KKSV0899OPOperation.run` -> `CCRequestBroker.invoke` -> `JKKOrsjgsUseStpRunCC.orsjgsRunUseStp` | `callEKK0081A010SC [R] KK_T_SVC_KEI`, `callEKK1091D010SC [C] KK_T_SHINHAN_TOROKU`, `svcCtlUseStpReq [R] SVC_CTL_USE_STP` |
| 2 | - | - | - |

**Explanation:** The method is called from KKSV0899OPOperation, which is the BPM operation class for screen KKSV0899. KKSV0899 handles the "wholesale customer service use stop" screen. The call chain uses the standard `CCRequestBroker` pattern to invoke the `orsjgsRunUseStp` method with a service ID of "wsale021" (SERVICE_ID_WSALE021).

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Initialize (L271)

> Sets up the initial state for use stop processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `statusCode = 0` // Initialize return status code to success [-> "0"] |
| 2 | EXEC | `oPE_DATE = JCCBPCommon.getOpeDate(null)` // Retrieve the operating date for audit purposes |
| 3 | EXEC | `use_stp_map = (HashMap<String, Object>)param.getData(fixedText)` // Retrieve the use stop data map from param keyed by fixedText |
| 4 | SET | `fukaUseStpTrgtLst = new ArrayList<HashMap<String, Object>>()` // Initialize the use stop inapplicable target list |
| 5 | SET | `wk_Fuka_flg = false` // Reset the use stop inapplicable flag [-> false] |

**Block 2** — [IF/ELSE] Wholesale customer service check (L275-L285)

> Checks if the service ID matches the wholesale customer service (卸事業者). If so, performs a prerequisite related-item check before proceeding. This is a gatekeeper check to prevent use stop when dependent items exist.

| # | Type | Code |
|---|------|------|
| 1 | IF | `use_stp_map.containsKey(JKKStrConst.SERVICE_ID) && JKKStrConst.SERVICE_ID_WSALE021.equals(use_stp_map.get(JKKStrConst.SERVICE_ID))` [-> SERVICE_ID_WSALE021 = "wsale021" (JKKStrConst.java:5560)] |
| 2 | EXEC | `checkRslt = this.orsjgsUseStpKanrencheck(handle, param, fixedText)` // Call the related-item check for wholesale customer use stop |
| 3 | IF | `!JKKStrConst.CHECK_OK.equals(checkRslt)` [-> CHECK_OK constant] |
| 4 | RETURN | `return param` // Early return if related check failed — use stop cannot proceed |
| 5 | ELSE | `// Proceed to main processing` |

**Block 3** — [SET] Build paramHash and execute core use stop (L288-L301)

> Constructs a HashMap to pass the service contract number to the core processing method `runUseStpProc`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramHash = new HashMap<String, Object>()` |
| 2 | SET | `paramHash.put(SVC_KEI_NO, use_stp_map.get(JKKStrConst.SVC_KEI_NO))` // Put the service contract number [-> SVC_KEI_NO = "svc_kei_no"] |
| 3 | CALL | `statusCode = runUseStpProc(handle, param, paramHash, fixedText, fukaUseStpTrgtLst)` // Delegate to core use stop processing chain |

**Block 4** — [SET] Format return code (L303-L304)

> Formats the statusCode as a zero-padded 4-digit string for comparison.

| # | Type | Code |
|---|------|------|
| 1 | SET | `formatStatus = String.format("%1$04d", statusCode)` // Format statusCode as 4-digit zero-padded string |

**Block 5** — [IF/ELSE-IF/ELSE] Set processing result (L307-L328)

> Determines the final processing result based on whether the use stop was inapplicable (wk_Fuka_flg) and whether the status code was successful.

| # | Type | Code |
|---|------|------|
| 1 | IF | `wk_Fuka_flg == true` // Use stop was determined to be inapplicable [-> wk_Fuka_flg = false initially] |
| 2 | SET | `use_stp_map.put(JKKStrConst.SYORI_RESULT, JKKStrConst.SYORI_RESULT_FUKA)` // Set result to "inapplicable" |
| 3 | SET | `use_stp_map.put(JKKStrConst.RETURN_CODE, JKKStrConst.RETURN_CD_9000)` // Set return code to 9000 (system error) |
| 4 | SET | `use_stp_map.put(JKKStrConst.RETURN_MESSAGE, JKKStrConst.RETURN_MESSAGE_SYSTEM_ERROR)` // Set system error message |
| 5 | ELSE-IF | `!JKKStrConst.CHECK_OK.equals(formatStatus)` // Status code is not "0000" — processing failed |
| 6 | SET | `use_stp_map.put(JKKStrConst.SYORI_RESULT, JKKStrConst.SYORI_RESULT_OK)` // Still mark as "processed" but with error code |
| 7 | SET | `use_stp_map.put(JKKStrConst.RETURN_CODE, JKKStrConst.RETURN_CD_9000)` // System error code |
| 8 | SET | `use_stp_map.put(JKKStrConst.RETURN_MESSAGE, JKKStrConst.RETURN_MESSAGE_SYSTEM_ERROR)` // System error message |
| 9 | ELSE | `// All OK — use_stp_map.put(JKKStrConst.SYORI_RESULT, JKKStrConst.SYORI_RESULT_OK)` // Mark as successful |
| 10 | SET | `use_stp_map.put(JKKStrConst.RETURN_CODE, JKKStrConst.CHECK_OK)` // OK return code |
| 11 | SET | `use_stp_map.put(JKKStrConst.RETURN_MESSAGE, null)` // Clear any error message |

**Block 6** — [EXEC] Write back and return (L329-L330)

> Writes the updated use_stp_map back to the param object and returns.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `param.setData(fixedText, use_stp_map)` // Persist updated map back to param |

**Block 7** — [TRY-CATCH] Exception handling (L331-L336)

> Catches any Exception during processing and ensures the error state is written back to param before returning.

| # | Type | Code |
|---|------|------|
| 1 | CATCH | `catch(Exception e)` — catches any exception thrown during the try block |
| 2 | SET | `use_stp_map.put(JKKStrConst.RETURN_CODE, JKKStrConst.RETURN_CD_9000)` // Set system error code |
| 3 | SET | `use_stp_map.put(JKKStrConst.RETURN_MESSAGE, JKKStrConst.RETURN_MESSAGE_SYSTEM_ERROR)` // Set system error message |
| 4 | EXEC | `param.setData(fixedText, use_stp_map)` // Write error state back |
| 5 | RETURN | `return param` |

### Sub-method: runUseStpProc (L366–L568)

**Block R1** — [SET] Initialize runUseStpProc (L369-L380)

> Sets up the processing context for the core use stop routine.

| # | Type | Code |
|---|------|------|
| 1 | SET | `statusCode = 0` |
| 2 | SET | `resultHash = new HashMap<String, Object>()` // Result hash for SC response data |
| 3 | SET | `requestParam.put(SVC_KEI_USE_STP_EXEC_FLG, false)` // Initialize service contract use stop execution flag [-> SVC_KEI_USE_STP_EXEC_FLG = "svc_kei_use_stp_exec_flg"] |
| 4 | SET | `hakkoSODDataList = new ArrayList<HashMap<String, Object>>()` // SOD issuance list |
| 5 | SET | `prm_svc_kei_no = requestParam.get(SVC_KEI_NO)` // Extract service contract number for use stop target [-> SVC_KEI_NO = "svc_kei_no"] |

**Block R2** — [CALL] Service contract agreement query (L382-L386)

> Queries the service contract agreement to obtain the pricing group code, service code, and contract status.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0081A010SC(param, handle, requestParam, resultHash, prm_svc_kei_no)` |
| 2 | IF | `statusCode != 0` — return error immediately |

**Block R3** — [IF/ELSE-IF/ELSE-IF] Pricing group code filtering (L392-L412)

> The method skips use stop processing for services in specific pricing groups that should not be cancelled.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0081A010Hash = resultHash.get(TEMPLATE_ID_EKK0081A010)` [-> TEMPLATE_ID_EKK0081A010 = "EKK0081A010"] |
| 2 | SET | `prc_grp_cd = eKK0081A010Hash.get(EKK0081A010CBSMsg1List.PRC_GRP_CD)` |
| 3 | IF | `PRC_GRP_CD_MANSION_OYA.equals(prc_grp_cd)` [-> PRC_GRP_CD_MANSION_OYA = "99" (Mansion/Group Contract) (JKKOrsjgsUseStpRunCC.java:223)] — skip processing |
| 4 | IF | `PRC_GRP_CD_MINEO.equals(prc_grp_cd)` [-> PRC_GRP_CD_MINEO = "51" (MI NEEO) (JKKOrsjgsUseStpRunCC.java:225)] — skip processing |
| 5 | IF | `PRC_GRP_CD_EODENKI.equals(prc_grp_cd)` [-> PRC_GRP_CD_EODENKI = "17" (eo Electric) (JKKOrsjgsUseStpRunCC.java:227)] — skip processing |

**Block R4** — [IF] Use stop inapplicable check (L414-L417)

> Checks if the service is on the "use stop inapplicable" list. If so, sets the flag and returns early.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `useStpFukaCheck(fukaUseStpTrgtLst, requestParam, resultHash)` |
| 2 | IF | result is `true` — set `wk_Fuka_flg = true` and return 0 |

**Block R5** — [CALL] Mansion info, billing-first list, billing-first detail (L420-L447)

> Queries mansion info, retrieves billing-first list by service contract number, then by billing contract number.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0861B002SC(param, handle, requestParam, resultHash)` // Mansion info |
| 2 | CALL | `statusCode = callEKK0321B005SC(param, handle, requestParam, resultHash)` // Billing-first list by SVC_KEI_NO |
| 3 | IF | `eKK0321B005HashList.size() == 0` — return 0 (no billing items, end processing) |
| 4 | SET | `eKK0321B005Hash = eKK0321B005HashList.get(0)` // Use first billing-first item |
| 5 | SET | `seikyu_kei_no = eKK0321B005Hash.get(EKK0321B005CBSMsg1List.SEIKY_KEI_NO)` // Billing contract number |
| 6 | CALL | `statusCode = callEKK0321B002SC(param, handle, requestParam, resultHash, seikyu_kei_no)` // Billing-first list by billing contract number |

**Block R6** — [FOR] Iterate through billing-first items (L457-L560)

> Loops through each billing-first item to execute use stop processing for its associated contracts.

| # | Type | Code |
|---|------|------|
| 1 | FOR | `for (int i = 0; i < eKK0321B002HashList.size(); i++)` |
| 2 | SET | `eKK0321B002Hash = eKK0321B002HashList.get(i)` |
| 3 | CALL | `statusCode = callEKK0321A010SC(param, handle, eKK0321B002Hash, resultHash)` // Billing-first agreement |
| 4 | IF | `eKK0321A010Hash == null` — continue (skip this iteration) |
| 5 | SET | `svc_kei_no = eKK0321A010Hash.get(EKK0321A010CBSMsg1List.SVC_KEI_NO)` // Main service contract number |
| 6 | SET | `kktk_svc_kei_no = eKK0321A010Hash.get(EKK0321A010CBSMsg1List.KKTK_SVC_KEI_NO)` // Equipment provider service contract number |
| 7 | SET | `op_svc_kei_no = eKK0321A010Hash.get(EKK0321A010CBSMsg1List.OP_SVC_KEI_NO)` // Optional service contract number |
| 8 | SET | `sbop_svc_kei_no = eKK0321A010Hash.get(EKK0321A010CBSMsg1List.SBOP_SVC_KEI_NO)` // Sub-optional service contract number |

**Block R6.1** — [IF] Main service contract use stop (L466-L477)

> Executes use stop for the main service contract if a service contract number is set.

| # | Type | Code |
|---|------|------|
| 1 | IF | `svc_kei_no != null && !"".equals(svc_kei_no)` |
| 2 | CALL | `statusCode = svcKei_UseStp(handle, param, requestParam, resultHash, hakkoSODDataList, prm_svc_kei_no)` |
| 3 | IF | `statusCode != 0` — return immediately |

**Block R6.2** — [IF] Optional service contract use stop (L483-L497)

> Executes use stop for the optional service contract if present and not a sub-optional contract.

| # | Type | Code |
|---|------|------|
| 1 | 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 | IF | `statusCode != 0` — return immediately |

**Block R6.3** — [IF] Sub-optional service contract use stop (L503-L517)

> Executes use stop for the sub-optional service contract if present.

| # | Type | Code |
|---|------|------|
| 1 | 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 | IF | `statusCode != 0` — return immediately |

**Block R6.4** — [IF] Equipment provider service contract use stop (L523-L533)

> Executes use stop for the equipment provider service contract if present.

| # | Type | Code |
|---|------|------|
| 1 | 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 | IF | `statusCode != 0` — return immediately |

**Block R7** — [IF] Telephone service ONU/VDSL use stop (L543-L551)

> For telephone services, additionally stops ONU/VDSL models linked to the e-o光 network side.

| # | Type | Code |
|---|------|------|
| 1 | IF | `eKK0081A010Hash != null && SVC_CD_TEL.equals(eKK0081A010Hash.get(EKK0081A010CBSMsg1List.SVC_CD))` [-> SVC_CD_TEL = "02" (Telephone) (JKKOrsjgsUseStpRunCC.java:229)] |
| 2 | CALL | `statusCode = kktkSvcKei_UseStp2(handle, param, requestParam, resultHash, eKK0081A010Hash, prm_svc_kei_no)` // Secondary equipment use stop |
| 3 | IF | `statusCode != 0` — return immediately |

**Block R8** — [CALL] Advance registration (L555-L559)

> Submits advance registration for the use stop.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK1091D010SC(param, handle, requestParam, resultHash, prm_svc_kei_no)` |
| 2 | IF | `statusCode != 0` — return immediately |

**Block R9** — [IF] Service control use stop request (L563-L573)

> If the service contract use stop execution flag was set during processing, requests the service control system to perform the use stop.

| # | Type | Code |
|---|------|------|
| 1 | IF | `requestParam.get(SVC_KEI_USE_STP_EXEC_FLG) == true` [-> 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 | IF | `statusCode != 0` — return immediately |

**Block R10** — [CALL] Pointer registration data retrieval (L593-L598)

> Retrieves pointer registration data to check if update is needed.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0081B546SC(param, handle, requestParam, resultHash, prm_svc_kei_no)` |
| 2 | IF | `statusCode != 0` — return immediately |

**Block R11** — [IF] Pointer registration update check (L600-L616)

> If the pointer registration has update flag "1" (有), calls the wholesale customer use stop pointer registration process.

| # | Type | Code |
|---|------|------|
| 1 | IF | `eKK0081B546HashList != null && size > 0` |
| 2 | SET | `eKK0081B546Hash = eKK0081B546HashList.get(0)` |
| 3 | SET | `updUm = eKK0081B546Hash.get(EKK0081B546CBSMsg1List.UPD_UM)` // Update flag |
| 4 | IF | `"1".equals(updUm)` [-> "1" = Update exists] |
| 5 | SET | `sysid = eKK0081B546Hash.get(EKK0081B546CBSMsg1List.SYSID)` |
| 6 | CALL | `statusCode = orsjgsrunUseStpAddShijisho11(handle, param, requestParam, sysid)` |
| 7 | IF | `statusCode != 0` — return immediately |

**Block R12** — [RETURN] Normal completion (L619)

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

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `orsjgsRunUseStp` | Method | Wholesale customer service use stop execution — the main entry point method for cancelling service use for wholesale business customers |
| `svc_kei_no` | Field | Service contract number — the unique identifier for a customer's service contract line |
| `seiky_kei_no` | Field | Billing contract number — the unique identifier for a billing contract associated with one or more service contracts |
| `prc_grp_cd` | Field | Pricing group code — classifies the customer's pricing tier (e.g., "99" = Mansion/Group, "51" = MI NEEO, "17" = eo Electric) |
| `svc_kei_stat` | Field | Service contract status — indicates the lifecycle state of a service contract (e.g., "100" = Service In Progress, "210" = Suspended/Terminated, "220" = Stopped, "910" = Cancelled) |
| `svc_kei_use_stp_exec_flg` | Field | Service contract use stop execution flag — indicates whether the service contract use stop was actually performed during processing |
| `fukaUseStpTrgtLst` | Field | Use stop inapplicable target list — a list of services that cannot be stopped (e.g., due to dependent contracts) |
| `wk_Fuka_flg` | Field | Use stop inapplicable flag — when true, indicates the use stop could not be completed |
| `fuka_reson` | Field | Use stop inapplicable reason — code explaining why the service cannot be stopped (e.g., "01" = Request Cancellation, "02" = Contract Processing In Progress, "03" = eo Light TV (KCN)) |
| SERVICE_ID_WSALE021 | Constant | "wsale021" — Wholesale customer service ID identifier |
| PRC_GRP_CD_MANSION_OYA | Constant | "99" — Mansion/Group (Parent) contract pricing group; these services are excluded from use stop |
| PRC_GRP_CD_MINEO | Constant | "51" — MI NEEO pricing group; these services are excluded from use stop |
| PRC_GRP_CD_EODENKI | Constant | "17" — eo Electric pricing group; these services are excluded from use stop |
| SVC_CD_TEL | Constant | "02" — Telephone service code; used to identify telephone service contracts for ONU/VDSL secondary use stop |
| SVC_KEI_STAT_TKC | Constant | "100" — Service In Progress (サービス提供中) |
| SVC_KEI_STAT_PAUSE | Constant | "210" — Suspended/Terminated Mid-Processing (休止・中断中) |
| SVC_KEI_STAT_STP | Constant | "220" — Stopped (停止中) |
| SVC_KEI_STAT_DSL | Constant | "910" — Contract Cancelled (解約済) |
| PRG_STAT_USESTP_FIN | Constant | "2201" — Use stop completed processing status |
| IDO_DIV_USESTP | Constant | "00062" — Difference division (use stop) |
| SYORI_RESULT | Constant | Processing result flag key in the result map |
| SYORI_RESULT_FUKA | Constant | "Cannot be processed" result flag |
| SYORI_RESULT_OK | Constant | "Successfully processed" result flag |
| RETURN_CD_9000 | Constant | System error return code |
| CHECK_OK | Constant | "0" — Successful execution / OK check |
| EKK0081A010SC | SC Code | Service contract agreement SC — queries and retrieves service contract details |
| EKK0321A010SC | SC Code | Billing-first agreement SC — queries billing-first agreement details |
| EKK0321B002SC | SC Code | Billing-first list (by billing contract/SVC contract) SC |
| EKK0321B005SC | SC Code | Billing-first list (by service contract number) SC |
| EKK0081B546SC | SC Code | Pointer registration data retrieval SC |
| EKK1091D010SC | SC Code | Advance registration SC — submits advance registration for the use stop |
| SOD | Acronym | Service Order Data — data structure for service order issuance, used when generating use stop service orders |
| ONU | Acronym | Optical Network Unit — endpoint device in fiber optic networks that terminates optical fiber and converts optical signals to electrical signals |
| VDSL | Acronym | Very-high-bit-rate Digital Subscriber Line — a type of DSL technology used for broadband connectivity |
| KKTK | Acronym | K-Optiken Kitaku — equipment provider/installation service (機器提供) |
| 卸事業者 (oroshigyousha) | Japanese term | Wholesale business customer — a business entity that purchases services in bulk and resells to end customers |
| 利用停止 (riyou teishi) | Japanese term | Service use stop — cancellation or suspension of an active service contract |
| 課金先 (kakin-saki) | Japanese term | Billing destination — the entity to which billing is directed; a billing-first (課金先一) item represents a billing relationship between a billing contract and a service contract |
| 機器提供 (kiki teikyou) | Japanese term | Equipment provider — a service type where equipment (e.g., ONU, set-top box) is provided to the customer |
| 指先登録 (saki touroku) | Japanese term | Pointer registration — registration of data pointers/references for downstream processing |
| MI NEEO | Business term | MI NEEO — a bundled telecom service offering (mobile + home internet) by K-Opticom |
| eo 電気 (eo Dengenki) | Business term | eo Electric — K-Opticom's electricity service offering |
| 卸事業者利用停止 (oroshigyousha riyou teishi) | Japanese term | Wholesale customer service use stop — the specific use stop process for wholesale business customer contracts |
| 関連チェック (kanren chekku) | Japanese term | Related-item check — a prerequisite validation that checks for dependent items or contracts that would prevent use stop |
