# Business Logic — JBSbatKKKjFinDataInTrn.insertKktkSvcKeiTakinoRouter() [548 LOC]

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

## 1. Role

### JBSbatKKKjFinDataInTrn.insertKktkSvcKeiTakinoRouter()

This method performs **equipment-provided service contract registration** (機器提供サービス契約登録処理) — the core batch processing step that persists a complete record into the `KK_T_KKTK_SVC_KEI` (Equipment-Provided Service Contract) database table. It acts as a **data aggregator and delegator**: it receives a pre-queried service contract record (via `JBSbatCommonDBInterface`), normalizes and resolves date fields based on the contract's status, assembles a 133-element parameter array covering every column of the target table (including device info, installation address, billing dates, pause/cancel status, and guarantee data), and delegates the actual SQL insert to `executeKK_T_KKTK_SVC_KEI_PKINSERT()`.

The method supports two distinct service contract statuses defined by the `kktkSvcKeiStat` parameter: **"030" (Contract Concluded / 締結済)** — where all date fields are read directly from the source map because the contract is already fully signed, and **"100" (Service in Progress / サービス提供中)** — where date fields follow fallback logic: if the source map contains no service start date, it uses the plan dates passed as method parameters and assigns a placeholder end date of `20991231` (far-future sentinel for "not yet ended"). If the source map does contain data, it reads the dates directly from the map.

The design pattern used is **data assembly + delegation**: the method never executes SQL itself; it maps fields, computes derived values, and delegates to a dedicated insert method. This is the primary entry point for new service contract creation in the `KjFinDataIn` (Kj Financial Data Input) batch process.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["insertKktkSvcKeiTakinoRouter params"])
    GET_SYS_DATE["Get system date sysDate"]
    INIT_VARS["Initialize date variables to empty strings"]
    CHECK_STATUS["kktkSvcKeiStat equals 030"]
    BRANCH_CONCLUDED["Branch: Contract Concluded 030"]
    BRANCH_CONCLUDED_FETCH["Fetch all dates from kktkSvcKei_map"]
    BRANCH_CONCLUDED_KEICNC["Set keiCncYmd = opeDate"]
    BRANCH_ACTIVE["Branch: Service in Progress"]
    DEBUG_LOGS["Debug logs for planStaymd2 and planChrgStaymd2"]
    CHECK_KEICNC["keiCncYmd empty"]
    SET_KEICNC_OPE["keiCncYmd = opeDate"]
    SET_KEICNC_MAP["keiCncYmd = map.keiCncYmd"]
    CHECK_SVC_DATE["svcStaymdStr empty"]
    SET_SVC_DEFAULTS["svc dates from plan params with 20991231 defaults"]
    SET_SVC_FROM_MAP["svc dates from map"]
    CHECK_PLAN_DATE["planStaymdStr empty"]
    SET_PLAN_DEFAULTS["plan dates from plan params with 20991231 defaults"]
    SET_PLAN_FROM_MAP["plan dates from map"]
    BUILD_PARAMS["Build setParam array from map fields"]
    CALL_INSERT["executeKK_T_KKTK_SVC_KEI_PKINSERT setParam"]
    END_NODE(["Return"])

    START --> GET_SYS_DATE --> INIT_VARS --> CHECK_STATUS
    CHECK_STATUS -->|Yes| BRANCH_CONCLUDED
    CHECK_STATUS -->|No| BRANCH_ACTIVE

    BRANCH_CONCLUDED --> BRANCH_CONCLUDED_FETCH --> BRANCH_CONCLUDED_KEICNC --> BUILD_PARAMS
    BRANCH_ACTIVE --> DEBUG_LOGS --> CHECK_KEICNC
    CHECK_KEICNC -->|Yes| SET_KEICNC_OPE
    CHECK_KEICNC -->|No| SET_KEICNC_MAP
    SET_KEICNC_OPE --> CHECK_SVC_DATE
    SET_KEICNC_MAP --> CHECK_SVC_DATE
    CHECK_SVC_DATE -->|Yes| SET_SVC_DEFAULTS
    CHECK_SVC_DATE -->|No| SET_SVC_FROM_MAP
    SET_SVC_DEFAULTS --> CHECK_PLAN_DATE
    SET_SVC_FROM_MAP --> CHECK_PLAN_DATE
    CHECK_PLAN_DATE -->|Yes| SET_PLAN_DEFAULTS
    CHECK_PLAN_DATE -->|No| SET_PLAN_FROM_MAP
    SET_PLAN_DEFAULTS --> BUILD_PARAMS
    SET_PLAN_FROM_MAP --> BUILD_PARAMS
    BUILD_PARAMS --> CALL_INSERT --> END_NODE
```

**CRITICAL — Constant Resolution:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|------------------|
| `JBSbatKKConst.CD00056_KKTK_SVC_KEI_STAT_030` | `"030"` | Contract Concluded (締結済) — the service contract has been fully signed and executed |
| `JBSbatKKConst.MK_FLG_YK` | `"0"` | Mark flag default value (YK = 有効/unused, meaning the flag is inactive) |

The flowchart conditions are labeled with the resolved constant values rather than the raw constant references, making the business intent immediately clear.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `kktkSvcKei_map` | `JBSbatCommonDBInterface` | Pre-queried equipment-provided service contract record. This interface acts as a key-value map where every database column of `KK_T_KKTK_SVC_KEI` can be retrieved by its field name constant. Contains all device info, service dates, contract status codes, installation addresses, and billing parameters for the service contract being registered. |
| 2 | `kktkSvcKeiStat` | `String` | Equipment-provided service contract status code that determines the data resolution strategy. Can be `"030"` (Contract Concluded / 締結済) or `"100"` (Service in Progress / サービス提供中). When `"030"`, all dates come directly from the map. When `"100"`, the method applies fallback logic using plan parameters. |
| 3 | `planStaymd2` | `String` | Plan start date (YYYYMMDD format). Used as the **fallback** for service start date and plan start date when the source map returns null/empty values during "Service in Progress" (status `"100"`) processing. Represents the originally planned service activation date from the plan data. |
| 4 | `planChrgStaymd2` | `String` | Plan billing start date (YYYYMMDD format). Used as the **fallback** for service billing start date and plan billing start date when the source map returns null/empty values during "Service in Progress" processing. Represents the originally planned billing activation date. |

**Instance fields read by the method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `super.opeDate` | `String` | Operational date from the parent class — used as `keiCncYmd` (contract conclusion date) and as the reservation application date (予約適用年月日). Represents the current batch run date for audit purposes. |

## 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 | - | Retrieves the current system timestamp for use as the system date in the insert record |
| R | `JBSbatStringUtil.Rtrim` | JBSbatStringUtil | - | Trims whitespace from map field values (called ~100+ times across the setParam array) |
| R | `JBSbatKK_T_KKTK_SVC_KEI.getString` | KK_T_KKTK_SVC_KEI | KK_T_KKTK_SVC_KEI | Reads all 100+ field values from the input map interface using field name constants from the table definition class |
| C | `executeKK_T_KKTK_SVC_KEI_PKINSERT` | KK_T_KKTK_SVC_KEI | KK_T_KKTK_SVC_KEI | Inserts the assembled 133-element parameter array as a new row into the equipment-provided service contract table. Primary key insert. |
| - | `super.logPrint.printDebugLog` | JACBatDebugLogUtil | - | Debug logging of plan dates during the "Service in Progress" branch (only executed when status is not "030") |

**Classification rationale:**

- **R (Read)**: The method extensively reads from `kktkSvcKei_map` via `getString()` calls to extract every column value from the pre-queried service contract record. System date is read from `JCCBatCommon.getSysDateTimeStamp()`. `Rtrim` is called on every extracted value to normalize whitespace.
- **C (Create)**: The single terminal operation is `executeKK_T_KKTK_SVC_KEI_PKINSERT(setParam)`, which performs a primary-key-based INSERT into `KK_T_KKTK_SVC_KEI`. This is the core data persistence operation.
- No UPDATE or DELETE operations occur in this method.

## 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` [-] |

### Call Chain

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JBSbatKKKjFinDataInTrn.execute()` | `execute()` -> PK select `KK_T_KKTK_SVC_KEI` -> (status 020) `insertKktkSvcKeiTakinoRouter(kktkSvcKei_map, "030", planStaymd2, planChrgStaymd2)` OR (status 100) `insertKktkSvcKeiTakinoRouter(kktkSvcKei_map, "100", planStaymd2, planChrgStaymd2)` | `executeKK_T_KKTK_SVC_KEI_PKINSERT [C] KK_T_KKTK_SVC_KEI` |
| 2 | `JBSbatKKKjFinDataInTrn.execute()` (recursive self-call) | `execute()` -> `insertKktkSvcKeiTakinoRouter(kktkSvcKei_map, JBSbatKKConst.CD00056_KKTK_SVC_KEI_STAT_030, planStaymd2, planChrgStaymd2)` | `executeKK_T_KKTK_SVC_KEI_PKINSERT [C] KK_T_KKTK_SVC_KEI` |

**Caller context:** The `execute()` method of `JBSbatKKKjFinDataInTrn` performs a primary-key SELECT on `KK_T_KKTK_SVC_KEI`, then calls `insertKktkSvcKeiTakinoRouter()` twice — once for status `"020"` (which passes `"030"` as the inner status) and once for status `"100"` (Service in Progress). Each call passes the pre-queried map along with plan dates. The method itself has no external caller beyond the parent class's `execute()` entry point, making it an internal batch processing step within the Kj Fin Data Input job.

## 6. Per-Branch Detail Blocks

### Block 1 — INITIALIZATION (L13232)

> Acquire system date and initialize all date variables to empty strings. This sets the baseline before any conditional logic.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `sysDate = JCCBatCommon.getSysDateTimeStamp()` |
| 2 | SET | `svcChrgStaymdStr = ""` (サービス課金開始年月日 / Service billing start date) |
| 3 | SET | `svcEndymdStr = ""` (サービス終了年月日 / Service end date) |
| 4 | SET | `svcChrgEndymdStr = ""` (サービス課金終了年月日 / Service billing end date) |
| 5 | SET | `planChrgStaymdStr = ""` (プラン課金開始年月日 / Plan billing start date) |
| 6 | SET | `planEndymdStr = ""` (プラン終了年月日 / Plan end date) |
| 7 | SET | `planChrgEndymdStr = ""` (プラン課金終了年月日 / Plan billing end date) |
| 8 | SET | `keiCncYmd = ""` (契約締結年月日 / Contract conclusion date) |

**Note:** Lines 13244–13247 (ANK-4315-00-00 DEL) contain commented-out code that previously read `TAKNKIKI_SBT_CD` (equipment subtype code) — this was removed in a version change.

### Block 2 — INITIAL DATE FIELD EXTRACTION (L13251–13260)

> Before the status-based branching, fetch the base service start date and plan start date from the map. These values serve as the initial values that may be overridden by the branch-specific logic below.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcStaymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.SVC_STA_YMD))` (サービス開始年月日 / Service start date) |
| 2 | SET | `planStaymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.PLAN_STAYMD))` (プラン開始年月日 / Plan start date) |

### Block 3 — STATUS BRANCH: "030" Contract Concluded (L13265–13293)

> When `kktkSvcKeiStat` equals `"030"` (Contract Concluded / 締結済), all date fields are fetched directly from the input map. The contract conclusion date (`keiCncYmd`) is set to the operational date (`opeDate`), reflecting that the contract has been formally executed. This is the simpler path — no fallback logic is needed because the source data is authoritative.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcStaymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.SVC_STA_YMD))` — Services start date from map |
| 2 | SET | `svcChrgStaymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.SVC_CHRG_STAYMD))` — Service billing start date from map |
| 3 | SET | `svcEndymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.SVC_ENDYMD))` — Service end date from map |
| 4 | SET | `svcChrgEndymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.SVC_CHRG_ENDYMD))` — Service billing end date from map |
| 5 | SET | `planStaymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.PLAN_STAYMD))` — Plan start date from map |
| 6 | SET | `planChrgStaymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.PLAN_CHRG_STAYMD))` — Plan billing start date from map |
| 7 | SET | `planEndymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.PLAN_ENDYMD))` — Plan end date from map |
| 8 | SET | `planChrgEndymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.PLAN_CHRG_ENDYMD))` — Plan billing end date from map |
| 9 | SET | `keiCncYmd = super.opeDate` — Contract conclusion date set to operational date (運用手 / operation date) |

### Block 4 — STATUS BRANCH: Not "030" — Service in Progress (L13298–13384)

> When `kktkSvcKeiStat` is NOT `"030"` (i.e., status `"100"`: Service in Progress / サービス提供中), the method applies a two-layer fallback strategy. First, it logs the incoming plan dates to debug output. Then, for each date category (contract conclusion, service dates, plan dates), it checks if the source is empty and falls back to the plan parameters or assigns a sentinel end date of `"20991231"` (far-future placeholder meaning "not ended").

#### Block 4.1 — Contract Conclusion Date Resolution (L13299–13311)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `super.logPrint.printDebugLog(" ルール：75取得値（開始日）" + planStaymd2)` — Debug logging |
| 2 | EXEC | `super.logPrint.printDebugLog(" ルール：67取得値（課金開始日）" + planChrgStaymd2)` — Debug logging |
| 3 | IF | `"".equals(JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.KEI_CNC_YMD)))` — Check if contract conclusion date is empty |

##### Block 4.1.1 — Contract Conclusion Date is empty (L13302–13304)

| # | Type | Code |
|---|------|------|
| 1 | SET | `keiCncYmd = super.opeDate` — Use operational date as contract conclusion date |

##### Block 4.1.2 — Contract Conclusion Date has value (L13306–13308)

| # | Type | Code |
|---|------|------|
| 1 | SET | `keiCncYmd = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.KEI_CNC_YMD))` — Use the value from the source map |

#### Block 4.2 — Service Date Resolution (L13314–13355)

| # | Type | Code |
|---|------|------|
| 1 | IF | `isEmpty(svcStaymdStr)` — Check if service start date is empty or null |

##### Block 4.2.1 — Service Start Date is empty (L13318–13328)

> When the source map has no service start date, use the plan parameters passed as method arguments. Set end dates to `"20991231"` (far-future sentinel indicating the service has not yet ended).

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcStaymdStr = planStaymd2` — Service start date = plan start date from parameter |
| 2 | SET | `svcChrgStaymdStr = planChrgStaymd2` — Service billing start date = plan billing start date from parameter |
| 3 | SET | `svcEndymdStr = "20991231"` — Service end date = far-future sentinel (not ended) |
| 4 | SET | `svcChrgEndymdStr = "20991231"` — Service billing end date = far-future sentinel (not ended) |

##### Block 4.2.2 — Service Start Date has data (L13334–13355)

> When the source map contains service date data, read all four service date fields directly from the map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcStaymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.SVC_STA_YMD))` |
| 2 | SET | `svcChrgStaymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.SVC_CHRG_STAYMD))` |
| 3 | SET | `svcEndymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.SVC_ENDYMD))` |
| 4 | SET | `svcChrgEndymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.SVC_CHRG_ENDYMD))` |

#### Block 4.3 — Plan Date Resolution (L13358–13384)

| # | Type | Code |
|---|------|------|
| 1 | IF | `isEmpty(planStaymdStr)` — Check if plan start date is empty or null |

##### Block 4.3.1 — Plan Start Date is empty (L13363–13373)

> When the source map has no plan start date, use the plan parameters passed as method arguments. Set end dates to `"20991231"`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `planStaymdStr = planStaymd2` — Plan start date from parameter |
| 2 | SET | `planChrgStaymdStr = planChrgStaymd2` — Plan billing start date from parameter |
| 3 | SET | `planEndymdStr = "20991231"` — Plan end date = far-future sentinel |
| 4 | SET | `planChrgEndymdStr = "20991231"` — Plan billing end date = far-future sentinel |

##### Block 4.3.2 — Plan Start Date has data (L13378–13384)

> When the source map contains plan date data, read all four plan date fields directly from the map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `planStaymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.PLAN_STAYMD))` |
| 2 | SET | `planChrgStaymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.PLAN_CHRG_STAYMD))` |
| 3 | SET | `planEndymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.PLAN_ENDYMD))` |
| 4 | SET | `planChrgEndymdStr = JBSbatStringUtil.Rtrim(kktkSvcKei_map.getString(JBSbatKK_T_KKTK_SVC_KEI.PLAN_CHRG_ENDYMD))` |

### Block 5 — PARAMETER ASSEMBLY (L13389–13529)

> Assemble the 133-element `setParam` array that will be passed to the INSERT operation. Each element corresponds to one column of the `KK_T_KKTK_SVC_KEI` table. The method reads every field from the input `kktkSvcKei_map`, applies `Rtrim()` for whitespace normalization, and includes several pre-computed date variables (svcStaymdStr, planStaymdStr, etc.) and the `MK_FLG_YK = "0"` constant.

The parameter array in order (with resolved constants shown):

| # | Code Source | Business Field |
|---|------------|----------------|
| 1 | `map.getString(KKTK_SVC_KEI_NO)` | Equipment-provided service contract number |
| 2 | `sysDate` | System date (registered timestamp) |
| 3 | `kktkSvcKeiStat` | Contract status (030 or 100) |
| 4 | `map.getString(KKTK_SVC_CD)` | Equipment-provided service code |
| 5 | `map.getString(PCRS_CD)` | Service package code |
| 6 | `map.getString(PPLAN_CD)` | Plan code |
| 7 | `map.getString(TK_HOSHIKI_KEI_NO)` | Telecommunications equipment contract number |
| 8 | `map.getString(KKTK_SBT_CD)` | Equipment-provided subtype code |
| 9 | `map.getString(HAMBAI_SBT_CD)` | Sales subtype code |
| 10 | `map.getString(SVC_USE_STA_KIBO_YMD)` | Service use start desired date |
| 11 | `map.getString(RSV_TSTA_KIBO_YMD)` | Reservation test start desired date |
| 12 | `map.getString(KIBO_MAKER_CD)` | Desired maker code |
| 13 | `map.getString(KIKI_SHITEI_SBT_CD)` | Equipment designation subtype code |
| 14 | `map.getString(TAKNKIKI_SBT_CD)` | Rental equipment subtype code |
| 15 | `map.getString(TAKNKIKI_MODEL_CD)` | Rental equipment model code |
| 16 | `map.getString(KIKI_SEIZO_NO)` | Equipment manufacturing number |
| 17 | `map.getString(HUZOKUHIN_SBT_CD)` | Attached goods subtype code |
| 18 | `map.getString(HUZOKUHIN_MODEL_CD)` | Attached goods model code |
| 19 | `map.getString(TAKNKIKI_SETHIN_MODEL_CD)` | Rental equipment set product model code |
| 20 | `map.getString(KIKI_CHG_NO)` | Equipment change number |
| 21 | `map.getString(KIKI_CHG_RSN_CD)` | Equipment change reason code |
| 22 | `map.getString(TSUSHIN_KIKI_SET_CD)` | Communication equipment set code |
| 23 | `map.getString(HDD_CAPA_CD)` | HDD capacity code |
| 24 | `map.getString(KIKI_STC_SAKI_PLACE_NO)` | Equipment installation destination place number |
| 25 | `map.getString(OYA_KEI_SKBT_CD)` | Parent contract subtype code |
| 26 | `map.getString(SVC_KEI_NO)` | Service contract number |
| 27 | `map.getString(SVC_KEI_UCWK_NO)` | Service detail work number |
| 28 | `map.getString(SVC_KEI_KAISEN_UCWK_NO)` | Service contract circuit work number (old route) |
| 29 | `map.getString(OP_SVC_KEI_NO)` | Optional service contract number |
| 30 | `map.getString(SYSID)` | System ID |
| 31 | `map.getString(MSKM_DTL_NO)` | Masking detail number |
| 32 | `map.getString(LINK_STB_FLG)` | Link STB flag |
| 33 | `map.getString(KIKI_HKAT_SHITEI_SOKO_CD)` | Equipment hook-up designation location code |
| 34 | `map.getString(KIKI_HKAT_SHITEI_SKDN_CD)` | Equipment hook-up designation store code |
| 35 | `map.getString(KIKI_STI_JI_KRIPLACE_SKCD)` | Equipment installation address region code |
| 36 | `map.getString(KIKI_STI_JI_KOCOMP_CD)` | Equipment installation address co-location code |
| 37 | `map.getString(KIKI_STI_JI_KOCOMP_SLF_CD)` | Equipment installation address co-location self code |
| 38 | `map.getString(KIKI_STI_JI_YTKSKOF_CD)` | Equipment installation address branch code |
| 39 | `map.getString(KIKI_STI_JI_YTKSKOF_SLF_CD)` | Equipment installation address branch self code |
| 40 | `map.getString(KKTK_SVC_KEI_HKHASYMD)` | Equipment-provided service contract start date |
| 41 | `map.getString(KIKI_SORYO_UM)` | Equipment total cost (unit multiplier) |
| 42 | `map.getString(KIKI_SORYO_SAKSEI_YMD)` | Equipment total cost creation date |
| 43–53 | `map.getString(KIKI_SOHUS_*)` | Equipment owner info: name, kana, address, postal code, state, city, block, district, building, phone |
| 54 | `map.getString(KIKI_SHS_AD_MAN_INPUT_FLG)` | Equipment owner address manual input flag |
| 55 | `map.getString(MANSION_BUKKEN_NO)` | Mansion property number |
| 56 | `map.getString(KIKI_SOHUS_KSH_AD_SAI_FLG)` | Equipment owner address reconfirmation flag |
| 57 | `map.getString(KIKI_SHS_KBT_SHITEI_FLG)` | Equipment owner billing designation flag |
| 58–60 | `map.getString(KIKI_SHS_HSK_CD_*)` | Equipment owner billing info: codes 1-2, memo |
| 61–71 | `map.getString(KIKI_STC_SAKI_*)` | Equipment installation destination info: name, kana, address, postal code, state, city, block, district, building, phone, reconfirmation flag |
| 72 | `map.getString(KIKI_STS_KKK_SEIRI_CHU_FLG)` | Equipment status processing intermediate flag |
| 73 | `map.getString(AD_MI_FIX_FLG)` | Address mileage fix flag |
| 74 | `map.getString(AUTO_ADD_CD)` | Auto-add code |
| 75 | `map.getString(AD_MI_FIX_RLS_YMD)` | Address mileage fix release date |
| 76 | `map.getString(CHRG_STA_YMD_HOSEI_UM)` | Billing start date adjustment unit multiplier |
| 77–79 | `map.getString(KIKI_STS_HSK_*)` | Equipment status billing: codes 1-2, memo |
| 80 | `map.getString(KKTK_SVC_KEI_KZKWRK_REQYMD)` | Equipment-provided service detail work request date |
| 81 | `map.getString(SHOSA_YMD)` | Maintenance date |
| 82 | `map.getString(SHOSA_CL_YMD)` | Maintenance completion date |
| 83 | `map.getString(HAISO_DIV)` | Delivery division |
| 84 | `map.getString(HAISO_KIGEN_YMD)` | Delivery deadline date |
| 85 | `map.getString(HAISO_ARIV_SHITEI_YMD)` | Delivery arrival designation date |
| 86 | `map.getString(FTRIAL_KANYU_YMD)` | Free trial entry date |
| 87 | `map.getString(FTRIAL_PRD_ENDYMD)` | Free trial period end date |
| 88 | `map.getString(HONKANYU_YMD)` | Actual entry date |
| 89 | `map.getString(HONKANYU_IKO_KIGEN_YMD)` | Actual entry following deadline date |
| 90 | `keiCncYmd` | Contract conclusion date (resolved above) |
| 91 | `map.getString(JCCC_KANYU_BUNSHO_YMD)` | JCCC entry document date |
| 92 | `map.getString(HOSHO_CD)` | Guarantee code |
| 93 | `map.getString(KKTK_SVKEI_HOKI)` | Equipment-provided service coverage |
| 94 | `map.getString(HOSHO_STAYMD)` | Guarantee start date |
| 95 | `map.getString(HOSHO_END_YMD)` | Guarantee end date |
| 96 | `super.opeDate` | Reservation application date (operational date) |
| 97 | `map.getString(RSV_CL_YMD)` | Reservation completion date |
| 98 | `map.getString(RSV_APLY_CD)` | Reservation application code |
| 99 | `map.getString(KIKI_CHG_YMD)` | Equipment change date |
| 100 | `planStaymdStr` | Plan start date (resolved above) |
| 101 | `planEndymdStr` | Plan end date (resolved above) |
| 102 | `planChrgStaymdStr` | Plan billing start date (resolved above) |
| 103 | `planChrgEndymdStr` | Plan billing end date (resolved above) |
| 104 | `map.getString(PLAN_END_SBT_CD)` | Plan end subtype code |
| 105 | `map.getString(SVC_CANCEL_YMD)` | Service cancellation date |
| 106 | `map.getString(SVC_CANCEL_RSN_CD)` | Service cancellation reason code |
| 107 | `map.getString(SVC_STA_KISAN_YMD)` | Service start prior notice date |
| 108 | `svcStaymdStr` | Service start date (resolved above) |
| 109 | `svcChrgStaymdStr` | Service billing start date (resolved above) |
| 110 | `map.getString(SVC_STP_YMD)` | Service stop date |
| 111 | `map.getString(SVCTK_CHU_USE_FAIL_SBT_CD)` | Service trial use failure subtype code |
| 112 | `map.getString(SVC_STP_RSN_CD)` | Service stop reason code |
| 113 | `map.getString(SVC_STP_RLS_YMD)` | Service stop release date |
| 114 | `map.getString(SVC_STP_RLS_RSN_CD)` | Service stop release reason code |
| 115 | `map.getString(PAUSE_STP_CD)` | Pause stop code |
| 116 | `map.getString(SVC_PAUSE_YMD)` | Service pause date |
| 117 | `map.getString(SVC_PAUSE_RSN_CD)` | Service pause reason code |
| 118 | `map.getString(SVC_PAUSE_RSN_MEMO)` | Service pause reason memo |
| 119 | `map.getString(SVC_PAUSE_RLS_YMD)` | Service pause release date |
| 120 | `map.getString(SVC_PAUSE_RLS_RSN_CD)` | Service pause release reason code |
| 121 | `map.getString(SVC_PAUSE_RLS_RSN_MEMO)` | Service pause release reason memo |
| 122 | `svcEndymdStr` | Service end date (resolved above) |
| 123 | `svcChrgEndymdStr` | Service billing end date (resolved above) |
| 124 | `map.getString(SVC_DSL_YMD)` | Service DSL date |
| 125 | `map.getString(SVC_DLRE_CD)` | Service delivery reason code |
| 126 | `map.getString(SVC_DLRE_MEMO)` | Service delivery memo |
| 127 | `map.getString(ZANCHI_FLG)` | Remaining days flag |
| 128 | `map.getString(SVC_DSL_TTDKI_FIN_FLG)` | Service DSL trial period end flag |
| 129 | `map.getString(KAIHK_YMD)` | Reopening date |
| 130 | `map.getString(SVC_CANCEL_CL_YMD)` | Service cancellation completion date |
| 131 | `map.getString(SVC_DSL_CL_YMD)` | Service DSL completion date |
| 132 | `map.getString(SKEKKA_SEND_CD)` | Billing result send code |
| 133 | `map.getString(SVC_PAUSE_CHRG_STA_YMD)` | Service pause billing start date |
| 134 | `map.getString(PNLTY_HASSEI_CD)` | Penalty occurrence code |
| 135 | `map.getString(KIKI_NINSHO_ID)` | Equipment certification ID |
| 136 | `map.getString(KIKI_NINSHO_ID_PWD)` | Equipment certification password |
| 137 | `map.getString(IDO_DIV)` | Transfer division |
| 138 | `map.getString(KKST_JSEKI_UK_YMD)` | Account settlement suspension date |
| 139 | `map.getString(EO_TV_KKST_SNN_STAT_CD)` | EO TV account settlement status code |
| 140 | `map.getString(KKST_SNN_YMD)` | Account settlement status date |
| 141 | `map.getString(TAKNKIKI_IDO_CD)` | Rental equipment transfer code |
| 142 | `map.getString(CAS_CARD_USE_KYODAK_YMD)` | CAS card usage request date |
| 143 | `map.getString(KIKI_HUKA_INFO_CD)` | Equipment additional info code |
| 144 | `map.getString(SHOSA_DSL_FIN_CD)` | Maintenance DSL completion code |
| 145 | `map.getString(ROUTER_DSL_RSV_TRN_STAT_CD)` | Router DSL reservation transfer status code |
| 146 | `map.getString(ROUTER_DSL_RSV_TRN_RSLT_CD)` | Router DSL reservation transfer result code |
| 147 | `map.getString(HAISO_WAY_CD)` | Delivery method code |
| 148 | `map.getString(KIKI_ITENS_MV_JSSIS_SKCD)` | Equipment internal move JSSIS site code |
| 149 | `map.getString(KAISHU_KIKI_UM)` | Disposal equipment cost unit multiplier |
| 150 | `map.getString(HAISO_REQ_SHITEI_YMD)` | Delivery request designation date |
| 151 | `map.getString(SHKA_FIN_JI_SYRZM_FLG)` | Business completion certification flag |
| 152 | `map.getString(SVC_STA_JI_HIS_JOKYO_SKCD)` | Service start site history status site code |
| 153–158 | `""` (empty strings) | Reserved/placeholder fields |
| 159 | `JBSbatKKConst.MK_FLG_YK` = `"0"` | Mark flag (changed from literal `"0"` to constant reference) |
| 160–165 | `""` (empty strings) | Reserved/placeholder fields |
| 166 | `map.getString(HCPRD_STAD_SNSTSTD_YMD)` | High-capacity plan start notification start date |
| 167 | `map.getString(HCPRD_STAD_SNSTSTD_YMD_IKF)` | High-capacity plan start notification start date (first notification) |
| 168 | `map.getString(HCPRD_STAD_SNSTSTD_YMD_SCD)` | High-capacity plan start notification start date (second notification) |

### Block 6 — INSERT DELEGATION (L13532)

> Call the primary key insert method with the assembled parameter array. This is the sole terminal operation of the method — all data preparation is complete.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `executeKK_T_KKTK_SVC_KEI_PKINSERT(setParam)` |

**Note:** Lines 13534–13557 (ANK-4315-00-00 DEL) contain commented-out conditional logic for rental equipment subtype "S0" with status "100" — this previously performed a circuit detail update and ONU-specific insert. This functionality was removed in version 20.00.00.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `kktkSvcKei` | Field | Equipment-provided service contract — a service contract for telecom equipment (router, ONT, STB) provided by the carrier to the subscriber, as opposed to customer-owned equipment |
| `KK_T_KKTK_SVC_KEI` | DB Table | Equipment-provided service contract table — the central database table storing all equipment-provided service contract records, including device info, billing dates, contract status, installation addresses, and pause/cancel history |
| `kktkSvcKeiStat` | Field | Equipment-provided service contract status code — `"030"` = Contract Concluded (締結済), `"100"` = Service in Progress (サービス提供中), `"020"` = Inspection Complete (照查済) |
| `svcStaymdStr` | Field | Service start date (サービス開始年月日) — when the actual service begins for the subscriber |
| `svcChrgStaymdStr` | Field | Service billing start date (サービス課金開始年月日) — when billing for the service commences |
| `svcEndymdStr` | Field | Service end date (サービス終了年月日) — when the service terminates; `"20991231"` is a far-future sentinel indicating "not ended" |
| `svcChrgEndymdStr` | Field | Service billing end date (サービス課金終了年月日) — when billing ceases |
| `planStaymdStr` | Field | Plan start date (プラン開始年月日) — the originally planned service activation date from the subscription plan |
| `planChrgStaymdStr` | Field | Plan billing start date (プラン課金開始年月日) — the originally planned billing start date |
| `planEndymdStr` | Field | Plan end date (プラン終了年月日) — the planned service termination date |
| `planChrgEndymdStr` | Field | Plan billing end date (プラン課金終了年月日) — the planned billing end date |
| `keiCncYmd` | Field | Contract conclusion date (契約締結年月日) — the date the contract was formally signed/executed |
| `opeDate` | Field | Operational date (運用手) — the batch processing date from the parent class, used as the system reference date for audit records |
| `KKTK_SVC_KEI_NO` | Field | Equipment-provided service contract number — the primary key identifier for the service contract |
| `KKTK_SBT_CD` | Field | Equipment-provided subtype code — classifies the type of equipment contract (e.g., router rental, ONU provision) |
| `TAKNKIKI_SBT_CD` | Field | Rental equipment subtype code — distinguishes between different rental equipment categories |
| `SVC_KEI_UCWK_NO` | Field | Service detail work number — internal tracking ID for service contract line items |
| `SVC_KEI_KAISEN_UCWK_NO` | Field | Service contract circuit work number (old route) — tracking ID for previously routed circuit work (now removed) |
| `MK_FLG_YK` | Constant | Mark flag — default value `"0"` (inactive/unused); renamed from literal `"0"` to constant reference in v20.00.00 |
| `JBSbatStringUtil` | Component | String utility class providing `Rtrim()` for right-trimming whitespace from string values |
| `JCCBatCommon` | Component | Common batch utility class providing `getSysDateTimeStamp()` for system timestamp retrieval |
| `20991231` | Constant | Far-future sentinel date — used to indicate "no end date" for active services, following the convention that dates this far in the future represent "not yet terminated" |
| PKINSERT | Operation | Primary Key INSERT — inserts a new row using the primary key and all other columns, as opposed to an auto-generated identity insert |
| 締結済 (kekketsuzumi) | Status | Contract Concluded — the contract has been fully signed and is in effect |
| サービス提供中 | Status | Service in Progress — the service is actively running for the subscriber |
| 照查済 (tesasari-zumi) | Status | Inspection Complete — preliminary inspection of the service request is complete but contract not yet signed |
| ONU | Acronym | Optical Network Unit — the terminal device that terminates fiber-optic service at the subscriber premises |
| STB | Acronym | Set-Top Box — device for receiving and decoding TV signals |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service |
| JCCC | Acronym | Japan Cable Communications Consortium — industry body for cable/telecom service standards |
| HOSHO_CD | Field | Guarantee code — relates to warranty or service guarantee for the equipment |
