# Business Logic — JFUAddSvcKeiTvCC.editRetEKK0341D010() [257 LOC]

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

## 1. Role

### JFUAddSvcKeiTvCC.editRetEKK0341D010()

This method performs the **downward mapping processing for Device-Provided Service Contract Registration** (機器提供サービス契約登録の下りマッピング処理), transforming raw CBS response data carried in CAANMsg template objects into the application's internal work data structures. It is a **builder-pattern** method that reads the first template from a template array, extracts all device-provided service contract fields (service contract number, generation timestamp, service contract status, trial period end date, reservation application date, reservation application code, registration timestamp, registration operator, update timestamp, update operator, and invalidation flag), and writes them into a per-line-item HashMap stored in a list indexed by the caller. Additionally, it handles **discount service automatic application** (割引サービス自動適用対応) by enriching the service contract list mapping with target contract subtype code "06" and a pre-received status indicator "010", pulling system ID and application number from the auto-apply map as a fallback. The method delegates error extraction to `editErrInfoEKK0341D010` and packages error results into the control map via `TemplateErrorUtil.getErrorInfo`. It serves as a **shared mapping utility** called by `addTvTrk` to prepare response data for TV device-provided service contracts displayed in the screen layer.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editRetEKK0341D010 start"])
    START --> GET_TEMPLATES["Get CAANMsg[] templates from msgList"]
    GET_TEMPLATES --> GET_TEMPLATE["Get template = templates[0]"]
    GET_TEMPLATE --> GET_RET_CD["Get returnCode from msgList"]
    GET_RET_CD --> INIT_WORK_MAP{workMap null}
    INIT_WORK_MAP -->|yes| CREATE_WORK_MAP["Create HashMap; set work area"]
    INIT_WORK_MAP -->|no| INIT_DATA_MAP{dataMap null}
    CREATE_WORK_MAP --> INIT_DATA_MAP
    INIT_DATA_MAP -->|yes| CREATE_DATA_MAP["Create HashMap; setData on param"]
    INIT_DATA_MAP -->|no| INIT_TVLIST{dataList null}
    CREATE_DATA_MAP --> INIT_TVLIST
    INIT_TVLIST -->|yes| CREATE_TVLIST["Create ArrayList; put in dataMap"]
    INIT_TVLIST -->|no| GET_CHILDMAP{childMap null}
    CREATE_TVLIST --> GET_CHILDMAP
    GET_CHILDMAP -->|yes| CREATE_CHILDMAP["Create HashMap; add to dataList at index"]
    GET_CHILDMAP -->|no| INIT_DISCOUNT_VARS["Init sysId, mskmNo, work maps, wriSvcAutoAplyMap"]
    CREATE_CHILDMAP --> INIT_DISCOUNT_VARS
    INIT_DISCOUNT_VARS --> MAP_KKTK{template null?}
    MAP_KKTK -->|yes| MAP_KKTK_EMPTY["Put empty kktk_svc_kei_no"]
    MAP_KKTK -->|no| MAP_KKTK_VALUE["Put template string value"]
    MAP_KKTK_EMPTY --> MAP_GENE{template null?}
    MAP_KKTK_VALUE --> MAP_GENE
    MAP_GENE -->|yes| MAP_GENE_EMPTY["Put empty gene_add_dtm"]
    MAP_GENE -->|no| MAP_GENE_VALUE["Put template string value"]
    MAP_GENE_EMPTY --> MAP_STAT{template null?}
    MAP_GENE_VALUE --> MAP_STAT
    MAP_STAT -->|yes| MAP_STAT_EMPTY["Put empty kktk_svc_kei_stat"]
    MAP_STAT -->|no| MAP_STAT_VALUE["Put template string value"]
    MAP_STAT_EMPTY --> MAP_FTRIAL{template null?}
    MAP_STAT_VALUE --> MAP_FTRIAL
    MAP_FTRIAL -->|yes| MAP_FTRIAL_EMPTY["Put empty ftrial_prd_endymd"]
    MAP_FTRIAL -->|no| MAP_FTRIAL_VALUE["Put template string value"]
    MAP_FTRIAL_EMPTY --> MAP_RSV_YMD{template null?}
    MAP_FTRIAL_VALUE --> MAP_RSV_YMD
    MAP_RSV_YMD -->|yes| MAP_RSV_YMD_EMPTY["Put empty rsv_aply_ymd"]
    MAP_RSV_YMD -->|no| MAP_RSV_YMD_VALUE["Put template string value"]
    MAP_RSV_YMD_EMPTY --> MAP_RSV_CD{template null?}
    MAP_RSV_YMD_VALUE --> MAP_RSV_CD
    MAP_RSV_CD -->|yes| MAP_RSV_CD_EMPTY["Put empty rsv_aply_cd"]
    MAP_RSV_CD -->|no| MAP_RSV_CD_VALUE["Put template string value"]
    MAP_RSV_CD_EMPTY --> MAP_ADD_DTM{template null?}
    MAP_RSV_CD_VALUE --> MAP_ADD_DTM
    MAP_ADD_DTM -->|yes| MAP_ADD_DTM_EMPTY["Put empty add_dtm"]
    MAP_ADD_DTM -->|no| MAP_ADD_DTM_VALUE["Put template string value"]
    MAP_ADD_DTM_EMPTY --> MAP_ADD_OPEACNT{template null?}
    MAP_ADD_DTM_VALUE --> MAP_ADD_OPEACNT
    MAP_ADD_OPEACNT -->|yes| MAP_ADD_OPEACNT_EMPTY["Put empty add_opeacnt"]
    MAP_ADD_OPEACNT -->|no| MAP_ADD_OPEACNT_VALUE["Put template string value"]
    MAP_ADD_OPEACNT_EMPTY --> MAP_UPD_DTM{template null?}
    MAP_ADD_OPEACNT_VALUE --> MAP_UPD_DTM
    MAP_UPD_DTM -->|yes| MAP_UPD_DTM_EMPTY["Put empty upd_dtm"]
    MAP_UPD_DTM -->|no| MAP_UPD_DTM_VALUE["Put template string value"]
    MAP_UPD_DTM_EMPTY --> MAP_UPD_OPEACNT{template null?}
    MAP_UPD_DTM_VALUE --> MAP_UPD_OPEACNT
    MAP_UPD_OPEACNT -->|yes| MAP_UPD_OPEACNT_EMPTY["Put empty upd_opeacnt"]
    MAP_UPD_OPEACNT -->|no| MAP_UPD_OPEACNT_VALUE["Put template string value"]
    MAP_UPD_OPEACNT_EMPTY --> MAP_MK_FLG{template null?}
    MAP_UPD_OPEACNT_VALUE --> MAP_MK_FLG
    MAP_MK_FLG -->|yes| MAP_MK_FLG_EMPTY["Put empty mk_flg"]
    MAP_MK_FLG -->|no| MAP_MK_FLG_VALUE["Put template string value"]
    MAP_MK_FLG_EMPTY --> MAP_DISCOUNT["Discount service auto-apply: extract svcKeiGrpListMap, build svcKeiListMap, set sysid/mskm_no"]
    MAP_MK_FLG_VALUE --> MAP_DISCOUNT
    MAP_DISCOUNT --> DISCOUNT_SVC_LIST{svcKeiGrpListMap contains SVC_KEI_LIST?}
    DISCOUNT_SVC_LIST -->|yes| GET_SVC_LIST["Extract svcKeiList from svcKeiGrpListMap"]
    DISCOUNT_SVC_LIST -->|no| BUILD_SVC_MAP["Create svcKeiListMap with target fields"]
    GET_SVC_LIST --> BUILD_SVC_MAP
    BUILD_SVC_MAP --> ADD_SVC_TO_LIST["svcKeiList.add(svcKeiListMap)"]
    ADD_SVC_TO_LIST --> SVC_GRP_CHECK{svcKeiGrpListMap contains SVC_KEI_LIST?}
    SVC_GRP_CHECK -->|no| PUT_SVC_LIST["svcKeiGrpListMap.put(SVC_KEI_LIST, svcKeiList)"]
    SVC_GRP_CHECK -->|yes| SVC_LIST_READY["svcKeiList ready"]
    PUT_SVC_LIST --> SVC_LIST_READY
    SVC_LIST_READY --> EDIT_ERR["Call editErrInfoEKK0341D010(param, template, returnCode, fixedText, index)"]
    EDIT_ERR --> GET_ERR_LIST{errList null}
    GET_ERR_LIST -->|yes| CREATE_ERR_LIST["Create new ArrayList"]
    GET_ERR_LIST -->|no| SET_CONTROL_MAP["param.setControlMapData ERROR_INFO via TemplateErrorUtil"]
    CREATE_ERR_LIST --> SET_CONTROL_MAP
    SET_CONTROL_MAP --> RETURN_PARAM["Return param"]
    RETURN_PARAM --> END(["end"])
```

**Processing description:** The method follows a linear build-up pattern with nested null-safety guards. First, it initializes four nested data structures (workMap → dataMap → dataList → childMap), each created lazily if null. Then it maps 11 template fields one-by-one, using a repeated null-check/idle-value pattern. Next, it handles discount service auto-apply by extracting service group lists and building a service contract list map with hardcoded filter values. Finally, it delegates error handling and returns the param object.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `msgList` | `Map<?, ?>` | The CBS response message container holding CAANMsg template objects and a return code. The first template (`templates[0]`) is the device-provided service contract registration response carrying all mapped fields. |
| 2 | `param` | `IRequestParameterReadWrite` | The request/response parameter object that owns the work area maps, data maps, and control map. It is both read (to extract work area and data) and mutated (to set work area, data, and control map data). |
| 3 | `fixedText` | `String` | A key used to retrieve and store the dataMap from param. Typically an identifier like `"EKK0341D010Tv"` that distinguishes this method's data area from others in the same request. |
| 4 | `index` | `int` | The list index within `EKK0341D010TvList` that identifies which device-provided service contract line item to populate. This allows batch processing of multiple lines. |

**Instance/External State Read:**
- `param.getMappingWorkArea()` — read; returns the work area HashMap used for cross-method data sharing
- `param.getData(fixedText)` — read; returns the dataMap for this method's data area
- `param.getControlMapData(SCControlMapKeys.ERROR_INFO)` — read; retrieves existing error list

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JBSbatDKNyukaFinAdd.getData` | - | - | Calls `getData` in `JBSbatDKNyukaFinAdd` — retrieves data from DK entry finish add component |
| R | `JBSbatFUCaseFileRnkData.getString` | - | - | Calls `getString` in `JBSbatFUCaseFileRnkData` — reads case file rank data |
| R | `JBSbatFUMoveNaviData.getString` | - | - | Calls `getString` in `JBSbatFUMoveNaviData` — reads move navigation data |
| R | `JBSbatZMAdDataSet.getString` | - | - | Calls `getString` in `JBSbatZMAdDataSet` — reads ZM advertisement set data |
| R | `JFUeoTelOpTransferCC.getData` | - | - | Calls `getData` in `JFUeoTelOpTransferCC` — reads East Japan Tel operation transfer data |
| R | `JFUTransferCC.getData` | - | - | Calls `getData` in `JFUTransferCC` — reads general transfer data |
| R | `JFUTransferListToListCC.getData` | - | - | Calls `getData` in `JFUTransferListToListCC` — reads list-to-list transfer data |
| U | `JFUAddSvcKeiTvCC.editErrInfoEKK0341D010` | EKK0341D010 | - | Updates error info mapping for device-provided service contract TV [U] |
| R | `JESC0101B010TPMA.getString` | - | - | Calls `getString` in `JESC0101B010TPMA` — reads ESC customer info data |
| R | `JESC0101B020TPMA.getString` | - | - | Calls `getString` in `JESC0101B020TPMA` — reads ESC customer info data |
| R | `KKW12701SFLogic.getData` | - | - | Calls `getData` in `KKW12701SFLogic` — reads SF logic data |
| R | `ApiBpInterface.getErrorInfo` | - | - | Calls `getErrorInfo` in `ApiBpInterface` — retrieves API business process error info |

The primary business operation is **Update (U)** via `editErrInfoEKK0341D010` which populates error messages for the screen. The mapping itself is effectively a **U** operation on the param's internal data structures (workMap, dataMap, controlMap). No direct Create/Read/Delete on database entities occurs in this method — it is a pure mapping/transformation layer.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JFUAddSvcKeiTvCC.addTvTrk` | `addTvTrk` → `editRetEKK0341D010` | `editErrInfoEKK0341D010 [U] EKK0341D010`; `getErrorInfo [R]` (from `JBSbatDKNyukaFinAdd`, `JBSbatFUCaseFileRnkData`, `JBSbatFUMoveNaviData`, `JBSbatZMAdDataSet`, `JFUeoTelOpTransferCC`, `JFUTransferCC`, `JFUTransferListToListCC`, `JESC0101B010TPMA`, `JESC0101B020TPMA`, `KKW12701SFLogic`, `ApiBpInterface`) |

No screen/batch entry points found within 8 hops. The direct caller `addTvTrk` is itself a common component method that handles TV device service contract registration flow.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `(template extraction and returnCode retrieval)` (L2869)

| # | Type | Code |
|---|------|------|
| 1 | SET | `CAANMsg[] templates = (CAANMsg[])msgList.get(JCMConstants.TEMPLATE_LIST_KEY)` |
| 2 | SET | `CAANMsg template = templates[0]` |
| 3 | SET | `Object returnCode = msgList.get(JCMConstants.RET_CD_INT_KEY)` |

**Block 2** — [IF-ELSE] `(workMap == null)` (L2875)

| # | Type | Code |
|---|------|------|
| 1 | SET | `Map workMap = param.getMappingWorkArea()` |
| 2 | SET | `workMap = new HashMap()` // create if null |
| 3 | EXEC | `param.setMappingWorkArea(workMap)` // store if created |

**Block 3** — [IF-ELSE] `(dataMap == null)` (L2884)

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap dataMap = (HashMap)param.getData(fixedText)` // retrieve data area |
| 2 | SET | `dataMap = new HashMap()` // create if null |
| 3 | EXEC | `param.setData(fixedText, dataMap)` // store if created |

**Block 4** — [IF-ELSE] `(dataList == null)` (L2892) — v1.00.00 追加開始 (v1.00.00 additional start)

| # | Type | Code |
|---|------|------|
| 1 | SET | `ArrayList dataList = (ArrayList)dataMap.get("EKK0341D010TvList")` |
| 2 | SET | `dataList = new ArrayList()` // create if null |
| 3 | EXEC | `dataMap.put("EKK0341D010TvList", dataList)` |

**Block 5** — [IF-ELSE] `(childMap == null)` (L2897) — v1.00.00 追加終了 (v1.00.00 additional end)

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap childMap = (HashMap)dataList.get(index)` |
| 2 | SET | `childMap = new HashMap()` // create if null |
| 3 | EXEC | `dataList.add(index, childMap)` |

**Block 6** — [SET] `(discount service auto-apply initialization — 割引サービス自動適用対応 START)` (L2905)

| # | Type | Code |
|---|------|------|
| 1 | SET | `String sysId = ""` |
| 2 | SET | `String mskmNo = ""` |
| 3 | SET | `HashMap addKeishaServiceCCWorkMap = (HashMap)workMap.get(CC_WORK_AREA_NAME_KEISHA)` // 契約者情報WORK取得 (retrieves subscriber info work) |
| 4 | SET | `HashMap addMskmSCWork = (HashMap)workMap.get(CC_WORK_AREA_NAME_MSKM)` // 申請情報WORK取得 (retrieves application info work) |
| 5 | SET | `HashMap wriSvcAutoAplyMap = (HashMap)param.getData(CC_WRI_SVC_AUTO_APLY_MAP)` // 割引サービス自動適用マップ作成 (creates discount service auto-apply map) |
| 6 | SET | `HashMap svcKeiGrpListMap = new HashMap()` // サードビス契約グループリストマップ (service contract group list map) |
| 7 | SET | `ArrayList svcKeiGrpList = (ArrayList)wriSvcAutoAplyMap.get(SVC_KEI_GRP_LIST)` // サードビス契約グループリスト (service contract group list) |
| 8 | SET | `HashMap svcKeiListMap = new HashMap()` // サードビス契約リストマップ (service contract list map) |
| 9 | SET | `ArrayList svcKeiList = new ArrayList()` // サードビス契約リスト (service contract list) |

**Block 7** — [IF-ELSE] `(template.isNull(KKTK_SVC_KEI_NO))` (L2917) — 機器提供サービス契約登録マップ.機器提供サービス契約番号（機器提供サービス契約）← 機器提供サービス契約番号 (device-provided service contract registration map: device-provided service contract number)

| # | Type | Code |
|---|------|------|
| 1 | SET | `childMap.put("kktk_svc_kei_no", "")` // empty value |
| 2 | SET | `svcKeiListMap.put("kktk_svc_kei_no", "")` // 割引サービス自動適用対応 (discount service auto-apply) |

**Block 7.Else** — `(template not null for KKTK_SVC_KEI_NO)` (L2923)

| # | Type | Code |
|---|------|------|
| 1 | SET | `childMap.put("kktk_svc_kei_no", template.getString(EKK0341D010CBSMsg.KKTK_SVC_KEI_NO))` |
| 2 | SET | `svcKeiListMap.put("kktk_svc_kei_no", template.getString(EKK0341D010CBSMsg.KKTK_SVC_KEI_NO))` |

**Block 8** — [IF-ELSE] `(template.isNull(GENE_ADD_DTM))` (L2932) — 機器提供サービス契約登録マップ.世代登録年月日時分秒（機器提供サービス契約）← 世代登録年月日時分秒 (generation registration date-time)

| # | Type | Code |
|---|------|------|
| 1 | SET | `childMap.put("gene_add_dtm", "")` // empty |
| 2.ELSE | SET | `childMap.put("gene_add_dtm", template.getString(EKK0341D010CBSMsg.GENE_ADD_DTM))` |

**Block 9** — [IF-ELSE] `(template.isNull(KKTK_SVC_KEI_STAT))` (L2941) — 機器提供サービス契約登録マップ.機器提供サービス契約ステータス（機器提供サービス契約）← 機器提供サービス契約ステータス (device-provided service contract status)

| # | Type | Code |
|---|------|------|
| 1 | SET | `childMap.put("kktk_svc_kei_stat", "")` // empty |
| 2.ELSE | SET | `childMap.put("kktk_svc_kei_stat", template.getString(EKK0341D010CBSMsg.KKTK_SVC_KEI_STAT))` |

**Block 10** — [IF-ELSE] `(template.isNull(FTRIAL_PRD_ENDYMD))` (L2950) — 機器提供サービス契約登録マップ.試行期間終了年月日（機器提供サービス契約）← 試行期間終了年月日 (trial period end date)

| # | Type | Code |
|---|------|------|
| 1 | SET | `childMap.put("ftrial_prd_endymd", "")` // empty |
| 2.ELSE | SET | `childMap.put("ftrial_prd_endymd", template.getString(EKK0341D010CBSMsg.FTRIAL_PRD_ENDYMD))` |

**Block 11** — [IF-ELSE] `(template.isNull(RSV_APLY_YMD))` (L2959) — 機器提供サービス契約登録マップ.予約適用年月日（機器提供サービス契約）← 予約適用年月日 (reservation application date)

| # | Type | Code |
|---|------|------|
| 1 | SET | `childMap.put("rsv_aply_ymd", "")` // empty |
| 2.ELSE | SET | `childMap.put("rsv_aply_ymd", template.getString(EKK0341D010CBSMsg.RSV_APLY_YMD))` |

**Block 12** — [IF-ELSE] `(template.isNull(RSV_APLY_CD))` (L2968) — 機器提供サービス契約登録マップ.予約適用コード（機器提供サービス契約）← 予約適用コード (reservation application code)

| # | Type | Code |
|---|------|------|
| 1 | SET | `childMap.put("rsv_aply_cd", "")` // empty |
| 2.ELSE | SET | `childMap.put("rsv_aply_cd", template.getString(EKK0341D010CBSMsg.RSV_APLY_CD))` |

**Block 13** — [IF-ELSE] `(template.isNull(ADD_DTM))` (L2977) — 機器提供サービス契約登録マップ.登録年月日時分秒（機器提供サービス契約）← 登録年月日時分秒 (registration date-time)

| # | Type | Code |
|---|------|------|
| 1 | SET | `childMap.put("add_dtm", "")` // empty |
| 2.ELSE | SET | `childMap.put("add_dtm", template.getString(EKK0341D010CBSMsg.ADD_DTM))` |

**Block 14** — [IF-ELSE] `(template.isNull(ADD_OPEACNT))` (L2986) — 機器提供サービス契約登録マップ.登録オペレーターアカウント（機器提供サービス契約）← 登録オペレーターアカウント (registration operator account)

| # | Type | Code |
|---|------|------|
| 1 | SET | `childMap.put("add_opeacnt", "")` // empty |
| 2.ELSE | SET | `childMap.put("add_opeacnt", template.getString(EKK0341D010CBSMsg.ADD_OPEACNT))` |

**Block 15** — [IF-ELSE] `(template.isNull(UPD_DTM))` (L2995) — 機器提供サービス契約登録マップ.更新年月日時分秒（機器提供サービス契約）← 更新年月日時分秒 (update date-time)

| # | Type | Code |
|---|------|------|
| 1 | SET | `childMap.put("upd_dtm", "")` // empty |
| 2.ELSE | SET | `childMap.put("upd_dtm", template.getString(EKK0341D010CBSMsg.UPD_DTM))` |

**Block 16** — [IF-ELSE] `(template.isNull(UPD_OPEACNT))` (L3004) — 機器提供サービス契約登録マップ.更新オペレーターアカウント（機器提供サービス契約）← 更新オペレーターアカウント (update operator account)

| # | Type | Code |
|---|------|------|
| 1 | SET | `childMap.put("upd_opeacnt", "")` // empty |
| 2.ELSE | SET | `childMap.put("upd_opeacnt", template.getString(EKK0341D010CBSMsg.UPD_OPEACNT))` |

**Block 17** — [IF-ELSE] `(template.isNull(MK_FLG))` (L3013) — 機器提供サービス契約登録マップ.無効フラグ（機器提供サービス契約）← 無効フラグ (invalidation flag / marked flag)

| # | Type | Code |
|---|------|------|
| 1 | SET | `childMap.put("mk_flg", "")` // empty |
| 2.ELSE | SET | `childMap.put("mk_flg", template.getString(EKK0341D010CBSMsg.MK_FLG))` |

**Block 18** — [SET] `(discount service auto-apply mapping — 割引サービス自動適用対応)` (L3022)

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiGrpListMap = (HashMap)svcKeiGrpList.get(0)` // サードビス契約グループリストからサードビス契約グループリストマップを取得 (extract group list map from group list) |
| 2 | SET | `sysId = ""` (initialized in Block 6) |
| 3 | SET | `mskmNo = ""` (initialized in Block 6) |

**Block 19** — [IF-ELSE] `(svcKeiGrpListMap.containsKey(SVC_KEI_LIST))` (L3027) — サードビス契約リストマップからサードビス契約リストを取得 (extract service contract list from group list map)

| # | Type | Code |
|---|------|------|
| 1.1 | IF-THEN | `svcKeiList = (ArrayList)svcKeiGrpListMap.get(SVC_KEI_LIST)` |

**Block 20** — [IF-ELSE] `(wriSvcAutoAplyMap.containsKey("sysid"))` (L3034) — SYS/ID設定 (SYSID setting)

| # | Type | Code |
|---|------|------|
| 1 | SET | `if contains: sysId = (String)wriSvcAutoAplyMap.get("sysid")` |
| 2 | SET | `if "".equals(sysId): wriSvcAutoAplyMap.put("sysid", addKeishaServiceCCWorkMap.get("sysid"))` // fallback to subscriber work |

**Block 21** — [IF-ELSE] `(wriSvcAutoAplyMap.containsKey("mskm_no"))` (L3042) — 申請番号設定 (application number setting)

| # | Type | Code |
|---|------|------|
| 1 | SET | `if contains: mskmNo = (String)wriSvcAutoAplyMap.get("mskm_no")` |
| 2 | SET | `if "".equals(mskmNo): wriSvcAutoAplyMap.put("mskm_no", addMskmSCWork.get("mskm_no"))` // fallback to application work |

**Block 22** — [SET] `(build svcKeiListMap with hardcoded filter values)` (L3050)

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiListMap.put("tg_kei_skbt_cd", "06")` // サードビス契約リストマップ.対象契約区別コード (target contract subtype code = 06) |
| 2 | SET | `svcKeiListMap.put("kktk_svc_kei_stat", "010")` // サードビス契約リストマップ.機器提供サービス契約ステータス "010"：受付済 (status "010" = received/accepted) |
| 3 | SET | `svcKeiListMap.put("pcrs_cd", childMap.get("pcrs_cd"))` // サードビス契約リストマップ.料金コースコード (price course code) |
| 4 | SET | `svcKeiListMap.put("pplan_cd", childMap.get("pplan_cd"))` // サードビス契約リストマップ.料金プランコード (price plan code) |
| 5 | SET | `svcKeiListMap.put("kktk_svc_cd", childMap.get("kktk_svc_cd"))` // サードビス契約リストマップ.機器提供サービスコード (device-provided service code) |
| 6 | SET | `svcKeiListMap.put("kktk_sbt_cd", childMap.get("kktk_sbt_cd"))` // サードビス契約リストマップ.機器提供種類コード (device-provided subtype code) |

**Block 23** — [EXEC] `(add to list)` (L3058)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `svcKeiList.add(svcKeiListMap)` // サードビス契約リストにサードビス契約リストマップを格納 (insert svcKeiListMap into svcKeiList) |

**Block 24** — [IF] `(discount service auto-apply: add svcKeiList to group map if missing)` (L3063) — サードビスグループリストマップにサードビス契約リストが存在しない場合 (if svcKeiList doesn't exist in group map)

| # | Type | Code |
|---|------|------|
| 1 | IF-THEN | `svcKeiGrpListMap.put(SVC_KEI_LIST, svcKeiList)` // サードビス契約リストをグループリストマップに追加 (add svcKeiList to group list map) |

**Block 25** — [EXEC] `(error info setup)` (L3071) — エラー情報の設定 (error info setup)

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

**Block 26** — [IF-ELSE] `(errList == null)` (L3075) — エラー情報のマップを取得 (retrieve error info map)

| # | Type | Code |
|---|------|------|
| 1 | SET | `ArrayList<Object> errList = (ArrayList<Object>)param.getControlMapData(SCControlMapKeys.ERROR_INFO)` |
| 2.1 | IF-THEN | `errList = new ArrayList<Object>()` // create if null |

**Block 27** — [EXEC] `(set control map error info)` (L3081) — コントロールマップに設定 (set in control map)

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

**Block 28** — [RETURN] (L3083)

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

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `kkk_svc_kei_no` | Field | Device-provided service contract number — the unique identifier for a device-provided service contract line item |
| `gene_add_dtm` | Field | Generation registration date-time — when the service contract record was initially registered in the system |
| `kkk_svc_kei_stat` | Field | Device-provided service contract status — the current lifecycle state of the service contract (e.g., "010" = received/accepted) |
| `ftrial_prd_endymd` | Field | Trial period end date — the date when a trial service period expires |
| `rsv_aply_ymd` | Field | Reservation application date — when a reservation was applied for this service |
| `rsv_aply_cd` | Field | Reservation application code — codes the type of reservation application |
| `add_dtm` | Field | Registration date-time — timestamp of when the record was created |
| `add_opeacnt` | Field | Registration operator account — the operator who created the record |
| `upd_dtm` | Field | Update date-time — timestamp of the last modification |
| `upd_opeacnt` | Field | Update operator account — the operator who last modified the record |
| `mk_flg` | Field | Invalidation flag (Mark Flag) — indicates whether the record is marked as invalid/deleted |
| `tg_kei_skbt_cd` | Field | Target contract subtype code — filter code for contract type classification ("06" = device-provided service) |
| `pcrs_cd` | Field | Price course code — the pricing tier/course for the service |
| `pplan_cd` | Field | Price plan code — the specific pricing plan for the service |
| `kkk_svc_cd` | Field | Device-provided service code — identifies the type of device-provided service |
| `kkk_sbt_cd` | Field | Device-provided subtype code — sub-classification of the device-provided service |
| `CC_WORK_AREA_NAME_KEISHA` | Constant | Subscriber information work area name — key to retrieve subscriber data from the work map |
| `CC_WORK_AREA_NAME_MSKM` | Constant | Application information work area name — key to retrieve application data from the work map |
| `CC_WRI_SVC_AUTO_APLY_MAP` | Constant | Write service auto-apply map key — key to access the discount service auto-apply configuration map |
| `SVC_KEI_GRP_LIST` | Constant | Service contract group list key — key to retrieve the service contract group list from the auto-apply map |
| `SVC_KEI_LIST` | Constant | Service contract list key — key to retrieve the service contract list from the group list map |
| `JCMConstants` | Class | JCM framework constants — defines keys for TEMPLATE_LIST_KEY and RET_CD_INT_KEY used in msgList |
| `EKK0341D010CBSMsg` | Class | CBS message constants for screen EKK0341D010 — defines field identifiers like KKTK_SVC_KEI_NO, GENE_ADD_DTM, etc. |
| `SCControlMapKeys` | Class | Service Component control map keys — defines constants like ERROR_INFO for control map data |
| `TemplateErrorUtil` | Class | Template error utility — provides `getErrorInfo` to aggregate error information from template and list |
| CAANMsg | Class | CBS response message wrapper — carries field values from the downstream CBS (Communication Business System) |
| IRequestParameterReadWrite | Interface | Request/response parameter interface — the data carrier for all work areas, data maps, and control maps |
| 割引サービス自動適用対応 | Japanese comment | Discount service automatic application support — a feature added in v1.00.00 that automatically applies discount services by building service contract lists with predetermined filter codes |
| 機器提供サービス契約登録 | Japanese term | Device-provided service contract registration — the business domain for registering service contracts tied to hardware/devices |
| 下りマッピング処理 | Japanese term | Downward mapping processing — the flow of transforming CBS response data (top-down) into application-level data structures for screen display |
| 契約者情報 | Japanese term | Subscriber information — data about the customer/account holder |
| 申請情報 | Japanese term | Application information — data about the service application/request |
| サービス契約グループリスト | Japanese term | Service contract group list — hierarchical list grouping service contracts |
| サービス契約リスト | Japanese term | Service contract list — flat list of service contract records |
| 受付済 | Japanese term | Received/accepted — status code "010" indicating the service contract has been received by the system |
