# Business Logic — JFUAddSvcKeiNetCC.editOutEKK0091D010Msg() [298 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JFUAddSvcKeiNetCC` |
| Layer | CC/Common Component (Shared service component within the eo Customer Core System) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JFUAddSvcKeiNetCC.editOutEKK0091D010Msg()

This method performs the **downstream mapping processing** (下りマッピング処理) for the "Service Contract <eo Light Net> Registration" (サービス契約＜eo光ネット＞登録) screen — EKK0091D010. It is the final transformation layer that converts Service Component (SC) response data (encapsulated as `CAANMsg` templates) into business-friendly parameter data structures for the presentation layer. Specifically, it maps SC response fields — such as service contract number, registration timestamp, service contract status, discount plan codes, and operator audit fields — into `dataMap`, `workMap`, and `netMap` structures that downstream screen logic consumes.

The method also implements the **discount service auto-application** (割引サービス自動適用) feature introduced in 2012, which enriches the service contract list (`svcKeiList`) with resolved service codes, pricing group codes, and pricing codes so that any applicable automatic discounts can be applied during the registration flow. Error information extracted from the SC response is consolidated via `editErrInfoEKK0091D010` and written back into the control map for UI display.

Design pattern: **delegation + builder** — it delegates null-checking and string extraction to `CAANMsg` template getters, builds intermediate maps (`workDataMap`, `svcKeiListMap`), and delegates error consolidation to `editErrInfoEKK0091D010` and `TemplateErrorUtil.getErrorInfo`. Its role in the larger system is a **shared output mapper** called by `addNetTrk()` as part of the eo Light Net service contract registration pipeline.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editOutEKK0091D010Msg msgList, param, fixedText"])
    
    START --> GET_TEMPLATES["Get CAANMsg[] templates from msgList"]
    GET_TEMPLATES --> GET_RETURN_CODE["Get return code from msgList"]
    GET_RETURN_CODE --> INIT_WORK_AREA["Initialize work area and work data maps"]
    INIT_WORK_AREA --> INIT_DATA_MAP["Initialize dataMap from param.getData"]
    INIT_DATA_MAP --> INIT_NET_MAP["Get netMap from param.getData EKK0091D010"]
    INIT_NET_MAP --> INIT_WORK_MAPS["Get addKeishaServiceCCWorkMap, addMskmSCWork"]
    INIT_WORK_MAPS --> INIT_DISCOUNT["Get wriSvcAutoAplyMap, svcKeiGrpList, svcKeiList"]
    INIT_DISCOUNT --> TEMPLATE_NULL_FLG{template.isNull field?}
    
    TEMPLATE_NULL_FLG -->|Yes| MAP_NULL["dataMap.put field with empty string"]
    TEMPLATE_NULL_FLG -->|No| MAP_NOT_NULL["dataMap.put field with template.getString"]
    
    MAP_NULL --> TIME_STAMP_SECTION["Process time stamp fields: GENE_ADD_DTM, ADD_DTM, UPD_DTM"]
    MAP_NOT_NULL --> TIME_STAMP_SECTION
    TIME_STAMP_SECTION --> TIMESTAMP_OTHER["Process other fields: SVC_KEI_STAT, RSV_APLY_YMD, MK_FLG, etc."]
    
    TIMESTAMP_OTHER --> INIT_ADD_WORK["Initialize addSvcKeiNetWorkMap"]
    INIT_ADD_WORK --> ADD_WORK_SVC["addSvcKeiNetWorkMap.put svc_kei_no"]
    ADD_WORK_SVC --> NET_MAP_PUT["netMap.put pplan_cd_o, pcrs_cd_o from template"]
    
    NET_MAP_PUT --> DISCOUNT_SECTION["Discount service auto-apply: svcKeiGrpListMap, sysId, mskmNo"]
    DISCOUNT_SECTION --> DISCOUNT_BUILD["Build svcKeiListMap with fixed values and netMap data"]
    DISCOUNT_BUILD --> DISCOUNT_ADD["svcKeiList.add svcKeiListMap"]
    DISCOUNT_ADD --> DISCOUNT_CHECK{svcKeiGrpListMap contains SVC_KEI_LIST?}
    
    DISCOUNT_CHECK -->|No| DISCOUNT_PUT["svcKeiGrpListMap.put SVC_KEI_LIST svcKeiList"]
    DISCOUNT_CHECK -->|Yes| DISCOUNT_SKIP["Skip put list exists"]
    
    DISCOUNT_PUT --> SET_ERR_INFO["editErrInfoEKK0091D010 param, template, returnCode, fixedText"]
    DISCOUNT_SKIP --> SET_ERR_INFO
    SET_ERR_INFO --> GET_ERR_LIST["Get errList from param.getControlMapData ERROR_INFO"]
    GET_ERR_LIST --> SET_CTRL_DATA["param.setControlMapData ERROR_INFO TemplateErrorUtil.getErrorInfo"]
    SET_CTRL_DATA --> END_RETURN["return param"]
    
    END_RETURN
```

**Conditional field mapping:** For every field (SVC_KEI_NO, SEIKY_KEI_NO, GENE_ADD_DTM, SVC_KEI_STAT, RSV_APLY_YMD, RSV_APLY_CD, KK0091_GENE_ADD_DTM, ADD_DTM, ADD_OPEACNT, UPD_DTM, UPD_OPEACNT, MK_FLG), the method branches on `template.isNull(field)`. When null, it stores an empty string (`""`) in `dataMap`; otherwise, it stores the string value from `template.getString(field)`. Some fields also propagate to `workDataMap` (upd_dtm, svc_kei_no) for cross-screen work area sharing.

**Discount service auto-application:** When the `wriSvcAutoAplyMap` contains a `sysid` or `mskm_no` key, the method populates those values. If empty, it falls back to values from `addKeishaServiceCCWorkMap` (sysid) or `addMskmSCWork` (mskm_no). This ensures the discount service matching has consistent identifiers.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `msgList` | `Map<?, ?>` | The response payload from the Service Component (SC) call, containing `CAANMsg` template objects for the eo Light Net registration response. Retrieved via `JCMConstants.TEMPLATE_LIST_KEY`. Also contains the return code (`JCMConstants.RET_CD_INT_KEY`) as an `Integer`. |
| 2 | `param` | `IRequestParameterReadWrite` | The request/response parameter object carrying mapping work areas, data maps, and control map data. Used to store all output mappings (dataMap, workMap, netMap, error info) for downstream screen consumption. |
| 3 | `fixedText` | `String` | A text key (typically `"EKK0091D010"`) used as the map key to store and retrieve business data blocks within `param`. Acts as a namespace discriminator in the parameter's data storage. |

**Instance fields / constants read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `CC_WORK_AREA_NAME` | `String` | Work area map name — `"JFUAddSvcKeiNetCCWork"`, key in the mapping work area for service contract detail info |
| `CC_WORK_AREA_NAME_KEISHA` | `String` | Customer registration work area key — `"JFUAddKeishaServiceCCWork"`, holds customer-level data for discount auto-application fallback |
| `CC_WORK_AREA_NAME_MSKM` | `String` | Application details work area key — `"JFUAddMskmSCWork"`, holds order detail data for discount auto-application fallback |
| `CC_WRI_SVC_AUTO_APLY_MAP` | `String` | Discount service auto-application map name — `"JKKWrisvcAutoAplyCCMap"`, map containing sysid/mskm_no for discount matching |
| `SVC_KEI_GRP_LIST` | `String` | Service contract group list key — `"svc_kei_grp_list"`, list of service contract groups in the discount auto-application |
| `SVC_KEI_LIST` | `String` | Service contract list key — `"svc_kei_list"`, list of service contracts within a group for filtering |
| `TEMPLATE_ID_NET` | `String` | Template ID — `"EKK0091D010"`, the service contract <eo Light Net> registration template identifier |
| `TMCK_ERR_STATUS` | `int` | Error status constant — `1000`, used in error detection |
| `SC_ERROR_STRING` | `String` | Error label — `"サービスコンポーネントエラー"` (Service Component Error) |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `EKK0091D010CBSMsg` | EKK0091D010CBS | EO Light Net Service Contract Registration Response (CAANMsg) | Reads all service contract fields from the SC response template |
| U | `JFUAddSvcKeiNetCC.editErrInfoEKK0091D010` | EKK0091D010CBS | - | Updates error information for the EKK0091D010 screen using return code, template data, and fixedText |
| R | `TemplateErrorUtil.getErrorInfo` | EKK0091D010CBS | - | Retrieves consolidated error info from the template response |

### Analysis:

This method is predominantly an **output mapper** — it does not perform direct database CRUD. Instead, it:
- **Reads (R)** field values from the `CAANMsg` template returned by the SC (the SC has already performed the actual C/R/U/D against the database).
- **Updates (U)** internal data structures (`dataMap`, `workMap`, `netMap`, error control map) to prepare output for the presentation layer.
- Calls `editErrInfoEKK0091D010` which handles the **Update** of error info stored in `param`.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `CAANMsg template.getString(...)` | EKK0091D010CBS | KK_T_SVC_KEI (Service Contract), KK_T_SVC_KEI_DTL (Service Contract Details) | Reads all service contract response fields: svc_kei_no, seiky_kei_no, GENE_ADD_DTM, SVC_KEI_STAT, RSV_APLY_YMD, RSV_APLY_CD, KK0091_GENE_ADD_DTM, ADD_DTM, ADD_OPEACNT, UPD_DTM, UPD_OPEACNT, MK_FLG, PPLAN_CD_O, PCRS_CD_O |
| U | `JFUAddSvcKeiNetCC.editErrInfoEKK0091D010` | EKK0091D010CBS | - | Sets error information in param for UI display; processes return code and template data |
| R | `TemplateErrorUtil.getErrorInfo` | EKK0091D010CBS | - | Extracts error info list from msgList templates combined with current error list |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `getErrorInfo` [R], `editErrInfoEKK0091D010` [U], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `isNull` [-], `isNull` [-], `isNull` [-], `isNull` [-], `isNull` [-], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `isNull` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Caller: JFUAddSvcKeiNetCC.addNetTrk | `addNetTrk()` -> `editOutEKK0091D010Msg(msgList, param, fixedText)` | `template.getString(R) KK_T_SVC_KEI`, `editErrInfoEKK0091D010(U) ErrorInfo`, `TemplateErrorUtil.getErrorInfo(R) ErrorInfo` |

**Notes:** `addNetTrk()` is the registration processing method within the same class (`JFUAddSvcKeiNetCC`). It calls the SC, receives the response in `msgList`, then delegates to `editOutEKK0091D010Msg` to map the response into display-ready format. The terminal operations resolve to SC response reads and error info updates — the actual database operations are performed by the SC upstream.

## 6. Per-Branch Detail Blocks

**Block 1** — [GET/INIT] Template and return code extraction (L1896)

> Extracts the CAANMsg templates and return code from the SC response. This is the entry point for all subsequent field mapping.

| # | Type | Code |
|---|------|------|
| 1 | GET | `CAANMsg[] templates = (CAANMsg[])msgList.get(JCMConstants.TEMPLATE_LIST_KEY)` // SC response templates [-> CONSTANT="TEMPLATE_LIST_KEY"] |
| 2 | SET | `CAANMsg template = templates[0]` // First template in the array |
| 3 | GET | `Object returnCode = msgList.get(JCMConstants.RET_CD_INT_KEY)` // Return code for error processing [-> CONSTANT="RET_CD_INT_KEY"] |

---

**Block 2** — [IF] Work area initialization (L1901-L1911)

> Ensures the work area map (`CC_WORK_AREA_NAME`) and nested work data map exist. The constant `CC_WORK_AREA_NAME` resolves to `"JFUAddSvcKeiNetCCWork"` (ワークエリア名 = work area name).

| # | Type | Code |
|---|------|------|
| 1 | GET | `Map workMap = param.getMappingWorkArea()` // Get work area map |
| 2 | IF | `workMap == null` [-> CONSTANT="CC_WORK_AREA_NAME" = "JFUAddSvcKeiNetCCWork"] |

**Block 2.1** — [IF-True] Work area null, create new (L1903-L1905)

| # | Type | Code |
|---|------|------|
| 1 | SET | `workMap = new HashMap()` |
| 2 | EXEC | `param.setMappingWorkArea(workMap)` |

**Block 2.2** — [IF-False] Work area exists, continue (L1906)

| # | Type | Code |
|---|------|------|
| 1 | PROC | /* workMap already exists */ |

---

**Block 3** — [IF] Work data map initialization (L1907-L1911)

> Gets or creates the nested `workDataMap` within the work area. Uses same constant `CC_WORK_AREA_NAME`.

| # | Type | Code |
|---|------|------|
| 1 | GET | `HashMap workDataMap = (HashMap)workMap.get(CC_WORK_AREA_NAME)` |
| 2 | IF | `workDataMap == null` |

**Block 3.1** — [IF-True] Create new work data map (L1908-L1910)

| # | Type | Code |
|---|------|------|
| 1 | SET | `workDataMap = new HashMap()` |
| 2 | EXEC | `workMap.put(CC_WORK_AREA_NAME, workDataMap)` |

**Block 3.2** — [IF-False] Work data map exists (L1911)

| # | Type | Code |
|---|------|------|
| 1 | PROC | /* workDataMap already initialized */ |

---

**Block 4** — [IF] Data map initialization (L1914-L1918)

> Ensures the business data map for this screen's data block exists.

| # | Type | Code |
|---|------|------|
| 1 | GET | `HashMap dataMap = (HashMap)param.getData(fixedText)` |
| 2 | IF | `dataMap == null` [-> CONSTANT="fixedText" = "EKK0091D010"] |

**Block 4.1** — [IF-True] Create new data map (L1915-L1917)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap = new HashMap()` |
| 2 | EXEC | `param.setData(fixedText, dataMap)` |

**Block 4.2** — [IF-False] Data map exists (L1918)

| # | Type | Code |
|---|------|------|
| 1 | PROC | /* dataMap already initialized */ |

---

**Block 5** — [GET] System identifiers and net map initialization (L1921-L1946)

> Initializes local variables for discount service auto-application, retrieves the network map and related work maps.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String sysId = ""` // System ID for discount auto-application |
| 2 | SET | `String mskmNo = ""` // Application number for discount auto-application |
| 3 | GET | `HashMap netMap = (HashMap)(param.getData("EKK0091D010"))` // Network (eo Light Net) info map |
| 4 | GET | `HashMap addKeishaServiceCCWorkMap = (HashMap)workMap.get(CC_WORK_AREA_NAME_KEISHA)` [-> CONSTANT="CC_WORK_AREA_NAME_KEISHA" = "JFUAddKeishaServiceCCWork"] |
| 5 | GET | `HashMap addMskmSCWork = (HashMap)workMap.get(CC_WORK_AREA_NAME_MSKM)` [-> CONSTANT="CC_WORK_AREA_NAME_MSKM" = "JFUAddMskmSCWork"] |
| 6 | GET | `HashMap wriSvcAutoAplyMap = (HashMap)param.getData(CC_WRI_SVC_AUTO_APLY_MAP)` [-> CONSTANT="CC_WRI_SVC_AUTO_APLY_MAP" = "JKKWrisvcAutoAplyCCMap"] |
| 7 | SET | `HashMap svcKeiGrpListMap = new HashMap()` // Service contract group list map |
| 8 | SET | `HashMap svcKeiListMap = new HashMap()` // Service contract list map |
| 9 | SET | `ArrayList svcKeiList = new ArrayList()` // Service contract list |

---

**Block 6** — [IF-ELSE] Service contract number (svc_kei_no) mapping (L1949-L1963)

> Maps the service contract number (サービス契約番号) from template to dataMap, workDataMap, and svcKeiListMap. The service contract number is a core identifier for the registration.

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0091D010CBSMsg.SVC_KEI_NO)` |

**Block 6.1** — [IF-True] Service contract number is null (L1950-L1953)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("svc_kei_no", "")` |
| 2 | SET | `svcKeiListMap.put("svc_kei_no", "")` // Discount auto-application list |

**Block 6.2** — [IF-Else] Service contract number present (L1954-L1963)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("svc_kei_no", template.getString(EKK0091D010CBSMsg.SVC_KEI_NO))` |
| 2 | SET | `workDataMap.put("svc_kei_no", template.getString(EKK0091D010CBSMsg.SVC_KEI_NO))` // Cross-screen work area |
| 3 | SET | `svcKeiListMap.put("svc_kei_no", template.getString(EKK0091D010CBSMsg.SVC_KEI_NO))` // Discount auto-application |

---

**Block 7** — [IF-ELSE] Request contract number (seiky_kei_no) mapping (L1967-L1975)

> Maps the request contract number (請求契約番号). Uses `getSkkWorkMapValue` helper for the non-null case — this pulls from the SKK (savings account) work area instead of the template directly.

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0091D010CBSMsg.SEIKY_KEI_NO)` |

**Block 7.1** — [IF-True] Null (L1968-L1969)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("seiky_kei_no", "")` |

**Block 7.2** — [IF-Else] Present (L1971-L1973)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put(EKK0091D010CBSMsg.SEIKY_KEI_NO, getSkkWorkMapValue(param, "seiky_kei_no"))` // Cross-reference SKK work area |

---

**Block 8** — [IF-ELSE] Registration timestamp (gene_add_dtm) mapping (L1978-L1987)

> Maps the creation timestamp (世代登録年月日時分秒).

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0091D010CBSMsg.GENE_ADD_DTM)` |

**Block 8.1** — [IF-True] Null (L1979-L1980)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("gene_add_dtm", "")` |

**Block 8.2** — [IF-Else] Present (L1982-L1984)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("gene_add_dtm", template.getString(EKK0091D010CBSMsg.GENE_ADD_DTM))` |

---

**Block 9** — [IF-ELSE] Service contract status (svc_kei_stat) mapping (L1988-L1995)

> Maps the service contract status (サービス契約ステータス), e.g., "010" = accepted (受付済み).

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0091D010CBSMsg.SVC_KEI_STAT)` |

**Block 9.1** — [IF-True] Null (L1989-L1990)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("svc_kei_stat", "")` |

**Block 9.2** — [IF-Else] Present (L1992-L1994)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("svc_kei_stat", template.getString(EKK0091D010CBSMsg.SVC_KEI_STAT))` |

---

**Block 10** — [IF-ELSE] Reservation application date (rsv_aply_ymd) mapping (L1997-L2004)

> Maps the reservation application date (予約適用年月日).

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0091D010CBSMsg.RSV_APLY_YMD)` |

**Block 10.1** — [IF-True] Null (L1998-L1999)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("rsv_aply_ymd", "")` |

**Block 10.2** — [IF-Else] Present (L2001-L2003)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("rsv_aply_ymd", template.getString(EKK0091D010CBSMsg.RSV_APLY_YMD))` |

---

**Block 11** — [IF-ELSE] Reservation application code (rsv_aply_cd) mapping (L2006-L2013)

> Maps the reservation application code (予約適用コード).

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0091D010CBSMsg.RSV_APLY_CD)` |

**Block 11.1** — [IF-True] Null (L2007-L2008)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("rsv_aply_cd", "")` |

**Block 11.2** — [IF-Else] Present (L2010-L2012)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("rsv_aply_cd", template.getString(EKK0091D010CBSMsg.RSV_APLY_CD))` |

---

**Block 12** — [IF-ELSE] eo Light Net registration timestamp (kk0091_gene_add_dtm) mapping (L2015-L2024)

> Maps the eo Light Net-specific generation timestamp (世代登録年月日時分秒（サービス契約<eo光ネット>）).

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0091D010CBSMsg.KK0091_GENE_ADD_DTM)` |

**Block 12.1** — [IF-True] Null (L2016-L2017)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("kk0091_gene_add_dtm", "")` |

**Block 12.2** — [IF-Else] Present (L2019-L2021)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("kk0091_gene_add_dtm", template.getString(EKK0091D010CBSMsg.KK0091_GENE_ADD_DTM))` |

---

**Block 13** — [IF-ELSE] Registration timestamp (add_dtm) mapping (L2026-L2035)

> Maps the registration timestamp (登録年月日時分秒).

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0091D010CBSMsg.ADD_DTM)` |

**Block 13.1** — [IF-True] Null (L2027-L2028)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("add_dtm", "")` |

**Block 13.2** — [IF-Else] Present (L2030-L2032)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("add_dtm", template.getString(EKK0091D010CBSMsg.ADD_DTM))` |

---

**Block 14** — [IF-ELSE] Registration operator account (add_opeacnt) mapping (L2037-L2046)

> Maps the registration operator account (登録オペレーターアカウント).

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0091D010CBSMsg.ADD_OPEACNT)` |

**Block 14.1** — [IF-True] Null (L2038-L2039)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("add_opeacnt", "")` |

**Block 14.2** — [IF-Else] Present (L2041-L2043)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("add_opeacnt", template.getString(EKK0091D010CBSMsg.ADD_OPEACNT))` |

---

**Block 15** — [IF-ELSE] Update timestamp (upd_dtm) mapping (L2048-L2060)

> Maps the update timestamp (更新年月日時分秒). Notably, when present, also propagates to `workDataMap` (L2056-2057, ticket IT2-2012-0000262).

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0091D010CBSMsg.UPD_DTM)` |

**Block 15.1** — [IF-True] Null (L2049-L2050)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("upd_dtm", "")` |

**Block 15.2** — [IF-Else] Present (L2052-L2060)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("upd_dtm", template.getString(EKK0091D010CBSMsg.UPD_DTM))` |
| 2 | SET | `workDataMap.put("upd_dtm", template.getString(EKK0091D010CBSMsg.UPD_DTM))` // Also propagated to workDataMap [IT2-2012-0000262] |

---

**Block 16** — [IF-ELSE] Update operator account (upd_opeacnt) mapping (L2062-L2071)

> Maps the update operator account (更新オペレーターアカウント).

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0091D010CBSMsg.UPD_OPEACNT)` |

**Block 16.1** — [IF-True] Null (L2063-L2064)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("upd_opeacnt", "")` |

**Block 16.2** — [IF-Else] Present (L2066-L2068)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("upd_opeacnt", template.getString(EKK0091D010CBSMsg.UPD_OPEACNT))` |

---

**Block 17** — [IF-ELSE] Invalid flag (mk_flg) mapping (L2073-L2080)

> Maps the invalid/marking flag (無効フラグ).

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0091D010CBSMsg.MK_FLG)` |

**Block 17.1** — [IF-True] Null (L2074-L2075)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("mk_flg", "")` |

**Block 17.2** — [IF-Else] Present (L2077-L2079)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("mk_flg", template.getString(EKK0091D010CBSMsg.MK_FLG))` |

---

**Block 18** — [IF] Add service contract network work map initialization (L2084-L2090)

> Ensures the addSvcKeiNetWorkMap (作業項目情報) exists. Same constant `CC_WORK_AREA_NAME`.

| # | Type | Code |
|---|------|------|
| 1 | GET | `HashMap addSvcKeiNetWorkMap = (HashMap)workMap.get(CC_WORK_AREA_NAME)` |
| 2 | IF | `addSvcKeiNetWorkMap == null` |

**Block 18.1** — [IF-True] Create new (L2086-L2088)

| # | Type | Code |
|---|------|------|
| 1 | SET | `addSvcKeiNetWorkMap = new HashMap()` |
| 2 | EXEC | `workMap.put(CC_WORK_AREA_NAME, addSvcKeiNetWorkMap)` |

**Block 18.2** — [IF-Else] Exists (L2089)

| # | Type | Code |
|---|------|------|
| 1 | PROC | /* work map already initialized */ |

---

**Block 19** — [IF-ELSE] Service contract number for work map (L2093-L2100)

> Puts svc_kei_no into addSvcKeiNetWorkMap for downstream processing.

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0091D010CBSMsg.SVC_KEI_NO)` |

**Block 19.1** — [IF-True] Null (L2094-L2095)

| # | Type | Code |
|---|------|------|
| 1 | SET | `addSvcKeiNetWorkMap.put("svc_kei_no", new String())` |

**Block 19.2** — [IF-Else] Present (L2097-L2099)

| # | Type | Code |
|---|------|------|
| 1 | SET | `addSvcKeiNetWorkMap.put("svc_kei_no", template.getString(EKK0091D010CBSMsg.SVC_KEI_NO))` |

---

**Block 20** — [IF-ELSE] Post-registration pricing plan code (pplan_cd_o) (L2103-L2113)

> Maps the post-registration pricing plan code (登録後の料金プラン) into netMap.

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0091D010CBSMsg.PPLAN_CD_O)` |

**Block 20.1** — [IF-True] Null (L2104-L2105)

| # | Type | Code |
|---|------|------|
| 1 | SET | `netMap.put("pplan_cd_o", new String())` |

**Block 20.2** — [IF-Else] Present (L2107-L2109)

| # | Type | Code |
|---|------|------|
| 1 | SET | `netMap.put("pplan_cd_o", template.getString(EKK0091D010CBSMsg.PPLAN_CD_O))` |

---

**Block 21** — [IF-ELSE] Post-registration pricing code (pcrs_cd_o) (L2115-L2125)

> Maps the post-registration pricing code (登録後の料金コード) into netMap.

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0091D010CBSMsg.PCRS_CD_O)` |

**Block 21.1** — [IF-True] Null (L2116-L2117)

| # | Type | Code |
|---|------|------|
| 1 | SET | `netMap.put("pcrs_cd_o", new String())` |

**Block 21.2** — [IF-Else] Present (L2119-L2121)

| # | Type | Code |
|---|------|------|
| 1 | SET | `netMap.put("pcrs_cd_o", template.getString(EKK0091D010CBSMsg.PCRS_CD_O))` |

---

**Block 22** — [DISCOUNT AUTO-APPLICATION] Service contract list building (L2126-L2177)

> The discount service auto-application block (割引サービス自動適用対応). This builds a `svcKeiListMap` with fixed filter values and dynamic data from netMap, then adds it to the service contract list. Used for matching applicable discount services.

| # | Type | Code |
|---|------|------|
| 1 | GET | `svcKeiGrpListMap = (HashMap)svcKeiGrpList.get(0)` // Get first group from service contract group list [-> CONSTANT="SVC_KEI_GRP_LIST" = "svc_kei_grp_list"] |
| 2 | IF | `svcKeiGrpListMap.containsKey(SVC_KEI_LIST)` [-> CONSTANT="SVC_KEI_LIST" = "svc_kei_list"] |

**Block 22.1** — [IF-True] Extract svcKeiList (L2130-L2132)

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiList = (ArrayList)svcKeiGrpListMap.get(SVC_KEI_LIST)` |

**Block 22.2** — [IF-False] No list to extract (L2133)

| # | Type | Code |
|---|------|------|
| 1 | PROC | /* svcKeiList remains the newly created ArrayList */ |

---

**Block 23** — [IF] System ID (sysId) configuration (L2136-L2140)

> Sets sysId from wriSvcAutoAplyMap. If still empty, falls back to addKeishaServiceCCWorkMap.

| # | Type | Code |
|---|------|------|
| 1 | IF | `wriSvcAutoAplyMap.containsKey("sysid")` |

**Block 23.1** — [IF-True] Get sysId from auto-apply map (L2137-L2138)

| # | Type | Code |
|---|------|------|
| 1 | SET | `sysId = (String)wriSvcAutoAplyMap.get("sysid")` |

**Block 23.2** — [IF-Else] sysId not present (L2139)

| # | Type | Code |
|---|------|------|
| 1 | PROC | /* sysId remains empty string */ |

---

**Block 24** — [IF] Empty sysId fallback (L2141-L2144)

> If sysId is still empty after extraction, populate from addKeishaServiceCCWorkMap.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(sysId)` |

**Block 24.1** — [IF-True] Apply fallback (L2142-L2143)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `wriSvcAutoAplyMap.put("sysid", (String)addKeishaServiceCCWorkMap.get("sysid"))` |

**Block 24.2** — [IF-Else] sysId already has value (L2144)

| # | Type | Code |
|---|------|------|
| 1 | PROC | /* sysId is already set */ |

---

**Block 25** — [IF] Application number (mskmNo) configuration (L2147-L2151)

> Sets mskmNo (申請番号 = application number) from wriSvcAutoAplyMap.

| # | Type | Code |
|---|------|------|
| 1 | IF | `wriSvcAutoAplyMap.containsKey("mskm_no")` |

**Block 25.1** — [IF-True] Get mskmNo (L2148-L2149)

| # | Type | Code |
|---|------|------|
| 1 | SET | `mskmNo = (String)wriSvcAutoAplyMap.get("mskm_no")` |

**Block 25.2** — [IF-Else] Not present (L2150)

| # | Type | Code |
|---|------|------|
| 1 | PROC | /* mskmNo remains empty */ |

---

**Block 26** — [IF] Empty mskmNo fallback (L2152-L2155)

> If mskmNo is empty, populate from addMskmSCWork.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(mskmNo)` |

**Block 26.1** — [IF-True] Apply fallback (L2153-L2154)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `wriSvcAutoAplyMap.put("mskm_no", (String)addMskmSCWork.get("mskm_no"))` |

**Block 26.2** — [IF-Else] mskmNo already set (L2155)

| # | Type | Code |
|---|------|------|
| 1 | PROC | /* mskmNo already has value */ |

---

**Block 27** — [SET] Service contract list map construction (L2158-L2175)

> Builds the filter criteria map for the discount service auto-application. Fixed values target contract code "01" and status "010" (受付済み = accepted). Dynamic values come from netMap.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiListMap.put("tg_kei_skbt_cd", "01")` // Target contract sub-type code — contract line item |
| 2 | SET | `svcKeiListMap.put("svc_kei_stat", "010")` // Service contract status — "010" = accepted (受付済み) |
| 3 | SET | `svcKeiListMap.put("svc_cd", netMap.get("svc_cd"))` // Service code from netMap |
| 4 | SET | `svcKeiListMap.put("prc_grp_cd", netMap.get("prc_grp_cd"))` // Pricing group code from netMap |
| 5 | SET | `svcKeiListMap.put("pcrs_cd", netMap.get("pcrs_cd"))` // Pricing code from netMap |
| 6 | SET | `svcKeiListMap.put("pplan_cd", netMap.get("pplan_cd"))` // Pricing plan code from netMap |

---

**Block 28** — [EXEC] Add svcKeiListMap to svcKeiList (L2178)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `svcKeiList.add(svcKeiListMap)` |

---

**Block 29** — [IF] svcKeiGrpListMap update (L2182-L2185)

> If the service contract list was NOT already present in the group map, add it.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!svcKeiGrpListMap.containsKey(SVC_KEI_LIST)` [-> CONSTANT="SVC_KEI_LIST" = "svc_kei_list"] |

**Block 29.1** — [IF-True] Add list to group map (L2183-L2184)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `svcKeiGrpListMap.put(SVC_KEI_LIST, svcKeiList)` |

**Block 29.2** — [IF-Else] List already exists (L2185)

| # | Type | Code |
|---|------|------|
| 1 | PROC | /* Skip — list already present in group map */ |

---

**Block 30** — [CALL] Error information setup (L2188)

> Delegates error info creation to `editErrInfoEKK0091D010`.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `editErrInfoEKK0091D010(param, template, (Integer)returnCode, fixedText)` |

---

**Block 31** — [IF] Error list retrieval (L2191-L2195)

> Gets the current error list from the control map.

| # | Type | Code |
|---|------|------|
| 1 | GET | `ArrayList<Object> errList = (ArrayList<Object>)param.getControlMapData(SCControlMapKeys.ERROR_INFO)` |
| 2 | IF | `errList == null` |

**Block 31.1** — [IF-True] Create new error list (L2192-L2193)

| # | Type | Code |
|---|------|------|
| 1 | SET | `errList = new ArrayList<Object>()` |

**Block 31.2** — [IF-Else] Error list exists (L2194)

| # | Type | Code |
|---|------|------|
| 1 | PROC | /* errList already initialized */ |

---

**Block 32** — [EXEC] Set consolidated error info (L2198)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `param.setControlMapData(SCControlMapKeys.ERROR_INFO, TemplateErrorUtil.getErrorInfo(msgList, errList))` |

---

**Block 33** — [RETURN] Return param (L2200)

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

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service contract number — the unique identifier assigned to a service contract line item |
| `seiky_kei_no` | Field | Request contract number — the billing contract number associated with this service |
| `gene_add_dtm` | Field | Registration timestamp (generation) — when the service contract record was originally created/generated |
| `kk0091_gene_add_dtm` | Field | eo Light Net registration timestamp — the specific generation timestamp for the <eo Light Net> service contract |
| `add_dtm` | Field | Registration timestamp — when this record was added/registered |
| `upd_dtm` | Field | Update timestamp — when this record was last modified |
| `svc_kei_stat` | Field | Service contract status — indicates the current state of the contract (e.g., "010" = 受付済み / accepted) |
| `rsv_aply_ymd` | Field | Reservation application date — the date a reservation takes effect |
| `rsv_aply_cd` | Field | Reservation application code — code indicating the type of reservation |
| `add_opeacnt` | Field | Registration operator account — the user account that performed the registration |
| `upd_opeacnt` | Field | Update operator account — the user account that last modified this record |
| `mk_flg` | Field | Invalid/marking flag — indicates whether this record is marked as invalid |
| `pplan_cd_o` | Field | Post-registration pricing plan code — the pricing plan after registration |
| `pcrs_cd_o` | Field | Post-registration pricing code — the pricing code after registration |
| `tg_kei_skbt_cd` | Field | Target contract sub-type code — filters contracts by type (e.g., "01" for contract line items) |
| `svc_cd` | Field | Service code — identifies the type of service (e.g., eo Light Net) |
| `prc_grp_cd` | Field | Pricing group code — groups pricing plans |
| `pcrs_cd` | Field | Pricing code — the specific pricing rate code |
| `pplan_cd` | Field | Pricing plan code — the pricing plan identifier |
| `sysid` | Field | System ID — used for discount service auto-application matching |
| `mskm_no` | Field | Application number (申請番号) — the order/application identifier for discount matching |
| CC_WORK_AREA_NAME | Constant | Work area map name — `"JFUAddSvcKeiNetCCWork"`, the key used in the mapping work area |
| CC_WORK_AREA_NAME_KEISHA | Constant | Customer registration work area key — `"JFUAddKeishaServiceCCWork"` |
| CC_WORK_AREA_NAME_MSKM | Constant | Application details work area key — `"JFUAddMskmSCWork"` |
| CC_WRI_SVC_AUTO_APLY_MAP | Constant | Discount service auto-application map name — `"JKKWrisvcAutoAplyCCMap"` |
| SVC_KEI_GRP_LIST | Constant | Service contract group list key — `"svc_kei_grp_list"` |
| SVC_KEI_LIST | Constant | Service contract list key — `"svc_kei_list"` |
| EO Light Net (eo光ネット) | Business term | NTT East's fiber-optic broadband internet service brand; the core telecom service being registered |
| CAANMsg | Technical | Canonical Message — the standard response message object from Service Components, containing typed field getters |
| SC (Service Component) | Technical | A backend service layer class that handles database operations and business logic for a specific screen/transaction |
| CBS (Contract Business System) | Technical | The COBOL-based batch processing system that performs actual database CRUD operations |
| Template (テンプレート) | Technical | A CAANMsg object that encapsulates the response data from a CBS call, providing typed getter methods |
| Work Area (作業領域) | Technical | A HashMap stored in the request parameter that holds intermediate data shared across processing stages |
| Mapping (マッピング) | Technical | The process of converting between data representations — SC response (CAANMsg) to presentation-layer maps |
| 下りマッピング (おりマッピング) | Japanese term | Downstream mapping — the direction of data flow from SC response to presentation layer |
| 割引サービス自動適用 | Japanese term | Discount service auto-application — automatic matching and application of eligible discount services |
| 受付済み | Japanese term | Accepted — a contract status value ("010") indicating the contract has been received and is being processed |
| 世代登録 | Japanese term | Registration generation — the creation timestamp of a service contract record |
| EO (Eclipse Optical) | Business term | NTT East's brand prefix for optical broadband services |
