# Business Logic — JBSbatKKHnsokuCdIktTrkm.setMskmDtlParam() [84 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKHnsokuCdIktTrkm` |
| Layer | Service |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKHnsokuCdIktTrkm.setMskmDtlParam()

This method is a **data mapping and parameter assembly utility** for the subscription detail (`KK_T_MSKM_DTL`) table used in K-Opticom's customer core system. It transforms a flat `HashMap<String, String>` of input parameter values into a strongly-typed `Object[]` array that matches the column order of the subscription detail entity. The method does not contain any conditional logic or business rules — it is a pure transformer that follows the **builder pattern**, extracting values from the input map by field key and filling each position in the result array with the corresponding business data value. Many fields are populated with `null` placeholders, reserving space for future schema extensions or downstream components that may populate them during the actual INSERT operation. This design supports a **row-as-array** data access paradigm commonly used in enterprise batch processing within this codebase.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setMskmDtlParam(params)"])
    STEP1["Extract paramMap values for table columns"]
    STEP2["Add system timestamps via JCCBatCommon.getSysDateTimeStamp()"]
    STEP3["Add batch metadata: batchUserId, opeDate, S_MK_FLG=\"0\""]
    STEP4["Return Object[] with 65 elements"]
    END(["setParam returned"])

    START --> STEP1
    STEP1 --> STEP2
    STEP2 --> STEP3
    STEP3 --> STEP4
    STEP4 --> END
```

**Step-by-step processing:**

1. **Extract mapped values**: Pull values from `paramMap` using the constant keys defined in `JBSbatKK_T_MSKM_DTL` (e.g., `MSKM_DTL_NO`, `GENE_ADD_DTM`, `MSKM_NO`, `SYSID`, etc.). Each key maps to a column name in the `KK_T_MSKM_DTL` table.

2. **Insert null placeholders**: For fields not yet applicable in this registration context (e.g., subscription number, WEB receipt number, contact phone, service type codes, cancellation fields, delivery notification emails), `null` is inserted at the corresponding array position. These are reserved slots that may be populated by callers or subsequent operations.

3. **Add system-generated timestamps**: Call `JCCBatCommon.getSysDateTimeStamp()` twice — once for the registered timestamp (`REGIST_YMDHMS`) and once for the updated timestamp (`UPDATE_YMDHMS`).

4. **Add batch metadata**: Pull `super.batchUserId` for the registered operator account and processing ID, `super.opeDate` for the registered and updated operation dates, and `JKKBatConst.S_MK_FLG` (resolved value `"0"`) for the invalidity flag. Also add `null` for the delete timestamp, delete operator, and multifunction router swap request flag.

5. **Return the assembled array**: Return the fully constructed `Object[]` with 65 elements in the exact column order expected by `executeKK_T_MSKM_DTL_PKINSERT()`.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `paramMap` | `HashMap<String, String>` | Input message carrying subscription detail data — a flat key-value map where keys are field names from `JBSbatKK_T_MSKM_DTL` (e.g., `MSKM_DTL_NO`, `MSKM_NO`, `GENE_ADD_DTM`) and values are the actual data for the subscription detail being registered. |

**Instance fields read:**

| No | Field Name | Type | Business Description |
|----|-----------|------|---------------------|
| 1 | `super.batchUserId` | `String` | Batch processing user ID — the operator account performing the batch job, used as registered/updated operator account and processing ID. |
| 2 | `super.opeDate` | `String` | Operation date — the business date of the batch run, used as registered/updated operation date. |

**Constants referenced:**

| No | Constant | Resolved Value | Business Description |
|----|----------|---------------|---------------------|
| 1 | `JKKBatConst.S_MK_FLG` | `"0"` | Invalidity flag — `"0"` indicates the record is valid (not invalid/deleted). |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JCCBatCommon.getSysDateTimeStamp` | JCCBatCommon | - | Calls `getSysDateTimeStamp` in `JCCBatCommon` (system timestamp retrieval utility) |

### Method calls within `setMskmDtlParam`:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JCCBatCommon.getSysDateTimeStamp()` | JCCBatCommon | - | Retrieves the current system date-time stamp as a string (called twice: for registered timestamp and updated timestamp) |

**Note:** This method does **not** directly perform any database CRUD operations. It only assembles parameter data and delegates the actual INSERT to `executeKK_T_MSKM_DTL_PKINSERT()` (called by the caller `insertMskmDtl`). The only external method call is `JCCBatCommon.getSysDateTimeStamp()` for timestamp generation.

## 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: `getSysDateTimeStamp` [R], `getSysDateTimeStamp` [R]  # NOSONAR

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `insertMskmDtl` (Batch CBS) | `JBSbatKKHnsokuCdIktTrkm.insertMskmDtl` -> `JBSbatKKHnsokuCdIktTrkm.setMskmDtlParam` | `getSysDateTimeStamp` [R], `executeKK_T_MSKM_DTL_PKINSERT` [C] `KK_T_MSKM_DTL` |

**Call chain detail:** `insertMskmDtl` builds two separate `HashMap<String, String>` paramMaps (one for initial registration with status "booking complete" and one for detailed inspection/follow-up work request with status "inspection complete"), then calls `setMskmDtlParam(paramMap)` for each and passes the returned `Object[]` to `executeKK_T_MSKM_DTL_PKINSERT()` for actual database insertion into `KK_T_MSKM_DTL`.

## 6. Per-Branch Detail Blocks

**Block 1** — [ARRAY_CONSTRUCTION] `Object[] initialization` (L4161)

> The method constructs a 65-element `Object[]` array that maps directly to the columns of the `KK_T_MSKM_DTL` (Subscription Detail) table. Values are extracted from the input `paramMap` using constant keys from `JBSbatKK_T_MSKM_DTL`. Most fields are set to `null` as placeholders — the caller populates only a subset of fields, and the remaining slots are reserved for downstream processing or schema evolution.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap.get(JBSbatKK_T_MSKM_DTL.MSKM_DTL_NO)` // Subscription detail number [MSKM_DTL_NO] |
| 2 | SET | `paramMap.get(JBSbatKK_T_MSKM_DTL.GENE_ADD_DTM)` // Generation registered timestamp [GENE_ADD_DTM] |
| 3 | SET | `paramMap.get(JBSbatKK_T_MSKM_DTL.MSKM_DTL_STAT)` // Subscription detail status [MSKM_DTL_STAT] |
| 4 | SET | `paramMap.get(JBSbatKK_T_MSKM_DTL.MSKM_NO)` // Subscription number [MSKM_NO] |
| 5 | SET | `null` // Subscription form number [MSKMSHO_NO] |
| 6 | SET | `null` // Subscription form detail number [MSKMSHO_DTL_NO] |
| 7 | SET | `paramMap.get(JBSbatKK_T_MSKM_DTL.MSKM_YMD)` // Subscription year/month/day [MSKM_YMD] |
| 8 | SET | `paramMap.get(JBSbatKK_T_MSKM_DTL.SYSID)` // SYSID [SYSID] |
| 9 | SET | `null` // WEB receipt number [WEB_UK_NO] |
| 10 | SET | `null` // Subscription form code [MSKM_FORM_CD] |
| 11 | SET | `null` // Subscription detail type code [MSKM_DTL_SBT_CD] |
| 12 | SET | `null` // Contact phone number [RRKS_KTAI_TELNO] |
| 13 | SET | `null` // Contact duty name [RRKS_OFFC_NM] |
| 14 | SET | `null` // Daytime contact phone number [DT_RRKS_TELNO] |
| 15 | SET | `null` // New subscription type code [NEW_MSKM_SBT_CD] |
| 16 | SET | `null` // Subscription contract code [MSKM_OPTNTY_CD] |
| 17 | SET | `null` // Home survey request deadline [TAKCHO_KIBO_APO_KIGEN_YMD] |
| 18 | SET | `null` // Work appointment contact assignment code [KOJI_APO_RRKS_SHITEI_CD] |
| 19 | SET | `null` // Work appointment contact phone number [KOJI_APO_RRKS_TELNO] |
| 20 | SET | `paramMap.get(JBSbatKK_T_MSKM_DTL.RRK_JIKO_ADD_DTM)` // Contact item registered timestamp [RRK_JIKO_ADD_DTM] |
| 21 | SET | `paramMap.get(JBSbatKK_T_MSKM_DTL.MSKM_DTL_SHOSA_DTM)` // Subscription detail inspection timestamp [MSKM_DTL_SHOSA_DTM] |
| 22 | SET | `null` // Subscription detail inspection cancel date [MSKM_DTL_SHOSA_CL_YMD] |
| 23 | SET | `paramMap.get(JBSbatKK_T_MSKM_DTL.KZKWRK_REQYMD)` // Follow-up work request date [KZKWRK_REQYMD] |
| 24 | SET | `null` // Subscription detail cancel date [MSKM_DTL_CANCEL_YMD] |
| 25 | SET | `null` // Subscription detail cancel reason code [MSKM_DTL_CANCEL_RSN_CD] |
| 26 | SET | `null` // Subscription detail cancel reason memo [MSKM_DTL_CANCEL_RSN_MEMO] |
| 27 | SET | `null` // Subscription detail cancel processing date [MSKM_DTL_CANCEL_CL_YMD] |
| 28 | SET | `null` // Subscription contact email address [MSKM_RRKS_MLAD] |
| 29 | SET | `null` // Work progress notification email address [KOJI_PRG_TCHI_MLAD] |
| 30 | SET | `paramMap.get(JBSbatKK_T_MSKM_DTL.RRK_JIKO)` // Contact item [RRK_JIKO] |
| 31 | SET | `null` // Latest viewing date [RCNT_SHOKAI_YMD] |
| 32 | SET | `null` // WEB viewing count [WEB_SHOKAI_CNT] |
| 33 | SET | `null` // PC viewing count [PC_SHOKAI_CNT] |
| 34 | SET | `null` // Mobile viewing count [KTAI_SHOKAI_CNT] |
| 35 | SET | `null` // Work progress notification mobile email address [KJSC_TCH_KTAI_MLAD] |
| 36 | SET | `null` // Work progress notification PC email address change date [KJSC_TCH_PC_MLAD_CHG_YMD] |
| 37 | SET | `null` // Work progress notification mobile email address change date [KJSC_TCH_KTAI_MLAD_CHG_YMD] |
| 38 | SET | `null` // Progress email last send timestamp [PRG_ML_LAST_SEND_DTM] |
| 39 | SET | `null` // Email send exclusion flag [ML_SEND_JGI_FLG] |
| 40 | SET | `null` // Email send exclusion reason memo [ML_SEND_JGI_RSN_MEMO] |
| 41 | SET | `null` // Form subscription contact phone number [BMP_MSKM_RRKS_TLN] |
| 42 | SET | `paramMap.get(JBSbatKK_T_MSKM_DTL.OP_SVC_HKTGI_UM)` // Option service continuation [OP_SVC_HKTGI_UM] |
| 43 | SET | `null` // Contract document delivery request [DSL_ATICLE_SOHU_KIBO_UM] |
| 44 | SET | `null` // Contact method notation [RRK_WAY_HOKI] |
| 45 | SET | `null` // New building code [NEWCONST_BUKKEN_CD] |
| 46 | SET | `null` // Reactivation case flag [HUKKAT_ANKEN_FLG] |
| 47 | SET | `null` // Same equipment re-subscription code [SAME_EQUIP_RE_MSKM_CD] |
| 48 | SET | `null` // Identity confirmation document type code [HNIN_CFM_ATICLE_SBT_CD] |
| 49 | SET | `null` // Identity confirmation document name [HNIN_CFM_ATICLE_NM] |
| 50 | SET | `null` // Subscription form type code [MSKMSHO_SBT_CD] |
| 51 | SET | `null` // Contract add code [KEI_HUKA_CD] |
| 52 | SET | `null` // Map attachment [MAP_TEMP_UM] |
| 53 | SET | `null` // KCNSTB subscription form count [KCN_STB_MSKM_CNT] |
| 54 | SET | `null` // KCNSTB type code [KCN_STB_KIND_CD] |
| 55 | SET | `null` // Mansion device system link notes [MANSSBSYS_RNKI_YO_KIJIRAN] |
| 56 | SET | `null` // Mansion ID [MANSION_ID] |
| 57 | SET | `null` // CAT-ID [CAT_ID] |
| 58 | SET | `null` // Subscription receipt type code [MSKM_RYU_TYPE_CD] |
| 59 | SET | `null` // Subscription form handling information person name [MSKMSHO_TORIIKO_NINNM] |
| 60 | SET | `null` // Subscription form handling information phone number [MSKMSHO_TORIIKO_TELNO] |
| 61 | SET | `paramMap.get(JBSbatKK_T_MSKM_DTL.WRIB_AUTO_APLY_TG_GAI_FLG)` // Discount auto-application target exclusion flag [WRIB_AUTO_APLY_TG_GAI_FLG] |
| 62 | EXEC | `JCCBatCommon.getSysDateTimeStamp()` // Registered timestamp (1st call) |
| 63 | SET | `super.batchUserId` // Registered operator account |
| 64 | EXEC | `JCCBatCommon.getSysDateTimeStamp()` // Updated timestamp (2nd call) |
| 65 | SET | `super.batchUserId` // Updated operator account |

**Block 2** — [RETURN] (L4240)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return setParam;` // Return the fully assembled parameter array |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `MSKM_DTL_NO` | Field | Subscription detail number — unique sequence number identifying a subscription detail record in `KK_T_MSKM_DTL` |
| `MSKM_NO` | Field | Subscription number — the parent subscription ID that groups related detail records |
| `MSKM_DTL_STAT` | Field | Subscription detail status — the current lifecycle state of the subscription detail (e.g., "booking complete", "inspection complete") |
| `GENE_ADD_DTM` | Field | Generation registered date/time stamp — when this subscription detail record was originally created |
| `MSKM_YMD` | Field | Subscription year/month/day — the business date associated with the subscription |
| `SYSID` | Field | System ID — identifier of the originating system within the K-Opticom ecosystem |
| `RRK_JIKO_ADD_DTM` | Field | Contact item registered date/time stamp — when the contact item (related party information) was registered |
| `MSKM_DTL_SHOSA_DTM` | Field | Subscription detail inspection date/time stamp — when the subscription detail was inspected/verified |
| `KZKWRK_REQYMD` | Field | Follow-up work request date — date of any follow-up work requested on this subscription detail |
| `RRK_JIKO` | Field | Contact item — related party/contact information attached to the subscription detail |
| `OP_SVC_HKTGI_UM` | Field | Option service continuation flag — indicates whether existing option services are continued during this operation |
| `WRIB_AUTO_APLY_TG_GAI_FLG` | Field | Discount auto-application target exclusion flag — controls whether automatic discount application is excluded |
| `S_MK_FLG` | Field | Invalidity flag — `"0"` means valid/active; non-zero indicates invalid/deleted status |
| `KK_T_MSKM_DTL` | Table | Subscription detail master table — stores line-item-level data for customer subscriptions |
| `batchUserId` | Field | Batch processing user ID — the operator account performing the batch job |
| `opeDate` | Field | Operation date — the business date of the batch run |
| `setMskmDtlParam` | Method | Subscription detail schema registration parameter setter — assembles input data into a column-ordered array for the subscription detail table |
| `insertMskmDtl` | Method | Subscription detail insertion — calls `setMskmDtlParam` twice (initial registration and follow-up inspection) to insert two rows into `KK_T_MSKM_DTL` |
| `JCCBatCommon` | Class | Common batch utility class — provides shared timestamp and utility methods for batch processing |
| `JKKBatConst` | Class | Batch constant definitions — contains batch-level constants such as invalidity flag values |
| ExecuteKK_T_MSKM_DTL_PKINSERT | Method | Primary key insert into KK_T_MSKM_DTL — executes the actual database INSERT operation using the assembled parameter array |
| Booking complete | Status | `MSKM_DTL_STAT` value indicating the subscription detail has been booked/finalized |
| Inspection complete | Status | `MSKM_DTL_STAT` value indicating the subscription detail has been inspected and follow-up work requested |
| K-Opticom | Business term | Telecommunications service provider — the domain in which this customer core system operates |