# Business Logic — JBSbatACTaiikiLmtTchiTrgtMake.initial() [22 LOC]

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

## 1. Role

### JBSbatACTaiikiLmtTchiTrgtMake.initial()

This method performs the **initialization processing for a batch job** that creates the target list of customers who are eligible for **domain-limit over-notification** (帯域制限超過通知対象者作成). The domain refers to broadband bandwidth restrictions — when a customer exceeds a certain communication volume threshold, the system identifies them and prepares them as recipients for over-usage notifications.

As the entry point of the service class, this method follows the **template method delegation pattern** commonly used in this batch framework: it first configures shared batch context by delegating to `setCommonInfo`, then initializes database access for the lookup table, performs detailed debug logging, and finally builds the notification target data map by calling `getTsryoCkTcSeteMap()`. 

The method plays a critical role in the batch processing pipeline — without successful initialization, the subsequent `execute()` method would lack the database access layer and the pre-computed target data map needed to generate and deliver communication volume over-notification messages.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["initial(commonItem)"])
    START --> SET_INFO["setCommonInfo(commonItem)"]
    SET_INFO --> DB_NEW["new JBSbatSQLAccess(commonItem, D_TBL_NAME_AC_M_TSRYO_CKTCSETE)"]
    DB_NEW --> DEBUG_1["printDebugLog([S][initial])"]
    DEBUG_1 --> DEBUG_2["printDebugLog([L][initial][opeDate])"]
    DEBUG_2 --> DEBUG_3["printDebugLog([L][initial][freeItem])"]
    DEBUG_3 --> GET_MAP["getTsryoCkTcSeteMap()"]
    GET_MAP --> MAP_RESULT["tsryoCkTcSeteMap = result"]
    MAP_RESULT --> DEBUG_4["printDebugLog([E][initial])"]
    DEBUG_4 --> END_NODE(["Return / Next"])
```

**Description:**

1. **Common Info Setup** — Delegates to the parent class `JBSbatBusinessService.setCommonInfo()` to set the batch common parameters, establishing the shared context for all subsequent processing.

2. **DB Access Class Generation** — Instantiates a new `JBSbatSQLAccess` object pointing to the `AC_M_TSRYO_CKTCSETE` table (domain-limit over-notification settings master table). This enables subsequent SQL SELECT operations against the settings table.

3. **Debug Log — Entry / Runtime Info** — Outputs three debug log entries: the entry marker `[S][initial]`, the batch operation date (`opeDate`), and the free-item field (`freeItem`). These provide traceability for batch execution monitoring.

4. **Notification Target Data Map Retrieval** — Calls `getTsryoCkTcSeteMap()` which queries the `AC_M_TSRYO_CKTCSETE` table to build a HashMap mapping the composite key (`pcrs_cd` + `pplan_cd`) to the notification target communication volume (`tchi_tg_tsryo`). This map is stored in the instance field `tsryoCkTcSeteMap` for use by the main processing logic.

5. **Debug Log — Exit** — Outputs the exit marker `[E][initial]` to signal completion of the initialization phase.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `commonItem` | `JBSbatCommonItem` | Batch common parameter object carrying shared batch execution context including the operation date (`opeDate`), free item field (`freeItem`), and other runtime settings used by all services in this batch. It is passed through to `setCommonInfo()` and the `JBSbatSQLAccess` constructor. |
| — | `super.opeDate` | `Date` / `String` | Batch operation date inherited from the parent class `JBSbatBusinessService`. Used in debug logging and passed as a query parameter when fetching notification target data. |
| — | `super.freeItem` | `String` | Free-form item field inherited from parent class. Used for debug logging to provide additional batch context. |
| — | `db_AC_M_TSRYO_CKTCSETE` | `JBSbatSQLAccess` | Instance field storing the database access layer for the `AC_M_TSRYO_CKTCSETE` table. Initialized in this method and used for subsequent SELECT operations in `getTsryoCkTcSeteMap()`. |
| — | `tsryoCkTcSeteMap` | `HashMap<String, BigDecimal>` | Instance field storing the communication volume over-notification settings map. Populated by `getTsryoCkTcSeteMap()` with keys of `(pcrs_cd + pplan_cd)` and values of `tchi_tg_tsryo` (notification target communication volume). |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `JBSbatBusinessService.setCommonInfo` | JBSbatBusiness | JBSbatBusiness (shared context) | Sets common batch information into the parent service instance, establishing batch runtime context |
| - | `JBSbatSQLAccess.<constructor>` | JBSbatSQLAccess | - | Creates a new SQL access layer instance for table `AC_M_TSRYO_CKTCSETE` |
| - | `JACbatDebugLogUtil.printDebugLog` | JACbatDebugLog | - | Calls debug logging utility (entry marker `[S][initial]`) |
| - | `JACbatDebugLogUtil.printDebugLog` | JACbatDebugLog | - | Calls debug logging utility (log level `[L][initial][opeDate]`) |
| - | `JACbatDebugLogUtil.printDebugLog` | JACbatDebugLog | - | Calls debug logging utility (log level `[L][initial][freeItem]`) |
| R | `JBSbatACTaiikiLmtTchiTrgtMake.getTsryoCkTcSeteMap` | JBSbatACTaiikiLmtTchiTrgtMake | `AC_M_TSRYO_CKTCSETE` | Calls `getTsryoCkTcSeteMap()` which queries the notification settings table to build a composite-key HashMap |
| - | `JACbatDebugLogUtil.printDebugLog` | JACbatDebugLog | - | Calls debug logging utility (exit marker `[E][initial]`) |

### Detail: `getTsryoCkTcSeteMap()` Internal Operations

This called method performs a SQL SELECT against the `AC_M_TSRYO_CKTCSETE` table:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JBSbatACTaiikiLmtTchiTrgtMake.executeAC_M_TSRYO_CKTCSETE_AC_SELECT_002` | AC_M_TSRYO_CKTCSETE | `AC_M_TSRYO_CKTCSETE` | Executes SQL definition key `AC_SELECT_002` with parameters: upper-limit over-notification type code `"2"` (domain control over-notification) and batch operation date |

## 5. Dependency Trace

This method is a **batch entry point** — it is invoked from the batch job definition configuration rather than from other Java application classes. The search across all Java files returned no callers referencing this class, confirming that `JBSbatACTaiikiLmtTchiTrgtMake` is only triggered via the batch scheduling system (e.g., XML batch definitions or scheduler configuration).

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JBSbatACTaiikiLmtTchiTrgtMake` | Batch Job Config -> `JBSbatACTaiikiLmtTchiTrgtMake.initial` | `getTsryoCkTcSeteMap() [R] AC_M_TSRYO_CKTCSETE` |

**Notes:**
- This class extends `JBSbatBusinessService` which provides the standard batch service framework.
- The `initial()` method is called by the batch framework before the `execute()` method, as part of the standard batch execution flow.
- No screen (KKSV*) or CBS callers were found — this is a pure batch service.

## 6. Per-Branch Detail Blocks

### Block 1 — [SET] Initialize common info (L69)

Sets up shared batch context by delegating to the parent service class. This establishes the common parameters (operation date, free item, etc.) that are used throughout the batch lifecycle.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `super.setCommonInfo(commonItem)` | Sets the batch common parameter object into the parent service. Establishes `opeDate`, `freeItem`, and other shared context fields. |

### Block 2 — [SET] Generate DB Access Class (L75)

Initializes the SQL access layer for the domain-limit over-notification settings master table. This creates the database access object that will be used to query notification settings in the subsequent `getTsryoCkTcSeteMap()` call.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `db_AC_M_TSRYO_CKTCSETE = new JBSbatSQLAccess(commonItem, D_TBL_NAME_AC_M_TSRYO_CKTCSETE)` | Creates a new `JBSbatSQLAccess` instance for table `AC_M_TSRYO_CKTCSETE` (domain-limit over-notification settings master table). [-> `D_TBL_NAME_AC_M_TSRYO_CKTCSETE = "AC_M_TSRYO_CKTCSETE"`] |

### Block 3 — [EXEC] Debug Log — Entry (L78)

Outputs the entry marker debug log for traceability.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][initial]")` | Assert-based debug log marking the start of the `initial` method. `[S]` = Start marker. |

### Block 4 — [EXEC] Debug Log — Runtime Info (L79–80)

Outputs the batch operation date and free item as part of the debug log.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][initial][opeDate=" + super.opeDate + "]")` | Logs the batch operation date. `[L]` = Level log. |
| 2 | EXEC | `assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][initial][freeItem=" + super.freeItem + "]")` | Logs the free item field value for additional batch context. |

### Block 5 — [CALL] Retrieve Notification Target Data Map (L83)

Calls the internal method `getTsryoCkTcSeteMap()` which queries the `AC_M_TSRYO_CKTCSETE` table using SQL key `AC_SELECT_002`. The query filters by:
- **Upper-limit over-notification type code** = `"2"` (domain control over-notification / 帯域制御超過通知)
- **Batch operation date** = `super.opeDate`

The result is a HashMap where the key is the concatenation of `pcrs_cd` (price code) + `pplan_cd` (price plan code), and the value is `tchi_tg_tsryo` (notification target communication volume). This map is stored in the instance field `tsryoCkTcSeteMap` for use by the `execute()` method when determining per-customer notification thresholds.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `this.tsryoCkTcSeteMap = this.getTsryoCkTcSeteMap()` | Assigns the returned HashMap to the instance field. The map contains keys of `(price code + price plan code)` mapped to notification target communication volume thresholds (BigDecimal). |

### Block 6 — [EXEC] Debug Log — Exit (L85)

Outputs the exit marker debug log to signal the completion of the `initial` method.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][initial]")` | Assert-based debug log marking the end of the `initial` method. `[E]` = End marker. |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `AC_M_TSRYO_CKTCSETE` | Table | Over-notification settings master table (通信量超過通知設定マスタ) — stores communication volume over-notification configuration settings including price codes, plan codes, and notification thresholds |
| `opeDate` | Field | Batch operation date (バッチ運用日) — the date on which the batch job is being executed |
| `freeItem` | Field | Free item field (自由項目) — an arbitrary-purpose field for batch execution context and traceability |
| `pcrs_cd` | Field | Price code (料金コースコード) — identifies a specific pricing plan / rate course for customers |
| `pplan_cd` | Field | Price plan code (料金プランコード) — identifies a specific service pricing plan |
| `tchi_tg_tsryo` | Field | Notification target communication volume (通知対象通信量) — the bandwidth threshold at which a customer should receive an over-usage notification |
| `tsryoCkTcSeteMap` | Field | Communication volume over-notification settings map (通信量超過通知設定マップ) — HashMap mapping composite key (pcrs_cd + pplan_cd) to notification target communication volume |
| `USECASE_ID` | Constant | Use case identifier `ACSV0035` (FTTH communication volume over-usage registration) — links this batch to a specific business use case |
| `SC_TITLE` | Constant | SC title `ACSV003501SC` — service component title for FTTH communication volume over-usage registration |
| Domain-limit over-notification | Business term | 帯域制限超過通知 — a notification mechanism that alerts customers who have exceeded their contracted broadband bandwidth / communication volume threshold |
| Domain control | Business term | 帯域制御 — bandwidth control / restriction, the practice of limiting a customer's network speed when they exceed usage thresholds |
| `AC_SELECT_002` | SQL Key | SQL definition key for querying the `AC_M_TSRYO_CKTCSETE` table with filters on over-notification type and operation date |
| Upper-limit over-notification type code | Field | 上限超過通知種別コード — classification code for notification type; value `"2"` indicates domain control over-notification |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service offered by K-Opticom |
| `JBSbatSQLAccess` | Class | Batch SQL access layer — framework class for database access operations in batch services |
| `JBSbatBusinessService` | Class | Parent batch service class — provides shared batch context management including `setCommonInfo()` and inherited fields |
| `JACbatDebugLogUtil` | Class | Debug log utility — framework class for batch debug logging with structured markers (`[S]`, `[L]`, `[E]`) |
| Batch framework | Architecture | JBSbat* naming convention — standard batch processing framework used across the K-Opticom customer core system (eo顧客基幹システム) |
