# Business Logic — JBSbatKKKjhKapZnskIktSikyAdchg.executeKK_T_WRIB_SVC_KEI_PKINSERT() [72 LOC]

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

## 1. Role

### JBSbatKKKjhKapZnskIktSikyAdchg.executeKK_T_WRIB_SVC_KEI_PKINSERT()

This method performs a **primary-key-based INSERT** (全項目登録 — full-item registration) of a **Discount Service Contract** (割引サービス契約) record into the `KK_T_WRIB_SVC_KEI` table. It serves as the dedicated persistence bridge between the batch service layer and the discount service contract domain entity. The method accepts a flat `Object[]` array containing 64 field values and maps them onto a `JBSbatCommonDBInterface` structured map before delegating to the data-access component (`db_KK_T_WRIB_SVC_KEI.insertByPrimaryKeys`) for a single-shot database insert. It implements a **mapping-and-delegation pattern**: first transforming a positional parameter array into a typed key-value map, then forwarding it to the DAO/BS layer. Within the larger system, this method is the canonical write path for creating new discount service contract entries — for example, when a new promotional discount is registered during a service contract creation flow (`addWribSvcKei`). It has no conditional branches; every invocation executes the full field mapping and insert unconditionally.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeKK_T_WRIB_SVC_KEI_PKINSERT(setParam)"])
    STEP1["Create JBSbatCommonDBInterface setMap"]
    SET_VALUES["Set 64 key-value pairs from setParam array
WRIB_SVC_KEI_NO through DEL_TRN_ID"]
    STEP2["Call db_KK_T_WRIB_SVC_KEI.insertByPrimaryKeys(setMap)"]
    END_NODE(["Return / Next"])

    START --> STEP1
    STEP1 --> SET_VALUES
    SET_VALUES --> STEP2
    STEP2 --> END_NODE
```

The processing is strictly sequential with no branching:

1. **Map Creation** — A new `JBSbatCommonDBInterface` instance is allocated to hold the key-value field mapping.
2. **Field Mapping (64 assignments)** — Each element `setParam[i]` (i = 0..63) is assigned to a corresponding field name on the map via `setValue()`. This covers discount service contract identifiers, dates, codes, flags, audit fields (add/update/delete timestamps, operator accounts, operation IDs), and various status/reason codes.
3. **DB Insert** — The fully populated map is passed to `db_KK_T_WRIB_SVC_KEI.insertByPrimaryKeys(setMap)`, which performs a single-row INSERT on the `KK_T_WRIB_SVC_KEI` table using the primary-key columns.
4. **Return** — The method returns void; control passes back to the caller.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `setParam` | `Object[]` | An array of 64 field values representing all columns of a Discount Service Contract record. Index 0 is the discount service contract number; indices 1-63 cover dates, codes, flags, audit trail fields, and operational metadata. The positional order is fixed and must match the DB column order defined in the table schema. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `db_KK_T_WRIB_SVC_KEI` | Data-access component (DAO/BS) | The persistence handler for the `KK_T_WRIB_SVC_KEI` (Discount Service Contract Master) table. Provides the `insertByPrimaryKeys` method used in this method. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| C | `JDKBatCommon.insertByPrimaryKeys` | JDKBatCommon | `KK_T_WRIB_SVC_KEI` | Inserts a single row into the Discount Service Contract Master table using the primary key fields from the map. |
| - | `JBSbatCommonDBInterface.setValue` | JBSbatCommonDBInterface | - | Sets key-value pairs on the structured map (64 calls, one per field). |
| - | `JDKStructuredMap.setValue` | JDKStructuredMap | - | Internal map storage operation for each field value. |
| - | `DKSV0101_DKSV0101OP_EDKA0010001BSMapper.setValue` | DKSV0101_DKSV0101OP_EDKA0010001BSMapper | - | Called during the insert pipeline for field value assignment. |
| - | `DKSV0102_DKSV0102OP_EDKA0010001BSMapper.setValue` | DKSV0102_DKSV0102OP_EDKA0010001BSMapper | - | Called during the insert pipeline for field value assignment. |
| - | `DKSV0103_DKSV0103OP_EDKA0010001BSMapper.setValue` | DKSV0103_DKSV0103OP_EDKA0010001BSMapper | - | Called during the insert pipeline for field value assignment. |

The terminal database operation is an **INSERT (C)** into `KK_T_WRIB_SVC_KEI` — the Discount Service Contract Master table. The method performs no reads, updates, or deletes.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 method.
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` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: JBSbatKKKjhKapZnskIktSikyAdchg.addWribSvcKei | `addWribSvcKei` -> `executeKK_T_WRIB_SVC_KEI_PKINSERT` | `insertByPrimaryKeys [C] KK_T_WRIB_SVC_KEI` |

This method is called exclusively by `addWribSvcKei()` within the same class. It serves as the internal persistence helper that commits a newly assembled Discount Service Contract record to the database.

## 6. Per-Branch Detail Blocks

> **Block 1** — [PROCESSING] (L737)

The method body contains no conditional branches (no if/else, switch, or loops). It executes as a linear sequence: map creation, field assignments, and database insert.

| # | Type | Code |
|---|------|------|
| 1 | SET | `JBSbatCommonDBInterface setMap = new JBSbatCommonDBInterface();` // Create structured map for field values |
| 2 | SET | `setMap.setValue("WRIB_SVC_KEI_NO", setParam[0]);` // Discount Service Contract Number (割引サービス契約番号) |
| 3 | SET | `setMap.setValue("GENE_ADD_DTM", setParam[1]);` // Generation Registration DateTime (世代登録年月日時分秒) |
| 4 | SET | `setMap.setValue("WRIB_SVC_KEI_STAT", setParam[2]);` // Discount Service Contract Status (割引サービス契約ステータス) |
| 5 | SET | `setMap.setValue("SYSID", setParam[3]);` // System ID (ＳＹＳＩＤ) |
| 6 | SET | `setMap.setValue("WRIB_SVC_CD", setParam[4]);` // Discount Service Code (割引サービスコード) |
| 7 | SET | `setMap.setValue("PCRS_CD", setParam[5]);` // Pricing Course Code (料金コースコード) |
| 8 | SET | `setMap.setValue("PPLAN_CD", setParam[6]);` // Pricing Plan Code (料金プランコード) |
| 9 | SET | `setMap.setValue("SVC_USE_STA_KIBO_YMD", setParam[7]);` // Service Use Start Desired Date (サービス利用開始希望年月日) |
| 10 | SET | `setMap.setValue("RSV_TSTA_KIBO_YMD", setParam[8]);` // Reservation Application Start Desired Date (予約適用開始希望年月日) |
| 11 | SET | `setMap.setValue("MSKM_DTL_NO", setParam[9]);` // Application Detail Number (申込明細番号) |
| 12 | SET | `setMap.setValue("SHOSA_YMD", setParam[10]);` // Verification Date (照査年月日) |
| 13 | SET | `setMap.setValue("SHOSA_CL_YMD", setParam[11]);` // Verification Cancellation Date (照査取消年月日) |
| 14 | SET | `setMap.setValue("RSV_APLY_YMD", setParam[12]);` // Reservation Application Date (予約適用年月日) |
| 15 | SET | `setMap.setValue("RSV_CL_YMD", setParam[13]);` // Reservation Cancellation Date (予約取消年月日) |
| 16 | SET | `setMap.setValue("RSV_APLY_CD", setParam[14]);` // Reservation Application Code (予約適用コード) |
| 17 | SET | `setMap.setValue("APLY_JUN", setParam[15]);` // Immediate Application Flag (即時適用フラグ) |
| 18 | SET | `setMap.setValue("PLAN_STAYMD", setParam[16]);` // Plan Start Date (プラン開始年月日) |
| 19 | SET | `setMap.setValue("PLAN_ENDYMD", setParam[17]);` // Plan End Date (プラン終了年月日) |
| 20 | SET | `setMap.setValue("PLAN_CHRG_STAYMD", setParam[18]);` // Plan Billing Start Date (プラン課金開始年月日) |
| 21 | SET | `setMap.setValue("PLAN_CHRG_ENDYMD", setParam[19]);` // Plan Billing End Date (プラン課金終了年月日) |
| 22 | SET | `setMap.setValue("PLAN_END_SBT_CD", setParam[20]);` // Plan End Type Code (プラン終了種別コード) |
| 23 | SET | `setMap.setValue("SVC_CANCEL_YMD", setParam[21]);` // Service Cancellation Date (サービスキャンセル年月日) |
| 24 | SET | `setMap.setValue("SVC_CANCEL_RSN_CD", setParam[22]);` // Service Cancellation Reason Code (サービスキャンセル理由コード) |
| 25 | SET | `setMap.setValue("SVC_STA_YMD", setParam[23]);` // Service Start Date (サービス開始年月日) |
| 26 | SET | `setMap.setValue("SVC_CHRG_STAYMD", setParam[24]);` // Service Billing Start Date (サービス課金開始年月日) |
| 27 | SET | `setMap.setValue("SVC_ENDYMD", setParam[25]);` // Service End Date (サービス終了年月日) |
| 28 | SET | `setMap.setValue("SVC_CHRG_ENDYMD", setParam[26]);` // Service Billing End Date (サービス課金終了年月日) |
| 29 | SET | `setMap.setValue("SVC_DSL_YMD", setParam[27]);` // Service Cancellation Date (サービス解約年月日) |
| 30 | SET | `setMap.setValue("SVC_DLRE_CD", setParam[28]);` // Service Cancellation Reason Code (サービス解約理由コード) |
| 31 | SET | `setMap.setValue("SVC_DLRE_MEMO", setParam[29]);` // Service Cancellation Reason Memo (サービス解約理由メモ) |
| 32 | SET | `setMap.setValue("SVC_DSL_TTDKI_FIN_FLG", setParam[30]);` // Service Cancellation Procedure Completion Flag (サービス解約手続完了フラグ) |
| 33 | SET | `setMap.setValue("KAIHK_YMD", setParam[31]);` // Recovery Date (回復年月日) |
| 34 | SET | `setMap.setValue("SVC_CANCEL_CL_YMD", setParam[32]);` // Service Cancellation Reversal Date (サービスキャンセル取消年月日) |
| 35 | SET | `setMap.setValue("SVC_DSL_CL_YMD", setParam[33]);` // Service Cancellation Reversal Date (サービス解約取消年月日) |
| 36 | SET | `setMap.setValue("CHRG_STA_YMD_HOSEI_UM", setParam[34]);` // Billing Start Date Correction Presence (課金開始年月日補正有無) |
| 37 | SET | `setMap.setValue("SKEKKA_SEND_CD", setParam[35]);` // Review Result Transmission Code (審査結果送信コード) |
| 38 | SET | `setMap.setValue("PNLTY_HASSEI_CD", setParam[36]);` // Penalty Occurrence Code (違約金発生コード) |
| 39 | SET | `setMap.setValue("IDO_DIV", setParam[37]);` // Change Classification (異動区分) |
| 40 | SET | `setMap.setValue("SHOSA_DSL_FIN_CD", setParam[38]);` // Verification Cancellation Completion Code (照査解約完了コード) |
| 41 | SET | `setMap.setValue("KEI_CNC_YMD", setParam[39]);` // Contract Conclusion Date (契約締結年月日) |
| 42 | SET | `setMap.setValue("GRP_CD", setParam[40]);` // Group Code (グループコード) |
| 43 | SET | `setMap.setValue("INTR_CD", setParam[41]);` // Referral Code (紹介コード) |
| 44 | SET | `setMap.setValue("MSKM_KISAN_YMD", setParam[42]);` // Application Origin Date (申込起算年月日) |
| 45 | SET | `setMap.setValue("WRIB_ADD_OPTY_CD", setParam[43]);` // Discount Registration Trigger Code (割引登録契機コード) |
| 46 | SET | `setMap.setValue("WRIB_DSL_CNCL_OPTY_CD", setParam[44]);` // Discount Cancellation Trigger Code (割引解約キャンセル契機コード) |
| 47 | SET | `setMap.setValue("WRIB_SVC_KEI_AT_KEIZK_SKCD", setParam[45]);` // Discount Service Contract Auto-Renewal Identifier Code (割引サービス契約自動継続識別コード) |
| 48 | SET | `setMap.setValue("WRIB_AMNT_SNST_STDARDYMD", setParam[46]);` // Discount Amount Calculation Standard Date (割引額算出基準年月日) |
| 49 | SET | `setMap.setValue("WRIB_CHRG_STA_MON_STI_CD", setParam[47]);` // Discount Billing Start Month Designation Code (割引課金開始月指定コード) |
| 50 | SET | `setMap.setValue("WRIB_ADD_YMD", setParam[48]);` // Discount Registration Date (割引登録年月日) |
| 51 | SET | `setMap.setValue("WRTGKEI_SVC_PAUSE_YMD", setParam[49]);` // Discount Target Contract Service Suspension Date (割引対象契約サービス休止年月日) |
| 52 | SET | `setMap.setValue("WRTGKEI_SVC_PAUSE_RLS_YMD", setParam[50]);` // Discount Target Contract Service Suspension Release Date (割引対象契約サービス休止解除年月日) |
| 53 | SET | `setMap.setValue("ADD_DTM", setParam[51]);` // Registration DateTime (登録年月日時分秒) |
| 54 | SET | `setMap.setValue("ADD_OPEACNT", setParam[52]);` // Registering Operator Account (登録オペレータアカウント) |
| 55 | SET | `setMap.setValue("UPD_DTM", setParam[53]);` // Update DateTime (更新年月日時分秒) |
| 56 | SET | `setMap.setValue("UPD_OPEACNT", setParam[54]);` // Updating Operator Account (更新オペレータアカウント) |
| 57 | SET | `setMap.setValue("DEL_DTM", setParam[55]);` // Delete DateTime (削除年月日時分秒) |
| 58 | SET | `setMap.setValue("DEL_OPEACNT", setParam[56]);` // Deleting Operator Account (削除オペレータアカウント) |
| 59 | SET | `setMap.setValue("MK_FLG", setParam[57]);` // Invalid Flag (無効フラグ) |
| 60 | SET | `setMap.setValue("ADD_UNYO_YMD", setParam[58]);` // Registration Operation Date (登録運用年月日) |
| 61 | SET | `setMap.setValue("ADD_TRN_ID", setParam[59]);` // Registration Processing ID (登録処理ＩＤ) |
| 62 | SET | `setMap.setValue("UPD_UNYO_YMD", setParam[60]);` // Update Operation Date (更新運用年月日) |
| 63 | SET | `setMap.setValue("UPD_TRN_ID", setParam[61]);` // Update Processing ID (更新処理ＩＤ) |
| 64 | SET | `setMap.setValue("DEL_UNYO_YMD", setParam[62]);` // Delete Operation Date (削除運用年月日) |
| 65 | SET | `setMap.setValue("DEL_TRN_ID", setParam[63]);` // Delete Processing ID (削除処理ＩＤ) |
| 66 | CALL | `db_KK_T_WRIB_SVC_KEI.insertByPrimaryKeys(setMap);` // Execute primary-key insert on KK_T_WRIB_SVC_KEI table |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `WRIB_SVC_KEI_NO` | Field | Discount Service Contract Number — the unique identifier for a discount service contract record. |
| `WRIB` | Acronym | Discount (割引) — refers to promotional or pricing discount services in the telecom billing system. |
| `SVC_KEI` | Acronym | Service Contract — refers to the service contract entity. |
| `GENE_ADD_DTM` | Field | Generation Registration DateTime — timestamp when this version/generation of the record was registered. |
| `WRIB_SVC_KEI_STAT` | Field | Discount Service Contract Status — current status code of the discount service contract. |
| `SYSID` | Field | System ID — identifies the originating system. |
| `WRIB_SVC_CD` | Field | Discount Service Code — the code identifying the type of discount service. |
| `PCRS_CD` | Field | Pricing Course Code — the pricing course to which the discount applies. |
| `PPLAN_CD` | Field | Pricing Plan Code — the specific pricing plan for the discount. |
| `SVC_USE_STA_KIBO_YMD` | Field | Service Use Start Desired Date — the date the customer wishes to start using the service. |
| `RSV_TSTA_KIBO_YMD` | Field | Reservation Application Start Desired Date — the desired start date for reservation application. |
| `MSKM_DTL_NO` | Field | Application Detail Number — the detail line number of the original application. |
| `SHOSA_YMD` | Field | Verification Date — the date of verification/check (照査). |
| `SHOSA_CL_YMD` | Field | Verification Cancellation Date — the date a verification was cancelled. |
| `RSV_APLY_YMD` | Field | Reservation Application Date — the date a reservation was applied. |
| `RSV_CL_YMD` | Field | Reservation Cancellation Date — the date a reservation was cancelled. |
| `RSV_APLY_CD` | Field | Reservation Application Code — code indicating the type of reservation application. |
| `APLY_JUN` | Field | Immediate Application Flag — indicates whether the discount should be applied immediately. |
| `PLAN_STAYMD` | Field | Plan Start Date — the date the pricing plan becomes effective. |
| `PLAN_ENDYMD` | Field | Plan End Date — the date the pricing plan expires. |
| `PLAN_CHRG_STAYMD` | Field | Plan Billing Start Date — the date plan billing begins. |
| `PLAN_CHRG_ENDYMD` | Field | Plan Billing End Date — the date plan billing ends. |
| `PLAN_END_SBT_CD` | Field | Plan End Type Code — code indicating the type of plan termination. |
| `SVC_CANCEL_YMD` | Field | Service Cancellation Date — the date the service was cancelled. |
| `SVC_CANCEL_RSN_CD` | Field | Service Cancellation Reason Code — the reason code for service cancellation. |
| `SVC_STA_YMD` | Field | Service Start Date — the date the service started. |
| `SVC_CHRG_STAYMD` | Field | Service Billing Start Date — the date service billing began. |
| `SVC_ENDYMD` | Field | Service End Date — the date the service ended. |
| `SVC_CHRG_ENDYMD` | Field | Service Billing End Date — the date service billing ended. |
| `SVC_DSL_YMD` | Field | Service Cancellation/Disconnection Date — the date the service was disconnected. |
| `SVC_DLRE_CD` | Field | Service Disconnection Reason Code — the reason code for service disconnection. |
| `SVC_DLRE_MEMO` | Field | Service Disconnection Reason Memo — free-text memo for the disconnection reason. |
| `SVC_DSL_TTDKI_FIN_FLG` | Field | Service Cancellation Procedure Completion Flag — indicates whether cancellation procedures are complete. |
| `KAIHK_YMD` | Field | Recovery Date (回復年月日) — the date a suspended/recovered status was restored. |
| `SVC_CANCEL_CL_YMD` | Field | Service Cancellation Reversal Date — the date a cancellation was reversed/undone. |
| `SVC_DSL_CL_YMD` | Field | Service Disconnection Reversal Date — the date a disconnection was reversed/undone. |
| `CHRG_STA_YMD_HOSEI_UM` | Field | Billing Start Date Correction Presence (課金開始年月日補正有無) — flag indicating whether the billing start date was corrected. |
| `SKEKKA_SEND_CD` | Field | Review Result Transmission Code (審査結果送信コード) — code for transmitting review/underwriting results. |
| `PNLTY_HASSEI_CD` | Field | Penalty Occurrence Code (違約金発生コード) — code indicating whether a penalty/liquidated damage was incurred. |
| `IDO_DIV` | Field | Change Classification (異動区分) — classifies the type of contract change or movement. |
| `SHOSA_DSL_FIN_CD` | Field | Verification Cancellation Completion Code (照査解約完了コード) — code indicating completion of verification cancellation. |
| `KEI_CNC_YMD` | Field | Contract Conclusion Date (契約締結年月日) — the date the contract was concluded/signed. |
| `GRP_CD` | Field | Group Code (グループコード) — the code identifying the customer or contract group. |
| `INTR_CD` | Field | Referral Code (紹介コード) — the code for the referral source. |
| `MSKM_KISAN_YMD` | Field | Application Origin Date (申込起算年月日) — the origin date from which the application period is calculated. |
| `WRIB_ADD_OPTY_CD` | Field | Discount Registration Trigger Code (割引登録契機コード) — the trigger/event that caused this discount registration. |
| `WRIB_DSL_CNCL_OPTY_CD` | Field | Discount Cancellation Trigger Code (割引解約キャンセル契機コード) — the trigger that caused the discount cancellation. |
| `WRIB_SVC_KEI_AT_KEIZK_SKCD` | Field | Discount Service Contract Auto-Renewal Identifier Code (割引サービス契約自動継続識別コード) — identifier for auto-renewal of discount contracts. |
| `WRIB_AMNT_SNST_STDARDYMD` | Field | Discount Amount Calculation Standard Date (割引額算出基準年月日) — the standard date used for calculating the discount amount. |
| `WRIB_CHRG_STA_MON_STI_CD` | Field | Discount Billing Start Month Designation Code (割引課金開始月指定コード) — code designating the billing start month for the discount. |
| `WRIB_ADD_YMD` | Field | Discount Registration Date (割引登録年月日) — the date the discount was registered. |
| `WRTGKEI_SVC_PAUSE_YMD` | Field | Discount Target Contract Service Suspension Date (割引対象契約サービス休止年月日) — the date the target service was suspended. |
| `WRTGKEI_SVC_PAUSE_RLS_YMD` | Field | Discount Target Contract Service Suspension Release Date (割引対象契約サービス休止解除年月日) — the date the suspension was lifted. |
| `ADD_DTM` / `UPD_DTM` / `DEL_DTM` | Field | Registration / Update / Delete DateTime — audit timestamps for row lifecycle events. |
| `ADD_OPEACNT` / `UPD_OPEACNT` / `DEL_OPEACNT` | Field | Registering / Updating / Deleting Operator Account — the operator who performed each action. |
| `MK_FLG` | Field | Invalid Flag (無効フラグ) — soft-delete indicator; when set, the record is logically invalid. |
| `ADD_UNYO_YMD` / `UPD_UNYO_YMD` / `DEL_UNYO_YMD` | Field | Registration / Update / Delete Operation Date (登録/更新/削除運用年月日) — business operation date for audit. |
| `ADD_TRN_ID` / `UPD_TRN_ID` / `DEL_TRN_ID` | Field | Registration / Update / Delete Processing ID (登録/更新/削除処理ＩＤ) — internal processing/transmission ID for audit. |
| `KK_T_WRIB_SVC_KEI` | DB Table | Discount Service Contract Master table — the persistent store for discount service contract records. The `T_` prefix indicates a transaction/management table. |
| `JBSbatCommonDBInterface` | Class | Common batch database interface — a key-value structured map used to carry field data to batch data-access methods. |
| `insertByPrimaryKeys` | Method | Data-access operation that inserts a row into the target table using all primary-key columns as the uniqueness key. |
| `addWribSvcKei` | Method | The caller of this method; registers a new discount service contract entry. |
| 全項目登録 | Japanese | Full-item registration — registration where all fields are provided, as opposed to partial updates. |
| 照査 | Japanese | Verification / Screening — a business check process performed before contract activation. |
