# Business Logic — JKKSodSendCC.editInMsgEKK1041D010() [116 LOC]

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

## 1. Role

### JKKSodSendCC.editInMsgEKK1041D010()

This method serves as a **Service Order Data (SOD) message mapping component** for the EKK1041D010 service scenario. It maps order configuration data (`odrSetInfo`) into a `CAANMsg` template (`EKK1041D010CBSMsg`) so the downstream CBS (CBS message handler) receives properly formatted outbound order information. The method acts as a data transformer bridging the internal order set info structure with the standardized S/I (System Interface) message format used for SOD dispatch.

The method handles **eight distinct request type codes** (`yokyu_sbt_cd`): New Registration (02), Service Suspension (03), Service Reactivation (07), Deletion (08), Temporary Suspension (10), Temporary Suspension Release (11), and Toki/Emergency (14). Each request type determines which SOD send date field(s) are populated with the current operation date, as different request types require different date tracking (e.g., deletion vs. temporary suspension vs. normal add).

The design follows a **template-building + delegation pattern**: it initializes a `CAANMsg` template, performs null-mapping for missing fields, delegates common setup to `editInMsgBasicCmn`, populates all message fields from `odrSetInfo`, and finally delegates the completed template to `editInMsgCmn` for inclusion in the inbound request parameters. This method is a shared utility called by `executeSodSend` as a pre-processing step before service component execution.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editInMsgEKK1041D010"])
    START --> INIT["Initialize CAANMsg template"]
    INIT --> NULL_MAP["fillCAANMSGNullMapping"]
    NULL_MAP --> BASIC["editInMsgBasicCmn"]
    BASIC --> SETID["Set TEMPLATEID EKK1041D010"]
    SETID --> SETFUNC["Set FUNC_CODE FUNC_CD_1"]
    SETFUNC --> EXTRACT["Extract yokyuSbtCd from odrSetInfo"]
    EXTRACT --> D02{yokyuSbtCd == 02}
    D02 -->|Yes| SETADD1["Set addSodSendYmd getOpeDate"]
    D02 -->|No| D03{yokyuSbtCd == 03}
    SETADD1 --> D03
    D03 -->|Yes| SETSTP["Set stpSodSendYmd getOpeDate"]
    D03 -->|No| D07{yokyuSbtCd == 07}
    SETSTP --> D07
    D07 -->|Yes| SETADD2["Set addSodSendYmd getOpeDate"]
    D07 -->|No| D08{yokyuSbtCd == 08}
    SETADD2 --> D08
    D08 -->|Yes| SETDEL["Set delSodSendYmd getOpeDate"]
    D08 -->|No| D10{yokyuSbtCd == 10}
    SETDEL --> D10
    D10 -->|Yes| SETSTP2["Set stpSodSendYmd getOpeDate"]
    D10 -->|No| D11{yokyuSbtCd == 11}
    SETSTP2 --> D11
    D11 -->|Yes| SETSTPRL["Set stpRlsSodSendYmd getOpeDate"]
    D11 -->|No| D14{yokyuSbtCd == 14}
    SETSTPRL --> D14
    D14 -->|Yes| SETADD3["Set addSodSendYmd getOpeDate"]
    D14 -->|No| SKIP["No date update no-op"]
    SETADD3 --> MAP
    SETADD2 --> MAP
    SETDEL --> MAP
    SETSTP2 --> MAP
    SETSTPRL --> MAP
    SKIP --> MAP["Map service contract fields"]
    SETSTP --> MAP
    SETADD1 --> MAP
    SETSTP --> MAP
    SETADD2 --> MAP
    SETDEL --> MAP
    SETSTP2 --> MAP
    SETSTPRL --> MAP
    MAP --> MAP2["Set ODR_SET_TG_VALUE to null"]
    MAP2 --> MAP3["Map device and address fields"]
    MAP3 --> MAP4["Map SOD send date fields"]
    MAP4 --> MAP5["Map additional fields"]
    MAP5 --> RETURN["Return editInMsgCmn"]
    RETURN --> END(["Done"])
```

**Branch descriptions by request type code (YOKYU_SBT_CD):**

| Code | Constant | Business Meaning | Date Field Set |
|------|----------|-----------------|----------------|
| `02` | `YOKYU_SBT_CD_NEW` | New Registration — new service contract | `addSodSendYmd` |
| `03` | `YOKYU_SBT_CD_DSL` | Cancellation/Stop — service termination | `stpSodSendYmd` |
| `07` | `YOKYU_SBT_CD_KAIHK` | Reactivation — service restart | `addSodSendYmd` |
| `08` | `YOKYU_SBT_CD_DEL` | Deletion — order record removal | `delSodSendYmd` |
| `10` | `YOKYU_SBT_CD_STP` | Temporary Suspension — service pause | `stpSodSendYmd` |
| `11` | `YOKYU_SBT_CD_STP_RLS` | Temporary Suspension Release — pause end | `stpRlsSodSendYmd` |
| `14` | `YOKYU_SBT_CD_TOKI` | Toki (Emergency) — urgent dispatch | `addSodSendYmd` |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter object carrying S/I-upward message data; used as the carrier for the populated CAANMsg template returned at the end of processing. |
| 2 | `odrSetInfo` | `HashMap<String, Object>` | Order configuration information hash map containing all order-related fields — service contract numbers, request type code, device model codes, addresses, and other order setup values extracted from the order entry screen or upstream processing. |

**Read instance fields / external state:**
- None directly read as instance fields; all data is sourced from method parameters.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JCCBPCommon.getOpeDate` | JCCBPCommon | - | Reads current operation date for SOD send date population |
| - | `JKKSodSendCC.fillCAANMSGNullMapping` | JKKSodSendCC | - | Prepares CAANMsg template with null mapping for missing fields |
| U | `JKKSodSendCC.editInMsgBasicCmn` | JKKSodSendCC | - | Sets up basic/common message fields (shared template initialization) |
| R | `JKKSodSendCC.convBlankToNull` | JKKSodSendCC | - | Utility to convert blank strings to null for clean message field values |
| R | `JPCModelConstant.FUNC_CD_1` | - | - | Function code constant value 1 (registration/add operation) |
| U | `JKKSodSendCC.editInMsgCmn` | JKKSodSendCC | - | Final assembly — writes the completed template back into the request parameter map for S/I upward message |

**CRUD Analysis:** This method is primarily a **Read + Update** pattern:
- It reads data from `odrSetInfo` HashMap and the operation date from `JCCBPCommon.getOpeDate`.
- It performs no direct database operations itself; all data transformation happens in-memory via the `CAANMsg` template.
- The terminal `editInMsgCmn` call is an Update operation that writes the assembled message into the request parameter object for downstream CBS invocation.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JKKSodSendCC.executeSodSend` | `executeSodSend` -> `editInMsgEKK1041D010` -> `editInMsgCmn` | `editInMsgCmn [U]` |

**Terminal operations from this method:** `editInMsgCmn` [U], `convBlankToNull` [-] x12, `setNull` [-], `getOpeDate` [R] x8, `fillCAANMSGNullMapping` [-], `editInMsgBasicCmn` [U]

## 6. Per-Branch Detail Blocks

**Block 1** — [SETUP] Initialize CAANMsg template (L1860)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template = new CAANMsg(EKK1041D010CBSMsg.class.getName())` |
| 2 | EXEC | `fillCAANMSGNullMapping(template, new EKK1041D010CBSMsg().getContents())` // null mapping実施 (Perform null mapping) |
| 3 | CALL | `editInMsgBasicCmn(param, template)` // 共通部を設定 (Set common section) |
| 4 | SET | `template.set(EKK1041D010CBSMsg.TEMPLATEID, "EKK1041D010")` // テンプレートID(SIFのID) (Template ID / SIF ID) |
| 5 | SET | `template.set(EKK1041D010CBSMsg.FUNC_CODE, JPCModelConstant.FUNC_CD_1)` // 機能コード (Function code) |

**Block 2** — [EXTRACT] Extract yokyuSbtCd from odrSetInfo (L1872)

| # | Type | Code |
|---|------|------|
| 1 | SET | `yokyuSbtCd = (String)odrSetInfo.get(JKKSodSendConstCC.OSI_YOKYU_SBT_CD)` // OSI_YOKYU_SBT_CD = "yokyu_sbt_cd" |

**Block 3** — [VAR DECL] Initialize date variables to null (L1874–L1877)

| # | Type | Code |
|---|------|------|
| 1 | SET | `stpSodSendYmd = null` // 停止SOD送信年月日 (Stop SOD send date) |
| 2 | SET | `stpRlsSodSendYmd = null` // 停止解除SOD送信年月日 (Stop release SOD send date) |
| 3 | SET | `delSodSendYmd = null` // 削除SOD送信年月日 (Delete SOD send date) |
| 4 | SET | `addSodSendYmd = null` // 登録SOD送信年月日 (Register SOD send date) |

**Block 4** — [IF-ELSE IF] Conditional date assignment by yokyu_sbt_cd (L1879–L1922)

| # | Type | Code |
|---|------|------|
| 1 | SET | `yokyuSbtCd = (String)odrSetInfo.get(JKKSodSendConstCC.OSI_YOKYU_SBT_CD)` |
| 2 | IF | `JKKSvcConst.YOKYU_SBT_CD_NEW.equals(yokyuSbtCd)` [YOKYU_SBT_CD_NEW = "02"] (新登録 / New Registration) (L1879) |
| 3 | SET | `addSodSendYmd = JCCBPCommon.getOpeDate(null)` // 要求種別コードが新規の場合 (Request type code is new) (L1881) |
| 4 | ELSE-IF | `JKKSvcConst.YOKYU_SBT_CD_KAIHK.equals(yokyuSbtCd)` [YOKYU_SBT_CD_KAIHK = "07"] (再開 / Reactivation) (L1885) |
| 5 | SET | `addSodSendYmd = JCCBPCommon.getOpeDate(null)` // 要求種別コードが再開の場合 (Request type code is reactivation) (L1887) |
| 6 | ELSE-IF | `JKKSvcConst.YOKYU_SBT_CD_DSL.equals(yokyuSbtCd)` [YOKYU_SBT_CD_DSL = "03"] (解約 / Cancellation-Stop) (L1891) |
| 7 | SET | `stpSodSendYmd = JCCBPCommon.getOpeDate(null)` // 要求種別コードが解約の場合 (OT-2013-0000663: Stop SOD send date not set when issuing SOD for cancellation/stop) (L1894–L1895) |
| 8 | ELSE-IF | `JKKSvcConst.YOKYU_SBT_CD_DEL.equals(yokyuSbtCd)` [YOKYU_SBT_CD_DEL = "08"] (消去 / Deletion) (L1899) |
| 9 | SET | `delSodSendYmd = JCCBPCommon.getOpeDate(null)` // 要求種別コードが消去の場合 (Request type code is deletion) (L1901) |
| 10 | ELSE-IF | `JKKSvcConst.YOKYU_SBT_CD_STP.equals(yokyuSbtCd)` [YOKYU_SBT_CD_STP = "10"] (一時停止 / Temporary Suspension) (L1905) |
| 11 | SET | `stpSodSendYmd = JCCBPCommon.getOpeDate(null)` // 要求種別コードが一時停止の場合 (Request type code is temporary suspension) (L1907) |
| 12 | ELSE-IF | `JKKSvcConst.YOKYU_SBT_CD_STP_RLS.equals(yokyuSbtCd)` [YOKYU_SBT_CD_STP_RLS = "11"] (停止解除 / Temporary Suspension Release) (L1911) |
| 13 | SET | `stpRlsSodSendYmd = JCCBPCommon.getOpeDate(null)` // 要求種別コードが停止解除の場合 (Request type code is suspension release) (L1913) |
| 14 | ELSE-IF | `JKKSvcConst.YOKYU_SBT_CD_TOKI.equals(yokyuSbtCd)` [YOKYU_SBT_CD_TOKI = "14"] (特急 / Emergency dispatch) (L1917) |
| 15 | SET | `addSodSendYmd = JCCBPCommon.getOpeDate(null)` // 要求種別コードが特急の場合 (Request type code is tokiji/emergency) (L1919) |
| 16 | ELSE | Default case — no date item is updated (日付項目を更新しない) (L1923) |

**Block 5** — [SET] Map service contract numbers (L1927–L1932)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK1041D010CBSMsg.SVC_KEI_NO, convBlankToNull((String)odrSetInfo.get(JKKSodSendConstCC.OSI_SVC_KEI_NO)))` // サービス契約番号 (Service contract number) |
| 2 | SET | `template.set(EKK1041D010CBSMsg.SVC_KEI_UCWK_NO, convBlankToNull((String)odrSetInfo.get(JKKSodSendConstCC.OSI_SVC_KEI_UCWK_NO)))` // サービス契約内訳番号 (Service contract detail number) |
| 3 | SET | `template.set(EKK1041D010CBSMsg.KKTK_SVC_KEI_NO, convBlankToNull((String)odrSetInfo.get(JKKSodSendConstCC.OSI_KKTK_SVC_KEI_NO)))` // 機器提供サービス契約番号 (Equipment-provisioned service contract number) |
| 4 | SET | `template.set(EKK1041D010CBSMsg.OP_SVC_KEI_NO, convBlankToNull((String)odrSetInfo.get(JKKSodSendConstCC.OSI_OP_SVC_KEI_NO)))` // オプションサービス契約番号 (Option service contract number) |
| 5 | SET | `template.set(EKK1041D010CBSMsg.SBOP_SVC_KEI_NO, convBlankToNull((String)odrSetInfo.get(JKKSodSendConstCC.OSI_SBOP_SVC_KEI_NO)))` // サブオプションサービス契約番号 (Sub-option service contract number) |
| 6 | SET | `template.set(EKK1041D010CBSMsg.SEIOPSVC_KEI_NO, convBlankToNull((String)odrSetInfo.get(JKKSodSendConstCC.OSI_SEIOP_SVC_KEI_NO)))` // 請求オプションサービス契約番号 (Billing option service contract number) |

**Block 6** — [SET] Map order and service codes (L1933–L1937)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK1041D010CBSMsg.ORDER_SBT_CD, convBlankToNull((String)odrSetInfo.get(JKKSodSendConstCC.OSI_ORDER_SBT_CD)))` // オーダ種別コード (Order type code) |
| 2 | SET | `template.set(EKK1041D010CBSMsg.SVC_ORDER_CD, convBlankToNull((String)odrSetInfo.get(JKKSodSendConstCC.OSI_SVC_ORDER_CD)))` // サービスオーダコード (Service order code) |
| 3 | SET | `template.set(EKK1041D010CBSMsg.RCNT_YOKYU_SBT_CD, convBlankToNull(yokyuSbtCd))` // 最新要求種別コード (Latest request type code) — reuses already-extracted `yokyuSbtCd` without lookup |

**Block 7** — [SET] Set order set target value to null (L1939–L1940)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.setNull(EKK1041D010CBSMsg.ODR_SET_TG_VALUE)` // オーダ設定対象値 — 何も登録しない (Order set target value — no registration) |

**Block 8** — [SET] Map device and address fields (L1942–L1952)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK1041D010CBSMsg.TAKNKIKI_MODEL_CD, convBlankToNull((String)odrSetInfo.get(JKKSodSendConstCC.OSI_TAKNKIKI_MODEL_CD)))` // 宅内機器型式コード (Indoor equipment model code) |
| 2 | SET | `template.set(EKK1041D010CBSMsg.KIKI_SEIZO_NO, convBlankToNull((String)odrSetInfo.get(JKKSodSendConstCC.OSI_KIKI_SEIZO_NO)))` // 機器製造番号 (Equipment serial number / manufacturing number) |
| 3 | SET | `template.set(EKK1041D010CBSMsg.MLAD, convBlankToNull((String)odrSetInfo.get(JKKSodSendConstCC.OSI_MLAD)))` // メールアドレス (Mail address) |
| 4 | SET | `template.set(EKK1041D010CBSMsg.SPOT_LOGIN_SYSID, convBlankToNull((String)odrSetInfo.get(JKKSodSendConstCC.OSI_SPOT_LOGIN_SYSID)))` // スポットログインSYSID (Spot login SYSID) |

**Block 9** — [SET] Map SOD send date fields (L1954–L1961)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK1041D010CBSMsg.ADD_SOD_SEND_YMD, convBlankToNull(addSodSendYmd))` // 登録SOD送信年月日 (Registration SOD send date) |
| 2 | SET | `template.set(EKK1041D010CBSMsg.STP_SOD_SEND_YMD, convBlankToNull(stpSodSendYmd))` // 停止SOD送信年月日 (Stop SOD send date) |
| 3 | SET | `template.set(EKK1041D010CBSMsg.STP_RLS_SOD_SEND_YMD, convBlankToNull(stpRlsSodSendYmd))` // 停止解除SOD送信年月日 (Stop release SOD send date) |
| 4 | SET | `template.set(EKK1041D010CBSMsg.DEL_SOD_SEND_YMD, convBlankToNull(delSodSendYmd))` // 削除SOD送信年月日 (Delete SOD send date) |

**Block 10** — [SET] Map additional fields — SVC_KEI_KAISEN_UCWK_NO and TAKINORT_KINO_CD (L1964–L1970)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK1041D010CBSMsg.SVC_KEI_KAISEN_UCWK_NO, convBlankToNull((String)odrSetInfo.get(JKKSodSendConstCC.OSI_SVC_KEI_KAISEN_UCWK_NO)))` // サービス契約回線内訳番号 — added 2012-12-27 for Lot2 IT1-2012-0002564 (internal failure No.307 check update) (L1966) |
| 2 | SET | `template.set(EKK1041D010CBSMsg.TAKINORT_KINO_CD, convBlankToNull((String)odrSetInfo.get(JKKSodSendConstCC.OSI_TAKINORT_KINO_CD)))` // added 2013-12-04 for ANK-1578-00-00 multi-function router (L1968) |

**Block 11** — [RETURN] Return assembled message (L1972)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return editInMsgCmn(param, template)` // 上り情報を生成 (Generate upward information) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `yokyu_sbt_cd` | Field | Request type code — classifies the type of service order request (new, reactivation, cancellation, etc.) |
| `svc_kei_no` | Field | Service contract number — primary identifier for a service contract line |
| `svc_kei_ucwk_no` | Field | Service contract detail number — sub-identifier for service contract line items |
| `kktk_svc_kei_no` | Field | Equipment-provisioned service contract number — contract number when equipment is provided with the service |
| `op_svc_kei_no` | Field | Option service contract number — contract number for optional add-on services |
| `sbop_svc_kei_no` | Field | Sub-option service contract number — contract number for sub-options of optional services |
| `seiop_svc_kei_no` | Field | Billing option service contract number — contract number for billing-related optional services |
| `order_sbt_cd` | Field | Order type code — classifies the type of order |
| `svc_order_cd` | Field | Service order code — code identifying the service order |
| `rcnt_yokyu_sbt_cd` | Field | Latest request type code — the most recent request type applied to this order |
| `taknkiki_model_cd` | Field | Indoor equipment model code — model code for customer premises equipment |
| `kiki_seizo_no` | Field | Equipment serial number (manufacturing number) — unique manufacturing identifier for the device |
| `mlad` | Field | Mail address — customer email address |
| `spot_login_sysid` | Field | Spot login SYSID — system identifier for spot login authentication |
| `add_sod_send_ymd` | Field | Registration SOD send date — date when registration SOD is dispatched |
| `stp_sod_send_ymd` | Field | Stop SOD send date — date when stop (suspension) SOD is dispatched |
| `stp_rls_sod_send_ymd` | Field | Stop release SOD send date — date when the stop is lifted and SOD is dispatched |
| `del_sod_send_ymd` | Field | Delete SOD send date — date when deletion SOD is dispatched |
| `svc_kei_kaisen_ucwk_no` | Field | Service contract line detail number — internal tracking for service contract wiring details (added 2012-12-27) |
| `takinort_kino_cd` | Field | Multi-function router device code — code identifying a multi-function router device (added 2013-12-04) |
| `odr_set_tg_value` | Field | Order set target value — placeholder field not populated in this scenario |
| YOKYU_SBT_CD_NEW | Constant | Request type code "02" — New Registration |
| YOKYU_SBT_CD_DSL | Constant | Request type code "03" — Cancellation / Stop |
| YOKYU_SBT_CD_KAIHK | Constant | Request type code "07" — Reactivation |
| YOKYU_SBT_CD_DEL | Constant | Request type code "08" — Deletion |
| YOKYU_SBT_CD_STP | Constant | Request type code "10" — Temporary Suspension |
| YOKYU_SBT_CD_STP_RLS | Constant | Request type code "11" — Temporary Suspension Release |
| YOKYU_SBT_CD_TOKI | Constant | Request type code "14" — Emergency (Toki) dispatch |
| SOD | Acronym | Service Order Data — telecom order fulfillment entity dispatched to downstream systems |
| CBS | Acronym | CBS Message Service — component-based service for business system messaging |
| SC | Acronym | Service Component — service component layer class |
| CAANMsg | Technical | CAAN message template — standard message structure used for S/I (System Interface) data exchange |
| S/I | Acronym | System Interface — interface between systems for data exchange |
| FUNC_CD_1 | Constant | Function code "1" — represents registration/add operation type |
| EKK1041D010 | Technical | Service scenario ID — identifies this specific order configuration registration scenario |
