# Business Logic - JKKSeikyKeiBunkatsuCC.editInMsg_EKU0021C010() [2634 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKSeikyKeiBunkatsuCC` |
| Layer | CC/Common Component (shared business logic layer - "CC" stands for Common Component) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKSeikyKeiBunkatsuCC.editInMsg_EKU0021C010()

This method constructs the inbound CAANMsg message payload required by the EKU0021C010 CBS (Contract/Service Detail Modification Service for Work Orders). It is responsible for preparing all input parameters that the downstream CBS expects when performing "工事案件<eo光ネット>諸変更" (Work Order - eo Hikari Network - Miscellaneous Changes), i.e., miscellaneous changes to FTTH (Fiber-to-the-Home) work orders under the eo Hikari internet service.

The method implements a **message builder pattern**: it initializes a `CAANMsg` template from the `EKU0021C010CBSMsg` schema, populates it with 160+ fields mapped from the `childMap` and `dataMap` parameters, and returns the assembled message within a `paramMap` wrapped by a delegated call to `editInMsg()`.

The service handles two distinct business contexts determined by the **service contract status code** (`svc_kei_stat_cd`): when status is `"010"` ("Received"), the method uses a direct detail number from `childMap`; for all other statuses, it resolves the detail number from the `KKSV054601SCWORKLIST` in `dataMap`. Additionally, the **function code** (`funcCd`) is checked: when `funcCd == "2"` (Confirmation/Check mode), the existing billing contract number is copied from `childMap` to bypass field-level validation that would otherwise reject it during the confirmation screen.

The method also pre-initializes a large set of fields to `null` (home device types, home device models, MAC addresses, router types, device change numbers, and previous temporary case numbers) because these are variadic fields representing up to 20 repeatable home device entries that are only populated for specific service types (e.g., home network devices, router additions).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editInMsg_EKU0021C010 start"])

    S1["EXEC: editInMsg(param) -> paramMap"]
    S2["INIT: CAANMsg template = new CAANMsg(EKU0021C010CBSMsg)"]
    S3["SET: template.templateID = EKU0021C010"]
    S4["SET: template.funcCode = 1"]
    S5["SET: operatorId, operateDate, operateDateTime from controlMap"]
    S6["INIT: workMap, meisai, stateCd"]
    S7{"stateCd == 010?"}

    S7A["READ: childMap.get(kksv040321_svc_kei_stat_cd)"]
    S7B["SET: meisai from KKSV054601SCWORKLIST"]

    COND1{"mskm_dtl_no == null or empty?"}
    NULL1["SET: template.mskmDtlNo = null"]
    SET1["SET: template.mskmDtlNo = meisai"]

    COND2{"funcCd == 2?"}
    SET2["SET: template.seikyKeiNo from childMap"]
    COND3{"seiky_kei_no_work == null or empty?"}
    NULL2["SET: template.seikyKeiNo = null"]
    SET3["SET: template.seikyKeiNo from dataMap"]

    MAP1["SET: template.funcCode = funcCd"]
    MAP2["Field mapping: childMap to template - service, customer, address fields"]
    MAP3["Null init: home device fields 1 to 4"]
    MAP4["Field mapping: childMap to template - home device fields 5 to 20"]
    MAP5["Null init: mskmShaNm, kojiApoRrksTelNo, taknkiki_ido_cd, kikiChgNo, motoTcaseNo"]
    MAP6["SET: templates array with template"]
    MAP7["SET: paramMap.put(TEMPLATE_LIST_KEY, templates)"]

    END_RETURN(["Return paramMap"])

    START --> S1 --> S2 --> S3 --> S4 --> S5 --> S6 --> S7A --> S7
    S7 -- Yes --> COND1
    S7 -- No --> S7B --> COND1
    COND1 -- Yes --> NULL1
    COND1 -- No --> SET1
    NULL1 --> COND2
    SET1 --> COND2
    COND2 -- Yes --> SET2
    COND2 -- No --> COND3
    COND3 -- Yes --> NULL2
    COND3 -- No --> SET3
    SET2 --> MAP1
    NULL2 --> MAP1
    SET3 --> MAP1
    MAP1 --> MAP2 --> MAP3 --> MAP4 --> MAP5 --> MAP6 --> MAP7 --> END_RETURN
```

**CRITICAL - Constant Resolution:**

| Constant | Value | Business Meaning |
|----------|-------|------------------|
| `TEMPLATE_ID_EKU0021C010` | `"EKU0021C010"` | Template ID for eo Hikari work order miscellaneous changes CBS message |
| `stateCd == "010"` | `"010"` | Service contract status = "Received" (受付済) - order accepted but not yet processed |
| `funcCd == "2"` | `"2"` | Confirmation mode (確認) - the screen is for data verification, not actual editing |
| `FUNC_CODE = "1"` | `"1"` | Fixed default function code set on the template before override by actual funcCd |
| `SCControlMapKeys.OPERATOR_ID` | Control map key | User/operator identifier from session control data |
| `SCControlMapKeys.OPE_DATE` | Control map key | Operation date from session control data |
| `SCControlMapKeys.OPE_TIME` | Control map key | Operation time from session control data |
| `JCMConstants.FUNC_CODE_KEY` | Control map key | Function code key for retrieving screen mode |
| `JCMConstants.TEMPLATE_LIST_KEY` | Control map key | Key under which the CAANMsg array is stored in paramMap |
| `JCMConstants.OPERATOR_ID_KEY` | Control map key | Template field for operator ID |
| `JCMConstants.OPERATE_DATE_KEY` | Control map key | Template field for operate date |
| `JCMConstants.OPERATE_DATETIME_KEY` | Control map key | Template field for operate datetime |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | Business data get/write interface; provides access to control map data (operator ID, operation date/time), the mapping work area, and serves as the container into which the final template list is placed via `editInMsg()`. |
| 2 | `dataMap` | `Map<String, Object>` | Request data map carrying screen-level data including the `KKSV054601SCWORKLIST` work item list (used to resolve detail number when status is not "Received"), the function code (`funcCd`), and the `ekk0491d010_seiky_kei_no_work` (work billing contract number) used when not in confirmation mode. |
| 3 | `childMap` | `HashMap<String, Object>` | Child data map carrying all source fields for the message template. Contains over 160 keys representing service contract details, customer information, addresses, telecommunication data, pricing, scheduling, and up to 20 entries of repeatable home device fields. |

**Instance fields / external state read by the method:**
- None directly; all state is passed via parameters. The method delegates to `editInMsg(param)` (a parent/sibling method in the same class) which initializes the `paramMap` container.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKSeikyKeiBunkatsuCC.editInMsg` | JKKSeikyKeiBunkatsuCC | - | Calls `editInMsg(param)` to initialize the `paramMap` container; sets up base mapping area before populating template. |
| - | `SCW00701SFLogic.getName` | SCW00701SFLogic | - | Referenced by pre-computed graph; likely a utility called during template processing for name resolution. |

**Additional called methods (from source code analysis):**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `CAANMsg.set` | CAANMsg | CAANMsg template | Sets individual fields on the `CAANMsg` template - covers 160+ field assignments (service codes, customer info, addresses, scheduling, home device data). |
| U | `CAANMsg.setNull` | CAANMsg | CAANMsg template | Sets individual fields to null - covers detail number fields when empty/null, home device fields 1-4 (always null), and variadic fields at end (device movement codes, device change numbers, previous temporary case numbers). |
| R | `childMap.get` | childMap | - | Reads over 160 source values from childMap; each is checked against empty string before setting to template. |
| R | `dataMap.get` | dataMap | - | Reads `KKSV054601SCWORKLIST` work list, `funcCd` function code, and `ekk0491d010_seiky_kei_no_work` contract number. |
| R | `param.getControlMapData` | param | - | Retrieves operator ID, operation date, and operation time from the session control map. |
| R | `param.getMappingWorkArea` | param | - | Retrieves the mapping work area for further business processing. |
| R | `param.get` / `param.put` | param | - | Used via `editInMsg()` to initialize and populate the `paramMap` container. |

**CRUD Classification Summary:**
- **No Create (C), Read (R), Update (U), or Delete (D) operations** on actual database tables. This method is purely a **message assembly/builder** method - it does not perform any database CRUD. All operations are in-memory field population into the `CAANMsg` template.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods.
Terminal operations from this method: `setNull` [-], `set` [-], `get` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: `JKKSeikyKeiBunkatsuCC.execEKU0021C010` | `execEKU0021C010()` -> `editInMsg_EKU0021C010(param, dataMap, childMap)` | `editInMsg [U] CAANMsg template`, `CAANMsg.set [U] 160+ fields`, `CAANMsg.setNull [U] variadic null fields` |

**Notes:** The method is called from `execEKU0021C010()` within the same class. This is the standard entry point pattern: `exec*` methods orchestrate CBS execution by calling `editInMsg_*` to build the inbound message, then invoking the CBS via SC. No direct screen entry points were found (the method is not called from any `KKSV*` screen class).

## 6. Per-Branch Detail Blocks

### Block 1 - EXEC (Initialization) (L8284)

> Initialize the message container and template. Sets common domain data (operator, date/time).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `editInMsg(param)` -> `paramMap` [Initialize base mapping container] |
| 2 | INIT | `CAANMsg template = new CAANMsg(EKU0021C010CBSMsg.class.getName())` [Create message template from schema] |
| 3 | SET | `template.set(EKU0021C010CBSMsg.TEMPLATEID, TEMPLATE_ID_EKU0021C010)` `[-> TEMPLATE_ID_EKU0021C010="EKU0021C010"]` |
| 4 | SET | `template.set(EKU0021C010CBSMsg.FUNC_CODE, "1")` [Default funcCode; overridden later at Block 1.2] |
| 5 | EXEC | `param.getControlMapData(SCControlMapKeys.OPERATOR_ID)` -> `operatorId` -> `template.set(JCMConstants.OPERATOR_ID_KEY, operatorId)` |
| 6 | EXEC | `param.getControlMapData(SCControlMapKeys.OPE_DATE)` -> `operateDate` -> `template.set(JCMConstants.OPERATE_DATE_KEY, operateDate)` |
| 7 | EXEC | `param.getControlMapData(SCControlMapKeys.OPE_TIME)` -> `operateDateTime` -> `template.set(JCMConstants.OPERATE_DATETIME_KEY, operateDateTime)` |
| 8 | EXEC | `param.getMappingWorkArea()` -> `workMap` [Read work area for business processing] |

### Block 1.1 - IF (Service Contract Status Check) (L8302)

> Branch on service contract status code (`kksv040321_svc_kei_stat_cd`) to determine how to resolve the detail number (`mskm_dtl_no`).
> - When status is "010" (Received): read from childMap directly.
> - Otherwise: read from the KKSV054601SCWORKLIST dataMap.

| # | Type | Code |
|---|------|------|
| 1 | SET | `stateCd = (String)childMap.get("kksv040321_svc_kei_stat_cd")` [Service contract status code] |
| 2 | IF | `"010".equals(stateCd)` `[stateCd == "010" (受付済/Received)]` (L8303) |

#### Block 1.1.1 - IF (child) - Status is "010" (Received)

> When service contract status is "Received", the detail number comes directly from childMap.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040324_mskm_dtl_no"))` [Detail number is empty] (L8305) |
| 1.1 | SET | `template.setNull(EKU0021C010CBSMsg.MSKM_DTL_NO)` [Clear detail number field] |
| 1.2 | SET | `template.set(EKU0021C010CBSMsg.MSKM_DTL_NO, (String)childMap.get("kksv040324_mskm_dtl_no"))` [Set detail number from childMap] |

#### Block 1.1.2 - ELSE - Status is NOT "010"

> When service contract status is not "Received", the detail number must be resolved from the work list in `dataMap`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `meisaiList = (ArrayList<HashMap<String,String>>)dataMap.get("KKSV054601SCWORKLIST")` [Retrieve work list] |
| 2 | IF | `meisaiList == null || meisaiList.size() == 0` (L8312) |
| 2.1 | SET | `template.setNull(EKU0021C010CBSMsg.MSKM_DTL_NO)` [Clear detail number] |
| 2.2 | ELSE (L8315) | |

##### Block 1.1.2.2.1 - Nested: Get first work item

| # | Type | Code |
|---|------|------|
| 1 | SET | `workdMap = (HashMap)meisaiList.get(0)` [Get first entry from work list] |
| 2 | SET | `meisai = (String)workdMap.get("ekk0011d020_mskm_dtl_no")` [Extract detail number] |
| 3 | IF | `meisai == null || "".equals(meisai)` (L8320) |
| 3.1 | SET | `template.setNull(EKU0021C010CBSMsg.MSKM_DTL_NO)` |
| 3.2 | ELSE | `template.set(EKU0021C010CBSMsg.MSKM_DTL_NO, meisai)` |

### Block 1.2 - IF (Function Code Check) (L8329)

> Branch on function code to determine how to set the billing contract number (`seiky_kei_no`).
> - When `funcCd == "2"` (Confirmation mode): copy existing contract number from childMap to bypass validation.
> - Otherwise: derive from `dataMap` work contract number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `funcCd = (String)dataMap.get(JCMConstants.FUNC_CODE_KEY)` |
| 2 | IF | `"2".equals(funcCd)` `[funcCd == "2" (確認/Confirmation)]` (L8333) |
| 2.1 | SET | `template.set(EKU0021C010CBSMsg.SEIKY_KEI_NO, (String)childMap.get("kksv040324_seiky_kei_no"))` [Use existing contract number - IF check bypass] |
| 2.2 | ELSE | |

#### Block 1.2.2 - ELSE - Function Code is NOT "2"

| # | Type | Code |
|---|------|------|
| 1 | IF | `dataMap == null || dataMap.get("ekk0491d010_seiky_kei_no_work") == null || "".equals(dataMap.get("ekk0491d010_seiky_kei_no_work"))` (L8336) |
| 1.1 | SET | `template.setNull(EKU0021C010CBSMsg.SEIKY_KEI_NO)` |
| 1.2 | ELSE | `template.set(EKU0021C010CBSMsg.SEIKY_KEI_NO, (String)dataMap.get("ekk0491d010_seiky_kei_no_work"))` |

### Block 2 - SET (Override funcCode) (L8346)

> Override the default funcCode (set to "1" in Block 1) with the actual function code from dataMap.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKU0021C010CBSMsg.FUNC_CODE, funcCd)` [Set actual function code] |

### Block 3 - Field Mapping (childMap -> template) Part 1

> Map service contract and work order identification fields from childMap to template.
> Pattern: For each field, check if childMap value is empty string; if empty, setNull; otherwise set the value.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKU0021C010CBSMsg.SVC_KEI_NO, childMap.get("kksv040324_svc_kei_no"))` [Service contract number] |
| 2 | SET | `template.set(EKU0021C010CBSMsg.SVC_KEI_KAISEN_UCWK_NO, childMap.get("kksv040324_svc_kei_kaisen_ucwk_no"))` [Service contract modification work number] |
| 3 | SET | `template.set(EKU0021C010CBSMsg.KOJIAK_NO, childMap.get("kojiak_no"))` [Work order number] |
| 4 | SET | `template.set(EKU0021C010CBSMsg.KOJI_UK_CD, childMap.get("kksv040324_koji_uk_cd"))` [Work acceptance code] |
| 5 | SET | `template.set(EKU0021C010CBSMsg.KOJI_UK_DTAIL_CD, childMap.get("kksv040324_koji_uk_dtail_cd"))` [Work acceptance detail code] |
| 6 | SET | `template.set(EKU0021C010CBSMsg.KOJI_UK_OPTNTY_IDO_DTM, childMap.get("kksv040324_koji_uk_optnty_ido_dtm"))` [Work acceptance contract move datetime] |
| 7 | SET | `template.set(EKU0021C010CBSMsg.SVC_CD, childMap.get("kksv040324_svc_cd"))` [Service code] |
| 8 | SET | `template.set(EKU0021C010CBSMsg.PRC_GRP_CD, childMap.get("kksv040324_prc_grp_cd"))` [Price group code] |
| 9 | SET | `template.set(EKU0021C010CBSMsg.PCRS_CD, childMap.get("kksv040324_pcrs_cd"))` [Price course code] |
| 10 | SET | `template.set(EKU0021C010CBSMsg.PPLAN_CD, childMap.get("kksv040324_pplan_cd"))` [Price plan code] |
| 11 | SET | `template.set(EKU0021C010CBSMsg.WRIB_TYPE_CD, childMap.get("wrib_type_cd"))` [Discount type code] |
| 12 | SET | `template.set(EKU0021C010CBSMsg.PLAN_CHG_FIX_YMD, childMap.get("plan_chg_fix_ymd"))` [Plan change fix date] |
| 13 | SET | `template.set(EKU0021C010CBSMsg.AD_CHG_FIX_DTM, childMap.get("ad_chg_fix_dtm"))` [Address change completion datetime] |
| 14 | SET | `template.set(EKU0021C010CBSMsg.MENKAIHAT_ANKEN_NO, childMap.get("menkaihat_anken_no"))` [Surface development order number] |
| 15 | SET | `template.set(EKU0021C010CBSMsg.MNKHT_KOJI_CD, childMap.get("mnkht_koji_cd"))` [Surface development work code] |
| 16 | SET | `template.set(EKU0021C010CBSMsg.PON_SKBT_CD, childMap.get("pon_skbt_cd"))` [PON identification code] |
| 17 | SET | `template.set(EKU0021C010CBSMsg.SYSID, childMap.get("kksv040324_sysid"))` [System ID] |

### Block 4 - Customer Information Field Mapping (childMap -> template)

> Map customer identification and contact information fields.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKU0021C010CBSMsg.CUST_NM, childMap.get("kksv040324_cust_nm"))` [Customer name] |
| 2 | SET | `template.set(EKU0021C010CBSMsg.CUST_KANA, childMap.get("kksv040324_cust_kana"))` [Customer name (kana)] |
| 3 | SET | `template.set(EKU0021C010CBSMsg.CUST_HOME_TEL_NO, childMap.get("cust_home_tel_no"))` [Customer home phone number] |
| 4 | SET | `template.set(EKU0021C010CBSMsg.CUST_KTAI_TEL_NO, childMap.get("cust_ktai_tel_no"))` [Customer mobile phone number] |
| 5 | SET | `template.set(EKU0021C010CBSMsg.CUST_RRKS_TEL_NO, childMap.get("cust_rrks_tel_no"))` [Customer contact phone number] |
| 6 | SET | `template.set(EKU0021C010CBSMsg.RRKS_OFFC_NM, childMap.get("rrks_offc_nm"))` [Contact business name] |

### Block 5 - Contract Address Field Mapping (childMap -> template)

> Map contract holder address fields (11 sub-fields composing the full address).

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKU0021C010CBSMsg.KEISHA_AD_CD, childMap.get("kksv040324_keisha_ad_cd"))` [Contract address code] |
| 2 | SET | `template.set(EKU0021C010CBSMsg.KEISHA_PCD, childMap.get("kksv040324_keisha_pcd"))` [Contract postal code] |
| 3 | SET | `template.set(EKU0021C010CBSMsg.KEISHA_STATE_NM, childMap.get("kksv040324_keisha_state_nm"))` [Contract prefecture name] |
| 4 | SET | `template.set(EKU0021C010CBSMsg.KEISHA_CITY_NM, childMap.get("kksv040324_keisha_city_nm"))` [Contract city/town/village name] |
| 5 | SET | `template.set(EKU0021C010CBSMsg.KEISHA_OAZTSU_NM, childMap.get("kksv040324_keisha_oaztsu_nm"))` [Contract district name] |
| 6 | SET | `template.set(EKU0021C010CBSMsg.KEISHA_AZCHO_NM, childMap.get("kksv040324_keisha_azcho_nm"))` [Contract block name] |
| 7 | SET | `template.set(EKU0021C010CBSMsg.KEISHA_AD_BNCHIGO, childMap.get("kksv040324_keisha_ad_bnchigo"))` [Contract address number] |
| 8 | SET | `template.set(EKU0021C010CBSMsg.KEISHA_ADRTTM, childMap.get("kksv040324_keisha_adrttm"))` [Contract address supplement (building name)] |
| 9 | SET | `template.set(EKU0021C010CBSMsg.KEISHA_ADRRM, childMap.get("kksv040324_keisha_adrrm"))` [Contract address supplement (room number)] |

### Block 6 - Installation Address Field Mapping (childMap -> template)

> Map installation place address fields (same 11 sub-fields as contract address).

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKU0021C010CBSMsg.PLACE_NO, childMap.get("place_no"))` [Place number] |
| 2-9 | SET | `template.set(EKU0021C010CBSMsg.SETPLACE_*, childMap.get("setplace_*"))` [Installation place address: code, postal code, prefecture, city, district, block, number, building name, room number] |

### Block 7 - Work-Specific Fields (childMap -> template)

> Map work order specifics: prior address flag, installation place phone, KEPCO office, coordinates, building info.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKU0021C010CBSMsg.KOJI_SAKI_AD_MI_FIX_FLG, childMap.get("koji_saki_ad_mi_fix_flg"))` [Work prior address unconfirmed flag] |
| 2 | SET | `template.set(EKU0021C010CBSMsg.KAISEN_PLACE_TELNO, childMap.get("kaisen_place_telno"))` [Line installation place phone number] |
| 3 | SET | `template.set(EKU0021C010CBSMsg.KEPCO_BUSIOFFICE_NO, childMap.get("kepco_busioffice_no"))` [KEPCO business office number] |
| 4 | SET | `template.set(EKU0021C010CBSMsg.LGTD, childMap.get("lgtd"))` [Longitude] |
| 5 | SET | `template.set(EKU0021C010CBSMsg.LTTD, childMap.get("lttd"))` [Latitude] |
| 6 | SET | `template.set(EKU0021C010CBSMsg.ZAHYO_HOSEI_UM, childMap.get("zahyo_hosei_um"))` [Coordinate correction present/absent] |
| 7 | SET | `template.set(EKU0021C010CBSMsg.AD_FORM_CD, childMap.get("ad_form_cd"))` [Address building type code] |
| 8 | SET | `template.set(EKU0021C010CBSMsg.NYUKYO_FLR_CNT_CD, childMap.get("nyukyo_flr_cnt_cd"))` [Move-in floor count code] |
| 9 | SET | `template.set(EKU0021C010CBSMsg.KCKU_FLR_CNT_CD, childMap.get("kcku_flr_cnt_cd"))` [Building floor count code] |
| 10 | SET | `template.set(EKU0021C010CBSMsg.DIRECTION_CD_1, childMap.get("direction_cd_1"))` [Direction code 1] |
| 11 | SET | `template.set(EKU0021C010CBSMsg.DIRECTION_CD_2, childMap.get("direction_cd_2"))` [Direction code 2] |

### Block 8 - Previous Address (Before Move) Field Mapping (childMap -> template)

> Map "before move" address fields (tentaku_bf_*). Same 11 sub-fields pattern.

| # | Type | Code |
|---|------|------|
| 1-9 | SET | `template.set(EKU0021C010CBSMsg.TENTAKU_BF_*, childMap.get("tentaku_bf_*"))` [Previous address: code, postal, prefecture, city, district, block, number, building, room] |

### Block 9 - Previous Address (Before Move-Out) Field Mapping (childMap -> template)

> Map "move-out prior" address fields (tentaku_saki_*). Same 11 sub-fields pattern.

| # | Type | Code |
|---|------|------|
| 1-9 | SET | `template.set(EKU0021C010CBSMsg.TENTAKU_SAKI_*, childMap.get("tentaku_saki_*"))` [Previous address (before move-out): code, postal, prefecture, city, district, block, number, building, room] |

### Block 10 - Additional Work Fields (childMap -> template)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKU0021C010CBSMsg.NEWCONST_BUKKEN_CD, childMap.get("newconst_bukken_cd"))` [New construction building code] |
| 2 | SET | `template.set(EKU0021C010CBSMsg.HUKKAT_ANKEN_FLG, childMap.get("hukkat_anken_flg"))` [Revival order flag] |
| 3 | SET | `template.set(EKU0021C010CBSMsg.SAME_EQUIP_RE_MSKM_CD, childMap.get("same_equip_re_mskm_cd"))` [Same equipment re-order code] |
| 4 | SET | `template.set(EKU0021C010CBSMsg.OPSVKEI_HKTGI_FLG, childMap.get("opsvkei_hktgi_flg"))` [Optional service contract succession flag] |
| 5 | SET | `template.set(EKU0021C010CBSMsg.KOJI_SCOPE_CD, childMap.get("koji_scope_cd"))` [Work scope code] |
| 6 | SET | `template.set(EKU0021C010CBSMsg.ISETSU_CD, childMap.get("isetsu_cd"))` [Relocation code] |
| 7 | SET | `template.set(EKU0021C010CBSMsg.KOJI_KIBO_YMD, childMap.get("koji_kibo_ymd"))` [Work desired date] |
| 8 | SET | `template.set(EKU0021C010CBSMsg.DSL_KIBO_YMD, childMap.get("dsl_kibo_ymd"))` [Contract termination desired date] |
| 9 | SET | `template.set(EKU0021C010CBSMsg.SHUNKO_RSV_YMD, childMap.get("shunko_rsv_ymd"))` [Construction scheduled date] |
| 10 | SET | `template.set(EKU0021C010CBSMsg.NYUKYO_RSV_YMD, childMap.get("nyukyo_rsv_ymd"))` [Move-in scheduled date] |
| 11 | SET | `template.set(EKU0021C010CBSMsg.HIKIWATASHI_RSV_YMD, childMap.get("hikiwatashi_rsv_ymd"))` [Handover scheduled date] |
| 12 | SET | `template.set(EKU0021C010CBSMsg.EPOWER_SODEN_RSV_YMD, childMap.get("epower_soden_rsv_ymd"))` [Power transmission scheduled date] |
| 13 | SET | `template.set(EKU0021C010CBSMsg.TEL_RRK_KIBO_YMD, childMap.get("tel_rrk_kibo_ymd"))` [Phone contact desired date] |
| 14 | SET | `template.set(EKU0021C010CBSMsg.TEL_RRK_KIBO_TIME_CD, childMap.get("tel_rrk_kibo_time_cd"))` [Phone contact desired time slot code] |
| 15 | SET | `template.set(EKU0021C010CBSMsg.TAKCHO_KIBO_APO_KIGEN_YMD, childMap.get("takcho_kibo_apo_kigen_ymd"))` [In-home survey desired appointment deadline] |
| 16 | SET | `template.set(EKU0021C010CBSMsg.TNKJ_KIBO_APO_KIGEN_YMD, childMap.get("tnkj_kibo_apo_kigen_ymd"))` [In-home work desired appointment deadline] |
| 17 | SET | `template.set(EKU0021C010CBSMsg.KOJI_APO_RRKS_SHITEI_CD, childMap.get("koji_apo_rrks_shitei_cd"))` [Work appointment contact designation code] |
| 18 | SET | `template.set(EKU0021C010CBSMsg.RRK_WAY_CD, childMap.get("rrk_way_cd"))` [Contact method code] |
| 19 | SET | `template.set(EKU0021C010CBSMsg.RRK_WAY_HOKI, childMap.get("rrk_way_hoki"))` [Contact method supplement] |
| 20 | SET | `template.set(EKU0021C010CBSMsg.KOJIAK_BIKO, childMap.get("kojiak_biko"))` [Work order remarks] |
| 21 | SET | `template.set(EKU0021C010CBSMsg.KOJIAK_BIKO_1, childMap.get("kojiak_biko_1"))` [Work order remarks 1] |
| 22 | SET | `template.set(EKU0021C010CBSMsg.KOJIAK_BIKO_2, childMap.get("kojiak_biko_2"))` [Work order remarks 2] |
| 23 | SET | `template.set(EKU0021C010CBSMsg.DMPSANK_SBT_CD, childMap.get("dmpsank_sbt_cd"))` [Radio wave disaster order type code] |
| 24 | SET | `template.set(EKU0021C010CBSMsg.KEPCO_CTINFO_JUJU_DOI_UM, childMap.get("kepco_ctinfo_juju_doi_um"))` [West Japan Electric customer info acceptance consent] |
| 25 | SET | `template.set(EKU0021C010CBSMsg.CUST_SOS_USE_UM, childMap.get("cust_sos_use_um"))` [Customer SOS usage] |
| 26 | SET | `template.set(EKU0021C010CBSMsg.FAMILY_KEI_FLG, childMap.get("family_kei_flg"))` [Family plan flag] |

### Block 11 - Port Number (Portability) Fields (childMap -> template)

> Map port number (番号ポータビリティ/Number Portability) fields. These fields come in 5 sets (1-5), each with 6 sub-fields.

| # | Type | Code |
|---|------|------|
| 1-5 (set 1) | SET | `bmp_um_1` (Port present/absent), `eoh_tel_no_1` (eo Hikari phone number), `bmp_rsv_ymd_1` (Port scheduled date), `bmp_moto_tushin_jgs_cd_1` (Port original carrier code), `chgb_bmp_um_1` (Pre-change port present/absent), `chgb_eoh_tel_no_1` (Pre-change eo Hikari phone number), `chgb_bmp_rsv_ymd_1` (Pre-change port scheduled date), `chgb_bmp_moto_tushin_jgs_cd_1` (Pre-change original carrier code) |
| 6-13 (set 2) | SET | Same 6 sub-fields numbered `_2` |
| 14-21 (set 3) | SET | Same 6 sub-fields numbered `_3` |
| 22-29 (set 4) | SET | Same 6 sub-fields numbered `_4` |
| 30-37 (set 5) | SET | Same 6 sub-fields numbered `_5` |

### Block 12 - Home Device Fields: Null Init (fields 1-4)

> Pre-initialize home device fields 1 through 4 to null. These are variadic fields for repeatable home device entries (up to 20). Fields 1-4 are always cleared; fields 5+ are populated from childMap.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKU0021C010CBSMsg.TAKNKIKI_SBT_CD_1)` [Home device type code 1] |
| 2 | SET | `template.setNull(EKU0021C010CBSMsg.KKTK_SVC_KEI_NO_1)` [Device service contract number 1] |
| 3 | SET | `template.setNull(EKU0021C010CBSMsg.TAKNKIKI_MODEL_CD_1)` [Home device model code 1] |
| 4 | SET | `template.setNull(EKU0021C010CBSMsg.KKSEIZO_NO_1)` [Device serial number 1] |
| 5 | SET | `template.setNull(EKU0021C010CBSMsg.MACAD_1)` [MAC address 1] |
| 6 | SET | `template.setNull(EKU0021C010CBSMsg.ROUTER_KIND_CD_1)` [Router type code 1] |
| 7 | SET | `template.setNull(EKU0021C010CBSMsg.TK_SBT_CD_1)` [Service type code 1] |
| 8 | SET | `template.setNull(EKU0021C010CBSMsg.CHGB_TAKNIKK_MODEL_CD_1)` [Pre-change home device model code 1] |
| 9 | SET | `template.setNull(EKU0021C010CBSMsg.CHGB_KKSEIZO_NO_1)` [Pre-change device serial number 1] |
| 10 | SET | `template.setNull(EKU0021C010CBSMsg.CHGB_MACAD_1)` [Pre-change MAC address 1] |
| 11 | SET | `template.setNull(EKU0021C010CBSMsg.CHGB_ROUTER_KIND_CD_1)` [Pre-change router type code 1] |
| 12 | SET | `template.setNull(EKU0021C010CBSMsg.CHGB_TK_SBT_CD_1)` [Pre-change service type code 1] |
| 13-24 | SET | Same 12 fields repeated for device indices 2, 3, and 4 |

### Block 13 - Home Device Fields: Populated (fields 5-20)

> Map home device fields 5 through 20 from childMap. Each device entry has 6 sub-fields: type code, service contract number, model code, serial number, MAC address, router type code, and service type code, plus pre-change equivalents.

| # | Type | Code |
|---|------|------|
| 1-20 (device 5-20 type) | SET | `template.set(EKU0021C010CBSMsg.TAKNKIKI_SBT_CD_N, childMap.get("taknkiki_sbt_cd_N"))` [Home device type code N] |
| 21-40 (device 5-20 service) | SET | `template.set(EKU0021C010CBSMsg.KKTK_SVC_KEI_NO_N, childMap.get("kktk_svc_kei_no_N"))` [Device service contract number N] |
| 41-60 (device 5-20 model) | SET | `template.set(EKU0021C010CBSMsg.TAKNKIKI_MODEL_CD_N, childMap.get("taknkiki_model_cd_N"))` [Home device model code N] |
| 61-80 (device 5-20 serial) | SET | `template.set(EKU0021C010CBSMsg.KKSEIZO_NO_N, childMap.get("kkseizo_no_N"))` [Device serial number N] |
| 81-100 (device 5-20 MAC) | SET | `template.set(EKU0021C010CBSMsg.MACAD_N, childMap.get("macad_N"))` [MAC address N] |
| 101-120 (device 5-20 router) | SET | `template.set(EKU0021C010CBSMsg.ROUTER_KIND_CD_N, childMap.get("router_kind_cd_N"))` [Router type code N] |
| 121-140 (device 5-20 svc type) | SET | `template.set(EKU0021C010CBSMsg.TK_SBT_CD_N, childMap.get("tk_sbt_cd_N"))` [Service type code N] |
| 141-160 (device 5-20 pre-change model) | SET | `template.set(EKU0021C010CBSMsg.CHGB_TAKNIKK_MODEL_CD_N, childMap.get("chgb_taknikk_model_cd_N"))` [Pre-change model code N] |
| 161-180 (device 5-20 pre-change serial) | SET | `template.set(EKU0021C010CBSMsg.CHGB_KKSEIZO_NO_N, childMap.get("chgb_kkseizo_no_N"))` [Pre-change serial number N] |
| 181-200 (device 5-20 pre-change MAC) | SET | `template.set(EKU0021C010CBSMsg.CHGB_MACAD_N, childMap.get("chgb_macad_N"))` [Pre-change MAC address N] |
| 201-220 (device 5-20 pre-change router) | SET | `template.set(EKU0021C010CBSMsg.CHGB_ROUTER_KIND_CD_N, childMap.get("chgb_router_kind_cd_N"))` [Pre-change router type code N] |
| 221-240 (device 5-20 pre-change svc type) | SET | `template.set(EKU0021C010CBSMsg.CHGB_TK_SBT_CD_N, childMap.get("chgb_tk_sbt_cd_N"))` [Pre-change service type code N] |

### Block 14 - Null Init: Remaining Variadic Fields

> Pre-initialize remaining variadic fields to null: applicant name, work appointment contact phone, device movement codes (1-20), device change numbers (1-20), previous temporary case numbers (1-20).

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKU0021C010CBSMsg.MSKMSHA_NM)` [Applicant name] |
| 2 | SET | `template.setNull(EKU0021C010CBSMsg.KOJI_APO_RRKS_TELNO)` [Work appointment contact phone number] |
| 3-22 | SET | `template.setNull(EKU0021C010CBSMsg.TAKNKIKI_IDO_CD_N)` [Home device movement code N (1-20)] |
| 23-42 | SET | `template.setNull(EKU0021C010CBSMsg.KIKI_CHG_NO_N)` [Device change number N (1-20)] |
| 43-62 | SET | `template.setNull(EKU0021C010CBSMsg.MOTO_TCASE_NO_N)` [Previous temporary case number N (1-20)] |

### Block 15 - RETURN

> Assemble the template into a CAANMsg array and store it in the paramMap.

| # | Type | Code |
|---|------|------|
| 1 | SET | `CAANMsg[] templates = new CAANMsg[1]` |
| 2 | SET | `templates[0] = template` |
| 3 | SET | `paramMap.put(JCMConstants.TEMPLATE_LIST_KEY, templates)` `[-> TEMPLATE_LIST_KEY]` |
| 4 | RETURN | `return paramMap` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_stat_cd` | Field | Service contract status code - "010" means "Received" (受付済), indicating the order has been accepted into the system |
| `mskm_dtl_no` | Field | Detail number - unique identifier for a work order detail line item |
| `kojiak_no` | Field | Work order number - identifies a specific FTTH work order case |
| `svc_kei_no` | Field | Service contract number - identifies the customer's service contract line |
| `svc_kei_kaisen_ucwk_no` | Field | Service contract modification work number - internal tracking ID for modification work |
| `svc_cd` | Field | Service code - classifies the type of service (e.g., FTTH, fiber internet) |
| `funcCd` | Field | Function code - screen mode indicator; "2" means confirmation/check mode |
| `seiky_kei_no` | Field | Billing contract number - the customer's billing account contract number |
| `seiky_kei_no_work` | Field | Billing contract number (work) - derived contract number used during processing |
| `kksv040321_svc_kei_stat_cd` | Field | ChildMap key for service contract status code |
| `kksv040324_mskm_dtl_no` | Field | ChildMap key for detail number |
| `kksv040324_seiky_kei_no` | Field | ChildMap key for billing contract number |
| `kksv040324_svc_kei_no` | Field | ChildMap key for service contract number |
| `KKSV054601SCWORKLIST` | Field | DataMap key for the work item list containing detail numbers when status is not "Received" |
| `ekk0491d010_seiky_kei_no_work` | Field | DataMap key for work billing contract number |
| `ekk0011d020_mskm_dtl_no` | Field | Work list entry field for detail number |
| `TEMPLATE_ID_EKU0021C010` | Constant | Template ID = "EKU0021C010" for eo Hikari work order miscellaneous changes CBS |
| CAANMsg | Technical | Fujitsu's message class for CBS (Contract/Billing System) communication - used as a key-value message container |
| CBS | Acronym | Contract/Billing System - core Fujitsu billing and contract management system |
| SC | Acronym | Service Component - a component that calls CBS methods for database operations |
| CC | Acronym | Common Component - shared business logic components in the `common` package |
| FTTH | Business term | Fiber To The Home - fiber-optic broadband internet service (eo Hikari) |
| eo Hikari | Business term | Fujitsu's FTTH broadband internet service brand in Japan |
| 工事案件 (Koji Anken) | Japanese | Work order case - a work order case for FTTH installation/modification |
| 諸変更 (Sho-henkou) | Japanese | Miscellaneous changes - catch-all category for non-standard service modifications |
| 受付済 (Uketsuke-zumi) | Japanese | "Received" - order status indicating acceptance into the system |
| 確認 (Kakunin) | Japanese | Confirmation - screen mode for verifying data before actual processing |
| `taknkiki_sbt_cd` | Field | Home device type code - type of home networking device (router, ONU, etc.) |
| `taknkiki_model_cd` | Field | Home device model code - specific model of home networking device |
| `kkseizo_no` | Field | Device serial number - manufacturing serial number of home device |
| `macad` | Field | MAC address - hardware address of the network device |
| `router_kind_cd` | Field | Router type code - classification of the router device |
| `tk_sbt_cd` | Field | Service type code - type of service provided with the device |
| `bmp_*` | Field | Port number (portability) fields - related to number portability (番号ポータビリティ) |
| `bmp_um_*` | Field | Port present/absent flag - whether port number is being used |
| `eoh_tel_no_*` | Field | eo Hikari phone number - VoIP phone number for eo Hikari service |
| `bmp_rsv_ymd_*` | Field | Port scheduled date - date when port is scheduled to occur |
| `bmp_moto_tushin_jgs_cd_*` | Field | Port original carrier code - the previous telecommunications carrier |
| `chgb_bmp_*` | Field | Pre-change port fields - values of port data before the modification |
| `tentaku_*` | Field | Previous address fields (転居前/転宅先) - addresses before move |
| `tentaku_bf_*` | Field | Before-move address fields - address at the location before moving |
| `tentaku_saki_*` | Field | Prior-to-move address fields - address before the move-out |
| `keisha_*` | Field | Contract holder address fields - address of the contract customer |
| `setplace_*` | Field | Installation place address fields - address where equipment is installed |
| `tentakusaki_ad_cd` | Field | Post-move address code - address after the move |
| `dmpsank_sbt_cd` | Field | Radio wave disaster order type code - order type for radio wave interference issues |
| `kepco_ctinfo_juju_doi_um` | Field | West Japan Electric (KEPCO) customer info acceptance consent flag |
| `family_kei_flg` | Field | Family plan flag - indicates if the customer is on a family plan |
| `koji_scope_cd` | Field | Work scope code - defines the scope of the work order |
| `isetsu_cd` | Field | Relocation code - indicates if the service is being relocated |
| `shunko_rsv_ymd` | Field | Construction scheduled date - when construction is scheduled to begin |
| `nyukyo_rsv_ymd` | Field | Move-in scheduled date - when the customer is scheduled to move in |
| `epower_soden_rsv_ymd` | Field | Power transmission scheduled date - when power is scheduled to be transmitted |
| `tel_rrk_kibo_ymd` | Field | Phone contact desired date |
| `tel_rrk_kibo_time_cd` | Field | Phone contact desired time slot code |
| `koji_apo_rrks_shitei_cd` | Field | Work appointment contact designation code |
| `rrk_way_cd` | Field | Contact method code |
| `kojiak_biko` | Field | Work order remarks |
| `ad_form_cd` | Field | Address building type code - type of building (apartment, house, etc.) |
| `nyukyo_flr_cnt_cd` | Field | Move-in floor count code |
| `kcku_flr_cnt_cd` | Field | Building floor count code |
| `direction_cd` | Field | Direction code - building orientation |
| `lgtd` / `lttd` | Field | Longitude / Latitude - GPS coordinates for the installation location |
| `zahyo_hosei_um` | Field | Coordinate correction present/absent flag |
| `place_no` | Field | Place number - location identifier |
| `newconst_bukken_cd` | Field | New construction building code |
| `hukkat_anken_flg` | Field | Revival order flag |
| `same_equip_re_mskm_cd` | Field | Same equipment re-order code |
| `opsvkei_hktgi_flg` | Field | Optional service contract succession flag |
| `dsl_kibo_ymd` | Field | Contract termination desired date |
| `hikiwatashi_rsv_ymd` | Field | Handover scheduled date |
| `cust_sos_use_um` | Field | Customer SOS usage flag |
| `bmp_doji_kj_kibo_um` | Field | Port simultaneous work desired flag |
| `prc_grp_cd` | Field | Price group code |
| `pcrs_cd` | Field | Price course code |
| `pplan_cd` | Field | Price plan code |
| `wrib_type_cd` | Field | Discount type code |
| `plan_chg_fix_ymd` | Field | Plan change fix date |
| `ad_chg_fix_dtm` | Field | Address change completion datetime |
| `menkaihat_anken_no` | Field | Surface development order number |
| `mnkht_koji_cd` | Field | Surface development work code |
| `pon_skbt_cd` | Field | PON identification code (Passive Optical Network) |
| `koji_uk_cd` | Field | Work acceptance code |
| `koji_uk_dtail_cd` | Field | Work acceptance detail code |
| `koji_uk_optnty_ido_dtm` | Field | Work acceptance contract move datetime |
| `koji_saki_ad_mi_fix_flg` | Field | Work prior address unconfirmed flag |
| `kaisen_place_telno` | Field | Line installation place phone number |
| `kepco_busioffice_no` | Field | KEPCO (West Japan Electric Power) business office number |
| `cust_home_tel_no` | Field | Customer home phone number |
| `cust_ktai_tel_no` | Field | Customer mobile phone number |
| `cust_rrks_tel_no` | Field | Customer contact phone number |
| `rrks_offc_nm` | Field | Contact business name |
| `mskmShaNm` | Field | Applicant name (submittor name) |
| `kojiApoRrksTelNo` | Field | Work appointment contact phone number |
| `taknkiki_ido_cd_N` | Field | Home device movement code N (1-20) - indicates if the home device was moved |
| `kikiChgNo_N` | Field | Device change number N (1-20) - tracks device change transactions |
| `motoTcaseNo_N` | Field | Previous temporary case number N (1-20) - reference to prior temporary case |
| `chk_bmp_um_1` | Field | Pre-change port present/absent flag 1 |
| EKU0021C010 | Code | CBS transaction code for eo Hikari work order miscellaneous changes |
| EKU0021C010CBSMsg | Technical | CBS message schema class defining all fields for EKU0021C010 transactions |
| JCMConstants | Technical | Fujitsu JCM framework constants class (control map keys, template list key, etc.) |
| SCControlMapKeys | Technical | Control map key constants (OPERATOR_ID, OPE_DATE, OPE_TIME) |
