# Business Logic — JFUAddKktSvcKeiCC.editInEKK0341D01002() [991 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JFUAddKktSvcKeiCC` |
| Layer | CC / Common Component — Shared mapping component used by multiple screens and CBS entry points |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JFUAddKktSvcKeiCC.editInEKK0341D01002()

This method performs **top-level (upper) mapping** for device-provided service contract registration in the order fulfillment system. It transforms incoming HashMap data from the screen's work area — representing a single service contract line item — into a structured `CAANMsg` template (`EKK0341D010CBSMsg`). This template is then consumed downstream by CBS (Central Business System) to persist or query service contract records.

The method handles multiple **service types** including FTTH registration, Mail service changes, STB (Set-Top Box) linking, equipment transfer, and installation-only services. It dynamically determines the source of address data (mansion new registration, mansion fallback, or home/standard) based on the `MSKM_MNS_TYPE` judgment flag, ensuring the correct address fields populate the output template.

It implements the **builder/routing dispatch pattern**: a single method acts as a central entry point that branches on service type codes, resolves address sources conditionally, and then performs a uniform field-by-field mapping pass over approximately 60+ output message fields. Each field follows a null-check-and-set pattern: if the source is null or empty, call `template.setNull()`; otherwise, call `template.set()` with the resolved value.

Its **role in the larger system** is that of a shared data mapper called from the service registration controller (`addKktSvcKei`) and the CBS invocation handler (`getInvokeCBS`). It bridges the screen-layer work area (HashMaps stored in `IRequestParameterReadWrite`) and the CBS-layer message contract, ensuring all service contract fields — from equipment codes and pricing to installation addresses and trial periods — are properly populated before CBS invocation.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editInEKK0341D01002"])
    CREATE_TEMPLATE(["Create CAANMsg template"])
    SET_TEMPLATE_ID(["Set TEMPLATEID from fixedText"])
    SET_FUNC_CODE_1(["Set FUNC_CODE = FUNC_1 '1'"])
    GET_OPERATOR_ID(["Get OPERATOR_ID from param"])
    GET_OPERATE_DATE(["Get OPE_DATE from param"])
    GET_OPERATE_TIME(["Get OPE_TIME from param"])
    SET_MAP_DATA(["Set operatorId/operateDate/operateDateTime on template"])
    GET_WORK_MAP(["Get mappingWorkArea from param"])
    GET_IN_MAP(["Get inMap from param.getData(fixedText)"])
    GET_TELLIST(["Extract index entry from EKK0341D010TelList"])
    GET_ADDRESS_MAP(["Get useplaceAddressMap"])
    CHECK_ADDRESS_TYPE{"judgeAddressMskmMnsType == '1'?"}
    GET_DELIVERY_MAP_MANSION(["Get kikiSohusAddressMap from FUSV015212CC"])
    CHECK_DELIVERY_MANSION{"kikiSohusAddressMap null?"}
    GET_DELIVERY_MAP_FALLBACK_M(["Get FUSV016007CC fallback"])
    GET_DELIVERY_MAP_HOME(["Get kikiSohusAddressMap from FUSV015211CC"])
    CHECK_DELIVERY_HOME{"kikiSohusAddressMap null?"}
    GET_DELIVERY_MAP_FALLBACK_H(["Get FUSV016102CC fallback"])
    OVERWRITE_FUNC_CODE(["Overwrite FUNC_CODE from inMap"])
    MAP_FIELDS_START(["Begin field mapping loop"])
    CHECK_IN_MAP_NULL{"inMap null or field empty?"}
    SET_FIELD_NULL(["template.setNull(field)"])
    SET_FIELD_VALUE(["template.set(field, inMap value)"])
    CHECK_PARENT_SERVICE{"oya_kei_skbt_cd == '02'?"}
    GET_KAISEN_FALLBACK(["getWorkMapValue from CC_WORK_AREA_NAME_USE"])
    CHECK_KAISEN_NULL{"svc_kei_kaisen_ucwk_no null?"}
    MAP_ADDITIONAL_FIELDS(["Map remaining fields"])
    GET_ADDR_FROM_MAP(["Use kikiSohusAddressMap for delivery address fields"])
    USEPLACE_ADDR_MAP(["Use useplaceAddressMap for installation address fields"])
    MAP_FINAL_FIELDS(["Map trial, regular, guarantee, CAS card fields"])
    GET_UPD_DTM(["Get upd_dtm_bf from EKK0111D010"])
    RETURN_TEMPLATE(["Return template"])

    START --> CREATE_TEMPLATE --> SET_TEMPLATE_ID --> SET_FUNC_CODE_1 --> GET_OPERATOR_ID --> GET_OPERATE_DATE --> GET_OPERATE_TIME --> SET_MAP_DATA --> GET_WORK_MAP --> GET_IN_MAP --> GET_TELLIST --> GET_ADDRESS_MAP --> CHECK_ADDRESS_TYPE
    CHECK_ADDRESS_TYPE -- "Yes (Mansion)" --> GET_DELIVERY_MAP_MANSION
    CHECK_ADDRESS_TYPE -- "No (Home/Standard)" --> GET_DELIVERY_MAP_HOME
    GET_DELIVERY_MAP_MANSION --> CHECK_DELIVERY_MANSION
    CHECK_DELIVERY_MANSION -- "Yes" --> GET_DELIVERY_MAP_FALLBACK_M
    GET_DELIVERY_MAP_FALLBACK_M --> GET_DELIVERY_MAP_MANSION
    CHECK_DELIVERY_MANSION -- "No" --> OVERWRITE_FUNC_CODE
    GET_DELIVERY_MAP_HOME --> CHECK_DELIVERY_HOME
    CHECK_DELIVERY_HOME -- "Yes" --> GET_DELIVERY_MAP_FALLBACK_H
    GET_DELIVERY_MAP_FALLBACK_H --> GET_DELIVERY_MAP_HOME
    CHECK_DELIVERY_HOME -- "No" --> OVERWRITE_FUNC_CODE
    SET_MAP_DATA --> GET_IN_MAP
    GET_IN_MAP --> GET_TELLIST
    GET_ADDRESS_MAP --> CHECK_ADDRESS_TYPE
    CHECK_PARENT_SERVICE --> MAP_FIELDS_START
    MAP_FIELDS_START --> CHECK_IN_MAP_NULL
    CHECK_IN_MAP_NULL -- "Yes" --> SET_FIELD_NULL
    CHECK_IN_MAP_NULL -- "No" --> SET_FIELD_VALUE
    SET_FIELD_NULL --> CHECK_PARENT_SERVICE
    SET_FIELD_VALUE --> CHECK_PARENT_SERVICE
    CHECK_PARENT_SERVICE -- "Yes (Service Wiring)" --> GET_KAISEN_FALLBACK
    CHECK_PARENT_SERVICE -- "No" --> MAP_ADDITIONAL_FIELDS
    GET_KAISEN_FALLBACK --> CHECK_KAISEN_NULL
    CHECK_KAISEN_NULL -- "Yes" --> SET_FIELD_NULL
    CHECK_KAISEN_NULL -- "No" --> MAP_ADDITIONAL_FIELDS
    CHECK_KAISEN_NULL --> MAP_FINAL_FIELDS
    SET_FIELD_NULL --> MAP_FINAL_FIELDS
    SET_FIELD_VALUE --> MAP_FINAL_FIELDS
    MAP_FINAL_FIELDS --> GET_UPD_DTM
    GET_UPD_DTM --> USEPLACE_ADDR_MAP
    USEPLACE_ADDR_MAP --> GET_ADDR_FROM_MAP
    GET_ADDR_FROM_MAP --> MAP_FINAL_FIELDS
    MAP_FINAL_FIELDS --> RETURN_TEMPLATE
```

**CRITICAL — Constant Resolution:**

| Constant | Value | Business Meaning |
|----------|-------|------------------|
| `JCRStrConst.FUNC_1` | `"1"` | Default function code for template creation |
| `OYA_KEI_SKBT_CD_02` | `"02"` | Parent contract identification code — Service contract wiring detail (service line installation with network cabling) |
| `MSKM_MNS_TYPE` check | `"1"` | Mansion new registration flag — when "1", address comes from mansion-specific mapping keys |
| `CC_WORK_AREA_NAME_USE` | `"JFUAddKeishaServiceCCWork"` (or derived) | Work area name for user/consumer contract data |
| `CC_WORK_AREA_NAME_SKK` | Derived from class constants | Work area name for service contract line data |
| `CC_WORK_AREA_NAME_MSKM` | Derived from class constants | Work area name for customer application data |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter container holding screen work area maps, control data (operator ID, operate date/time), and per-screen data maps (e.g., `EKK0341D010TelList`, address maps like `FUSV015211CC`). It carries the full screen context needed to resolve all field values for the output template. |
| 2 | `fixedText` | `String` | The template identifier / screen key used to look up the work area data map. It serves as the key into `param.getData(fixedText)` to retrieve the HashMap containing service contract details, and is also set on the template's `TEMPLATEID` field for traceability. |
| 3 | `index` | `int` | The index into the `EKK0341D010TelList` ArrayList, selecting which service contract line item (telephone line / equipment service line) to map. This method processes one line item at a time, and the index determines which entry in the multi-line service list is being serialized. |

**Instance fields / external state read:**

| Field | Source | Business Description |
|-------|--------|---------------------|
| `CC_WORK_AREA_NAME` | `JFUAddKktSvcKeiCC` class constant | Work area key name for retrieving the operator service contract work map from `param.getMappingWorkArea()` |
| `OYA_KEI_SKBT_CD_02` | `JFUAddKktSvcKeiCC` class constant | Parent service code `"02"` — triggers fallback lookup for service contract wiring detail number |
| `EKK0341D010CBSMsg.*` | Message field constants | All target message field identifiers used in `template.set()` / `template.setNull()` calls |
| `EKK0191D010CBSMsg.FTRIAL_PRD_ENDYMD` | Message field constants | Trial period end date field from a different message class |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JFUAddKktSvcKeiCC.getKeishaWorkMapValue` | - | - | Reads `sysid` from Keisha (owner) work map for customer SYSID lookup |
| R | `JFUAddKktSvcKeiCC.getMskmWorkMapValue` | - | - | Reads `ekk0111_mskm_dtl_no` from Mskm (customer application) work map for registration detail number |
| R | `JFUAddKktSvcKeiCC.getWorkMapValue` | - | - | Reads `seiky_kei_no` (billing contract number) from service contract work area; reads `svc_kei_kaisen_ucwk_no` when parent service code is "02" |

### Additional calls identified from source analysis:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `param.getMappingWorkArea` | - | - | Reads work area map from request parameter (screen work data) |
| R | `param.getData(fixedText)` | - | - | Reads the screen data HashMap keyed by fixedText template ID |
| R | `param.getData("FUSV015211CC")` | - | - | Reads use-place address data from mapping key for installation address fields |
| R | `param.getData("FUSV015212CC")` | - | - | Reads mansion new-registered address data for delivery address (mansion mode only) |
| R | `param.getData("FUSV016007CC")` | - | - | Fallback address map for mansion when primary is null |
| R | `param.getData("FUSV016102CC")` | - | - | Fallback address map for home/standard address mode |
| R | `param.getControlMapData(OPERATOR_ID)` | - | - | Reads operator ID from control map |
| R | `param.getControlMapData(OPE_DATE)` | - | - | Reads operate date from control map |
| R | `param.getControlMapData(OPE_TIME)` | - | - | Reads operate time from control map |
| R | `param.getData("EKK0111D010")` | - | - | Reads update timestamp (before-update) from EKK0111D010 data map |

**Classification rationale:** This method is a pure **Read** operation — it never creates, updates, or deletes data. It exclusively reads HashMap data from the request parameter's work area and control maps, and writes to an in-memory `CAANMsg` template. No entity persistence or database operations occur within this method. The output template is consumed by callers which handle CBS invocation and persistence.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS:JFUAddKktSvcKeiCC.addKktSvcKei | `addKktSvcKei` -> `editInEKK0341D01002` | `setNull` [-], `set` [-] (field mapping, no persistence) |
| 2 | CBS:JFUAddKktSvcKeiCC.getInvokeCBS | `getInvokeCBS` -> `editInEKK0341D01002` | `setNull` [-], `set` [-] (field mapping for CBS response) |

**Upstream chain (addKktSvcKei):** Typically invoked from screen entry `KKSV0004` (Service Contract Registration Screen) -> controller -> `addKktSvcKei` -> `editInEKK0341D01002`. The method maps incoming screen data to CBS message format before CBS invocation.

**Upstream chain (getInvokeCBS):** Invoked during CBS response processing, this method maps CBS return values back to the screen work area (via its complementary `editOutEKK0341D01002` method).

## 6. Per-Branch Detail Blocks

**Block 1** — [SET/INITIALIZATION] Template creation and control map setup (L3593)

Initializes the output message template and populates standard operational metadata.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template = new CAANMsg(EKK0341D010CBSMsg.class.getName())` |
| 2 | EXEC | `template.set(EKK0341D010CBSMsg.TEMPLATEID, fixedText)` // Set template ID from fixedText |
| 3 | SET | `template.set(EKK0341D010CBSMsg.FUNC_CODE, FUNC_1)` // [-> FUNC_1="1"] Default function code |
| 4 | EXEC | `operatorId = param.getControlMapData(SCControlMapKeys.OPERATOR_ID)` // Get operator ID |
| 5 | EXEC | `operateDate = param.getControlMapData(SCControlMapKeys.OPE_DATE)` // Get operate date |
| 6 | EXEC | `operateDateTime = param.getControlMapData(SCControlMapKeys.OPE_TIME)` // Get operate time |
| 7 | EXEC | `template.set(JCMConstants.OPERATOR_ID_KEY, operatorId)` // Set on template |
| 8 | EXEC | `template.set(JCMConstants.OPERATE_DATE_KEY, operateDate)` // Set on template |
| 9 | EXEC | `template.set(JCMConstants.OPERATE_DATETIME_KEY, operateDateTime)` // Set on template |
| 10 | SET | `workMap = (Map)param.getMappingWorkArea()` // Get work area map |

**Block 2** — [IF/ELSE] Work area map resolution (L3608)

Attempts to retrieve the work area HashMap from the mapping work area. If null, inMap is set to null (will be overwritten immediately below).

| # | Type | Code |
|---|------|------|
| 1 | IF | `workMap != null` |
| 2 | SET | `inMap = (HashMap)workMap.get(CC_WORK_AREA_NAME)` // Get work area work map |
| 3 | ELSE | — |
| 4 | SET | `inMap = null` |

**Block 3** — [SET] Screen data map extraction (L3618)

Overrides inMap with actual screen data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap = (HashMap)(param.getData(fixedText))` // Get screen data map |
| 2 | SET | `judgeAddressMskmMnsType = (String)inMap.get("MSKM_MNS_TYPE")` // Get address type judgment flag |

**Block 4** — [SET] Service line list index extraction (L3622)

Extracts the specific service line item from the multi-line list using the provided index.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap = (HashMap)((ArrayList)inMap.get("EKK0341D010TelList")).get(index)` // Get service line at index |

**Block 5** — [IF/ELSE] Use-place address map resolution (L3626)

Retrieves the installation address data map, trying two possible mapping keys.

| # | Type | Code |
|---|------|------|
| 1 | IF | `useplaceAddressMap == null` |
| 2 | SET | `useplaceAddressMap = (HashMap)param.getData("FUSV015211CC")` // Primary use-place address map |
| 3 | ELSE | — |
| 4 | SET | `useplaceAddressMap = (HashMap)param.getData("FUSV016102CC")` // Fallback use-place address map |

**Block 6** — [IF/ELSE] Delivery address map resolution by address type (L3632–3658)

Branches based on `judgeAddressMskmMnsType == "1"` to select mansion vs. home/standard delivery address source.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"1".equals(judgeAddressMskmMnsType)` — [Mansion new registration mode] |
| 2 | SET | `kikiSohusAddressMap = (HashMap)param.getData("FUSV015212CC")` // Mansion new-registered address |
| 3 | IF | `kikiSohusAddressMap == null` |
| 4 | SET | `kikiSohusAddressMap = (HashMap)param.getData("FUSV016007CC")` // Mansion fallback |
| 5 | ELSE | — |
| 6 | IF | `"1".equals(judgeAddressMskmMnsType)` — false → Home/Standard mode |
| 7 | SET | `kikiSohusAddressMap = (HashMap)param.getData("FUSV015211CC")` // Home use-place address |
| 8 | IF | `kikiSohusAddressMap == null` |
| 9 | SET | `kikiSohusAddressMap = (HashMap)param.getData("FUSV016102CC")` // Home fallback |

**Block 7** — [SET] Function code overwrite (L3662)

Overwrites the previously set default function code with the actual value from the data map.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.set(EKK0341D010CBSMsg.FUNC_CODE, inMap.get(JCMConstants.FUNC_CODE_KEY))` // Overwrite with actual value |

**Block 8** — [Field Mapping Loop] Core service contract field mapping (L3667–4455)

This is the main body of the method — approximately 60+ fields mapped using an identical pattern. Each field follows the same structure: check if `inMap` is null or the field value is null/empty, then either call `template.setNull()` or `template.set()` with the resolved value. The fields cover:

| # | Field (source key) | Output Template Field | Business Description |
|---|-------------------|----------------------|---------------------|
| 1 | `kktk_svc_cd` | `KKTK_SVC_CD` | Device-provided service code |
| 2 | `pcrs_cd` | `PCRS_CD` | Pricing course code |
| 3 | `pplan_cd` | `PPLAN_CD` | Pricing plan code |
| 4 | `kktk_sbt_cd` | `KKTK_SBT_CD` | Device-provided service type code |
| 5 | `hdd_capa_cd` | `HDD_CAPA_CD` | HDD capacity code |
| 6 | `svc_use_sta_kibo_ymd` | `SVC_USE_STA_KIBO_YMD` | Service use start desired date (YYYYMMDD) |
| 7 | `rsv_tsta_kibo_ymd` | `RSV_TSTA_KIBO_YMD` | Reservation application start desired date |
| 8 | `kibo_maker_cd` | `KIBO_MAKER_CD` | Desired manufacturer code |
| 9 | `hambai_sbt_cd` | `HAMBAI_SBT_CD` | Sales type code |
| 10 | `tsushin_kiki_set_cd` | `TSUSHIN_KIKI_SET_CD` | Communication device set code |
| 11 | `taknkiki_sbt_cd` | `TAKNKIKI_SBT_CD` | Indoor equipment type code |
| 12 | `taknkiki_model_cd` | `TAKNKIKI_MODEL_CD` | Indoor equipment model code |
| 13 | `taknkiki_sethin_model_cd` | `TAKNKIKI_SETHIN_MODEL_CD` | Indoor equipment set product model code |
| 14 | `huzokuhin_sbt_cd` | `HUZOKUHIN_SBT_CD` | Accessory type code |
| 15 | `kiki_stc_saki_place_no` | `KIKI_STC_SAKI_PLACE_NO` | Equipment installation destination place number |
| 16 | `oya_kei_skbt_cd` | `OYA_KEI_SKBT_CD` | Device-provided service parent contract ID code |
| 17 | `svc_kei_no` | `SVC_KEI_NO` | Service contract number |
| 18 | `svc_kei_ucwk_no` | `SVC_KEI_UCWK_NO` | Service contract detail work number |
| 19 | `svc_kei_kaisen_ucwk_no` | `SVC_KEI_KAISEN_UCWK_NO` | Service contract wiring detail work number — [SPECIAL: conditional fallback] |
| 20 | `op_svc_kei_no` | `OP_SVC_KEI_NO` | Option service contract number |
| 21 | `sysid` | `SYSID` | Customer SYSID — [SPECIAL: work map lookup fallback] |
| 22 | `mskm_dtl_no` | `MSKM_DTL_NO` | Application registration detail number — [SPECIAL: work map lookup] |
| 23 | `link_stb_flg` | `LINK_STB_FLG` | Link STB flag |
| 24 | `kiki_hkat_shitei_soko_cd` | `KIKI_HKAT_SHITEI_SOKO_CD` | Equipment draw designation warehouse code |
| 25 | `kiki_hkat_shitei_skdn_cd` | `KIKI_HKAT_SHITEI_SKDN_CD` | Equipment draw designation shelf code |
| 26 | `taknkiki_ido_cd` | `TAKNKIKI_IDO_CD` | Indoor equipment movement code |
| 27 | `haiso_div` | `HAISO_DIV` | Delivery division |
| 28 | `kiki_huka_info_cd` | `KIKI_HUKA_INFO_CD` | Equipment additional info code |
| 29 | `haiso_way_cd` | `HAISO_WAY_CD` | Delivery method code |
| 30 | `haiso_req_shitei_ymd` | `HAISO_REQ_SHITEI_YMD` | Delivery request designated date |
| 31 | `ad_mi_fix_flg` | `AD_MI_FIX_FLG` | Address undetermined flag |
| 32 | `kiki_soryo_um` | `KIKI_SORYO_UM` | Equipment delivery charge presence/absence |
| 33 | `kiki_soryo_saksei_ymd` | `KIKI_SORYO_SAKSEI_YMD` | Equipment delivery charge creation date |
| 34 | `kiki_sohus_nm` | `KIKI_SOHUS_NM` | Equipment delivery destination name |
| 35 | `kiki_sohus_kana` | `KIKI_SOHUS_KANA` | Equipment delivery destination kana |
| 36 | `kiki_sohus_pcd` | `KIKI_SOHUS_PCD` | Equipment delivery destination postal code |
| 37 | `kiki_sohus_adrttm` | `KIKI_SOHUS_ADRTTM` | Equipment delivery destination address supplement (building name) |
| 38 | `kiki_sohus_adrrm` | `KIKI_SOHUS_ADRRM` | Equipment delivery destination address supplement (room number) |
| 39 | `kiki_sohus_telno` | `KIKI_SOHUS_TELNO` | Equipment delivery destination telephone number |
| 40 | `mansion_bukken_no` | `MANSION_BUKKEN_NO` | Mansion property number |
| 41 | `kiki_sohus_ksh_ad_sai_flg` | `KIKI_SOHUS_KSH_AD_SAI_FLG` | Equipment delivery destination vs. contract address difference flag |
| 42 | `kiki_shs_kbt_shitei_flg` | `KIKI_SHS_KBT_SHITEI_FLG` | Equipment delivery destination individual designation flag |
| 43 | `kiki_shs_hsk_cd_1` | `KIKI_SHS_HSK_CD_1` | Equipment delivery destination supplement code 1 |
| 44 | `kiki_shs_hsk_cd_2` | `KIKI_SHS_HSK_CD_2` | Equipment delivery destination supplement code 2 |
| 45 | `kiki_shs_hsk_memo` | `KIKI_SHS_HSK_MEMO` | Equipment delivery destination supplement memo |
| 46 | `kiki_stc_saki_nm` | `KIKI_STC_SAKI_NM` | Equipment installation destination name |
| 47 | `kiki_stc_saki_kana` | `KIKI_STC_SAKI_KANA` | Equipment installation destination kana |
| 48 | `kiki_stc_saki_pcd` | `KIKI_STC_SAKI_PCD` | Equipment installation destination postal code |
| 49 | `kiki_stc_saki_adrttm` | `KIKI_STC_SAKI_ADRTTM` | Equipment installation destination address supplement (building name) |
| 50 | `kiki_stc_saki_adrrm` | `KIKI_STC_SAKI_ADRRM` | Equipment installation destination address supplement (room number) |
| 51 | `kiki_stc_sk_ksh_ad_sai_flg` | `KIKI_STC_SK_KSH_AD_SAI_FLG` | Equipment installation vs. contract address difference flag |
| 52 | `kiki_stc_sk_telno` | `KIKI_STC_SK_TELNO` | Equipment installation destination telephone number |
| 53 | `kiki_sts_kkk_seiri_chu_flg` | `KIKI_STS_KKK_SEIRI_CHU_FLG` | Equipment installation status sorting in-progress flag |
| 54 | `kiki_sts_hsk_cd_1` | `KIKI_STS_HSK_CD_1` | Equipment installation supplement code 1 |
| 55 | `kiki_sts_hsk_cd_2` | `KIKI_STS_HSK_CD_2` | Equipment installation supplement code 2 |
| 56 | `kiki_sts_hsk_memo` | `KIKI_STS_HSK_MEMO` | Equipment installation supplement memo |
| 57 | `ftrial_kanyu_ymd` | `FTRIAL_KANYU_YMD` | Trial addition date |
| 58 | `ftrial_prd_endymd` | `FTRIAL_PRD_ENDYMD` | Trial period end date (from `EKK0191D010CBSMsg`) |
| 59 | `honkanyu_ymd` | `HONKANYU_YMD` | Regular addition date |
| 60 | `honkanyu_iko_kigen_ymd` | `HONKANYU_IKO_KIGEN_YMD` | Regular addition transfer deadline date |
| 61 | `hosho_cd` | `HOSHO_CD` | Guarantee code |
| 62 | `hosho_staymd` | `HOSHO_STAYMD` | Guarantee start date |
| 63 | `pnlty_hassei_cd` | `PNLTY_HASSEI_CD` | Penalty occurrence code |
| 64 | `ido_div` | `IDO_DIV` | Movement division |
| 65 | `cas_card_use_kyodak_ymd` | `CAS_CARD_USE_KYODAK_YMD` | CAS card usage guarantee date |
| 66 | `seiky_kei_no` | `SEIKY_KEI_NO` | Billing contract number — [SPECIAL: work map lookup] |
| 67 | `prc_kmk_cd` | `PRC_KMK_CD` | Pricing item code |
| 68 | `kiki_seizo_no` | `KIKI_SEIZO_NO` | Equipment serial number |
| 69 | `upd_dtm_bf` | `UPD_DTM_BF` | Update timestamp before (from EKK0111D010) |
| 70 | `kiki_itens_mv_jssis_skcd` | `KIKI_ITENS_MV_JSSIS_SKCD` | Equipment transfer destination moving implementer ID code |
| 71 | `kiki_shs_ad_man_input_flg` | `KIKI_SHS_AD_MAN_INPUT_FLG` | Equipment delivery destination address manual entry flag |

Each field follows this block pattern:

**Block 8.N** — [IF] Field null-check `[field_name]` (L varies)

| # | Type | Code |
|---|------|------|
| 1 | IF | `inMap == null || inMap.get("fieldName") == null || "".equals(inMap.get("fieldName"))` |
| 2 | EXEC | `template.setNull(EKK0341D010CBSMsg.FIELD_NAME)` // Set null if source missing |
| 3 | ELSE | — |
| 4 | EXEC | `template.set(EKK0341D010CBSMsg.FIELD_NAME, (String)inMap.get("fieldName"))` // Set value |

**Block 8.19** — [SPECIAL] `svc_kei_kaisen_ucwk_no` with parent service code fallback (L3854)

| # | Type | Code |
|---|------|------|
| 1 | IF | `inMap == null || inMap.get("svc_kei_kaisen_ucwk_no") == null` |
| 2 | EXEC | `template.setNull(EKK0341D010CBSMsg.SVC_KEI_KAISEN_UCWK_NO)` |
| 3 | IF | `inMap.get("oya_kei_skbt_cd").equals(OYA_KEI_SKBT_CD_02)` — [-> OYA_KEI_SKBT_CD_02="02"] Service wiring detail |
| 4 | EXEC | `svc_kei_kaisen_ucwk_no = getWorkMapValue(param, "svc_kei_kaisen_ucwk_no", CC_WORK_AREA_NAME_USE)` // Fallback from work area |
| 5 | IF | `svc_kei_kaisen_ucwk_no == null` |
| 6 | EXEC | `template.setNull(EKK0341D010CBSMsg.SVC_KEI_KAISEN_UCWK_NO)` |
| 7 | ELSE | — |
| 8 | EXEC | `template.set(EKK0341D010CBSMsg.SVC_KEI_KAISEN_UCWK_NO, svc_kei_kaisen_ucwk_no)` |

**Block 8.21** — [SPECIAL] `sysid` with Keisha work map fallback (L3771)

| # | Type | Code |
|---|------|------|
| 1 | IF | `inMap == null || inMap.get("sysid") == null` |
| 2 | EXEC | `sysid = getKeishaWorkMapValue(param, "sysid")` // Lookup from Keisha work map |
| 3 | IF | `sysid == null` |
| 4 | EXEC | `template.setNull(EKK0341D010CBSMsg.SYSID)` |
| 5 | ELSE | — |
| 6 | EXEC | `template.set(EKK0341D010CBSMsg.SYSID, sysid)` |

**Block 8.22** — [SPECIAL] `mskm_dtl_no` with Mskm work map fallback (L3796)

| # | Type | Code |
|---|------|------|
| 1 | IF | `inMap == null || inMap.get("mskm_dtl_no") == null` |
| 2 | EXEC | `mskm_dtl_no = getMskmWorkMapValue(param, "ekk0111_mskm_dtl_no")` // Lookup from Mskm work map |
| 3 | IF | `mskm_dtl_no == null` |
| 4 | EXEC | `template.setNull(EKK0341D010CBSMsg.MSKM_DTL_NO)` |
| 5 | ELSE | — |
| 6 | EXEC | `template.set(EKK0341D010CBSMsg.MSKM_DTL_NO, mskm_dtl_no)` |

**Block 9** — [Address Fields] Use kikiSohusAddressMap for delivery address fields (L4045–4128)

After the main field loop, delivery address details are mapped from `kikiSohusAddressMap` (determined in Block 6 by `judgeAddressMskmMnsType`).

| # | Type | Code |
|---|------|------|
| 1 | IF | `kikiSohusAddressMap == null || kikiSohusAddressMap.get("ad_cd") == null` |
| 2 | EXEC | `template.setNull(EKK0341D010CBSMsg.KIKI_SOHUS_AD_CD)` |
| 3 | ELSE | — |
| 4 | EXEC | `template.set(EKK0341D010CBSMsg.KIKI_SOHUS_AD_CD, kikiSohusAddressMap.get("ad_cd"))` |
| 5 | IF | `kikiSohusAddressMap == null || kikiSohusAddressMap.get("state_nm") == null` |
| 6 | EXEC | `template.setNull(EKK0341D010CBSMsg.KIKI_SOHUS_STATE_NM)` |
| 7 | ELSE | — |
| 8 | EXEC | `template.set(EKK0341D010CBSMsg.KIKI_SOHUS_STATE_NM, kikiSohusAddressMap.get("state_nm"))` |
| 9 | IF | `kikiSohusAddressMap == null || kikiSohusAddressMap.get("city_nm") == null` |
| 10 | EXEC | `template.setNull(EKK0341D010CBSMsg.KIKI_SOHUS_CITY_NM)` |
| 11 | ELSE | — |
| 12 | EXEC | `template.set(EKK0341D010CBSMsg.KIKI_SOHUS_CITY_NM, kikiSohusAddressMap.get("city_nm"))` |
| 13 | IF | `kikiSohusAddressMap == null || kikiSohusAddressMap.get("oaztsu_nm") == null` |
| 14 | EXEC | `template.setNull(EKK0341D010CBSMsg.KIKI_SOHUS_OAZTSU_NM)` |
| 15 | ELSE | — |
| 16 | EXEC | `template.set(EKK0341D010CBSMsg.KIKI_SOHUS_OAZTSU_NM, kikiSohusAddressMap.get("oaztsu_nm"))` |
| 17 | IF | `kikiSohusAddressMap == null || kikiSohusAddressMap.get("azcho_nm") == null` |
| 18 | EXEC | `template.setNull(EKK0341D010CBSMsg.KIKI_SOHUS_AZCHO_NM)` |
| 19 | ELSE | — |
| 20 | EXEC | `template.set(EKK0341D010CBSMsg.KIKI_SOHUS_AZCHO_NM, kikiSohusAddressMap.get("azcho_nm"))` |
| 21 | IF | `kikiSohusAddressMap == null || kikiSohusAddressMap.get("after_bnchi") == null` |
| 22 | EXEC | `template.setNull(EKK0341D010CBSMsg.KIKI_SOHUS_BNCHIGO)` |
| 23 | ELSE | — |
| 24 | EXEC | `template.set(EKK0341D010CBSMsg.KIKI_SOHUS_BNCHIGO, kikiSohusAddressMap.get("after_bnchi"))` |

**Block 10** — [Address Fields] Use useplaceAddressMap for installation address fields (L4250–4341)

Installation address details are mapped from `useplaceAddressMap` (the use-place address determined in Block 5).

| # | Type | Code |
|---|------|------|
| 1 | IF | `useplaceAddressMap == null || useplaceAddressMap.get("ad_cd") == null` |
| 2 | EXEC | `template.setNull(EKK0341D010CBSMsg.KIKI_STC_SAKI_AD_CD)` |
| 3 | ELSE | — |
| 4 | EXEC | `template.set(EKK0341D010CBSMsg.KIKI_STC_SAKI_AD_CD, useplaceAddressMap.get("ad_cd"))` |
| 5 | IF | `useplaceAddressMap == null || useplaceAddressMap.get("state_nm") == null` |
| 6 | EXEC | `template.setNull(EKK0341D010CBSMsg.KIKI_STC_SAKI_STATE_NM)` |
| 7 | ELSE | — |
| 8 | EXEC | `template.set(EKK0341D010CBSMsg.KIKI_STC_SAKI_STATE_NM, useplaceAddressMap.get("state_nm"))` |
| 9 | IF | `useplaceAddressMap == null || useplaceAddressMap.get("city_nm") == null` |
| 10 | EXEC | `template.setNull(EKK0341D010CBSMsg.KIKI_STC_SAKI_CITY_NM)` |
| 11 | ELSE | — |
| 12 | EXEC | `template.set(EKK0341D010CBSMsg.KIKI_STC_SAKI_CITY_NM, useplaceAddressMap.get("city_nm"))` |
| 13 | IF | `useplaceAddressMap == null || useplaceAddressMap.get("oaztsu_nm") == null` |
| 14 | EXEC | `template.setNull(EKK0341D010CBSMsg.KIKI_STC_SAKI_OAZTSU_NM)` |
| 15 | ELSE | — |
| 16 | EXEC | `template.set(EKK0341D010CBSMsg.KIKI_STC_SAKI_OAZTSU_NM, useplaceAddressMap.get("oaztsu_nm"))` |
| 17 | IF | `useplaceAddressMap == null || useplaceAddressMap.get("azcho_nm") == null` |
| 18 | EXEC | `template.setNull(EKK0341D010CBSMsg.KIKI_STC_SAKI_AZCHO_NM)` |
| 19 | ELSE | — |
| 20 | EXEC | `template.set(EKK0341D010CBSMsg.KIKI_STC_SAKI_AZCHO_NM, useplaceAddressMap.get("azcho_nm"))` |
| 21 | IF | `useplaceAddressMap == null || useplaceAddressMap.get("after_bnchi") == null` |
| 22 | EXEC | `template.setNull(EKK0341D010CBSMsg.KIKI_STC_SAKI_BNCHIGO)` |
| 23 | ELSE | — |
| 24 | EXEC | `template.set(EKK0341D010CBSMsg.KIKI_STC_SAKI_BNCHIGO, useplaceAddressMap.get("after_bnchi"))` |

**Block 11** — [SET] Update timestamp retrieval (L4451–4465)

Gets the pre-update timestamp from the EKK0111D010 data map for audit tracking.

| # | Type | Code |
|---|------|------|
| 1 | SET | `upd_dtm_bf = (String)((HashMap)(param.getData("EKK0111D010"))).get(EKK0111D010CBSMsg.UPD_DTM)` |
| 2 | IF | `upd_dtm_bf == null` |
| 3 | EXEC | `template.setNull(EKK0341D010CBSMsg.UPD_DTM_BF)` |
| 4 | ELSE | — |
| 5 | EXEC | `template.set(EKK0341D010CBSMsg.UPD_DTM_BF, upd_dtm_bf)` |

**Block 12** — [RETURN] Return template (L4574)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return template` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `kktk_svc_cd` | Field | Device-provided service code — classifies the type of device service (e.g., FTTH, Mail, STB) |
| `pcrs_cd` | Field | Pricing course code — determines the pricing tier for the service |
| `pplan_cd` | Field | Pricing plan code — specific pricing plan associated with the service contract |
| `kktk_sbt_cd` | Field | Device-provided service type code — subtype of device service (e.g., rental, purchase) |
| `hdd_capa_cd` | Field | HDD capacity code — hard disk drive capacity classification for recording devices |
| `svc_use_sta_kibo_ymd` | Field | Service use start desired date (YYYYMMDD) — customer-requested service activation date |
| `rsv_tsta_kibo_ymd` | Field | Reservation application start desired date — desired date for reservation-based activation |
| `kibo_maker_cd` | Field | Desired manufacturer code — customer's preferred equipment manufacturer |
| `hambai_sbt_cd` | Field | Sales type code — type of sales channel (direct, retail, online, etc.) |
| `tsushin_kiki_set_cd` | Field | Communication device set code — identifies the communication device bundle |
| `taknkiki_sbt_cd` | Field | Indoor equipment type code — type of indoor unit (router, modem, STB, etc.) |
| `taknkiki_model_cd` | Field | Indoor equipment model code — specific model number of indoor equipment |
| `huzokuhin_sbt_cd` | Field | Accessory type code — accessories bundled with the equipment |
| `kiki_stc_saki_place_no` | Field | Equipment installation destination place number — location identifier for installation site |
| `oya_kei_skbt_cd` | Field | Parent contract identification code — links to a parent/anchor service contract (e.g., "02" = service wiring detail) |
| `svc_kei_no` | Field | Service contract number — primary contract identifier |
| `svc_kei_ucwk_no` | Field | Service contract detail work number — internal tracking ID for service contract line items |
| `svc_kei_kaisen_ucwk_no` | Field | Service contract wiring detail work number — tracks network cabling/installation work for service lines |
| `op_svc_kei_no` | Field | Option service contract number — identifies optional add-on services |
| `sysid` | Field | System ID — unique customer identifier in the system |
| `mskm_dtl_no` | Field | Customer application registration detail number — links to the customer application record |
| `link_stb_flg` | Field | Link STB flag — indicates whether Set-Top Box is linked (for IPTV/cable services) |
| `kiki_hkat_shitei_soko_cd` | Field | Equipment draw designation warehouse code — warehouse for equipment allocation |
| `kiki_hkat_shitei_skdn_cd` | Field | Equipment draw designation shelf code — specific shelf within the warehouse |
| `taknkiki_ido_cd` | Field | Indoor equipment movement code — tracks equipment relocation (e.g., move-in, move-out) |
| `haiso_div` | Field | Delivery division — type of delivery (standard, express, installation-included) |
| `kiki_huka_info_cd` | Field | Equipment additional info code — supplementary equipment information |
| `haiso_way_cd` | Field | Delivery method code — how equipment is delivered (courier, self-pickup, installation-team) |
| `haiso_req_shitei_ymd` | Field | Delivery request designated date — requested delivery date |
| `ad_mi_fix_flg` | Field | Address undetermined flag — indicates whether the customer's address is finalized |
| `kiki_soryo_um` | Field | Equipment delivery charge presence/absence — whether delivery charges apply |
| `kiki_soryo_saksei_ymd` | Field | Equipment delivery charge creation date — when the delivery charge was generated |
| `kiki_sohus_nm` | Field | Equipment delivery destination name — name of the delivery address |
| `kiki_sohus_kana` | Field | Equipment delivery destination kana — phonetic reading of the delivery address name |
| `kiki_sohus_pcd` | Field | Equipment delivery destination postal code |
| `kiki_sohus_adrttm` | Field | Equipment delivery destination address supplement (building name) |
| `kiki_sohus_adrrm` | Field | Equipment delivery destination address supplement (room number) |
| `kiki_sohus_telno` | Field | Equipment delivery destination telephone number |
| `mansion_bukken_no` | Field | Mansion property number — identifier for apartment/mansion unit |
| `kiki_sohus_ksh_ad_sai_flg` | Field | Equipment delivery destination vs. contract address difference flag — indicates if delivery address differs from contract address |
| `kiki_shs_kbt_shitei_flg` | Field | Equipment delivery destination individual designation flag — whether delivery address was individually specified |
| `kiki_shs_hsk_cd_1/2` | Field | Equipment delivery destination supplement code 1/2 — supplementary codes for delivery address |
| `kiki_shs_hsk_memo` | Field | Equipment delivery destination supplement memo — free-text memo for delivery address |
| `kiki_stc_saki_nm` | Field | Equipment installation destination name |
| `kiki_stc_saki_kana` | Field | Equipment installation destination kana |
| `kiki_stc_saki_adrttm` | Field | Equipment installation destination address supplement (building name) |
| `kiki_stc_sk_ksh_ad_sai_flg` | Field | Equipment installation vs. contract address difference flag |
| `kiki_sts_kkk_seiri_chu_flg` | Field | Equipment installation status sorting in-progress flag |
| `kiki_sts_hsk_cd_1/2` | Field | Equipment installation supplement code 1/2 |
| `kiki_sts_hsk_memo` | Field | Equipment installation supplement memo |
| `ftrial_kanyu_ymd` | Field | Trial addition date — date the trial period was added |
| `ftrial_prd_endymd` | Field | Trial period end date — end of the trial service period |
| `honkanyu_ymd` | Field | Regular addition date — date the service became permanent (converted from trial) |
| `honkanyu_iko_kigen_ymd` | Field | Regular addition transfer deadline date — deadline for trial-to-regular conversion |
| `hosho_cd` | Field | Guarantee code — type of service guarantee/warranty |
| `hosho_staymd` | Field | Guarantee start date |
| `pnlty_hassei_cd` | Field | Penalty occurrence code — indicates if/when contract penalties apply |
| `ido_div` | Field | Movement division — type of service change (new, transfer, cancellation) |
| `cas_card_use_kyodak_ymd` | Field | CAS card usage guarantee date — CAS (Conditional Access System) card validity |
| `seiky_kei_no` | Field | Billing contract number — links to the billing contract for charges |
| `prc_kmk_cd` | Field | Pricing item code — specific pricing line item code |
| `kiki_seizo_no` | Field | Equipment serial number — unique hardware identifier |
| `kiki_itens_mv_jssis_skcd` | Field | Equipment transfer destination moving implementer ID code — identifies the moving service provider |
| `kiki_shs_ad_man_input_flg` | Field | Equipment delivery destination address manual entry flag — indicates if address was manually entered |
| `MSKM_MNS_TYPE` | Field | Mansion/new registration type judgment flag — `"1"` = mansion new registration mode, otherwise home/standard mode |
| `EKK0341D010TelList` | Field | Service telephone list — ArrayList of service contract line items in the work area |
| `CC_WORK_AREA_NAME` | Constant | Work area name key — `"JFUAddKeishaServiceCCWork"` for operator service work data |
| `CC_WORK_AREA_NAME_USE` | Constant | Work area name key for user/consumer service contract data |
| `CC_WORK_AREA_NAME_SKK` | Constant | Work area name key for service contract line data |
| `CC_WORK_AREA_NAME_MSKM` | Constant | Work area name key for customer application data |
| `OYA_KEI_SKBT_CD_02` | Constant | `"02"` — Parent contract ID code for service contract wiring detail |
| `FUNC_1` | Constant | `"1"` — Default function code for CBS message templates |
| `EKK0341D010CBSMsg` | Class | CBS message class for service contract registration input |
| `EKK0191D010CBSMsg` | Class | CBS message class for trial period data |
| `CAANMsg` | Class | Base message class for CBS communication templates |
| `IRequestParameterReadWrite` | Interface | Request parameter interface providing access to work area maps, control data, and screen data |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service |
| STB | Acronym | Set-Top Box — decoding equipment for IPTV/cable TV services |
| CBS | Acronym | Central Business System — the core backend system handling service contract persistence |
| SOD | Acronym | Service Order Data — telecom order fulfillment entity |
| MAP | Acronym | Message Access Protocol — message template system |
| HDD | Acronym | Hard Disk Drive — storage device for recording equipment |
| CAS | Acronym | Conditional Access System — content protection system for digital broadcasting |
| KK_T_KKTK_SVC_KEI | Entity | Service contract header table in the KK_T_* table naming convention |