# Business Logic — JKKUseStpRlsRunCC.executeKktkSvcKei_UseStp() [155 LOC]

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

## 1. Role

### JKKUseStpRlsRunCC.executeKktkSvcKei_UseStp()

This method implements the **equipment provision service contract use stop release process** (機器提供サービス契約 利用停止解除処理), a central business component within K-Opticom's eo Customer Core System for managing subscriber equipment-related service stop and release operations. The method performs a multi-branch dispatch: it determines whether the target equipment provision service falls under a "service contract cable wiring" scenario (親契約識別コード "02") requiring multi-functional router or HGW device contract updates, or whether it follows the standard service stop release flow by querying the current equipment service contract status.

The method implements a **guard-and-dispatch design pattern**: it first loads equipment provision service data via SC call `getEKK0341A010SC`, then conditionally validates target eligibility through `isKktkSvcKeiTargetData`, extracts service attributes, and routes into one of three distinct processing paths: (1) early return for VONo/eo光 Network or eo光 Telephone service scenarios, (2) multi-functional router/HGW device contract update via `JKKKkopSvcUseKeiUpdCC.updateKkopSvcKeiTran`, or (3) standard service stop release by invoking `getEKK0341C130SC` or `getEKK0341C131SC` depending on prior service status, followed by `executeKkopSvcKei_UseStp` to process the equipment service contract use stop release.

Its **role in the larger system** is that of a shared common component (CC) called by `executeKktkSvcKei_UseStp2` and `executeUseStpRlsMain`, serving as the orchestration point for the equipment provision service side of stop release operations in batch processing jobs that handle large-scale use stop releases (e.g., full household simultaneous operations added in ANK-2480-00-00, power supply correspondence in ANK-2480-00-00, and temporary fixed-period eo Home GateWay introduction in ANK-4315-00-00).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeKktkSvcKei_UseStp"])
    START --> INIT["Set statusCode equals zero"]

    INIT --> SC1["Call getEKK0341A010SC"]
    SC1 --> CHK_SC1{statusCode != 0?}
    CHK_SC1 -->|Yes| RET_EARLY["Return statusCode"]
    CHK_SC1 -->|No| GET_EKK0341A010["Get eKK0341A010Hash from resultHash"]

    GET_EKK0341A010 --> CHK_TARGET{chkTarget equals true?}
    CHK_TARGET -->|No| EXTRACT_DATA["Extract kktk_svc_kei_stat, kktk_svc_cd, oya_kei_skbt_cd"]
    CHK_TARGET -->|Yes| IS_TARGET["Call isKktkSvcKeiTargetData"]

    IS_TARGET --> CHK_IS_TARGET{isKktkSvcKeiTargetData equals false?}
    CHK_IS_TARGET -->|Yes| RET_STATUS["Return statusCode"]
    CHK_IS_TARGET -->|No| EXTRACT_DATA

    EXTRACT_DATA --> CHK_OYA{oya_kei_skbt_cd equals 02?}
    CHK_OYA -->|No| CHK_KKTKE_STP{kktk_svc_kei_stat equals 220?}

    CHK_OYA -->|Yes| GET_EKK0081A010["Get eKK0081A010Hash from resultHash"]

    GET_EKK0081A010 --> EXTRACT_SVC["Extract svc_cd, prc_grp_cd"]

    EXTRACT_SVC --> CHK_EO_VONU{VONU AND NET_or_TEL?}
    CHK_EO_VONU -->|No| CHK_EO_TV{NOT VONU AND TV?}
    CHK_EO_VONU -->|Yes| RET_ZERO_EARLY["Return 0"]

    CHK_EO_TV -->|Yes| RET_ZERO_EARLY
    CHK_EO_TV -->|No| CHK_MFR_HGW{MFR_or_HGW?}

    CHK_MFR_HGW -->|No| CHK_KKTKE_STP
    CHK_MFR_HGW -->|Yes| EXTRACT_SVC_NET{svc_cd equals NET_or_TEL?}

    EXTRACT_SVC_NET -->|Yes| SET_WORK_KEY["Set workKkopSvcUseKeiUpdDataKey"]
    EXTRACT_SVC_NET -->|No| CHK_KKTKE_STP

    SET_WORK_KEY --> CALL_CREATE["Call createUserData"]

    CALL_CREATE --> BUILD_MAP["Build kkopKeiUpdInfo map with service data"]

    BUILD_MAP --> CALL_UPDATE["Instantiate JKKKkopSvcUseKeiUpdCC, call updateKkopSvcKeiTran"]

    CALL_UPDATE --> RET_ZERO_U["Return 0"]

    CHK_KKTKE_STP -->|No| RET_ZERO_K["Return 0"]
    CHK_KKTKE_STP -->|Yes| GET_STAT_MAP["Get svkeiStatMap from resultHash"]

    GET_STAT_MAP --> GET_LAST_STAT["Get LAST_KK0081_STAT from svkeiStatMap"]

    GET_LAST_STAT --> CHK_KYUS{useStpBfSvcKeiStat equals 210?}

    CHK_KYUS -->|Yes| GET_C131["Call getEKK0341C131SC"]

    GET_C131 --> CHK_C131{statusCode != 0?}
    CHK_C131 -->|Yes| RET_STATUS_C131["Return statusCode"]
    CHK_C131 -->|No| CALL_USESTP_RLS["Call executeKkopSvcKei_UseStp"]

    CHK_KYUS -->|No| GET_C130["Call getEKK0341C130SC"]

    GET_C130 --> CHK_C130{statusCode != 0?}
    CHK_C130 -->|Yes| RET_STATUS_C130["Return statusCode"]
    CHK_C130 -->|No| CALL_USESTP_RLS

    CALL_USESTP_RLS --> RET_ZERO_FINAL["Return 0"]
```

### Branch Summary

| Branch | Condition | Business Meaning |
|--------|-----------|-----------------|
| Guard | `getEKK0341A010SC` returns non-zero | Equipment provision service data acquisition failed — propagate error |
| Target check | `chkTarget == true` and target data check fails | Equipment is not a target for use stop release |
| VONo early return | `KKTk_SVC_CD_VONU == "C013"` AND (svc == NET `"01"` or TEL `"02"`) | VONo device on eo光 Network or eo光 Telephone: no stop release needed |
| TV early return | NOT VONo AND svc == TV `"03"` | eo光 TV service on non-VONo device: no stop release needed |
| MFR/HGW update | `MFR == "C024"` or `HGW == "C025"` AND (NET with HOME/MAISON/MANSION group OR TEL) | Multi-functional router or HGW device with qualifying service and price group: update equipment option contract |
| Standard stop release | `kktk_svc_kei_stat == "220"` (Stopped) | Equipment service is stopped — proceed with stop release |
| Pause device release | Prior stat == `"210"` (Paused) | Use prior stop release SC for paused equipment (KT1-2013-0000766) |
| Standard release | Prior stat != `"210"` | Use standard stop release SC |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session handle carrying database session context, transaction state, and connection metadata used for all SC invocations within this method |
| 2 | `param` | `IRequestParameterReadWrite` | Business data I/O object holding model groups, control maps, and operational data (e.g., the `JKKKkopSvcUseKeiUpdCC` work map populated for equipment option contract updates) |
| 3 | `requestParam` | `HashMap<String, Object>` | Request parameter map passed through to SC calls; carries request-scoped configuration data |
| 4 | `resultHash` | `HashMap<String, Object>` | Result accumulator map storing SC query results by template key (e.g., `EKK0341A010`, `eKK0081A010`, `JKKGetSvkeiStat`); results are extracted and inspected throughout the method |
| 5 | `prm_svc_kei_no` | `String` | Service contract number — the top-level service contract identifier that scopes this stop release operation; used as input for the `executeKkopSvcKei_UseStp` call at the end |
| 6 | `chkTarget` | `boolean` | Target validation flag — when `true`, triggers the `isKktkSvcKeiTargetData` check to verify that the specified service contract is a valid candidate for use stop release; when `false`, skips validation for internal batch scenarios where target eligibility has already been determined upstream |

### Instance Fields Read

| Field | Type | Business Description |
|-------|------|---------------------|
| `oPE_DATE` | `String` | Operation date — the business date used as the service stop release date (利用停止解除年月日) when populating the equipment option contract update map. Initialized to `""` and set externally via `setOPE_DATE` |
| `IDO_DIV_USESTPRLS` | `String` (`"00063"`) | Division code for use stop release (利用停止解除) — passed as the distinction-of-move field in the equipment option contract update data |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKUseStpRlsRunCC.getEKK0341A010SC` | EKK0341A010SC | KK_T_KKTK_SVC_KEI (Equipment Provision Service Contract Table) | Reads equipment provision service contract data including status, service code, and parent contract identification code |
| R | `JKKUseStpRlsRunCC.isKktkSvcKeiTargetData` | — | — | Validates whether the given service contract is a target for use stop release processing |
| R | `JKKUseStpRlsRunCC.getEKK0081A010SC` (via resultHash) | EKK0081A010SC | KK_T_SVC_KEI (Service Contract Table) | Reads service contract data (svc_cd, prc_grp_cd) for the parent service contract — loaded externally in the calling batch flow |
| C | `JKKUseStpRlsRunCC.createUserData` | — | In-memory (param work area) | Creates a work data entry in the param object for the equipment option contract update CC to populate |
| U | `JKKKkopSvcUseKeiUpdCC.updateKkopSvcKeiTran` | — | KK_T_KKOP_SVC_KEI (Equipment Option Service Contract Table) | Updates the equipment option service contract with stop release info: division code, operation date, and last update datetime |
| R | `JKKUseStpRlsRunCC.getEKK0341C131SC` | EKK0341C131SC | KK_T_KKTK_SVC_KEI (Equipment Provision Service Contract Table) | Reads/updates equipment provision service contract for pause device stop release (休止中機器提供サービス契約停止解除) — used when prior status was paused |
| R | `JKKUseStpRlsRunCC.getEKK0341C130SC` | EKK0341C130SC | KK_T_KKTK_SVC_KEI (Equipment Provision Service Contract Table) | Reads/updates equipment provision service contract for standard stop release (機器提供サービス契約停止解除) |
| - | `JKKUseStpRlsRunCC.executeKkopSvcKei_UseStp` | — | KK_T_KKOP_SVC_KEI (Equipment Option Service Contract Table) | Processes equipment service contract use stop/release — sets the equipment service contract's use stop flag. ANK-2054-00-00 |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `executeKktkSvcKei_UseStp2` | `executeKktkSvcKei_UseStp2` -> `executeKktkSvcKei_UseStp` | `getEKK0341A010SC [R] KK_T_KKTK_SVC_KEI`, `updateKkopSvcKeiTran [U] KK_T_KKOP_SVC_KEI`, `getEKK0341C130SC [R] KK_T_KKTK_SVC_KEI`, `getEKK0341C131SC [R] KK_T_KKTK_SVC_KEI`, `executeKkopSvcKei_UseStp [-] KK_T_KKOP_SVC_KEI` |
| 2 | Method: `executeUseStpRlsMain` | `executeUseStpRlsMain` -> `executeKktkSvcKei_UseStp` | `getEKK0341A010SC [R] KK_T_KKTK_SVC_KEI`, `updateKkopSvcKeiTran [U] KK_T_KKOP_SVC_KEI`, `getEKK0341C130SC [R] KK_T_KKTK_SVC_KEI`, `getEKK0341C131SC [R] KK_T_KKTK_SVC_KEI`, `executeKkopSvcKei_UseStp [-] KK_T_KKOP_SVC_KEI` |

**How to classify:**
- **C** (Create): Methods with names like insert*, create*, add*, save*, persist*, register*, execute*Add*
- **R** (Read): Methods with names like find*, get*, select*, search*, load*, fetch*, call*SC* (service calls that query data)
- **U** (Update): Methods with names like update*, set*, modify*, merge*, change*
- **D** (Delete): Methods with names like delete*, remove*, drop*, cancel*

**How to find SC Code:**
- Look at the method name itself — if it contains a pattern like `callEKK0361A010SC`, the SC Code is `EKK0361A010SC`
- Use `search_files` to find the method definition and check its containing class name for SC/CBS patterns
- SC Codes typically match: `[A-Z]{3}\d{4}[A-Z]\d{3}(SC|CBS)`

**How to find Entity/DB tables:**
- Use `read_file` to read the source of called methods (e.g., `executeOdrHakkoJokenAdd`)
- Search for table name constants: `KK_T_*`, `ZM_M_*`, or similar patterns
- Search for SQL operations or entity references in the called method
- Use `search_files` with pattern `*CBS*` or `*SC*` to find service component implementations

## 5. Dependency Trace

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods.
Terminal operations from this method: `executeKkopSvcKei_UseStp` [-], `getEKK0341C130SC` [R], `getEKK0341C131SC` [R], `updateKkopSvcKeiTran` [U], `getData` [R], `getData` [R], `getData` [R], `getData` [R], `getData` [R], `createUserData` [C], `isKktkSvcKeiTargetData` [-], `getEKK0341A010SC` [R]

Trace who calls this method and what this method ultimately calls.
Use the pre-computed evidence and caller search results from Step 2 above.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `executeKktkSvcKei_UseStp2` | `executeKktkSvcKei_UseStp2` -> `executeKktkSvcKei_UseStp` | `getEKK0341A010SC [R] KK_T_KKTK_SVC_KEI`, `updateKkopSvcKeiTran [U] KK_T_KKOP_SVC_KEI`, `getEKK0341C130SC [R] KK_T_KKTK_SVC_KEI`, `getEKK0341C131SC [R] KK_T_KKTK_SVC_KEI`, `executeKkopSvcKei_UseStp [-] KK_T_KKOP_SVC_KEI` |
| 2 | Method: `executeUseStpRlsMain` | `executeUseStpRlsMain` -> `executeKktkSvcKei_UseStp` | `getEKK0341A010SC [R] KK_T_KKTK_SVC_KEI`, `updateKkopSvcKeiTran [U] KK_T_KKOP_SVC_KEI`, `getEKK0341C130SC [R] KK_T_KKTK_SVC_KEI`, `getEKK0341C131SC [R] KK_T_KKTK_SVC_KEI`, `executeKkopSvcKei_UseStp [-] KK_T_KKOP_SVC_KEI` |

## 6. Per-Branch Detail Blocks

**Block 1** — INIT (Initialization) (L1413)

> Initialize local status code and acquire equipment provision service contract data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `statusCode = 0` // Status code initialization [-> `statusCode = 0`] |
| 2 | CALL | `getEKK0341A010SC(param, handle, requestParam, resultHash)` // Load equipment provision service contract data [-> SC Code: EKK0341A010SC] |
| 3 | SET | `statusCode = <return value of getEKK0341A010SC>` |

**Block 2** — IF (Error guard after SC call) (L1421)

> Check if the SC call succeeded. If not, propagate the error code.

| # | Type | Code |
|---|------|------|
| 1 | IF | `statusCode != 0` [Guard: early return on error] |
| 2 | RETURN | `return statusCode` |

**Block 3** — SET (Extract SC result hash) (L1426)

> Extract the equipment provision service contract data from the result hash map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0341A010Hash = (HashMap) resultHash.get(TEMPLATE_ID_EKK0341A010)` [-> `TEMPLATE_ID_EKK0341A010 = "EKK0341A010"`] |

**Block 4** — IF (chkTarget validation) (L1430)

> If chkTarget is true, validate that the service contract is a valid target for use stop release.

| # | Type | Code |
|---|------|------|
| 1 | IF | `chkTarget` [Condition: target validation flag] |
| 2 | EXEC | `isKktkSvcKeiTargetData(param, handle, requestParam, resultHash, prm_svc_kei_no, eKK0341A010Hash)` // Validate target eligibility |
| 3 | IF | `!isKktkSvcKeiTargetData(...) == true` [Condition: not a target] |
| 4 | RETURN | `return statusCode` |

**Block 5** — SET (Extract equipment service data attributes) (L1434–L1440)

> Extract key fields from the equipment provision service contract data: status, service code, and parent contract identification code.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_svc_kei_stat = eKK0341A010Hash.get(KKTK_SVC_KEI_STAT)` // Equipment provision service contract status (機器提供サービス契約状態) [-> Field: `KKTK_SVC_KEI_STAT`] |
| 2 | SET | `kktk_svc_cd = eKK0341A010Hash.get(KKTK_SVC_CD)` // Equipment provision service code (機器提供サービスコード) [-> Field: `KKTK_SVC_CD`] |
| 3 | SET | `oya_kei_skbt_cd = eKK0341A010Hash.get(OYA_KEI_SKBT_CD)` // Parent contract identification code (親契約識別コード) [-> Field: `OYA_KEI_SKBT_CD`] |

**Block 6** — IF (Parent contract is service contract cable wiring) (L1442)

> When the parent contract identification code is "02" (service contract cable wiring), the equipment is part of a wiring bundle within the parent service contract. This triggers special handling for multi-functional router or HGW devices.

> [-> `OYA_KEI_SKBT_CD_KAISEN = "02"` (service contract cable wiring: devices within parent contract line)]

| # | Type | Code |
|---|------|------|
| 1 | IF | `OYA_KEI_SKBT_CD_KAISEN.equals(oya_kei_skbt_cd)` [-> `OYA_KEI_SKBT_CD_KAISEN = "02"` (service contract cable wiring)] |

**Block 7** — SET (Get parent service contract data) (L1446–L1453)

> Extract the parent service contract hash and its svc_cd and prc_grp_cd attributes.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0081A010Hash = (HashMap) resultHash.get(TEMPLATE_ID_EKK0081A010)` [-> `TEMPLATE_ID_EKK0081A010 = "EKK0081A010"`] |
| 2 | SET | `svc_cd = eKK0081A010Hash.get(SVC_CD)` // Service code (サービスコード) |
| 3 | SET | `prc_grp_cd = eKK0081A010Hash.get(PRC_GRP_CD)` // Price group code (料金グループコード) |

**Block 8** — IF (VONo early return: VONo + NET/TEL, or non-VONo + TV) (L1456–L1467)

> For VONo (virtual ONU) devices on eo光 Network or eo光 Telephone service, or non-VONo devices on eo光 TV service, no stop release processing is needed — the method returns 0 immediately. This is an early-exit path.

> Condition 1: VONo (`KKTK_SVC_CD_VONU = "C013"`) AND (NET (`SVC_CD_NET = "01"`) OR TEL (`SVC_CD_TEL = "02"`))
> Condition 2: NOT VONo AND TV (`SVC_CD_TV = "03"`)

| # | Type | Code |
|---|------|------|
| 1 | IF | `KKTK_SVC_CD_VONU.equals(kktk_svc_cd) && (SVC_CD_NET.equals(svc_cd) || SVC_CD_TEL.equals(svc_cd))` [-> `KKTK_SVC_CD_VONU = "C013"`, `SVC_CD_NET = "01"`, `SVC_CD_TEL = "02"`] |
| 2 | OR_IF | `!KKTK_SVC_CD_VONU.equals(kktk_svc_cd) && SVC_CD_TV.equals(svc_cd)` [-> `SVC_CD_TV = "03"`] |
| 3 | RETURN | `return 0` [Early return: no stop release needed for VONo NET/TEL or TV service] |

**Block 9** — IF (MFR/HGW device with qualifying service and price group) (L1470–L1522)

> When the equipment is a multi-functional router (`MFR = "C024"`) or HGW (`HGW = "C025"`) AND the service code is NET (`"01"`) with a qualifying price group (HOME `"02"`, MAISON `"03"`, or MANSION `"04"`), OR the service code is TEL (`"02"`), the method prepares and executes an equipment option service contract update.

> This path was added in ANK-2054-00-00 and modified in ANK-4315-00-00 to include HGW alongside MFR.

> [-> `KKTK_SVC_CD_MFR = "C024"` (multi-functional router), `KKTK_SVC_CD_HGW = "C025"` (HGW), `PCRS_GRP_HOME = "02"`, `PCRS_GRP_MAISON = "03"`, `PCRS_GRP_MANSION = "04"`]

| # | Type | Code |
|---|------|------|
| 1 | IF | `(KKTK_SVC_CD_MFR.equals(kktk_svc_cd) || KKTK_SVC_CD_HGW.equals(kktk_svc_cd))` [-> `KKTK_SVC_CD_MFR = "C024"`, `KKTK_SVC_CD_HGW = "C025"`] |
| 2 | IF (nested) | `SVC_CD_NET.equals(svc_cd) && (PCRS_GRP_HOME.equals(prc_grp_cd) || PCRS_GRP_MAISON.equals(prc_grp_cd) || PCRS_GRP_MANSION.equals(prc_grp_cd))` [-> `SVC_CD_NET = "01"`, `PCRS_GRP_HOME = "02"`, `PCRS_GRP_MAISON = "03"`, `PCRS_GRP_MANSION = "04"`] |
| 3 | OR_IF (nested) | `SVC_CD_TEL.equals(svc_cd)` [-> `SVC_CD_TEL = "02"`] |
| 4 | SET | `workKkopSvcUseKeiUpdDataKey = "JKKKkopSvcUseKeiUpdCC"` // Work data key for equipment option service contract update CC |
| 5 | EXEC | `createUserData(param, workKkopSvcUseKeiUpdDataKey)` // Create work data entry in param |
| 6 | SET | `outMap = (HashMap) param.getData(workKkopSvcUseKeiUpdDataKey)` |
| 7 | SET | `trgtDataList = new ArrayList<>()` // Target data list for update |
| 8 | SET | `kkopKeiUpdInfo = new HashMap<>()` // Equipment option contract update info |
| 9 | EXEC | `kkopKeiUpdInfo.put(KEY_SVC_KEI_NO, eKK0081A010Hash.get(SVC_KEI_NO))` // Service contract number |
| 10 | EXEC | `kkopKeiUpdInfo.put(KEY_KKTK_SVC_KEI_NO, eKK0341A010Hash.get(KKTK_SVC_KEI_NO))` // Equipment provision service contract number |
| 11 | EXEC | `kkopKeiUpdInfo.put(KEY_IDO_DIV, IDO_DIV_USESTPRLS)` [-> `IDO_DIV_USESTPRLS = "00063"` (Use stop release division)] |
| 12 | EXEC | `kkopKeiUpdInfo.put(KEY_SVC_STP_RLS_YMD, oPE_DATE)` // Service stop release date (operation date) |
| 13 | EXEC | `kkopKeiUpdInfo.put(KEY_UPD_DTM_BF, eKK0341A010Hash.get(LAST_UPD_DTM))` // Last update datetime (before update) |
| 14 | EXEC | `trgtDataList.add(kkopKeiUpdInfo)` |
| 15 | EXEC | `outMap.put(KEY_TRGT_DATA_LIST, trgtDataList)` |
| 16 | SET | `kkopSvcUseKeiUpdCC = new JKKKkopSvcUseKeiUpdCC()` // Instantiate equipment option service contract update CC |
| 17 | CALL | `kkopSvcUseKeiUpdCC.updateKkopSvcKeiTran(handle, param, workKkopSvcUseKeiUpdDataKey)` // Execute equipment option service contract transaction update |
| 18 | RETURN | `return 0` [Equipment option contract updated successfully] |

**Block 10** — IF (Standard equipment service stop release) (L1527)

> When the equipment provision service contract status equals `"220"` (Stopped), execute the stop release process.

> [-> `SVC_KEI_STAT_STP = "220"` (Service contract status: Stopped)]

| # | Type | Code |
|---|------|------|
| 1 | IF | `SVC_KEI_STAT_STP.equals(kktk_svc_kei_stat)` [-> `SVC_KEI_STAT_STP = "220"` (Stopped)] |

**Block 11** — SET (Get prior service status) (L1531–L1533)

> Retrieve the previous service contract status before the stop was applied, from the result hash map. This is needed to determine which SC to call for the stop release.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svkeiStatMap = (HashMap) resultHash.get(MAP_KEY_GET_SVKEI_STAT)` [-> `MAP_KEY_GET_SVKEI_STAT = "JKKGetSvkeiStat"`] |
| 2 | SET | `useStpBfSvcKeiStat = svkeiStatMap.get(LAST_KK0081_STAT)` // Status before use stop [-> `LAST_KK0081_STAT` from `JKKGetSvkeiStatConstCC`] |

**Block 12** — IF (Pause device handling) (L1535–L1545)

> If the status before the use stop was `"210"` (Paused), use the pause-specific stop release SC (`getEKK0341C131SC`). Otherwise, use the standard stop release SC (`getEKK0341C130SC`). This branch was added in KT1-2013-0000766 to handle the case where use stop cannot be applied during pause/interruption.

> [-> `SVC_KEI_STAT_KYUS = "210"` (Service contract status: Paused)]

| # | Type | Code |
|---|------|------|
| 1 | IF | `SVC_KEI_STAT_KYUS.equals(useStpBfSvcKeiStat)` [-> `SVC_KEI_STAT_KYUS = "210"` (Paused)] |
| 2 | CALL | `getEKK0341C131SC(param, handle, requestParam, resultHash)` // Pause device equipment provision service contract stop release |
| 3 | IF | `statusCode != 0` [Guard: SC call error] |
| 4 | RETURN | `return statusCode` |
| 5 | ELSE | (else branch — non-pause device) |
| 6 | CALL | `getEKK0341C130SC(param, handle, requestParam, resultHash)` // Standard equipment provision service contract stop release |
| 7 | IF | `statusCode != 0` [Guard: SC call error] |
| 8 | RETURN | `return statusCode` |

**Block 13** — SET (Equipment service contract use stop release) (L1548)

> After the SC-level stop release, call the equipment service contract use stop/release processing to update the equipment service contract itself.

> Added in ANK-2054-00-00 (smart device terminal support).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `executeKkopSvcKei_UseStp(handle, param, requestParam, resultHash, prm_svc_kei_no, eKK0341A010Hash.get(KKTK_SVC_KEI_NO))` // Process equipment service contract use stop/release with the equipment service contract number |

**Block 14** — RETURN (Success) (L1550)

> All paths converge to return 0 on success.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return 0` [Success: use stop release completed] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `kktk_svc_kei_stat` | Field | Equipment provision service contract status — indicates current state of the equipment service (e.g., "220" = Stopped, "210" = Paused) |
| `kktk_svc_cd` | Field | Equipment provision service code — classifies the type of equipment service (e.g., "C013" = VONo, "C024" = Multi-functional router, "C025" = HGW) |
| `oya_kei_skbt_cd` | Field | Parent contract identification code — identifies whether the equipment is part of the parent service contract's wiring ("02" = 親契約回線内紐付, service contract cable wiring) |
| `svc_kei_no` | Field | Service contract number — unique identifier for the top-level service contract |
| `kktk_svc_kei_no` | Field | Equipment provision service contract number — unique identifier for the equipment-specific service contract |
| `svc_cd` | Field | Service code — classifies the service type (e.g., "01" = NET/FTTH, "02" = Telephone, "03" = TV) |
| `prc_grp_cd` | Field | Price group code — classifies the subscriber's price plan type (e.g., "02" = Home, "03" = Maison, "04" = Mansion) |
| `ido_div` | Field | Division of move/status change — codes that indicate the type of status transition (e.g., "00063" = Use stop release) |
| VONo | Business term | Virtual ONU — virtual Optical Network Unit, a logical ONU service delivered over eo光 network |
| MFR | Business term | Multi-functional router (多機能ルータ) — a router that integrates modem, router, and Wi-Fi access point functions. Code: "C024" |
| HGW | Business term | Home GateWay — Fujitsu's integrated home gateway device for eo光 services (eo固定ゲートウェイ). Code: "C025" |
| NET | Field value | eo光 Network (FTTH internet service) — Service code "01" |
| TEL | Field value | eo光 Telephone — Service code "02" |
| TV | Field value | eo光 TV — Service code "03" |
| `SVC_KEI_STAT_STP` | Constant | Service contract status: Stopped — value "220". The service is currently suspended. |
| `SVC_KEI_STAT_KYUS` | Constant | Service contract status: Paused — value "210". The service is in a temporary pause state (休止中), e.g., during summer vacation or relocation. |
| `OYA_KEI_SKBT_CD_KAISEN` | Constant | Parent contract cable wiring identification — value "02". Indicates equipment is tied within the parent service contract's wiring. |
| `IDO_DIV_USESTPRLS` | Constant | Use stop release division code — value "00063". Used to mark status changes related to use stop release operations. |
| `KKTK_SVC_CD_VONU` | Constant | Equipment provision service code for VONo — value "C013" |
| `KKTK_SVC_CD_MFR` | Constant | Equipment provision service code for multi-functional router — value "C024" |
| `KKTK_SVC_CD_HGW` | Constant | Equipment provision service code for HGW — value "C025" |
| `PCRS_GRP_HOME` | Constant | Price group code for Home — value "02". Standard residential home price plan. |
| `PCRS_GRP_MAISON` | Constant | Price group code for Maison — value "03". Mid-tier housing (maison) price plan. |
| `PCRS_GRP_MANSION` | Constant | Price group code for Mansion — value "04". Apartment/mansion price plan. |
| SC | Acronym | Service Component — the data access layer in the e.g., Fugue platform, handling database queries and updates |
| CC | Acronym | Common Component — reusable business logic components that coordinate multiple SC calls and implement domain-specific workflows |
| KK_T_KKTK_SVC_KEI | DB Table | Equipment Provision Service Contract Table — stores records for equipment-specific service contracts including status, service code, and timestamps |
| KK_T_KKOP_SVC_KEI | DB Table | Equipment Option Service Contract Table — stores records for equipment option services (device installation, relocation, repair) |
| KK_T_SVC_KEI | DB Table | Service Contract Table — stores records for top-level service contracts including service codes and price group codes |
| EKK0341A010SC | SC Code | Equipment provision service contract inquiry SC — reads equipment provision service contract data |
| EKK0341C130SC | SC Code | Equipment provision service contract stop release SC — processes standard stop release |
| EKK0341C131SC | SC Code | Equipment provision service contract pause device stop release SC — processes stop release for paused equipment |
| EKK0081A010SC | SC Code | Service contract inquiry SC — reads service contract data including svc_cd and prc_grp_cd |
| JKKKkopSvcUseKeiUpdCC | Component | Equipment Option Service Contract Update Common Component — handles equipment option service contract modifications (add, relocate, replace, cancel) |
| eo光 | Business term | K-Opticom's fiber-to-the-home broadband service brand (eo Hikari) |
| 利用停止解除 | Japanese term | Use stop release — the process of resuming a suspended service |
| 機器提供サービス | Japanese term | Equipment provision service — services related to customer-provided equipment (routers, ONUs, HGWs) |
| 親契約識別コード | Japanese term | Parent contract identification code — distinguishes whether equipment is part of the parent service contract |
| 休止中 | Japanese term | Paused — a temporary suspension state (e.g., summer vacation, relocation) distinct from full stop status |
| 料率グループ | Japanese term | Price group — categorizes subscriber pricing plans by housing type (Home, Maison, Mansion) |
| ANK-4315-00-00 | JIRA Key | eo Home GateWay introduction support — added HGW to the MFR/HGW conditional branch |
| ANK-2054-00-00 | JIRA Key | Smart device terminal support — added executeKkopSvcKei_UseStp call for equipment service contract use stop release |
| KT1-2013-0000766 | JIRA Key | Cannot apply use stop during pause/interruption — added pause-specific SC handling (getEKK0341C131SC) |

---

# Technical Context — JKKUseStpRlsRunCC.executeKktkSvcKei_UseStp() [155 LOC]

## 6. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeKktkSvcKei_UseStp"])
    START --> INIT["Set statusCode equals zero"]

    INIT --> SC1["Call getEKK0341A010SC"]
    SC1 --> CHK_SC1{statusCode != 0?}
    CHK_SC1 -->|Yes| RET_EARLY["Return statusCode"]
    CHK_SC1 -->|No| GET_EKK0341A010["Get eKK0341A010Hash from resultHash"]

    GET_EKK0341A010 --> CHK_TARGET{chkTarget equals true?}
    CHK_TARGET -->|No| EXTRACT_DATA["Extract kktk_svc_kei_stat, kktk_svc_cd, oya_kei_skbt_cd"]
    CHK_TARGET -->|Yes| IS_TARGET["Call isKktkSvcKeiTargetData"]

    IS_TARGET --> CHK_IS_TARGET{isKktkSvcKeiTargetData equals false?}
    CHK_IS_TARGET -->|Yes| RET_STATUS["Return statusCode"]
    CHK_IS_TARGET -->|No| EXTRACT_DATA

    EXTRACT_DATA --> CHK_OYA{oya_kei_skbt_cd equals 02?}
    CHK_OYA -->|No| CHK_KKTKE_STP{kktk_svc_kei_stat equals 220?}

    CHK_OYA -->|Yes| GET_EKK0081A010["Get eKK0081A010Hash from resultHash"]

    GET_EKK0081A010 --> EXTRACT_SVC["Extract svc_cd, prc_grp_cd"]

    EXTRACT_SVC --> CHK_EO_VONU{VONU AND NET_or_TEL?}
    CHK_EO_VONU -->|No| CHK_EO_TV{NOT VONU AND TV?}
    CHK_EO_VONU -->|Yes| RET_ZERO_EARLY["Return 0"]

    CHK_EO_TV -->|Yes| RET_ZERO_EARLY
    CHK_EO_TV -->|No| CHK_MFR_HGW{MFR_or_HGW?}

    CHK_MFR_HGW -->|No| CHK_KKTKE_STP
    CHK_MFR_HGW -->|Yes| EXTRACT_SVC_NET{svc_cd equals NET_or_TEL?}

    EXTRACT_SVC_NET -->|Yes| SET_WORK_KEY["Set workKkopSvcUseKeiUpdDataKey"]
    EXTRACT_SVC_NET -->|No| CHK_KKTKE_STP

    SET_WORK_KEY --> CALL_CREATE["Call createUserData"]

    CALL_CREATE --> BUILD_MAP["Build kkopKeiUpdInfo map with service data"]

    BUILD_MAP --> CALL_UPDATE["Instantiate JKKKkopSvcUseKeiUpdCC, call updateKkopSvcKeiTran"]

    CALL_UPDATE --> RET_ZERO_U["Return 0"]

    CHK_KKTKE_STP -->|No| RET_ZERO_K["Return 0"]
    CHK_KKTKE_STP -->|Yes| GET_STAT_MAP["Get svkeiStatMap from resultHash"]

    GET_STAT_MAP --> GET_LAST_STAT["Get LAST_KK0081_STAT from svkeiStatMap"]

    GET_LAST_STAT --> CHK_KYUS{useStpBfSvcKeiStat equals 210?}

    CHK_KYUS -->|Yes| GET_C131["Call getEKK0341C131SC"]

    GET_C131 --> CHK_C131{statusCode != 0?}
    CHK_C131 -->|Yes| RET_STATUS_C131["Return statusCode"]
    CHK_C131 -->|No| CALL_USESTP_RLS["Call executeKkopSvcKei_UseStp"]

    CHK_KYUS -->|No| GET_C130["Call getEKK0341C130SC"]

    GET_C130 --> CHK_C130{statusCode != 0?}
    CHK_C130 -->|Yes| RET_STATUS_C130["Return statusCode"]
    CHK_C130 -->|No| CALL_USESTP_RLS

    CALL_USESTP_RLS --> RET_ZERO_FINAL["Return 0"]
```

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `kktk_svc_kei_stat` | Field | Equipment provision service contract status — indicates current state of the equipment service (e.g., "220" = Stopped, "210" = Paused) |
| `kktk_svc_cd` | Field | Equipment provision service code — classifies the type of equipment service (e.g., "C013" = VONo, "C024" = Multi-functional router, "C025" = HGW) |
| `oya_kei_skbt_cd` | Field | Parent contract identification code — identifies whether the equipment is part of the parent service contract's wiring ("02" = 親契約回線内紐付, service contract cable wiring) |
| `svc_kei_no` | Field | Service contract number — unique identifier for the top-level service contract |
| `kktk_svc_kei_no` | Field | Equipment provision service contract number — unique identifier for the equipment-specific service contract |
| `svc_cd` | Field | Service code — classifies the service type (e.g., "01" = NET/FTTH, "02" = Telephone, "03" = TV) |
| `prc_grp_cd` | Field | Price group code — classifies the subscriber's price plan type (e.g., "02" = Home, "03" = Maison, "04" = Mansion) |
| `ido_div` | Field | Division of move/status change — codes that indicate the type of status transition (e.g., "00063" = Use stop release) |
| VONo | Business term | Virtual ONU — virtual Optical Network Unit, a logical ONU service delivered over eo光 network |
| MFR | Business term | Multi-functional router (多機能ルータ) — a router that integrates modem, router, and Wi-Fi access point functions. Code: "C024" |
| HGW | Business term | Home GateWay — Fujitsu's integrated home gateway device for eo光 services (eo固定ゲートウェイ). Code: "C025" |
| NET | Field value | eo光 Network (FTTH internet service) — Service code "01" |
| TEL | Field value | eo光 Telephone — Service code "02" |
| TV | Field value | eo光 TV — Service code "03" |
| `SVC_KEI_STAT_STP` | Constant | Service contract status: Stopped — value "220". The service is currently suspended. |
| `SVC_KEI_STAT_KYUS` | Constant | Service contract status: Paused — value "210". The service is in a temporary pause state (休止中), e.g., during summer vacation or relocation. |
| `OYA_KEI_SKBT_CD_KAISEN` | Constant | Parent contract cable wiring identification — value "02". Indicates equipment is tied within the parent service contract's wiring. |
| `IDO_DIV_USESTPRLS` | Constant | Use stop release division code — value "00063". Used to mark status changes related to use stop release operations. |
| `KKTK_SVC_CD_VONU` | Constant | Equipment provision service code for VONo — value "C013" |
| `KKTK_SVC_CD_MFR` | Constant | Equipment provision service code for multi-functional router — value "C024" |
| `KKTK_SVC_CD_HGW` | Constant | Equipment provision service code for HGW — value "C025" |
| `PCRS_GRP_HOME` | Constant | Price group code for Home — value "02". Standard residential home price plan. |
| `PCRS_GRP_MAISON` | Constant | Price group code for Maison — value "03". Mid-tier housing (maison) price plan. |
| `PCRS_GRP_MANSION` | Constant | Price group code for Mansion — value "04". Apartment/mansion price plan. |
| SC | Acronym | Service Component — the data access layer in the e.g., Fugue platform, handling database queries and updates |
| CC | Acronym | Common Component — reusable business logic components that coordinate multiple SC calls and implement domain-specific workflows |
| KK_T_KKTK_SVC_KEI | DB Table | Equipment Provision Service Contract Table — stores records for equipment-specific service contracts including status, service code, and timestamps |
| KK_T_KKOP_SVC_KEI | DB Table | Equipment Option Service Contract Table — stores records for equipment option services (device installation, relocation, repair) |
| KK_T_SVC_KEI | DB Table | Service Contract Table — stores records for top-level service contracts including service codes and price group codes |
| EKK0341A010SC | SC Code | Equipment provision service contract inquiry SC — reads equipment provision service contract data |
| EKK0341C130SC | SC Code | Equipment provision service contract stop release SC — processes standard stop release |
| EKK0341C131SC | SC Code | Equipment provision service contract pause device stop release SC — processes stop release for paused equipment |
| EKK0081A010SC | SC Code | Service contract inquiry SC — reads service contract data including svc_cd and prc_grp_cd |
| JKKKkopSvcUseKeiUpdCC | Component | Equipment Option Service Contract Update Common Component — handles equipment option service contract modifications (add, relocate, replace, cancel) |
| eo光 | Business term | K-Opticom's fiber-to-the-home broadband service brand (eo Hikari) |
| 利用停止解除 | Japanese term | Use stop release — the process of resuming a suspended service |
| 機器提供サービス | Japanese term | Equipment provision service — services related to customer-provided equipment (routers, ONUs, HGWs) |
| 親契約識別コード | Japanese term | Parent contract identification code — distinguishes whether equipment is part of the parent service contract |
| 休止中 | Japanese term | Paused — a temporary suspension state (e.g., summer vacation, relocation) distinct from full stop status |
| 料率グループ | Japanese term | Price group — categorizes subscriber pricing plans by housing type (Home, Maison, Mansion) |
| ANK-4315-00-00 | JIRA Key | eo Home GateWay introduction support — added HGW to the MFR/HGW conditional branch |
| ANK-2054-00-00 | JIRA Key | Smart device terminal support — added executeKkopSvcKei_UseStp call for equipment service contract use stop release |
| KT1-2013-0000766 | JIRA Key | Cannot apply use stop during pause/interruption — added pause-specific SC handling (getEKK0341C131SC) |
