# Business Logic — JFUAddKktSvcKeiCC.editInEKK2811D010() [372 LOC]

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

## 1. Role

### JFUAddKktSvcKeiCC.editInEKK2811D010()

This method performs the **incoming (upstream) mapping processing for Equipment Option Service Contract Registration (Telephone)** — the Japanese Javadoc states "機器オプションサービス契約登録(電話)の上りマッピング処理". It acts as a **mapper/transformer** that reads business data from a request parameter work area and populates a CBS message template (`EKK2811D010CBSMsg`) for downstream processing. The method handles **two business operation modes** — **Addition (追加申込み, MSKM_KBN_ADD = "2")** and **New Registration (新規申込み, MSKM_KBN_NEW = "1")** — routing the data retrieval logic based on the `mskmKbn` discriminator pulled from the `EKK2811B503` data block. It implements a **routing/dispatch pattern** at two branching points: the `mskmKbn` service type check (add vs. new) and the `updDtmBf` null-check cascade with net-map fallback in the new-registration path. As a **shared utility** called from `JFUAddKktSvcKeiCC.addKktSvcKei()`, this method is not a screen entry point but a reusable mapping function invoked during telephone equipment option service contract creation flows, specifically for the EKK2811D010 transaction.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editInEKK2811D010(params, fixedText, index)"])

    START --> INIT["Initialize template: EKK2811D010CBSMsg"]
    INIT --> SET_TEMPLATE["Set template: TEMPLATEID, FUNC_CODE, OPERATOR_ID, dates"]
    SET_TEMPLATE --> GET_MAPS["Retrieve workMap, inMap, useplaceAddressMap"]

    GET_MAPS --> KKOP_SVC["Set KKOP_SVC_CD from inMap"]
    KKOP_SVC --> PCR["Set PCRS_CD, PPLAN_CD from inMap"]

    PCR --> GET_MSKM_KBN["Get mskmKbn from EKK2811B503"]

    GET_MSKM_KBN --> COND_TYPE{MSKM_KBN<br>equals MSKM_KBN_ADD?<br>MSKM_KBN_ADD = 2}

    COND_TYPE -->|Yes| ADD_BRANCH["追加申込み (Addition)"]
    ADD_BRANCH --> GET_KIKI_TK["Get kktkSvcKeiNo from EKK2811B503CBSMsg1List"]
    GET_KIKI_TK --> CHECK_KIKI_TK{KikiTkList empty?}
    CHECK_KIKI_TK -->|No| SET_KKTK_ADD["template.set KKTK_SVC_KEI_NO"]
    CHECK_KIKI_TK -->|Yes| GET_FALLBACK["Fallback: get from EKK0341D010Tel"]
    GET_FALLBACK --> SET_KKTK_ADD

    COND_TYPE -->|No| NEW_BRANCH["新規申込み (New)"]
    NEW_BRANCH --> GET_KIKI["Get from EKK0341D010Tel"]
    GET_KIKI --> CHECK_NET{inEKK2811NetMap has data?}
    CHECK_NET -->|Yes| SET_FROM_NET["Get kktk_svc_kei_no from net map"]
    CHECK_NET -->|No| SET_FROM_LIST["Get from kikiList.get(0)"]
    SET_FROM_NET --> CHECK_NULL{is kktk_svc_kei_no null?}
    SET_FROM_LIST --> CHECK_NULL
    CHECK_NULL -->|Yes| SET_NULL_KKTK["template.setNull KKTK_SVC_KEI_NO"]
    CHECK_NULL -->|No| SET_KKTK_NEW["template.set KKTK_SVC_KEI_NO"]

    SET_KKTK_ADD --> SET_SYSID["Set SYSID (fallback to getKeishaWorkMapValue)"]
    SET_KKTK_NEW --> SET_SYSID

    SET_SYSID --> SET_MSKM_DTL["Set MSKM_DTL_NO (fallback to getMskmWorkMapValue)"]
    SET_MSKM_DTL --> SET_DATES["Set dates: ftrial, ftrial_end, honkanyu, honkanyu_iko, svc_use, rsv_tsta"]
    SET_DATES --> SET_OTHER["Set other fields: pnlty, ido_div, flag, prc_kmk_cd"]
    SET_OTHER --> SET_SEIKY["Set SEIKY_KEI_NO (fallback to getWorkMapValue)"]
    SET_SEIKY --> UPD_DTM_COND{MSKM_KBN equals MSKM_KBN_NEW?}
    UPD_DTM_COND -->|Yes| NEW_UPD_DTM["Get updDtmBf from EKK0341D010Tel"]
    UPD_DTM_COND -->|No| ADD_UPD_DTM["Get from EKK2811B503"]

    NEW_UPD_DTM --> CHECK_UPD_NULL{updDtmBf null?}
    CHECK_UPD_NULL -->|No| SET_UPD_NEW["template.set UPD_DTM_BF"]
    CHECK_UPD_NULL -->|Yes| CHECK_UPD_NET{net map has data?}
    CHECK_UPD_NET -->|Yes| SET_UPD_NET["Get from inEKK2811NetMap"]
    SET_UPD_NET --> SET_UPD_NEW

    ADD_UPD_DTM --> CHECK_MULTI{updDtmList empty?}
    CHECK_MULTI -->|No| SET_MULTI_DTM["Get from EKK0111D010 (multi-function)"]
    CHECK_MULTI -->|Yes| SET_SIMPLE_DTM["Get from EKK0341D010Tel"]

    SET_UPD_NEW --> RETURN["Return template (CAANMsg)"]
    SET_UPD_DTM --> RETURN
    SET_MULTI_DTM --> RETURN
    SET_SIMPLE_DTM --> RETURN
    SET_NULL_KKTK --> RETURN
    SET_KKTK_NEW --> RETURN
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter object carrying the complete work area mapping data, control map (operator ID, operation date/time), and all upstream/downstream data blocks (e.g., `EKK2811B503`, `EKK0341D010Tel`, `FUSV015211CC`). It is the central data bus for the entire service contract registration transaction. |
| 2 | `fixedText` | `String` | A string identifier used as the template ID key (`TEMPLATEID`) and as a lookup key for retrieving the primary work map (`param.getData(fixedText)`). It distinguishes between different service contract data blocks — typically the CBS message identifier for the telephone equipment option service contract registration flow. |
| 3 | `index` | `int` | An integer index into the `EKK2811D010TelList` ArrayList (retrieved from `fixedText` data). It selects a specific line item from the telephone service contract list, supporting multi-line service registration in a single transaction. |

**External state read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `workMap` (from `param.getMappingWorkArea()`) | `Map` | The shared work area map keyed by `CC_WORK_AREA_NAME = "JFUAddKeishaServiceCCWork"`, containing customer/work-related transient data. |
| `inEKK2811NetMap` (from `param.getData("OutEKK2811D010Net")`) | `HashMap` | Network-related data block for EKK2811D010 — used as a fallback source for `kktk_svc_kei_no` and `upd_dtm_bf` during new registration processing. |
| `mskmKbn` (from `EKK2811B503` data block) | `String` | The "MSKM Kbn" (Service Contract Classification) discriminator that determines whether the operation is an addition (value `"2"`) or a new registration (value `"1"`). This drives the primary branching logic. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JFUAddKktSvcKeiCC.getKeishaWorkMapValue` | - | - | Calls `getKeishaWorkMapValue` to retrieve `sysid` from the keisha (vehicle) work map as a fallback when `inMap` lacks `sysid`. |
| - | `JFUAddKktSvcKeiCC.getMskmWorkMapValue` | - | - | Calls `getMskmWorkMapValue` to retrieve `ekk0111_mskm_dtl_no` from the mskm work map as a fallback when `inMap` lacks `mskm_dtl_no`. |
| - | `JFUAddKktSvcKeiCC.getWorkMapValue` | - | - | Calls `getWorkMapValue` to retrieve `seiky_kei_no` (billing contract number) from the `JFUAddSkkSCWork` area as a fallback when `inMap` lacks `seiky_kei_no`. |
| - | `JCKMvnoCustInfoAddCC.setNull` | - | - | Sets null on template fields — internal field nulling operations on the output message template. |
| - | `JKKKapKeiInfoCancelCC.setNull` | - | - | Sets null on template fields — internal field nulling operations on the output message template. |
| - | `JKKKikiModelKappuInfoCC.setNull` | - | - | Sets null on template fields — internal field nulling operations on the output message template. |
| - | `JKKKisnUwHmdkAddCC.setNull` | - | - | Sets null on template fields — internal field nulling operations on the output message template. |
| - | `JKKMvnoSvcKeiStaAddCC.setNull` | - | - | Sets null on template fields — internal field nulling operations on the output message template. |

**Detailed analysis of called methods in this method:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JFUAddKktSvcKeiCC.getKeishaWorkMapValue(param, "sysid")` | - | - | Reads `sysid` (customer system ID) from the keisha work area — used as a secondary lookup source when the primary `inMap` does not contain `sysid`. |
| - | `JFUAddKktSvcKeiCC.getMskmWorkMapValue(param, "ekk0111_mskm_dtl_no")` | - | - | Reads `ekk0111_mskm_dtl_no` (service detail number from EKK0111 process) from the mskm work area — secondary lookup for service detail number when `inMap` lacks it. |
| - | `JFUAddKktSvcKeiCC.getWorkMapValue(param, "seiky_kei_no", "JFUAddSkkSCWork")` | - | - | Reads `seiky_kei_no` (billing contract number) from the `JFUAddSkkSCWork` work area — secondary lookup when `inMap` lacks the billing contract number. |
| R | `param.getMappingWorkArea()` | - | - | Reads the shared mapping work area containing transient business data. |
| R | `param.getControlMapData(OPERATOR_ID)` | - | - | Reads the operator ID from the control map for audit trail. |
| R | `param.getControlMapData(OPE_DATE)` | - | - | Reads the operation date for audit trail. |
| R | `param.getControlMapData(OPE_TIME)` | - | - | Reads the operation time for audit trail. |
| R | `param.getData("OutEKK2811D010Net")` | - | - | Reads network-related data block as a fallback source. |
| R | `param.getData(fixedText)` | - | - | Reads the primary data block keyed by `fixedText`, which contains the `EKK2811D010TelList`. |
| R | `param.getData("FUSV015211CC")` | - | - | Reads the divided post-use-place address map data. |
| R | `param.getData("FUSV016102CC")` | - | - | Reads an alternate divided post-use-place address map (fallback). |
| R | `param.getData("EKK2811B503")` | - | - | Reads the EKK2811B503 data block containing `mskmKbn` discriminator and addition-mode service contract info. |
| R | `param.getData("EKK0341D010Tel")` | - | - | Reads the EKK0341D010Tel data block — new registration telephone service data (used as primary or fallback source). |
| R | `param.getData("EKK0111D010")` | - | - | Reads the EKK0111D010 data block — used when processing multi-function equipment addition mode. |

**Classification:** This method is primarily a **Read (R)** operation — it reads data from various work areas and param data blocks, transforms it, and writes it to a message template. No actual database CRUD or service component (SC) calls are made. The `setNull` calls on template fields are internal message operations, not DB writes.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `setNull` [-], `setNull` [-], `setNull` [-], `setNull` [-], `setNull` [-], `getKeishaWorkMapValue` [R], `getMskmWorkMapValue` [R], `getWorkMapValue` [R]  # NOSONAR

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CC: `JFUAddKktSvcKeiCC.addKktSvcKei()` | `addKktSvcKei()` -> `editInEKK2811D010()` | `setNull` [-], `getKeishaWorkMapValue` [R], `getMskmWorkMapValue` [R], `getWorkMapValue` [R] |

**Note:** This method is a shared mapping utility — it is not directly invoked by any screen. The caller `addKktSvcKei()` is itself a Common Component (CC) method within the same class that orchestrates the overall equipment option service contract registration. Screen entry points (e.g., `KKSV0004` or similar) would route through higher-level CBS classes to reach `addKktSvcKei()`, which then delegates to this mapper.

## 6. Per-Branch Detail Blocks

### Block 1 — INITIALIZATION (L5617)

Initialize the output message template and set audit trail fields.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template = new CAANMsg(EKK2811D010CBSMsg.class.getName())` // Create template for EKK2811D010CBSMsg |
| 2 | SET | `template.set(EKK2811D010CBSMsg.TEMPLATEID, fixedText)` // テンプレートID — Set template ID (original: テンプレートID) |
| 3 | SET | `template.set(EKK2811D010CBSMsg.FUNC_CODE, FUNC_1)` // 機能コード（デフォルト：1）— Set function code with `FUNC_1 = "1"` (original: 機能コード（デフォルト：1）) |
| 4 | SET | `operatorId = param.getControlMapData(SCControlMapKeys.OPERATOR_ID)` // 作業者ID取得 — Read operator ID |
| 5 | SET | `template.set(JCMConstants.OPERATOR_ID_KEY, operatorId)` // 作業者IDをセット — Set operator ID on template |
| 6 | SET | `operateDate = param.getControlMapData(SCControlMapKeys.OPE_DATE)` // 運用日付 — Read operation date |
| 7 | SET | `template.set(JCMConstants.OPERATE_DATE_KEY, operateDate)` // 運用日付をセット — Set operation date |
| 8 | SET | `operateDateTime = param.getControlMapData(SCControlMapKeys.OPE_TIME)` // 運用日時 — Read operation date/time |
| 9 | SET | `template.set(JCMConstants.OPERATE_DATETIME_KEY, operateDateTime)` // 運用日時をセット — Set operation date/time |
| 10 | SET | `workMap = (Map)param.getMappingWorkArea()` // 作業領域の取得 — Read work area map |

---

### Block 2 — DATA BLOCK RETRIEVAL (L5635)

Retrieve and extract primary data maps for processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap = null` // Initialize work area map (original: 作業項目情報) |
| 2 | IF | `workMap != null` -> `inMap = workMap.get(CC_WORK_AREA_NAME)`; else `inMap = null` |
| 3 | SET | `inMap = (HashMap)param.getData(fixedText)` // UserData情報取得 — Override with user data block (original: ユーザーデータ情報) |
| 4 | SET | `inMap = (HashMap)((ArrayList)inMap.get("EKK2811D010TelList")).get(index)` // v1.00.00 追加 — Extract specific line item by index (original: v1.00.00 追加開始) |
| 5 | SET | `useplaceAddressMap = (HashMap)param.getData("FUSV015211CC")` // 分割後利用箇所住所情報 (original: 分割後利用箇所住所情報) |
| 6 | IF | `useplaceAddressMap == null` -> `useplaceAddressMap = param.getData("FUSV016102CC")` // Fallback for divided post-use-place address |

---

### Block 3 — KKOP_SVC_CD SETTING (L5666)

Set the equipment option service code.

| # | Type | Code |
|---|------|------|
| 1 | IF | `inMap == null \|\| inMap.get("kkop_svc_cd") == null \|\| "".equals(inMap.get("kkop_svc_cd"))` (original: 機器オプションサービスコード) |
| 2 | EXEC | `template.setNull(EKK2811D010CBSMsg.KKOP_SVC_CD)` // Set null if empty |
| 3 | ELSE | (original: —) |
| 4 | EXEC | `template.set(EKK2811D010CBSMsg.KKOP_SVC_CD, inMap.get("kkop_svc_cd"))` // Set equipment option service code |

---

### Block 4 — PCRS_CD SETTING (L5676)

Set the price code system code.

| # | Type | Code |
|---|------|------|
| 1 | IF | `inMap == null \|\| inMap.get("pcrs_cd") == null \|\| "".equals(inMap.get("pcrs_cd"))` (original: 料金コードシステムコード) |
| 2 | EXEC | `template.setNull(EKK2811D010CBSMsg.PCRS_CD)` // Set null if empty |
| 3 | ELSE | (original: —) |
| 4 | EXEC | `template.set(EKK2811D010CBSMsg.PCRS_CD, inMap.get("pcrs_cd"))` // Set price code system code |

---

### Block 5 — PPLAN_CD SETTING (L5686)

Set the price plan code.

| # | Type | Code |
|---|------|------|
| 1 | IF | `inMap == null \|\| inMap.get("pplan_cd") == null \|\| "".equals(inMap.get("pplan_cd"))` (original: 料金プランコード) |
| 2 | EXEC | `template.setNull(EKK2811D010CBSMsg.PPLAN_CD)` // Set null if empty |
| 3 | ELSE | (original: —) |
| 4 | EXEC | `template.set(EKK2811D010CBSMsg.PPLAN_CD, inMap.get("pplan_cd"))` // Set price plan code |

---

### Block 6 — MSKM_KBN BRANCH: KKTK_SVC_KEI_NO (L5700)

Branch on the service contract classification (`mskmKbn`). This block handles the **Equipment Contract Service Number (契約番号)** extraction differently for addition vs. new registrations.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mskmKbn = ((HashMap)param.getData("EKK2811B503")).get("mskmKbn")` // 機器提供サービス契約番号取得 (original: 機器提供サービス契約番号) |
| 2 | IF | `JFUStrConst.MSKM_KBN_ADD.equals(mskmKbn)` // MSKM_KBN_ADD = "2" — 追加申込みの場合 (original: 追加の場合) |

#### Block 6.1 — Addition (MSKM_KBN_ADD = "2") (L5706)

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktkSvcKeiNo = null` // Declare local variable |
| 2 | SET | `kikiTkMap = (HashMap)param.getData("EKK2811B503")` // 機器TKマップ取得 |
| 3 | SET | `KikiTkList = (ArrayList)kikiTkMap.get("EKK2811B503CBSMsg1List")` // 機器TKリスト取得 |
| 4 | IF | `KikiTkList != null && KikiTkList.size() > 0` |

##### Block 6.1.1 — KikiTkList has data (L5711)

| # | Type | Code |
|---|------|------|
| 1 | SET | `kikiTkSvcMap = (HashMap)KikiTkList.get(0)` // Get first list item |
| 2 | SET | `kktkSvcKeiNo = kikiTkSvcMap.get(EKK2811B503CBSMsg1List.KKTK_SVC_KEI_NO)` // Get contract service number from list |

##### Block 6.1.2 — KikiTkList empty (L5716)

Fallback: read from the telephone data block.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kikiMap = (HashMap)param.getData("EKK0341D010Tel")` // 代替取得先 |
| 2 | SET | `kikiList = (ArrayList)kikiMap.get("EKK0341D010TelList")` // Telephone list |
| 3 | SET | `kikiSvcMap = (HashMap)kikiList.get(0)` // Get first item |
| 4 | SET | `kktkSvcKeiNo = kikiSvcMap.get(EKK0341D010CBSMsg.KKTK_SVC_KEI_NO)` // Fallback contract number |

#### Block 6.2 — End of Addition branch

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.set(EKK2811D010CBSMsg.KKTK_SVC_KEI_NO, kktkSvcKeiNo)` // 追加の場合契約番号をセット (original: 追加の場合) |

#### Block 6.3 — New Registration (MSKM_KBN_NEW = "1") (L5726)

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_svc_kei_no = null` // Declare local variable (original: 新規の場合) |
| 2 | SET | `kikiMap = (HashMap)param.getData("EKK0341D010Tel")` // Read new registration data |
| 3 | SET | `kikiList = (ArrayList)kikiMap.get("EKK0341D010TelList")` // Telephone list for new registration |
| 4 | IF | `kikiList != null && kikiList.size() > 0` |

##### Block 6.3.1 — kikiList has data (L5732)

| # | Type | Code |
|---|------|------|
| 1 | IF | `inEKK2811NetMap != null && inEKK2811NetMap.size() > 0` // Check net map |

###### Block 6.3.1.1 — Net map has data

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktk_svc_kei_no = inEKK2811NetMap.get(EKK2811D010CBSMsg.KKTK_SVC_KEI_NO)` // From net map |

###### Block 6.3.1.2 — Net map empty

| # | Type | Code |
|---|------|------|
| 1 | SET | `kikiSvcMap = (HashMap)kikiList.get(0)` // Get from list |
| 2 | SET | `kktk_svc_kei_no = kikiSvcMap.get(EKK0341D010CBSMsg.KKTK_SVC_KEI_NO)` // From list item |

##### Block 6.3.2 — kikiList null or empty (L5739)

No assignment — `kktk_svc_kei_no` remains `null`.

#### Block 6.4 — Null check for new registration (L5739)

| # | Type | Code |
|---|------|------|
| 1 | IF | `kktk_svc_kei_no == null` // (original: 新規の場合のnullチェック) |
| 2 | EXEC | `template.setNull(EKK2811D010CBSMsg.KKTK_SVC_KEI_NO)` // Set null if no contract number |
| 3 | ELSE | (original: —) |
| 4 | EXEC | `template.set(EKK2811D010CBSMsg.KKTK_SVC_KEI_NO, kktk_svc_kei_no)` // Set contract service number |

---

### Block 7 — SYSID SETTING (L5750)

Set the customer system ID with a fallback work map lookup.

| # | Type | Code |
|---|------|------|
| 1 | IF | `inMap == null \|\| inMap.get("sysid") == null \|\| "".equals(inMap.get("sysid"))` // 顧客登録SYSID (original: お客様登録.SYSID) |

#### Block 7.1 — SYSID fallback (L5755)

v1.00.00 addition: use secondary work map lookup.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sysid = getKeishaWorkMapValue(param, "sysid")` // v1.00.00 追加 — Fallback lookup |
| 2 | IF | `sysid == null` |
| 3 | EXEC | `template.setNull(EKK2811D010CBSMsg.SYSID)` // Set null |
| 4 | ELSE | (original: —) |
| 5 | EXEC | `template.set(EKK2811D010CBSMsg.SYSID, sysid)` // Set SYSID |

#### Block 7.2 — SYSID present in inMap (L5763)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.set(EKK2811D010CBSMsg.SYSID, inMap.get("sysid"))` // Set SYSID from inMap |

---

### Block 8 — MSKM_DTL_NO SETTING (L5767)

Set the service contract detail number with a fallback lookup.

| # | Type | Code |
|---|------|------|
| 1 | IF | `inMap == null \|\| inMap.get("mskm_dtl_no") == null \|\| "".equals(inMap.get("mskm_dtl_no"))` // 申込登録.明細番号 (original: 申込登録.申込明細番号) |

#### Block 8.1 — MSKM_DTL_NO fallback (L5772)

v1.00.00 addition: use secondary work map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mskm_dtl_no = getMskmWorkMapValue(param, "ekk0111_mskm_dtl_no")` // v1.00.00 追加 — Fallback |
| 2 | IF | `mskm_dtl_no == null` |
| 3 | EXEC | `template.setNull(EKK2811D010CBSMsg.MSKM_DTL_NO)` // Set null |
| 4 | ELSE | (original: —) |
| 5 | EXEC | `template.set(EKK2811D010CBSMsg.MSKM_DTL_NO, mskm_dtl_no)` // Set detail number |

#### Block 8.2 — MSKM_DTL_NO present (L5781)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.set(EKK2811D010CBSMsg.MSKM_DTL_NO, inMap.get("mskm_dtl_no"))` // Set from inMap |

---

### Block 9 — DATE/TIMESTAMP FIELDS (L5785–L5841)

A sequence of null-check/set operations for various date fields. Each follows the identical pattern: check `inMap`, set null if empty, set value if present.

| # | Type | Code | Field | Business Description |
|---|------|------|-------|---------------------|
| 1 | IF-ELSE | Check `inMap.get("ftrial_kanyu_ymd")` | `FTRIAL_KANYU_YMD` | 試加入年月日 — Trial installation date (original: 試加入年月日) |
| 2 | IF-ELSE | Check `inMap.get("ftrial_prd_endymd")` | `FTRIAL_PRD_ENDYMD` | 試期間終了年月日 — Trial period end date (original: 試期間終了年月日) |
| 3 | IF-ELSE | Check `inMap.get("honkanyu_ymd")` | `HONKANYU_YMD` | 本加入年月日 — Full installation date (original: 本加入年月日) |
| 4 | IF-ELSE | Check `inMap.get("honkanyu_iko_kigen_ymd")` | `HONKANYU_IKO_KIGEN_YMD` | 本加入移行期限年月日 — Full installation migration deadline (original: 本加入移行期限年月日) |
| 5 | IF-ELSE | Check `inMap.get("svc_use_sta_kibo_ymd")` | `SVC_USE_STA_KIBO_YMD` | サービス利用開始希望年月日 — Desired service usage start date (original: サービス利用開始希望年月日) |
| 6 | IF-ELSE | Check `inMap.get("rsv_tsta_kibo_ymd")` | `RSV_TSTA_KIBO_YMD` | 予約適用開始希望年月日 — Desired reservation application start date (original: 予約適用開始希望年月日) |

---

### Block 10 — ADDITIONAL STRING FIELDS (L5845–L5886)

More null-check/set operations for categorical string fields.

| # | Type | Code | Field | Business Description |
|---|------|------|-------|---------------------|
| 1 | IF-ELSE | Check `inMap.get("pnlty_hassei_cd")` | `PNLTY_HASSEI_CD` | 違約金発生コード — Penalty occurrence code (original: 違約金発生コード) |
| 2 | IF-ELSE | Check `inMap.get("ido_div")` | `IDO_DIV` | 異動区分 — Movement/change classification (original: 異動区分) |
| 3 | IF-ELSE | Check `inMap.get("kiki_rntai_kei_chgechu_flg")` | `KIKI_RNTAI_KEI_CHGECHU_FLG` | 機器連帯契約変更手続フラグ — Equipment bundle contract change procedure flag (original: 機器連帯契約変更手続フラグ) |
| 4 | IF-ELSE | Check `inMap.get("prc_kmk_cd")` | `PRC_KMK_CD` | 料金項目コード — Price item code (original: 料金項目コード) |

---

### Block 11 — SEIKY_KEI_NO SETTING (L5853)

Set the billing contract number with a fallback work map lookup.

| # | Type | Code |
|---|------|------|
| 1 | IF | `inMap == null \|\| inMap.get("seiky_kei_no") == null \|\| "".equals(inMap.get("seiky_kei_no"))` // 請求契約番号 (original: 請求契約番号) |

#### Block 11.1 — SEIKY_KEI_NO fallback (L5858)

v1.00.00 addition: use `getWorkMapValue` from `JFUAddSkkSCWork` area.

| # | Type | Code |
|---|------|------|
| 1 | SET | `seiky_kei_no = getWorkMapValue(param, "seiky_kei_no", CC_WORK_AREA_NAME_SKK)` // v1.00.00 追加 — Fallback lookup (CC_WORK_AREA_NAME_SKK = "JFUAddSkkSCWork") |
| 2 | IF | `seiky_kei_no == null` |
| 3 | EXEC | `template.setNull(EKK2811D010CBSMsg.SEIKY_KEI_NO)` // Set null |
| 4 | ELSE | (original: —) |
| 5 | EXEC | `template.set(EKK2811D010CBSMsg.SEIKY_KEI_NO, seiky_kei_no)` // Set billing contract number |

#### Block 11.2 — SEIKY_KEI_NO present (L5868)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.set(EKK2811D010CBSMsg.SEIKY_KEI_NO, inMap.get("seiky_kei_no"))` // Set from inMap |

---

### Block 12 — UPD_DTM_BF (LAST UPDATE TIMESTAMP) (L5889)

Set the "update-before" timestamp — the previous timestamp before the current update. This block has the most complex branching due to multi-function equipment handling.

| # | Type | Code |
|---|------|------|
| 1 | SET | `updDtmBf = null` // 更新年月日時分秒(更新前)初期化 (original: 更新年月日時分秒(更新前)) |
| 2 | IF | `JFUStrConst.MSKM_KBN_NEW.equals(mskmKbn)` // MSKM_KBN_NEW = "1" — 新規の場合 (original: 新規の場合) |

#### Block 12.1 — New registration (L5895)

| # | Type | Code |
|---|------|------|
| 1 | SET | `updDtmMap = (HashMap)param.getData("EKK0341D010Tel")` // Read telephone update data |
| 2 | SET | `updDtmList = (ArrayList)updDtmMap.get("EKK0341D010TelList")` // Telephone list |
| 3 | SET | `updDtmBfMap = (HashMap)updDtmList.get(0)` // Get first item |
| 4 | SET | `updDtmBf = updDtmBfMap.get(EKK0341D010CBSMsg.UPD_DTM)` // Read update timestamp |
| 5 | IF | `updDtmBf == null` // (original: updDtmBfがnullの場合) |

##### Block 12.1.1 — updDtmBf is null (L5902)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.setNull(EKK2811D010CBSMsg.UPD_DTM_BF)` // Set null first |
| 2 | IF | `inEKK2811NetMap != null && inEKK2811NetMap.size() > 0` // 再試: net map fallback |

###### Block 12.1.1.1 — Net map has update timestamp

| # | Type | Code |
|---|------|------|
| 1 | SET | `updDtmBf = inEKK2811NetMap.get(EKK2811D010CBSMsg.UPD_DTM_BF)` // Get from net map |
| 2 | EXEC | `template.set(EKK2811D010CBSMsg.UPD_DTM_BF, updDtmBf)` // Override null with net map value |

#### Block 12.2 — updDtmBf has value (L5909)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.set(EKK2811D010CBSMsg.UPD_DTM_BF, updDtmBf)` // Set from telephone list |

#### Block 12.3 — Addition (MSKM_KBN_ADD = "2") (L5912)

| # | Type | Code |
|---|------|------|
| 1 | SET | `updDtmMap = (HashMap)param.getData("EKK2811B503")` // Read addition update data (original: 追加の場合) |
| 2 | SET | `updDtmList = (ArrayList)updDtmMap.get("EKK2811B503CBSMsg1List")` // Addition list |
| 3 | IF | `updDtmList != null && updDtmList.size() > 0` // 多機能を持っている場合 — Multi-function equipped (original: 多機能を持っている場合) |

##### Block 12.3.1 — Multi-function equipped (L5919)

| # | Type | Code |
|---|------|------|
| 1 | SET | `updDtmBf = ((HashMap)param.getData("EKK0111D010")).get(EKK0111D010CBSMsg.UPD_DTM)` // Read from EKK0111D010 |
| 2 | EXEC | `template.set(EKK2811D010CBSMsg.UPD_DTM_BF, updDtmBf)` // Set update timestamp |

##### Block 12.3.2 — Not multi-function (L5924)

Fallback for single-function equipment.

| # | Type | Code |
|---|------|------|
| 1 | SET | `updDtmMap = (HashMap)param.getData("EKK0341D010Tel")` // Switch to telephone data |
| 2 | SET | `updDtmList = (ArrayList)updDtmMap.get("EKK0341D010TelList")` // Telephone list |
| 3 | SET | `updDtmBfMap = (HashMap)updDtmList.get(0)` // Get first item |
| 4 | SET | `updDtmBf = updDtmBfMap.get(EKK0341D010CBSMsg.UPD_DTM)` // Read update timestamp |
| 5 | IF | `updDtmBf == null` |
| 6 | EXEC | `template.setNull(EKK2811D010CBSMsg.UPD_DTM_BF)` // Set null |
| 7 | ELSE | (original: —) |
| 8 | EXEC | `template.set(EKK2811D010CBSMsg.UPD_DTM_BF, updDtmBf)` // Set update timestamp |

---

### Block 13 — RETURN (L5931)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return template;` // 上りマッピング完了 — Return the fully populated CBS message template |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `kkop_svc_cd` | Field | Equipment Option Service Code — identifies the type of equipment option service (e.g., router, set-top box) |
| `pcrs_cd` | Field | Price Code System Code — the pricing code system identifier for billing classification |
| `pplan_cd` | Field | Price Plan Code — the specific price plan assigned to the service contract |
| `kktk_svc_kei_no` | Field | Equipment Contract Service Number — the service contract number for the equipment (terminal) |
| `sysid` | Field | System ID — the customer's unique system identifier in the registration system |
| `mskm_dtl_no` | Field | Service Contract Detail Number — the line-item detail number for the service contract (from EKK0111 process) |
| `ftrial_kanyu_ymd` | Field | Trial Installation Date — the date the trial service begins (original: 試加入年月日) |
| `ftrial_prd_endymd` | Field | Trial Period End Date — the end date of the trial service period (original: 試期間終了年月日) |
| `honkanyu_ymd` | Field | Full Installation Date — the date the full service is installed (original: 本加入年月日) |
| `honkanyu_iko_kigen_ymd` | Field | Full Installation Migration Deadline — the deadline for transitioning from trial to full service (original: 本加入移行期限年月日) |
| `svc_use_sta_kibo_ymd` | Field | Desired Service Usage Start Date — the customer's requested service start date (original: サービス利用開始希望年月日) |
| `rsv_tsta_kibo_ymd` | Field | Desired Reservation Application Start Date — the requested date for applying the reservation (original: 予約適用開始希望年月日) |
| `pnlty_hassei_cd` | Field | Penalty Occurrence Code — code indicating if/when a penalty fee is incurred (original: 違約金発生コード) |
| `ido_div` | Field | Movement/Change Classification — classifies the type of service transfer or change (original: 異動区分) |
| `kiki_rntai_kei_chgechu_flg` | Field | Equipment Bundle Contract Change Procedure Flag — indicates whether an equipment bundle contract change is in progress (original: 機器連帯契約変更手続フラグ) |
| `seiky_kei_no` | Field | Billing Contract Number — the contract number associated with billing (original: 請求契約番号) |
| `prc_kmk_cd` | Field | Price Item Code — the code for the specific price item/category (original: 料金項目コード) |
| `upd_dtm_bf` | Field | Update Date/Time (Before) — the timestamp of the last update before the current operation (original: 更新年月日時分秒(更新前)) |
| `mskmKbn` | Field | MSKM Classification — the service contract classification discriminator that determines the operation mode |
| MSKM_KBN_NEW | Constant | New Registration = "1" — indicates a brand new service contract registration (original: 新規申込み) |
| MSKM_KBN_ADD | Constant | Addition Registration = "2" — indicates an addition to an existing service contract (original: 追加申込み) |
| FUNC_1 | Constant | Function Code "1" — default function code for the service operation (from JCRStrConst) |
| CC_WORK_AREA_NAME | Constant | Work area map key = "JFUAddKeishaServiceCCWork" — the shared work area name for customer service data (original: 作業マップ名) |
| CC_WORK_AREA_NAME_SKK | Constant | SKK work area key = "JFUAddSkkSCWork" — the work area name for SKK (settlement) service component data |
| EKK2811D010CBSMsg | Class | CBS Message class for EKK2811D010 — the telephone equipment option service contract registration CBS transaction |
| EKK0341D010CBSMsg | Class | CBS Message class for EKK0341D010 — the telephone service contract main data CBS transaction |
| EKK0111D010CBSMsg | Class | CBS Message class for EKK0111D010 — the multi-function equipment service data CBS transaction |
| EKK2811B503CBSMsg1List | Class | CBS Message list class for EKK2811B503 — the addition-mode equipment data list |
| CAANMsg | Class | Abstract message class — the base class for all CBS message templates in this system |
| IRequestParameterReadWrite | Interface | Request parameter interface — the data bus carrying work area maps and parameter data between screens, CBS, and CC methods |
| KKOP | Acronym | Kiki Option (機器オプション) — Equipment Option, a service type for optional equipment add-ons |
| MSKM | Acronym | Musuki Service Keiyaku (ムズサービス契約) — A Fujitsu internal domain term for service contract line items |
| KKTK | Acronym | Kiki Contract (機器契約) — Equipment Contract, referring to the terminal/device contract number |
| SKK | Acronym | Settle Keiyaku (決済契約) — Settlement Contract, referring to billing/payment contract data |
| CC | Acronym | Common Component — a shared, reusable Java class in the `com.fujitsu.futurity.bp.custom.common` package |
| CBS | Acronym | Call Back System — the downstream service component layer that processes business transactions |
| SC | Acronym | Service Component — the layer handling business logic and data access (SC Code pattern: `EKK0361A010SC`) |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service (a common service type in this domain) |
