# Business Logic — JFUCngSeikyushoYohiCC.setInMapSeikyOpSvcKeiDsl() [28 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JFUCngSeikyushoYohiCC` |
| Layer | CC / Common Component (Package: `com.fujitsu.futurity.bp.custom.common`) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JFUCngSeikyushoYohiCC.setInMapSeikyOpSvcKeiDsl()

This method performs the **upstream mapping item setup for billing option service contract cancellation** (上りマッピング項目設定(請求オプションサービス契約解約)) within the K-Opticom customer billing and service management system. It is responsible for preparing the request parameter map that will be consumed by CBS (Component Business Service) `EKK0441C230` to execute a customer's cancellation of a billing option service — such as FTTH internet add-ons, email options, TV guide subscriptions, or other optional service lines attached to a customer's primary bill.

The method implements a **data assembly / builder pattern**: it retrieves a shared `HashMap` from the request parameter object, populates it with all the fields required by the cancellation CBS message schema, and then returns — delegating subsequent database persistence to the CBS layer. It does not contain conditional branching; it unconditionally assembles every field required by the `EKK0441C230CBSMsg` schema relevant to the cancellation operation.

Within the larger system, this method is a **shared utility** called from `cngSeikyushoYohi()` (the main change-of-billing-information screen processing method) within the same class. It ensures that the cancellation request carries consistent, system-time-based date values (via `JCCBPCommon.getOpeDate()`) and standardized cancellation reason and difference classification codes, making it a critical gatekeeper for data integrity in billing option service cancellation workflows.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setInMapSeikyOpSvcKeiDsl"])
    SET_FUNC["setFuncCode: param, fixedText, FUNC_CD_1"]
    GET_DATA["inMap = param.getData(fixedText)"]
    PUT_KEI_NO["inMap.put SEIOPSVC_KEI_NO, seiOpSvcKeiNo"]
    PUT_MSKM["inMap.put MSKM_DTL_NO, mskmDtlNo"]
    PUT_RSV["inMap.put RSV_TSTA_KIBO_YMD, getOpeDate(null)"]
    PUT_END["inMap.put SVC_ENDYMD, getOpeDate(null)"]
    PUT_CHRG["inMap.put SVC_CHRG_ENDYMD, getSvcChrgEndYmdOp(null)"]
    PUT_DSLYMD["inMap.put SVC_DSL_YMD, getOpeDate(null)"]
    PUT_DLRE_CD["inMap.put SVC_DLRE_CD, CD00879_01"]
    PUT_IDO["inMap.put IDO_DIV, CD00576_00005"]
    PUT_UPD_BF["inMap.put UPD_DTM_BF, updDtm"]
    END_NODE(["Return / Next"])

    START --> SET_FUNC --> GET_DATA --> PUT_KEI_NO --> PUT_MSKM --> PUT_RSV --> PUT_END --> PUT_CHRG --> PUT_DSLYMD --> PUT_DLRE_CD --> PUT_IDO --> PUT_UPD_BF --> END_NODE
```

**Processing Summary:**

1. **Set function code** (L956): Calls `JFUBaseUtil.setFuncCode()` with function code `FUNC_CD_1 = "1"` (Check & Register — チェック＆登録). This flags the request parameter for the downstream CBS layer that this operation involves both validation and data registration.

2. **Retrieve inbound map** (L959): Calls `param.getData(fixedText)` to obtain the shared `HashMap` associated with the given service message key. This map acts as the request payload for the cancellation CBS.

3. **Populate billing option service contract number** (L961): Puts `seiOpSvcKeiNo` under the key `SEIOPSVC_KEI_NO` ("seiopsvc_kei_no"). This identifies which billing option service contract line is being cancelled.

4. **Populate application detail number** (L963): Puts `mskmDtlNo` under the key `MSKM_DTL_NO` ("mskm_dtl_no"). This identifies the specific application detail record within the order.

5. **Populate reservation applicable start desired date** (L965): Puts the current operation date (`JCCBPCommon.getOpeDate(null)`) under the key `RSV_TSTA_KIBO_YMD` ("rsv_tsta_kibo_ymd"). This represents the customer's desired start date for the reservation applicable period.

6. **Populate service end date** (L967): Puts the current operation date under the key `SVC_ENDYMD` ("svc_endymd"). This is the date the service officially terminates.

7. **Populate service charge end date** (L969): Puts the service charge end date (`JFUBPCommon.getSvcChrgEndYmdOp(null)`) under the key `SVC_CHRG_ENDYMD` ("svc_chrg_endymd"). This determines when billing for the cancelled service stops.

8. **Populate service cancellation date** (L971): Puts the current operation date under the key `SVC_DSL_YMD` ("svc_dsl_ymd"). This records when the cancellation was processed.

9. **Populate service cancellation reason code** (L973): Puts `CD00879_01 = "01"` under the key `SVC_DLRE_CD` ("svc_dlre_cd"). This hardcoded code represents a standard cancellation reason — likely "customer-initiated cancellation" or "service termination request" (解約理由).

10. **Populate difference classification** (L975): Puts `CD00576_00005 = "00005"` under the key `IDO_DIV` ("ido_div"). This code classifies the type of data difference or change being made — here it represents a new cancellation operation (異動区分).

11. **Populate pre-update datetime** (L977): Puts `updDtm` under the key `UPD_DTM_BF` ("upd_dtm_bf"). This carries forward the timestamp from before the update, enabling optimistic locking and audit trail integrity.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter object that carries all data between processing stages. It holds the shared `HashMap` (retrieved via `getData`) into which mapping items are placed before being passed to the CBS layer. Acts as the primary data container for the request payload. |
| 2 | `fixedText` | `String` | The service message identifier/key used to scope the data within `param`. It acts as a namespace — the same `param` object may hold multiple maps for different CBS messages, and `fixedText` selects the correct one (e.g., the cancellation message map). |
| 3 | `seiOpSvcKeiNo` | `String` | The billing option service contract number (請求オプションサービス契約番号) — a unique identifier for the specific billing option service line (e.g., FTTH internet add-on, email option, TV guide) that is being cancelled. |
| 4 | `updDtm` | `String` | The pre-update timestamp (更新年月日時分秒 — 更新前) representing the last known update datetime of the record before this cancellation operation. Used for optimistic concurrency control and audit trail. |
| 5 | `mskmDtlNo` | `String` | The application detail number (申込明細番号) — identifies the specific application detail record within the order, linking the cancellation to the original service application. |

**External state read:**
- `JPCModelConstant.FUNC_CD_1` = `"1"` — Standard function code for check-and-register operations
- `JFUStrConst.CD00879_01` = `"01"` — Hardcoded service cancellation reason code
- `JFUStrConst.CD00576_00005` = `"00005"` — Hardcoded difference classification code for cancellation
- Operation date derived from `JCCBPCommon.getOpeDate(null)` — system operation date
- Service charge end date derived from `JFUBPCommon.getSvcChrgEndYmdOp(null)` — calculated based on billing rules

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JFUBaseUtil.setFuncCode` | JFUBase | - | Sets function code `"1"` (check & register) on the request parameter for downstream CBS routing |
| R | `JCCBPCommon.getOpeDate` | JCCBP | - | Retrieves the current system operation date to use for reservation start, service end, and cancellation dates |
| R | `JFUBPCommon.getSvcChrgEndYmdOp` | JFUBP | - | Calculates the service charge end date — when billing for the cancelled service terminates |
| R | `param.getData` | - | - | Retrieves the shared `HashMap` from the request parameter, keyed by the service message identifier |

**Note:** This method performs only **parameter assembly** — it does not directly invoke any database-level SC (Service Component) or CBS (Component Business Service) methods. The actual CRUD operations (R/U/D against billing option service tables) are performed downstream by the CBS `EKK0441C230` which consumes the populated map. The `setFuncCode("1")` call signals to the CBS framework that this request requires both validation (check) and data registration.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | JFUCngSeikyushoYohiCC.cngSeikyushoYohi() | `cngSeikyushoYohi` -> `setInMapSeikyOpSvcKeiDsl` | `param.getData [R] -`, `getOpeDate [R] -`, `getSvcChrgEndYmdOp [R] -` |

**Caller Description:**

- **`JFUCngSeikyushoYohiCC.cngSeikyushoYohi()`**: This is the primary processing entry point within the same class. It handles the change-of-billing-information screen workflow, where a customer modifies their billing details. During this process, the method `setInMapSeikyOpSvcKeiDsl` is invoked to prepare the billing option service contract cancellation mapping items that will be submitted to the `EKK0441C230` CBS. The caller passes the current request parameter, the service message key, the billing option service contract number, the pre-update timestamp, and the application detail number.

**Terminal Operations from this Method:**
`getOpeDate` [R], `getOpeDate` [R], `getOpeDate` [R], `getOpeDate` [R], `getSvcChrgEndYmdOp` [R], `param.getData` [R]

## 6. Per-Branch Detail Blocks

This method has **no conditional branching** — it executes a linear sequence of 11 operations (set function code, get map, 8 map.put calls, and implicit return). Below is the detailed block analysis.

**Block 1** — [SET] `(function code setup)` (L956)

> Sets the function code on the request parameter to indicate a check-and-register operation. The function code `"1"` (FUNC_CD_1) signals to the CBS framework that this request requires both validation and data registration.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JFUBaseUtil.setFuncCode(param, fixedText, JPCModelConstant.FUNC_CD_1)` // 機能コード設定(チェック＆登録) [-> FUNC_CD_1="1"] |

**Block 2** — [SET] `(retrieve inbound map)` (L959)

> Retrieves the shared HashMap from the request parameter. This map serves as the payload container for the cancellation CBS message. The map is keyed by the `fixedText` service message identifier.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap inMap = (HashMap)param.getData(fixedText)` // ユーザデータ取得 |

**Block 3** — [SET] `(populate billing option service contract number)` (L961)

> Puts the billing option service contract number into the map. This is the primary identifier for which billing option service (e.g., FTTH, email, TV) is being cancelled.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK0441C230CBSMsg.SEIOPSVC_KEI_NO, seiOpSvcKeiNo)` // 請求オプションサービス契約番号 |

**Block 4** — [SET] `(populate application detail number)` (L963)

> Puts the application detail number into the map. This links the cancellation to the specific line item in the original order.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK0441C230CBSMsg.MSKM_DTL_NO, mskmDtlNo)` // 申込明細番号 |

**Block 5** — [SET] `(populate reservation applicable start desired date)` (L965)

> Puts the current system operation date as the desired start date for the reservation applicable period. This date is fetched from the common business processor.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK0441C230CBSMsg.RSV_TSTA_KIBO_YMD, JCCBPCommon.getOpeDate(null))` // 予約適用開始希望年月日 |

**Block 6** — [SET] `(populate service end date)` (L967)

> Puts the current system operation date as the service end date — the date on which the service officially terminates.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK0441C230CBSMsg.SVC_ENDYMD, JCCBPCommon.getOpeDate(null))` // サービス終了年月日 |

**Block 7** — [SET] `(populate service charge end date)` (L969)

> Puts the service charge end date, calculated by `JFUBPCommon.getSvcChrgEndYmdOp()`. This determines when the customer stops being billed for the cancelled service. The calculation may involve billing cycle rules and proration logic handled internally by the utility method.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK0441C230CBSMsg.SVC_CHRG_ENDYMD, JFUBPCommon.getSvcChrgEndYmdOp(null))` // サービス課金終了年月日 |

**Block 8** — [SET] `(populate service cancellation date)` (L971)

> Puts the current system operation date as the service cancellation date — when the cancellation was processed in the system.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK0441C230CBSMsg.SVC_DSL_YMD, JCCBPCommon.getOpeDate(null))` // サービス解約年月日 |

**Block 9** — [SET] `(populate service cancellation reason code)` (L973)

> Puts a hardcoded cancellation reason code `"01"` (CD00879_01). This represents a standard reason for service cancellation, likely "customer-initiated" or "service termination request".

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK0441C230CBSMsg.SVC_DLRE_CD, JFUStrConst.CD00879_01)` // サービス解約理由コード [-> CD00879_01="01"] |

**Block 10** — [SET] `(populate difference classification)` (L975)

> Puts a hardcoded difference classification code `"00005"` (CD00576_00005). This classifies the type of data change — here indicating a new cancellation operation is being recorded in the audit trail.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK0441C230CBSMsg.IDO_DIV, JFUStrConst.CD00576_00005)` // 異動区分 [-> CD00576_00005="00005"] |

**Block 11** — [SET] `(populate pre-update datetime)` (L977)

> Puts the pre-update timestamp into the map. This carries the last known update datetime of the record before this operation, enabling optimistic concurrency control and providing audit trail data for change tracking.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK0441C230CBSMsg.UPD_DTM_BF, updDtm)` // 更新年月日時分秒(更新前) |

**Block 12** — [RETURN] `(implicit return)` (L978)

> Method completes. The populated `inMap` remains in `param` and is consumed by the caller (`cngSeikyushoYohi`) which subsequently invokes the `EKK0441C230` CBS to persist the cancellation to the database.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return;` // void method — implicit return |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `seiOpSvcKeiNo` | Field | Billing option service contract number (請求オプションサービス契約番号) — unique identifier for a specific optional service line (e.g., FTTH internet, email option, TV guide) attached to a customer's primary billing account. |
| `mskmDtlNo` | Field | Application detail number (申込明細番号) — identifies the specific line item within a customer's service application order. Links the cancellation to the original application record. |
| `updDtm` | Field | Update datetime (更新年月日時分秒) — the last known timestamp when the record was modified. Used for optimistic concurrency control. |
| `updDtmBf` | Field | Pre-update datetime (更新年月日時分秒(更新前)) — the timestamp of the record before the current operation. Enables audit trail and change tracking. |
| `rsv_tsta_kibo_ymd` | Field | Reservation applicable start desired date (予約適用開始希望年月日) — the date from which the customer wants the reservation to become effective. |
| `svc_endymd` | Field | Service end date (サービス終了年月日) — the date on which the service is officially terminated and the customer can no longer use it. |
| `svc_chrg_endymd` | Field | Service charge end date (サービス課金終了年月日) — the date until which the customer is still billed for the service. May differ from svc_endymd due to billing cycle proration. |
| `svc_dsl_ymd` | Field | Service cancellation date (サービス解約年月日) — the date the cancellation was processed in the system. |
| `svc_dlre_cd` | Field | Service cancellation reason code (サービス解約理由コード) — a coded value indicating why the service was cancelled. |
| `ido_div` | Field | Difference classification (異動区分) — categorizes the type of data change being recorded (e.g., new cancellation, modification, deletion). |
| `EKK0441C230CBSMsg` | CBS Message | CBS message schema for billing option service contract cancellation (請求オプションサービス契約解約スキーマ). Defines all fields in the request payload. |
| `FUNC_CD_1` | Constant | Function code `"1"` — indicates check-and-register (チェック＆登録) operation type. Tells the CBS framework to perform both validation and data registration. |
| `CD00879_01` | Constant | Cancellation reason code `"01"` — standard hardcoded reason for service cancellation (likely "customer-initiated" or "service termination request"). |
| `CD00576_00005` | Constant | Difference classification code `"00005"` — classifies the change type as a new cancellation operation in the audit trail. |
| `JCCBPCommon.getOpeDate` | Method | Retrieves the current system operation date (運用日付) — the business date used for all date fields in the request. |
| `JFUBPCommon.getSvcChrgEndYmdOp` | Method | Calculates the service charge end date (サービス課金終了年月日) based on billing cycle rules and the service cancellation date. |
| `IRequestParameterReadWrite` | Interface | Request parameter data container interface. Holds shared data (HashMaps) passed between processing stages (screen -> CC -> CBS). |
| `JFUCngSeikyushoYohiCC` | Class | Change-of-billing-information common component (変更請求書余技CC). Handles all data preparation for the billing information change screen, including add, modify, and cancel operations. |
| CBS | Acronym | Component Business Service — the service layer that handles database CRUD operations and business rule enforcement. |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service offered by K-Opticom. One of the billing option services that can be cancelled. |
| 上りマッピング | Japanese term | Upstream mapping (上りマッピング) — the process of mapping request/screen data into the format expected by the downstream CBS layer. |
| 請求オプションサービス | Japanese term | Billing option service (請求オプションサービス) — optional services附加 to a customer's primary billing plan, such as internet, email, TV, or security services. |
| 解約 | Japanese term | Contract cancellation (解約) — the business process of terminating a service contract and stopping billing. |
