# Business Logic — JBSbatKKNrkeFinKikiHktgi.executeKK_T_ODR_HAKKO_JOKEN_PKINSERT() [40 LOC]

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

## 1. Role

### JBSbatKKNrkeFinKikiHktgi.executeKK_T_ODR_HAKKO_JOKEN_PKINSERT()

This method performs a **full-record insert** (primary key-based registration) into the **Order Issuance Conditions** table (`KK_T_ODR_HAKKO_JOKEN`) as part of a batch processing workflow. In Japanese business domain terms, `ODR_HAKKO_JOKEN` (オーダ発行条件) refers to the configuration parameters that govern how service orders are issued — essentially the metadata that defines the rules and context for generating service orders in the telecom fulfillment system.

The method implements a **data-mapping-and-insert** pattern: it receives a flat `Object[]` array containing 32 field values, maps each value to a named key on a `JBSbatCommonDBInterface` (a common batch DTO/map wrapper), and passes the complete set to `insertByPrimaryKeys` for a single-row INSERT into the database. There are no conditional branches, no lookups, no updates — this is a pure, straight-through write path.

Its **role in the larger system** is that of an insertion endpoint invoked by the batch controller method `execute()` on the same class. It is the mechanism by which a fully constructed Order Issuance Conditions record — carrying service contract identifiers, order type codes, device model information, timestamps, operator account data, and audit lifecycle flags — is persisted to the database during batch processing.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeKK_T_ODR_HAKKO_JOKEN_PKINSERT setParam"])
    CREATE_MAP["Create JBSbatCommonDBInterface setMap"]

    SET0["SET setMap setValue ODR_HAKKO_JOKEN_NO = setParam[0]"]
    SET1["SET setMap setValue SVC_KEI_NO = setParam[1]"]
    SET2["SET setMap setValue SVC_KEI_UCWK_NO = setParam[2]"]
    SET3["SET setMap setValue KKTK_SVC_KEI_NO = setParam[3]"]
    SET4["SET setMap setValue OP_SVC_KEI_NO = setParam[4]"]
    SET5["SET setMap setValue SBOP_SVC_KEI_NO = setParam[5]"]
    SET6["SET setMap setValue SEIOPSVC_KEI_NO = setParam[6]"]
    SET7["SET setMap setValue ORDER_SBT_CD = setParam[7]"]
    SET8["SET setMap setValue SVC_ORDER_CD = setParam[8]"]
    SET9["SET setMap setValue YOKYU_SBT_CD = setParam[9]"]
    SET10["SET setMap setValue ODR_HAKKO_JOKEN_CD = setParam[10]"]
    SET11["SET setMap setValue KEI_SVC_CTL_YOKYU_ODR_SKCD = setParam[11]"]
    SET12["SET setMap setValue SAME_TRN_NO = setParam[12]"]
    SET13["SET setMap setValue TAKNKIKI_MODEL_CD = setParam[13]"]
    SET14["SET setMap setValue KIKI_SEIZO_NO = setParam[14]"]
    SET15["SET setMap setValue MLAD = setParam[15]"]
    SET16["SET setMap setValue SPOT_LOGIN_SYSID = setParam[16]"]
    SET17["SET setMap setValue SVC_KEI_KAISEN_UCWK_NO = setParam[17]"]
    SET18["SET setMap setValue SEND_REQ_FIN_DTM = setParam[18]"]
    SET19["SET setMap setValue ADD_DTM = setParam[19]"]
    SET20["SET setMap setValue ADD_OPEACNT = setParam[20]"]
    SET21["SET setMap setValue UPD_DTM = setParam[21]"]
    SET22["SET setMap setValue UPD_OPEACNT = setParam[22]"]
    SET23["SET setMap setValue DEL_DTM = setParam[23]"]
    SET24["SET setMap setValue DEL_OPEACNT = setParam[24]"]
    SET25["SET setMap setValue MK_FLG = setParam[25]"]
    SET26["SET setMap setValue ADD_UNYO_YMD = setParam[26]"]
    SET27["SET setMap setValue ADD_TRN_ID = setParam[27]"]
    SET28["SET setMap setValue UPD_UNYO_YMD = setParam[28]"]
    SET29["SET setMap setValue UPD_TRN_ID = setParam[29]"]
    SET30["SET setMap setValue DEL_UNYO_YMD = setParam[30]"]
    SET31["SET setMap setValue DEL_TRN_ID = setParam[31]"]

    DB_INSERT["CALL db_KK_T_ODR_HAKKO_JOKEN insertByPrimaryKeys setMap"]
    END_NODE(["Return void"])

    START --> CREATE_MAP
    CREATE_MAP --> SET0
    SET0 --> SET1
    SET1 --> SET2
    SET2 --> SET3
    SET3 --> SET4
    SET4 --> SET5
    SET5 --> SET6
    SET6 --> SET7
    SET7 --> SET8
    SET8 --> SET9
    SET9 --> SET10
    SET10 --> SET11
    SET11 --> SET12
    SET12 --> SET13
    SET13 --> SET14
    SET14 --> SET15
    SET15 --> SET16
    SET16 --> SET17
    SET17 --> SET18
    SET18 --> SET19
    SET19 --> SET20
    SET20 --> SET21
    SET21 --> SET22
    SET22 --> SET23
    SET23 --> SET24
    SET24 --> SET25
    SET25 --> SET26
    SET26 --> SET27
    SET27 --> SET28
    SET28 --> SET29
    SET29 --> SET30
    SET30 --> SET31
    SET31 --> DB_INSERT
    DB_INSERT --> END_NODE
```

This method contains a **single linear processing path** with no conditional branches:

1. **Map Creation**: Instantiate a `JBSbatCommonDBInterface` object (`setMap`) to serve as a key-value container for all 32 fields.
2. **Value Mapping**: Sequentially call `setValue()` 32 times, binding each element from the `setParam` array to its corresponding field name (e.g., `setParam[0]` maps to `ODR_HAKKO_JOKEN_NO`, `setParam[1]` maps to `SVC_KEI_NO`, etc.).
3. **Database Insert**: Delegate to `db_KK_T_ODR_HAKKO_JOKEN.insertByPrimaryKeys(setMap)`, which executes an INSERT statement using the primary key columns of the `KK_T_ODR_HAKKO_JOKEN` table.
4. **Return**: Method returns `void` — no value is returned to the caller.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `setParam` | `Object[]` | A flat array of 32 elements carrying the complete row data for an Order Issuance Conditions record. Each index maps to a specific database column (see detailed field list below). The caller must populate this array in the exact order defined by the field mapping. |

### Instance fields read by this method

| Field | Type | Business Description |
|-------|------|---------------------|
| `db_KK_T_ODR_HAKKO_JOKEN` | `JBSbatSQLAccess` | Database access delegate wired to the `KK_T_ODR_HAKKO_JOKEN` table. Provides `insertByPrimaryKeys` for row insertion. |

### Detailed index-to-field mapping (from `setParam[0]` through `setParam[31]`)

| Index | Field Key | Business Description |
|-------|-----------|---------------------|
| 0 | `ODR_HAKKO_JOKEN_NO` | Order Issuance Conditions Number — the primary sequence/key for this record |
| 1 | `SVC_KEI_NO` | Service Contract Number |
| 2 | `SVC_KEI_UCWK_NO` | Service Contract Detail/Line-item Work Number |
| 3 | `KKTK_SVC_KEI_NO` | Equipment Provision Service Contract Number |
| 4 | `OP_SVC_KEI_NO` | Option Service Contract Number |
| 5 | `SBOP_SVC_KEI_NO` | Sub-option Service Contract Number |
| 6 | `SEIOPSVC_KEI_NO` | Billing Option Service Contract Number |
| 7 | `ORDER_SBT_CD` | Order Type Code |
| 8 | `SVC_ORDER_CD` | Service Order Code |
| 9 | `YOKYU_SBT_CD` | Request Type Code |
| 10 | `ODR_HAKKO_JOKEN_CD` | Order Issuance Condition Code |
| 11 | `KEI_SVC_CTL_YOKYU_ODR_SKCD` | Contract Service Control Request Order Identification Code |
| 12 | `SAME_TRN_NO` | Same Processing Number (batch grouping identifier) |
| 13 | `TAKNKIKI_MODEL_CD` | Indoor Equipment Model Code |
| 14 | `KIKI_SEIZO_NO` | Equipment Serial Number (Manufacturing Number) |
| 15 | `MLAD` | Email Address |
| 16 | `SPOT_LOGIN_SYSID` | Spot Login SYSID |
| 17 | `SVC_KEI_KAISEN_UCWK_NO` | Service Contract Line Breakdown/Detail Number |
| 18 | `SEND_REQ_FIN_DTM` | Request Transmission Completion Date-Time |
| 19 | `ADD_DTM` | Registration Date-Time (creation timestamp) |
| 20 | `ADD_OPEACNT` | Registering Operator Account |
| 21 | `UPD_DTM` | Last Update Date-Time |
| 22 | `UPD_OPEACNT` | Last Updating Operator Account |
| 23 | `DEL_DTM` | Deletion Date-Time |
| 24 | `DEL_OPEACNT` | Deleting Operator Account |
| 25 | `MK_FLG` | Inactive Flag (soft-delete/lifecycle indicator) |
| 26 | `ADD_UNYO_YMD` | Registration Operation Date (business date of registration) |
| 27 | `ADD_TRN_ID` | Registration Transaction ID |
| 28 | `UPD_UNYO_YMD` | Update Operation Date |
| 29 | `UPD_TRN_ID` | Update Transaction ID |
| 30 | `DEL_UNYO_YMD` | Deletion Operation Date |
| 31 | `DEL_TRN_ID` | Deletion Transaction ID |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| C | `insertByPrimaryKeys` (JBSbatSQLAccess) | - | `KK_T_ODR_HAKKO_JOKEN` | Inserts a single row into the Order Issuance Conditions table using the provided primary key values. |
| - | `setValue` (JBSbatCommonDBInterface) | - | - | Sets key-value pairs on the batch DTO/map for all 32 fields of the Order Issuance Conditions record. |

### CRUD Classification Rationale

- **`insertByPrimaryKeys`** — Classified as **Create (C)**. The method name and usage pattern (passing a DTO/map of field values to be inserted) are standard for batch INSERT operations in this codebase. The target table `KK_T_ODR_HAKKO_JOKEN` is an order conditions table where records are created to define how service orders should be issued.
- **`setValue`** — Classified as **-** (data manipulation on in-memory DTO). This is a parameter-binding call, not a database operation. It populates the `JBSbatCommonDBInterface` container with field-value pairs before passing it to the insert method.

## 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` [-] (×32)

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JBSbatKKNrkeFinKikiHktgi.execute()` | `JBSbatKKNrkeFinKikiHktgi.execute()` → `executeKK_T_ODR_HAKKO_JOKEN_PKINSERT(setParam)` | `insertByPrimaryKeys [C] KK_T_ODR_HAKKO_JOKEN` |

**Notes:**
- The direct caller is the `execute()` method on the same batch service class (`JBSbatKKNrkeFinKikiHktgi`). This is a standard batch entry point pattern where a central `execute()` method dispatches to specialized helper methods for individual table operations.
- The terminal operation chains through to a database INSERT on the `KK_T_ODR_HAKKO_JOKEN` table via `JBSbatSQLAccess.insertByPrimaryKeys`.

## 6. Per-Branch Detail Blocks

### Block 1 — [SET] (L2415)

> Map creation — instantiate the container for field-value pairs.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setMap = new JBSbatCommonDBInterface()` // Create key-value DTO for Order Issuance Conditions fields |

### Block 2 — [EXEC] (L2416–L2447)

> Sequential value mapping — bind each element of the `setParam` array to a named field on the DTO.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `setMap.setValue("ODR_HAKKO_JOKEN_NO", setParam[0])` // Order Issuance Conditions Number [-> Field 0] |
| 2 | EXEC | `setMap.setValue("SVC_KEI_NO", setParam[1])` // Service Contract Number [-> Field 1] |
| 3 | EXEC | `setMap.setValue("SVC_KEI_UCWK_NO", setParam[2])` // Service Contract Line-item Work Number [-> Field 2] |
| 4 | EXEC | `setMap.setValue("KKTK_SVC_KEI_NO", setParam[3])` // Equipment Provision Service Contract Number [-> Field 3] |
| 5 | EXEC | `setMap.setValue("OP_SVC_KEI_NO", setParam[4])` // Option Service Contract Number [-> Field 4] |
| 6 | EXEC | `setMap.setValue("SBOP_SVC_KEI_NO", setParam[5])` // Sub-option Service Contract Number [-> Field 5] |
| 7 | EXEC | `setMap.setValue("SEIOPSVC_KEI_NO", setParam[6])` // Billing Option Service Contract Number [-> Field 6] |
| 8 | EXEC | `setMap.setValue("ORDER_SBT_CD", setParam[7])` // Order Type Code [-> Field 7] |
| 9 | EXEC | `setMap.setValue("SVC_ORDER_CD", setParam[8])` // Service Order Code [-> Field 8] |
| 10 | EXEC | `setMap.setValue("YOKYU_SBT_CD", setParam[9])` // Request Type Code [-> Field 9] |
| 11 | EXEC | `setMap.setValue("ODR_HAKKO_JOKEN_CD", setParam[10])` // Order Issuance Condition Code [-> Field 10] |
| 12 | EXEC | `setMap.setValue("KEI_SVC_CTL_YOKYU_ODR_SKCD", setParam[11])` // Contract Service Control Request Order ID Code [-> Field 11] |
| 13 | EXEC | `setMap.setValue("SAME_TRN_NO", setParam[12])` // Same Processing Number (batch group ID) [-> Field 12] |
| 14 | EXEC | `setMap.setValue("TAKNKIKI_MODEL_CD", setParam[13])` // Indoor Equipment Model Code [-> Field 13] |
| 15 | EXEC | `setMap.setValue("KIKI_SEIZO_NO", setParam[14])` // Equipment Serial Number [-> Field 14] |
| 16 | EXEC | `setMap.setValue("MLAD", setParam[15])` // Email Address [-> Field 15] |
| 17 | EXEC | `setMap.setValue("SPOT_LOGIN_SYSID", setParam[16])` // Spot Login SYSID [-> Field 16] |
| 18 | EXEC | `setMap.setValue("SVC_KEI_KAISEN_UCWK_NO", setParam[17])` // Service Contract Line Breakdown Number [-> Field 17] |
| 19 | EXEC | `setMap.setValue("SEND_REQ_FIN_DTM", setParam[18])` // Request Transmission Completion Date-Time [-> Field 18] |
| 20 | EXEC | `setMap.setValue("ADD_DTM", setParam[19])` // Registration Date-Time [-> Field 19] |
| 21 | EXEC | `setMap.setValue("ADD_OPEACNT", setParam[20])` // Registering Operator Account [-> Field 20] |
| 22 | EXEC | `setMap.setValue("UPD_DTM", setParam[21])` // Last Update Date-Time [-> Field 21] |
| 23 | EXEC | `setMap.setValue("UPD_OPEACNT", setParam[22])` // Last Updating Operator Account [-> Field 22] |
| 24 | EXEC | `setMap.setValue("DEL_DTM", setParam[23])` // Deletion Date-Time [-> Field 23] |
| 25 | EXEC | `setMap.setValue("DEL_OPEACNT", setParam[24])` // Deleting Operator Account [-> Field 24] |
| 26 | EXEC | `setMap.setValue("MK_FLG", setParam[25])` // Inactive Flag (soft-delete indicator) [-> Field 25] |
| 27 | EXEC | `setMap.setValue("ADD_UNYO_YMD", setParam[26])` // Registration Business Date [-> Field 26] |
| 28 | EXEC | `setMap.setValue("ADD_TRN_ID", setParam[27])` // Registration Transaction ID [-> Field 27] |
| 29 | EXEC | `setMap.setValue("UPD_UNYO_YMD", setParam[28])` // Update Business Date [-> Field 28] |
| 30 | EXEC | `setMap.setValue("UPD_TRN_ID", setParam[29])` // Update Transaction ID [-> Field 29] |
| 31 | EXEC | `setMap.setValue("DEL_UNYO_YMD", setParam[30])` // Deletion Business Date [-> Field 30] |
| 32 | EXEC | `setMap.setValue("DEL_TRN_ID", setParam[31])` // Deletion Transaction ID [-> Field 31] |

### Block 3 — [CALL] (L2452)

> Database insert — persist the complete record to `KK_T_ODR_HAKKO_JOKEN`.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `db_KK_T_ODR_HAKKO_JOKEN.insertByPrimaryKeys(setMap)` // Insert the Order Issuance Conditions record via primary key [-> Create on KK_T_ODR_HAKKO_JOKEN] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `ODR_HAKKO_JOKEN_NO` | Field | Order Issuance Conditions Number — the primary key/sequence for the order condition record |
| `ODR_HAKKO_JOKEN` | Field (Japanese: オーダ発行条件) | Order Issuance Conditions — configuration parameters that define how and when service orders are generated |
| `SVC_KEI_NO` | Field (Japanese: サービス契約番号) | Service Contract Number — identifier for the service contract |
| `SVC_KEI_UCWK_NO` | Field (Japanese: サービス契約内訳番号) | Service Contract Line-item/Distribution Number — sub-identifier within a contract for line-item tracking |
| `KKTK_SVC_KEI_NO` | Field (Japanese: 機器提供サービス契約番号) | Equipment Provision Service Contract Number — contract covering equipment provided to the customer |
| `OP_SVC_KEI_NO` | Field (Japanese: オプションサービス契約番号) | Option Service Contract Number — contract for optional/add-on services |
| `SBOP_SVC_KEI_NO` | Field (Japanese: サブオプションサービス契約番号) | Sub-option Service Contract Number — sub-level option service contract |
| `SEIOPSVC_KEI_NO` | Field (Japanese: 請求オプションサービス契約番号) | Billing Option Service Contract Number — option services that appear on the billing statement |
| `ORDER_SBT_CD` | Field (Japanese: オーダ種別コード) | Order Type Code — classifies the type of order (e.g., new, change, cancellation) |
| `SVC_ORDER_CD` | Field (Japanese: サービスオーダコード) | Service Order Code — code identifying the specific service order |
| `YOKYU_SBT_CD` | Field (Japanese: 要求種別コード) | Request Type Code — classifies the type of service request |
| `ODR_HAKKO_JOKEN_CD` | Field (Japanese: オーダ発行条件コード) | Order Issuance Condition Code — specific code defining the issuance rule/condition |
| `KEI_SVC_CTL_YOKYU_ODR_SKCD` | Field (Japanese: 契約サービス制御要求オーダ識別コード) | Contract Service Control Request Order Identification Code — identifies the order within service control requests |
| `SAME_TRN_NO` | Field (Japanese: 同一処理番号) | Same Processing Number — a batch grouping identifier linking related transactions |
| `TAKNKIKI_MODEL_CD` | Field (Japanese: 宅内機器型式コード) | Indoor Equipment Model Code — model classification for customer-premises equipment |
| `KIKI_SEIZO_NO` | Field (Japanese: 機器製造番号) | Equipment Serial/Manufacturing Number — unique hardware serial number |
| `MLAD` | Field (Japanese: メールアドレス) | Email Address — customer contact email |
| `SPOT_LOGIN_SYSID` | Field (Japanese: スポットログインSYSID) | Spot Login SYSID — identifier for spot/one-time login sessions |
| `SVC_KEI_KAISEN_UCWK_NO` | Field (Japanese: サービス契約回線内訳番号) | Service Contract Line Breakdown/Detail Number — detailed line-item identifier within a contract |
| `SEND_REQ_FIN_DTM` | Field (Japanese: 送信依頼完了年月日時分秒) | Request Transmission Completion Date-Time — when the transmission request was completed |
| `ADD_DTM` | Field (Japanese: 登録年月日時分秒) | Registration Date-Time — timestamp when the record was created |
| `ADD_OPEACNT` | Field (Japanese: 登録オペレータアカウント) | Registering Operator Account — user ID of the operator who created the record |
| `UPD_DTM` | Field (Japanese: 更新年月日時分秒) | Update Date-Time — timestamp of the last modification |
| `UPD_OPEACNT` | Field (Japanese: 更新オペレータアカウント) | Updating Operator Account — user ID of the operator who last modified the record |
| `DEL_DTM` | Field (Japanese: 削除年月日時分秒) | Deletion Date-Time — timestamp when the record was deleted (soft-delete) |
| `DEL_OPEACNT` | Field (Japanese: 削除オペレータアカウント) | Deleting Operator Account — user ID of the operator who deleted the record |
| `MK_FLG` | Field (Japanese: 無効フラグ) | Inactive/Invalid Flag — lifecycle flag indicating whether the record is active or disabled |
| `ADD_UNYO_YMD` | Field (Japanese: 登録運用年月日) | Registration Operation Date — business date (YYYYMMDD) of record creation |
| `ADD_TRN_ID` | Field (Japanese: 登録処理ID) | Registration Transaction ID — system-generated identifier for the registration transaction |
| `UPD_UNYO_YMD` | Field (Japanese: 更新運用年月日) | Update Operation Date — business date of the last update |
| `UPD_TRN_ID` | Field (Japanese: 更新処理ID) | Update Transaction ID — system-generated identifier for the update transaction |
| `DEL_UNYO_YMD` | Field (Japanese: 削除運用年月日) | Deletion Operation Date — business date of deletion |
| `DEL_TRN_ID` | Field (Japanese: 削除処理ID) | Deletion Transaction ID — system-generated identifier for the deletion transaction |
| `KK_T_ODR_HAKKO_JOKEN` | Table (Japanese: オーダ発行条件) | Order Issuance Conditions table — stores the order issuance configuration records |
| `JBSbatSQLAccess` | Class | Batch SQL access delegate — wrapper for executing SQL operations against a specific database table |
| `JBSbatCommonDBInterface` | Class | Common batch database interface — key-value DTO for passing field data to batch CRUD methods |
| `insertByPrimaryKeys` | Method | Batch insert method — performs an INSERT using primary key columns as the identifier basis |
| `KK` | Acronym | Kakaku/Equipment (Equipment-related) — prefix for equipment and service contract domain tables |
| `ODR` | Acronym | Order (オーダ) — abbreviation for order-related fields |
| `HAKKO` | Acronym | Issuance (発行) — abbreviation for issuance/generation operations |
| `JOKEN` | Acronym | Conditions (条件) — abbreviation for condition/configuration fields |
| `SVC` | Acronym | Service (サービス) — abbreviation for service-related fields |
| `KEI` | Acronym | Contract (契約) — abbreviation for contract-related fields |
| `SVC_KEI_UCWK` | Acronym | Service Contract Line-item/Detail (サービス契約内訳) — sub-division within a service contract |
| `KKTK` | Acronym | Equipment Provision (機器提供) — prefix for equipment provision service fields |
| `OP` | Acronym | Option (オプション) — abbreviation for option service fields |
| `SBOP` | Acronym | Sub-option (サブオプション) — abbreviation for sub-option service fields |
| `SEIOPSVC` | Acronym | Billing Option Service (請求オプションサービス) — option services appearing on invoices |
| `SVC_KEI_KAISEN` | Acronym | Service Contract Line Breakdown (サービス契約回線内訳) — detailed line-level breakdown within a contract |
| `MK_FLG` | Acronym | Make/Mark Flag (無効フラグ) — in this context, an inactive flag for record lifecycle management |
| `UNYO` | Acronym | Operation/Utilization (運用) — business date indicator for operational events |