# Business Logic — KKW02510SFLogic.setDslsrv() [34 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW02510SF.KKW02510SFLogic` |
| Layer | Controller / Web Logic (Package: `eo.web.webview.KKW02510SF`) |
| Module | `KKW02510SF` (Package: `eo.web.webview.KKW02510SF`) |

## 1. Role

### KKW02510SFLogic.setDslsrv()

This method performs the **cancellation service input configuration processing** (解約サービス入力設定処理) for the Multi-Session Update unit within K-Opticom's contract management system. It is the central data-preparation entry point that runs whenever a user navigates to the cancellation-service screen from the service-contract-list view.

Specifically, the method has two responsibilities. First, when invoked from the **"Update Confirmation"** screen (更新確認) — determined by `func_cd` equalling `"2"` — it assembles the **Use End Date** (利用終了日) from its year, month, and day components, clears the **Return Message ID** (返却メッセージID) to prevent stale messages from carrying over, and sets the **Progress-Specific Item 1** (進階特記事項1) field to the value `"マルチセッション情報解約"` (Multi-Session Information Cancellation). This branch ensures the screen renders with the correct cancellation context.

Second, regardless of the function code, the method delegates data-mapping to three downstream mapper methods via a `KKSV0073_KKSV0073OPDBMapper` instance: it calls `setOpsvckeiDslCC` (to handle DSL service-charge data mapping), `setJKKHakkoSODCC` (to prepare and issue a Service Order Data / SOD request), and `setKKSV0073WORK` (to write operational work-table data). This routing/dispatch pattern makes the method a **hub** that coordinates screen-level DataBean population with backend service-component processing.

The method is a **shared utility** within `KKW02510SFLogic`, called by both `actionFix` (the fix/apply action) and `actionUpdCfm` (the update-confirmation action). It is not a screen entry point itself but a supporting logic method that bridges the presentation layer (DataBeans) with the data-mapping layer (OPDBMapper).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setDslsrv(params)"])
    COND{"func_cd equals FUNC_CD_2 = 2?"}
    GET_YEAR["GET USE_ENDYMD_YEAR from paramBean 0"]
    GET_MON["GET USE_ENDYMD_MON from paramBean 0"]
    GET_DAY["GET USE_ENDYMD_DAY from paramBean 0"]
    CONCAT["CONCAT year plus mon plus day to use_endymd"]
    SET_ENDYM["SET USE_ENDYMD to use_endymd in paramBean 0"]
    CLEAR_RTN["SET RTN_MSG_ID to empty string in paramBean 0"]
    SET_PRG["SET PRG_TKJK_1 to MLTSE_INFO plus DSL"]
    NEW_MAPPER["NEW KKSV0073_KKSV0073OPDBMapper mapper"]
    CALL_OPS["CALL mapper.setOpsvckeiDslCC"]
    CALL_SOD["CALL mapper.setJKKHakkoSODCC"]
    CALL_WORK["CALL mapper.setKKSV0073WORK"]
    END_NODE(["Return"])

    START --> COND
    COND -->|Yes| GET_YEAR
    COND -->|No| NEW_MAPPER
    GET_YEAR --> GET_MON
    GET_MON --> GET_DAY
    GET_DAY --> CONCAT
    CONCAT --> SET_ENDYM
    SET_ENDYM --> CLEAR_RTN
    CLEAR_RTN --> SET_PRG
    SET_PRG --> NEW_MAPPER
    NEW_MAPPER --> CALL_OPS
    CALL_OPS --> CALL_SOD
    CALL_SOD --> CALL_WORK
    CALL_WORK --> END_NODE
```

**Constant Resolution:**
- `JPCModelConstant.FUNC_CD_2 = "2"` — Function code representing **"Update Confirmation" (更新確認)** action.
- `KKW02510SFConst.USE_ENDYMD_YEAR = "利用終了日（年）"` — Use end date (year) field key.
- `KKW02510SFConst.USE_ENDYMD_MON = "利用終了日（月）"` — Use end date (month) field key.
- `KKW02510SFConst.USE_ENDYMD_DAY = "利用終了日（日）"` — Use end date (day) field key.
- `KKW02510SFConst.USE_ENDYMD = "利用終了日"` — Use end date composite field key (YYYYMMDD).
- `KKW02510SFConst.RTN_MSG_ID = "返却メッセージID"` — Return message ID field key.
- `KKW02510SFConst.PRG_TKJK_1 = "進階特記事項1"` — Progress-specific item 1 field key.
- `KKW02510SFLogic.MLTSE_INFO = "マルチセッション情報"` — Multi-Session Information (class-level constant).
- `KKW02510SFLogic.DSL = "解約"` — Cancellation (class-level constant).

The condition branch on `func_cd` determines whether the **update-confirmation special logic** (dataBean editing) runs. Only when `func_cd` equals `"2"` does the method populate the Use End Date, clear the return message ID, and set the progress-specific item. In all cases, the mapper methods are called to handle backend data-mapping.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `paramBean` | `X31SDataBeanAccess[]` | Array of DataBean access handles for the screen. Each element provides read/write access to UI-bound fields (e.g., Use End Date, Return Message ID, Progress-Specific Item). `paramBean[0]` is the primary DataBean for the cancellation-service screen. Used for both reading existing values (year/month/day) and writing assembled results (composite end date, cleared message ID, progress label). |
| 2 | `inputMap` | `HashMap<String, Object>` | Input data map carrying request-level data to the mapper layer. Passed verbatim to `setOpsvckeiDslCC`, `setJKKHakkoSODCC`, and `setKKSV0073WORK`. Contains service contract identifiers (SVC_KEI_NO, SYSID, IDO_DIV), operation service numbers (OP_SVC_KEI_NO), and process classification codes (TRAN_DIV). |
| 3 | `func_cd` | `String` | Function code that determines the processing path. `"2"` indicates the **"Update Confirmation" (更新確認)** screen, which triggers the special DataBean editing logic. Any other value skips the DataBean editing block and proceeds directly to the mapper calls. This code originates from the screen's action button dispatch logic. |

**Instance fields / external state read:**
| Source | Description |
|--------|-------------|
| `KKW02510SFLogic.MLTSE_INFO` (private static final String) | Class-level constant `"マルチセッション情報"` (Multi-Session Information). Used to build the progress-specific item label. |
| `KKW02510SFLogic.DSL` (private static final String) | Class-level constant `"解約"` (Cancellation). Concatenated with `MLTSE_INFO` to form `"マルチセッション情報解約"`. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `KKSV0073_KKSV0073OPDBMapper.setOpsvckeiDslCC` | - | - | Calls `setOpsvckeiDslCC` — DSL service-charge data mapping. Prepares and maps operation service charge (Opsvckei) entity data for DSL services. |
| - | `KKSV0073_KKSV0073OPDBMapper.setJKKHakkoSODCC` | - | - | Calls `setJKKHakkoSODCC` — Service Order Data (SOD) issuance. Prepares and issues an SOD request for the cancellation service. |
| - | `KKSV0073_KKSV0073OPDBMapper.setKKSV0073WORK` | - | - | Calls `setKKSV0073WORK` — Work table data write. Writes operational work-table data for the cancellation processing. |
| - | `X31SDataBeanAccess.sendMessageString` | - | - | DataBean getter/setter calls. Reads/writes screen fields (USE_ENDYMD_YEAR, USE_ENDYMD_MON, USE_ENDYMD_DAY, USE_ENDYMD, RTN_MSG_ID, PRG_TKJK_1). No database operation — purely UI DataBean population. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `KKW02510SFLogic.actionFix()` | `actionFix` -> `setDslsrv(paramBean, inputMap, func_cd)` | `setOpsvckeiDslCC`, `setJKKHakkoSODCC`, `setKKSV0073WORK` |
| 2 | `KKW02510SFLogic.actionUpdCfm()` | `actionUpdCfm` -> `setDslsrv(paramBean, inputMap, func_cd)` | `setOpsvckeiDslCC`, `setJKKHakkoSODCC`, `setKKSV0073WORK` |

**Terminal operations reached from this method:**

| # | Terminal Call | Terminal (SC / CRUD / Entity) |
|---|--------------|-------------------------------|
| 1 | `setOpsvckeiDslCC` | `setOpsvckeiDslCC` [-] DSL service-charge data mapping |
| 2 | `setJKKHakkoSODCC` | `setJKKHakkoSODCC` [-] SOD (Service Order Data) issuance for cancellation |
| 3 | `setKKSV0073WORK` | `setKKSV0073WORK` [-] Work table data write |

**Call chain explanation:**
Both `actionFix` and `actionUpdCfm` are screen-level action methods within `KKW02510SFLogic` itself. They invoke `setDslsrv` as part of their processing — either after the user applies a fix (`actionFix`) or confirms an update (`actionUpdCfm`). The downstream mapper calls chain to their respective data-processing logic, which ultimately touch the OPSVKEI (service-charge), SOD (service order), and WORK tables.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(JPCModelConstant.FUNC_CD_2.equals(func_cd))` `[JPCModelConstant.FUNC_CD_2="2" (Update Confirmation)]` (L911)

> Conditional block that executes DataBean editing **only** during the "Update Confirmation" (更新確認) screen action. When `func_cd` is `"2"`, the method prepares the Use End Date, clears the return message ID, and sets the progress-specific item label.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String use_endymd = paramBean[0].sendMessageString(KKW02510SFConst.USE_ENDYMD_YEAR, X31CWebConst.DATABEAN_GET_VALUE)` // GET Use End Date (Year) — 利用終了日（年） |
| 2 | EXEC | `+ paramBean[0].sendMessageString(KKW02510SFConst.USE_ENDYMD_MON, X31CWebConst.DATABEAN_GET_VALUE)` // Plus Use End Date (Month) — 利用終了日（月） |
| 3 | EXEC | `+ paramBean[0].sendMessageString(KKW02510SFConst.USE_ENDYMD_DAY, X31CWebConst.DATABEAN_GET_VALUE)` // Plus Use End Date (Day) — 利用終了日（日）<br>// Comment: 利用終了日 (Use End Date) |
| 4 | SET | `use_endymd` = `"YYYYMMDD"` (concatenated year + month + day string) |
| 5 | EXEC | `paramBean[0].sendMessageString(KKW02510SFConst.USE_ENDYMD, X31CWebConst.DATABEAN_SET_VALUE, use_endymd)` // SET composite Use End Date — 利用終了日 |
| 6 | EXEC | `paramBean[0].sendMessageString(KKW02510SFConst.SVC_CHRG_ENDYMD, ...)` // **DELETED** — Service charge end date (サービス課金終了年月日). Comment: 2012/11/22 [TAI-2012-0000091] Tentative logic correction countermeasure (暫定ロジック修正対応) DEL START/END |
| 7 | EXEC | `paramBean[0].sendMessageString(KKW02510SFConst.RTN_MSG_ID, X31CWebConst.DATABEAN_SET_VALUE, "")` // CLEAR Return Message ID — 返却メッセージID |
| 8 | EXEC | `paramBean[0].sendMessageString(KKW02510SFConst.PRG_TKJK_1, X31CWebConst.DATABEAN_SET_VALUE, MLTSE_INFO + DSL)` // SET Progress-Specific Item 1 (進階特記事項1) to `"マルチセッション情報解約"`<br>// Comment: 2012/11/05 [ANK-1223-00-00] Progress-specific item editing countermeasure (進階補足事項編集対応) ADD START/END |

**Block 2** — [SEQUENCE] (L932-L935)

> Regardless of the function code, always executes: creates the mapper and calls three downstream data-mapping methods. Comment: データマッピング (Data Mapping).

| # | Type | Code |
|---|------|------|
| 1 | SET | `KKSV0073_KKSV0073OPDBMapper mapper = new KKSV0073_KKSV0073OPDBMapper()` // Instantiate the OPDBMapper — コメント: データマッピング (Data Mapping) |
| 2 | CALL | `mapper.setOpsvckeiDslCC(paramBean, inputMap, func_cd)` // Map DSL service-charge data |
| 3 | CALL | `mapper.setJKKHakkoSODCC(paramBean, inputMap, func_cd)` // Issue Service Order Data (SOD) for cancellation |
| 4 | CALL | `mapper.setKKSV0073WORK(paramBean, inputMap, func_cd)` // Write operational work-table data |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `func_cd` | Parameter | Function code — distinguishes screen actions (e.g., `"2"` = Update Confirmation / 更新確認) |
| `USE_ENDYMD_YEAR` | Field Key | Use End Date (Year) — 利用終了日（年）. The year portion of the service cancellation date. |
| `USE_ENDYMD_MON` | Field Key | Use End Date (Month) — 利用終了日（月）. The month portion of the service cancellation date. |
| `USE_ENDYMD_DAY` | Field Key | Use End Date (Day) — 利用終了日（日）. The day portion of the service cancellation date. |
| `USE_ENDYMD` | Field Key | Use End Date — 利用終了日. Composite YYYYMMDD date string for when the service ends. |
| `RTN_MSG_ID` | Field Key | Return Message ID — 返却メッセージID. ID for a message to be returned to the user; cleared here to prevent stale messages. |
| `PRG_TKJK_1` | Field Key | Progress-Specific Item 1 — 進階特記事項1. A screen field showing the specific progress/operation type label. |
| `MLTSE_INFO` | Class Constant | Multi-Session Information — マルチセッション情報. A label prefix identifying the multi-session service context. |
| `DSL` | Class Constant | Cancellation — 解約. Abbreviation for service cancellation. Combined with `MLTSE_INFO` to form `"マルチセッション情報解約"`. |
| `FUNC_CD_2` | Constant | Function code `"2"` — 更新確認 (Update Confirmation). Identifies the update-confirmation action. |
| `paramBean` | Parameter | DataBean access array — DataBeanアクセス配列. Provides read/write access to UI screen fields. |
| `inputMap` | Parameter | Input data — 入力データ. Request-level data map passed to mapper/SC methods. |
| `KKSV0073OPDBMapper` | Component | Operations Service Charge OPDB Mapper. Maps data between DataBeans and the OPSVKEI/SOD/WORK data layers. |
| `setOpsvckeiDslCC` | Method | DSL service-charge data mapping method. Handles service-charge (Opsvckei) entity data for DSL services. |
| `setJKKHakkoSODCC` | Method | Service Order Data (SOD) issuance method. Prepares and issues SOD for the cancellation. |
| `setKKSV0073WORK` | Method | Work table data write method. Writes operational work-table records. |
| SOD | Acronym | Service Order Data — サービス注文データ. Telecom order fulfillment entity for processing service changes. |
| OPSVKEI | Acronym | Operation Service Charge — オプションサービス課金. Service-charge data entity. |
| K-Opticom | Business | K-Opticom — the telecommunications service provider. Contract management system manages service subscriptions. |
| Multi-Session | Business | Multi-Session — マルチセッション. A service type allowing multiple concurrent sessions. |
| Update Confirmation | Business | 更新確認. The screen action where the user confirms changes before they are finalized. |
| Cancellation (DSL) | Business | 解約. Service cancellation — terminating a DSL/service subscription. |
