# Business Logic — JFUAddSvcKeiTvCC.editRetEKK0101D010() [289 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` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JFUAddSvcKeiTvCC.editRetEKK0101D010()

This method performs the **downward (output) mapping process** for the **Service Contract <TV> Registration** screen (EKK0101D010), responsible for transforming CBS (Common Business Service) response message data into the screen's display-ready data structures. It serves as the central data preparation hub that a CBS response message is consumed, its fields are extracted and mapped into the response data map (`dataMap`), and auxiliary processing maps for **discount service auto-application**, **star channel calculation**, and **contract reservation registration at application time** are populated. The method implements a **sequential routing and data aggregation pattern** — it retrieves all required work-area maps from the request parameter, initializes them if missing, then populates three specialized downstream maps (one each for star channel settlement, discount service auto-application, and rejected-contract reservation) before returning the fully prepared parameter object. Its role in the larger system is as a **shared mapping component** called by the `addTvTrk()` method of the same class, acting as the bridge between CBS-layer business processing and the presentation layer's data requirements. The method handles null safety for every field extraction, defaulting missing values to empty strings to prevent downstream null-pointer issues.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editRetEKK0101D010
msgList, param, fixedText"])
    GET_TEMPLATES["Get templates and returnCode from msgList"]
    INIT_WORK_AREA["Initialize workMap and workDataMap
Create HashMaps if null"]
    INIT_DATA_MAP["Initialize dataMap
param.getData(fixedText)"]
    INIT_VARIABLES["Extract tvMap, addKeishaWorkMap,
addMskmWorkMap, wriSvcAutoAplyMap,
starChannelSetwariMAP, jFUAddMkjMap"]
    CHECK_SVC_KEI_NO{"template.isNull
SVC_KEI_NO?"}
    SET_SVC_EMPTY["dataMap.put svc_kei_no empty
svcKeiListMap.put svc_kei_no empty"]
    SET_SVC_VALUE["dataMap.put svc_kei_no from template
workDataMap.put svc_kei_no from template
svcKeiListMap.put svc_kei_no from template"]
    SET_SVC_EMPTY --> MAP_OTHERS
    SET_SVC_VALUE --> MAP_OTHERS
    MAP_OTHERS["Template field mappings to dataMap
For each field: check isNull, set empty or value
Fields: GENE_ADD_DTM, SVC_KEI_STAT,
FTRIAL_PRD_ENDYMD, RSV_APLY_YMD, RSV_APLY_CD,
KK0101_GENE_ADD_DTM, ADD_DTM, ADD_OPEACNT,
UPD_DTM, UPD_OPEACNT, MK_FLG"]
    GET_SVC_GRP_MAP["svcKeiGrpListMap = svcKeiGrpList.get 0"]
    CHECK_HAS_SVC_LIST{"svcKeiGrpListMap containsKey
SVC_KEI_LIST?"}
    CHECK_HAS_SVC_LIST_YES["svcKeiList = svcKeiGrpListMap.get SVC_KEI_LIST"]
    CHECK_HAS_SVC_LIST_NO["svcKeiList = new ArrayList empty"]
    SET_SYSID["sysId from wriSvcAutoAplyMap or keisha workMap"]
    SET_MSKM["mskmNo from wriSvcAutoAplyMap or mskm workMap"]
    BUILD_SVC_LIST_MAP["svcKeiListMap.put tg_kei_skbt_cd=01
svc_kei_stat=010, svc_cd, prc_grp_cd, pcrs_cd, pplan_cd"]
    ADD_TO_LIST["svcKeiList.add svcKeiListMap"]
    ADD_LIST_TO_GRP["If svcKeiGrpListMap does not contain
SVC_KEI_LIST: put svcKeiList"]
    SET_STAR_CHANNEL["starChannelSetwariMAP.put SYSID, SVC_KEI_NO,
MSKM_DTL_NO, KK0081_UPD_DTM"]
    SET_MKJ_MAP["jFUAddMkjMap.put MSKM_DTL_NO,
SETE_TG_KEI_NO, UPD_DTM_BF"]
    SET_DATA["param.setData fixedText, dataMap"]
    EDIT_ERR["editErrInfoEKK0101D010
param, template, returnCode, fixedText"]
    GET_ERR_LIST["Get errList from param.getControlMapData ERROR_INFO"]
    CHECK_ERR_LIST{"errList == null?"}
    CREATE_ERR_LIST["Create new ArrayList"]
    SET_CONTROL_MAP["param.setControlMapData ERROR_INFO
getErrorInfo from msgList and errList"]
    END_NODE(["Return param"])

    START --> GET_TEMPLATES
    GET_TEMPLATES --> INIT_WORK_AREA
    INIT_WORK_AREA --> INIT_DATA_MAP
    INIT_DATA_MAP --> INIT_VARIABLES
    INIT_VARIABLES --> CHECK_SVC_KEI_NO
    CHECK_SVC_KEI_NO -->|Yes| SET_SVC_EMPTY
    CHECK_SVC_KEI_NO -->|No| SET_SVC_VALUE
    MAP_OTHERS --> GET_SVC_GRP_MAP
    GET_SVC_GRP_MAP --> CHECK_HAS_SVC_LIST
    CHECK_HAS_SVC_LIST -->|Yes| CHECK_HAS_SVC_LIST_YES
    CHECK_HAS_SVC_LIST -->|No| CHECK_HAS_SVC_LIST_NO
    CHECK_HAS_SVC_LIST_YES --> SET_SYSID
    CHECK_HAS_SVC_LIST_NO --> SET_SYSID
    SET_SYSID --> SET_MSKM
    SET_MSKM --> BUILD_SVC_LIST_MAP
    BUILD_SVC_LIST_MAP --> ADD_TO_LIST
    ADD_TO_LIST --> ADD_LIST_TO_GRP
    ADD_LIST_TO_GRP --> SET_STAR_CHANNEL
    SET_STAR_CHANNEL --> SET_MKJ_MAP
    SET_MKJ_MAP --> SET_DATA
    SET_DATA --> EDIT_ERR
    EDIT_ERR --> GET_ERR_LIST
    GET_ERR_LIST --> CHECK_ERR_LIST
    CHECK_ERR_LIST -->|Yes| CREATE_ERR_LIST
    CHECK_ERR_LIST -->|No| SET_CONTROL_MAP
    CREATE_ERR_LIST --> SET_CONTROL_MAP
    SET_CONTROL_MAP --> END_NODE
```

**Constant Resolution:**
- `CC_WORK_AREA_NAME` = `"JFUAddSvcKeiTvCCWork"` — Work map key for this CC's private work area
- `CC_WORK_AREA_NAME_KEISHA` = `"JFUAddKeishaServiceCCWork"` — Contractor (add-lessee) service work area key
- `CC_WORK_AREA_NAME_MSKM` = `"JFUAddMskmSCWork"` — Application details SC work area key
- `CC_WRI_SVC_AUTO_APLY_MAP` = `"JKKWrisvcAutoAplyCCMap"` — Discount service auto-application CC map key
- `SVC_KEI_GRP_LIST` = `"svc_kei_grp_list"` — Service contract group list key within the auto-application map
- `SVC_KEI_LIST` = `"svc_kei_list"` — Service contract list key within a service contract group map
- `TEMPLATE_ID_TV` = `"EKK0101D010"` — Service Contract <TV> Registration map template ID
- `FUSV015229CC` = `"FUSV015229CC"` — Star channel settlement calculation CC map key
- `SYSID` = `"sysid"` — System ID key for star channel settlement
- `SVC_KEI_NO` = `"svc_kei_no"` — Service contract number key
- `MSKM_DTL_NO` = `"mskm_dtl_no"` — Application details number key
- `EKK0101_MSKM_DTL_NO` = `"ekk0101_mskm_dtl_no"` — EKK0101-specific application details number key
- `KK0081_UPD_DTM` = `"kk0081_upd_dtm"` — Update datetime (pre-update) key for star channel settlement
- `UPD_DTM` = `"upd_dtm"` — Update datetime key
- `EKK2931D010` = `"EKK2931D010"` — Contract reservation registration at application time CC map key
- `SETE_TG_KEI_NO` = `"sete_tg_kei_no"` — Set target contract number key (for rejected-contract reservation)
- `UPD_DTM_BF` = `"upd_dtm_bf"` — Update datetime before update (for rejected-contract reservation)

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `msgList` | `Map<?, ?>` | The CBS response message map containing the service contract <TV> registration data returned from the database. Holds the message templates array (keyed by `TEMPLATE_LIST_KEY`), the return code (keyed by `RET_CD_INT_KEY`), and error information. This is the primary source of truth for all CBS-level data that flows to the screen. |
| 2 | `param` | `IRequestParameterReadWrite` | The request/response parameter object that carries the screen's working data. It provides access to the mapping work area (for cross-CC data sharing), data storage by fixed keys (via `getData`/`setData`), and control map data (for error information routing). Used throughout to read from and write to various work maps. |
| 3 | `fixedText` | `String` | The data storage key used to store/retrieve the response data map (`dataMap`) within the `param` object. This key distinguishes the data map for this specific mapping process from other concurrent mappings in the same request cycle. |

**Instance/External State Read:**
- None directly — this method operates on local variables and parameter-passed objects only.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `KKW12701SFLogic.getData` | EKK0101D010CBS | KK_T_SVC_KEI_TV | Reads TV service info data from star channel logic — retrieves service contract number for the star channel settlement map |
| R | `JFUTransferListToListCC.getData` | EKK0101D010CBS | KK_T_SVC_KEI_TV | Reads service contract list data and maps to TV-specific format — used for retrieving TV service mapping data |
| R | `JFUTransferCC.getData` | EKK0101D010CBS | KK_T_SVC_KEI_TV | Reads raw data fields and transfers to screen-specific data structures |
| R | `JFUeoTelOpTransferCC.getData` | EKK0101D010CBS | KK_T_SVC_KEI_TV | Reads EO TV operation-specific transfer data |
| U | `JFUAddSvcKeiTvCC.editErrInfoEKK0101D010` | EKK0101D010CBS | - | Updates error information in the param control map — prepares error messages for screen display |
| R | `JBSbatACECBuyIfTrkm.getErrorInfo` | EKK0101D010CBS | - | Reads error information from ACE buy-if tracking result |
| R | `JBSbatACKojiChrgInfoTrkm.getErrorInfo` | EKK0101D010CBS | - | Reads error information from ACS Koji (special) charge info tracking result |
| R | `JBSbatDKNyukaFinAdd.getData` | EKK0101D010CBS | KK_T_DKNYUKA_FIN | Reads data map from DK entry finish add — related to data entry completion state |
| R | `JBSbatFUCaseFileRnkData.getString` | EKK0101D010CBS | KK_T_CASE_FILE_RNK | Reads string data from FU case file ranking — customer case file reference |
| R | `JBSbatFUMoveNaviData.getString` | EKK0101D010CBS | - | Reads move navigation data from FU module |
| R | `JBSbatZMAdDataSet.getString` | EKK0101D010CBS | ZM_M_* | Reads from ZM Ad data set — customer address/registration data |
| R | `JESC0101B010TPMA.getString` | EKK0101D010CBS | - | Reads string data from ESC TV mapping — TV service mapping table |
| R | `JESC0101B020TPMA.getString` | EKK0101D010CBS | - | Reads additional TV mapping data from ESC mapping table |
| - | `JACBatCommon.isNull` | EKK0101D010CBS | - | Null-check utility — validates whether fields are null before extraction |
| - | `JACbatRknBusinessUtil.isNull` | EKK0101D010CBS | - | Null-check utility for business validation |
| - | `JCHbatSeikyKaknoBusinessUtil.isNull` | EKK0101D010CBS | - | Null-check utility for settlement desk business validation |
| - | `JBSbatACInsentetivePrcInfoSaksei.isNull` | EKK0101D010CBS | - | Null-check for ACS incentive price info creation |
| - | `JBSbatAKCHSeikyYsoInfMake.isNull` | EKK0101D010CBS | - | Null-check for AK CH settlement estimate info make |
| - | `JBSbatAKKshkmRsltInfoTukiawsday.setData` | EKK0101D010CBS | KK_T_AKK_SHHM_RSLT | Sets daily matching result info for AK charges |
| - | `JBSbatAKKshkmRsltInfoTukiaws.setData` | EKK0101D010CBS | KK_T_AKK_SHHM_RSLT | Sets AK charges matching result info |
| - | `JBSbatAKKshkmRsltInfoTukiawsRealSkh.setData` | EKK0101D010CBS | KK_T_AKK_SHHM_RSLT | Sets AK charges matching result info with real schedule |
| - | `JBSbatAKKshkmRsltInfTkCvsNCnsl.setData` | EKK0101D010CBS | KK_T_AKK_SHHM_RSLT | Sets AK charges matching result info with CVS cancellation |
| - | `JBSbatKKGetCTITelno.setData` | EKK0101D010CBS | KK_T_CIT_TELNO | Sets CIT telephone number data for customer information table |
| - | `JFUTransferListToListCC.setData` | EKK0101D010CBS | - | Sets transfer data from list to list |
| - | `JFUTransferCC.setData` | EKK0101D010CBS | - | Sets transferred data between layers |
| - | `JFUeoTelOpTransferCC.setData` | EKK0101D010CBS | - | Sets EO TV operation transfer data |
| - | `ApiBpInterface.getErrorInfo` | EKK0101D010CBS | - | Reads error info from API business process interface |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CC:JFUAddSvcKeiTvCC | `JFUAddSvcKeiTvCC.addTvTrk` -> `JFUAddSvcKeiTvCC.editRetEKK0101D010` | `template.getString [R]`, `template.isNull [R]`, `param.setData [U]`, `editErrInfoEKK0101D010 [U]`, `param.getData [R]`, `getErrorInfo [R]` |

**Call Chain Description:**
- `JFUAddSvcKeiTvCC.addTvTrk()` — The service contract <TV> registration entry point in the same class. It invokes `editRetEKK0101D010` as part of the downward mapping phase, preparing the screen's display data after CBS processing completes.

**Terminal Operations from this method:**
- `template.getString [R]` — Reads fields from CBS response message template (service contract number, state, timestamps, flags, etc.)
- `template.isNull [R]` — Validates field presence in CBS response
- `param.setData [U]` — Writes prepared data map back to param with fixedText key
- `param.getData [R]` — Reads work-area maps and auxiliary processing maps from param
- `param.setMappingWorkArea [U]` — Sets the mapping work area for cross-CC data sharing
- `param.setControlMapData [U]` — Sets error information in the control map for screen display
- `editErrInfoEKK0101D010 [U]` — Prepares and writes error info to the response

## 6. Per-Branch Detail Blocks

### Initialization Phase

**Block 1** — [SET/EXEC] `(Parameter extraction and map initialization)` (L2278)

> Extracts templates, return code, work area, and data map from parameters. Initializes maps if null.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `CAANMsg[] templates = (CAANMsg[])msgList.get(JCMConstants.TEMPLATE_LIST_KEY)` // Get message templates from msgList [-> TEMPLATE_LIST_KEY] |
| 2 | SET | `CAANMsg template = templates[0]` // Select the first (primary) template |
| 3 | EXEC | `Object returnCode = msgList.get(JCMConstants.RET_CD_INT_KEY)` // Get return code [-> RET_CD_INT_KEY] |
| 4 | EXEC | `Map workMap = param.getMappingWorkArea()` // Get work map |
| 5 | IF | `workMap == null` |

**Block 1.1** — [ELSE] `(Initialize workMap)` (L2285)

| # | Type | Code |
|---|------|------|
| 1 | SET | `workMap = new HashMap()` // Create new HashMap [-> CC_WORK_AREA_NAME="JFUAddSvcKeiTvCCWork"] |
| 2 | EXEC | `param.setMappingWorkArea(workMap)` // Store in param |

**Block 1.2** — [NESTED INIT] `(Initialize workDataMap)` (L2289)

> Gets the CC's private work area from workMap, creates if missing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap workDataMap = (HashMap)workMap.get(CC_WORK_AREA_NAME)` // [-> CC_WORK_AREA_NAME="JFUAddSvcKeiTvCCWork"] |
| 2 | IF | `workDataMap == null` |

**Block 1.2.1** — [ELSE] `(Create workDataMap)` (L2292)

| # | Type | Code |
|---|------|------|
| 1 | SET | `workDataMap = new HashMap()` |
| 2 | SET | `workMap.put(CC_WORK_AREA_NAME, workDataMap)` // [-> "JFUAddSvcKeiTvCCWork"] |

**Block 1.3** — [SET] `(Initialize dataMap)` (L2297)

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap dataMap = (HashMap)param.getData(fixedText)` // Get data map by fixedText key |
| 2 | IF | `dataMap == null` |

**Block 1.3.1** — [ELSE] `(Create dataMap)` (L2299)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap = new HashMap()` |
| 2 | SET | `param.setData(fixedText, dataMap)` // Store data map back |

**Block 1.4** — [SET] `(Extract auxiliary data structures)` (L2304)

> Prepares all secondary work maps and lists for discount service, star channel, and contract reservation processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String sysId = ""` // Initialize system ID |
| 2 | SET | `String mskmNo = ""` // Initialize application number |
| 3 | SET | `HashMap tvMap = (HashMap)(param.getData("EKK0101D010"))` // TV service info map |
| 4 | SET | `HashMap addKeishaServiceCCWorkMap = (HashMap)workMap.get(CC_WORK_AREA_NAME_KEISHA)` // [-> "JFUAddKeishaServiceCCWork"] |
| 5 | SET | `HashMap addMskmSCWork = (HashMap)workMap.get(CC_WORK_AREA_NAME_MSKM)` // [-> "JFUAddMskmSCWork"] |
| 6 | SET | `HashMap wriSvcAutoAplyMap = (HashMap)param.getData(CC_WRI_SVC_AUTO_APLY_MAP)` // [-> "JKKWrisvcAutoAplyCCMap"] |
| 7 | SET | `HashMap starChannelSetwariMAP = (HashMap)param.getData(FUSV015229CC)` // [-> "FUSV015229CC"] |
| 8 | SET | `HashMap jFUAddMkjAddfKeiRvCCMAP = (HashMap)param.getData(EKK2931D010)` // [-> "EKK2931D010"] |
| 9 | SET | `HashMap svcKeiGrpListMap = new HashMap()` // Service contract group list map |
| 10 | SET | `ArrayList svcKeiGrpList = (ArrayList)wriSvcAutoAplyMap.get(SVC_KEI_GRP_LIST)` // [-> "svc_kei_grp_list"] |
| 11 | SET | `HashMap svcKeiListMap = new HashMap()` // Service contract list map |
| 12 | SET | `ArrayList svcKeiList = new ArrayList()` // Service contract list |

### Service Contract Number Mapping

**Block 2** — [IF] `(template.isNull(EKK0101D010CBSMsg.SVC_KEI_NO))` (L2322)

> Checks if the service contract number field is null in the CBS template. Sets empty string or copies from template to all three maps (dataMap, workDataMap, svcKeiListMap).

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("svc_kei_no", "")` // Set empty string [-> "svc_kei_no"] |
| 2 | SET | `svcKeiListMap.put("svc_kei_no", "")` // Set empty in service list map [-> "svc_kei_no"] |
| 3 | ELSE | |

**Block 2.1** — [ELSE] `(Copy service contract number from template)` (L2328)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("svc_kei_no", template.getString(EKK0101D010CBSMsg.SVC_KEI_NO))` // [-> "svc_kei_no"] |
| 2 | SET | `workDataMap.put("svc_kei_no", template.getString(EKK0101D010CBSMsg.SVC_KEI_NO))` // [-> "svc_kei_no"] |
| 3 | SET | `svcKeiListMap.put("svc_kei_no", template.getString(EKK0101D010CBSMsg.SVC_KEI_NO))` // [-> "svc_kei_no"] |

### Template Field Mappings (11 fields, each with isNull check)

**Block 3** — [IF] `(template.isNull(EKK0101D010CBSMsg.GENE_ADD_DTM))` (L2336)

> Service Contract <TV> Registration — Generation registration datetime stamp. Sets empty or copies from template.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("kk0081_gene_add_dtm", "")` |
| 2 | ELSE | `dataMap.put("kk0081_gene_add_dtm", template.getString(EKK0101D010CBSMsg.GENE_ADD_DTM))` |

**Block 4** — [IF] `(template.isNull(EKK0101D010CBSMsg.SVC_KEI_STAT))` (L2346)

> Service Contract <TV> Registration — Service contract status. Sets empty or copies from template.

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

**Block 5** — [IF] `(template.isNull(EKK0101D010CBSMsg.FTRIAL_PRD_ENDYMD))` (L2356)

> Service Contract <TV> Registration — Trial period end date. Sets empty or copies from template.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("ftrial_prd_endymd", "")` |
| 2 | ELSE | `dataMap.put("ftrial_prd_endymd", template.getString(EKK0101D010CBSMsg.FTRIAL_PRD_ENDYMD))` |

**Block 6** — [IF] `(template.isNull(EKK0101D010CBSMsg.RSV_APLY_YMD))` (L2366)

> Service Contract <TV> Registration — Reservation application date. Sets empty or copies from template.

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

**Block 7** — [IF] `(template.isNull(EKK0101D010CBSMsg.RSV_APLY_CD))` (L2376)

> Service Contract <TV> Registration — Reservation application code. Sets empty or copies from template.

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

**Block 8** — [IF] `(template.isNull(EKK0101D010CBSMsg.KK0101_GENE_ADD_DTM))` (L2386)

> Service Contract <TV> Registration — Generation registration datetime stamp (EO TV specific). Sets empty or copies from template.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("gene_add_dtm", "")` |
| 2 | ELSE | `dataMap.put("gene_add_dtm", template.getString(EKK0101D010CBSMsg.KK0101_GENE_ADD_DTM))` |

**Block 9** — [IF] `(template.isNull(EKK0101D010CBSMsg.ADD_DTM))` (L2396)

> Service Contract <TV> Registration — Registration datetime stamp. Sets empty or copies from template.

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

**Block 10** — [IF] `(template.isNull(EKK0101D010CBSMsg.ADD_OPEACNT))` (L2406)

> Service Contract <TV> Registration — Registration operator account. Sets empty or copies from template.

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

**Block 11** — [IF] `(template.isNull(EKK0101D010CBSMsg.UPD_DTM))` (L2416)

> Service Contract <TV> Registration — Update datetime stamp. Sets empty or copies from template.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put("upd_dtm", "")` |
| 2 | ELSE | `dataMap.put("upd_dtm", template.getString(EKK0101D010CBSMsg.UPD_DTM))` |

**Block 12** — [IF] `(template.isNull(EKK0101D010CBSMsg.UPD_OPEACNT))` (L2426)

> Service Contract <TV> Registration — Update operator account. Sets empty or copies from template.

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

**Block 13** — [IF] `(template.isNull(EKK0101D010CBSMsg.MK_FLG))` (L2436)

> Service Contract <TV> Registration — Invalid flag. Sets empty or copies from template.

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

### Discount Service Auto-Application Phase

**Block 14** — [SET] `(Extract service contract group list)` (L2444)

> Gets the first element from svcKeiGrpList and assigns it as the group list map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiGrpListMap = (HashMap)svcKeiGrpList.get(0)` // Get first group from discount service auto-application list |

**Block 15** — [IF] `(svcKeiGrpListMap.containsKey(SVC_KEI_LIST))` (L2448)

> Checks if the service contract group map contains a service contract list. [-> SVC_KEI_LIST="svc_kei_list"]

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiList = (ArrayList)svcKeiGrpListMap.get(SVC_KEI_LIST)` // Get existing svc_kei_list |
| 2 | ELSE | `svcKeiList = new ArrayList()` // Already initialized above, but this branch provides safety |

**Block 16** — [IF] `(wriSvcAutoAplyMap.containsKey("sysid"))` (L2453)

> Reads the system ID from the discount service auto-application map.

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

**Block 16.1** — [ELSE] `(Fill sysId from contractor work map)` (L2456)

| # | Type | Code |
|---|------|------|
| 1 | SET | `wriSvcAutoAplyMap.put("sysid", (String)addKeishaServiceCCWorkMap.get("sysid"))` // Copy sysId from keisha work area |

**Block 17** — [IF] `(wriSvcAutoAplyMap.containsKey("mskm_no"))` (L2460)

> Reads the application number from the discount service auto-application map.

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

**Block 17.1** — [ELSE] `(Fill mskmNo from application work map)` (L2463)

| # | Type | Code |
|---|------|------|
| 1 | SET | `wriSvcAutoAplyMap.put("mskm_no", (String)addMskmSCWork.get("mskm_no"))` // Copy from mskm SC work area |

**Block 18** — [SET] `(Build service contract list map)` (L2467)

> Constructs a new service contract list entry with standard filter values (target contract type = "01", status = "010" = accepted, and dynamic values from tvMap).

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiListMap.put("tg_kei_skbt_cd", "01")` // Target contract subtype code = "01" |
| 2 | SET | `svcKeiListMap.put("svc_kei_stat", "010")` // Service contract status = "010" (accepted) |
| 3 | SET | `svcKeiListMap.put("svc_cd", tvMap.get("svc_cd"))` // Service code from TV map |
| 4 | SET | `svcKeiListMap.put("prc_grp_cd", tvMap.get("prc_grp_cd"))` // Price group code from TV map |
| 5 | SET | `svcKeiListMap.put("pcrs_cd", tvMap.get("pcrs_cd"))` // Price course code from TV map |
| 6 | SET | `svcKeiListMap.put("pplan_cd", tvMap.get("pplan_cd"))` // Price plan code from TV map |

**Block 19** — [EXEC] `(Add to list and group)` (L2473)

> Appends the built service contract list map to the list, then adds the list to the group map if not already present.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `svcKeiList.add(svcKeiListMap)` // Add the new entry |
| 2 | IF | `!svcKeiGrpListMap.containsKey(SVC_KEI_LIST)` |

**Block 19.1** — [ELSE] `(Add list to group if missing)` (L2477)

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiGrpListMap.put(SVC_KEI_LIST, svcKeiList)` // [-> "svc_kei_list"] |

### Star Channel Settlement Map Population

**Block 20** — [SET] `(Star channel settlement map — SYSID)` (L2481)

> Sets the system ID in the star channel settlement map from the contractor work area.

| # | Type | Code |
|---|------|------|
| 1 | SET | `starChannelSetwariMAP.put(SYSID, (String)addKeishaServiceCCWorkMap.get(SYSID))` // [-> "sysid"] |

**Block 21** — [SET] `(Star channel settlement map — Service contract number)` (L2484)

| # | Type | Code |
|---|------|------|
| 1 | SET | `starChannelSetwariMAP.put(SVC_KEI_NO, (String)tvMap.get(SVC_KEI_NO))` // [-> "svc_kei_no"] |

**Block 22** — [SET] `(Star channel settlement map — Application details number)` (L2487)

| # | Type | Code |
|---|------|------|
| 1 | SET | `starChannelSetwariMAP.put(MSKM_DTL_NO, (String)addMskmSCWork.get(EKK0101_MSKM_DTL_NO))` // [-> "mskm_dtl_no", "ekk0101_mskm_dtl_no"] |

**Block 23** — [SET] `(Star channel settlement map — Pre-update datetime)` (L2490)

| # | Type | Code |
|---|------|------|
| 1 | SET | `starChannelSetwariMAP.put(KK0081_UPD_DTM, (String)tvMap.get(UPD_DTM))` // [-> "kk0081_upd_dtm", "upd_dtm"] |

### Contract Reservation Registration at Application Time

**Block 24** — [SET] `(Set application details number in reservation map)` (L2493)

> Sets the application details number for the rejected-contract reservation map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `jFUAddMkjAddfKeiRvCCMAP.put(MSKM_DTL_NO, (String)addMskmSCWork.get(EKK0101_MSKM_DTL_NO))` // [-> "mskm_dtl_no", "ekk0101_mskm_dtl_no"] |

**Block 25** — [SET] `(Set target contract number in reservation map)` (L2496)

> Sets the target service contract number for the rejected-contract reservation map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `jFUAddMkjAddfKeiRvCCMAP.put(SETE_TG_KEI_NO, (String)tvMap.get(SVC_KEI_NO))` // [-> "sete_tg_kei_no", "svc_kei_no"] |

**Block 26** — [SET] `(Set pre-update datetime in reservation map)` (L2499)

> Sets the update datetime (before update) for the rejected-contract reservation map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `jFUAddMkjAddfKeiRvCCMAP.put(UPD_DTM_BF, (String)tvMap.get(UPD_DTM))` // [-> "upd_dtm_bf", "upd_dtm"] |

### Finalization Phase

**Block 27** — [SET] `(Store data map back to param)` (L2502)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `param.setData(fixedText, dataMap)` // Write final data map to param |

**Block 28** — [EXEC] `(Prepare error information)` (L2505)

> Calls the error info preparation method for this specific screen.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `editErrInfoEKK0101D010(param, template, (Integer)returnCode, fixedText)` // Prepare error messages |

**Block 29** — [EXEC] `(Get and set error control map data)` (L2509)

> Retrieves the error list from param, creates new one if null, then sets the consolidated error info into the control map.

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

**Block 29.1** — [ELSE] `(Create error list)` (L2513)

| # | Type | Code |
|---|------|------|
| 1 | SET | `errList = new ArrayList<Object>()` |
| 2 | EXEC | `param.setControlMapData(SCControlMapKeys.ERROR_INFO, TemplateErrorUtil.getErrorInfo(msgList, errList))` // [-> ERROR_INFO] |

**Block 30** — [RETURN] `(Return param)` (L2517)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return param` // Return fully prepared request parameter |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service contract number — the unique identifier for a service contract line item |
| `svc_kei_stat` | Field | Service contract status — "010" means "Accepted/Completed" (受注済み) |
| `kk0081_gene_add_dtm` | Field | Generation registration datetime stamp — timestamp when the service contract was registered/generated |
| `ftrial_prd_endymd` | Field | Trial period end date — the date when a free trial service period ends |
| `rsv_aply_ymd` | Field | Reservation application date — date when the service reservation was applied |
| `rsv_aply_cd` | Field | Reservation application code — code classifying the type of reservation application |
| `gene_add_dtm` | Field | Generation registration datetime (EO TV specific) — generation registration timestamp specific to EO TV service contracts |
| `add_dtm` | Field | Registration datetime stamp — when the record was initially created |
| `add_opeacnt` | Field | Registration operator account — the user account that created the record |
| `upd_dtm` | Field | Update datetime stamp — when the record was last modified |
| `upd_opeacnt` | Field | Update operator account — the user account that last modified the record |
| `mk_flg` | Field | Invalid flag — flag indicating whether the record is invalid/deactivated (無効フラグ) |
| `tg_kei_skbt_cd` | Field | Target contract subtype code — "01" indicates the primary contract type |
| `svc_cd` | Field | Service code — code identifying the service type (e.g., TV, FTTH, Mail) |
| `prc_grp_cd` | Field | Price group code — code classifying the pricing group for the service |
| `pcrs_cd` | Field | Price course code — code identifying the pricing course/tier |
| `pplan_cd` | Field | Price plan code — code identifying the specific pricing plan |
| `sysid` | Field | System ID — identifier for the system component in the auto-application processing |
| `mskm_no` | Field | Application details number — the line-item number within an application |
| `ekk0101_mskm_dtl_no` | Field | EKK0101-specific application details number — the application detail number for the EKK0101 screen |
| `kk0081_upd_dtm` | Field | Update datetime pre-update — the update datetime value before the current modification |
| `upd_dtm_bf` | Field | Update datetime before — the update datetime before the update (for rejected-contract reservation) |
| `svc_kei_no` | Field | Service contract number — the unique identifier for a service contract line item |
| SVC_KEI_NO | Constant | Key "svc_kei_no" — used across maps to reference the service contract number |
| MSKM_DTL_NO | Constant | Key "mskm_dtl_no" — used to reference the application details number |
| SYSID | Constant | Key "sysid" — used to reference the system ID in star channel settlement |
| SETE_TG_KEI_NO | Constant | Key "sete_tg_kei_no" — set target contract number, used for rejected-contract reservation |
| UPD_DTM_BF | Constant | Key "upd_dtm_bf" — update datetime before, used for rejected-contract reservation |
| CC_WORK_AREA_NAME | Constant | Value "JFUAddSvcKeiTvCCWork" — the CC's private work area key in the mapping work map |
| CC_WORK_AREA_NAME_KEISHA | Constant | Value "JFUAddKeishaServiceCCWork" — contractor/add-lessee service work area key |
| CC_WORK_AREA_NAME_MSKM | Constant | Value "JFUAddMskmSCWork" — application details SC work area key |
| CC_WRI_SVC_AUTO_APLY_MAP | Constant | Value "JKKWrisvcAutoAplyCCMap" — discount service auto-application CC map key |
| SVC_KEI_GRP_LIST | Constant | Value "svc_kei_grp_list" — service contract group list key within the auto-application map |
| SVC_KEI_LIST | Constant | Value "svc_kei_list" — service contract list key within a service contract group map |
| FUSV015229CC | Constant | Value "FUSV015229CC" — star channel settlement calculation CC map key |
| EKK2931D010 | Constant | Value "EKK2931D010" — contract reservation registration at application time CC map key |
| EKK0101D010CBSMsg | Class | CBS message class for the EKK0101D010 screen — holds all field constant definitions for Service Contract <TV> Registration |
| TEMPLATE_LIST_KEY | Constant | Key to retrieve the array of CAANMsg templates from the msgList map |
| RET_CD_INT_KEY | Constant | Key to retrieve the return code integer from the msgList map |
| ERROR_INFO | Constant | Key in SCControlMapKeys for storing error information in the control map |
| CAANMsg | Class | The CBS message template class — provides `getString()` and `isNull()` methods for field access |
| IRequestParameterReadWrite | Interface | Request parameter interface — provides `getData()`, `setData()`, `getMappingWorkArea()`, `setMappingWorkArea()`, `getControlMapData()`, `setControlMapData()` |
| TemplateErrorUtil | Class | Utility class for consolidating error information from msgList and error lists |
| Star Channel Settlement | Business process | Star channel settlement calculation — a billing/charge calculation mechanism for service contracts |
| Discount Service Auto-Application | Business process | Automatic application of discount services to service contracts based on business rules |
| Contract Reservation Registration at Application Time | Business process | Registration mechanism for contracts that cannot be registered at application time — reserves them for later processing |
| EO TV | Business term | EO (Easy On Demand) TV — a video-on-demand service offered by K-Opticom |
| SC (Service Component) | Pattern | A service component class that encapsulates business logic — referenced by patterns like `EKK0101D010CBS` |
| CBS (Common Business Service) | Architecture | Common Business Service layer — the middleware tier that handles business logic and data access |
