---

# Business Logic — JBSbatTUBmpKojiFinTrn.initial() [14 LOC]

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

## 1. Role

### JBSbatTUBmpKojiFinTrn.initial()

The `initial()` method is the **initialization entry point** for the `JBSbatTUBmpKojiFinTrn` batch service, which handles **Bangou Koji (番号工事) — numbered work completion processing** in the K-Opticom customer base system. This method prepares the batch execution environment by delegating to the parent class `JBSbatBusinessService.setCommonInfo()` to bind the batch common parameters (`JBSbatCommonItem`), then instantiates three `JBSbatSQLAccess` database access objects for the tables managed by this service: the **Bangou Koji (numbered work completion)** table (`TU_T_BMP_KOJI`), the **One-time Money Settings (一時金設定)** table (`KK_T_ICJKN_SETTE`), and the **Contract One-time Money (契約一時金)** table (`KK_T_KICJKN`). The method implements the **template method pattern** inherited from `JBSbatBusinessService`, where each concrete batch service overrides `initial()` to declare its own DB access resources before the main processing (`execute()`) is invoked by the batch framework. As a framework-managed lifecycle callback, it plays the role of a **shared utility entry point** — the batch runtime calls this method automatically before any business logic is executed, ensuring that all DB access objects are ready for downstream processing. This method contains no conditional branches or decision logic; it is a straightforward sequential initialization routine.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["initial\(commonItem\"])
    START --> STEP1["setCommonInfo\(commonItem\"]
    STEP1 --> STEP2["db_TU_T_BMP_KOJI initialization"]
    STEP2 --> STEP3["db_KK_T_ICJKN_SETTE initialization"]
    STEP3 --> STEP4["db_KK_T_KICJKN initialization"]
    STEP4 --> END_NODE(["Return / Next"])
```

The processing flow is strictly sequential with no conditional branching:

1. **Delegated common info setup** — The method calls `super.setCommonInfo(commonItem)`, which binds the batch common parameters (system ID, processing date, batch name, etc.) into the parent class context via the `JBSbatBusinessService` base class.

2. **DB access object instantiation** — Three `JBSbatSQLAccess` objects are created, each bound to a specific database table and the common item context:
   - `db_TU_T_BMP_KOJI` for the **Bangou Koji (番号工事 — numbered work completion)** table
   - `db_KK_T_ICJKN_SETTE` for the **One-time Money Settings (一時金設定)** table
   - `db_KK_T_KICJKN` for the **Contract One-time Money (契約一時金)** table

These objects are used later in `execute()` to perform actual SQL operations (reads, updates, inserts) on the respective tables.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `commonItem` | `JBSbatCommonItem` | Batch common parameter document carrying runtime execution context — includes system ID, batch name, processing date/time, and other shared batch configuration data required by the batch framework to coordinate processing. |

**Instance fields used (declared in class):**

| No | Field Name | Type | Business Description |
|----|-----------|------|---------------------|
| 1 | `db_TU_T_BMP_KOJI` | `JBSbatSQLAccess` | DB access object for the `TU_T_BMP_KOJI` (Bangou Koji / numbered work completion) table |
| 2 | `db_KK_T_ICJKN_SETTE` | `JBSbatSQLAccess` | DB access object for the `KK_T_ICJKN_SETTE` (One-time Money Settings) table |
| 3 | `db_KK_T_KICJKN` | `JBSbatSQLAccess` | DB access object for the `KK_T_KICJKN` (Contract One-time Money) table |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JBSbatBusinessService.setCommonInfo` | - | - | Calls `setCommonInfo()` on the parent class to set batch common parameters |

**Analysis of called methods within `initial()`:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JBSbatBusinessService.setCommonInfo(JBSbatCommonItem)` | - | - | Delegates to parent class to bind common batch context (system ID, processing date, etc.); no direct DB operation |
| - | `new JBSbatSQLAccess(JBSbatCommonItem, "TU_T_BMP_KOJI")` | - | `TU_T_BMP_KOJI` | Creates SQL access object for the Bangou Koji (numbered work completion) table — prepares for subsequent CRUD operations in `execute()` |
| - | `new JBSbatSQLAccess(JBSbatCommonItem, "KK_T_ICJKN_SETTE")` | - | `KK_T_ICJKN_SETTE` | Creates SQL access object for the One-time Money Settings table |
| - | `new JBSbatSQLAccess(JBSbatCommonItem, "KK_T_KICJKN")` | - | `KK_T_KICJKN` | Creates SQL access object for the Contract One-time Money table |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatTUBmpKojiFinTrn | Batch framework invokes `initial()` as lifecycle callback | `setCommonInfo` [no-op] — `db_TU_T_BMP_KOJI` init [N/A] `TU_T_BMP_KOJI`<br>`db_KK_T_ICJKN_SETTE` init [N/A] `KK_T_ICJKN_SETTE`<br>`db_KK_T_KICJKN` init [N/A] `KK_T_KICJKN` |

**Notes:**
- This method is part of a batch framework lifecycle. The batch runner invokes `initial()` automatically before calling `execute()` — it is not called from any screen (KKSV*) or CBS.
- A codebase-wide search for callers of `initial()` did not find any explicit references (no `JBSbatTUBmpKojiFinTrn.initial(...)` calls in other Java files), confirming it is invoked via the framework's template method pattern.

## 6. Per-Branch Detail Blocks

**Block 1** — [EXPRESSION] `super.setCommonInfo(commonItem)` (L78)

> Sets batch common parameters by delegating to the parent class `JBSbatBusinessService.setCommonInfo()`. This binds the batch execution context (system ID, batch name, processing date, etc.) for downstream processing.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `super.setCommonInfo(commonItem)` // Delegates to parent class to bind batch common parameters |

**Block 2** — [EXPRESSION] `db_TU_T_BMP_KOJI = new JBSbatSQLAccess(...)` (L81)

> Initializes the DB access object for the **Bangou Koji (番号工事 — numbered work completion)** table. This table stores records related to numbered work orders and their completion status.

| # | Type | Code |
|---|------|------|
| 1 | SET | `db_TU_T_BMP_KOJI = new JBSbatSQLAccess(commonItem, D_TBL_NAME_TU_T_BMP_KOJI)` // `D_TBL_NAME_TU_T_BMP_KOJI = "TU_T_BMP_KOJI"` — Bangou Koji table access |

**Block 3** — [EXPRESSION] `db_KK_T_ICJKN_SETTE = new JBSbatSQLAccess(...)` (L82)

> Initializes the DB access object for the **One-time Money Settings (一時金設定)** table. This table stores configuration for one-time charges/credits applied to customer accounts.

| # | Type | Code |
|---|------|------|
| 1 | SET | `db_KK_T_ICJKN_SETTE = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_ICJKN_SETTE)` // `D_TBL_NAME_KK_T_ICJKN_SETTE = "KK_T_ICJKN_SETTE"` — One-time Money Settings table access |

**Block 4** — [EXPRESSION] `db_KK_T_KICJKN = new JBSbatSQLAccess(...)` (L83)

> Initializes the DB access object for the **Contract One-time Money (契約一時金)** table. This table stores contract-level one-time money (charges/credits) records.

| # | Type | Code |
|---|------|------|
| 1 | SET | `db_KK_T_KICJKN = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_KICJKN)` // `D_TBL_NAME_KK_T_KICJKN = "KK_T_KICJKN"` — Contract One-time Money table access |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `TU_T_BMP_KOJI` | Table | Bangou Koji (番号工事) — Numbered Work Completion table. Stores records of work orders identified by serial numbers and their completion status in the telecom service provisioning system. |
| `KK_T_ICJKN_SETTE` | Table | One-time Money Settings (一時金設定) — Configuration table for one-time charges or credits applied to customer accounts during contract modifications. |
| `KK_T_KICJKN` | Table | Contract One-time Money (契約一時金) — Table storing contract-level one-time financial records (charges/credits) associated with service contracts. |
| Bangou Koji (番号工事) | Business term | Numbered Work Completion — A process identifier in the telecom service provisioning system where each work order is assigned a unique serial number (bangou) for tracking from order to completion. |
| Isshikin (一時金) | Business term | One-time Money — A one-off charge or credit applied to a customer's account, typically associated with promotions, contract changes, or service modifications. |
| Keiyaku (契約) | Business term | Contract — The service agreement between the customer and K-Opticom. Used here to qualify one-time money at the contract level. |
| JBSbatBusinessService | Class | Abstract base class for all batch business services. Provides the template method pattern with `initial()` and `execute()` lifecycle hooks, along with shared DB access, logging, and common parameter handling. |
| JBSbatSQLAccess | Class | Database SQL access abstraction layer for batch processing. Wraps SQL operations (SELECT, INSERT, UPDATE, DELETE) for a specific table with standardized parameter binding. |
| JBSbatCommonItem | Class | Batch common parameter object carrying shared execution context including system ID, batch name, processing date/time, and other runtime configuration. |
| BMP_KOJI_NO | Field | Bangou Koji Number — The unique serial number identifier for a numbered work completion record. |
| GENE_ADD_DTM | Field | Generated Add Date/Time — Timestamp when the BMP Koji record was created. |
| SVC_KEI_UCWK_NO | Field | Service Detail Work Number — Internal tracking ID for a service contract line item. |
| HOJIN_KOJIN_CD | Field | Corporation/Individual Code — Distinguishes between corporate (hojin) and individual (kojin) customer types. |
| BMP_MSKMSHO_TYPE_CD | Field | Bangou Mask Shoshi Type Code — Code identifying the type of work completion request (e.g., cancellation, modification). |
| BMP_KOJI_STAT | Field | Bangou Koji Status — Current processing status of the numbered work record. |
| KOJIN | String const | Individual (personal) customer type constant. |
| KOJIN_JSSI_REQ_STAY | String const | Individual Transfer Request Stay — Status indicating a request to stay (remain) during an individual customer transfer. |
| BMP_REQ_NAIYO_HAISHI | String const | Bangou Request Content Cancellation — Code indicating the work completion request has been cancelled. |
| NTT_KEI_TEL_KAISEN_NO | Field | NTT Kei Tel Kaizen Number — NTT telephone line improvement number associated with the work order. |
| JTUStrConst | Class | JTU string constants provider — Contains standard string constant values used throughout the JTU (telecom) domain. |

---
