# Business Logic — JKKKddiKeishaInfoCC.setTelKeiSmartValueMskmKh() [143 LOC]

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

## 1. Role

### JKKKddiKeishaInfoCC.setTelKeiSmartValueMskmKh()

This method determines whether a KDDI corporate customer is eligible to apply for **Smart Value** (スマートバリュー) — a bundled telecom discount program offered by KDDI — and writes the eligibility result into the outbound message parameters (`ccMsg`). It serves as the dedicated phone-contract-specific eligibility gate within the broader KDDI customer information retrieval flow (KKK DdI Keisha Info = KDDI Subscriber Information Reference).

The method implements a **conditional-dispatch pattern** with four distinct business paths: (1) the customer has no EO Hikari phone contract at all, (2) all EO Hikari phone lines are in cancelled/cancel/inactive-Eo state, (3) the selected phone line is in suspended/interrupted status (status code "210" with a non-02 pause code), or (4) the customer has an active, applicable phone contract. Each path sets a different combination of "apply / cannot apply" flags, reason codes, and customer-facing guide messages into a working parameter map, then delegates to `getSmartValueMskmKhMap` to compute the final Smart Value eligibility result. The computed result is then written to outbound parameters (`out_prmt13`–`out_prmt21`) depending on whether the contract is in a cancel state or not.

Additionally, when the customer is eligible (non-cancel path), the method also configures EO Hikari phone numbers 1 through 4 via `setEoHikariTel1_4`, populating those fields in `ccMsg` for screen display. The method is a shared utility component called by other methods within `JKKKddiKeishaInfoCC` — specifically `getKddiKeishaInfo` and `getSmartValueMskmKh` — and is invoked as part of the standard customer information screen flow.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setTelKeiSmartValueMskmKh"])
    GET_SVC_KEI_KAISEN_UCWK_NO["Get svcKeiKaisenUcwkiNo from svcKeiData"]
    GET_EKK0191B009["getEKK0191B009 - Get EO Hikari phone contracts"]

    START --> GET_SVC_KEI_KAISEN_UCWK_NO
    GET_SVC_KEI_KAISEN_UCWK_NO --> GET_EKK0191B009

    GET_EKK0191B009 --> COND1{cAANMsgSvcKeiUcwkTel == null or length == 0}

    COND1 -->|"Yes"| BRANCH_NO_CONTRACT["Branch: No phone contract"]
    BRANCH_NO_CONTRACT --> SET_CANCEL_TRUE_1["cancelKeiFlg = true"]
    SET_CANCEL_TRUE_1 --> PUT_TEL_MSKM_FL_1["workParamKeyMap.put(KEY_TEL_MSKM_FL, KK_MSKM_FL_TEL)"]
    PUT_TEL_MSKM_FL_1 --> PUT_TEL_MSKM_RSN_1["workParamKeyMap.put(KEY_TEL_MSKM_RSN, KK_MKM_FL_RSN_T_NON)"]
    PUT_TEL_MSKM_RSN_1 --> PUT_TEL_GUIDE_1["workParamKeyMap.put(KEY_TEL_GUIDE, KK_CUST_GUIDE_T_NON)"]
    PUT_TEL_GUIDE_1 --> GET_CD_NM["getEZM0171A010 - Get code name management"]
    GET_CD_NM --> PUT_OUT_PRMT16["ccMsg.put(out_prmt16, code_name)"]

    COND1 -->|"No"| BRANCH_HAS_CONTRACT["Branch: Has phone contract"]
    BRANCH_HAS_CONTRACT --> CALL_ISALL["isAllCancel - Check if all cancelled"]

    CALL_ISALL --> COND2{isAllCancel == true}

    COND2 -->|"Yes"| BRANCH_ALL_CANCEL["Branch: All cancelled / Cancel / Inactive EO"]
    BRANCH_ALL_CANCEL --> SET_CANCEL_TRUE_2["cancelKeiFlg = true"]
    SET_CANCEL_TRUE_2 --> PUT_TEL_MSKM_FL_2["workParamKeyMap.put(KEY_TEL_MSKM_FL, KK_MSKM_FL_TEL)"]
    PUT_TEL_MSKM_FL_2 --> PUT_TEL_MSKM_RSN_2["workParamKeyMap.put(KEY_TEL_MSKM_RSN, KK_MKM_FL_RSN_T_DSL)"]
    PUT_TEL_MSKM_RSN_2 --> PUT_TEL_GUIDE_2["workParamKeyMap.put(KEY_TEL_GUIDE, KK_CUST_GUIDE_T_DSL)"]
    PUT_TEL_GUIDE_2 --> SET_TARGET_2["targetSvcKeiUcwkTel = cAANMsgSvcKeiUcwkTel[0]"]

    COND2 -->|"No"| BRANCH_ACTIVE["Branch: Active contract exists"]
    BRANCH_ACTIVE --> GET_TARGET["getTargetSvcKeiUcwk - Get target service contract line"]
    GET_TARGET --> GET_STATUS["Get SVC_KEI_UCWK_STAT"]
    GET_STATUS --> GET_PAUSE["Get PAUSE_STP_CD"]

    GET_PAUSE --> COND3{"status == 210 && pauseStpCd != 02"}

    COND3 -->|"Yes"| BRANCH_SUSPENDED["Branch: Status=210 with non-02 pause code"]
    BRANCH_SUSPENDED --> SET_CANCEL_TRUE_3["cancelKeiFlg = true"]
    SET_CANCEL_TRUE_3 --> PUT_TEL_MSKM_FL_3["workParamKeyMap.put(KEY_TEL_MSKM_FL, KK_MSKM_FL_TEL)"]
    PUT_TEL_MSKM_FL_3 --> PUT_TEL_MSKM_RSN_3["workParamKeyMap.put(KEY_TEL_MSKM_RSN, KK_MKM_FL_RSN_T_PSE)"]
    PUT_TEL_MSKM_RSN_3 --> PUT_TEL_GUIDE_3["workParamKeyMap.put(KEY_TEL_GUIDE, KK_CUST_GUIDE_T_PSE)"]

    COND3 -->|"No"| BRANCH_APPLICABLE["Branch: Application possible"]
    BRANCH_APPLICABLE --> SET_CANCEL_FALSE["cancelKeiFlg = false"]
    SET_CANCEL_FALSE --> PUT_TEL_MSKM_FL_4["workParamKeyMap.put(KEY_TEL_MSKM_FL, KK_MSKM_PSB_TEL)"]

    PUT_TEL_GUIDE_1 --> GET_KEI_JOTAI
    PUT_OUT_PRMT16 --> GET_KEI_JOTAI
    SET_TARGET_2 --> GET_KEI_JOTAI
    PUT_TEL_MSKM_FL_3 --> GET_KEI_JOTAI
    PUT_TEL_MSKM_FL_4 --> GET_KEI_JOTAI

    GET_KEI_JOTAI["getTelKeiyakuJotai - Get phone contract status"] --> COND4{cancelKeiFlg == true}

    COND4 -->|"Yes"| BRANCH_CANCEL_SET["Set outbound parameters 13-15 and 16-17"]
    BRANCH_CANCEL_SET --> SET_KEI_JOTAI_16["ccMsg.put(out_prmt16, keiJotai)"]
    SET_KEI_JOTAI_16 --> SET_TELNO["ccMsg.put(out_prmt17, telNo)"]

    COND4 -->|"No"| BRANCH_APPLICABLE_SET["Set outbound parameters 21 and EO Hikari 1-4"]
    BRANCH_APPLICABLE_SET --> SET_KEI_JOTAI_21["ccMsg.put(out_prmt21, keiJotai)"]
    SET_KEI_JOTAI_21 --> CALL_SET_EO["setEoHikariTel1_4 - Set EO Hikari phone 1-4"]

    SET_TELNO --> GET_SMART_VALUE["getSmartValueMskmKhMap - Get SmartValue eligibility"]
    CALL_SET_EO --> GET_SMART_VALUE

    GET_SMART_VALUE --> COND5{cancelKeiFlg == true}

    COND5 -->|"Yes"| SET_OUT_13_15["ccMsg.put(out_prmt13-15) from telMskmMap"]

    COND5 -->|"No"| SET_OUT_18_20["ccMsg.put(out_prmt18-20) from telMskmMap"]

    SET_OUT_13_15 --> END_NODE(["Return / Next"])
    SET_OUT_18_20 --> END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle used for executing service component calls (e.g., `getEKK0191B009`, `getEZM0171A010`, `getTelKeiyakuJotai`). Provides the transactional context for DB reads. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object carrying inbound screen data. Used as the context object passed to SC calls and internal method delegations. |
| 3 | `fixedText` | `String` | A fixed-key string used as a map key to retrieve or store data within `param`. It acts as a namespace partition within the request parameter map (e.g., `param.getData(fixedText)`). |
| 4 | `ccMsg` | `HashMap<String, Object>` | The outbound message map — the central output carrier. All eligibility flags, customer guide messages, phone contract status, phone numbers, and Smart Value results are written into this map. Key names include `out_prmt13` through `out_prmt21`, `out_prmt16`, and `out_prmt21`. |
| 5 | `svcKeiData` | `CAANMsg` | Service contract data message containing the service contract number (`SVC_KEI_NO`) and the service contract line-internal detail number (`SVC_KEI_KAISEN_UCWK_NO`). This is the primary data source from which the method retrieves the target service contract line identifier. |

**Instance fields / external state read:**

| Field / External State | Description |
|------------------------|-------------|
| `KK_MSKM_FL_TEL` (static constant) | Smart Value "cannot apply (phone)" flag value: `"KK_MSKM_FL_TEL"` [-> `KK_MSKM_FL_TEL="KK_MSKM_FL_TEL" (JKKKddiKeishaInfoCC.java:292)] |
| `KK_MSKM_PSB_TEL` (static constant) | Smart Value "applicable (phone)" flag value: `"KK_MSKM_PSB_TEL"` [-> `KK_MSKM_PSB_TEL="KK_MSKM_PSB_TEL" (JKKKddiKeishaInfoCC.java:290)] |
| `KK_MKM_FL_RSN_T_NON` (static constant) | "Cannot apply reason (phone, no contract)": `"KK_MKM_FL_RSN_T_NON"` [-> `KK_MKM_FL_RSN_T_NON="KK_MKM_FL_RSN_T_NON" (JKKKddiKeishaInfoCC.java:272)] |
| `KK_MKM_FL_RSN_T_DSL` (static constant) | "Cannot apply reason (phone, cancelled)": `"KK_MKM_FL_RSN_T_DSL"` [-> `KK_MKM_FL_RSN_T_DSL="KK_MKM_FL_RSN_T_DSL" (JKKKddiKeishaInfoCC.java:274)] |
| `KK_MKM_FL_RSN_T_PSE` (static constant) | "Cannot apply reason (phone, suspended)": `"KK_MKM_FL_RSN_T_PSE"` [-> `KK_MKM_FL_RSN_T_PSE="KK_MKM_FL_RSN_T_PSE" (JKKKddiKeishaInfoCC.java:276)] |
| `KK_CUST_GUIDE_T_NON` (static constant) | "Customer guide (phone, no contract)": `"KK_CUST_GUIDE_T_NON"` [-> `KK_CUST_GUIDE_T_NON="KK_CUST_GUIDE_T_NON" (JKKKddiKeishaInfoCC.java:278)] |
| `KK_CUST_GUIDE_T_DSL` (static constant) | "Customer guide (phone, cancelled)": `"KK_CUST_GUIDE_T_DSL"` [-> `KK_CUST_GUIDE_T_DSL="KK_CUST_GUIDE_T_DSL" (JKKKddiKeishaInfoCC.java:280)] |
| `KK_CUST_GUIDE_T_PSE` (static constant) | "Customer guide (phone, suspended)": `"KK_CUST_GUIDE_T_PSE"` [-> `KK_CUST_GUIDE_T_PSE="KK_CUST_GUIDE_T_PSE" (JKKKddiKeishaInfoCC.java:282)] |
| `KEY_TEL_MSKM_FL` (static constant) | Map key for "phone Smart Value apply/non-apply flag": `"KEY_TEL_MSKM_FL"` [-> `KEY_TEL_MSKM_FL="KEY_TEL_MSKM_FL" (JKKKddiKeishaInfoCC.java:300)] |
| `KEY_TEL_MSKM_RSN` (static constant) | Map key for "phone Smart Value cannot apply reason": `"KEY_TEL_MSKM_RSN"` [-> `KEY_TEL_MSKM_RSN="KEY_TEL_MSKM_RSN" (JKKKddiKeishaInfoCC.java:302)] |
| `KEY_TEL_GUIDE` (static constant) | Map key for "phone Smart Value customer guide": `"KEY_TEL_GUIDE"` [-> `KEY_TEL_GUIDE="KEY_TEL_GUIDE" (JKKKddiKeishaInfoCC.java:304)] |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `getEKK0191B009` | EKK0191B009SC | Service contract line table (EO Hikari phone) | Retrieves the list of EO Hikari phone contracts for the given service contract line-internal detail number. Returns `CAANMsg[]` array of contract details. |
| R | `getEZM0171A010` | EZM0171A010SC | Master code management table (CD01537) | Looks up the code name for code division `"CD01537"` with sort key `"000"`. Returns the human-readable code name for `out_prmt16`. |
| R | `getTargetSvcKeiUcwk` | (internal) | - | Selects the target service contract line from the array of EO Hikari phone contracts when a valid contract exists. |
| R | `getTelKeiyakuJotai` | (internal) | - | Retrieves the phone contract status information (状態) for the target contract line. Modified in v31.01.00 (ANK-3136-00-00) to accept `svcKeiData` parameter. |
| R | `getSmartValueMskmKhMap` | (internal) | - | Computes the final Smart Value eligibility map by combining the work parameter key map (containing flag, reason, guide) with the handle/context. Returns `HashMap<String, Object>`. |
| R | `getNullToStr` | (internal utility) | - | Null-safe string conversion utility. Converts `null` values to empty strings to prevent NPE in downstream operations. Called extensively across all parameters. |
| - | `isAllCancel` | (internal) | - | Determines whether all EO Hikari phone contract lines in the array are in a cancelled, cancel, or inactive-Eo state. Modified in v31.00.00 (ANK-3136-00-00) to accept `svcKeiData` parameter. |
| - | `setEoHikariTel1_4` | (internal) | - | Sets EO Hikari phone numbers 1 through 4 into `ccMsg` when the customer has an active, applicable phone contract. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `JKKKddiKeishaInfoCC.getKddiKeishaInfo()` | `getKddiKeishaInfo` -> `setTelKeiSmartValueMskmKh` | `getEKK0191B009 [R]`, `getEZM0171A010 [R]`, `isAllCancel [-]`, `getTargetSvcKeiUcwk [R]`, `getTelKeiyakuJotai [R]`, `getSmartValueMskmKhMap [R]`, `setEoHikariTel1_4 [-]`, `getNullToStr [R]` |
| 2 | Method: `JKKKddiKeishaInfoCC.getSmartValueMskmKh()` | `getSmartValueMskmKh` -> `setTelKeiSmartValueMskmKh` | `getEKK0191B009 [R]`, `getEZM0171A010 [R]`, `isAllCancel [-]`, `getTargetSvcKeiUcwk [R]`, `getTelKeiyakuJotai [R]`, `getSmartValueMskmKhMap [R]`, `setEoHikariTel1_4 [-]`, `getNullToStr [R]` |

**Note:** No screen/batch entry points (KKSV*) were found within 8 hops of this method. It is exclusively called internally by sibling methods within `JKKKddiKeishaInfoCC`, which themselves are called by CBS/SC classes invoked from screens.

## 6. Per-Branch Detail Blocks

### Block 1 — SETUP: Initialize working state (L2494–L2501)

> Initialize a working boolean flag and a parameter map. The `svcKeiKaisenUcwkiNo` is extracted from the incoming `svcKeiData` message — this is the service contract line internal detail number used to query EO Hikari phone contracts.

| # | Type | Code |
|---|------|------|
| 1 | SET | `cancelKeiFlg = false` // Initialize cancellation flag to false |
| 2 | SET | `workParamKeyMap = new HashMap<String, String>()` // Create working parameter key map |
| 3 | SET | `svcKeiKaisenUcwkiNo = getNullToStr(svcKeiData.getString(EKK0251B005CBSMsg1List.SVC_KEI_KAISEN_UCWK_NO))` // Get service contract line internal detail number [-> `EKK0251B005CBSMsg1List.SVC_KEI_KAISEN_UCWK_NO`] |

---

### Block 2 — IF: No EO Hikari phone contract (L2503–L2522)

> **[Condition]:** `cAANMsgSvcKeiUcwkTel == null || cAANMsgSvcKeiUcwkTel.length == 0`
> 
> The customer has no EO Hikari phone contract line. In this case, Smart Value application is NOT possible (flag = `KK_MSKM_FL_TEL`), reason is "no contract" (`KK_MKM_FL_RSN_T_NON`), and a customer guide is set. Additionally, the code name management lookup is performed to resolve the contract status code for display.

| # | Type | Code |
|---|------|------|
| 1 | SET | `cancelKeiFlg = true` // Mark as cancellation state |
| 2 | CALL | `workParamKeyMap.put(KEY_TEL_MSKM_FL, KK_MSKM_FL_TEL)` // Set flag: cannot apply (phone) [-> `KEY_TEL_MSKM_FL="KEY_TEL_MSKM_FL" (JKKKddiKeishaInfoCC.java:300)`, `KK_MSKM_FL_TEL="KK_MSKM_FL_TEL" (JKKKddiKeishaInfoCC.java:292)`] |
| 3 | CALL | `workParamKeyMap.put(KEY_TEL_MSKM_RSN, KK_MKM_FL_RSN_T_NON)` // Set reason: no contract [-> `KEY_TEL_MSKM_RSN="KEY_TEL_MSKM_RSN" (JKKKddiKeishaInfoCC.java:302)`, `KK_MKM_FL_RSN_T_NON="KK_MKM_FL_RSN_T_NON" (JKKKddiKeishaInfoCC.java:272)`] |
| 4 | CALL | `workParamKeyMap.put(KEY_TEL_GUIDE, KK_CUST_GUIDE_T_NON)` // Set guide: no contract [-> `KEY_TEL_GUIDE="KEY_TEL_GUIDE" (JKKKddiKeishaInfoCC.java:304)`, `KK_CUST_GUIDE_T_NON="KK_CUST_GUIDE_T_NON" (JKKKddiKeishaInfoCC.java:278)`] |
| 5 | CALL | `cAANMsgCdNmKanri = getEZM0171A010(handle, param, fixedText, "CD01537", "000")` // Look up code name management [-> code division `"CD01537"`, sort key `"000"`] |
| 6 | CALL | `ccMsg.put("out_prmt16", getNullToStr(cAANMsgCdNmKanri.getString(EZM0171A010CBSMsg1List.CD_DIV_NM)))` // Set outbound parameter 16 with code name [-> `EZM0171A010CBSMsg1List.CD_DIV_NM`] |

---

### Block 3 — ELSE: Has EO Hikari phone contract (L2525–L2603)

> **[Condition]:** `cAANMsgSvcKeiUcwkTel != null && cAANMsgSvcKeiUcwkTel.length > 0`
> 
> The customer has at least one EO Hikari phone contract. The method now determines whether all lines are cancelled or if there is an active line eligible for Smart Value application.

#### Block 3.1 — IF: All contracts are cancelled (L2534–L2546)

> **[Condition]:** `isAllCancel(handle, param, fixedText, cAANMsgSvcKeiUcwkTel, svcKeiData) == true`
> 
> (ANK-3136-00-00 MOD: signature extended to accept `svcKeiData` as a 5th parameter)
> 
> All EO Hikari phone contract lines are in a cancelled, cancel, or inactive-Eo state. Smart Value application is NOT possible.

| # | Type | Code |
|---|------|------|
| 1 | SET | `cancelKeiFlg = true` // Mark as cancellation state |
| 2 | CALL | `workParamKeyMap.put(KEY_TEL_MSKM_FL, KK_MSKM_FL_TEL)` // Cannot apply (phone) [-> `KEY_TEL_MSKM_FL="KEY_TEL_MSKM_FL" (JKKKddiKeishaInfoCC.java:300)`, `KK_MSKM_FL_TEL="KK_MSKM_FL_TEL" (JKKKddiKeishaInfoCC.java:292)`] |
| 3 | CALL | `workParamKeyMap.put(KEY_TEL_MSKM_RSN, KK_MKM_FL_RSN_T_DSL)` // Reason: cancelled [-> `KEY_TEL_MSKM_RSN="KEY_TEL_MSKM_RSN" (JKKKddiKeishaInfoCC.java:302)`, `KK_MKM_FL_RSN_T_DSL="KK_MKM_FL_RSN_T_DSL" (JKKKddiKeishaInfoCC.java:274)`] |
| 4 | CALL | `workParamKeyMap.put(KEY_TEL_GUIDE, KK_CUST_GUIDE_T_DSL)` // Guide: cancelled [-> `KEY_TEL_GUIDE="KEY_TEL_GUIDE" (JKKKddiKeishaInfoCC.java:304)`, `KK_CUST_GUIDE_T_DSL="KK_CUST_GUIDE_T_DSL" (JKKKddiKeishaInfoCC.java:280)`] |
| 5 | SET | `targetSvcKeiUcwkTel = cAANMsgSvcKeiUcwkTel[0]` // Take first contract line for subsequent status lookup |

#### Block 3.2 — ELSE-IF: Active contract exists — check status (L2548–L2560)

> **[Condition]:** `isAllCancel(...) == false`
> 
> There is at least one non-cancelled contract. Get the target contract line and evaluate its status.

##### Block 3.2.1 — Get status and pause code (L2552–L2555)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `targetSvcKeiUcwkTel = getTargetSvcKeiUcwk(cAANMsgSvcKeiUcwkTel)` // Select target service contract line |
| 2 | SET | `status = getNullToStr(targetSvcKeiUcwkTel.getString(EKK0191B009CBSMsg1List.SVC_KEI_UCWK_STAT))` // Get service contract line status [-> `EKK0191B009CBSMsg1List.SVC_KEI_UCWK_STAT`] |
| 3 | SET | `pauseStpCd = getNullToStr(targetSvcKeiUcwkTel.getString(EKK0191B009CBSMsg1List.PAUSE_STP_CD))` // Get pause/stop status code [-> `EKK0191B009CBSMsg1List.PAUSE_STP_CD`] |

##### Block 3.2.2 — IF: Suspended/interrupted with non-02 pause code (L2558–L2568)

> **[Condition]:** `"210".equals(status) && !"02".equals(pauseStpCd)`
> 
> Status is "210" (suspended/interrupted — 休止中・中断中) AND the pause code is NOT "02" (which represents a special case where application may still be possible). Application is NOT possible.

| # | Type | Code |
|---|------|------|
| 1 | SET | `cancelKeiFlg = true` // Mark as cancellation state |
| 2 | CALL | `workParamKeyMap.put(KEY_TEL_MSKM_FL, KK_MSKM_FL_TEL)` // Cannot apply (phone) [-> `KK_MSKM_FL_TEL="KK_MSKM_FL_TEL" (JKKKddiKeishaInfoCC.java:292)`] |
| 3 | CALL | `workParamKeyMap.put(KEY_TEL_MSKM_RSN, KK_MKM_FL_RSN_T_PSE)` // Reason: suspended [-> `KK_MKM_FL_RSN_T_PSE="KK_MKM_FL_RSN_T_PSE" (JKKKddiKeishaInfoCC.java:276)`] |
| 4 | CALL | `workParamKeyMap.put(KEY_TEL_GUIDE, KK_CUST_GUIDE_T_PSE)` // Guide: suspended [-> `KK_CUST_GUIDE_T_PSE="KK_CUST_GUIDE_T_PSE" (JKKKddiKeishaInfoCC.java:282)`] |

##### Block 3.2.3 — ELSE: Application possible (L2570–L2575)

> **[Condition]:** Status is NOT "210" OR pause code IS "02" — meaning the line is in an active/applicable state.

| # | Type | Code |
|---|------|------|
| 1 | SET | `cancelKeiFlg = false` // Mark as applicable (non-cancellation) |
| 2 | CALL | `workParamKeyMap.put(KEY_TEL_MSKM_FL, KK_MSKM_PSB_TEL)` // Set flag: applicable (phone) [-> `KK_MSKM_PSB_TEL="KK_MSKM_PSB_TEL" (JKKKddiKeishaInfoCC.java:290)`] |

#### Block 3.3 — Get phone contract status (L2580–L2583)

> IT1-2018-0000088 MOD: `getTelKeiyakuJotai` was updated to accept `svcKeiData` as an additional 5th parameter (instead of 4), to handle cases where the contract status is "contract in process" during work-pseudo cancellation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `keiJotai = getTelKeiyakuJotai(handle, param, fixedText, ccMsg, targetSvcKeiUcwkTel, svcKeiData)` // Get phone contract status [-> IT1-2018-0000088 MOD] |

#### Block 3.4 — IF/ELSE: Set outbound parameters based on cancelKeiFlg (L2585–L2599)

##### Block 3.4.1 — IF: Cancel state (L2586–L2593)

> **[Condition]:** `cancelKeiFlg == true`
>
> Set outbound message parameters 16 (contract status code name) and 17 (phone number) for display.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `ccMsg.put("out_prmt16", keiJotai)` // Set outbound parameter 16 with phone contract status |
| 2 | SET | `telNo = getNullToStr(targetSvcKeiUcwkTel.getString(EKK0191B009CBSMsg1List.TELNO))` // Get phone number [-> `EKK0191B009CBSMsg1List.TELNO`] |
| 3 | CALL | `ccMsg.put("out_prmt17", telNo)` // Set outbound parameter 17 with phone number |

##### Block 3.4.2 — ELSE: Applicable state (L2596–L2600)

> **[Condition]:** `cancelKeiFlg == false`
>
> Set outbound message parameter 21 (contract status) and configure EO Hikari phone numbers 1–4.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `ccMsg.put("out_prmt21", keiJotai)` // Set outbound parameter 21 with phone contract status |
| 2 | CALL | `setEoHikariTel1_4(handle, param, fixedText, ccMsg, cAANMsgSvcKeiUcwkTel)` // Set EO Hikari phone numbers 1 through 4 |

---

### Block 4 — GET Smart Value eligibility map (L2605–L2607)

> After all contract evaluation is complete, compute the final Smart Value application eligibility map using the working parameter key map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `telMskmMap = getSmartValueMskmKhMap(handle, param, fixedText, ccMsg, workParamKeyMap)` // Get Smart Value application eligibility map [-> `workParamKeyMap` contains flag/reason/guide set by previous branches] |

---

### Block 5 — IF/ELSE: Write Smart Value result to ccMsg (L2609–L2623)

#### Block 5.1 — IF: Cancel state (L2610–L2616)

> **[Condition]:** `cancelKeiFlg == true`
>
> Write Smart Value eligibility results to outbound parameters 13, 14, and 15.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `ccMsg.put("out_prmt13", getNullToStr((String)telMskmMap.get(KEY_TEL_MSKM_FL)))` // Set out_prmt13: Smart Value apply/non-apply flag [-> `KEY_TEL_MSKM_FL="KEY_TEL_MSKM_FL" (JKKKddiKeishaInfoCC.java:300)`] |
| 2 | CALL | `ccMsg.put("out_prmt14", getNullToStr((String)telMskmMap.get(KEY_TEL_MSKM_RSN)))` // Set out_prmt14: Smart Value cannot apply reason [-> `KEY_TEL_MSKM_RSN="KEY_TEL_MSKM_RSN" (JKKKddiKeishaInfoCC.java:302)`] |
| 3 | CALL | `ccMsg.put("out_prmt15", getNullToStr((String)telMskmMap.get(KEY_TEL_GUIDE)))` // Set out_prmt15: Smart Value customer guide [-> `KEY_TEL_GUIDE="KEY_TEL_GUIDE" (JKKKddiKeishaInfoCC.java:304)`] |

#### Block 5.2 — ELSE: Applicable state (L2618–L2623)

> **[Condition]:** `cancelKeiFlg == false`
>
> Write Smart Value eligibility results to outbound parameters 18, 19, and 20.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `ccMsg.put("out_prmt18", getNullToStr((String)telMskmMap.get(KEY_TEL_MSKM_FL)))` // Set out_prmt18: Smart Value apply/non-apply flag [-> `KEY_TEL_MSKM_FL="KEY_TEL_MSKM_FL" (JKKKddiKeishaInfoCC.java:300)`] |
| 2 | CALL | `ccMsg.put("out_prmt19", getNullToStr((String)telMskmMap.get(KEY_TEL_MSKM_RSN)))` // Set out_prmt19: Smart Value cannot apply reason [-> `KEY_TEL_MSKM_RSN="KEY_TEL_MSKM_RSN" (JKKKddiKeishaInfoCC.java:302)`] |
| 3 | CALL | `ccMsg.put("out_prmt20", getNullToStr((String)telMskmMap.get(KEY_TEL_GUIDE)))` // Set out_prmt20: Smart Value customer guide [-> `KEY_TEL_GUIDE="KEY_TEL_GUIDE" (JKKKddiKeishaInfoCC.java:304)`] |

---

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_ucwk_no` | Field | Service contract line internal detail number — internal tracking ID for a specific service contract line item within a service contract. Used as the key to query EO Hikari phone contract details. |
| `svc_kei_no` | Field | Service contract number — the primary key identifying a customer's overall service contract. |
| `svc_kei_ucwk_stat` | Field | Service contract line status — the current state of a service contract line (e.g., "020" = completed setup, "100" = service in progress, "210" = suspended/interrupted, "910" = cancelled, "920" = cancelled). |
| `pause_stp_cd` | Field | Pause/stop status code — a sub-status code under status "210" (suspended/interrupted) indicating the specific type of suspension (e.g., "02" = special case, "01" = standard suspension). |
| `telno` | Field | Telephone number — the actual phone number assigned to an EO Hikari phone contract line. |
| `cd_div_nm` | Field | Code division name — the human-readable description of a master code from the code name management table. Used here to resolve a status code to a displayable name. |
| CD01537 | Constant | Code division identifier for phone contract status codes — the master code division looked up to display the contract status name. |
| KK_MSKM_FL_TEL | Constant | Smart Value "cannot apply" flag (phone) — the flag value indicating that Smart Value application is NOT possible for phone contracts. Value: `"KK_MSKM_FL_TEL"`. |
| KK_MSKM_PSB_TEL | Constant | Smart Value "applicable" flag (phone) — the flag value indicating that Smart Value application IS possible for phone contracts. Value: `"KK_MSKM_PSB_TEL"`. |
| KK_MKM_FL_RSN_T_NON | Constant | Smart Value cannot apply reason — phone, no contract. Value: `"KK_MKM_FL_RSN_T_NON"`. |
| KK_MKM_FL_RSN_T_DSL | Constant | Smart Value cannot apply reason — phone, cancelled. Value: `"KK_MKM_FL_RSN_T_DSL"`. |
| KK_MKM_FL_RSN_T_PSE | Constant | Smart Value cannot apply reason — phone, suspended/interrupted. Value: `"KK_MKM_FL_RSN_T_PSE"`. |
| KK_CUST_GUIDE_T_NON | Constant | Customer guide message key — phone, no contract. Used to retrieve the customer-facing explanation text. Value: `"KK_CUST_GUIDE_T_NON"`. |
| KK_CUST_GUIDE_T_DSL | Constant | Customer guide message key — phone, cancelled. Value: `"KK_CUST_GUIDE_T_DSL"`. |
| KK_CUST_GUIDE_T_PSE | Constant | Customer guide message key — phone, suspended/interrupted. Value: `"KK_CUST_GUIDE_T_PSE"`. |
| KEY_TEL_MSKM_FL | Constant | Map key — Smart Value phone apply/non-apply flag. Used as the key in `workParamKeyMap` to set the flag value. Value: `"KEY_TEL_MSKM_FL"`. |
| KEY_TEL_MSKM_RSN | Constant | Map key — Smart Value phone cannot apply reason. Value: `"KEY_TEL_MSKM_RSN"`. |
| KEY_TEL_GUIDE | Constant | Map key — Smart Value phone customer guide. Value: `"KEY_TEL_GUIDE"`. |
| out_prmt13 | Field | Outbound message parameter 13 — Smart Value phone apply/non-apply flag result. Set in cancel state. |
| out_prmt14 | Field | Outbound message parameter 14 — Smart Value phone cannot apply reason result. Set in cancel state. |
| out_prmt15 | Field | Outbound message parameter 15 — Smart Value phone customer guide result. Set in cancel state. |
| out_prmt16 | Field | Outbound message parameter 16 — phone contract status code name (from code management lookup). Set in cancel state and no-contract branch. |
| out_prmt17 | Field | Outbound message parameter 17 — phone number from the target contract line. Set in cancel state. |
| out_prmt18 | Field | Outbound message parameter 18 — Smart Value phone apply/non-apply flag result. Set in applicable state. |
| out_prmt19 | Field | Outbound message parameter 19 — Smart Value phone cannot apply reason result. Set in applicable state. |
| out_prmt20 | Field | Outbound message parameter 20 — Smart Value phone customer guide result. Set in applicable state. |
| out_prmt21 | Field | Outbound message parameter 21 — phone contract status. Set in applicable state. |
| Smart Value | Business term | Smart Value (スマートバリュー) — KDDI's bundled discount program for telecom services. Customers with qualifying phone contracts can apply for this program to receive discounted rates. |
| EO Hikari | Business term | EO Hikari (eoひかり) — KDDI's fiber-optic broadband internet service. This method specifically evaluates EO Hikari phone contracts (eo光電話) for Smart Value eligibility. |
| cancelKeiFlg | Field | Cancellation flag — internal boolean that tracks whether the customer's phone contract is in a cancel state (true) or an applicable state (false). Drives all conditional branching. |
| getEKK0191B009 | Method | Get EO Hikari phone contract lines (same line) — retrieves all EO Hikari phone contract details associated with a service contract line-internal detail number. Returns `CAANMsg[]`. |
| getEZM0171A010 | Method | Get code name management — looks up human-readable descriptions for master codes. Called here with code division `"CD01537"` and sort key `"000"` to resolve the phone contract status to a displayable name. |
| getTargetSvcKeiUcwk | Method | Get target service contract line — selects the primary/applicable service contract line from an array of EO Hikari phone contracts. |
| getTelKeiyakuJotai | Method | Get phone contract status — retrieves the phone contract status (状態) for display. Updated in v31.01.00 to handle work-pseudo cancellation scenarios. |
| getSmartValueMskmKhMap | Method | Get Smart Value application eligibility map — computes the final eligibility result by combining the working parameter key map (containing flag, reason, and guide keys/values) with the session context. |
| setEoHikariTel1_4 | Method | Set EO Hikari phone numbers 1 through 4 — populates phone number fields 1–4 in `ccMsg` for screen display when the customer has active EO Hikari phone contracts. |
| isAllCancel | Method | Check if all contracts are cancelled — determines whether all EO Hikari phone contract lines are in a cancelled, cancel, or inactive-Eo state. Updated in v31.00.00 to accept `svcKeiData` for hard-ware preservation compliance. |
| getNullToStr | Method | Null-to-string utility — null-safe conversion that returns an empty string for null inputs, preventing NullPointerException. |
| CAANMsg | Class | Customer Application ANswer Message — a message container class used throughout the system to hold structured response data from service components. |
| SessionHandle | Class | Database session handle — provides the transactional context for executing service component calls against the database. |
| IRequestParameterReadWrite | Interface | Request parameter read/write interface — the contract for accessing and modifying request-level parameters during screen processing. |
