# Business Logic — JKKUseStpRunCC.svcKei_UseStp() [236 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.svcKei_UseStp()

This method performs the **Service Contract Suspension (Use Stop) Processing** — a core batch operation in the K-Opticom customer billing system that executes usage suspension for a specified service contract. The method follows a **sequential orchestration pattern**: it first validates whether the target service contract is eligible for suspension, then retrieves the contract's current agreement data and status, performs the top-level contract suspension, iterates over all child sub-agreements (service contract details) and suspends each active sub-agreement, and finally prepares Service Order Data (SOD) for downstream fulfillment processing.

The method handles **multiple service types** by branching on the pricing group code (`prc_grp_cd`), covering FTTH broadband services (eo Hikari networks: HM/MT/MZ), mobile services (eo Mobile/MI NEO), telephone services, and television (KCN) services. For network-group contracts, it also performs optional mansion-type checks to determine whether the suspension applies under whole-building or whole-resident agreements.

This method acts as a **delegated business component (CC)** called from the batch processing entry point `runUseStpProc()`. It does not serve as a screen entry point itself but is a shared utility within the suspension batch pipeline. The method uses a **dispatch-and-delegate design**: it reads contract state from SC results, makes decisions based on service status and pricing group, then delegates sub-agreement suspension and SOD issuance to other methods within the same class. If the contract status is neither "Service Providing" (100) nor "Suspension/Discontinuation" (210), the method exits early with no-op behavior.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["svcKei_UseStp(params)"])
    SETUP["Set statusCode = 0"]
    GET_KEISA["Get eKK0321A010Hash from resultHash"]
    GET_SVC_NO["Get svc_kei_no from eKK0321A010Hash"]
    CHECK_TARGET{"isSvcKeiTargetData(prm_svc_kei_no, svc_kei_no)?"}
    CALL_KEISA["callEKK0081A010SC(param, handle, requestParam, resultHash, svc_kei_no)"]
    GET_HASH0081["Get eKK0081A010Hash from resultHash"]
    GET_PRC_GRP["Get prc_grp_cd from eKK0081A010Hash"]
    GET_SVC_STAT["Get svc_kei_stat from eKK0081A010Hash"]
    CHECK_STAT{"svc_kei_stat == 100 (TKC) OR svc_kei_stat == 210 (PAUSE)?"}
    CHECK_NETGRP{"prc_grp_cd is NET_HM OR NET_MT OR NET_MZ?"}
    GET_MANSION["Get eKK0861B002Hash from resultHash"]
    CALL_STP["callEKK0081C050SC(param, handle, requestParam, resultHash)"]
    SET_EXEC_FLG["Set SVC_KEI_USE_STP_EXEC_FLG = true"]
    SET_WORK_MAP["Set workMap: func_cd=1, shori_cd=4 (DSL_STP_PAUSE), svc_kei_no, snst_mt_ymd, ope_div=3 (STP)"]
    SET_WORK_DATA["Set param.setData(CC_WORK_USE_STP, workMap)"]
    CALL_SPTV["JKKSptvKeyInfOperateCC.execute(handle, param, CC_WORK_USE_STP)"]
    CALL_DETAIL["callEKK0161B004SC(param, handle, requestParam, resultHash, svc_kei_no)"]
    GET_DETAIL_LIST["Get eKK0161B004HashList from resultHash"]
    CHECK_LIST_EMPTY{"eKK0161B004HashList.size() > 0?"}
    LOOP_START["For each eKK0161B004Hash in list"]
    GET_UCWK_NO["Get svc_kei_ucwk_no"]
    GET_UCWK_STAT["Get svc_kei_ucwk_stat"]
    CHECK_UCWK_STAT{"svc_kei_ucwk_stat == 100 (TKC) OR 210 (PAUSE)?"}
    CALL_SUB_AGREE["callEKK0161A010SC(param, handle, svc_kei_ucwk_no, resultHash)"]
    CALL_SUB_STP["callEKK0161C040SC(param, handle, eKK0161A010Hash, resultHash)"]
    CHECK_MOB{"prc_grp_cd == MOBILE (PRC_GRP_CD_MOB_EM)?"}
    GET_EMOBILE["getEMobileSodKbn(svc_kei_stat, svc_kei_ucwk_stat)"]
    JUDGE_SOD{"judgeHakkoSod(..., svc_kei_ucwk_no, prc_grp_cd, eMobileSodKbn)?"}
    SET_SOD_DATA["Set SODData: SYSID, SVC_KEI_NO, SVC_KEI_UCWK_NO, GENE_ADD_DTM"]
    ADD_SOD_LIST["hakkoSODDataList.add(SODData)"]
    CHECK_TEIKOKU{"svc_kei_ucwk_stat == 030 (TEIK) AND prc_grp_cd is NET?"}
    SET_SOD_SIMPLE["Set SODData: SYSID, SVC_KEI_NO, SVC_KEI_UCWK_NO, GENE_ADD_DTM"]
    ADD_SOD_SIMPLE["hakkoSODDataList.add(SODData)"]
    CALL_HAKKO_UCWK["hakkoSodUcwk(param, handle, requestParam, resultHash, eKK0161B004Hash, prc_grp_cd, hakkoSODDataList)"]
    CHECK_PAUSE_NO_SUB{"svc_kei_stat != 210 (PAUSE)?"}
    SET_SOD_MAIN["Set SODData: SYSID, SVC_KEI_NO"]
    ADD_SOD_MAIN["hakkoSODDataList.add(SODData)"]
    RETURN_0["Return 0"]

    START --> SETUP --> GET_KEISA --> GET_SVC_NO --> CHECK_TARGET
    CHECK_TARGET -- true --> CALL_KEISA
    CHECK_TARGET -- false --> RETURN_0
    CALL_KEISA --> GET_HASH0081 --> GET_PRC_GRP --> GET_SVC_STAT --> CHECK_STAT
    CHECK_STAT -- true --> CHECK_NETGRP
    CHECK_STAT -- false --> RETURN_0
    CHECK_NETGRP -- true --> GET_MANSION --> CALL_STP
    CHECK_NETGRP -- false --> CALL_STP
    CALL_STP --> SET_EXEC_FLG --> SET_WORK_MAP --> SET_WORK_DATA --> CALL_SPTV --> CALL_DETAIL
    CALL_DETAIL --> GET_DETAIL_LIST --> CHECK_LIST_EMPTY
    CHECK_LIST_EMPTY -- true --> LOOP_START --> GET_UCWK_NO --> GET_UCWK_STAT --> CHECK_UCWK_STAT
    CHECK_LIST_EMPTY -- false --> CHECK_PAUSE_NO_SUB
    CHECK_UCWK_STAT -- true --> CALL_SUB_AGREE --> CALL_SUB_STP --> CHECK_MOB
    CHECK_MOB -- true --> GET_EMOBILE --> JUDGE_SOD
    CHECK_MOB -- false --> JUDGE_SOD
    JUDGE_SOD -- true --> SET_SOD_DATA --> ADD_SOD_LIST --> LOOP_START
    JUDGE_SOD -- false --> CHECK_TEIKOKU
    CHECK_TEIKOKU -- true --> SET_SOD_SIMPLE --> ADD_SOD_SIMPLE --> LOOP_START
    CHECK_TEIKOKU -- false --> CALL_HAKKO_UCWK --> LOOP_START
    CHECK_PAUSE_NO_SUB -- true --> SET_SOD_MAIN --> ADD_SOD_MAIN --> RETURN_0
    CHECK_PAUSE_NO_SUB -- false --> RETURN_0
```

**Processing Summary:**

1. **Retrieves the service contract number** from the pre-populated `resultHash` under template `EKK0321A010` (Biller's Agreement List result).
2. **Validates the target service contract** — if `prm_svc_kei_no` (the requested suspension target) does not match the contract retrieved from the biller's agreement data, the method returns early (no-op).
3. **Fetches the service contract agreement** via `callEKK0081A010SC` to obtain the pricing group code (`prc_grp_cd`) and service contract status (`svc_kei_stat`).
4. **Checks service status** — only contracts in "Service Providing" (status `100`) or "Suspension/Discontinuation" (status `210`) are eligible. Other statuses cause an early return.
5. **Network-group mansion check** — for network pricing groups (HM/MT/MZ), the method optionally retrieves mansion information and payment method codes (commented-out legacy logic removed in ANK-2801-00-00).
6. **Executes service contract suspension** via `callEKK0081C050SC`, sets the execution flag, and performs special key information operation mapping for TV new course (Sparkey) integration (ANK-4592-00-00).
7. **Retrieves sub-agreement details** via `callEKK0161B004SC`, then iterates over each sub-agreement:
   - If the sub-agreement is "Service Providing" or "Suspension/Discontinuation": performs sub-agreement agreement retrieval, suspends the sub-agreement via `callEKK0161C040SC`, and conditionally generates SOD data.
   - If the sub-agreement is "Completion" (status `030`) and the main contract is a network group: generates SOD for the new-side of a course change (OM-2016-0000008).
   - Otherwise: delegates to `hakkoSodUcwk` for other cases.
8. **If no sub-agreements exist**: if the main contract is not in "Suspension/Discontinuation" status, generates a minimal SOD record for the top-level contract.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle containing transaction context, connection pool, and operation date. Used for all database operations and SC invocations within this method. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object carrying model groups and control maps. Used to set and retrieve work map data for special key information operation (Sparkey key) during suspension processing. |
| 3 | `requestParam` | `HashMap<String, Object>` | Request parameter map that holds the suspension execution flag (`svc_kei_use_stp_exec_flg`). After suspension, `true` is stored to indicate execution completion. |
| 4 | `resultHash` | `HashMap<String, Object>` | Result data container shared across method calls. Populated with results from SC calls (EKK0321A010, EKK0081A010, EKK0161B004, etc.) under template keys. Also carries mansion data (EKK0861B002) if available. |
| 5 | `hakkoSODDataList` | `ArrayList<HashMap<String, Object>>` | Output parameter: list of SOD (Service Order Data) records to be issued. Each entry is a HashMap containing SYSID, service contract number, sub-agreement number, and creation timestamp. These are passed downstream to `hakkoSodUcwk` for actual order issuance. |
| 6 | `prm_svc_kei_no` | `String` | Target service contract number for suspension. This is the contract explicitly requested for use stop. Compared against the contract retrieved from the biller's agreement to determine if it is a valid target. |

### Instance Fields Read

| Field | Type | Business Description |
|-------|------|---------------------|
| `oPE_DATE` | `String` | Operation date — set during the batch processing entry point, used as the notification date (`snst_mt_ymd`) for special key information operation mapping. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `callEKK0321A010SC` | EKK0321A010SC | KK_T_BILLER_AGREEMENT (inferred from "Biller's Agreement" template) | Reads biller's agreement data to get the service contract number |
| R | `callEKK0081A010SC` | EKK0081A010SC | KK_T_SVC_KEI, KK_T_PRC_GRP (inferred from "Service Contract Agreement" template) | Reads service contract agreement to obtain pricing group code and service status |
| U | `callEKK0081C050SC` | EKK0081C050SC | KK_T_SVC_KEI (inferred from "Service Contract Suspension" template) | Updates service contract status to suspension |
| R | `callEKK0161B004SC` | EKK0161B004SC | KK_T_SVC_KEI_UCWK (inferred from "Service Contract Detail List" template) | Reads list of sub-agreement details for the service contract |
| R | `callEKK0161A010SC` | EKK0161A010SC | KK_T_SVC_KEI_UCWK (inferred from "Sub-Agreement Agreement" template) | Reads sub-agreement agreement data |
| U | `callEKK0161C040SC` | EKK0161C040SC | KK_T_SVC_KEI_UCWK (inferred from "Sub-Agreement Suspension" template) | Updates sub-agreement status to suspension |
| R | `JKKSptvKeyInfOperateCC.execute` | - | KK_T_SPARKEY_KEY (inferred from "Sparkey Key Info Operation" class name) | Updates Sparkey key operation mapping for TV new course integration |
| - | `JKKUseStpRunCC.isSvcKeiTargetData` | - | - | Local method: validates whether the target contract number matches the biller's agreement contract |
| - | `JKKUseStpRunCC.hakkoSodUcwk` | - | KK_T_ODR_HAKKO (inferred from "SOD Issuance" class name) | Delegates SOD (Service Order Data) issuance for sub-agreement orders |
| - | `JKKUseStpRunCC.getEMobileSodKbn` | - | - | Local method: determines E-Mobile SOD issuance classification |
| - | `JKKUseStpRunCC.judgeHakkoSod` | - | - | Local method: decides whether to issue SOD based on contract conditions |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JKKUseStpRunCC.runUseStpProc()` | `runUseStpProc()` -> `svcKei_UseStp()` | `callEKK0081C050SC [U] KK_T_SVC_KEI`, `callEKK0161C040SC [U] KK_T_SVC_KEI_UCWK`, `hakkoSodUcwk [C] KK_T_ODR_HAKKO` |

**Notes:**
- `runUseStpProc()` is the batch processing entry point that orchestrates the overall service contract suspension extraction and execution.
- The terminal operations include: reading biller agreement data, reading/updating service contracts, reading/updating sub-agreements, updating Sparkey key mappings, and creating SOD records for downstream fulfillment.

## 6. Per-Branch Detail Blocks

**Block 1** — SETUP `(statusCode = 0)` (L953)

> Initialize the status code to zero (success default).

| # | Type | Code |
|---|------|------|
| 1 | SET | `int statusCode = 0` // Status code: default success [-> SYORI_RESULT_OK="0"] |

---

**Block 2** — GET `(Retrieve biller agreement data from resultHash)` (L956–960)

> Reads the pre-populated result hash to get the biller's agreement data, which contains the canonical service contract number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0321A010Hash = (HashMap) resultHash.get("EKK0321A010")` // [-> TEMPLATE_ID_EKK0321A010="EKK0321A010"] Biller's agreement result |
| 2 | SET | `svc_kei_no = (String) eKK0321A010Hash.get(SVC_KEI_NO)` // Service contract number from biller's agreement |

---

**Block 3** — IF `(isSvcKeiTargetData check)` (L963–969) [CONSTANT: 2013/07/19 ADD]

> Validates that the target service contract number (`prm_svc_kei_no`) matches the biller's agreement contract. If it does not match, the method returns early without processing (KT1-2013-0000729).

| # | Type | Code |
|---|------|------|
| 1 | IF | `!isSvcKeiTargetData(prm_svc_kei_no, svc_kei_no)` // Is the target NOT a valid contract? |
| 2 | RETURN | `return statusCode` // No-op: target contract does not match |

---

**Block 4** — EXEC `(Service Contract Agreement)` (L974–977)

> Calls the service contract agreement SC to retrieve the current state of the contract.

| # | Type | Code |
|---|------|------|
| 1 | SET | `statusCode = callEKK0081A010SC(param, handle, requestParam, resultHash, svc_kei_no)` |
| 2 | IF | `statusCode != 0` // Error occurred in SC call |
| 3 | RETURN | `return statusCode` // Propagate error |

---

**Block 5** — GET `(Extract pricing group code and service status)` (L980–985)

> Retrieves key fields from the service contract agreement result.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0081A010Hash = (HashMap) resultHash.get("EKK0081A010")` // [-> TEMPLATE_ID_EKK0081A010="EKK0081A010"] |
| 2 | SET | `prc_grp_cd = (String) eKK0081A010Hash.get(PRC_GRP_CD)` // Pricing group code |
| 3 | SET | `svc_kei_stat = (String) eKK0081A010Hash.get(SVC_KEI_STAT)` // Service status [-> SVC_KEI_STAT_TKC="100" (Service Providing), SVC_KEI_STAT_PAUSE="210" (Suspension/Discontinuation)] |

---

**Block 6** — IF `(Service status eligibility check)` (L990–996)

> Only contracts that are actively being provided or in suspension/discontinuation are eligible for use stop processing. If the status is anything else (e.g., completed, cancelled, not-yet-started), the method exits with no-op.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!SVC_KEI_STAT_TKC.equals(svc_kei_stat) && !SVC_KEI_STAT_PAUSE.equals(svc_kei_stat)` // Status is NOT "100" (TKC) AND NOT "210" (PAUSE) |
| 2 | RETURN | `return statusCode` // No-op: contract not in an active or suspended state |

---

**Block 7** — IF `(Network-group mansion check)` (L1001–L1024) [CONSTANT: KT1-2013-0000729]

> For network pricing group contracts (eo Hikari: HM, MT, MZ), this block retrieves mansion information and checks the payment method code. The legacy payment-method-based skip logic was removed in ANK-2801-00-00 (commented out). Currently, this block only retrieves data without taking action.

| # | Type | Code |
|---|------|------|
| 1 | IF | `JKKSvcConst.PRC_GRP_CD_NET_HM.equals(prc_grp_cd) || NET_MT.equals(prc_grp_cd) || NET_MZ.equals(prc_grp_cd)` // Is network group? [values not resolvable from local search — known: HM=home, MT=metro, MZ=metro-z] |
| 2 | SET | `eKK0861B002Hash = (HashMap) resultHash.get("EKK0861B002")` // [-> TEMPLATE_ID_EKK0861B002="EKK0861B002"] Mansion info result |
| 3 | IF | `eKK0861B002Hash != null` // Mansion data exists |
| 4 | SET | `payHoshikiCd = (String) eKK0861B002Hash.get(KANYU_KEI_PAY_HOSHIKI_CD)` // Payment method code |

---

**Block 8** — EXEC `(Service Contract Suspension)` (L1031–L1035)

> Executes the top-level service contract suspension via the EKK0081C050SC service component.

| # | Type | Code |
|---|------|------|
| 1 | SET | `statusCode = callEKK0081C050SC(param, handle, requestParam, resultHash)` // [-> TEMPLATE_ID_EKK0081C050="EKK0081C050"] |
| 2 | IF | `statusCode != 0` // Error in SC call |
| 3 | RETURN | `return statusCode` // Propagate error |

---

**Block 9** — SET `(Set suspension execution flag)` (L1038)

> Sets a flag in the request parameter to indicate that the suspension has been executed.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `requestParam.put(SVC_KEI_USE_STP_EXEC_FLG, true)` // [-> SVC_KEI_USE_STP_EXEC_FLG="svc_kei_use_stp_exec_flg"] |

---

**Block 10** — EXEC `(Sparkey Key Info Operation Mapping)` (L1042–L1056) [CONSTANT: ANK-4592-00-00]

> Creates a work map with operation metadata and calls the Sparkey key information operation component to record the suspension for TV new course purposes.

| # | Type | Code |
|---|------|------|
| 1 | SET | `workMap = new HashMap()` // ANK-4592-00-00 |
| 2 | SET | `workMap.put("func_cd", "1")` |
| 3 | SET | `workMap.put("shori_cd", SHORI_CD_DSL_STP_PAUSE)` // [-> SHORI_CD_DSL_STP_PAUSE="4"] (Cancellation/Suspension/Pause) |
| 4 | SET | `workMap.put("svc_kei_no", eKK0081A010Hash.get(SVC_KEI_NO))` |
| 5 | SET | `workMap.put("snst_mt_ymd", oPE_DATE)` |
| 6 | SET | `workMap.put("ope_div", OPE_DIV_STP)` // [-> OPE_DIV_STP="3"] (Stop) |
| 7 | EXEC | `param.setData(CC_WORK_USE_STP, workMap)` // [-> CC_WORK_USE_STP="JKKUSESTPRUNCC"] |
| 8 | SET | `JKKSptvKeyInfOperateCC sptvCC = new JKKSptvKeyInfOperateCC()` |
| 9 | CALL | `sptvCC.execute(handle, param, CC_WORK_USE_STP)` // Sparkey key info operation |

---

**Block 11** — EXEC `(Service Contract Detail List)` (L1061–L1065)

> Retrieves the list of sub-agreements (service contract details) for the suspended contract.

| # | Type | Code |
|---|------|------|
| 1 | SET | `statusCode = callEKK0161B004SC(param, handle, requestParam, resultHash, svc_kei_no)` // [-> TEMPLATE_ID_EKK0161B004="EKK0161B004"] |
| 2 | IF | `statusCode != 0` |
| 3 | RETURN | `return statusCode` |

---

**Block 12** — IF `(Sub-agreement list non-empty check)` (L1068–L1140)

> Main iteration block: iterates over all sub-agreements and processes each based on its status.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0161B004HashList = (ArrayList) resultHash.get("EKK0161B004")` // [-> TEMPLATE_ID_EKK0161B004="EKK0161B004"] |
| 2 | IF | `eKK0161B004HashList.size() > 0` // Has sub-agreements? |

---

**Block 12.1** — FOR `(Iterate over sub-agreements)` (L1072–L1137)

> Processes each sub-agreement in the detail list.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0161B004Hash = eKK0161B004HashList.get(idx_su)` |
| 2 | SET | `svc_kei_ucwk_no = (String) eKK0161B004Hash.get(SVC_KEI_UCWK_NO)` |
| 3 | SET | `svc_kei_ucwk_stat = (String) eKK0161B004Hash.get(SVC_KEI_UCWK_STAT)` |

---

**Block 12.1.1** — IF `(Sub-agreement status: Service Providing OR Suspension)` (L1079–L1127) [CONSTANT: SVC_KEI_STAT_TKC="100", SVC_KEI_STAT_PAUSE="210"]

> For sub-agreements that are actively providing service or in suspension: performs sub-agreement agreement retrieval, suspends the sub-agreement, and decides whether to issue SOD data.

| # | Type | Code |
|---|------|------|
| 1 | IF | `SVC_KEI_STAT_TKC.equals(svc_kei_ucwk_stat) || SVC_KEI_STAT_PAUSE.equals(svc_kei_ucwk_stat)` // [-> TKC="100" (Service Providing), PAUSE="210" (Suspension/Discontinuation)] |
| 2 | CALL | `callEKK0161A010SC(param, handle, svc_kei_ucwk_no, resultHash)` // Sub-agreement agreement retrieval |
| 3 | IF | `statusCode != 0` // Error check |
| 4 | RETURN | `return statusCode` |
| 5 | SET | `eKK0161A010Hash = (HashMap) resultHash.get("EKK0161A010")` // [-> TEMPLATE_ID_EKK0161A010="EKK0161A010"] |
| 6 | SET | `statusCode = callEKK0161C040SC(param, handle, eKK0161A010Hash, resultHash)` // [-> TEMPLATE_ID_EKK0161C040="EKK0161C040"] Sub-agreement suspension |
| 7 | IF | `statusCode != 0` |
| 8 | RETURN | `return statusCode` |
| 9 | SET | `eKK0161C040Hash = (HashMap) resultHash.get("EKK0161C040")` |
| 10 | SET | `eMobileSodKbn = 0` |

---

**Block 12.1.1.1** — IF `(E-Mobile check)` (L1096–L1099) [CONSTANT: PRC_GRP_CD_MOB_EM]

> For mobile service contracts, determines the E-Mobile SOD classification.

| # | Type | Code |
|---|------|------|
| 1 | IF | `JKKSvcConst.PRC_GRP_CD_MOB_EM.equals(prc_grp_cd)` // Is eo Mobile service? |
| 2 | SET | `eMobileSodKbn = getEMobileSodKbn(svc_kei_stat, svc_kei_ucwk_stat)` |

---

**Block 12.1.1.2** — IF `(SOD issuance decision)` (L1101–L1122)

> Decides whether SOD (Service Order Data) should be issued for this sub-agreement. For non-Mobile contracts or specific Mobile classifications, generates SOD data.

| # | Type | Code |
|---|------|------|
| 1 | IF | `judgeHakkoSod(param, handle, requestParam, resultHash, svc_kei_ucwk_no, prc_grp_cd, eMobileSodKbn)` // Should we issue SOD? |
| 2 | SET | `SODData = new HashMap()` |
| 3 | SET | `SODData.put(INFO_SYSID, eKK0081A010Hash.get(SYSID))` |
| 4 | SET | `SODData.put(INFO_SVC_KEI_NO, eKK0081A010Hash.get(SVC_KEI_NO))` |
| 5 | IF | `eMobileSodKbn == 0 || EMOBILE_SOD_KBN_EM_UCWK == eMobileSodKbn || EMOBILE_SOD_KBN_UCWK == eMobileSodKbn` // [-> EM_UCWK=1 (Main+Sub), UCWK=4 (Sub only)] Non-Mobile or includes sub-agreement |
| 6 | SET | `SODData.put(INFO_SVC_KEI_UCWK_NO, eKK0161C040Hash.get(SVC_KEI_UCWK_NO))` |
| 7 | SET | `SODData.put(INFO_CHAF_SVC_KEI_UCWK_GENE_ADD_DTM, eKK0161C040Hash.get(GENE_ADD_DTM))` |
| 8 | EXEC | `hakkoSODDataList.add(SODData)` |

---

**Block 12.1.2** — ELSE-IF `(Sub-agreement in Completion, main is Network)` (L1129–L1137) [CONSTANT: OM-2016-0000008, SVC_KEI_STAT_TEIK="030"]

> For network group contracts where the sub-agreement is in "Completion" (030) status: generates SOD for the new-side of a course change (new recognition side).

| # | Type | Code |
|---|------|------|
| 1 | IF | `SVC_KEI_STAT_TEIK.equals(svc_kei_ucwk_stat) && (NET_HM.equals(prc_grp_cd) || NET_MT.equals(prc_grp_cd) || NET_MZ.equals(prc_grp_cd))` // [-> TEIK="030" (Completion)] Completed sub-agreement under network group |
| 2 | SET | `SODData = new HashMap()` |
| 3 | SET | `SODData.put(INFO_SYSID, eKK0081A010Hash.get(SYSID))` |
| 4 | SET | `SODData.put(INFO_SVC_KEI_NO, eKK0081A010Hash.get(SVC_KEI_NO))` |
| 5 | SET | `SODData.put(INFO_SVC_KEI_UCWK_NO, eKK0161B004Hash.get(SVC_KEI_UCWK_NO))` |
| 6 | SET | `SODData.put(INFO_CHAF_SVC_KEI_UCWK_GENE_ADD_DTM, eKK0161B004Hash.get(GENE_ADD_DTM))` |
| 7 | EXEC | `hakkoSODDataList.add(SODData)` |

---

**Block 12.1.3** — ELSE `(Other cases: delegate to hakkoSodUcwk)` (L1139–L1149) [CONSTANT: IT1-2013-0000847]

> For all other sub-agreement statuses, delegates to the SOD issuance method for sub-agreement orders. This handles cases like completed numbers change.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `hakkoSodUcwk(param, handle, requestParam, resultHash, eKK0161B004Hash, prc_grp_cd, hakkoSODDataList)` |

---

**Block 13** — ELSE `(No sub-agreements)` (L1151–L1166)

> When the service contract has no sub-agreements (detail list is empty), this block handles the main contract directly.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!SVC_KEI_STAT_PAUSE.equals(svc_kei_stat)` // Status is NOT "210" (PAUSE) [-> KT1-2013-0000766] |
| 2 | SET | `SODData = new HashMap()` |
| 3 | SET | `SODData.put(INFO_SYSID, eKK0081A010Hash.get(SYSID))` |
| 4 | SET | `SODData.put(INFO_SVC_KEI_NO, eKK0081A010Hash.get(SVC_KEI_NO))` |
| 5 | EXEC | `hakkoSODDataList.add(SODData)` // Minimal SOD with only SYSID and top-level contract number |

---

**Block 14** — RETURN `(Return success)` (L1167)

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

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service contract number — unique identifier for a service contract in the system |
| `prm_svc_kei_no` | Field | Target service contract number — the specific contract number requested for suspension |
| `svc_kei_stat` | Field | Service contract status code — indicates the current state of a service contract (100=Service Providing, 210=Suspension/Discontinuation, 030=Completion, 220=Stopped, 910=Cancelled) |
| `svc_kei_ucwk_no` | Field | Service contract detail (sub-agreement) number — identifies individual line items within a service contract |
| `svc_kei_ucwk_stat` | Field | Service contract detail status — status of a sub-agreement line item |
| `prc_grp_cd` | Field | Pricing group code — classifies the billing group of a service (e.g., network, telephone, TV, mobile) |
| `statusCode` | Field | Processing status code — return value indicating success (0) or error (non-zero) |
| `hakkoSODDataList` | Field | SOD issuance list — output parameter containing SOD records to be issued downstream |
| SOD | Acronym | Service Order Data — data structure for service order issuance in the telecom fulfillment pipeline |
| TKC | Acronym | (Japanese: 提供中) Service Providing — status code "100" indicating the service is actively being provided |
| PAUSE | Acronym | (Japanese: 休止・中断中) Suspension/Discontinuation — status code "210" indicating the service is temporarily suspended or discontinued |
| TEIK | Acronym | (Japanese: 締結済) Completion — status code "030" indicating the service contract has been completed |
| STP | Acronym | (Japanese: 停止) Stop/Suspension — status code "220" |
| DSL | Acronym | (Japanese: 解約) Cancellation/Disconnection — status code "910" |
| CNCL | Acronym | (Japanese: キャンセル済) Cancelled — status code "920" |
| `callEKK0081A010SC` | Method | Service Contract Agreement — reads the current service contract agreement data |
| `callEKK0081C050SC` | Method | Service Contract Suspension — updates the service contract to suspended status |
| `callEKK0161B004SC` | Method | Service Contract Detail List — retrieves all sub-agreements for a service contract |
| `callEKK0161A010SC` | Method | Sub-Agreement Agreement — reads individual sub-agreement agreement data |
| `callEKK0161C040SC` | Method | Sub-Agreement Suspension — suspends an individual sub-agreement |
| `callEKK0321A010SC` | Method | Biller's Agreement List — retrieves biller's agreement data including the service contract number |
| `isSvcKeiTargetData` | Method | Target contract validator — checks if the requested contract matches the biller's agreement |
| `judgeHakkoSod` | Method | SOD issuance judge — decides whether a Service Order should be issued |
| `hakkoSodUcwk` | Method | SOD issuance for sub-agreement — delegates SOD creation for sub-agreement orders |
| `getEMobileSodKbn` | Method | E-Mobile SOD classification — determines the E-Mobile specific SOD issuance type |
| `JKKSptvKeyInfOperateCC.execute` | Method | Sparkey key information operation — updates special key mappings for TV new course |
| `SVC_KEI_USE_STP_EXEC_FLG` | Constant | Service contract use stop execution flag — set to true after suspension is executed |
| `SHORI_CD_DSL_STP_PAUSE` | Constant | Processing code for cancellation/suspension/pause — value "4" for Sparkey key operation |
| `OPE_DIV_STP` | Constant | Operation division for stop — value "3" |
| `CC_WORK_USE_STP` | Constant | Work map name for use stop — value "JKKUSESTPRUNCC" |
| `EMOBILE_SOD_KBN_EM_UCWK` | Constant | E-Mobile SOD classification: Main + Sub — value 1 |
| `EMOBILE_SOD_KBN_EM` | Constant | E-Mobile SOD classification: Main only — value 2 |
| `EMOBILE_SOD_KBN_NONE` | Constant | E-Mobile SOD classification: No SOD — value 3 |
| `EMOBILE_SOD_KBN_UCWK` | Constant | E-Mobile SOD classification: Sub only — value 4 |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service |
| eo Hikari | Business term | Fujitsu's FTTH broadband service brand |
| K-Opticom | Business term | Japanese telecommunications provider, customer of the eo customer system |
| Sparkey | Business term | Special key information system — equipment/terminal management for TV new course integration |
| ANK | Acronym | Internal project/issue identifier prefix (e.g., ANK-4592-00-00) |
| KT1 | Acronym | Internal project identifier for K-Opticom improvements |
| OM | Acronym | Internal project identifier for order management changes |
| IT1 | Acronym | Internal project identifier for IT-related improvements |
| SC | Acronym | Service Component — service layer module for database operations |
| CC | Acronym | Common Component — shared business logic component |
| CBS | Acronym | Common Business Service — shared business service module |
| SYSID | Acronym | System identifier — unique identifier for the system instance |
| GENE_ADD_DTM | Field | Generation/addition timestamp — when the sub-agreement was created or modified |
