# Business Logic — JBSbatACTaiikiLmtTchiTrgtMake.getTsryoCkTcSeteMap() [48 LOC]

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

## 1. Role

### JBSbatACTaiikiLmtTchiTrgtMake.getTsryoCkTcSeteMap()

This method retrieves configuration data from the **Communication Volume Over-Notification Settings Master** table (`AC_M_TSRYO_CKTCSETE`) and returns it as a HashMap for fast lookup during batch processing. Its business purpose is to load bandwidth over-notification thresholds so that downstream processing can determine when a customer's data usage has exceeded their contracted rate plan's bandwidth limit. Specifically, it queries only records for notification type code `"2"` (Bandwidth Control Over-Notification — 帯域制御超過通知), which identifies notification events triggered when a customer's communication volume exceeds the threshold defined in their rate plan. The method implements the **Repository pattern** by encapsulating database access logic and transforming raw tabular results into a domain-friendly key-value map. The composite key is formed by concatenating the rate course code (`PCRS_CD`) and rate plan code (`PPLAN_CD`), producing a unique identifier per rate plan within a service course. The **notification target bandwidth** (`TCHI_TG_TSRYO`) is used as the map value, representing the bandwidth threshold (in bytes or similar unit) at which an over-notification should be triggered. This map is populated during the batch's initialization phase and consumed by subsequent processing steps to evaluate whether individual customers have exceeded their contracted bandwidth limits.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getTsryoCkTcSeteMap"])
    DEBUG_S["Log: S entry"]
    NEW_DB["dbSelectList = new JBSbatCommonDBInterface()"]
    SET_TYPE["dbSelectList.setValue UPPL_CHOK_TCH_SBT_CD_TAILMT"]
    SET_OPE["dbSelectList.setValue opeDate"]
    EXEC_SEL["executeAC_M_TSRYO_CKTCSETE_AC_SELECT_002"]
    GET_RESULT["dbMap = db_AC_M_TSRYO_CKTCSETE.selectNext()"]
    NEW_MAP["rtnMap = new HashMap"]
    CHECK_NULL{dbMap == null?}
    RETURN_EMPTY["return empty rtnMap"]
    CHECK_LOOP{dbMap != null?}
    KEY_BUF["keyBuf = new StringBuffer()"]
    APPEND_CRS["keyBuf.append PCRS_CD"]
    APPEND_PLAN["keyBuf.append PPLAN_CD"]
    GET_VAL["value = dbMap.getBigDecimal TCHI_TG_TSRYO"]
    MAP_PUT["rtnMap.put key,value"]
    FETCH_NEXT["dbMap = db_AC_M_TSRYO_CKTCSETE.selectNext()"]
    DEBUG_E["Log: E exit"]
    END_NODE["return rtnMap"]

    START --> DEBUG_S
    DEBUG_S --> NEW_DB
    NEW_DB --> SET_TYPE
    SET_TYPE --> SET_OPE
    SET_OPE --> EXEC_SEL
    EXEC_SEL --> GET_RESULT
    GET_RESULT --> NEW_MAP
    NEW_MAP --> CHECK_NULL
    CHECK_NULL -->|Yes| RETURN_EMPTY
    CHECK_NULL -->|No| CHECK_LOOP
    CHECK_LOOP -->|Yes| KEY_BUF
    CHECK_LOOP -->|No| DEBUG_E
    KEY_BUF --> APPEND_CRS
    APPEND_CRS --> APPEND_PLAN
    APPEND_PLAN --> GET_VAL
    GET_VAL --> MAP_PUT
    MAP_PUT --> FETCH_NEXT
    FETCH_NEXT --> CHECK_LOOP
    DEBUG_E --> END_NODE
```

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JACBatCommon.printDebugLog` | JACBatCommon | - | Calls `printDebugLog` in `JACBatCommon` |
| - | `JACbatDebugLogUtil.printDebugLog` | JACbatDebugLog | - | Calls `printDebugLog` in `JACbatDebugLogUtil` |
| - | `JCKLcsRenkeiUtil.printDebugLog` | JCKLcsRenkei | - | Calls `printDebugLog` in `JCKLcsRenkeiUtil` |
| - | `JKKHttpCommunicator.printDebugLog` | JKKHttpCommunicator | - | Calls `printDebugLog` in `JKKHttpCommunicator` |
| R | `JBSbatACInsentivePrcCalcCH.getList` | JBSbatACInsentivePrcCalcCH | - | Calls `getList` in `JBSbatACInsentivePrcCalcCH` |
| R | `JBSbatACTaiikiLmtTchiTrgtMake.executeAC_M_TSRYO_CKTCSETE_AC_SELECT_002` | AC_M_TSRYO_CKTCSETE | `AC_M_TSRYO_CKTCSETE` | Calls `executeAC_M_TSRYO_CKTCSETE_AC_SELECT_002` to SELECT notification settings from `AC_M_TSRYO_CKTCSETE` master table |
| - | `JBSbatKKCashPostAddMail.printDebugLog` | JBSbatKKCashPostAddMail | - | Calls `printDebugLog` in `JBSbatKKCashPostAddMail` |
| R | `JBSbatZMAdDataSet.getString` | JBSbatZMAdDataSet | - | Calls `getString` in `JBSbatZMAdDataSet` |
| R | `JDKCommon47CC.getList` | JDKCommon47CC | - | Calls `getList` in `JDKCommon47CC` |
| - | `JDKStructuredMap.setValue` | JDKStructuredMap | - | Calls `setValue` in `JDKStructuredMap` |
| R | `JFUeoTelOpTransferCC.getList` | JFUeoTelOpTransferCC | - | Calls `getList` in `JFUeoTelOpTransferCC` |
| R | `JKKAddUsePlaceInfoCC.getList` | JKKAddUsePlaceInfoCC | - | Calls `getList` in `JKKAddUsePlaceInfoCC` |
| R | `JKKCancelUsePlaceInfoCC.getList` | JKKCancelUsePlaceInfoCC | - | Calls `getList` in `JKKCancelUsePlaceInfoCC` |
| - | `JKKEohTvGuideAddCC.setValue` | JKKEohTvGuideAddCC | - | Calls `setValue` in `JKKEohTvGuideAddCC` |
| - | `DKSV0101_DKSV0101OP_EDKA0010001BSMapper.setValue` | DKSV0101 | - | Calls `setValue` in `DKSV0101_DKSV0101OP_EDKA0010001BSMapper` |
| - | `DKSV0102_DKSV0102OP_EDKA0010001BSMapper.setValue` | DKSV0102 | - | Calls `setValue` in `DKSV0102_DKSV0102OP_EDKA0010001BSMapper` |
| - | `DKSV0103_DKSV0103OP_EDKA0010001BSMapper.setValue` | DKSV0103 | - | Calls `setValue` in `DKSV0103_DKSV0103OP_EDKA0010001BSMapper` |
| R | `JESC0101B010TPMA.getString` | JESC0101B010TPMA | - | Calls `getString` in `JESC0101B010TPMA` |
| R | `JESC0101B020TPMA.getString` | JESC0101B020TPMA | - | Calls `getString` in `JESC0101B020TPMA` |
| - | `JFUKyokaIpAdActionChkUtil.toArray` | JFUKyokaIpAdActionChk | - | Calls `toArray` in `JFUKyokaIpAdActionChkUtil` |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no parameters. It operates entirely on instance fields (`super.opeDate`, `this.db_AC_M_TSRYO_CKTCSETE`) and constructs its query parameters internally. |
| 1 | `super.opeDate` | `Date` (instance field) | Batch operation date — the date on which this batch process is running. Used as a filter parameter to ensure only notification settings valid on the current batch date are retrieved. |
| 2 | `this.db_AC_M_TSRYO_CKTCSETE` | `JBSbatCommonDBInterface` (instance field) | Database access interface for the `AC_M_TSRYO_CKTCSETE` master table. Used to iterate over query results via `selectNext()`. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `executeAC_M_TSRYO_CKTCSETE_AC_SELECT_002(Object[])` | AC_M_TSRYO_CKTCSETE | `AC_M_TSRYO_CKTCSETE` | SELECT notification settings from the Communication Volume Over-Notification Settings Master table, filtering by notification type code "2" and batch operation date |
| - | `JACbatDebugLogUtil.printDebugLog` | JACbatDebugLog | - | DEBUG logging — logs method entry and exit points |
| - | `JBSbatCommonDBInterface.setValue` | JDKCommonDB | - | Sets query parameters (notification type code, operation date) into the parameter list interface |
| - | `JBSbatCommonDBInterface.getList` | JDKCommonDB | - | Retrieves the parameter list as an array for the SQL execution |
| R | `JBSbatCommonDBInterface.selectNext` | JDKCommonDB | `AC_M_TSRYO_CKTCSETE` | Fetches the next row from the result set, iterating through all matching records |
| R | `JBSbatCommonDBInterface.getString` | JDKCommonDB | - | Reads `PCRS_CD` (rate course code) and `PPLAN_CD` (rate plan code) from the current result row |
| R | `JBSbatCommonDBInterface.getBigDecimal` | JDKCommonDB | - | Reads `TCHI_TG_TSRYO` (notification target bandwidth) as a BigDecimal from the current result row |

## 5. Dependency Trace

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

The method is called exactly once from the batch's `initial()` method (line 85), where its result is stored in the instance field `tsryoCkTcSeteMap`. This field is then used by subsequent processing methods within the same batch class. No screen or CBS-level entry points reach this method within 8 hops — it is a pure batch-internal utility method.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET/EXEC] `JBSbatCommonDBInterface creation and parameter setup` (L206-L214)

> Initializes the query parameter structure and sets the notification type code and batch operation date.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][getTsryoCkTcSeteMap]")` | Log method entry (S = Start) |
| 2 | SET | `dbSelectList = new JBSbatCommonDBInterface()` | Create parameter holder |
| 3 | SET | `dbSelectList.setValue(JACStrConst.UPPL_CHOK_TCH_SBT_CD_TAILMT)` | Set notification type code [-> `UPPL_CHOK_TCH_SBT_CD_TAILMT = "2"`: Bandwidth Control Over-Notification] |
| 4 | SET | `dbSelectList.setValue(super.opeDate)` | Set batch operation date as query filter |

**Block 2** — [CALL] `SQL Execution` (L217)

> Executes the SELECT query against the notification settings master table with the configured parameters.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `this.executeAC_M_TSRYO_CKTCSETE_AC_SELECT_002(dbSelectList.getList().toArray())` | Execute SQL to select notification settings from `AC_M_TSRYO_CKTCSETE` |

**Block 3** — [SET] `Result initialization` (L220-L223)

> Fetches the first result row and creates the return HashMap.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dbMap = this.db_AC_M_TSRYO_CKTCSETE.selectNext()` | Get first row from result set |
| 2 | SET | `rtnMap = new HashMap<String, BigDecimal>()` | Create empty return map |

**Block 4** — [IF] `(dbMap == null)` (L225-L229)

> If no matching records exist, return an empty map immediately.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][getTsryoCkTcSeteMap]")` | Log method exit (E = End) |
| 2 | RETURN | `return rtnMap` | Return empty HashMap — no notification settings found |

**Block 5** — [WHILE] `(dbMap != null)` (L232-L247)

> Iterates through all result rows, building a composite key from rate course code and rate plan code, and storing the notification target bandwidth as the map value. This loop continues until `selectNext()` returns null (no more rows).

| # | Type | Code |
|---|------|------|
| 1 | SET | `keyBuf = new StringBuffer()` | Create buffer for composite key |
| 2 | SET | `keyBuf.append(dbMap.getString(JBSbatAC_M_TSRYO_CKTCSETE.PCRS_CD))` | Append rate course code [-> `PCRS_CD`]: key component 1 |
| 3 | SET | `keyBuf.append(dbMap.getString(JBSbatAC_M_TSRYO_CKTCSETE.PPLAN_CD))` | Append rate plan code [-> `PPLAN_CD`]: key component 2 |
| 4 | SET | `value = dbMap.getBigDecimal(JBSbatAC_M_TSRYO_CKTCSETE.TCHI_TG_TSRYO)` | Get notification target bandwidth [-> `TCHI_TG_TSRYO`]: map value |
| 5 | SET | `rtnMap.put(keyBuf.toString(), value)` | Store key-value pair in result map |
| 6 | SET | `dbMap = this.db_AC_M_TSRYO_CKTCSETE.selectNext()` | Fetch next row for loop continuation |

**Block 5.1** — [ELSE-IMPLICIT] End of while loop (L232)

> When `selectNext()` returns null, the loop exits and the method returns the populated map.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][getTsryoCkTcSeteMap]")` | Log method exit |
| 2 | RETURN | `return rtnMap` | Return populated HashMap with all notification settings |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `AC_M_TSRYO_CKTCSETE` | Table | Communication Volume Over-Notification Settings Master table — stores bandwidth notification thresholds per rate plan |
| `PCRS_CD` | Field | Rate Course Code — identifies the service course/category (e.g., FTTH, cable, mobile) a rate plan belongs to |
| `PPLAN_CD` | Field | Rate Plan Code — identifies a specific pricing plan within a course; combined with `PCRS_CD` forms a unique key |
| `TCHI_TG_TSRYO` | Field | Notification Target Bandwidth — the bandwidth threshold (value) at which an over-usage notification is triggered for a given rate plan |
| `TSRYO_CKTCSETE_NO` | Field | Notification Setting Number — unique identifier for each notification settings record |
| `UPPL_CHOK_TCH_SBT_CD_TAILMT` | Constant | Upper Limit Over-Notification Type Code Tail — filter code for notification types; value `"2"` means Bandwidth Control Over-Notification |
| `opeDate` | Field | Operation Date — the batch run date used as a filter for valid/active settings |
| `tsryoCkTcSeteMap` | Field | Communication Volume Over-Notification Settings Map — instance field holding the HashMap result of this method |
| Bandwidth Control Over-Notification | Business term | A notification mechanism that alerts when a customer's data usage exceeds their contracted bandwidth limit defined in their rate plan |
| JBSbatCommonDBInterface | Component | Common database interface — parameter list and result set abstraction used for batch SQL execution |
| `AC_M_TSRYO_CKTCSETE_AC_SELECT_002` | SQL ID | SQL define ID for the SELECT query on the notification settings master table |
| Batch (バッチ) | Business term | Offline scheduled processing that runs independently of user interaction, typically overnight |
