# Business Logic — JBSbatKKNrkeFinKikiHktgi.executeKK_T_ODR_INF_SKSI_WK_PKINSERT() [52 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKNrkeFinKikiHktgi` |
| Layer | Batch (Package: `eo.business.service`, file in `koptBatch`) |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKNrkeFinKikiHktgi.executeKK_T_ODR_INF_SKSI_WK_PKINSERT()

This method performs the core data persistence operation for the **Order Information Creation Work** table (`KK_T_ODR_INF_SKSI_WK`) within a batch processing workflow. Specifically, it inserts a complete row of order information into the database using a primary-key-based insert (`insertByPrimaryKeys`). The surrounding class, `JBSbatKKNrkeFinKikiHktgi`, is a batch service responsible for executing device succession processing after a "Simpler Plane" (a K-Opticom telecom service tier) conversion completes — i.e., transferring equipment records from legacy services to newly converted fiber-to-the-home (FTTH) simpler plane services.

The method acts as a **delegation layer** between the batch orchestration logic (`executeKK_T_ODR_INF_SKSI_WK_INSERT`) and the persistence layer (`db_KK_T_ODR_INF_SKSI_WK`). It does not contain any conditional branching or business-rule evaluation; instead, it purely maps 44 incoming parameters into a structured map object and delegates the actual database insert to the `JBSbatSQLAccess` layer. As a `private` method, it is called exclusively by the batch entry method `executeKK_T_ODR_INF_SKSI_WK_INSERT` (via `executeKK_T_ODR_INF_SKSI_WK` or similar batch dispatch) and is not exposed as a shared utility or screen entry point.

The method supports a broad range of telecom service types by capturing all fields associated with a single order creation work record — including primary identifiers, service contract chains (main service, device-provided service, option services, sub-option services, invoiced option services, additional information contracts), their revision history, audit trail metadata (add/update/delete timestamps, operator accounts, processing IDs), phone number, and the processing flag.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeKK_T_ODR_INF_SKSI_WK_PKINSERT(params)"])
    STEP1["Create setMap as JBSbatCommonDBInterface"]
    STEP2["Map 44 parameters from setParam to setMap via setValue"]
    STEP3["Insert record into KK_T_ODR_INF_SKSI_WK"]
    END_NODE(["Return (void)"])

    START --> STEP1
    STEP1 --> STEP2
    STEP2 --> STEP3
    STEP3 --> END_NODE
```

The method follows a **linear two-phase pattern**:

1. **Parameter Mapping Phase:** A new `JBSbatCommonDBInterface` object is instantiated as a key-value map. All 44 elements from the input `Object[]` array (`setParam[0]` through `setParam[43]`) are mapped to named fields using `setValue(String key, Object value)` calls. The mapping is positional — index 0 maps to `ODR_INF_SKSI_WK_NO`, index 1 to `ODR_HAKKO_JOKEN_NO`, and so on.

2. **Persistence Phase:** The fully populated map is passed to `db_KK_T_ODR_INF_SKSI_WK.insertByPrimaryKeys(setMap)`, which performs a single-row insert into the `KK_T_ODR_INF_SKSI_WK` database table using the mapped values as primary key and data columns.

There are no conditional branches, loops, or error handling within the method body — all validation and error handling are delegated to the called persistence methods.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `setParam` | `Object[]` | An array of exactly 44 elements containing all fields for a single Order Information Creation Work record. Each element is a `(field_name, value)` pair passed positionally. |

### Instance Fields Read

| Field | Type | Business Description |
|-------|------|---------------------|
| `db_KK_T_ODR_INF_SKSI_WK` | `JBSbatSQLAccess` | Database access object for the `KK_T_ODR_INF_SKSI_WK` (Order Information Creation Work) table. Used to execute the primary-key insert operation. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JBSbatCommonDBInterface.setValue` | - | In-memory map | Calls `setValue` on the key-value map to populate field names with values from `setParam`. Done 44 times. |
| C | `JBSbatSQLAccess.insertByPrimaryKeys` | - | `KK_T_ODR_INF_SKSI_WK` | Performs a primary-key-based insert of the fully mapped record into the Order Information Creation Work table. |

**Classification Notes:**
- `setValue` calls on `JBSbatCommonDBInterface` are internal data-structuring operations (no DB touch) that populate the in-memory key-value map before the database call.
- `insertByPrimaryKeys` is the sole database operation and performs a **Create (C)** operation on the `KK_T_ODR_INF_SKSI_WK` table. The method name `PKINSERT` in the method signature itself confirms this is a primary-key insert.

## 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: `insertByPrimaryKeys` [C], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-], `setValue` [-]  # NOSONAR

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JBSbatKKNrkeFinKikiHktgi.executeKK_T_ODR_INF_SKSI_WK_INSERT` (assumed) | `executeKK_T_ODR_INF_SKSI_WK` -> `executeKK_T_ODR_INF_SKSI_WK_PKINSERT` | `insertByPrimaryKeys [C] KK_T_ODR_INF_SKSI_WK` |

**Caller Context:** The only documented direct caller is the `execute()` method of the same class `JBSbatKKNrkeFinKikiHktgi`. As a `private` method within a batch service, this is invoked as part of the batch's main processing loop that creates order information work records after device succession processing completes.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `(create JBSbatCommonDBInterface)` (L2519)

> Instantiates the key-value map object that will hold all 44 fields before the database insert.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setMap = new JBSbatCommonDBInterface()` // Create mapping object [-> JBSbatCommonDBInterface is a key-value store] |

**Block 2** — [EXEC] `(map 44 parameters from setParam into setMap)` (L2520–L2563)

> Populates the key-value map with all fields from the input array. Each `setValue` call maps a named field to the corresponding element in `setParam`.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `setMap.setValue("ODR_INF_SKSI_WK_NO", setParam[0])` // Order Creation Work Number |
| 2 | EXEC | `setMap.setValue("ODR_HAKKO_JOKEN_NO", setParam[1])` // Order Issuance Condition Number |
| 3 | EXEC | `setMap.setValue("ODR_NAIYO_CD", setParam[2])` // Order Content Code |
| 4 | EXEC | `setMap.setValue("SVC_KEI_NO", setParam[3])` // Service Contract Number |
| 5 | EXEC | `setMap.setValue("SVKEI_GADTM", setParam[4])` // Service Contract Version Registered Timestamp |
| 6 | EXEC | `setMap.setValue("SVC_KEI_UCWK_NO", setParam[5])` // Service Contract Line Item Number |
| 7 | EXEC | `setMap.setValue("SVKEIUW_GADTM", setParam[6])` // Service Contract Line Item Version Registered Timestamp |
| 8 | EXEC | `setMap.setValue("KKTK_SVC_KEI_NO", setParam[7])` // Device-Provided Service Contract Number |
| 9 | EXEC | `setMap.setValue("KKTSVKEI_GADTM", setParam[8])` // Device-Provided Service Contract Version Registered Timestamp |
| 10 | EXEC | `setMap.setValue("OP_SVC_KEI_NO", setParam[9])` // Option Service Contract Number |
| 11 | EXEC | `setMap.setValue("OPSVKEI_GADTM", setParam[10])` // Option Service Contract Version Registered Timestamp |
| 12 | EXEC | `setMap.setValue("SBOP_SVC_KEI_NO", setParam[11])` // Sub-Option Service Contract Number |
| 13 | EXEC | `setMap.setValue("SBOPSVKEI_GADTM", setParam[12])` // Sub-Option Service Contract Version Registered Timestamp |
| 14 | EXEC | `setMap.setValue("SEIOPSVC_KEI_NO", setParam[13])` // Invoiced Option Service Contract Number |
| 15 | EXEC | `setMap.setValue("SEIOPSVKEI_GADTM", setParam[14])` // Invoiced Option Service Contract Version Registered Timestamp |
| 16 | EXEC | `setMap.setValue("HUKA_INF_KEI_NO", setParam[15])` // Additional Information Contract Number |
| 17 | EXEC | `setMap.setValue("HUKA_INF_KEI_GADTM", setParam[16])` // Additional Information Contract Version Registered Timestamp |
| 18 | EXEC | `setMap.setValue("CHBF_SVKEI_GADTM", setParam[17])` // Pre-Change Service Contract Version Timestamp |
| 19 | EXEC | `setMap.setValue("CHBF_SVKEIUW_GADTM", setParam[18])` // Pre-Change Service Contract Line Item Version Timestamp |
| 20 | EXEC | `setMap.setValue("CHBF_KKTSVKEI_GADTM", setParam[19])` // Pre-Change Device-Provided Service Contract Version Timestamp |
| 21 | EXEC | `setMap.setValue("CHBF_OPSVKEI_GADTM", setParam[20])` // Pre-Change Option Service Contract Version Timestamp |
| 22 | EXEC | `setMap.setValue("CHBF_SBOPSVKEI_GADTM", setParam[21])` // Pre-Change Sub-Option Service Contract Version Timestamp |
| 23 | EXEC | `setMap.setValue("CHBF_SEIOPSVKEI_GADTM", setParam[22])` // Pre-Change Invoiced Option Service Contract Version Timestamp |
| 24 | EXEC | `setMap.setValue("CHBF_HUKA_INF_KEI_GADTM", setParam[23])` // Pre-Change Additional Information Contract Version Timestamp |
| 25 | EXEC | `setMap.setValue("ADD_DTM", setParam[24])` // Registration Timestamp |
| 26 | EXEC | `setMap.setValue("ADD_OPEACNT", setParam[25])` // Registering Operator Account |
| 27 | EXEC | `setMap.setValue("UPD_DTM", setParam[26])` // Update Timestamp |
| 28 | EXEC | `setMap.setValue("UPD_OPEACNT", setParam[27])` // Updating Operator Account |
| 29 | EXEC | `setMap.setValue("DEL_DTM", setParam[28])` // Delete Timestamp |
| 30 | EXEC | `setMap.setValue("DEL_OPEACNT", setParam[29])` // Deleting Operator Account |
| 31 | EXEC | `setMap.setValue("MK_FLG", setParam[30])` // Inactive Flag |
| 32 | EXEC | `setMap.setValue("ADD_UNYO_YMD", setParam[31])` // Registration Business Date (YYYYMMDD) |
| 33 | EXEC | `setMap.setValue("ADD_TRN_ID", setParam[32])` // Registration Processing ID |
| 34 | EXEC | `setMap.setValue("UPD_UNYO_YMD", setParam[33])` // Update Business Date (YYYYMMDD) |
| 35 | EXEC | `setMap.setValue("UPD_TRN_ID", setParam[34])` // Update Processing ID |
| 36 | EXEC | `setMap.setValue("DEL_UNYO_YMD", setParam[35])` // Delete Business Date (YYYYMMDD) |
| 37 | EXEC | `setMap.setValue("DEL_TRN_ID", setParam[36])` // Delete Processing ID |
| 38 | EXEC | `setMap.setValue("KKOP_SVC_KEI_NO_1", setParam[37])` // Device Option Service Contract Number 1 |
| 39 | EXEC | `setMap.setValue("KKOSVKEI_GADTM_1", setParam[38])` // Device Option Service Contract Version Timestamp 1 |
| 40 | EXEC | `setMap.setValue("CHBF_KKOSVKEI_GADTM_1", setParam[39])` // Pre-Change Device Option Contract Version Timestamp 1 |
| 41 | EXEC | `setMap.setValue("KKOP_SVC_KEI_NO_2", setParam[40])` // Device Option Service Contract Number 2 |
| 42 | EXEC | `setMap.setValue("KKOSVKEI_GADTM_2", setParam[41])` // Device Option Service Contract Version Timestamp 2 |
| 43 | EXEC | `setMap.setValue("CHBF_KKOSVKEI_GADTM_2", setParam[42])` // Pre-Change Device Option Contract Version Timestamp 2 |
| 44 | EXEC | `setMap.setValue("TELNO", setParam[43])` // Phone Number |

**Block 3** — [CALL] `(insert into KK_T_ODR_INF_SKSI_WK)` (L2566)

> Delegates the primary-key insert to the database access layer. This is the only database-touching call in this method.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `db_KK_T_ODR_INF_SKSI_WK.insertByPrimaryKeys(setMap)` // Insert complete record into KK_T_ODR_INF_SKSI_WK table |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `KK_T_ODR_INF_SKSI_WK` | DB Table | Order Information Creation Work — temporary/work table holding order information during creation before committing to permanent tables |
| `ODR_INF_SKSI_WK_NO` | Field | Order Creation Work Number — unique identifier for a work record in the order creation process |
| `ODR_HAKKO_JOKEN_NO` | Field | Order Issuance Condition Number — links the work record to specific order issuance conditions |
| `ODR_NAIYO_CD` | Field | Order Content Code — classifies the type/order category (e.g., FTTH registration, mail change, service addition) |
| `SVC_KEI_NO` | Field | Service Contract Number — primary identifier for a telecom service contract |
| `SVKEI_GADTM` | Field | Service Contract Version Registered Timestamp — when this version of the service contract was registered |
| `SVC_KEI_UCWK_NO` | Field | Service Contract Line Item Number — identifies a specific line item within a service contract |
| `SVKEIUW_GADTM` | Field | Service Contract Line Item Version Registered Timestamp — when this line item version was registered |
| `KKTK_SVC_KEI_NO` | Field | Device-Provided Service Contract Number — contract for services where the provider supplies equipment |
| `KKTSVKEI_GADTM` | Field | Device-Provided Service Contract Version Registered Timestamp |
| `OP_SVC_KEI_NO` | Field | Option Service Contract Number — contract for optional add-on services |
| `OPSVKEI_GADTM` | Field | Option Service Contract Version Registered Timestamp |
| `SBOP_SVC_KEI_NO` | Field | Sub-Option Service Contract Number — contract for sub-option (secondary tier) add-on services |
| `SBOPSVKEI_GADTM` | Field | Sub-Option Service Contract Version Registered Timestamp |
| `SEIOPSVC_KEI_NO` | Field | Invoiced Option Service Contract Number — option services that appear on the billing statement |
| `SEIOPSVKEI_GADTM` | Field | Invoiced Option Service Contract Version Registered Timestamp |
| `HUKA_INF_KEI_NO` | Field | Additional Information Contract Number — contract for supplementary/ancillary information services |
| `HUKA_INF_KEI_GADTM` | Field | Additional Information Contract Version Registered Timestamp |
| `CHBF_*` fields | Field | Pre-Change versions of timestamp fields — captured before a service change for audit/rollback purposes. "CHBF" = "Change Before" |
| `ADD_DTM` | Field | Registration Timestamp — when the record was first created |
| `ADD_OPEACNT` | Field | Registering Operator Account — the operator who created the record |
| `UPD_DTM` | Field | Update Timestamp — when the record was last modified |
| `UPD_OPEACNT` | Field | Updating Operator Account — the operator who last modified the record |
| `DEL_DTM` | Field | Delete Timestamp — when the record was logically deleted |
| `DEL_OPEACNT` | Field | Deleting Operator Account — the operator who deleted the record |
| `MK_FLG` | Field | Inactive Flag — marks whether the record is active (0) or inactive (1/removed from service) |
| `ADD_UNYO_YMD` | Field | Registration Business Date — YYYYMMDD date of record creation |
| `ADD_TRN_ID` | Field | Registration Processing ID — system processing ID for the registration transaction |
| `UPD_UNYO_YMD` | Field | Update Business Date — YYYYMMDD date of last update |
| `UPD_TRN_ID` | Field | Update Processing ID — system processing ID for the update transaction |
| `DEL_UNYO_YMD` | Field | Delete Business Date — YYYYMMDD date of deletion |
| `DEL_TRN_ID` | Field | Delete Processing ID — system processing ID for the delete transaction |
| `KKOP_SVC_KEI_NO_1` | Field | Device Option Service Contract Number 1 — first device option add-on contract |
| `KKOP_SVC_KEI_NO_2` | Field | Device Option Service Contract Number 2 — second device option add-on contract |
| `TELNO` | Field | Phone Number — customer's telephone number associated with the order |
| PKINSERT | Acronym | Primary Key INSERT — insert operation using the full primary key as the unique identifier |
| KK | Acronym | K-Opticom — the telecom service brand (K-Opticom) |
| ODR | Acronym | Order — refers to order-related data (ODR = Order) |
| SVC | Acronym | Service — refers to telecom service contracts |
| KEI | Acronym | Contract (Keiyaku, 契約) — from Japanese "contract" |
| GADTM | Acronym | Registered Date Time (Millisecond) — full precision timestamp including date and time |
| WK | Acronym | Work — temporary/work data during processing (not yet committed to permanent tables) |
| HAKKO | Acronym | Issuance (Hakkou, 発行) — from Japanese "issuance/release" |
| NAIYO | Acronym | Content (Naiyou, 内容) — from Japanese "content/type" |
| HUKA | Acronym | Additional/Supplementary Information (Fuka, 追加) — from Japanese "additional" |
| CHBF | Acronym | Change Before — pre-change snapshot of a field for audit trail purposes |
| UNYO | Acronym | Business Operation (Unyou, 運用) — from Japanese "business operations" |
| JBSbatCommonDBInterface | Class | Framework key-value interface used to construct parameter maps before database operations |
| insertByPrimaryKeys | Method | Database insert method that uses primary key fields to uniquely identify and create a record |
| Simplier Plane | Business term | K-Opticom's simplified fiber-optic internet service plan |
| Device Succession | Business term | The process of transferring equipment/service records from a legacy plan to a new plan after conversion |
