# Business Logic — JKKSeikyKeiHenkoCC.editInMsg_EKK0491C060() [450 LOC]

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

## 1. Role

### JKKSeikyKeiHenkoCC.editInMsg_EKK0491C060()

This method is responsible for constructing the inbound CBS (Callback System) message used during invoice contract detail modifications — the "request content change" operation in the K-Opticom billing system. In Japanese business terms, the screen (EKK0491C060) enables operators to modify invoice-related contract details such as billing recipient address, contact information, invoicing preferences, and payment scheduling for existing contracted customers.

The method follows a **builder pattern**: it first initializes a shared message map via `editInMsg(param)`, creates a typed `CAANMsg` template using the `EKK0491C060CBSMsg` schema, then systematically populates 40+ message fields by copying data from the `childMap` parameter. The `childMap` acts as a transfer container carrying pre-validated screen input from one of two possible source screens (EKK0011D020 or KKSVC040505).

The method serves as a **data transformation bridge** between the presentation layer (screen inputs) and the CBS layer (message-based communication). It does not perform any business logic validation or database operations — its sole purpose is mapping flat string fields from a transfer map into a strongly typed CBS message schema. The output `paramMap` contains the assembled `CAANMsg[]` template wrapped under `JCMConstants.TEMPLATE_LIST_KEY`, ready to be dispatched to downstream CBS processing.

All fields are handled uniformly: if the source value in `childMap` is an empty string or absent, the corresponding CBS message field is set to null (clearing it); otherwise, the value is copied verbatim as a string. This consistent null-vs-copy pattern ensures that only fields the user has actively modified (or cleared) appear in the outgoing message.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editInMsg_EKK0491C060"])
    STEP1["Create paramMap from editInMsg"]
    STEP2["Create CAANMsg template<br/>EKK0491C060CBSMsg"]
    STEP3["Set TEMPLATEID = 'EKK0491C060'"]
    STEP4["Set FUNC_CODE = '1'"]
    STEP5["Set OPERATOR_ID from controlMap"]
    STEP6["Set OPERATE_DATE from controlMap"]
    STEP7["Set OPERATE_DATETIME from controlMap"]
    STEP8["Get workMap from param"]
    STEP9["Update FUNC_CODE from dataMap"]
    COND_EKKO["ekk0011d020_mskm_dtl_no<br/>empty or missing?"]
    COND_KKSV["kksv040505_mskm_dtl_no<br/>empty?"]
    SET_NULL_1["setNull MSKM_DTL_NO"]
    SET_KKSV["set MSKM_DTL_NO<br/>from kksv040505_mskm_dtl_no"]
    SET_EKKO["set MSKM_DTL_NO<br/>from ekk0011d020_mskm_dtl_no"]
    COND_IDENTITY["kksv040505_seiky_kei_no<br/>empty?"]
    SET_NULL_2["setNull SEIKY_KEI_NO"]
    SET_KKSV_2["set SEIKY_KEI_NO<br/>from kksv040505_seiky_kei_no"]
    COND_DETAILS["Process each of 30+ fields:<br/>seiky_kei_kana through hktgim_rsv_aply_ymd"]
    SET_NULL_DETAILS["If childMap value is empty/missing:<br/>template.setNull(field)"]
    SET_DETAILS["If childMap value is present:<br/>template.set(field, value)"]
    WRAP["Create CAANMsg[1] array,<br/>put into paramMap"]
    RETURN(["Return paramMap"])

    START --> STEP1
    STEP1 --> STEP2
    STEP2 --> STEP3
    STEP3 --> STEP4
    STEP4 --> STEP5
    STEP5 --> STEP6
    STEP6 --> STEP7
    STEP7 --> STEP8
    STEP8 --> STEP9
    STEP9 --> COND_EKKO
    COND_EKKO -- "Yes" --> COND_KKSV
    COND_EKKO -- "No" --> SET_EKKO
    COND_KKSV -- "Yes" --> SET_NULL_1
    COND_KKSV -- "No" --> SET_KKSV
    SET_NULL_1 --> COND_IDENTITY
    SET_KKSV --> COND_IDENTITY
    SET_EKKO --> COND_IDENTITY
    COND_IDENTITY -- "Yes" --> SET_NULL_2
    COND_IDENTITY -- "No" --> SET_KKSV_2
    SET_NULL_2 --> COND_DETAILS
    SET_KKSV_2 --> COND_DETAILS
    COND_DETAILS --> SET_NULL_DETAILS
    SET_NULL_DETAILS --> SET_DETAILS
    SET_DETAILS --> WRAP
    WRAP --> RETURN
```

**CRITICAL — Constant Resolution:**
- `TEMPLATE_ID_EKK0491C060 = "EKK0491C060"` (defined in `JKKAdInfChgConstCC`) — the template identifier for the invoice contract detail modification CBS message schema.
- `FUNC_CODE = "1"` — hardcoded as a literal string, indicating function type 1 (update/modification operation).
- All 40+ field copies check `"".equals(childMap.get("..."))` — meaning the condition triggers null-clearing when the value is an empty string or when the key is absent from `childMap`.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter object carrying the full web request context. Provides access to control map data (operator ID, operation date/time) via `getControlMapData()`, and the work area mapping for session-level data sharing. The result `paramMap` is stored back into this object for downstream consumption. |
| 2 | `dataMap` | `Map<String, Object>` | A data container holding functional metadata extracted from the screen request. Specifically read for `JCMConstants.FUNC_CODE_KEY` which overrides the initial hardcoded `FUNC_CODE` value of "1" with the actual function code from the incoming request. |
| 3 | `childMap` | `HashMap<String, Object>` | A child transfer map carrying the pre-populated screen input fields from a specific source screen. Contains keys such as `kksv040505_*`, `ekk0011d020_*`, `ad_chk_lv`, `sohus_ad_chk_lv`, and `hktgim_rsv_aply_ymd`. These represent the actual invoice contract detail fields (recipient address, contact info, invoicing settings, reservation dates, etc.) entered or modified on the source screen. The `childMap` may originate from screen `EKK0011D020` or screen `KKSVC040505` depending on the navigation path. |

### External State Read
- `editInMsg(param)` — instance method call on the same class, initializes shared/common message fields and returns a `paramMap`
- `SCControlMapKeys.OPERATOR_ID` — constant key to retrieve operator ID from the request's control map
- `SCControlMapKeys.OPE_DATE` — constant key to retrieve operation date from the request's control map
- `SCControlMapKeys.OPE_TIME` — constant key to retrieve operation timestamp from the request's control map
- `JCMConstants.FUNC_CODE_KEY` — constant key for the function code stored in `dataMap`
- `JCMConstants.OPERATOR_ID_KEY` — constant key to store operator ID in the CBS message
- `JCMConstants.OPERATE_DATE_KEY` — constant key to store operation date in the CBS message
- `JCMConstants.OPERATE_DATETIME_KEY` — constant key to store operation timestamp in the CBS message
- `JCMConstants.TEMPLATE_LIST_KEY` — constant key under which the final `CAANMsg[]` array is stored in `paramMap`

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `JKKSeikyKeiHenkoCC.editInMsg` | - | - | Calls `editInMsg(param)` in `JKKSeikyKeiHenkoCC` to initialize the base paramMap with shared/common message configuration before adding EKK0491C060-specific fields. |
| R | `SCW00701SFLogic.getName` | - | - | No direct call found in this method. Pre-computed evidence listed; method does not invoke SCW00701SFLogic directly. |
| - | `JCKMvnoCustInfoAddCC.setNull` | - | - | No direct call found in this method. Pre-computed evidence listed but not invoked by this method. |
| - | `JKKKapKeiInfoCancelCC.setNull` | - | - | No direct call found in this method. Pre-computed evidence listed but not invoked by this method. |
| - | `JKKKikiModelKappuInfoCC.setNull` | - | - | No direct call found in this method. Pre-computed evidence listed but not invoked by this method. |
| - | `JKKKisnUwHmdkAddCC.setNull` | - | - | No direct call found in this method. Pre-computed evidence listed but not invoked by this method. |
| - | `JKKMvnoSvcKeiStaAddCC.setNull` | - | - | No direct call found in this method. Pre-computed evidence listed but not invoked by this method. |

**Note:** This method performs **no direct database or CBS operations**. It exclusively constructs and returns a message template (`paramMap` containing a `CAANMsg[]` array). The only cross-method call is `editInMsg(param)`, which initializes the shared paramMap structure. All subsequent work is in-memory field population into the `CAANMsg` template via `template.set()` and `template.setNull()` calls, writing to the `EKK0491C060CBSMsg` schema fields. No SC Codes or Entity/DB tables are directly accessed.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | N/A | `JKKSeikyKeiHenkoCC.execEKK0491C060()` -> `JKKSeikyKeiHenkoCC.editInMsg_EKK0491C060(param, dataMap, childMap)` | `template.setNull/set` (in-memory CBS field population) |

**Instructions:**
- The only direct caller identified in the code graph is `JKKSeikyKeiHenkoCC.execEKK0491C060()`, which is a method within the same class.
- No screen or batch entry points (KKSV* classes) were found calling this method directly within 8 hops. The entry point is presumed to be the EKK0491C060 screen, which invokes `execEKK0491C060()`, which in turn calls this method to build the inbound message.
- Terminal operations from this method are exclusively in-memory `template.setNull()` and `template.set()` calls on the `CAANMsg` object — no database writes, no CBS invocations, no external service calls.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] (L1397)

> Initialize the base paramMap by delegating to the shared `editInMsg` method. This common setup configures default fields shared across all EKK0491C060 message-building methods.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap = editInMsg(param)` // Initialize shared paramMap via base editInMsg |
| 2 | SET | `template = new CAANMsg(EKK0491C060CBSMsg.class.getName())` // Create CBS message template with EKK0491C060 schema |

**Block 2** — [SET] (L1401-1411)

> Set the CBS message header fields: template ID, function code, operator ID, and operation timestamp. These are common metadata fields required by all CBS messages.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0491C060CBSMsg.TEMPLATEID, TEMPLATE_ID_EKK0491C060)` // [-> TEMPLATE_ID_EKK0491C060 = "EKK0491C060"] |
| 2 | SET | `template.set(EKK0491C060CBSMsg.FUNC_CODE, "1")` // Hardcoded function code "1" |
| 3 | SET | `operatorId = param.getControlMapData(SCControlMapKeys.OPERATOR_ID)` // Read operator ID from request control map |
| 4 | SET | `template.set(JCMConstants.OPERATOR_ID_KEY, operatorId)` // Store operator ID in template |
| 5 | SET | `operateDate = param.getControlMapData(SCControlMapKeys.OPE_DATE)` // Read operation date from control map |
| 6 | SET | `template.set(JCMConstants.OPERATE_DATE_KEY, operateDate)` // Store operation date in template |
| 7 | SET | `operateDateTime = param.getControlMapData(SCControlMapKeys.OPE_TIME)` // Read operation timestamp from control map |
| 8 | SET | `template.set(JCMConstants.OPERATE_DATETIME_KEY, operateDateTime)` // Store operation datetime in template |

**Block 3** — [SET] (L1413-1421)

> Declare local variables for work area data extraction and update the FUNC_CODE from the dataMap.

| # | Type | Code |
|---|------|------|
| 1 | SET | `templateArray = null` // Unused local variable declaration |
| 2 | SET | `inMap = null` // Unused local variable declaration |
| 3 | SET | `inList = null` // Unused local variable declaration |
| 4 | SET | `workMap = param.getMappingWorkArea()` // Get work area mapping (comment: 作業領域の取得 = "Get work area") |
| 5 | SET | `template.set(EKK0491C060CBSMsg.FUNC_CODE, dataMap.get(JCMConstants.FUNC_CODE_KEY))` // Override FUNC_CODE with value from dataMap (comment: 機能コード = "Function code") |

**Block 4** — [IF-ELSEIF-ELSE] `ekk0011d020_mskm_dtl_no empty or missing?` (L1423-1435)

> Resolve the detail number (申込明細番号 = "Application detail number"). Priority: first check `ekk0011d020_mskm_dtl_no`, then fallback to `kksv040505_mskm_dtl_no`, else null.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `"".equals(childMap.get("ekk0011d020_mskm_dtl_no")) || !childMap.containsKey("ekk0011d020_mskm_dtl_no")` // Check if EKK source detail number is empty or absent |
| 2 | IF-ELSEIF-ELSE | Nested check on `kksv040505_mskm_dtl_no` |

**Block 4.1** — [NESTED IF] `kksv040505_mskm_dtl_no empty?` (L1424-1430)

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_mskm_dtl_no"))` // Check if KKSVC source detail number is empty |
| 2 | EXEC (Block 4.1.1) | `template.setNull(EKK0491C060CBSMsg.MSKM_DTL_NO)` // Set to null (neither source has a value) |
| 3 | EXEC (Block 4.1.2) | `template.set(EKK0491C060CBSMsg.MSKM_DTL_NO, (String)childMap.get("kksv040505_mskm_dtl_no"))` // Use KKSVC source value |

**Block 4.2** — [ELSE] `ekk0011d020_mskm_dtl_no present` (L1433-1435)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.set(EKK0491C060CBSMsg.MSKM_DTL_NO, (String)childMap.get("ekk0011d020_mskm_dtl_no"))` // Use EKK source value (comment: 請求契約内容変更マップ.申込明細番号 -> 申込明細番号 = "Invoice contract detail modification map: Application detail number") |

**Block 5** — [IF-ELSE] `kksv040505_seiky_kei_no empty?` (L1437-1443)

> Map the invoice contract number (請求契約番号 = "Invoice contract number") from KKSVC source.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_seiky_kei_no"))` // Check if invoice contract number is empty |
| 2 | EXEC (Block 5.1) | `template.setNull(EKK0491C060CBSMsg.SEIKY_KEI_NO)` // Null-clear when empty |
| 3 | EXEC (Block 5.2) | `template.set(EKK0491C060CBSMsg.SEIKY_KEI_NO, (String)childMap.get("kksv040505_seiky_kei_no"))` // Copy value |

**Block 6** — [IF-ELSE] `kksv040505_seiky_kei_kana empty?` (L1445-1451)

> Map the invoice contract kana name (請求契約カナ名 = "Invoice contract Kana name").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_seiky_kei_kana"))` |
| 2 | EXEC (Block 6.1) | `template.setNull(EKK0491C060CBSMsg.SEIKY_KEI_KANA)` |
| 3 | EXEC (Block 6.2) | `template.set(EKK0491C060CBSMsg.SEIKY_KEI_KANA, (String)childMap.get("kksv040505_seiky_kei_kana"))` |

**Block 7** — [IF-ELSE] `kksv040505_info_dsp_cd empty?` (L1453-1459)

> Map the information display code (情報表示コード = "Information display code").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_info_dsp_cd"))` |
| 2 | EXEC (Block 7.1) | `template.setNull(EKK0491C060CBSMsg.INFO_DSP_CD)` |
| 3 | EXEC (Block 7.2) | `template.set(EKK0491C060CBSMsg.INFO_DSP_CD, (String)childMap.get("kksv040505_info_dsp_cd"))` |

**Block 8** — [IF-ELSE] `kksv040505_seikyus_hakko_yh empty?` (L1461-1467)

> Map the invoice document issuance necessity flag (請求書発行要否 = "Invoice document issuance necessity").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_seikyus_hakko_yh"))` |
| 2 | EXEC (Block 8.1) | `template.setNull(EKK0491C060CBSMsg.SEIKYUS_HAKKO_YH)` |
| 3 | EXEC (Block 8.2) | `template.set(EKK0491C060CBSMsg.SEIKYUS_HAKKO_YH, (String)childMap.get("kksv040505_seikyus_hakko_yh"))` |

**Block 9** — [IF-ELSE] `kksv040505_sks_shs_ksh_ad_sai_flg empty?` (L1469-1475)

> Map the invoice document recipient vs contract address mismatch flag (請求書送付先_契約者住所差異フラグ = "Invoice document recipient vs contract address difference flag").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_sks_shs_ksh_ad_sai_flg"))` |
| 2 | EXEC (Block 9.1) | `template.setNull(EKK0491C060CBSMsg.SKS_SHS_KSH_AD_SAI_FLG)` |
| 3 | EXEC (Block 9.2) | `template.set(EKK0491C060CBSMsg.SKS_SHS_KSH_AD_SAI_FLG, (String)childMap.get("kksv040505_sks_shs_ksh_ad_sai_flg"))` |

**Block 10** — [IF-ELSE] `kksv040505_sks_shs_nm_cust_nm_sai_flg empty?` (L1477-1483)

> Map the invoice document recipient name vs customer name mismatch flag (請求書送付先名_お客様名差異フラグ = "Invoice document recipient name vs customer name difference flag").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_sks_shs_nm_cust_nm_sai_flg"))` |
| 2 | EXEC (Block 10.1) | `template.setNull(EKK0491C060CBSMsg.SKS_SHS_NM_CUST_NM_SAI_FLG)` |
| 3 | EXEC (Block 10.2) | `template.set(EKK0491C060CBSMsg.SKS_SHS_NM_CUST_NM_SAI_FLG, (String)childMap.get("kksv040505_sks_shs_nm_cust_nm_sai_flg"))` |

**Block 11** — [IF-ELSE] `kksv040505_shs_hojin_sbt_cd empty?` (L1485-1491)

> Map the recipient legal entity type code (送付先法人格種別コード = "Recipient legal entity type code").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_shs_hojin_sbt_cd"))` |
| 2 | EXEC (Block 11.1) | `template.setNull(EKK0491C060CBSMsg.SHS_HOJIN_SBT_CD)` |
| 3 | EXEC (Block 11.2) | `template.set(EKK0491C060CBSMsg.SHS_HOJIN_SBT_CD, (String)childMap.get("kksv040505_shs_hojin_sbt_cd"))` |

**Block 12** — [IF-ELSE] `kksv040505_shs_hojin_zengo_shitei_cd empty?` (L1493-1499)

> Map the recipient legal entity prefix/suffix designation code (送付先法人格前後指定コード = "Recipient legal entity prefix/suffix designation code").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_shs_hojin_zengo_shitei_cd"))` |
| 2 | EXEC (Block 12.1) | `template.setNull(EKK0491C060CBSMsg.SHS_HOJIN_ZENGO_SHITEI_CD)` |
| 3 | EXEC (Block 12.2) | `template.set(EKK0491C060CBSMsg.SHS_HOJIN_ZENGO_SHITEI_CD, (String)childMap.get("kksv040505_shs_hojin_zengo_shitei_cd"))` |

**Block 13** — [IF-ELSE] `kksv040505_shs_kana empty?` (L1501-1507)

> Map the recipient kana name (送付先カナ名 = "Recipient Kana name").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_shs_kana"))` |
| 2 | EXEC (Block 13.1) | `template.setNull(EKK0491C060CBSMsg.SHS_KANA)` |
| 3 | EXEC (Block 13.2) | `template.set(EKK0491C060CBSMsg.SHS_KANA, (String)childMap.get("kksv040505_shs_kana"))` |

**Block 14** — [IF-ELSE] `kksv040505_sohus_nm empty?` (L1509-1515)

> Map the recipient name (送付先名 = "Recipient name").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_sohus_nm"))` |
| 2 | EXEC (Block 14.1) | `template.setNull(EKK0491C060CBSMsg.SOHUS_NM)` |
| 3 | EXEC (Block 14.2) | `template.set(EKK0491C060CBSMsg.SOHUS_NM, (String)childMap.get("kksv040505_sohus_nm"))` |

**Block 15** — [IF-ELSE] `kksv040505_sohus_bkm empty?` (L1517-1523)

> Map the recipient department name (送付先部課名 = "Recipient department name").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_sohus_bkm"))` |
| 2 | EXEC (Block 15.1) | `template.setNull(EKK0491C060CBSMsg.SOHUS_BKM)` |
| 3 | EXEC (Block 15.2) | `template.set(EKK0491C060CBSMsg.SOHUS_BKM, (String)childMap.get("kksv040505_sohus_bkm"))` |

**Block 16** — [IF-ELSE] `kksv040505_sohus_tntsha_nm empty?` (L1525-1531)

> Map the recipient responsible person name (送付先担当者名 = "Recipient responsible person name").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_sohus_tntsha_nm"))` |
| 2 | EXEC (Block 16.1) | `template.setNull(EKK0491C060CBSMsg.SOHUS_TNTSHA_NM)` |
| 3 | EXEC (Block 16.2) | `template.set(EKK0491C060CBSMsg.SOHUS_TNTSHA_NM, (String)childMap.get("kksv040505_sohus_tntsha_nm"))` |

**Block 17** — [IF-ELSE] `kksv040505_sohus_ad_cd empty?` (L1533-1539)

> Map the recipient address code (送付先住所コード = "Recipient address code").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_sohus_ad_cd"))` |
| 2 | EXEC (Block 17.1) | `template.setNull(EKK0491C060CBSMsg.SOHUS_AD_CD)` |
| 3 | EXEC (Block 17.2) | `template.set(EKK0491C060CBSMsg.SOHUS_AD_CD, (String)childMap.get("kksv040505_sohus_ad_cd"))` |

**Block 18** — [IF-ELSE] `kksv040505_sohus_pcd empty?` (L1541-1547)

> Map the recipient postal code (送付先郵便番号 = "Recipient postal code").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_sohus_pcd"))` |
| 2 | EXEC (Block 18.1) | `template.setNull(EKK0491C060CBSMsg.SOHUS_PCD)` |
| 3 | EXEC (Block 18.2) | `template.set(EKK0491C060CBSMsg.SOHUS_PCD, (String)childMap.get("kksv040505_sohus_pcd"))` |

**Block 19** — [IF-ELSE] `kksv040505_sohus_state_nm empty?` (L1549-1555)

> Map the recipient prefecture name (送付先都道府県名 = "Recipient prefecture name").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_sohus_state_nm"))` |
| 2 | EXEC (Block 19.1) | `template.setNull(EKK0491C060CBSMsg.SOHUS_STATE_NM)` |
| 3 | EXEC (Block 19.2) | `template.set(EKK0491C060CBSMsg.SOHUS_STATE_NM, (String)childMap.get("kksv040505_sohus_state_nm"))` |

**Block 20** — [IF-ELSE] `kksv040505_sohus_city_nm empty?` (L1557-1563)

> Map the recipient city/town/village name (送付先市区町村名 = "Recipient city/town/village name").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_sohus_city_nm"))` |
| 2 | EXEC (Block 20.1) | `template.setNull(EKK0491C060CBSMsg.SOHUS_CITY_NM)` |
| 3 | EXEC (Block 20.2) | `template.set(EKK0491C060CBSMsg.SOHUS_CITY_NM, (String)childMap.get("kksv040505_sohus_city_nm"))` |

**Block 21** — [IF-ELSE] `kksv040505_sohus_oaztsu_nm empty?` (L1565-1571)

> Map the recipient district name (送付先大字通称名 = "Recipient large character street alias name").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_sohus_oaztsu_nm"))` |
| 2 | EXEC (Block 21.1) | `template.setNull(EKK0491C060CBSMsg.SOHUS_OAZTSU_NM)` |
| 3 | EXEC (Block 21.2) | `template.set(EKK0491C060CBSMsg.SOHUS_OAZTSU_NM, (String)childMap.get("kksv040505_sohus_oaztsu_nm"))` |

**Block 22** — [IF-ELSE] `kksv040505_sohus_azcho_nm empty?` (L1573-1579)

> Map the recipient street name (送付先字丁目名 = "Recipient character/chome name").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_sohus_azcho_nm"))` |
| 2 | EXEC (Block 22.1) | `template.setNull(EKK0491C060CBSMsg.SOHUS_AZCHO_NM)` |
| 3 | EXEC (Block 22.2) | `template.set(EKK0491C060CBSMsg.SOHUS_AZCHO_NM, (String)childMap.get("kksv040505_sohus_azcho_nm"))` |

**Block 23** — [IF-ELSE] `kksv040505_sohus_adrttm empty?` (L1581-1587)

> Map the recipient address supplement — building name (送付先住所補記・建物名 = "Recipient address supplementary note - building name").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_sohus_adrttm"))` |
| 2 | EXEC (Block 23.1) | `template.setNull(EKK0491C060CBSMsg.SOHUS_ADRTTM)` |
| 3 | EXEC (Block 23.2) | `template.set(EKK0491C060CBSMsg.SOHUS_ADRTTM, (String)childMap.get("kksv040505_sohus_adrttm"))` |

**Block 24** — [IF-ELSE] `kksv040505_sohus_adrrm empty?` (L1589-1595)

> Map the recipient address supplement — room number (送付先住所補記・部屋番号 = "Recipient address supplementary note - room number").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_sohus_adrrm"))` |
| 2 | EXEC (Block 24.1) | `template.setNull(EKK0491C060CBSMsg.SOHUS_ADRRM)` |
| 3 | EXEC (Block 24.2) | `template.set(EKK0491C060CBSMsg.SOHUS_ADRRM, (String)childMap.get("kksv040505_sohus_adrrm"))` |

**Block 25** — [IF-ELSE] `kksv040505_sohus_bnchigo empty?` (L1597-1603)

> Map the recipient lot number (送付先番地番号 = "Recipient lot number").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_sohus_bnchigo"))` |
| 2 | EXEC (Block 25.1) | `template.setNull(EKK0491C060CBSMsg.SOHUS_BNCHIGO)` |
| 3 | EXEC (Block 25.2) | `template.set(EKK0491C060CBSMsg.SOHUS_BNCHIGO, (String)childMap.get("kksv040505_sohus_bnchigo"))` |

**Block 26** — [IF-ELSE] `kksv040505_sohus_telno empty?` (L1605-1611)

> Map the recipient phone number (送付先電話番号 = "Recipient phone number").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_sohus_telno"))` |
| 2 | EXEC (Block 26.1) | `template.setNull(EKK0491C060CBSMsg.SOHUS_TELNO)` |
| 3 | EXEC (Block 26.2) | `template.set(EKK0491C060CBSMsg.SOHUS_TELNO, (String)childMap.get("kksv040505_sohus_telno"))` |

**Block 27** — [IF-ELSE] `kksv040505_sohus_fax_no empty?` (L1613-1619)

> Map the recipient FAX number (送付先FAX番号 = "Recipient FAX number").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_sohus_fax_no"))` |
| 2 | EXEC (Block 27.1) | `template.setNull(EKK0491C060CBSMsg.SOHUS_FAX_NO)` |
| 3 | EXEC (Block 27.2) | `template.set(EKK0491C060CBSMsg.SOHUS_FAX_NO, (String)childMap.get("kksv040505_sohus_fax_no"))` |

**Block 28** — [IF-ELSE] `kksv040505_sohus_mlad empty?` (L1621-1627)

> Map the recipient email address (送付先メールアドレス = "Recipient email address").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_sohus_mlad"))` |
| 2 | EXEC (Block 28.1) | `template.setNull(EKK0491C060CBSMsg.SOHUS_MLAD)` |
| 3 | EXEC (Block 28.2) | `template.set(EKK0491C060CBSMsg.SOHUS_MLAD, (String)childMap.get("kksv040505_sohus_mlad"))` |

**Block 29** — [IF-ELSE] `kksv040505_sohus_ad_man_input_flg empty?` (L1629-1635)

> Map the recipient address manual entry flag (送付先住所手動入力フラグ = "Recipient address manual input flag").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_sohus_ad_man_input_flg"))` |
| 2 | EXEC (Block 29.1) | `template.setNull(EKK0491C060CBSMsg.SOHUS_AD_MAN_INPUT_FLG)` |
| 3 | EXEC (Block 29.2) | `template.set(EKK0491C060CBSMsg.SOHUS_AD_MAN_INPUT_FLG, (String)childMap.get("kksv040505_sohus_ad_man_input_flg"))` |

**Block 30** — [IF-ELSE] Version 4.01.00 fix: `sohus_ad_chk_lv empty?` (L1637-1649)

> Map the recipient address check level (住所チェックレベル = "Address check level"). Originally used `ad_chk_lv` key (v4.00.00 added via ANK-0398), corrected in v4.01.00 to use `sohus_ad_chk_lv` key for consistency.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("sohus_ad_chk_lv"))` // v4.01.00 corrected from `ad_chk_lv` |
| 2 | EXEC (Block 30.1) | `template.setNull(EKK0491C060CBSMsg.SOHUS_AD_CHK_LV)` |
| 3 | EXEC (Block 30.2) | `template.set(EKK0491C060CBSMsg.SOHUS_AD_CHK_LV, (String)childMap.get("sohus_ad_chk_lv"))` // v4.01.00 corrected |

**Block 31** — [IF-ELSE] `kksv040505_seikyus_sohus_chge_ymd empty?` (L1651-1657)

> Map the invoice document recipient change date (請求書送付先変更年月日 = "Invoice document recipient change year-month-date").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_seikyus_sohus_chge_ymd"))` |
| 2 | EXEC (Block 31.1) | `template.setNull(EKK0491C060CBSMsg.SEIKYUS_SOHUS_CHGE_YMD)` |
| 3 | EXEC (Block 31.2) | `template.set(EKK0491C060CBSMsg.SEIKYUS_SOHUS_CHGE_YMD, (String)childMap.get("kksv040505_seikyus_sohus_chge_ymd"))` |

**Block 32** — [IF-ELSE] `kksv040505_seiky_way_aply_adj_ymd empty?` (L1659-1665)

> Map the invoice method application adjustment date (請求方法適用調整年月日 = "Invoice method application adjustment year-month-date").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_seiky_way_aply_adj_ymd"))` |
| 2 | EXEC (Block 32.1) | `template.setNull(EKK0491C060CBSMsg.SEIKY_WAY_APLY_ADJ_YMD)` |
| 3 | EXEC (Block 32.2) | `template.set(EKK0491C060CBSMsg.SEIKY_WAY_APLY_ADJ_YMD, (String)childMap.get("kksv040505_seiky_way_aply_adj_ymd"))` |

**Block 33** — [IF-ELSE] `kksv040505_rsv_tsta_kibo_ymd empty?` (L1667-1673)

> Map the reservation application start desired date (予約適用開始希望年月日 = "Reservation application start desired year-month-date").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_rsv_tsta_kibo_ymd"))` |
| 2 | EXEC (Block 33.1) | `template.setNull(EKK0491C060CBSMsg.RSV_TSTA_KIBO_YMD)` |
| 3 | EXEC (Block 33.2) | `template.set(EKK0491C060CBSMsg.RSV_TSTA_KIBO_YMD, (String)childMap.get("kksv040505_rsv_tsta_kibo_ymd"))` |

**Block 34** — [IF-ELSE] `kksv040505_rsv_aply_ymd empty?` (L1675-1681)

> Map the reservation application date (予約適用年月日 = "Reservation application year-month-date").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_rsv_aply_ymd"))` |
| 2 | EXEC (Block 34.1) | `template.setNull(EKK0491C060CBSMsg.RSV_APLY_YMD)` |
| 3 | EXEC (Block 34.2) | `template.set(EKK0491C060CBSMsg.RSV_APLY_YMD, (String)childMap.get("kksv040505_rsv_aply_ymd"))` |

**Block 35** — [IF-ELSE] `kksv040505_ido_div empty?` (L1683-1689)

> Map the migration division (異動区分 = "Migration division/type").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_ido_div"))` |
| 2 | EXEC (Block 35.1) | `template.setNull(EKK0491C060CBSMsg.IDO_DIV)` |
| 3 | EXEC (Block 35.2) | `template.set(EKK0491C060CBSMsg.IDO_DIV, (String)childMap.get("kksv040505_ido_div"))` |

**Block 36** — [IF-ELSE] `kksv040505_first_seiky_ym empty?` (L1691-1697)

> Map the first invoice month (初回請求年月 = "First invoice year-month").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_first_seiky_ym"))` |
| 2 | EXEC (Block 36.1) | `template.setNull(EKK0491C060CBSMsg.FIRST_SEIKY_YM)` |
| 3 | EXEC (Block 36.2) | `template.set(EKK0491C060CBSMsg.FIRST_SEIKY_YM, (String)childMap.get("kksv040505_first_seiky_ym"))` |

**Block 37** — [IF-ELSE] `kksv040505_first_pay_mskmsho_sohu_yh empty?` (L1698-1704)

> Map the first payment application document sending necessity (初回支払申込書送付要否 = "First payment application document sending necessity").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_first_pay_mskmsho_sohu_yh"))` |
| 2 | EXEC (Block 37.1) | `template.setNull(EKK0491C060CBSMsg.FIRST_PAY_MSKMSHO_SOHU_YH)` |
| 3 | EXEC (Block 37.2) | `template.set(EKK0491C060CBSMsg.FIRST_PAY_MSKMSHO_SOHU_YH, (String)childMap.get("kksv040505_first_pay_mskmsho_sohu_yh"))` |

**Block 38** — [IF-ELSE] `kksv040505_first_pay_mskmsho_sohu_ymd empty?` (L1706-1712)

> Map the first payment application document sending date (初回支払申込書送付年月日 = "First payment application document sending year-month-date").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_first_pay_mskmsho_sohu_ymd"))` |
| 2 | EXEC (Block 38.1) | `template.setNull(EKK0491C060CBSMsg.FIRST_PAY_MSKMSHO_SOHU_YMD)` |
| 3 | EXEC (Block 38.2) | `template.set(EKK0491C060CBSMsg.FIRST_PAY_MSKMSHO_SOHU_YMD, (String)childMap.get("kksv040505_first_pay_mskmsho_sohu_ymd"))` |

**Block 39** — [IF-ELSE] `kksv040505_first_pay_mskmsho_rcp_ymd empty?` (L1714-1720)

> Map the first payment application document receipt date (初回支払申込書受領年月日 = "First payment application document receipt year-month-date").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_first_pay_mskmsho_rcp_ymd"))` |
| 2 | EXEC (Block 39.1) | `template.setNull(EKK0491C060CBSMsg.FIRST_PAY_MSKMSHO_RCP_YMD)` |
| 3 | EXEC (Block 39.2) | `template.set(EKK0491C060CBSMsg.FIRST_PAY_MSKMSHO_RCP_YMD, (String)childMap.get("kksv040505_first_pay_mskmsho_rcp_ymd"))` |

**Block 40** — [IF-ELSE] `kksv040505_upd_dtm_bf empty?` (L1722-1728)

> Map the update datetime before update (更新年月日時分秒（更新前） = "Update year-month-date hour-minute-second (before update)").

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040505_upd_dtm_bf"))` |
| 2 | EXEC (Block 40.1) | `template.setNull(EKK0491C060CBSMsg.UPD_DTM_BF)` |
| 3 | EXEC (Block 40.2) | `template.set(EKK0491C060CBSMsg.UPD_DTM_BF, (String)childMap.get("kksv040505_upd_dtm_bf"))` |

> **Note (L1730-1737):** A commented-out block previously handled `ekk0491c240_upd_dtm` as an alternative source for the update datetime field. This was replaced by the current `kksv040505_upd_dtm_bf` approach.

**Block 41** — [IF-ELSE] OM-2016-0000145: `hktgim_rsv_aply_ymd empty?` (L1739-1745)

> Map the legacy reservation application date for inheritance (引継元予約適用年月日 = "Legacy reservation application year-month-date"). Added under change request OM-2016-0000145 for handling reservation data inherited from previous system generations.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("hktgim_rsv_aply_ymd"))` // Added OM-2016-0000145 |
| 2 | EXEC (Block 41.1) | `template.setNull(EKK0491C060CBSMsg.HKTGIM_RSV_APLY_YMD)` |
| 3 | EXEC (Block 41.2) | `template.set(EKK0491C060CBSMsg.HKTGIM_RSV_APLY_YMD, (String)childMap.get("hktgim_rsv_aply_ymd"))` |

**Block 42** — [RETURN] (L1747-1751)

> Finalize the message by wrapping the single `CAANMsg` template into an array and storing it in the `paramMap` under `TEMPLATE_LIST_KEY`, then returning the map for downstream CBS processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `templates = new CAANMsg[1]` // Create array with single element |
| 2 | SET | `templates[0] = template` // Populate with the constructed template |
| 3 | SET | `paramMap.put(JCMConstants.TEMPLATE_LIST_KEY, templates)` // Store template array in paramMap |
| 4 | RETURN | `return paramMap` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `seiky_kei_no` | Field | Invoice contract number — the unique identifier for a billing contract line item in the K-Opticom system |
| `mskm_dtl_no` | Field | Application detail number — a sub-identifier for a specific application/detail within an invoice contract |
| `seiky_kei_kana` | Field | Invoice contract Kana name — the phonetic (Kana) representation of the contract holder's name |
| `info_dsp_cd` | Field | Information display code — controls how information is presented on screens |
| `seikyus_hakko_yh` | Field | Invoice document issuance necessity — flag indicating whether a physical invoice document should be generated |
| `sks_shs_ksh_ad_sai_flg` | Field | Invoice document recipient vs contract address difference flag — indicates if the billing address differs from the contract address |
| `sks_shs_nm_cust_nm_sai_flg` | Field | Invoice document recipient name vs customer name difference flag — indicates if the billing recipient name differs from the registered customer name |
| `shs_hojin_sbt_cd` | Field | Recipient legal entity type code — classifies the type of legal entity (e.g., corporation, individual) receiving invoices |
| `shs_hojin_zengo_shitei_cd` | Field | Recipient legal entity prefix/suffix designation code — determines prefix/suffix formatting for legal entity names |
| `shs_kana` | Field | Recipient Kana name — phonetic name of the invoice document recipient |
| `sohus_nm` | Field | Recipient name — the name of the entity/individual receiving invoice documents |
| `sohus_bkm` | Field | Recipient department name — the department or division within the recipient organization |
| `sohus_tntsha_nm` | Field | Recipient responsible person name — the specific contact person at the recipient organization |
| `sohus_ad_cd` | Field | Recipient address code — a coded reference to the recipient's postal address |
| `sohus_pcd` | Field | Recipient postal code — the 7-digit Japanese postal code |
| `sohus_state_nm` | Field | Recipient prefecture name — the prefecture (都道府県) portion of the recipient's address |
| `sohus_city_nm` | Field | Recipient city/town/village name — the city (市区町村) portion of the recipient's address |
| `sohus_oaztsu_nm` | Field | Recipient large character street alias name — the district/oaza portion of the Japanese address |
| `sohus_azcho_nm` | Field | Recipient character/chome name — the chome/ban/go portion of the Japanese address |
| `sohus_adrttm` | Field | Recipient address supplement — building name — additional address info for building/apartment name |
| `sohus_adrrm` | Field | Recipient address supplement — room number — additional address info for room/suite number |
| `sohus_bnchigo` | Field | Recipient lot number — the land parcel number in the Japanese address system |
| `sohus_telno` | Field | Recipient phone number — contact telephone number for the invoice recipient |
| `sohus_fax_no` | Field | Recipient FAX number — contact FAX number |
| `sohus_mlad` | Field | Recipient email address — electronic mail address for invoice delivery |
| `sohus_ad_man_input_flg` | Field | Recipient address manual entry flag — indicates whether the address was manually entered vs. auto-resolved |
| `sohus_ad_chk_lv` | Field | Recipient address check level — the validation/check level applied to the address |
| `seikyus_sohus_chge_ymd` | Field | Invoice document recipient change date — the date when the invoice recipient information was last changed |
| `seiky_way_aply_adj_ymd` | Field | Invoice method application adjustment date — the date for adjusting which invoicing method applies |
| `rsv_tsta_kibo_ymd` | Field | Reservation application start desired date — the date the customer wants the reservation to become effective |
| `rsv_aply_ymd` | Field | Reservation application date — the date the reservation was applied |
| `ido_div` | Field | Migration division — classification code for service migration type (e.g., contract transfer, change) |
| `first_seiky_ym` | Field | First invoice year-month — the first month for which an invoice will be generated |
| `first_pay_mskmsho_sohu_yh` | Field | First payment application document sending necessity — whether the first payment application document should be mailed |
| `first_pay_mskmsho_sohu_ymd` | Field | First payment application document sending date — when the first payment application document is sent |
| `first_pay_mskmsho_rcp_ymd` | Field | First payment application document receipt date — when the first payment application document is received |
| `upd_dtm_bf` | Field | Update datetime before update — the timestamp of the record before this modification was applied |
| `hktgim_rsv_aply_ymd` | Field | Legacy reservation application date — reservation date inherited from a previous system generation (added OM-2016-0000145) |
| EKK0491C060 | Screen ID | Invoice contract detail modification screen — the primary screen for modifying invoice-related contract information |
| KKSVC040505 | Screen ID | Source screen providing KKSVC-prefixed data fields to the childMap |
| EKK0011D020 | Screen ID | Source screen providing EKK-prefixed data fields to the childMap (fallback for mskm_dtl_no) |
| CAANMsg | Class | The CBS message container class used for building and passing typed messages between system components |
| EKK0491C060CBSMsg | Class | The CBS message schema class defining the field structure for the EKK0491C060 invoice contract detail modification message |
| TEMPLATE_ID_EKK0491C060 | Constant | Template identifier value `"EKK0491C060"` — used to identify the CBS message schema version |
| CBS | Acronym | Callback System — Fujitsu's middleware for service-oriented message-based communication |
| SC Code | Acronym | Service Component code — identifies the specific service component (e.g., EKK0491C060CBSMsg) |
| K-Opticom | Business term | The telecommunications service provider whose billing and contract management system this code supports |
| FUNC_CODE | Field | Function code — identifies the type of operation (e.g., "1" for update/modification in this context) |
| OPERATOR_ID_KEY | Field | The operator (user) ID performing the operation, tracked for audit trail purposes |
| TEMPLATE_LIST_KEY | Field | The key under which the assembled `CAANMsg[]` array is stored in the result paramMap |
