---

# Business Logic — JBSbatACTaiikiLmtTchiTrgtMake.execute() [52 LOC]

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

## 1. Role

### JBSbatACTaiikiLmtTchiTrgtMake.execute()

This method is the main processing entry point for a **domain restriction excess notification target maker** batch service within the K-Opticom eo customer core system. Its business purpose is to identify FTTH (Fiber To The Home) subscribers who have exceeded their domain-specific data usage notification threshold and register them as notification targets via a remote service call.

The method implements a **guard-then-route** design pattern: it first checks whether the subscriber already has a recorded FTTH excess usage record (JSK_FLG). If no prior excess record exists, it proceeds to evaluate the customer's communication volume against a pre-loaded notification threshold matrix. The threshold matrix (`tsryoCkTcSeteMap`) is populated during `initial()` by querying the `AC_M_TSRYO_CKTCSETE` table for all active notification settings.

Its role in the larger system is as a **batch-driven customer eligibility screener** — it runs periodically to scan through customers and determine which ones should receive an excess notification based on their current usage. If a customer's cumulative usage before reflection (mae) is at or below the threshold, and the usage after reflection (ato) exceeds the threshold, the method registers the excess by invoking the `addTsrckJsk` service which calls a remote ESB endpoint (use case `ACSV0035`). If no threshold matrix is found or the usage does not cross the threshold, the method silently completes without action.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["execute(inMap)"])
    START --> LOG_S["Print debug log [S][execute]"]
    LOG_S --> LOG_IN["Print debug log: inMap content"]
    LOG_IN --> CHECK_JS["JSK_FLG == \"\" (empty)?"]
    CHECK_JS -->|Yes (no prior excess)| CHECK_NOFT["Print debug log: No FTTH excess result"]
    CHECK_NOFT --> BUILD_KEY["Build key: PCRS_CD + PRC_SVC_CD (trimmed)"]
    BUILD_KEY --> GET_MAP["upplChokTchSbtCd = tsryoCkTcSeteMap.get(key)"]
    GET_MAP --> CHECK_NULL["upplChokTchSbtCd != null?"]
    CHECK_NULL -->|Yes (matrix found)| LOG_MAT["Print debug log: Notification matrix exists"]
    LOG_MAT --> MAK_MAE["mae = TUSHINRYOGKEI_MAE as BigDecimal
(Usage total before reflection)"]
    MAK_MAE --> MAK_ATO["ato = TUSHINRYOGKEI_ATO as BigDecimal
(Usage total after reflection)"]
    MAK_ATO --> CHECK_THRESHOLD["mae <= threshold AND threshold > ato?"]
    CHECK_THRESHOLD -->|True (threshold crossed)| LOG_OVER["Print debug log: Exceeded notification target"]
    LOG_OVER --> CALL_REG["addTsrckJsk(makeInputMap(inMap))
Register FTTH excess via ESB service"]
    CALL_REG --> END_LOG["Print debug log [E][execute]"]
    CHECK_NULL -->|No (no matrix for this customer)| END_LOG
    CHECK_THRESHOLD -->|False (not crossed)| END_LOG
    CHECK_JS -->|No (prior excess exists)| END_LOG
    END_LOG --> RETURN(["return null"])
```

**Constant Resolution:**
- `JSK_FLG == KARA_MOJI (\"\")` — The `JSK_FLG` (実存在フラグ / actual existence flag) is checked against an empty string. If empty, no prior FTTH excess record exists for this customer, so the method proceeds to evaluate thresholds.
- `UPPL_CHOK_TCH_SBT_CD_TAILMT = \"2\"` — Domain control excess notification type code, used when loading the threshold matrix during `initial()`.
- `ZUMI_FLG_MI = \"0\"` — Used in `makeInputMap` to set the domain control implementation flag as "not yet implemented" when registering excess results.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `inMap` | `JBSbatServiceInterfaceMap` | The input message carrying customer FTTH usage data and billing identifiers. Contains the service contract number (`SVKEI_NO`), pricing course code (`PCRS_CD`), pricing service code (`PRC_SVC_CD`), total communication volume before reflection (`TUSHINRYOGKEI_MAE`), total communication volume after reflection (`TUSHINRYOGKEI_ATO`), the usage year/month (`RIYOU_YM`), and the actual existence flag (`JSK_FLG`) which indicates whether a prior FTTH excess record already exists. |

**Instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `tsryoCkTcSeteMap` | `HashMap<String, BigDecimal>` | Pre-loaded notification threshold matrix. Keys are composed of pricing course code + pricing plan code. Values are the notification threshold communication volumes (TCHI_TG_TSRYO). Populated during `initial()` by querying the `AC_M_TSRYO_CKTCSETE` table. |

## 4. CRUD Operations / Called Services

### Pre-computed evidence from code analysis:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JACbatDebugLogUtil.printDebugLog` | - | - | Prints debug log messages at [S], [L], [E] levels |
| R | `JBSbatServiceInterfaceMap.getString` | JBSbatACIFM214 | - | Reads string values from input map (JSK_FLG, PCRS_CD, PRC_SVC_CD, etc.) |
| C | `JBSbatACTaiikiLmtTchiTrgtMake.addTsrckJsk` | ACSV003501SC | AC_M_TSRYO_CKTCSETE (via remote ESB) | Registers FTTH excess usage result via remote service |
| C | `JBSbatACTaiikiLmtTchiTrgtMake.makeInputMap` | - | - | Constructs input map for the excess registration service |
| R | `JBSbatACTaiikiLmtTchiTrgtMake.tsryoCkTcSeteMap.get` | - | - | Retrieves notification threshold for a given pricing course/service key |

### Processing-level CRUD trace:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `getTsryoCkTcSeteMap` (called during `initial()`) | ACSV003501SC | `AC_M_TSRYO_CKTCSETE` | Queries notification threshold settings: filters by upper limit excess notification type code (`\"2\"`) and batch operation date. Returns HashMap of (PCRS_CD + PPLAN_CD) -> TCHI_TG_TSRYO threshold. |
| R | `executeAC_M_TSRYO_CKTCSETE_AC_SELECT_002` | ACSV003501SC | `AC_M_TSRYO_CKTCSETE` | Executes SQL select with key-based filtering using SQL define key `AC_SELECT_002`. |
| R | `inMap.getString(JSK_FLG)` | - | - | Reads the actual existence flag to check if prior excess record exists. |
| R | `inMap.getString(PCRS_CD)` | - | - | Reads pricing course code used as part of the threshold lookup key. |
| R | `inMap.getString(PRC_SVC_CD)` | - | - | Reads pricing service code (trimmed), used as part of the threshold lookup key. |
| R | `inMap.getString(TUSHINRYOGKEI_MAE)` | - | - | Reads cumulative communication volume before reflection (pre-processing usage total). |
| R | `inMap.getString(TUSHINRYOGKEI_ATO)` | - | - | Reads cumulative communication volume after reflection (post-processing usage total). |
| R | `inMap.getString(SVKEI_NO)` | - | - | Reads service contract number, passed to the registration service. |
| R | `inMap.getString(RIYOU_YM)` | - | - | Reads FTTH communication usage year/month, passed to the registration service. |
| C | `addTsrckJsk` | ACSV003501CBS | AC_M_TSRYO_CKTCSETE | Invokes remote ESB service to register FTTH excess result. Internally calls `JCCBatchEsbInterface.invokeService` with use case ID `ACSV0035` and service title `ACSV003501SC`. |
| C | `makeInputMap` | ACSV003501CBS | - | Constructs `HashMap<String, String>` input for the excess registration service containing service contract number, pricing course code, pricing plan code, usage year/month, domain control implementation flag, and function code (`\"1\"`). |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatACTaiikiLmtTchiTrgtMake (self) | `initial()` -> `getTsryoCkTcSeteMap` -> `executeAC_M_TSRYO_CKTCSETE_AC_SELECT_002` [R] `AC_M_TSRYO_CKTCSETE` -> `execute()` -> `addTsrckJsk` [C] `AC_M_TSRYO_CKTCSETE` via ESB ACSV003501CBS | `getTsryoCkTcSeteMap [R] AC_M_TSRYO_CKTCSETE`<br>`addTsrckJsk [C] AC_M_TSRYO_CKTCSETE` |

**Notes:** No external screen or batch class directly instantiates or calls `JBSbatACTaiikiLmtTchiTrgtMake.execute()`. Search of all Java files in the repository returned zero results for direct references to this class. This method is designed to be invoked by the batch framework's service invocation pipeline (extending `JBSbatBusinessService`), which dispatches to `execute()` based on the configured use case ID (`ACSV0035`).

## 6. Per-Branch Detail Blocks

**Block 1** — [LOGGING] `(L99)`

> Begin processing: log entry and input inspection.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][execute]")` |
| 2 | EXEC | `assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[S][execute][inMap = " + inMap.getMap().toString() + "]")` |

**Block 2** — [CONDITIONAL: JSK_FLG CHECK] `(L105)` [KARA_MOJI = ""]

> Check if the customer already has an existing FTTH excess usage record. The JSK_FLG (実存在フラグ / actual existence flag) is read from the input map. If empty, this customer has no prior excess record and needs threshold evaluation.
> Comment: `FTTH通信量超過実蹟の存在チェック` (FTTH excess usage record existence check)
> Note: A commented-out SQL query for direct DB check of excess records was removed in v4.01.00 (2013/03/23) for speed improvement — the SELECT from `execute()` was disabled in favor of pre-loaded HashMap lookup.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JACStrConst.KARA_MOJI.equals(inMap.getString(JBSbatACIFM214.JSK_FLG))` [-> `KARA_MOJI = ""`] |
| 2 | EXEC | `assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][FTTH通信量超過実蹟なし]")` // If condition true: No FTTH excess result |

**Block 2.1** — [THEN: threshold matrix lookup and evaluation] `(L106)`

> No prior excess exists — retrieve notification threshold and evaluate if customer's usage crossed the threshold.
> Comment: `FTTH通信量合計情報の料金コースコード，料金サービスコードより、通信量超過通知設定を検索する。` (Search notification settings by pricing course code and pricing service code from FTTH total communication volume info.)

| # | Type | Code |
|---|------|------|
| 1 | SET | `StringBuffer keyBuf = new StringBuffer()` |
| 2 | EXEC | `keyBuf.append(inMap.getString(JBSbatACIFM214.PCRS_CD))` [-> `PCRS_CD`] // Append pricing course code |
| 3 | EXEC | `keyBuf.append(inMap.getString(JBSbatACIFM214.PRC_SVC_CD).trim())` [-> `PRC_SVC_CD`] // Append trimmed pricing service code |
| 4 | SET | `BigDecimal upplChokTchSbtCd = this.tsryoCkTcSeteMap.get(keyBuf.toString())` // Lookup notification threshold by composite key |

**Block 2.1.1** — [CONDITIONAL: threshold matrix found] `(L116)`

> The notification threshold matrix was found for this customer's pricing course/service combination.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][通信量超過通知設定マトマッハスあり]")` // Notification matrix found |

**Block 2.1.1.1** — [EXCESS THRESHOLD EVALUATION] `(L120)`

> Compare the customer's communication volume before and after reflection against the threshold to determine if a notification should be triggered.
> Comment: `利用通信量合計（反映前） ≦ 通知対象通信量 < 利用通信量合計（反映後）` (Usage total before reflection ≦ Notification target volume < Usage total after reflection)

| # | Type | Code |
|---|------|------|
| 1 | SET | `BigDecimal mae = new BigDecimal(inMap.getString(JBSbatACIFM214.TUSHINRYOGKEI_MAE))` [-> `TUSHINRYOGKEI_MAE`] // Usage total before reflection |
| 2 | SET | `BigDecimal ato = new BigDecimal(inMap.getString(JBSbatACIFM214.TUSHINRYOGKEI_ATO))` [-> `TUSHINRYOGKEI_ATO`] // Usage total after reflection |
| 3 | EXEC | `mae.compareTo(upplChokTchSbtCd) <= 0 && upplChokTchSbtCd.compareTo(ato) < 0` // mae ≦ threshold AND threshold < ato |

**Block 2.1.1.1.1** — [CONDITIONAL: threshold crossed] `(L124)`

> The customer's usage has crossed the notification threshold. Register the excess record.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][通信量が通知対象を超えた]")` // Exceeded notification target |
| 2 | EXEC | `assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][ 通知対象通信量 = " + upplChokTchSbtCd + "]")` // Log threshold value |
| 3 | EXEC | `assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][ 利用通信量合計（反映前） = " + mae + "]")` // Log pre-reflection value |
| 4 | EXEC | `assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[L][execute][ 利用通信量合計（反映後） = " + ato + "]")` // Log post-reflection value |

**Block 2.1.1.1.1.1** — [CALL: Register FTTH excess via ESB service] `(L130)`

> Build the input map and invoke the remote ESB service to register this customer as a FTTH excess result record.
> Comment: `FTTH通信量超過実蹟を登録する。（サービス呼び出し）` (Register FTTH excess usage record. (Service call))

| # | Type | Code |
|---|------|------|
| 1 | CALL | `this.addTsrckJsk(this.makeInputMap(inMap))` // makeInputMap constructs: svc_kei_no, pcrs_cd, pplan_cd, ftth_tushin_use_ym, tik_ctl_jssi_zm_flg ("0"), func_code ("1") -> addTsrckJsk invokes `JCCBatchEsbInterface.invokeService` with USECASE_ID="ACSV0035" and SC_TITLE="ACSV003501SC" |

**Block 2.1.1.1.2** — [ELSE: threshold not crossed] `(implicit at L124)`

> The usage did not cross the threshold. No registration is performed. Method proceeds to end logging.

**Block 2.1.1.2** — [ELSE: threshold matrix not found] `(implicit at L116)`

> No notification threshold matrix exists for this customer's pricing course/service combination. This can occur when the customer's pricing course/plan combination is not configured with a notification threshold. No action is taken.

**Block 2.2** — [ELSE: prior excess exists] `(implicit at L105)`

> The customer already has an existing FTTH excess record (JSK_FLG is not empty). Skip all processing.

**Block 3** — [LOGGING] `(L135)`

> End processing: log exit.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `assert JACbatDebugLogUtil.printDebugLog(super.logPrint, "[E][execute]")` |

**Block 4** — [RETURN] `(L137)`

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `SVKEI_NO` | Field | Service contract number — the unique identifier for a customer's service contract in the eo system |
| `PCRS_CD` | Field | Pricing course code — identifies the billing course/planset a customer is enrolled in |
| `PRC_SVC_CD` | Field | Pricing service code — identifies the specific pricing service plan (e.g., FTTH internet, phone bundle) |
| `TUSHINRYOGKEI_MAE` | Field | Total communication volume before reflection — cumulative data usage total prior to the current batch run's adjustments |
| `TUSHINRYOGKEI_ATO` | Field | Total communication volume after reflection — cumulative data usage total after the current batch run's adjustments/updates |
| `JSK_FLG` | Field | Actual existence flag — indicates whether a prior FTTH excess usage record already exists for this customer |
| `RIYOU_YM` | Field | Usage year/month — the billing period year and month for which FTTH communication data is being evaluated |
| `TCHI_TG_TSRYO` | Field | Notification target communication volume — the threshold value (in MB/GB) above which a customer should receive a notification |
| `PPLAN_CD` | Field | Pricing plan code — identifies a specific pricing plan within a pricing course |
| `tik_ctl_jssi_zm_flg` | Field | Domain control implementation flag — indicates whether domain-level control measures have been applied ("0" = not yet implemented) |
| `func_code` | Field | Function code — set to "1" to indicate this is a registration-type operation |
| `USECASE_ID` | Constant | "ACSV0035" — the use case identifier for the FTTH excess usage registration service |
| `SC_TITLE` | Constant | "ACSV003501SC" — the service component title key used in the ESB input map |
| `KARA_MOJI` | Constant | `""` (empty string) — used to represent an empty/blank string value |
| `UPPL_CHOK_TCH_SBT_CD_TAILMT` | Constant | `"2"` — upper limit excess notification type code for domain control excess notification |
| `UPPL_CHOK_TCH_SBT_CD_TSUSHIN` | Constant | `"1"` — upper limit excess notification type code for communication volume excess notification |
| `ZUMI_FLG_MI` | Constant | `"0"` — "not yet implemented" flag value |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service provided by K-Opticom |
| Domain restriction | Business term | A billing control mechanism that monitors a customer's data usage per domain (e.g., internet, phone) and triggers notifications or controls when thresholds are exceeded |
| Excess notification | Business term | A proactive notification sent to a customer when their data usage approaches or exceeds a pre-configured threshold |
| ESB | Acronym | Enterprise Service Bus — middleware used for service invocation and data exchange between systems |
| `AC_M_TSRYO_CKTCSETE` | Table | Notification threshold settings table — stores the mapping of pricing course/code to notification target volume thresholds |
| `JCCBatchEsbInterface.invokeService` | Method | Remote ESB service invocation — calls a backend service with input parameters and receives return codes/output |
| `RETURN_CODE_SUCCESS` | Constant | Success return code value (typically "0000" or "0") — indicates the ESB service completed successfully |
| `JACbatRknBusinessUtil.esbErrOutputPrc` | Method | ESB error processing utility — handles error output, logging, and escalation when an ESB service returns a non-success code |

---
