# Business Logic — JKKKyoseiDslRunCC.svcKei_KyoseiDsl() [412 LOC]

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

## 1. Role

### JKKKyoseiDslRunCC.svcKei_KyoseiDsl()

This method executes the **forced cancellation (kyosei kaiyaku)** process for DSL-type service contracts. It is the core business logic handler that systematically cancels service contracts and their sub-contracts (including optional services, equipment services, and sub-operation services), then performs service-type-specific post-cancellation processing — primarily aging ID invalidation (usage end) and SOD (Service Order Data) order issuance.

The method handles multiple **service categories** based on the pricing group code (`prc_grp_cd`): eo Home/Mezo/Mansion Net types (`PRC_GRP_CD_NET_HM="02"`, `PRC_GRP_CD_NET_MZ="03"`, `PRC_GRP_CD_NET_MN="04"`), eoADSL/eAccess (`PRC_GRP_CD_EACCESS="05"`), eo Flets (`PRC_GRP_CD_FLETS="06"`), eo Phone (`PRC_GRP_CD_TEL="10"`), eo Mail Access (`PRC_GRP_CD_MAIL="16"`), and others (eo Electricity `PRC_GRP_CD_EODENKI="17"`, MI NEIO `PRC_GRP_CD_MINEO="51"`). Each category triggers different authentication/aging termination logic.

The method implements a **routing/dispatch design pattern**: it first performs common operations (service contract cancellation, skiper key info registration), then routes to service-type-specific processing branches. For service details within each contract, it iterates through the details list, cancels each one, and conditionally issues SOD orders based on the `judgeHakkoSod()` assessment.

Its **role in the larger system** is as the central forced cancellation coordinator called by `executeKyoseiDslProc()`. It is invoked during batch processing or screen-based forced cancellation operations (e.g., KKSV0167), serving as the bridge between the calling layer and the underlying service components (SCs) that perform the actual contract lifecycle state transitions.

## 2. Processing Pattern (Detailed Business Logic)

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

    START --> RETRIEVE["Retrieve eKK0321A010Hash, eKK0081A010Hash, isNowAdchgFlg"]
    RETRIEVE --> PRM_CHECK{prm_svc_kei_no equals eKK0321A010 SVC_KEI_NO?}

    PRM_CHECK -->|No| RET0["return 0 - Service contract number mismatch"]
    PRM_CHECK -->|Yes| SVC_KYOSAI["callEKK0081C180SC - Service Contract Cancellation"]

    SVC_KYOSAI -->|statusCode != 0| RET_ERR["return statusCode - Error"]
    SVC_KYOSAI -->|OK| SVC_KYOSAI_KAKTEI["callEKK0081C260SC - Cancellation Confirmation"]

    SVC_KYOSAI_KAKTEI -->|statusCode != 0| RET_ERR
    SVC_KYOSAI_KAKTEI -->|OK| SKIPPER_KEY["Set Skiper key info work map"]

    SKIPPER_KEY --> SKIPPER_CALL["JKKSptvKeyInfOperateCC.execute"]
    SKIPPER_CALL --> PRC_GRP_CHECK{prc_grp_cd == 05 or 16?}

    PRC_GRP_CHECK -->|Yes - 05 or 16| EACCESS["sodUcwkMap with empty, return 0"]
    PRC_GRP_CHECK -->|No| TEL_AUTH["callEKK0111A010SC - PPP Auth ID aging end"]

    TEL_AUTH -->|statusCode != 0| RET_ERR
    TEL_AUTH -->|OK| SVC_DTL_LIST["callEKK0161B004SC - Get service contract detail list"]

    SVC_DTL_LIST -->|statusCode != 0| RET_ERR
    SVC_DTL_LIST -->|OK| FOR_LOOP["for each detail in eKK0161B004HashList"]

    FOR_LOOP --> SVC_DTL_AGREED["callEKK0161A010SC - Get service detail agreement"]
    SVC_DTL_AGREED -->|statusCode != 0| RET_ERR
    SVC_DTL_AGREED -->|OK| STAT_CHECK{svc_kei_ucwk_stat in 030/100/220/210?}

    STAT_CHECK -->|No - other stat| CONTINUE["continue - skip this detail"]
    STAT_CHECK -->|Yes| DETAIL_BRANCH{isNewCourse or isAdChgAdd?}

    DETAIL_BRANCH --> NEW_COURSE{IDO_DIV == 00009 or 00011?}
    DETAIL_BRANCH --> AD_CHG_ADD{IDO_DIV == 00064?}

    NEW_COURSE -->|Yes| SET_NEW["isNewCourse = true"]
    NEW_COURSE -->|No| SET_NORMAL
    AD_CHG_ADD -->|Yes| SET_ADCHG["isAdChgAdd = true"]
    AD_CHG_ADD -->|No| SET_NORMAL

    SET_NEW --> CANCEL_DETAIL["callEKK0161C180SC - Service Detail Cancellation"]
    SET_ADCHG --> CANCEL_DETAIL
    SET_NORMAL --> CANCEL_DETAIL

    CANCEL_DETAIL -->|statusCode != 0| RET_ERR
    CANCEL_DETAIL -->|OK| CANCEL_KAKTEI["callEKK0161C190SC - Cancellation Confirmation"]

    CANCEL_KAKTEI -->|statusCode != 0| RET_ERR
    CANCEL_KAKTEI -->|OK| JUDGE_SOD{judgeHakkoSod - SOD decision}

    JUDGE_SOD -->|false| PRC_GRP_BRANCH{prc_grp_cd check}
    JUDGE_SOD -->|true| SOD_MAP["Add to sodSvcKeiUcwkList"]
    SOD_MAP --> PRC_GRP_BRANCH

    PRC_GRP_BRANCH -->|10| TEL_SVC["callEKK0191A010SC - eo Phone detail"]
    PRC_GRP_BRANCH -->|02/03/04| NET_SVC["callEKK0171A010SC - eo Net detail"]
    PRC_GRP_BRANCH -->|06| ADSL_SVC["callEKK0221A010SC - eoADSL detail"]

    TEL_SVC -->|statusCode != 0| RET_ERR
    TEL_SVC -->|OK| TEL_AGING["Update aging for telno and SIP user ID"]

    TEL_AGING -->|Error| RET_ERR
    TEL_AGING -->|OK| FOR_NEXT["Next iteration"]

    NET_SVC -->|statusCode != 0| RET_ERR
    NET_SVC -->|OK| NET_AGING["Update ISP auth ID aging"]
    NET_AGING --> FOR_NEXT

    ADSL_SVC -->|statusCode != 0| RET_ERR
    ADSL_SVC -->|OK| ADSL_AGING["Split ADSL auth ID, update aging"]
    ADSL_AGING --> FOR_NEXT

    FOR_NEXT -->|continue loop| SVC_DTL_AGREED
    FOR_NEXT -->|loop end| SJISHO_PUT["JKKBpCommon.putAxMRenkeiDataKbn"]

    SJISHO_PUT --> NETFLIX_CHECK{svcCd == 01?}
    NETFLIX_CHECK -->|Yes| NETFLIX_PROC["Netflix contract cancellation"]
    NETFLIX_CHECK -->|No| FINAL_RET["return 0 - Done"]
    NETFLIX_PROC --> FINAL_RET

    RET_ERR --> RET_EXIT(["Return error code"])
    RET0 --> EXIT_OK(["Return 0"])
    EACCESS --> EXIT_OK
    EXIT_OK --> END_NODE(["End"])
```

**Processing Flow Summary:**

1. **Initialization** — Retrieve pre-billing and service contract agreement results from the cached resultHash. Check the address-change flag.
2. **Contract Number Validation** — If the requested service contract number does not match the pre-billing agreement, abort (return 0).
3. **Primary Service Contract Cancellation** — Execute `EKK0081C180SC` for cancellation, then `EKK0081C260SC` for confirmation.
4. **Skiper Key Info Registration (ANK-4592)** — Register skiper key operation info (function code=1, process code=4/DSL_STP_PAUSE, operation division=1) to coordinate with the cable/TV system.
5. **Pricing Group Routing** — Branch based on `prc_grp_cd`:
   - **05 (eAccess) or 16 (eo Mail)**: Add empty SOD entry and return 0 — no SOD order needed.
   - **10 (eo Phone)**: Process PPP auth ID and SIP user ID aging end.
6. **Service Detail Iteration** — Loop through all service contract details, cancelling each one.
7. **Post-Cancellation per Service Type** — For each cancelled detail, perform service-type-specific aging termination (telno, SIP ID, ISP auth ID, ADSL auth ID).
8. **Linked Data KBN Setup** — Mark authentication IDs as deleted for address-linked contracts.
9. **Netflix Cancellation (ANK-3949)** — If service code is "01" (Internet), execute Netflix business contract cancellation.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle carrying connection context and transaction management for the forced cancellation operation |
| 2 | `param` | `IRequestParameterReadWrite` | Model group and control map container; carries request parameters, work maps (e.g., skiper key info), and result data structures; used to set and retrieve business data throughout processing |
| 3 | `requestParam` | `HashMap<String, Object>` | Request parameter map containing the service contract number (`SVC_KEI_NO`), request date (`REQYMD`), and aging operation data (`AGING_SBT_CD`, `AGING_TG_VALUE`); drives conditional branches and aging termination |
| 4 | `resultHash` | `HashMap<String, Object>` | Result hash map populated with SC (Service Component) responses; contains templates like `EKK0321A010` (pre-billing agreement), `EKK0081A010` (service contract agreement), `EKK0161B004` (detail list), `EKK0161C180` (detail cancellation), etc. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `sodSvcKeiUcwkList` | `ArrayList<HashMap<String, Object>>` | SODCC service contract detail number list — tracks details requiring SOD (Service Order Data) order issuance after forced cancellation |
| `dslTelnoList` | `ArrayList<String>` | Phone number list for Skype-style number update processing (added in ANK-4494 Step 2 quality enhancement) |
| `svcKeiUpdDtm` | `String` | Service contract update datetime — set after each cancellation/confirmation operation |
| `mapper` | `JKKKyoseiDslRunMapperCC` | Mapper object group used for calling service information |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKKyoseiDslRunCC.callEKK0321A010SC` | EKK0321A010SC | Pre-billing agreement tables | Retrieve pre-billing one-agreement result (already cached in resultHash) |
| R | `JKKKyoseiDslRunCC.callEKK0081A010SC` | EKK0081A010SC | Service contract tables | Retrieve service contract agreement result (already cached in resultHash) |
| R | `JKKKyoseiDslRunCC.getAgingNinshoId` | EZM0111B030SC | Aging management tables | Look up aging authentication ID with VR identifier prefix resolution |
| C | `JKKKyoseiDslRunCC.callEKK0081C180SC` | EKK0081C180SC | Service contract tables | Execute service contract cancellation (primary contract level) |
| C | `JKKKyoseiDslRunCC.callEKK0081C260SC` | EKK0081C260SC | Service contract tables | Confirm/cancel service contract cancellation (primary contract level) |
| R | `JKKKyoseiDslRunCC.callEKK0111A010SC` | EKK0111A010SC | eo Phone service detail tables | Get eo Phone service detail — PPP Auth ID and SIP User ID for aging |
| R | `JKKKyoseiDslRunCC.callEKK0161B004SC` | EKK0161B004SC | Service contract detail tables | Retrieve service contract details list |
| R | `JKKKyoseiDslRunCC.callEKK0161A010SC` | EKK0161A010SC | Service contract detail tables | Get service contract detail agreement (per-detail level) |
| C | `JKKKyoseiDslRunCC.callEKK0161C180SC` | EKK0161C180SC | Service contract detail tables | Cancel service contract detail (per-detail cancellation) |
| C | `JKKKyoseiDslRunCC.callEKK0161C190SC` | EKK0161C190SC | Service contract detail tables | Confirm service detail cancellation |
| R | `JKKKyoseiDslRunCC.callEKK0191A010SC` | EKK0191A010SC | eo Phone service detail tables | Get eo Phone service detail — phone number, SIP User ID for aging |
| R | `JKKKyoseiDslRunCC.callEKK0171A010SC` | EKK0171A010SC | eo Net service detail tables | Get eo Net service detail — ISP auth ID for aging |
| R | `JKKKyoseiDslRunCC.callEKK0221A010SC` | EKK0221A010SC | eoADSL (Flets) service detail tables | Get eoADSL service detail — ADSL auth ID for aging |
| R | `JKKKyoseiDslRunCC.getTelnPortoutUm` | - | Port-out status tables | Check whether a phone number is under port-out status |
| U | `JKKKyoseiDslRunCC.updateAgingUseEnd` | EZM0111C010SC | Aging management tables (EZM) | Mark aging authentication IDs (PPP ID, SIP User ID, ISP auth ID, ADSL auth ID, phone number) as usage-ended |
| U | `JKKSptvKeyInfOperateCC.execute` | - | Skiper key info tables | Register skiper key operation info (function code=1, process code=4/DSL_STP_PAUSE, operation division=1) |
| U | `JKKBpCommon.putAxMRenkeiDataKbn` | - | Linked data tables (AxM) | Set linked data KBN (auth ID deletion for SJISHO linked contracts) |
| C | `JKKNetflixTajgsKeiIdtslAddCC.main` | - | Netflix business contract tables | Register Netflix business contract cancellation异动 (only when svcCd == "01" Internet) |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: `executeKyoseiDslProc` | `executeKyoseiDslProc` -> `svcKei_KyoseiDsl` | `callEKK0081C180SC [C] service_contract`, `callEKK0081C260SC [C] service_contract`, `callEKK0111A010SC [R] eo_phone_detail`, `callEKK0161B004SC [R] svc_contract_detail`, `callEKK0161A010SC [R] svc_contract_detail`, `callEKK0161C180SC [C] svc_contract_detail`, `callEKK0161C190SC [C] svc_contract_detail`, `callEKK0191A010SC [R] eo_phone_detail`, `callEKK0171A010SC [R] eo_net_detail`, `callEKK0221A010SC [R] eoADSL_detail`, `updateAgingUseEnd [U] aging_mgmt`, `getTelnPortoutUm [R] portout_status`, `JKKNetflixTajgsKeiIdtslAddCC.main [C] netflix_contract` |

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Initialize local variables (L1474)

> Retrieve pre-billing and service contract agreement results from the resultHash, and check the address-change flag.

| # | Type | Code |
|---|------|------|
| 1 | SET | `statusCode = 0` // Initialize return code [L1474] |
| 2 | SET | `eKK0321A010Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0321A010)` // Pre-billing agreement result [-> "EKK0321A010"] |
| 3 | SET | `eKK0081A010Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0081A010)` // Service contract agreement result [-> "EKK0081A010"] |
| 4 | EXEC | `isNowAdchgFlg = isNowAdChg(handle, param, requestParam, "", eKK0081A010Hash)` // Check address-change flag [L1484] |
| 5 | SET | `prc_grp_cd = eKK0081A010Hash.get(PRC_GRP_CD)` // Pricing group code [-> EKK0081A010CBSMsg1List.PRC_GRP_CD] |
| 6 | SET | `sysid = eKK0081A010Hash.get(SYSID)` // SYSID [L1488] |
| 7 | SET | `prm_svc_kei_no = requestParam.get(SVC_KEI_NO)` // Requested service contract number [-> "SVC_KEI_NO"] |

---

**Block 2** — [IF] Service contract number mismatch check (L1492)

> If the requested service contract number does not match the pre-billing agreement's service contract number, abort processing and return 0.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!prm_svc_kei_no.equals(eKK0321A010Hash.get(EKK0321A010CBSMsg1List.SVC_KEI_NO))` [L1492] |
| 2 | RETURN | `return 0` // Mismatch — no processing |

---

**Block 3** — [EXEC] Service Contract Cancellation (L1509)

> Execute primary service contract cancellation via SC call.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0081C180SC(param, handle, requestParam, resultHash)` // Service contract cancellation [-> TEMPLATE_ID_EKK0081C180 = "EKK0081C180"] |
| 2 | IF | `statusCode != 0` [L1512] |
| 3 | RETURN | `return statusCode` |
| 4 | SET | `eKK0081C180Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0081C180)` [L1516] |
| 5 | SET | `this.svcKeiUpdDtm = eKK0081C180Hash.get(EKK0081C180CBSMsg.UPD_DTM)` // Update timestamp [L1517] |

---

**Block 4** — [EXEC] Service Contract Cancellation Confirmation (L1522)

> Confirm/cancel the service contract cancellation.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0081C260SC(param, handle, requestParam, resultHash)` // Cancellation confirmation [-> TEMPLATE_ID_EKK0081C260 = "EKK0081C260"] |
| 2 | IF | `statusCode != 0` [L1525] |
| 3 | RETURN | `return statusCode` |
| 4 | SET | `eKK0081C260Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0081C260)` [L1529] |
| 5 | SET | `this.svcKeiUpdDtm = eKK0081C260Hash.get(EKK0081C260CBSMsg.UPD_DTM)` [L1530] |

---

**Block 5** — [SET + EXEC] Skiper Key Info Registration (ANK-4592) (L1534)

> Register skiper key operation information to coordinate with the Skiper (television/cable) system, signaling a DSL stop/pause operation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `workMap = new HashMap<>()` [L1536] |
| 2 | SET | `workMap.put("func_cd", "1")` [-> func_cd = "1"] |
| 3 | SET | `workMap.put("shori_cd", SHORI_CD_DSL_STP_PAUSE)` [-> SHORI_CD_DSL_STP_PAUSE = "4" (DSL Stop/Pause)] |
| 4 | SET | `workMap.put("svc_kei_no", eKK0081A010Hash.get(EKK0081A010CBSMsg1List.SVC_KEI_NO))` |
| 5 | SET | `workMap.put("snst_mt_ymd", requestParam.get(REQYMD))` [-> REQYMD = "REQYMD"] |
| 6 | SET | `workMap.put("ope_div", OPE_DIV_DSL)` [-> OPE_DIV_DSL = "1"] |
| 7 | EXEC | `param.setData(CC_WORK_KYOSEI_DSL, workMap)` [-> CC_WORK_KYOSEI_DSL = "JKKKYOSEIDSLRUNCC"] |
| 8 | EXEC | `JKKSptvKeyInfOperateCC.execute(handle, param, CC_WORK_KYOSEI_DSL)` // Execute Skiper key operation [L1538] |

---

**Block 6** — [IF/ELSE-IF] Pricing Group Code Routing (L1542)

> Route based on the pricing group code. If eoADSL/eAccess or eo Mail Access, add an empty SOD entry and return early since no SOD order is needed for these service types.

| # | Type | Code |
|---|------|------|
| 1 | IF | `PRC_GRP_CD_EACCESS.equals(prc_grp_cd) || PRC_GRP_CD_MAIL.equals(prc_grp_cd)` [L1542] |
| 2 |  | `[PRC_GRP_CD_EACCESS = "05" (eoADSL/eAccess), PRC_GRP_CD_MAIL = "16" (eo Mail Access)]` |
| 3 | SET | `sodUcwkMap = new HashMap<>()` [L1547] |
| 4 | SET | `sodUcwkMap.put("svc_kei_ucwk_no", "")` // Empty service contract detail number |
| 5 | SET | `sodUcwkMap.put("upd_dtm", "")` // Empty update timestamp |
| 6 | SET | `this.sodSvcKeiUcwkList.add(sodUcwkMap)` [L1551] |
| 7 | RETURN | `return 0` // Return early — no SOD needed |
| 8 | ELSE-IF | `PRC_GRP_CD_TEL.equals(prc_grp_cd)` [L1564] |
| 9 |  | `[PRC_GRP_CD_TEL = "10" (eo Phone)]` |

**Block 6.1** — [EXEC] PPP Auth / SIP User Aging End for eo Phone (L1566)

> For eo Phone service, retrieve PPP authentication ID and SIP user ID, then mark them as usage-ended.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0111A010SC(param, handle, requestParam, resultHash)` [L1566 - PPP Auth ID/SIP User] |
| 2 | IF | `statusCode != 0` [L1569] |
| 3 | RETURN | `return statusCode` |
| 4 | SET | `ppp_ninsho_id = eKK0111a010Hash.get(EKK0111A010CBSMsg1List.PPP_NINSHO_ID)` [L1575] |
| 5 | IF | `null != ppp_ninsho_id && 0 < ppp_ninsho_id.length()` [L1577] |
| 6 | SET | `ppp_ninsho_id = JKKBpCommon.getAgingNinshoId(ppp_ninsho_id)` // Resolve VR prefix |
| 7 | SET | `requestParam.put(AGING_SBT_CD, AGING_SBT_CD_PPP_ID)` [-> AGING_SBT_CD = "aging_sbt_cd", AGING_SBT_CD_PPP_ID = PPP auth ID] |
| 8 | SET | `requestParam.put(AGING_TG_VALUE, ppp_ninsho_id)` [-> AGING_TG_VALUE = "aging_tg_value"] |
| 9 | CALL | `statusCode = updateAgingUseEnd(param, handle, requestParam, resultHash)` |
| 10 | IF | `statusCode != 0` [L1583] |
| 11 | RETURN | `return statusCode` |

---

**Block 7** — [EXEC] Service Contract Details List Retrieval (L1589)

> Retrieve the full list of service contract details for the cancelled contract.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0161B004SC(param, handle, requestParam, resultHash)` [L1589 - Service detail list] |
| 2 | IF | `statusCode != 0` [L1592] |
| 3 | RETURN | `return statusCode` |
| 4 | SET | `eKK0161B004HashList = (ArrayList)resultHash.get(TEMPLATE_ID_EKK0161B004)` [-> "EKK0161B004"] |
| 5 | SET | `sjishoSvcKeiUcwk = new ArrayList<>()` // Linked service contract detail numbers list |
| 6 | SET | `targetSvcKeiUcwkCnt = 0` // SOD order count (OM-2015-0000711) [L1599] |

---

**Block 8** — [FOR] Iterate Over Service Contract Details (L1603)

> Loop through each service contract detail to process cancellation and post-processing.

| # | Type | Code |
|---|------|------|
| 1 | FOR | `idx_su = 0; idx_su < eKK0161B004HashList.size(); idx_su++` [L1603] |
| 2 | SET | `eKK0161B004Hash = eKK0161B004HashList.get(idx_su)` [L1606] |

---

**Block 8.1** — [CALL] Service Contract Detail Agreement (L1611)

> Retrieve the agreement result for the current service contract detail.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0161A010SC(param, handle, eKK0161B004Hash, resultHash)` [L1611] |
| 2 | IF | `statusCode != 0` [L1614] |
| 3 | RETURN | `return statusCode` |
| 4 | SET | `eKK0161A010Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0161A010)` [-> "EKK0161A010"] |
| 5 | SET | `svc_kei_ucwk_no = eKK0161A010Hash.get(EKK0161A010CBSMsg1List.SVC_KEI_UCWK_NO)` [L1619] |
| 6 | SET | `svc_kei_ucwk_stat = eKK0161A010Hash.get(EKK0161A010CBSMsg1List.SVC_KEI_UCWK_STAT)` [L1622] |
| 7 | SET | `kahi_flg = eKK0161A010Hash.get(EKK0161A010CBSMsg1List.KEIZK_AF_KEI_CHGECHU_FLG)` [L1623] |

---

**Block 8.2** — [IF] Service Detail Status Check (L1628)

> Only process details that are in active states: "030" (Settled), "100" (In Service), "220" (Suspended), or "210" (Stopped).

| # | Type | Code |
|---|------|------|
| 1 | IF | `svc_kei_ucwk_stat in (SVC_KEI_STAT_TEIK="030" \|\| SVC_KEI_STAT_TKC="100" \|\| SVC_KEI_STAT_STP="220" \|\| SVC_KEI_STAT_KYUS="210")` [L1628-1631] |

**Block 8.2.1** — [IF/ELSE-IF] ID Division Sub-Checks (L1638)

> Determine if this is a new course change or address-change-added detail for SOD order logic.

| # | Type | Code |
|---|------|------|
| 1 | SET | `isNewCourse = false` [L1638] |
| 2 | SET | `kk0161_ido_div = eKK0161A010Hash.get(EKK0161A010CBSMsg1List.IDO_DIV)` [L1640] |
| 3 | IF | `svc_kei_ucwk_stat == "030" (Settled) && IDO_DIV in (IDO_DIV_COURSECHG="00009" \|\| IDO_DIV_KAIHK="00011")` [L1641-1642] |
| 4 |  | `[IDO_DIV_COURSECHG = "00009" (Course Change), IDO_DIV_KAIHK = "00011" (Reinstallation)]` |
| 5 | SET | `isNewCourse = true` [L1643] |
| 6 | ELSE-IF | `svc_kei_ucwk_stat == "030" && IDO_DIV == IDO_DIV_ADCHGADD` [L1651] |
| 7 |  | `[IDO_DIV_ADCHGADD = "00064" (Address Change Add)]` |
| 8 | SET | `isAdChgAdd = true` [L1652] |

**Block 8.2.2** — [CALL] Service Detail Cancellation (L1659)

> Cancel the current service contract detail.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0161C180SC(param, handle, requestParam, resultHash)` [L1659] |
| 2 | IF | `statusCode != 0` [L1662] |
| 3 | RETURN | `return statusCode` |
| 4 | SET | `eKK0161C180Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0161C180)` [-> "EKK0161C180"] |
| 5 | SET | `this.svcKeiUpdDtm = eKK0161C180Hash.get(EKK0161C180CBSMsg.UPD_DTM)` [L1666] |

**Block 8.2.3** — [CALL] Service Detail Cancellation Confirmation (L1671)

> Confirm the service detail cancellation.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0161C190SC(param, handle, requestParam, resultHash)` [L1671] |
| 2 | IF | `statusCode != 0` [L1674] |
| 3 | RETURN | `return statusCode` |
| 4 | SET | `eKK0161C190Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0161C190)` [-> "EKK0161C190"] |
| 5 | SET | `this.svcKeiUpdDtm = eKK0161C190Hash.get(EKK0161C190CBSMsg.UPD_DTM)` [L1678] |

**Block 8.2.4** — [IF] SOD Order Issuance Decision (L1683)

> Determine if an SOD (Service Order Data) order should be issued for this cancelled detail.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `result = judgeHakkoSod(param, handle, requestParam, resultHash, svc_kei_ucwk_no, prc_grp_cd)` [L1683] |
| 2 | IF | `result == true` [L1684] |
| 3 | SET | `sodUcwkMap = new HashMap<>()` [L1685] |
| 4 | SET | `sodUcwkMap.put("svc_kei_ucwk_no", eKK0161C190Hash.get(EKK0161A010CBSMsg1List.SVC_KEI_UCWK_NO))` |
| 5 | SET | `sodUcwkMap.put("upd_dtm", eKK0161C190Hash.get(EKK0161A010CBSMsg1List.GENE_ADD_DTM))` |
| 6 | SET | `sodUcwkMap.put(INFO_NEW_CRS_FLAG, isNewCourse)` [-> JKKHakkoSODConstCC.INFO_NEW_CRS_FLAG] |
| 7 | SET | `targetSvcKeiUcwkCnt++` [L1695 - SOD order count increment] |
| 8 | SET | `sodUcwkMap.put(TARGET_SVC_KEI_UCWK_CNT, targetSvcKeiUcwkCnt)` [-> JKKHakkoSODConstCC.TARGET_SVC_KEI_UCWK_CNT] |
| 9 | SET | `sodUcwkMap.put(INFO_AD_CHG_ADD_FLAG, isAdChgAdd)` [-> JKKHakkoSODConstCC.INFO_AD_CHG_ADD_FLAG] |
| 10 | SET | `this.sodSvcKeiUcwkList.add(sodUcwkMap)` [L1701] |

---

**Block 8.3** — [ELSE] Other Status — Skip Detail (L1705)

> Details not in active states are skipped.

| # | Type | Code |
|---|------|------|
| 1 | ELSE | `svc_kei_ucwk_stat not in 030/100/220/210` [L1705] |
| 2 | EXEC | `continue` // Skip this detail |

---

**Block 8.4** — [IF/ELSE-IF/ELSE-IF] Post-Cancellation Service-Type-Specific Processing (L1709)

> After cancelling the detail, perform service-type-specific aging ID termination.

| # | Type | Code |
|---|------|------|
| 1 | IF | `PRC_GRP_CD_TEL.equals(prc_grp_cd)` [L1709 - "10" (eo Phone)] |

**Block 8.4.1** — [CALL] eo Phone Service Detail Agreement (L1714)

> Retrieve the eo Phone service detail including phone number and SIP user ID.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0191A010SC(param, handle, requestParam, resultHash)` [L1714] |
| 2 | IF | `statusCode != 0` [L1717] |
| 3 | RETURN | `return statusCode` |
| 4 | SET | `eKK0191A010Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0191A010)` [-> "EKK0191A010"] |
| 5 | SET | `telno = eKK0191A010Hash.get(EKK0191A010CBSMsg1List.TELNO)` [L1722] |
| 6 | SET | `bmpUm = eKK0191A010Hash.get(EKK0191A010CBSMsg1List.BMP_UM)` [L1727] |
| 7 | IF | `telno != null && !"".equals(telno)` [L1730] |
| 8 | SET | `this.dslTelnoList.add(telno)` [L1733 - Phone number tracking for updates] |
| 9 | SET | `telnoPortoutUm = getTelnPortoutUm(handle, param, telno)` [L1738 - Check port-out status] |
| 10 | IF | `!BMP_UM_1.equals(bmpUm) && !PORTOUT_ARI.equals(telnoPortoutUm)` [L1745] |
| 11 |  | `[BMP_UM_1 = "bmp_um_1" (has phone number), PORTOUT_ARI = "1" (port-out)]` |
| 12 | SET | `requestParam.put(AGING_SBT_CD, AGING_SBT_CD_TELNO)` [-> Phone number aging] |
| 13 | SET | `requestParam.put(AGING_TG_VALUE, telno)` |
| 14 | CALL | `statusCode = updateAgingUseEnd(param, handle, requestParam, resultHash)` |
| 15 | IF | `statusCode != 0` [L1752] |
| 16 | RETURN | `return statusCode` |

**Block 8.4.2** — [IF] SIP User ID Aging (L1759)

> Mark the SIP user ID as usage-ended if present.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sip_user_id = eKK0191A010Hash.get(EKK0191A010CBSMsg1List.SIP_USER_ID)` [L1759] |
| 2 | IF | `null != sip_user_id && 0 < sip_user_id.length()` [L1760] |
| 3 | SET | `requestParam.put(AGING_SBT_CD, AGING_SBT_CD_SIP_ID)` [-> SIP User ID aging] |
| 4 | SET | `requestParam.put(AGING_TG_VALUE, sip_user_id)` |
| 5 | CALL | `statusCode = updateAgingUseEnd(param, handle, requestParam, resultHash)` |
| 6 | IF | `statusCode != 0` [L1766] |
| 7 | RETURN | `return statusCode` |

**Block 8.4.3** — [ELSE-IF] Net Home/Mezo/Mansion (L1770)

> For eo Net services, store linked detail numbers and mark ISP auth ID as usage-ended.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `PRC_GRP_CD_NET_HM="02" \|\| PRC_GRP_CD_NET_MZ="03" \|\| PRC_GRP_CD_NET_MN="04"` [L1770] |
| 2 | SET | `sjishoSvcKeiUcwk.add(eKK0161A010Hash.get(SVC_KEI_UCWK_NO))` |
| 3 | CALL | `statusCode = callEKK0171A010SC(param, handle, requestParam, resultHash)` [L1777 - eo Net service detail] |
| 4 | IF | `statusCode != 0` [L1780] |
| 5 | RETURN | `return statusCode` |
| 6 | SET | `isp_ninsho_id = eKK0171A010Hash.get(EKK0171A010CBSMsg1List.ISP_NINSHO_ID)` [L1787] |
| 7 | IF | `null != isp_ninsho_id && 0 < isp_ninsho_id.length()` [L1790] |
| 8 | SET | `isp_ninsho_id = JKKBpCommon.getAgingNinshoId(isp_ninsho_id)` |
| 9 | SET | `requestParam.put(AGING_SBT_CD, AGING_SBT_CD_ISP_ID)` [-> ISP auth ID aging] |
| 10 | SET | `requestParam.put(AGING_TG_VALUE, isp_ninsho_id)` |
| 11 | CALL | `statusCode = updateAgingUseEnd(param, handle, requestParam, resultHash)` |
| 12 | IF | `statusCode != 0` [L1796] |
| 13 | RETURN | `return statusCode` |

**Block 8.4.4** — [ELSE-IF] Flets (eoADSL) (L1799)

> For eoADSL (Flets), store linked detail numbers and mark ADSL auth ID as usage-ended.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `PRC_GRP_CD_FLETS.equals(prc_grp_cd)` [L1799 - "06" (eoADSL Flets)] |
| 2 | SET | `sjishoSvcKeiUcwk.add(eKK0161A010Hash.get(SVC_KEI_UCWK_NO))` |
| 3 | CALL | `statusCode = callEKK0221A010SC(param, handle, requestParam, resultHash)` [L1807 - eoADSL(Flets) service detail] |
| 4 | IF | `statusCode != 0` [L1810] |
| 5 | RETURN | `return statusCode` |
| 6 | SET | `adsl_ninsho_id = eKK0221a010Hash.get(EKK0221A010CBSMsg1List.ADSL_NINSHO_ID)` [L1815] |
| 7 | IF | `null != adsl_ninsho_id && 0 < adsl_ninsho_id.length()` [L1817] |
| 8 | SET | `adsl_ninsho_id = adsl_ninsho_id.split("@")[0]` [L1821 - Remove VR prefix if present] |
| 9 | SET | `requestParam.put(AGING_SBT_CD, AGING_SBT_CD_ADSL_ID)` [-> ADSL auth ID aging] |
| 10 | SET | `requestParam.put(AGING_TG_VALUE, adsl_ninsho_id)` |
| 11 | CALL | `statusCode = updateAgingUseEnd(param, handle, requestParam, resultHash)` |
| 12 | IF | `statusCode != 0` [L1823] |
| 13 | RETURN | `return statusCode` |

---

**Block 9** — [EXEC] Linked Data KBN Setup (L1831)

> Set linked authentication ID data for SJISHO (address-linked) contracts. Marks auth IDs for deletion.

| # | Type | Code |
|---|------|------|
| 1 | SET | `v1 = new String[sjishoSvcKeiUcwk.size()]` [L1831] |
| 2 | EXEC | `JKKBpCommon.putAxMRenkeiDataKbn(param, JKKDslRunConstCC.SJISHO_MAP, JKKAddSjishoConst.RENKEI_DATA_KBN_NINSHO_ID, JKKAddSjishoConst.TRN_KBN_DEL, sjishoSvcKeiUcwk.toArray(v1), sysid)` [L1833-1839] |

---

**Block 10** — [IF] Netflix Cancellation (ANK-3949) (L1843)

> If the service code is "01" (Internet), execute Netflix business contract cancellation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcCd = eKK0081A010Hash.get(EKK0081A010CBSMsg1List.SVC_CD)` [L1843] |
| 2 | IF | `SVC_CD_NET.equals(svcCd)` [L1846 - "01" (Internet)] |
| 3 | SET | `NetflixCC = new JKKNetflixTajgsKeiIdtslAddCC()` [L1849] |
| 4 | SET | `this.mapper.setNetflixCC(param, eKK0081A010Hash.get(SVC_KEI_NO))` [L1851] |
| 5 | EXEC | `NetflixCC.main(handle, param, "NETFLIXCC")` [L1853 - Netflix business contract cancellation] |

---

**Block 11** — [RETURN] Final Return (L1857)

> Forced cancellation completed successfully.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return 0` [L1857] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `kyosei kaiyaku` / 強制解約 | Business term | Forced cancellation — termination of service contracts due to reasons such as non-payment of bills, initiated unilaterally by the provider |
| `prc_grp_cd` / 料金グループコード | Field | Pricing group code — classifies the service by billing category (e.g., "05"=eoADSL/eAccess, "10"=eo Phone, "02"=eo Home Net) |
| `svc_kei_no` / サービス契約番号 | Field | Service contract number — unique identifier for a service contract |
| `svc_kei_ucwk_no` / サービス契約内訳番号 | Field | Service contract detail number — identifier for individual line items within a service contract |
| `svc_kei_ucwk_stat` / サービス契約内訳ステータス | Field | Service contract detail status — current state of a contract detail (030=Settled, 100=In Service, 220=Suspended, 210=Stopped, 910=Cancelled) |
| `sod_svc_kei_ucwk_list` / SODCC用サービス契約内訳番号リスト | Field | List for SOD (Service Order Data) processing — tracks service details requiring SOD order issuance after cancellation |
| `ido_div` / 移動区分 | Field | Move/division code — indicates the type of service change (00009=Course Change, 00011=Reinstallation, 00064=Address Change Add) |
| `kahi_flg` / 加味フラグ | Field | Consideration flag — "1" indicates a number-change-among-process state for phone numbers |
| `is_now_adchg_flg` / 住所変更中フラグ | Field | Address-change-in-progress flag — indicates whether the customer is currently undergoing an address change |
| `AGING_SBT_CD` / エージング種類 | Field | Aging type code — classifies what type of authentication/resource is being managed (phone number, PPP ID, SIP ID, ISP auth ID, ADSL auth ID) |
| `AGING_TG_VALUE` / エージング対象値 | Field | Aging target value — the actual value (e.g., phone number, auth ID) to mark as usage-ended |
| `getAgingNinshoId` / エージング認証ID | Method | Method that resolves VR (Virtual Router) prefix from authentication IDs |
| `updateAgingUseEnd` / エージング使用終了 | Method | Updates aging records to mark a resource as no longer in use |
| `SHORI_CD_DSL_STP_PAUSE` / 処理コードDSL停止一時 | Constant | "4" — DSL Stop/Pause process code for Skiper key info |
| `OPE_DIV_DSL` / 演習区分DSL | Constant | "1" — Operation division code for DSL-related operations |
| `BMP_UM_1` / 番ポ有無1 | Constant | "bmp_um_1" — Key for phone number presence flag |
| `PORTOUT_ARI` / ポートアウト有 | Constant | "1" — Indicates phone number is under port-out status |
| `CC_WORK_KYOSEI_DSL` / 作業用CCワークDSL | Constant | "JKKKYOSEIDSLRUNCC" — Key for the work map in the parameter object |
| `TEMPLATE_ID_EKK0081A010` | Constant | "EKK0081A010" — Service contract agreement template ID |
| `TEMPLATE_ID_EKK0081C180` | Constant | "EKK0081C180" — Service contract cancellation template ID |
| `TEMPLATE_ID_EKK0081C260` | Constant | "EKK0081C260" — Service contract cancellation confirmation template ID |
| `TEMPLATE_ID_EKK0161A010` | Constant | "EKK0161A010" — Service contract detail agreement template ID |
| `TEMPLATE_ID_EKK0161B004` | Constant | "EKK0161B004" — Service contract detail list template ID |
| `TEMPLATE_ID_EKK0161C180` | Constant | "EKK0161C180" — Service detail cancellation template ID |
| `TEMPLATE_ID_EKK0161C190` | Constant | "EKK0161C190" — Service detail cancellation confirmation template ID |
| `TEMPLATE_ID_EKK0111A010` | Constant | "EKK0111A010" — eo Phone service detail (PPP Auth/SIP) template ID |
| `TEMPLATE_ID_EKK0171A010` | Constant | "EKK0171A010" — eo Net service detail (ISP Auth) template ID |
| `TEMPLATE_ID_EKK0191A010` | Constant | "EKK0191A010" — eo Phone service detail (telno/SIP) template ID |
| `TEMPLATE_ID_EKK0221A010` | Constant | "EKK0221A010" — eoADSL(Flets) service detail (ADSL Auth) template ID |
| `SVC_CD_NET` | Constant | "01" — Service code for Internet |
| `PRC_GRP_CD_EACCESS` | Constant | "05" — Pricing group: eoADSL (eAccess) |
| `PRC_GRP_CD_MAIL` | Constant | "16" — Pricing group: eo Mail Access |
| `PRC_GRP_CD_TEL` | Constant | "10" — Pricing group: eo Phone |
| `PRC_GRP_CD_FLETS` | Constant | "06" — Pricing group: eo Flets (eoADSL) |
| `PRC_GRP_CD_NET_HM` | Constant | "02" — Pricing group: eo Home Net |
| `PRC_GRP_CD_NET_MZ` | Constant | "03" — Pricing group: eo Mezo Net |
| `PRC_GRP_CD_NET_MN` | Constant | "04" — Pricing group: eo Mansion Net |
| `PRC_GRP_CD_TV_KCN` | Constant | "12" — Pricing group: eo TV (KCN) |
| `PRC_GRP_CD_MINEO` | Constant | "51" — Pricing group: MI NEIO |
| SOD | Acronym | Service Order Data — telecom order fulfillment entity used for service change orders |
| SODCC | Acronym | SOD Common Component — component handling SOD order issuance |
| SC | Acronym | Service Component — backend service layer component for data operations |
| CBS | Acronym | CBS (Call Back Service) — service component calling convention |
| SJISHO / 指書連連 | Acronym | Address-linked contract — contracts linked by shared address information |
| PPP | Acronym | Point-to-Point Protocol — authentication protocol for DSL connections |
| ISP | Acronym | Internet Service Provider |
| SIP | Acronym | Session Initiation Protocol — signaling protocol for VoIP calls |
| VLAN | Acronym | Virtual LAN — network segmentation |
| Skiper | Business term | Fujitsu's cable/television service management system; skiper key info refers to operational keys for TV service coordination |
| 番ポ / 番号変更 | Business term | Phone number change — number portability or number reassignment during service changes |
| BMP / 番ポ有無 | Business term | Phone number port-out presence — flag indicating if a number is involved in port-out processing |
| VOIP / SIPユーザID | Business term | SIP User ID — user identifier for SIP-based VoIP services (eo Phone) |
| VR | Acronym | Virtual Router — prefix attached to ADSL authentication IDs in some configurations |
| NETFLIXCC | Business term | Netflix Common Component — handles Netflix business contract cancellation for Internet service customers |