---

# Business Logic — JKKBumpMdsCC.mappingEZM0121C010InMsg() [79 LOC]

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

## 1. Role

### JKKBumpMdsCC.mappingEZM0121C010InMsg()

This method is the **SIF (Service Interface) message builder** for the **EZM0121C010 Phone Number Change** service component in the K-Opticom customer core system. It populates a `CAANMsg` template with all the condition/data fields required to invoke the phone number change service — specifically, the scenario where a customer **retains their phone number after SIP line cancellation** (番ポ帰り, "hampokaeri" — port return). 

The method acts as a **data aggregation and mapping bridge**: it reads information from four distinct input sources — the incoming `inHash`, the carrier list lookup result (`eTU0051B010Hash`), the port-out reception info lookup result (`eTU0151A011Hash`), and the phone number unique lookup result (`eZM0121A010Hash`) — and writes them into the corresponding fields of the EZM0121C010 CBS message template.

It follows the **template builder pattern**: first it null-maps all fields to ensure every field has a value (preventing null-pointer issues downstream), then it sets fixed metadata fields (template ID, function code), and finally it populates every business field from the hash lookups. The method has **no conditional branches** of its own — it executes linearly. The branching logic (whether to invoke this method with or without port-related carrier data) is handled by the caller: `callEZM0121C010SC()` for standard number changes (no number port) and `callEZM0121C010SC_2()` for number port return scenarios (number port exists).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["mappingEZM0121C010InMsg"])
    S1["fillCAANMSGNullMapping: null-map all template fields"]
    S2["Set TEMPLATEID = EZM0121C010"]
    S3["Set FUNC_CODE = 1 (Phone Number Change)")
    S4["Set TELNO from telNo param"]
    S5["Extract 16 fields from eZM0121A010Hash: KYOKU_NO, NO_CD, WARIATE_TSJGS_CD, USE_TSJGS_CD, SVC_DIV, HKAT_SIYK_SBT_CD, HKAT_SIYK_SET_DTM, TLN_SETMEI, KOJIN_HOJIN_TLN_TAI_CD, C5_SERVER_GOKI_SKBT_CD, TELNO_TSTAYMD, TELNO_TENDYMD, NRN_NO, FIRST_WARIATE_YMD, SHK_KOJIN_HOJIN_TLN_TAI_CD, TLN_STKU_TSJGS_CD"]
    S6["Set LAST_UPD_DTM_BF from updDtm param"]
    S7["Extract ITNM_TSJGS_CD from eTU0051B010Hash (Transfer-from carrier code)"]
    S8["Extract ITNS_TSJGS_CD from eTU0151A011Hash (Transfer-to carrier code)"]
    S9["Set BMP_HAISHI_REQ_CTRL_CD = 0 (Cancellation request control: not required)"]
    END(["Return void"])

    START --> S1 --> S2 --> S3 --> S4 --> S5 --> S6 --> S7 --> S8 --> S9 --> END
```

**Processing Flow Summary:**

1. **Null-mapping**: `fillCAANMSGNullMapping()` sets every field in the template to null, ensuring no field is left unset. This is a safety measure — the downstream SC expects all fields to have explicit values (even if null) rather than missing fields.
2. **Metadata setup**: The template ID is set to `"EZM0121C010"` (resolved constant `TEMPLATE_ID_EZM0121C010`), and the function code is hardcoded to `"1"` (Phone Number Change).
3. **Phone number assignment**: The `telNo` parameter is written directly into the template's `TELNO` field.
4. **Phone number lookup data extraction**: All fields from `eZM0121A010Hash` are extracted and mapped. These represent the result of a phone number unique inquiry (EZM0121A010) executed earlier in the call chain. 16 distinct fields are extracted, covering office code, number code, carrier codes, service classification, contract info, personal/corporate designation, server identification, number retention dates, NRN number, and initial port date.
5. **Timestamp**: The `updDtm` parameter is set as the "last update datetime before" field — capturing the state of the record before this change is applied.
6. **Carrier transfer data**: The "transfer-from carrier code" (`ITNM_TSJGS_CD`) is extracted from `eTU0051B010Hash` (carrier list inquiry), and the "transfer-to carrier code" (`ITNS_TSJGS_CD`) is extracted from `eTU0151A011Hash` (port-out reception info inquiry). These fields are only populated in the number port return scenario (called via `callEZM0121C010SC_2`); when invoked via the standard path (`callEZM0121C010SC`), these hashes are available but may be empty.
7. **Cancellation control flag**: `BMP_HAISHI_REQ_CTRL_CD` is hardcoded to `"0"` meaning "cancellation request control not required" — this is a new flag introduced in change #86474 (2025/03/12) to control whether a number cancellation request is needed.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `template` | `CAANMsg` | The SIF request message template for EZM0121C010. This is a newly instantiated `CAANMsg` object created by the caller (via `new CAANMsg(EZM0121C010CBSMsg.class.getName())`). Fields are populated into this template, which is then sent to the service component. |
| 2 | `inHash` | `HashMap<String, Object>` | The incoming condition hash passed from the caller. In the current implementation, this hash is **not directly read** by this method — it is passed through to support future extensibility. The null-mapping uses `EZM0121C010CBSMsg.getContents()` instead. |
| 3 | `eTU0051B010Hash` | `HashMap<String, Object>` | Result of the **carrier list inquiry** (ETU0051B010 SC). Contains the "transfer-from carrier code" (`TSJGS_CD`). Populated when the phone number has no number port (番ポなし path). |
| 4 | `eTU0151A011Hash` | `HashMap<String, Object>` | Result of the **port-out reception info unique inquiry** (ETU0151A011 SC — Service Contract Inquiry). Contains the "transfer-to carrier code" (`ITENS_JIGYOSHA_NO`). Populated for both port and non-port scenarios. |
| 5 | `eZM0121A010Hash` | `HashMap<String, Object>` | Result of the **phone number unique inquiry** (EZM0121A010 SC). Contains all phone-number-specific data: office code, number code, carrier codes, service classification, contract info, personal/corporate designation, server info, retention dates, NRN number, etc. This is the primary data source for the method. |
| 6 | `telNo` | `String` | The **phone number** being changed. Used directly as the `TELNO` field value in the template. |
| 7 | `updDtm` | `String` | The **last update datetime (before change)** in YYYYMMDDHHmmss format. Represents the state of the record immediately before this phone number change operation is applied. |

**No instance fields or external state** are read by this method. It is a pure data-mapping function that operates entirely on its parameters.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKBumpMdsCC.fillCAANMSGNullMapping` | - | - | Calls `fillCAANMSGNullMapping` within `JKKBumpMdsCC` — iterates through all template field keys and sets each to null in the message |
| - | `EZM0121C010CBSMsg.getContents` | - | - | Gets the list of field keys from the EZM0121C010 CBS message class to iterate over for null-mapping |

**Note:** This method performs **no actual database or service component calls**. It is purely a **data mapper** — it reads from `HashMap` parameters (in-memory data structures populated by previous SC calls in the call chain) and writes to a `CAANMsg` template. The actual database reads are performed by the SC calls executed by the caller (`callEZM0121C010SC` or `callEZM0121C010SC_2`): `EZM0121A010`, `ETU0051B010`, and `ETU0151A011`.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CC: `callEZM0121C010SC` | `executeBumpMds` -> `callEZM0121C010SC` -> `mappingEZM0121C010InMsg` | `fillCAANMSGNullMapping [-]`, `EZM0121A010 [R]`, `ETU0051B010 [R]`, `ETU0151A011 [R]` |
| 2 | CC: `callEZM0121C010SC_2` | `executeBumpMds` -> `callEZM0121C010SC_2` -> `mappingEZM0121C010InMsg_2` | `fillCAANMSGNullMapping [-]`, `EZM0121A010 [R]` |

**Caller details:**

- **`callEZM0121C010SC`** (JKKBumpMdsCC.java, line ~1794): The standard phone number change caller used when the phone number does **not** have a number port (番ポなし). It first calls `ETU0051B010` (carrier list inquiry), then passes all three hash objects (`eTU0051B010Hash`, `eTU0151A011Hash`, `eZM0121A010Hash`) to this method.
- **`callEZM0121C010SC_2`** (JKKBumpMdsCC.java, line ~1854): The number port return phone number change caller used when the phone number **has** a number port (番ポあり / BMP_1). It calls a variant of this method (`mappingEZM0121C010InMsg_2`) with a reduced parameter set (no `inHash`, no `eTU0051B010Hash`, no `eTU0151A011Hash`).

**Full entry point chain:**
`executeBumpMds` (番ポ帰り実行メソッド / Port Return Execution Method) is the public entry point in `JKKBumpMdsCC` that orchestrates the entire port return process — including SOD issuance checks, status validations, and conditional branching on `BMP_1` (number port existence) — and eventually reaches this method via either `callEZM0121C010SC` or `callEZM0121C010SC_2`.

## 6. Per-Branch Detail Blocks

Since this method has no conditional branches (it is a linear sequence of `template.set()` calls), there is a single processing block:

### Block 1 — LINEAR EXECUTION (L2652–L2730)

> Null-mapping, metadata setup, and field-by-field data population from hash lookups.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `fillCAANMSGNullMapping(template, new EZM0121C010CBSMsg().getContents())` | Null-map all template fields. Uses `EZM0121C010CBSMsg.getContents()` to get the list of field keys. [-> Null-mapping safety pattern] |
| 2 | SET | `template.set(EZM0121C010CBSMsg.TEMPLATEID, TEMPLATE_ID_EZM0121C010)` | Set template ID to `"EZM0121C010"` (SIF identifier). [-> `TEMPLATE_ID_EZM0121C010 = "EZM0121C010"`] |
| 3 | SET | `template.set(EZM0121C010CBSMsg.FUNC_CODE, "1")` | Set function code to `"1"` — Phone Number Change (電話番号変更). [-> Hardcoded] |
| 4 | SET | `template.set(EZM0121C010CBSMsg.TELNO, telNo)` | Set the phone number from parameter. [-> Direct assignment] |
| 5 | SET | `template.set(EZM0121C010CBSMsg.KYOKU_NO, (String)eZM0121A010Hash.get(EZM0121A010CBSMsg1List.KYOKU_NO))` | Set office code (局番) — the prefix digits of the phone number. |
| 6 | SET | `template.set(EZM0121C010CBSMsg.NO_CD, (String)eZM0121A010Hash.get(EZM0121A010CBSMsg1List.NO_CD))` | Set number code (番号コード) — the middle segment of the phone number. |
| 7 | SET | `template.set(EZM0121C010CBSMsg.WARIATE_TSJGS_CD, (String)eZM0121A010Hash.get(EZM0121A010CBSMsg1List.WARIATE_TSJGS_CD))` | Set assigned carrier code (割当通信事業者コード) — the carrier assigned to the number. |
| 8 | SET | `template.set(EZM0121C010CBSMsg.USE_TSJGS_CD, (String)eZM0121A010Hash.get(EZM0121A010CBSMsg1List.USE_TSJGS_CD))` | Set used carrier code (使用通信事業者コード) — the carrier currently providing the service. |
| 9 | SET | `template.set(EZM0121C010CBSMsg.SVC_DIV, (String)eZM0121A010Hash.get(EZM0121A010CBSMsg1List.SVC_DIV))` | Set service classification (サービス区分). |
| 10 | SET | `template.set(EZM0121C010CBSMsg.HKAT_SIYK_SBT_CD, (String)eZM0121A010Hash.get(EZM0121A010CBSMsg1List.HKAT_SIYK_SBT_CD))` | Set contract type code (引当契約種別コード). |
| 11 | SET | `template.set(EZM0121C010CBSMsg.HKAT_SIYK_SET_DTM, (String)eZM0121A010Hash.get(EZM0121A010CBSMsg1List.HKAT_SIYK_SET_DTM))` | Set contract set datetime (引当契約設定年月日時分秒). |
| 12 | SET | `template.set(EZM0121C010CBSMsg.TLN_SETMEI, (String)eZM0121A010Hash.get(EZM0121A010CBSMsg1List.TLN_SETMEI))` | Set phone number description (電話番号説明). |
| 13 | SET | `template.set(EZM0121C010CBSMsg.KOJIN_HOJIN_TLN_TAI_CD, (String)eZM0121A010Hash.get(EZM0121A010CBSMsg1List.KOJIN_HOJIN_TLN_TAI_CD))` | Set personal/corporate phone number carrier code (個人法人電話番号帯コード). |
| 14 | SET | `template.set(EZM0121C010CBSMsg.C5_SERVER_GOKI_SKBT_CD, (String)eZM0121A010Hash.get(EZM0121A010CBSMsg1List.C5_SERVER_GOKI_SKBT_CD))` | Set S5 server machine identification code (#5サーバ号機識別コード). |
| 15 | SET | `template.set(EZM0121C010CBSMsg.TELNO_TSTAYMD, (String)eZM0121A010Hash.get(EZM0121A010CBSMsg1List.TELNO_TSTAYMD))` | Set number retention start date (電話番号適用開始年月日). |
| 16 | SET | `template.set(EZM0121C010CBSMsg.TELNO_TENDYMD, (String)eZM0121A010Hash.get(EZM0121A010CBSMsg1List.TELNO_TENDYMD))` | Set number retention end date (電話番号適用終了年月日). |
| 17 | SET | `template.set(EZM0121C010CBSMsg.NRN_NO, (String)eZM0121A010Hash.get(EZM0121A010CBSMsg1List.NRN_NO))` | Set NRN number (N.R.N番号 — Number Retention Number). |
| 18 | SET | `template.set(EZM0121C010CBSMsg.FIRST_WARIATE_YMD, (String)eZM0121A010Hash.get(EZM0121A010CBSMsg1List.FIRST_WARIATE_YMD))` | Set initial assignment date (初回割当年月日). |
| 19 | SET | `template.set(EZM0121C010CBSMsg.LAST_UPD_DTM_BF, updDtm)` | Set last update datetime before change from parameter. [-> Direct assignment] |
| 20 | SET | `template.set(EZM0121C010CBSMsg.SHK_KOJIN_HOJIN_TLN_TAI_CD, (String)eZM0121A010Hash.get(EZM0121A010CBSMsg1List.SHK_KOJIN_HOJIN_TLN_TAI_CD))` | Set initial personal/corporate phone number carrier code (初期個人法人電話番号帯コード). |
| 21 | SET | `template.set(EZM0121C010CBSMsg.TLN_STKU_TSJGS_CD, (String)eZM0121A010Hash.get(EZM0121A010CBSMsg1List.TLN_STKU_TSJGS_CD))` | Set phone number acquisition carrier code (電話番号取得通信事業者コード). |
| 22 | SET | `template.set(EZM0121C010CBSMsg.ITNM_TSJGS_CD, (String)eTU0051B010Hash.get(ETU0051B010CBSMsg1List.TSJGS_CD))` | Set transfer-from carrier code (移転元通信事業者コード) from carrier list lookup. [-> Only populated in non-port path] |
| 23 | SET | `template.set(EZM0121C010CBSMsg.ITNS_TSJGS_CD, (String)eTU0151A011Hash.get(ETU0151A011CBSMsg1List.ITENS_JIGYOSHA_NO))` | Set transfer-to carrier code (移転先通信事業者コード) from port-out reception inquiry. [-> Only populated in port path] |
| 24 | SET | `template.set(EZM0121C010CBSMsg.BMP_HAISHI_REQ_CTRL_CD, "0")` | Set cancellation request control code to `"0"` (not required). [-> Hardcoded via change #86474, 2025/03/12] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mappingEZM0121C010InMsg` | Method | EZM0121C010 inbound message builder — populates the CAANMsg template for the phone number change service |
| `EZM0121C010` | Service Code | Phone Number Change (電話番号変更) — the core service for changing a customer's phone number during port return |
| `TEMPLATE_ID_EZM0121C010` | Constant | Template identifier `"EZM0121C010"` — SIF (Service Interface) template ID for the phone number change message |
| `FUNC_CODE` | Field | Function code — `"1"` means Phone Number Change (電話番号変更) |
| `TELNO` | Field | Telephone number (電話番号) — the phone number being changed |
| `KYOKU_NO` | Field | Office code (局番) — the prefix digits of the Japanese phone number (e.g., "03" for Tokyo) |
| `NO_CD` | Field | Number code (番号コード) — the middle segment of the phone number |
| `WARIATE_TSJGS_CD` | Field | Assigned carrier code (割当通信事業者コード) — the carrier to which the phone number is assigned |
| `USE_TSJGS_CD` | Field | Used carrier code (使用通信事業者コード) — the carrier currently providing the service |
| `SVC_DIV` | Field | Service classification (サービス区分) — classifies the type of service (e.g., FTTH, Mail, ENUM) |
| `HKAT_SIYK_SBT_CD` | Field | Contract type code (引当契約種別コード) — the type of contract associated with the number |
| `HKAT_SIYK_SET_DTM` | Field | Contract set datetime (引当契約設定年月日時分秒) — when the contract was set up |
| `TLN_SETMEI` | Field | Phone number description (電話番号説明) — descriptive label for the phone number |
| `KOJIN_HOJIN_TLN_TAI_CD` | Field | Personal/corporate phone number carrier code (個人法人電話番号帯コード) — distinguishes between personal and corporate numbers |
| `C5_SERVER_GOKI_SKBT_CD` | Field | S5 server machine identification code (#5サーバ号機識別コード) — identifies which S5 server machine manages the number |
| `TELNO_TSTAYMD` | Field | Number retention start date (電話番号適用開始年月日) — when number retention started |
| `TELNO_TENDYMD` | Field | Number retention end date (電話番号適用終了年月日) — when number retention ends |
| `NRN_NO` | Field | NRN (Number Retention Number) — a unique number used for number retention porting |
| `FIRST_WARIATE_YMD` | Field | Initial assignment date (初回割当年月日) — when the number was first assigned |
| `LAST_UPD_DTM_BF` | Field | Last update datetime before change (更新前最終年月日時分秒) — the record state immediately before this change |
| `SHK_KOJIN_HOJIN_TLN_TAI_CD` | Field | Initial personal/corporate phone number carrier code (初期個人法人電話番号帯コード) — original designation |
| `TLN_STKU_TSJGS_CD` | Field | Phone number acquisition carrier code (電話番号取得通信事業者コード) — the carrier from which the number was acquired |
| `ITNM_TSJGS_CD` | Field | Transfer-from carrier code (移転元通信事業者コード) — the carrier the number is being transferred FROM |
| `ITNS_TSJGS_CD` | Field | Transfer-to carrier code (移転先通信事業者コード) — the carrier the number is being transferred TO |
| `BMP_HAISHI_REQ_CTRL_CD` | Field | Cancellation request control code (番ポ廃止依頼制御コード) — `"0"` means cancellation request control not required; introduced in change #86474 |
| `BMP_1` | Constant | Number port exists indicator (番ポあり) — `"番ポ工事詳細"` — indicates the phone number has a number port |
| `番ポ帰り` (hampokaeri) | Business term | Port return — scenario where a customer retains their phone number after cancelling their SIP line |
| `EZM0121A010` | SC Code | Phone Number Unique Inquiry (電話番号一意照会) — SC that retrieves phone number details |
| `ETU0051B010` | SC Code | Carrier List Inquiry (通信事業者一覧照会) — SC that retrieves available carrier information |
| `ETU0151A011` | SC Code | Port-out Reception Info Unique Inquiry / Service Contract Inquiry (ポートアウト受付情報一意照会／サービス契約照会) — SC that retrieves port-out reception details |
| `CAANMsg` | Class | Fujitsu's message wrapper class used for SIF request/response objects |
| `SIF` | Acronym | Service Interface — the middleware layer between screens/batches and service components |
| `SC` | Acronym | Service Component — modular business logic units in the Fujitsu architecture |
| `CBS` | Acronym | Common Business Service — the message class for CBS-level data exchange |
| `SOD` | Acronym | Service Order Data — telecom order fulfillment entity |
| `FTTH` | Business term | Fiber To The Home — fiber-optic broadband internet service |
| `ENUM` | Business term | ENUM (Telephone Number Mapping) — maps telephone numbers to Internet identifiers |
| `KKKBumpMdsCC` | Class | Port Return (番ポ帰り) execution class — orchestrates the entire port return business process |
| `fillCAANMSGNullMapping` | Method | Sets all fields in a CAANMsg template to null — used as a safety measure before populating fields |
| `ServiceComponentRequestInvoker` | Class | Invokes the service component through the SIF interface |

---
