# Business Logic — JBSbatKKKjFinDataInTrn.insertKktkSvcKeiTeiketsu() [248 LOC]

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

## 1. Role

### JBSbatKKKjFinDataInTrn.insertKktkSvcKeiTeiketsu()

This method performs the **equipment provision service contract registration processing** (機器提供サービス契約登録処理). It is the core data-mapping and persistence entry point for creating a new record in the `KK_T_KKTK_SVC_KEI` (Equipment Provision Service Contract) table during batch job execution. The method accepts a pre-populated database interface map (`kktkSvcKei_map`) containing extracted service contract fields from an incoming electronic message (電文), transforms and normalizes those values (trimming whitespace, resolving dates), and then delegates to `executeKK_T_KKTK_SVC_KEI_PKINSERT` to perform the actual primary-key-insert SQL operation.

The method implements a **data-mapper / assembler pattern**: it does not contain business decision logic or conditional branching by service type. Instead, it unconditionally extracts all ~99 fields from the input map, resolves a small set of date-derived variables (service start, plan start, charges, contract completion), and assembles them into a single parameter array. Two hardcoded constants from the v20.00.00 refactoring are embedded directly: the contract status code `CD00056_KKTK_SVC_KEI_STAT_030` ("030" — Contract Completed) and the valid flag `MK_FLG_YK` ("0" — Valid).

In the larger system, this method serves as the shared batch-side counterpart to the online service-contract screen handlers. It is called by `insertUpdatekktkSvcKeiNet` (for FTTH/Net service registrations) and `insertUpdateKktkSvcKeiTV` (for Cable TV service registrations), making it a **universal contract-line-item creator** that handles all equipment-provision service subtypes (Internet, TV, bundled, rental, purchase) through a single unified insert path.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["insertKktkSvcKeiTeiketsu(kktkSvcKei_map, mskmDtlNo, idoDiv)"])
    GET_SYS_DATE["Get system date via JCCBatCommon"]
    DECL_VARS["Declare date string variables"]
    EXTRACT_SVC_DATE["Extract service start date from map"]
    EXTRACT_PLAN_DATE["Extract plan start date from map"]
    EXTRACT_CHARGE_DATES["Extract service and plan charge dates"]
    EXTRACT_TERM_DATES["Extract service and plan end dates"]
    EXTRACT_CONTRACT_DATE["Extract keiCncYmd and other dates"]
    EXTRACT_KIKI_FIELDS["Extract equipment fields"]
    EXTRACT_DELIVERY_FIELDS["Extract delivery fields"]
    EXTRACT_OTHER_FIELDS["Extract other fields"]
    EXTRACT_PROJECTION_FIELDS["Extract projection fields"]
    EXTRACT_STATUS_FIELDS["Extract status fields"]
    SET_KEI_CNC["Set keiCncYmd to opeDate"]
    SET_MK_FLG["Set MK_FLG_YK to valid flag"]
    BUILD_PARAM_ARRAY["Build setParam array"]
    CALL_INSERT["Call executeKK_T_KKTK_SVC_KEI_PKINSERT"]
    END_NODE(["Return void"])
    START --> GET_SYS_DATE
    GET_SYS_DATE --> DECL_VARS
    DECL_VARS --> EXTRACT_SVC_DATE
    EXTRACT_SVC_DATE --> EXTRACT_PLAN_DATE
    EXTRACT_PLAN_DATE --> EXTRACT_CHARGE_DATES
    EXTRACT_CHARGE_DATES --> EXTRACT_TERM_DATES
    EXTRACT_TERM_DATES --> EXTRACT_CONTRACT_DATE
    EXTRACT_CONTRACT_DATE --> EXTRACT_KIKI_FIELDS
    EXTRACT_KIKI_FIELDS --> EXTRACT_DELIVERY_FIELDS
    EXTRACT_DELIVERY_FIELDS --> EXTRACT_OTHER_FIELDS
    EXTRACT_OTHER_FIELDS --> EXTRACT_PROJECTION_FIELDS
    EXTRACT_PROJECTION_FIELDS --> EXTRACT_STATUS_FIELDS
    EXTRACT_STATUS_FIELDS --> SET_KEI_CNC
    SET_KEI_CNC --> SET_MK_FLG
    SET_MK_FLG --> BUILD_PARAM_ARRAY
    BUILD_PARAM_ARRAY --> CALL_INSERT
    CALL_INSERT --> END_NODE
```

**Processing Summary:**

The method follows a **linear, unbranching assembly pattern**:

1. **System timestamp acquisition** — Obtains the current system date/time stamp for audit trail purposes via `JCCBatCommon.getSysDateTimeStamp()`.

2. **Date variable declaration** — Declares local string variables to hold normalized date values for service start, service charge start, service end, service charge end, plan start, plan end, plan charge start, plan charge end, and contract completion date.

3. **Input field extraction from map** — Extracts all relevant fields from the `kktkSvcKei_map` (a `JBSbatCommonDBInterface` carrying data from the incoming electronic message). Every extracted value is passed through `JBSbatStringUtil.Rtrim()` for whitespace normalization. This covers:
   - Service lifecycle dates (start, charge start, end, charge end)
   - Plan lifecycle dates (start, end, charge start, charge end)
   - Equipment identification (service code, contract code, plan code, device series number, equipment type, sales subtype)
   - Equipment specifications (hoped-for start date, reservation start date, maker code, designated subtype, rental equipment subtype/model, manufacturing number, accessory subtype/model, etc.)
   - Equipment owner information (name, katakana, address, postal code, phone)
   - Equipment installation/installation-branch addresses (name, kana, address, postal code, phone)
   - Delivery/scheduling data (delivery division, delivery deadline, arrival designation, trial period, formal installation)
   - Status/change codes (service stop, pause, DSL, guarantee, penalty)
   - Reference data (operator system ID, application detail number, movement division)
   - Forward-compatibility placeholder fields (6 blank strings for future schema expansion)
   - Version-controlled fields (v9.00.00 added trial period start/summary dates; v10.00.00 modified these to separate start and summary columns)

4. **Contract completion date assignment** — Sets `keiCncYmd` (contract completion date) to `super.opeDate`, the operational date set at the batch job level.

5. **Parameter array construction** — Assembles a 99-element `String[]` (`setParam`) in the exact column order expected by the `KK_T_KKTK_SVC_KEI` table schema.

6. **Hardcoded constant injection (v20.00.00)** — Replaces the old hardcoded status code `"030"` with the resolved constant `JBSbatKKConst.CD00056_KKTK_SVC_KEI_STAT_030` (value: `"030"`) for equipment provision service contract status (Contract Completed). Also replaces the old hardcoded `"0"` with `JBSbatKKConst.MK_FLG_YK` (value: `"0"`, meaning Valid).

7. **Delegation to persistence layer** — Calls `executeKK_T_KKTK_SVC_KEI_PKINSERT(setParam)` to perform the SQL INSERT with primary-key generation.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `kktkSvcKei_map` | `JBSbatCommonDBInterface` | The equipment provision service contract data map, carrying all fields from the incoming electronic message (電文). Contains pre-fetched service contract attributes including service codes, equipment details, addresses, dates, and status codes. This map is populated by prior batch processing stages that read from upstream tables or parse inbound messages. |
| 2 | `mskmDtlNo` | `String` | Application detail number (申請明細番号) — the unique identifier linking this service contract record to a specific line item within a batch application. Used for traceability between the application header and its detail records. |
| 3 | `idoDiv` | `String` | Movement division (異動区分) — classifies the type of contract change operation (e.g., new installation, transfer, modification, cancellation). Drives downstream business rules for service activation and billing adjustments. |

**Inherited/Instance Fields Read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `super.opeDate` | `String` | Operational date (運用日) — the business date used for this batch run. Serves as both the contract completion date (keiCncYmd) and the reservation application date (RSV_APPLY_YMD equivalent). |

## 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 | - | Reads system date/time stamp for audit trail |
| R | `JBSbatStringUtil.Rtrim` | JBSbatStringUtil | - | Trims whitespace from extracted string fields |
| C | `JBSbatKKKjFinDataInTrn.executeKK_T_KKTK_SVC_KEI_PKINSERT` | - | `KK_T_KKTK_SVC_KEI` | Inserts a new equipment provision service contract record with primary-key generation |

### Detailed Analysis:

**`R — JCCBatCommon.getSysDateTimeStamp()`**
- **SC Code:** Not applicable (utility method)
- **Entity/DB:** N/A
- **Operation:** Retrieves the current system date and time as a formatted string (e.g., `20260628143000`) for use as the system date (`sysDate`) embedded in the contract record.

**`R — JBSbatStringUtil.Rtrim(String)` (called ~80+ times)**
- **SC Code:** Not applicable (utility method)
- **Entity/DB:** N/A
- **Operation:** Trims trailing whitespace from every string value extracted from the input map. Applied to all fields before inclusion in the parameter array to ensure data cleanliness.

**`C — JBSbatKKKjFinDataInTrn.executeKK_T_KKTK_SVC_KEI_PKINSERT(Object[])`**
- **SC Code:** Not explicitly coded (this class's own method)
- **Entity/DB:** `KK_T_KKTK_SVC_KEI` (Equipment Provision Service Contract table)
- **Operation:** Performs a SQL INSERT operation that creates a new row in the `KK_T_KKTK_SVC_KEI` table. The method name indicates it handles primary-key generation (`PKINSERT`), meaning the primary key (likely `KKTK_SVC_KEI_NO`) is generated internally rather than accepted from the caller. The 99-element `setParam` array is mapped positionally to the table's columns.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods.
Terminal operations from this method: `executeKK_T_KKTK_SVC_KEI_PKINSERT` [C], `Rtrim` [-], `Rtrim` [-], `Rtrim` [-], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `Rtrim` [-], `Rtrim` [-], `Rtrim` [-], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `Rtrim` [-], `Rtrim` [-], `Rtrim` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JBSbatKKKjFinDataInTrn.insertUpdatekktkSvcKeiNet` | `insertUpdatekktkSvcKeiNet` -> `insertKktkSvcKeiTeiketsu` | `executeKK_T_KKTK_SVC_KEI_PKINSERT [C] KK_T_KKTK_SVC_KEI` |
| 2 | Batch: `JBSbatKKKjFinDataInTrn.insertUpdateKktkSvcKeiTV` | `insertUpdateKktkSvcKeiTV` -> `insertKktkSvcKeiTeiketsu` | `executeKK_T_KKTK_SVC_KEI_PKINSERT [C] KK_T_KKTK_SVC_KEI` |

**Caller Descriptions:**

- **`insertUpdatekktkSvcKeiNet`** — Handles Net (FTTH/Internet) service contract registration. Prepares the `kktkSvcKei_map` with Internet-subtype data, then delegates to `insertKktkSvcKeiTeiketsu` for the actual contract record creation.
- **`insertUpdateKktkSvcKeiTV`** — Handles Cable TV service contract registration. Prepares the `kktkSvcKei_map` with TV-subtype data, then delegates to `insertKktkSvcKeiTeiketsu` for the actual contract record creation.

## 6. Per-Branch Detail Blocks

This method has **no conditional branching** (no if/else, switch, loop, or try-catch blocks). It is a purely linear data-assembly method. Below is the single execution block.

**Block 1** — [SEQUENTIAL EXECUTION] (L12159)

> Acquire system timestamp, declare date variables, and extract all fields from the input map for the equipment provision service contract registration.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `sysDate = JCCBatCommon.getSysDateTimeStamp()` | Get current system date/time for audit trail [JCCBatCommon utility] |
| 2 | SET | `svcChrgStaymdStr = ""` | Initialize service charge start date variable |
| 3 | SET | `svcEndymdStr = ""` | Initialize service end date variable |
| 4 | SET | `svcChrgEndymdStr = ""` | Initialize service charge end date variable |
| 5 | SET | `planChrgStaymdStr = ""` | Initialize plan charge start date variable |
| 6 | SET | `planEndymdStr = ""` | Initialize plan end date variable |
| 7 | SET | `planChrgEndymdStr = ""` | Initialize plan charge end date variable |
| 8 | SET | `keiCncYmd = ""` | Initialize contract completion date variable |
| 9 | SET/EXEC | `svcStaymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.SVC_STA_YMD))` | Extract service start date (サービス開始年月日) from map |
| 10 | SET/EXEC | `planStaymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.PLAN_STAYMD))` | Extract plan start date (プラン開始年月日) from map |
| 11 | SET/EXEC | `svcStaymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.SVC_STA_YMD))` | Re-assign service start date (idempotent — second extraction) |
| 12 | SET/EXEC | `svcChrgStaymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.SVC_CHRG_STAYMD))` | Extract service charge start date (サービス課金開始年月日) |
| 13 | SET/EXEC | `svcEndymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.SVC_ENDYMD))` | Extract service end date (サービス終了年月日) |
| 14 | SET/EXEC | `svcChrgEndymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.SVC_CHRG_ENDYMD))` | Extract service charge end date (サービス課金終了年月日) |
| 15 | SET/EXEC | `planStaymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.PLAN_STAYMD))` | Extract plan start date (プラン開始年月日) |
| 16 | SET/EXEC | `planChrgStaymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.PLAN_CHRG_STAYMD))` | Extract plan charge start date (プラン課金開始年月日) |
| 17 | SET/EXEC | `planEndymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.PLAN_ENDYMD))` | Extract plan end date (プラン終了年月日) |
| 18 | SET/EXEC | `planChrgEndymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.PLAN_CHRG_ENDYMD))` | Extract plan charge end date (プラン課金終了年月日) |
| 19 | SET | `keiCncYmd = super.opeDate` | Set contract completion date (契約締結年月日) to operational date |

**Block 1.1** — [PARAMETER ARRAY CONSTRUCTION] (L12251)

> Build the 99-element setParam array for KK_T_KKTK_SVC_KEI INSERT.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `setParam[0]` = `KKTk_SVC_KEI_NO` from map | Equipment provision service contract number (機器提供サービス契約番号) |
| 2 | SET | `setParam[1]` = `sysDate` | System date (システム日) |
| 3 | SET | `setParam[2]` = `JBSbatKKConst.CD00056_KKTK_SVC_KEI_STAT_030` (= "030") | Contract status — Contract Completed (契約済み) [v20.00.00 constant resolution] |
| 4 | SET | `setParam[3]` = `KKTK_SVC_CD` from map | Equipment provision service code (機器提供サービスコード) |
| 5 | SET | `setParam[4]` = `PCRS_CD` from map | PCRS code (PCRSコード) |
| 6 | SET | `setParam[5]` = `PPPLAN_CD` from map | PP plan code (PPプランコード) |
| 7 | SET | `setParam[6]` = `TK_HOSHIKI_KEI_NO` from map | Transmission equipment series number (送信設備系番号) |
| 8 | SET | `setParam[7]` = `KKTK_SBT_CD` from map | Equipment provision subtype code (機器提供種別コード) |
| 9 | SET | `setParam[8]` = `HAMBAI_SBT_CD` from map | Sales subtype code (販売種別コード) |
| 10 | SET | `setParam[9]` = `SVC_USE_STA_KIBO_YMD` from map | Service use start desired date (サービス使用開始希望年月日) |
| 11 | SET | `setParam[10]` = `RSV_TSTA_KIBO_YMD` from map | Reservation start desired date (予約開始希望年月日) |
| 12 | SET | `setParam[11]` = `KIBO_MAKER_CD` from map | Desired maker code (希望メーカーコード) |
| 13 | SET | `setParam[12]` = `KIKI_SHITEI_SBT_CD` from map | Equipment designated subtype code (機器指定種別コード) |
| 14 | SET | `setParam[13]` = `TAKNKIKI_SBT_CD` from map | Rental equipment subtype code (貸与機器種別コード) |
| 15 | SET | `setParam[14]` = `TAKNKIKI_MODEL_CD` from map | Rental equipment model code (貸与機器モデルコード) |
| 16 | SET | `setParam[15]` = `KIKI_SEIZO_NO` from map | Equipment manufacturing number (機器製造番号) |
| 17 | SET | `setParam[16]` = `FUZOKUHIN_SBT_CD` from map | Accessory subtype code (付属品種別コード) |
| 18 | SET | `setParam[17]` = `FUZOKUHIN_MODEL_CD` from map | Accessory model code (付属品モデルコード) |
| 19 | SET | `setParam[18]` = `TAKNKIKI_SETHIN_MODEL_CD` from map | Rental equipment delivery model code (貸与機器届出モデルコード) |
| 20 | SET | `setParam[19]` = `KIKI_CHG_NO` from map | Equipment change number (機器変更番号) |
| 21 | SET | `setParam[20]` = `KIKI_CHG_RSN_CD` from map | Equipment change reason code (機器変更理由コード) |
| 22 | SET | `setParam[21]` = `TSUSHIN_KIKI_SET_CD` from map | Communication equipment set code (通信機器設定コード) |
| 23 | SET | `setParam[22]` = `HDD_CAPA_CD` from map | HDD capacity code (HDD容量コード) |
| 24 | SET | `setParam[23]` = `KIKI_STC_SAKI_PLACE_NO` from map | Equipment installation work site number (機器施工サイト場所番号) |
| 25 | SET | `setParam[24]` = `OYA_KEI_SKBT_CD` from map | Parent contract subtype code (親契約種別コード) |
| 26 | SET | `setParam[25]` = `SVC_KEI_NO` from map | Service contract number (サービス契約番号) |
| 27 | SET | `setParam[26]` = `SVC_KEI_UCWK_NO` from map | Service contract detail number (サービス契約内訳番号) |
| 28 | SET | `setParam[27]` = `SVC_KEI_KAISEN_UCWK_NO` from map | Service contract improvement detail number (サービス契約改良内訳番号) |
| 29 | SET | `setParam[28]` = `OP_SVC_KEI_NO` from map | OP service contract number (OPサービス契約番号) |
| 30 | SET | `setParam[29]` = `SYSID` from map | System ID (システムID) |
| 31 | SET | `setParam[30]` = `mskmDtlNo` | Application detail number (申請明細番号) — **method parameter** |
| 32 | SET | `setParam[31]` = `LINK_STB_FLG` from map | Link STB flag (リンクSTBフラグ) |
| 33 | SET | `setParam[32]` = `KIKI_HKAT_SHITEI_SOKO_CD` from map | Equipment installation designated location code (機器設置指定場所コード) |
| 34 | SET | `setParam[33]` = `KIKI_HKAT_SHITEI_SKDN_CD` from map | Equipment installation designated branch code (機器設置指定支店コード) |
| 35 | SET | `setParam[34]` = `KIKI_STI_JI_KRIPLACE_SKCD` from map | Equipment installed site work location code (機器設置地施工場所支店コード) |
| 36 | SET | `setParam[35]` = `KIKI_STI_JI_KOCOMP_CD` from map | Equipment installed site KO component code (機器設置地KO構成コード) |
| 37 | SET | `setParam[36]` = `KIKI_STI_JI_KOCOMP_SLF_CD` from map | Equipment installed site KO component self code (機器設置地KO構成自己コード) |
| 38 | SET | `setParam[37]` = `KIKI_STI_JI_YTKSKOF_CD` from map | Equipment installed site YTK SKOF code (機器設置地YTKSKOFコード) |
| 39 | SET | `setParam[38]` = `KIKI_STI_JI_YTKSKOF_SLF_CD` from map | Equipment installed site YTK SKOF self code (機器設置地YTKSKOF自己コード) |
| 40 | SET | `setParam[39]` = `KKTK_SVC_KEI_HKHASYMD` from map | Equipment provision service start date (機器提供サービス開始年月日) |
| 41 | SET | `setParam[40]` = `KIKI_SORYO_UM` from map | Equipment charge unit cost (機器料金単価) |
| 42 | SET | `setParam[41]` = `KIKI_SORYO_SAKSEI_YMD` from map | Equipment charge creation date (機器料金作成年月日) |
| 43 | SET | `setParam[42]` = `KIKI_SOHUS_NM` from map | Equipment owner name (機器所有者名称) |
| 44 | SET | `setParam[43]` = `KIKI_SOHUS_KANA` from map | Equipment owner katakana (機器所有者カナ) |
| 45 | SET | `setParam[44]` = `KIKI_SOHUS_AD_CD` from map | Equipment owner address code (機器所有者住所コード) |
| 46 | SET | `setParam[45]` = `KIKI_SOHUS_PCD` from map | Equipment owner postal code (機器所有者郵便番号) |
| 47 | SET | `setParam[46]` = `KIKI_SOHUS_STATE_NM` from map | Equipment owner state name (機器所有者都道府県名称) |
| 48 | SET | `setParam[47]` = `KIKI_SOHUS_CITY_NM` from map | Equipment owner city name (機器所有者市区町村名称) |
| 49 | SET | `setParam[48]` = `KIKI_SOHUS_OAZTSU_NM` from map | Equipment owner oaztsu name (機器所有者大口名称) |
| 50 | SET | `setParam[49]` = `KIKI_SOHUS_AZCHO_NM` from map | Equipment owner azcho name (機器所有者安札名称) |
| 51 | SET | `setParam[50]` = `KIKI_SOHUS_BNCHIGO` from map | Equipment owner branch code (機器所有者支店番号) |
| 52 | SET | `setParam[51]` = `KIKI_SOHUS_ADRTTM` from map | Equipment owner address building name (機器所有者住所建物名) |
| 53 | SET | `setParam[52]` = `KIKI_SOHUS_ADRRM` from map | Equipment owner address room (機器所有者住所部屋) |
| 54 | SET | `setParam[53]` = `KIKI_SHS_AD_MAN_INPUT_FLG` from map | Equipment address manual input flag (機器住所手入力フラグ) |
| 55 | SET | `setParam[54]` = `KIKI_SOHUS_TELNO` from map | Equipment owner telephone number (機器所有者電話番号) |
| 56 | SET | `setParam[55]` = `MANSION_BUKKEN_NO` from map | Mansion building number (マンション建番) |
| 57 | SET | `setParam[56]` = `KIKI_SOHUS_KSH_AD_SAI_FLG` from map | Equipment owner address re-inspection flag (機器所有者住所再調査フラグ) |
| 58 | SET | `setParam[57]` = `KIKI_SHS_KBT_SHITEI_FLG` from map | Equipment KBT designation flag (機器KB指定フラグ) |
| 59 | SET | `setParam[58]` = `KIKI_SHS_HSK_CD_1` from map | Equipment housing code 1 (機器住宅コード1) |
| 60 | SET | `setParam[59]` = `KIKI_SHS_HSK_CD_2` from map | Equipment housing code 2 (機器住宅コード2) |
| 61 | SET | `setParam[60]` = `KIKI_SHS_HSK_MEMO` from map | Equipment housing memo (機器住宅メモ) |
| 62 | SET | `setParam[61]` = `KIKI_STC_SAKI_NM` from map | Equipment installation work name (機器施工名称) |
| 63 | SET | `setParam[62]` = `KIKI_STC_SAKI_KANA` from map | Equipment installation work katakana (機器施工カナ) |
| 64 | SET | `setParam[63]` = `KIKI_STC_SAKI_AD_CD` from map | Equipment installation work address code (機器施工住所コード) |
| 65 | SET | `setParam[64]` = `KIKI_STC_SAKI_PCD` from map | Equipment installation work postal code (機器施工郵便番号) |
| 66 | SET | `setParam[65]` = `KIKI_STC_SAKI_STATE_NM` from map | Equipment installation work state name (機器施工都道府県名称) |
| 67 | SET | `setParam[66]` = `KIKI_STC_SAKI_CITY_NM` from map | Equipment installation work city name (機器施工市区町村名称) |
| 68 | SET | `setParam[67]` = `KIKI_STC_SAKI_OAZTSU_NM` from map | Equipment installation work oaztsu name (機器施工大口名称) |
| 69 | SET | `setParam[68]` = `KIKI_STC_SAKI_AZCHO_NM` from map | Equipment installation work azcho name (機器施工安札名称) |
| 70 | SET | `setParam[69]` = `KIKI_STC_SAKI_BNCHIGO` from map | Equipment installation work branch code (機器施工支店番号) |
| 71 | SET | `setParam[70]` = `KIKI_STC_SAKI_ADRTTM` from map | Equipment installation work address building name (機器施工住所建物名) |
| 72 | SET | `setParam[71]` = `KIKI_STC_SAKI_ADRRM` from map | Equipment installation work address room (機器施工住所部屋) |
| 73 | SET | `setParam[72]` = `KIKI_STC_SK_KSH_AD_SAI_FLG` from map | Equipment installation branch re-inspection flag (機器施工支店再調査フラグ) |
| 74 | SET | `setParam[73]` = `KIKI_STC_SK_TELNO` from map | Equipment installation branch telephone number (機器施工支店電話番号) |
| 75 | SET | `setParam[74]` = `KIKI_STS_KKK_SEIRI_CHU_FLG` from map | Equipment processing in-progress flag (機器処理処理中フラグ) |
| 76 | SET | `setParam[75]` = `AD_MI_FIX_FLG` from map | Address mail fix flag (アドレスメール修正フラグ) |
| 77 | SET | `setParam[76]` = `AUTO_ADD_CD` from map | Auto-add code (自動追加コード) |
| 78 | SET | `setParam[77]` = `AD_MI_FIX_RLS_YMD` from map | Address mail fix release date (アドレスメール修正解除年月日) |
| 79 | SET | `setParam[78]` = `CHRG_STA_YMD_HOSEI_UM` from map | Charge start date adjustment unit cost (課金開始年月日調整単位) |
| 80 | SET | `setParam[79]` = `KIKI_STS_HSK_CD_1` from map | Equipment status housing code 1 (機器状態住宅コード1) |
| 81 | SET | `setParam[80]` = `KIKI_STS_HSK_CD_2` from map | Equipment status housing code 2 (機器状態住宅コード2) |
| 82 | SET | `setParam[81]` = `KIKI_STS_HSK_MEMO` from map | Equipment status housing memo (機器状態住宅メモ) |
| 83 | SET | `setParam[82]` = `KKTK_SVC_KEI_KZKWRK_REQYMD` from map | Equipment provision contract work request date (機器提供契約作業要求年月日) |
| 84 | SET | `setParam[83]` = `SHOSA_YMD` from map | Inspection date (調査年月日) |
| 85 | SET | `setParam[84]` = `SHOSA_CL_YMD` from map | Inspection completion date (調査完了年月日) |
| 86 | SET | `setParam[85]` = `HAISO_DIV` from map | Delivery division (配達区分) |
| 87 | SET | `setParam[86]` = `HAISO_KIGEN_YMD` from map | Delivery deadline date (配達期限年月日) |
| 88 | SET | `setParam[87]` = `HAISO_ARIV_SHITEI_YMD` from map | Delivery arrival designation date (配達到着指定年月日) |
| 89 | SET | `setParam[88]` = `FTRIAL_KANYU_YMD` from map | Free trial insertion date (無料試訳入年月日) |
| 90 | SET | `setParam[89]` = `FTRIAL_PRD_ENDYMD` from map | Free trial period end date (無料試用期間終了年月日) |
| 91 | SET | `setParam[90]` = `HONKANYU_YMD` from map | Formal installation date (本設置年月日) |
| 92 | SET | `setParam[91]` = `HONKANYU_IKO_KIGEN_YMD` from map | Post-formal-installation deadline date (本設置後期限年月日) |
| 93 | SET | `setParam[92]` = `keiCncYmd` (= `super.opeDate`) | Contract completion date (契約締結年月日) — inherited from operational date |
| 94 | SET | `setParam[93]` = `JCCC_KANYU_BUNSHO_YMD` from map | JCCC insertion document date (JCCC插入文書年月日) |
| 95 | SET | `setParam[94]` = `HOSHO_CD` from map | Guarantee code (保証コード) |
| 96 | SET | `setParam[95]` = `KKTK_SVKEI_HOKI` from map | Equipment provision supplement (機器提供補遺) |
| 97 | SET | `setParam[96]` = `HOSHO_STAYMD` from map | Guarantee start date (保証開始年月日) |
| 98 | SET | `setParam[97]` = `HOSHO_END_YMD` from map | Guarantee end date (保証終了年月日) |
| 99 | SET | `setParam[98]` = `super.opeDate` | Reservation application date (予約適用年月日) — inherited from operational date [v20.00.00] |

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 100 | SET | `setParam[99]` = `RSV_CL_YMD` from map | Reservation completion date (予約完了年月日) |
| 101 | SET | `setParam[100]` = `RSV_APLY_CD` from map | Reservation application code (予約適用コード) |
| 102 | SET | `setParam[101]` = `KIKI_CHG_YMD` from map | Equipment change date (機器変更年月日) |
| 103 | SET | `setParam[102]` = `planStaymdStr` | Plan start date (プラン開始年月日) — extracted earlier |
| 104 | SET | `setParam[103]` = `planEndymdStr` | Plan end date (プラン終了年月日) — extracted earlier |
| 105 | SET | `setParam[104]` = `planChrgStaymdStr` | Plan charge start date (プラン課金開始年月日) — extracted earlier |
| 106 | SET | `setParam[105]` = `planChrgEndymdStr` | Plan charge end date (プラン課金終了年月日) — extracted earlier |
| 107 | SET | `setParam[106]` = `PLAN_END_SBT_CD` from map | Plan end subtype code (プラン終了種別コード) |
| 108 | SET | `setParam[107]` = `SVC_CANCEL_YMD` from map | Service cancellation date (サービス取消年月日) |
| 109 | SET | `setParam[108]` = `SVC_CANCEL_RSN_CD` from map | Service cancellation reason code (サービス取消理由コード) |
| 110 | SET | `setParam[109]` = `SVC_STA_KISAN_YMD` from map | Service start early notification date (サービス開始早期通知年月日) |
| 111 | SET | `setParam[110]` = `svcStaymdStr` | Service start date (サービス開始年月日) — extracted earlier |
| 112 | SET | `setParam[111]` = `svcChrgStaymdStr` | Service charge start date (サービス課金開始年月日) — extracted earlier |
| 113 | SET | `setParam[112]` = `SVC_STP_YMD` from map | Service stop date (サービス停止年月日) |
| 114 | SET | `setParam[113]` = `SVCTK_CHU_USE_FAIL_SBT_CD` from map | Service trial use failure subtype code (サービス試用失敗種別コード) |
| 115 | SET | `setParam[114]` = `SVC_STP_RSN_CD` from map | Service stop reason code (サービス停止理由コード) |
| 116 | SET | `setParam[115]` = `SVC_STP_RLS_YMD` from map | Service stop release date (サービス停止解除年月日) |
| 117 | SET | `setParam[116]` = `SVC_STP_RLS_RSN_CD` from map | Service stop release reason code (サービス停止解除理由コード) |
| 118 | SET | `setParam[117]` = `PAUSE_STP_CD` from map | Pause stop code (一時停止停止コード) |
| 119 | SET | `setParam[118]` = `SVC_PAUSE_YMD` from map | Service pause date (サービス一時停止年月日) |
| 120 | SET | `setParam[119]` = `SVC_PAUSE_RSN_CD` from map | Service pause reason code (サービス一時停止理由コード) |
| 121 | SET | `setParam[120]` = `SVC_PAUSE_RSN_MEMO` from map | Service pause reason memo (サービス一時停止理由メモ) |
| 122 | SET | `setParam[121]` = `SVC_PAUSE_RLS_YMD` from map | Service pause release date (サービス一時停止解除年月日) |
| 123 | SET | `setParam[122]` = `SVC_PAUSE_RLS_RSN_CD` from map | Service pause release reason code (サービス一時停止解除理由コード) |
| 124 | SET | `setParam[123]` = `SVC_PAUSE_RLS_RSN_MEMO` from map | Service pause release reason memo (サービス一時停止解除理由メモ) |
| 125 | SET | `setParam[124]` = `svcEndymdStr` | Service end date (サービス終了年月日) — extracted earlier |
| 126 | SET | `setParam[125]` = `svcChrgEndymdStr` | Service charge end date (サービス課金終了年月日) — extracted earlier |
| 127 | SET | `setParam[126]` = `SVC_DSL_YMD` from map | Service DSL date (サービスDSL年月日) |
| 128 | SET | `setParam[127]` = `SVC_DLRE_CD` from map | Service delivery reason code (サービス引渡理由コード) |
| 129 | SET | `setParam[128]` = `SVC_DLRE_MEMO` from map | Service delivery reason memo (サービス引渡理由メモ) |
| 130 | SET | `setParam[129]` = `ZANCHI_FLG` from map | Reservation flag (予約フラグ) |
| 131 | SET | `setParam[130]` = `SVC_DSL_TTDKI_FIN_FLG` from map | Service delivery equipment finish flag (サービス引渡機器完了フラグ) |
| 132 | SET | `setParam[131]` = `KAIHK_YMD` from map | Recovery date (再開年月日) |
| 133 | SET | `setParam[132]` = `SVC_CANCEL_CL_YMD` from map | Service cancellation completion date (サービス取消完了年月日) |
| 134 | SET | `setParam[133]` = `SVC_DSL_CL_YMD` from map | Service DSL completion date (サービスDSL完了年月日) |
| 135 | SET | `setParam[134]` = `SKEKKA_SEND_CD` from map | Settlement sending code (精算送信コード) |
| 136 | SET | `setParam[135]` = `SVC_PAUSE_CHRG_STA_YMD` from map | Service pause charge start date (サービス一時停止課金開始年月日) |
| 137 | SET | `setParam[136]` = `PNLTY_HASSEI_CD` from map | Penalty occurrence code (違約金発生コード) |
| 138 | SET | `setParam[137]` = `KIKI_NINSHO_ID` from map | Equipment recognition ID (機器認証ID) |
| 139 | SET | `setParam[138]` = `KIKI_NINSHO_ID_PWD` from map | Equipment recognition ID password (機器認証IDパスワード) |
| 140 | SET | `setParam[139]` = `idoDiv` | Movement division (異動区分) — **method parameter** |
| 141 | SET | `setParam[140]` = `KKST_JSEKI_UK_YMD` from map | Equipment settlement unknown date (設備精算不明年月日) |
| 142 | SET | `setParam[141]` = `EO_TV_KKST_SNN_STAT_CD` from map | EO TV equipment status code (EO TV設備状態コード) |
| 143 | SET | `setParam[142]` = `KKST_SNN_YMD` from map | Equipment status date (設備状態年月日) |
| 144 | SET | `setParam[143]` = `TAKNKIKI_IDO_CD` from map | Rental equipment movement code (貸与機器異動コード) |
| 145 | SET | `setParam[144]` = `CAS_CARD_USE_KYODAK_YMD` from map | CAS card usage receipt date (CASカード使用受領年月日) |
| 146 | SET | `setParam[145]` = `KIKI_HUKA_INFO_CD` from map | Equipment additional info code (機器追加情報コード) |
| 147 | SET | `setParam[146]` = `SHOSA_DSL_FIN_CD` from map | Inspection DSL completion code (調査DSL完了コード) |
| 148 | SET | `setParam[147]` = `ROUTER_DSL_RSV_TRN_STAT_CD` from map | Router DSL reservation transmission status code (ルーターDSL予約送信状態コード) |
| 149 | SET | `setParam[148]` = `ROUTER_DSL_RSV_TRN_RSLT_CD` from map | Router DSL reservation transmission result code (ルーターDSL予約送信結果コード) |
| 150 | SET | `setParam[149]` = `HAISO_WAY_CD` from map | Delivery method code (配達方法コード) |
| 151 | SET | `setParam[150]` = `KIKI_ITENS_MV_JSSIS_SKCD` from map | Equipment instant move JSSIS branch code (機器即動JSSIS支店コード) |
| 152 | SET | `setParam[151]` = `KAISHU_KIKI_UM` from map | Owned equipment unit cost (所有機器単価) |
| 153 | SET | `setParam[152]` = `HAISO_REQ_SHITEI_YMD` from map | Delivery request designation date (配達要求指定年月日) |
| 154 | SET | `setParam[153]` = `SHKA_FIN_JI_SYRZM_FLG` from map | Handover finish site agreement flag (引渡完了地誓約フラグ) |
| 155 | SET | `setParam[154]` = `SVC_STA_JI_HIS_JOKYO_SKCD` from map | Service start site history situation code (サービス開始地履歴状況支店コード) |
| 156 | SET | `setParam[155]` = `""` | Placeholder (future schema field 1) |
| 157 | SET | `setParam[156]` = `""` | Placeholder (future schema field 2) |
| 158 | SET | `setParam[157]` = `""` | Placeholder (future schema field 3) |
| 159 | SET | `setParam[158]` = `""` | Placeholder (future schema field 4) |
| 160 | SET | `setParam[159]` = `""` | Placeholder (future schema field 5) |
| 161 | SET | `setParam[160]` = `""` | Placeholder (future schema field 6) |
| 162 | SET | `setParam[161]` = `JBSbatKKConst.MK_FLG_YK` (= "0") | Valid flag (有効フラグ) — Contract valid flag [v20.00.00 constant resolution] |
| 163 | SET | `setParam[162]` = `""` | Placeholder (future schema field 7) |
| 164 | SET | `setParam[163]` = `""` | Placeholder (future schema field 8) |
| 165 | SET | `setParam[164]` = `""` | Placeholder (future schema field 9) |
| 166 | SET | `setParam[165]` = `""` | Placeholder (future schema field 10) |
| 167 | SET | `setParam[166]` = `""` | Placeholder (future schema field 11) |
| 168 | SET | `setParam[167]` = `""` | Placeholder (future schema field 12) |
| 169 | SET | `setParam[168]` = `HCPRD_STAD_SNSTSTD_YMD` from map | Trial period start notification start date (試用期間開始通知開始年月日) [v9.00.00 added] |
| 170 | SET | `setParam[169]` = `HCPRD_STAD_SNSTSTD_YMD_IKF` from map | Trial period start notification start date (first) [v10.00.00 modified] |
| 171 | SET | `setParam[170]` = `HCPRD_STAD_SNSTSTD_YMD_SCD` from map | Trial period start notification start date (second) [v10.00.00 modified] |

**Block 1.2** — [PERSISTENCE DELEGATION] (L12402)

> Pass the assembled parameter array to the primary-key-insert method.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `executeKK_T_KKTK_SVC_KEI_PKINSERT(setParam)` | Insert new equipment provision service contract record into `KK_T_KKTK_SVC_KEI` table with primary-key generation |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `KK_T_KKTK_SVC_KEI` | Table | Equipment Provision Service Contract table — stores records for all equipment-provided service contracts (Internet, TV, bundled services) including equipment details, dates, addresses, and status codes. |
| `KKTk_SVC_KEI_NO` | Field | Equipment provision service contract number — the unique contract identifier (primary key) for the KK_T_KKTK_SVC_KEI table. |
| `KKTK_SVC_CD` | Field | Equipment provision service code — classifies the type of equipment-provided service (e.g., Internet, Cable TV, bundled). |
| `SVC_STA_YMD` | Field | Service start date (サービス開始年月日) — the date when the service contract becomes active and the customer begins receiving service. |
| `SVC_CHRG_STAYMD` | Field | Service charge start date (サービス課金開始年月日) — the date when billing for the service begins. May differ from the service start date due to trial periods or prorated billing. |
| `SVC_ENDYMD` | Field | Service end date (サービス終了年月日) — the date when the service contract terminates. |
| `SVC_CHRG_ENDYMD` | Field | Service charge end date (サービス課金終了年月日) — the date when billing for the service ends. |
| `PLAN_STAYMD` | Field | Plan start date (プラン開始年月日) — the date when the associated billing plan becomes effective. |
| `PLAN_ENDYMD` | Field | Plan end date (プラン終了年月日) — the date when the associated billing plan expires. |
| `PLAN_CHRG_STAYMD` | Field | Plan charge start date (プラン課金開始年月日) — the date when plan-level billing begins. |
| `PLAN_CHRG_ENDYMD` | Field | Plan charge end date (プラン課金終了年月日) — the date when plan-level billing ends. |
| `keiCncYmd` | Field | Contract completion date (契約締結年月日) — the date the service contract was formally concluded. Populated from the batch operational date (`opeDate`). |
| `MSKM_DtlNo` | Field | Application detail number (申請明細番号) — links the contract record to a specific line item in the batch application. |
| `idoDiv` | Field | Movement division (異動区分) — classifies the type of contract change (new, transfer, modification, cancellation). |
| `CD00056_KKTK_SVC_KEI_STAT_030` | Constant | Contract status code "030" — Contract Completed (契約済み). Set at record creation to indicate the contract is finalized. [v20.00.00: replaced hardcoded "030"] |
| `MK_FLG_YK` | Constant | Valid flag (有効フラグ) — "0" means the record is valid/active. Used to distinguish active records from cancelled or deleted ones. [v20.00.00: replaced hardcoded "0"] |
| `super.opeDate` | Field | Operational date (運用日) — the business date set at the batch job level, used for contract completion date and reservation application date. Inherited from the parent class. |
| `SVC_KEI_UCWK_NO` | Field | Service contract detail number (サービス契約内訳番号) — the sub-identification number for individual contract line items within a parent contract. |
| `KKTK_SBT_CD` | Field | Equipment provision subtype code (機器提供種別コード) — classifies how the equipment is provided (rental, purchase, lease, etc.). |
| `HAMBAI_SBT_CD` | Field | Sales subtype code (販売種別コード) — classifies the sales channel or method for the service. |
| `KIKI_SOHUS_NM` | Field | Equipment owner name (機器所有者名称) — the name of the entity that owns the provided equipment. |
| `KIKI_SOHUS_AD_CD` | Field | Equipment owner address code (機器所有者住所コード) — the registered address of the equipment owner. |
| `KIKI_STC_SAKI_NM` | Field | Equipment installation work name (機器施工名称) — the name/location where equipment installation work is performed. |
| `HAISO_DIV` | Field | Delivery division (配達区分) — classifies the type of equipment delivery (home delivery, store pickup, etc.). |
| `HAISO_KIGEN_YMD` | Field | Delivery deadline date (配達期限年月日) — the deadline by which equipment delivery must be completed. |
| `FTRIAL_KANYU_YMD` | Field | Free trial insertion date (無料試訳入年月日) — the date the free trial period begins. |
| `FTRIAL_PRD_ENDYMD` | Field | Free trial period end date (無料試用期間終了年月日) — the date the free trial period ends. |
| `HONKANYU_YMD` | Field | Formal installation date (本設置年月日) — the date the equipment is permanently installed. |
| `HOSHO_CD` | Field | Guarantee code (保証コード) — indicates the type of warranty/guarantee coverage on the equipment. |
| `SVC_PAUSE_YMD` | Field | Service pause date (サービス一時停止年月日) — the date when the service is temporarily suspended. |
| `SVC_PAUSE_RSN_CD` | Field | Service pause reason code (サービス一時停止理由コード) — the reason for the service pause. |
| `PNLTY_HASSEI_CD` | Field | Penalty occurrence code (違約金発生コード) — indicates whether a cancellation penalty applies. |
| `KIKI_NINSHO_ID` | Field | Equipment recognition ID (機器認証ID) — the authentication identifier for the equipment. |
| `KIKI_NINSHO_ID_PWD` | Field | Equipment recognition ID password (機器認証IDパスワード) — the password for equipment authentication. |
| `LINK_STB_FLG` | Field | Link STB flag (リンクSTBフラグ) — indicates whether the Set-Top-Box is linked to the service. |
| `EO_TV_KKST_SNN_STAT_CD` | Field | EO TV equipment status code (EO TV設備状態コード) — the status code for EO TV equipment. |
| `TAKNKIKI_IDO_CD` | Field | Rental equipment movement code (貸与機器異動コード) — classifies the type of rental equipment movement (transfer, return, exchange). |
| `ROUTER_DSL_RSV_TRN_STAT_CD` | Field | Router DSL reservation transmission status code (ルーターDSL予約送信状態コード) — the status of router DSL reservation data transmission. |
| `SVC_DLRE_CD` | Field | Service delivery reason code (サービス引渡理由コード) — the reason for service handover. |
| `ZANCHI_FLG` | Field | Reservation flag (予約フラグ) — indicates whether the record is a reservation (pending) or confirmed. |
| `JBSbatStringUtil.Rtrim` | Method | Utility method that trims trailing whitespace from a string. Called on every extracted field for data normalization. |
| `JCCBatCommon.getSysDateTimeStamp` | Method | Utility method that returns the current system date/time as a formatted string for audit trail purposes. |
| `executeKK_T_KKTK_SVC_KEI_PKINSERT` | Method | Internal persistence method that performs the SQL INSERT into KK_T_KKTK_SVC_KEI with primary-key generation. Accepts a 99-element Object array mapped positionally to table columns. |
| v20.00.00 | Version | Refactoring version that standardized hardcoded string literals ("030", "0") into named constants (`CD00056_KKTK_SVC_KEI_STAT_030`, `MK_FLG_YK`) for maintainability. |
| v9.00.00 | Version | Added trial period start/summary notification date fields to the insert parameter array. |
| v10.00.00 | Version | Modified trial period fields to split into separate start and summary columns (`_IKF` and `_SCD` suffixes). |
