# Business Logic — JBSbatKKKjClDataInTrn.equipmentOptionServiceContract() [274 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKKjClDataInTrn` |
| Layer | Service (Batch processing service within the business tier) |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKKjClDataInTrn.equipmentOptionServiceContract()

This method handles the backend processing for a **multi-function router equipment option service contract update** during a batch job. When a customer switches a multi-function router (KKOP = Kiki Option Service Contract) plan — specifically the "eo Hikari Multi-Function Router" service (service code `G01`, pricing code `G01`, plan `PG0101`) — this method orchestrates a cascade of data operations to update and record the change in the order fulfillment system.

The method follows a **delegation + sequential INSERT** pattern: it first reads existing equipment option service contract data from the `T_KKTK_SVC_KEI` table (equipment-provided service contract), retrieves associated service contract details and line information, then performs three key batch insert operations. If a prior equipment option service contract record exists, it **re-inserts the full contract record** with updated timestamps into the `T_KKOP_SVC_KEI` table (creating a new generation/version of the contract), then generates an **SOD (Service Order Data) trigger** via `T_ODR_HAKKO_JOKEN` to notify downstream order processing of the router change, creates an **order information work record** via `T_ODR_INF_SKSI_WK`, and finally logs the processing step in the **progress management table** `T_PRG` with a status indicating the batch is mid-update.

The method is a shared batch utility called by `JBSbatKKKjClDataInTrn.execute()`, making it a critical link in the batch pipeline that processes service contract course changes. It operates on existing contracts only (data existence check required) and always targets the multi-function router equipment option (`KKOP_SVC_CD_G01 = "G01"` — eo Hikari Multi-Function Router, Router function).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["equipmentOptionServiceContract starts"])
    START --> SELECT269["executeKK_T_KKTK_SVC_KEI_KK_SELECT_269(svcKeiKaisenUcwkNo)"]
    SELECT269 --> FETCH269["kkTKktkSvcKei_KkSelect269 = db_KK_T_KKTK_SVC_KEI_269.selectNext()"]
    FETCH269 --> COND269{kkTKktkSvcKei_KkSelect269 != null?}
    COND269 -->|Yes| GET_SYS_DATE["sysDate = JCCBatCommon.getSysDateTimeStamp()"]
    COND269 -->|No| END_NODE["Return"]
    GET_SYS_DATE --> BUILD_PARAMS["Build kkTKkopSvcKei_PkSelectParam[] from select269 result"]
    BUILD_PARAMS --> PKSELECT["executeKK_T_KKOP_SVC_KEI_PKSELECT(kkTKkopSvcKei_PkSelectParam)"]
    PKSELECT --> SELECT139["executeKK_T_SVC_KEI_UCWK_KK_SELECT_139(svcKeiNo)"]
    SELECT139 --> SELECT063["executeKK_T_SVKEI_KAISEN_UW_KK_SELECT_063(svcKeiKaisenUcwkNo)"]
    SELECT063 --> FETCH_RESULTS["Fetch kkTSvcKeiUcwk_KkSelect139, kkTSvkeiKaisenUw_KkSelect063 from db"]
    FETCH_RESULTS --> COND_PKSELECT{kkTKkopSvcKei_PkSelect != null?}
    COND_PKSELECT -->|No| END_NODE2["Return"]
    COND_PKSELECT -->|Yes| INSERT_PK["executeKK_T_KKOP_SVC_KEI_PKINSERT(62 fields)"]
    INSERT_PK --> EXTRACT_063["Extract kkSelect063_SVC_KEI_KAISEN_UCWK_NO, kkSelect063_GENE_ADD_DTM"]
    EXTRACT_063 --> EXTRACT_139["Extract KkSelect139_SVC_KEI_UCWK_NO, KkSelect139_GENE_ADD_DTM"]
    EXTRACT_139 --> SEQ_ODR["odrHakkoJokenNoTakino = getNextSeq(SEQ_ODR_HAKKO_JOKEN_NO) padded to 12"]
    SEQ_ODR --> INSERT_ODR["executeKK_T_ODR_HAKKO_JOKEN_PKINSERT2(setKkTOdrHakkoJoken_PkInsertParam)"]
    INSERT_ODR --> SEQ_ODRINFO["odrInfSksiWkNo = getNextSeq(SEQ_ODR_INF_SKSI_WK_NO) padded to 12"]
    SEQ_ODRINFO --> INSERT_ODRINFO["executeKK_T_ODR_INF_SKSI_WK_PKINSERT2(setKkTOdrInfSksiWk_PkInsertParam)"]
    INSERT_ODRINFO --> SEQ_PRG["prgNo = getNextSeq(SEQ_PRG_NO) padded to 12"]
    SEQ_PRG --> INSERT_PRG["executeKK_T_PRG_PKINSERT(setParam)"]
    INSERT_PRG --> END_NODE3["Return"]
```

**Processing steps:**

1. **Read equipment-provided service contract** (line ~12280): Queries `T_KKTK_SVC_KEI` using the service detail work number to obtain the current router equipment contract data.
2. **Condition check — data existence** (line ~12284): If no contract data exists, the method returns early — no further processing occurs.
3. **Get system timestamp** (line ~12287): Retrieves the current system date-time stamp for use as the generation registration timestamp.
4. **Query equipment option service contract** (line ~12294): Builds a parameter array from the select269 result (contract number + gene add datetime) and calls `executeKK_T_KKOP_SVC_KEI_PKSELECT` to look up the existing equipment option service contract.
5. **Query service contract details and line information** (lines ~12297-12299): Calls `executeKK_T_SVC_KEI_UCWK_KK_SELECT_139` for contract details and `executeKK_T_SVKEI_KAISEN_UW_KK_SELECT_063` for line information using data from the input map and the router work number.
6. **Condition check — prior contract existence** (line ~12303): If no prior equipment option service contract record exists, the method returns — the full update cascade only proceeds when there is an existing contract to update.
7. **Re-insert equipment option service contract** (line ~12308): Inserts a new generation of the equipment option service contract into `T_KKOP_SVC_KEI` with all 62 fields populated — this creates a versioned copy of the contract with the current system date as the registration timestamp. The contract is fixed to service code `G01` (eo Hikari Multi-Function Router), pricing code `G01`, plan `PG0101`, and application code `2` (reservation application).
8. **Extract supplementary contract data** (lines ~12365-12383): Extracts service detail work numbers and generation timestamps from the line information and contract details select results (with null-safety checks).
9. **Generate SOD trigger** (lines ~12386-12442): Generates a unique order trigger condition number from sequence `SEQ_ODR_HAKKO_JOKEN_NO` and inserts a record into `T_ODR_HAKKO_JOKEN` (order trigger condition table) to signal downstream order processing that a router equipment change has occurred. The trigger is classified with order subtype code `2` (equipment option), service order code `26` (router equipment change), requirement subtype `04`, and trigger condition code `01`.
10. **Create order information work record** (lines ~12453-12500): Generates an order information work number from sequence `SEQ_ODR_INF_SKSI_WK_NO` and inserts a detailed work record into `T_ODR_INF_SKSI_WK` that captures the full state of the order — including service contract numbers, generation timestamps, router equipment model codes, and device serial numbers.
11. **Log batch progress** (lines ~12502-12523): Generates a progress number from sequence `SEQ_PRG_NO` and inserts a progress management record into `T_PRG` with status `H001` (processing in progress), movement division from input, movement datetime from `idoDtm`, and a combined batch operation date with system time.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `svcKeiKaisenUcwkNo` | `String` | Service detail work number — an internal tracking identifier for service contract line items. Used as the primary key to query the `T_KKTK_SVC_KEI` table (equipment-provided service contract) and retrieve the existing router equipment configuration. This value flows through multiple queries as the correlation key across all related tables. |
| 2 | `svcKeiGeneAddDtm` | `String` | Service contract generation registration date-time stamp — a string representation of the timestamp when the current version of the service contract was created. Passed through to the order information work table (`T_ODR_INF_SKSI_WK`) to track which generation of the contract is being processed. |
| 3 | `inMap` | `JBSbatServiceInterfaceMap` | Service interface parameter map — a key-value container carrying business data from the calling batch process. Used to extract the service contract number (`SVC_KEI_NO`), application detail number (`MSKM_DTL_NO`), and movement division (`IDO_DIV`). The detail number identifies the specific router plan change application from the course-change intermediate file. |
| 4 | `idoDtm` | `String` | Movement (migration/transfer) date-time stamp — obtained from the common batch processing component. Represents the timestamp of when this migration/change operation was initiated. Stored in the progress management table to track when the batch step was executed. |

**Instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `commonItem.getConnection()` | `Connection` | Database connection for sequence generation (SEQ_ODR_HAKKO_JOKEN_NO, SEQ_SAME_TRN_NO, SEQ_ODR_INF_SKSI_WK_NO, SEQ_PRG_NO) |
| `super.opeDate` | `String` | Batch operation date — the batch run date, used in combination with the system timestamp to construct the progress date-time stamp |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `executeKK_T_KKTK_SVC_KEI_KK_SELECT_269` | - | `T_KKTK_SVC_KEI` (Equipment-provided Service Contract) | Reads the equipment-provided service contract record for the given service detail work number |
| R | `JCCBatCommon.getSysDateTimeStamp` | - | System | Retrieves current system date-time stamp |
| R | `executeKK_T_KKOP_SVC_KEI_PKSELECT` | - | `T_KKOP_SVC_KEI` (Equipment Option Service Contract) | Looks up the existing equipment option service contract by contract number and generation timestamp |
| R | `executeKK_T_SVC_KEI_UCWK_KK_SELECT_139` | - | `T_SVC_KEI_UCWK` (Service Contract Details) | Retrieves service contract detail information by service contract number |
| R | `executeKK_T_SVKEI_KAISEN_UW_KK_SELECT_063` | - | `T_SVKEI_KAISEN_UW` (Service Contract Line Information) | Retrieves service contract line information by service detail work number |
| C | `executeKK_T_KKOP_SVC_KEI_PKINSERT` | - | `T_KKOP_SVC_KEI` (Equipment Option Service Contract) | Inserts a new generation/version of the equipment option service contract with 62 fields, fixed to multi-function router plan G01/PG0101 |
| C | `executeKK_T_ODR_HAKKO_JOKEN_PKINSERT2` | - | `T_ODR_HAKKO_JOKEN` (Order Trigger Condition) | Inserts an SOD (Service Order Data) trigger record to notify downstream of a router equipment change (order condition code 01) |
| C | `executeKK_T_ODR_INF_SKSI_WK_PKINSERT2` | - | `T_ODR_INF_SKSI_WK` (Order Information Work) | Inserts a work record capturing the full order state including router model code, device serial number, and all contract generation data |
| C | `executeKK_T_PRG_PKINSERT` | - | `T_PRG` (Progress Management) | Logs the batch processing step in the progress management table with status H001 (processing in progress) |
| - | `JBSbatOracleSeqUtil.getNextSeq` | - | Sequence (DB) | Generates next values for 4 sequences: SEQ_ODR_HAKKO_JOKEN_NO, SEQ_SAME_TRN_NO, SEQ_ODR_INF_SKSI_WK_NO, SEQ_PRG_NO |
| - | `JBSbatStringUtil.padNumFormString` | - | - | Pads numeric strings to 12 characters for uniform formatting of generated numbers |
| - | `JBSbatCommonDBInterface.getString` | - | - | Extracts field values from database result sets |
| - | `String.substring` | - | - | Extracts time portion (last 6 characters) from system date-time stamp for progress timestamp construction |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatKKKjClDataInTrn.execute() | `JBSbatKKKjClDataInTrn.execute()` -> `equipmentOptionServiceContract(svcKeiKaisenUcwkNo, svcKeiGeneAddDtm, inMap, idoDtm)` | `executeKK_T_PRG_PKINSERT [C] T_PRG`, `executeKK_T_ODR_INF_SKSI_WK_PKINSERT2 [C] T_ODR_INF_SKSI_WK`, `executeKK_T_ODR_HAKKO_JOKEN_PKINSERT2 [C] T_ODR_HAKKO_JOKEN`, `executeKK_T_KKOP_SVC_KEI_PKINSERT [C] T_KKOP_SVC_KEI`, `executeKK_T_SVKEI_KAISEN_UW_KK_SELECT_063 [R] T_SVKEI_KAISEN_UW`, `executeKK_T_SVC_KEI_UCWK_KK_SELECT_139 [R] T_SVC_KEI_UCWK`, `executeKK_T_KKOP_SVC_KEI_PKSELECT [R] T_KKOP_SVC_KEI`, `executeKK_T_KKTK_SVC_KEI_KK_SELECT_269 [R] T_KKTK_SVC_KEI` |

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(null != kkTKktkSvcKei_KkSelect269)` (L12284)

> Query the equipment-provided service contract by service detail work number. If data exists, proceed with the full service contract update cascade.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kkTKktkSvcKei_KkSelect269 = db_KK_T_KKTK_SVC_KEI_269.selectNext()` // Fetch result from SELECT_269 |
| 2 | EXEC | `sysDate = JCCBatCommon.getSysDateTimeStamp()` // (システム日付を取得: Get system date) |
| 3 | SET | `kkTKkopSvcKei_PkSelectParam[] = {kkTKktkSvcKei_KkSelect269.getString(KKOP_SVC_KEI_NO), kkTKktkSvcKei_KkSelect269.getString(GENE_ADD_DTM)}` // Build lookup param from select269 result |
| 4 | CALL | `kkTKkopSvcKei_PkSelect = executeKK_T_KKOP_SVC_KEI_PKSELECT(kkTKkopSvcKei_PkSelectParam)` // (2-4-23-2: Update processing when select269 has results: Execute equipment option service contract lookup) |
| 5 | CALL | `executeKK_T_SVC_KEI_UCWK_KK_SELECT_139(inMap.getString(SVC_KEI_NO))` // (2: Acquire service contract details by service contract number) |
| 6 | CALL | `executeKK_T_SVKEI_KAISEN_UW_KK_SELECT_063(svcKeiKaisenUcwkNo)` // (3: Acquire service contract line information) |
| 7 | SET | `kkTSvcKeiUcwk_KkSelect139 = db_KK_T_SVC_KEI_UCWK_139.selectNext()` // Fetch contract details result |
| 8 | SET | `kkTSvkeiKaisenUw_KkSelect063 = db_KK_T_SVKEI_KAISEN_UW_063.selectNext()` // Fetch line information result |

**Block 1.1** — [IF] `(null != kkTKkopSvcKei_PkSelect)` (L12303)

> Existing equipment option service contract found. Perform the full update: re-insert the contract with a new generation, generate SOD triggers, create order work records, and log progress. This is the primary processing branch for active router plan changes.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setKktKkopSvcKei_PkInsertParam[] = {kkTKkopSvcKei_PkSelect.getString(KKOP_SVC_KEI_NO), sysDate, kkTKkopSvcKei_PkSelect.getString(KKOP_SVC_KEI_STAT), KKOP_SVC_CD_G01="G01" (equipment option service code: eo Hikari Multi-Function Router), PCRS_CD_G01="G01" (pricing code: eo Hikari), PPLAN_CD_PG0101="PG0101" (pricing plan code), kkTKkopSvcKei_PkSelect.getString(KKTK_SVC_KEI_NO), kkTKkopSvcKei_PkSelect.getString(SYSID), inMap.getString(MSKM_DTL_NO), super.opeDate, kkTKkopSvcKei_PkSelect.getString(RSV_CL_YMD), RSV_APLY_CD_2="2" (reservation application code), kkTKkopSvcKei_PkSelect.getString(FTRIAL_KANYU_YMD), kkTKkopSvcKei_PkSelect.getString(FTRIAL_PRD_ENDYMD), kkTKkopSvcKei_PkSelect.getString(HONKANYU_YMD), kkTKkopSvcKei_PkSelect.getString(HONKANYU_IKO_KIGEN_YMD), kkTKkopSvcKei_PkSelect.getString(SVC_USE_STA_KIBO_YMD), kkTKkopSvcKei_PkSelect.getString(RSV_TSTA_KIBO_YMD), kkTKkopSvcKei_PkSelect.getString(SHOSA_YMD), kkTKkopSvcKei_PkSelect.getString(SHOSA_CL_YMD), kkTKkopSvcKei_PkSelect.getString(SKEKKA_SEND_CD), kkTKkopSvcKei_PkSelect.getString(KEI_CNC_YMD), kkTKkopSvcKei_PkSelect.getString(SVC_STAYMD), kkTKkopSvcKei_PkSelect.getString(SVC_ENDYMD), kkTKkopSvcKei_PkSelect.getString(SVC_CHRG_STAYMD), kkTKkopSvcKei_PkSelect.getString(SVC_CHRG_ENDYMD), kkTKkopSvcKei_PkSelect.getString(KEIZK_SVC_STAYMD), kkTKkopSvcKei_PkSelect.getString(KEIZK_SVC_CHRG_STAYMD), kkTKkopSvcKei_PkSelect.getString(PLAN_STAYMD), kkTKkopSvcKei_PkSelect.getString(PLAN_ENDYMD), kkTKkopSvcKei_PkSelect.getString(PLAN_CHRG_STAYMD), kkTKkopSvcKei_PkSelect.getString(PLAN_CHRG_ENDYMD), kkTKkopSvcKei_PkSelect.getString(PLAN_END_SBT_CD), kkTKkopSvcKei_PkSelect.getString(SVC_CANCEL_YMD), kkTKkopSvcKei_PkSelect.getString(SVC_CANCEL_RSN_CD), kkTKkopSvcKei_PkSelect.getString(SVC_CANCEL_CL_YMD), kkTKkopSvcKei_PkSelect.getString(SVC_STP_YMD), kkTKkopSvcKei_PkSelect.getString(SVC_STP_RSN_CD), kkTKkopSvcKei_PkSelect.getString(SVC_STP_RLS_YMD), kkTKkopSvcKei_PkSelect.getString(SVC_STP_RLS_RSN_CD), kkTKkopSvcKei_PkSelect.getString(PAUSE_STP_CD), kkTKkopSvcKei_PkSelect.getString(SVC_PAUSE_YMD), kkTKkopSvcKei_PkSelect.getString(SVC_PAUSE_CHRG_STA_YMD), kkTKkopSvcKei_PkSelect.getString(SVC_PAUSE_RSN_CD), kkTKkopSvcKei_PkSelect.getString(SVC_PAUSE_RSN_MEMO), kkTKkopSvcKei_PkSelect.getString(SVC_PAUSE_RLS_YMD), kkTKkopSvcKei_PkSelect.getString(SVC_PAUSE_RLS_RSN_CD), kkTKkopSvcKei_PkSelect.getString(SVC_PAUSE_RLS_RSN_MEMO), kkTKkopSvcKei_PkSelect.getString(SVC_DSL_YMD), kkTKkopSvcKei_PkSelect.getString(SVC_DLRE_CD), kkTKkopSvcKei_PkSelect.getString(SVC_DLRE_MEMO), kkTKkopSvcKei_PkSelect.getString(SVC_DSL_CL_YMD), kkTKkopSvcKei_PkSelect.getString(SVC_DSL_TTDKI_FIN_FLG), kkTKkopSvcKei_PkSelect.getString(KAIHK_YMD), kkTKkopSvcKei_PkSelect.getString(CHRG_STA_YMD_HOSEI_UM), kkTKkopSvcKei_PkSelect.getString(KKOP_SVC_KEI_HKHASYMD), kkTKkopSvcKei_PkSelect.getString(PNLTY_HASSEI_CD), inMap.getString(IDO_DIV), kkTKkopSvcKei_PkSelect.getString(SHOSA_DSL_FIN_CD), kkTKkopSvcKei_PkSelect.getString(KIKI_RNTAI_KEI_CHGECHU_FLG), kkTKkopSvcKei_PkSelect.getString(ADD_DTM), kkTKkopSvcKei_PkSelect.getString(ADD_OPEACNT), kkTKkopSvcKei_PkSelect.getString(UPD_DTM), kkTKkopSvcKei_PkSelect.getString(UPD_OPEACNT), kkTKkopSvcKei_PkSelect.getString(DEL_DTM), kkTKkopSvcKei_PkSelect.getString(DEL_OPEACNT), kkTKkopSvcKei_PkSelect.getString(MK_FLG), kkTKkopSvcKei_PkSelect.getString(ADD_UNYO_YMD), kkTKkopSvcKei_PkSelect.getString(ADD_TRN_ID), kkTKkopSvcKei_PkSelect.getString(UPD_UNYO_YMD), kkTKkopSvcKei_PkSelect.getString(UPD_TRN_ID), kkTKkopSvcKei_PkSelect.getString(DEL_UNYO_YMD), kkTKkopSvcKei_PkSelect.getString(DEL_TRN_ID), "0"}; // 62-field param: (機器オプションサービスサービス契約番号: Equipment option service contract number), (世代登録年月日時秒: Generation registration datetime), (機器オプションサービスサービス契約ステータス: Contract status), G01, G01, PG0101, (機器提供サービス契約番号: Equipment-provided service contract number), (SYSID: System ID), (申請明細番号: Application detail number), (予約適用年月日: Reservation application date), (予約取消年月日: Reservation cancellation date), "2", (試用加入年月日: Trial addition date), (試用期間終了年月日: Trial period end date), (本加入年月日: Full addition date), (本加入移行期限年月日: Full migration deadline date), (サービス利用開始希望年月日: Service start desired date), (予約適用開始希望年月日: Reservation start desired date), (照会年月日: Inquiry date), (照会取消年月日: Inquiry cancellation date), (審査結果送信コード: Review result send code), (契約結成年月日: Contract formation date), (サービス開始年月日: Service start date), (サービス終了年月日: Service end date), (サービス課金開始年月日: Billing start date), (サービス課金終了年月日: Billing end date), (継続サービス開始年月日: Continuation start date), (継続サービス課金開始年月日: Continuation billing start date), (プラン開始年月日: Plan start date), (プラン終了年月日: Plan end date), (プラン課金開始年月日: Plan billing start date), (プラン課金終了年月日: Plan billing end date), (プラン終了種類コード: Plan end type code), (サービスキャンセル年月日: Service cancellation date), (サービスキャンセル理由コード: Cancellation reason code), (サービスキャンセル取消年月日: Cancellation undo date), (サービス停止年月日: Service suspension date), (サービス停止理由コード: Suspension reason code), (サービス停止解除年月日: Suspension release date), (サービス停止解除理由コード: Suspension release reason code), (休止中コード: Pause status code), (サービス休止年月日: Service suspension date), (サービス休止課金開始年月日: Suspension billing start date), (サービス休止理由コード: Suspension reason code), (サービス休止理由メモ: Suspension reason memo), (サービス休止解除年月日: Suspension release date), (サービス休止解除理由コード: Suspension release reason code), (サービス休止解除理由メモ: Suspension release memo), (サービス解約年月日: Service termination date), (サービス解約理由コード: Termination reason code), (サービス解約理由メモ: Termination reason memo), (サービス解約取消年月日: Termination undo date), (サービス解約手続完了フラグ: Termination procedure completion flag), (回復年月日: Recovery date), (課金開始年月日補正有無: Billing start date correction flag), (機器オプションサービス契約引発年月日: Equipment option service contract trigger date), (違約金発生コード: Penalty occurrence code), (異動区分: Movement division), (照会解約完了コード: Inquiry termination completion code), (機器帯約約変更手続中フラグ: Equipment contract change procedure-in-progress flag), ADD/UPD/DEL timestamps and operators, MK_FLG, ADD_UNWO_YMD, ADD_TRN_ID, UPD_UNWO_YMD, UPD_TRN_ID, DEL_UNWO_YMD, DEL_TRN_ID, "0") |
| 2 | CALL | `executeKK_T_KKOP_SVC_KEI_PKINSERT(setKktKkopSvcKei_PkInsertParam)` // Re-insert equipment option service contract as new generation (2-4-23-2: Update processing) |
| 3 | SET | `kkSelect063_SVC_KEI_KAISEN_UCWK_NO = kkTSvkeiKaisenUw_KkSelect063.getString(SVC_KEI_KAISEN_UCWK_NO)` // (Service contract line detail number) |
| 4 | SET | `kkSelect063_GENE_ADD_DTM = kkTSvkeiKaisenUw_KkSelect063.getString(GENE_ADD_DTM)` // (Line info generation registration datetime) |
| 5 | SET | `KkSelect139_SVC_KEI_UCWK_NO = kkTSvcKeiUcwk_KkSelect139.getString(SVC_KEI_UCWK_NO)` // (Service contract detail number) |
| 6 | SET | `KkSelect139_GENE_ADD_DTM = kkTSvcKeiUcwk_KkSelect139.getString(GENE_ADD_DTM)` // (Detail generation registration datetime) |
| 7 | SET | `odrHakkoJokenNoTakino = padNumFormString(getNextSeq(SEQ_ODR_HAKKO_JOKEN_NO), 12)` // (Order trigger condition number: Auto-number) |
| 8 | SET | `setKkTOdrHakkoJoken_PkInsertParam[] = {odrHakkoJokenNoTakino, inMap.getString(SVC_KEI_NO), "" (svc_kei_ucwk_no: NULL), kkTKktkSvcKei_KkSelect269.getString(KKTK_SVC_KEI_NO), "" (op_svc_kei_no: NULL), "" (sub_op_svc_kei_no: NULL), "" (bill_op_svc_kei_no: NULL), ORDER_SBT_CD_2="2" (Order subtype code: Equipment option), SVC_ORDER_CD_26="26" (Service order code: Router equipment change), YOKYU_SBT_CD_04="04" (Requirement subtype code), ODR_HAKKO_JOKEN_CD_01="01" (Order trigger condition code: Router change), "" (contract svc ctrl req order ID: NULL), padNumFormString(getNextSeq(SEQ_SAME_TRN_NO), 12), kkTKktkSvcKei_KkSelect269.getString(TAKNKIKI_MODEL_CD), kkTKktkSvcKei_KkSelect269.getString(KIKI_SEIZO_NO), "" (mail address: NULL), "" (spotlog SYSID: NULL), kkSelect063_SVC_KEI_KAISEN_UCWK_NO, "" (send req completion datetime: NULL), "" (registration datetime: NULL), "" (registration operator: NULL), "" (update datetime: NULL), "" (update operator: NULL), "" (delete datetime: NULL), "" (delete operator: NULL), "" (invalid flag: "0"=valid), "" (reg op ymd: NULL), "" (reg process ID: NULL), "" (upd op ymd: NULL), "" (upd process ID: NULL), "" (del op ymd: NULL), "" (del process ID: NULL)};` // 38 fields |
| 9 | CALL | `executeKK_T_ODR_HAKKO_JOKEN_PKINSERT2(setKkTOdrHakkoJoken_PkInsertParam)` // (Route change SOD issuance: Issue order for old router info) |
| 10 | SET | `setKkTOdrInfSksiWk_PkInsertParam[] = {padNumFormString(getNextSeq(SEQ_ODR_INF_SKSI_WK_NO), 12), odrHakkoJokenNoTakino, ODR_NAIYO_CD_418="418" (Order content code: Router equipment change), inMap.getString(SVC_KEI_NO), svcKeiGeneAddDtm, KkSelect139_SVC_KEI_UCWK_NO, KkSelect139_GENE_ADD_DTM, kkTKktkSvcKei_KkSelect269.getString(KKTK_SVC_KEI_NO), kkTKktkSvcKei_KkSelect269.getString(KK0341_GENE_ADD_DTM), "" (op_svc_kei_no: NULL), "" (op_svc_kei_gene: NULL), "" (sub_op_svc_kei_no: NULL), "" (sub_op_svc_kei_gene: NULL), "" (bill_op_svc_kei_no: NULL), "" (bill_op_svc_kei_gene: NULL), kkSelect063_SVC_KEI_KAISEN_UCWK_NO, kkSelect063_GENE_ADD_DTM, "" (pre_change_svc_gene: NULL), "" (pre_change_svc_ucwk_gene: NULL), "" (pre_change_kktk_gene: NULL), "" (pre_change_op_gene: NULL), "" (pre_change_sub_gene: NULL), "" (pre_change_bill_gene: NULL), "" (reg_datetime: NULL), "" (reg_operator: NULL), "" (upd_datetime: NULL), "" (upd_operator: NULL), "" (del_datetime: NULL), "" (del_operator: NULL), "" (invalid_flag: "0"=valid), "" (reg_op_ymd: NULL), "" (reg_proc_id: NULL), "" (upd_op_ymd: NULL), "" (upd_proc_id: NULL), "" (del_op_ymd: NULL), "" (del_proc_id: NULL), kkTKkopSvcKei_PkSelect.getString(KKOP_SVC_KEI_NO), sysDate, "", "", "", ""};` // 39 fields |
| 11 | CALL | `executeKK_T_ODR_INF_SKSI_WK_PKINSERT2(setKkTOdrInfSksiWk_PkInsertParam)` // (Register order info work params) |
| 12 | SET | `setParam[] = {padNumFormString(getNextSeq(SEQ_PRG_NO), 12), inMap.getString(MSKM_DTL_NO), "" (billing_contract_no: NULL), "" (billing_method_no_seat: NULL), "" (billing_method_no_credit: NULL), inMap.getString(SVC_KEI_NO), "" (svc_kei_ucwk_no: NULL), "" (svc_kei_kaisen_ucwk_no: NULL), "" (kktk_svc_kei_no: NULL), "" (op_svc_kei_no: NULL), "" (bill_op_svc_kei_no: NULL), "" (sub_op_svc_kei_no: NULL), "" (discount_svc_kei_no: NULL), inMap.getString(IDO_DIV), idoDtm, PRG_STATUS_1="H001" (Progress status), super.opeDate + sysDate.substring(8), "" (prog_memo: NULL), PRG_TKJK_1="" (Progress special item 1), "" (prog_special_2: NULL), "" (reg_datetime: NULL), "" (reg_operator: NULL), "" (upd_datetime: NULL), "" (upd_operator: NULL), "" (del_datetime: NULL), "" (del_operator: NULL), "" (invalid_flag: "0"=valid), "" (reg_op_ymd: NULL), "" (reg_proc_id: NULL), "" (upd_op_ymd: NULL), "" (upd_proc_id: NULL), "" (del_op_ymd: NULL), "" (del_proc_id: NULL)};` // 33 fields |
| 13 | CALL | `executeKK_T_PRG_PKINSERT(setParam)` // (Register progress params) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svcKeiKaisenUcwkNo` | Field | Service detail work number — internal tracking ID for service contract line items (回線内訳番号) |
| `svcKeiGeneAddDtm` | Field | Service contract generation registration datetime — timestamp when a contract version was created (サービス契約世代登録年月日時秒) |
| `idoDtm` | Field | Movement/transfer datetime — timestamp of when the migration/change operation was initiated (異動年月日時秒) |
| `IDO_DIV` | Field | Movement division — classification code for the type of migration/change operation (異動区分) |
| `MSKM_DTL_NO` | Field | Application detail number — identifies the specific plan change application from the course-change intermediate file (申請明細番号) |
| `SVC_KEI_NO` | Field | Service contract number — unique identifier for a service contract (サービス契約番号) |
| KKOP | Acronym | Kiki Option — Equipment Option Service Contract (機器オプションサービス契約). The "KK" prefix identifies equipment-provided service contracts |
| SOD | Acronym | Service Order Data — telecom order fulfillment entity used to trigger downstream order processing |
| `KKOP_SVC_CD_G01` | Constant | Equipment option service code = "G01" (eo Hikari Multi-Function Router, Router function: eo光多功能ルーラー ルーター機能) |
| `PCRS_CD_G01` | Constant | Pricing code = "G01" (Pricing code: eo Hikari pricing tier) |
| `PPLAN_CD_PG0101` | Constant | Pricing plan code = "PG0101" (Pricing plan code: specific pricing plan) |
| `RSV_APLY_CD_2` | Constant | Reservation application code = "2" (予約適用コード: reservation application) |
| `ORDER_SBT_CD_2` | Constant | Order subtype code = "2" (Order subtype: Equipment option order) |
| `SVC_ORDER_CD_26` | Constant | Service order code = "26" (Service order code: Router equipment change) |
| `YOKYU_SBT_CD_04` | Constant | Requirement subtype code = "04" (Requirement subtype classification) |
| `ODR_HAKKO_JOKEN_CD_01` | Constant | Order trigger condition code = "01" (Order trigger condition: Router change/SOKJI HAKKO) |
| `ODR_NAIYO_CD_418` | Constant | Order content code = "418" (Order content: Router equipment change order information) |
| `PRG_STATUS_1` | Constant | Progress status = "H001" (Progress status code: processing in progress) |
| `PRG_TKJK_1` | Field | Progress special item 1 — metadata field for progress management (進捗特記事項1) |
| `SEQ_ODR_HAKKO_JOKEN_NO` | Sequence | Order trigger condition number sequence — generates unique identifiers for SOD trigger records |
| `SEQ_ODR_INF_SKSI_WK_NO` | Sequence | Order information work number sequence — generates identifiers for order work records |
| `SEQ_SAME_TRN_NO` | Sequence | Same processing number sequence — generates identifiers for grouping related operations |
| `SEQ_PRG_NO` | Sequence | Progress number sequence — generates unique identifiers for progress management records |
| `T_KKTK_SVC_KEI` | Table | Equipment-provided Service Contract table — stores contracts for equipment-provided services (機器提供サービス契約) |
| `T_KKOP_SVC_KEI` | Table | Equipment Option Service Contract table — stores equipment option service contract records with full lifecycle state (機器オプションサービスサービス契約) |
| `T_SVC_KEI_UCWK` | Table | Service Contract Details table — stores detailed service contract information (サービス契約内訳) |
| `T_SVKEI_KAISEN_UW` | Table | Service Contract Line Information table — stores service contract line/extension details (サービス契約回線内訳) |
| `T_ODR_HAKKO_JOKEN` | Table | Order Trigger Condition table — stores SOD trigger conditions that initiate downstream order processing (Order trigger condition) |
| `T_ODR_INF_SKSI_WK` | Table | Order Information Work table — stores order information work records for processing (Order information work) |
| `T_PRG` | Table | Progress Management table — stores batch processing progress and status tracking (進捗管理) |
| `geneAddDtm` | Field | Generation registration datetime — when a record version was created (世代登録年月日時秒) |
| `RSV_CL_YMD` | Field | Reservation cancellation date (予約取消年月日) |
| `FTRIAL_KANYU_YMD` | Field | Trial addition date (試用加入年月日) |
| `HONKANYU_YMD` | Field | Full addition date — when service moves from trial to full service (本加入年月日) |
| `KEI_CNC_YMD` | Field | Contract formation date (契約結成年月日) |
| `SHOSA_YMD` | Field | Inquiry date (照会年月日) |
| `SVC_STP_YMD` | Field | Service suspension date (サービス停止年月日) |
| `SVC_DSL_YMD` | Field | Service termination date (サービス解約年月日) |
| `KIKI_RNTAI_KEI_CHGECHU_FLG` | Field | Equipment contract change procedure-in-progress flag (機器帯約約変更手続中フラグ) |
| `GENE_ADD_DTM` | Field | Generation registration datetime (世代登録年月日時秒) |
| `KKTK_SVC_KEI_NO` | Field | Equipment-provided service contract number (機器提供サービス契約番号) |
| `KKOP_SVC_KEI_NO` | Field | Equipment option service contract number (機器オプションサービス契約番号) |
| `TAKNKIKI_MODEL_CD` | Field | Home router model code (宅内機器型式コード) |
| `KIKI_SEIZO_NO` | Field | Device serial number (機器製造番号) |
| `sokji_hakko` | Business term | Router change order issuance — the process of issuing an SOD trigger to process a router change (索知発行) |
| `routaa` | Business term | Router — multi-function router equipment (ルーター) |
| `Kiki Option` | Business term | Equipment-provided service where Fujitsu supplies the router device (機器オプション) |
| `Course Change` | Business term | Service plan/course change operation (コース変更) |
