# Business Logic — JKKTvSvcKeiCourceChgCC.courceChange() [209 LOC]

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

## 1. Role

### JKKTvSvcKeiCourceChgCC.courceChange()

The `courceChange` method performs **eo light TV (eo光TV) service detail (service line) source change processing** within the K-Opticom eo Customer Core System (eo顧客基幹システム). It is the central business component for executing changes to a subscriber's TV service contract line items -- including pricing plan modifications, service code updates, and associated data adjustments.

The method implements a **routing/dispatch design pattern**: based on the incoming `pcrs_cd` (price course code), it first resolves the effective pricing plan code (`pplan_cd`) -- either through a special radio trouble case consultation (`EKK0581A010`) for code `"A23"`, or through a general price plan list inquiry (`EKK0591B003`) for all other codes. It then fetches the current service contract details (`EKK0081A010`) and executes the service detail change via `EKK0101C060` (Service Contract - eo light TV > Price Plan Change).

If the operation is **check-only mode** (`func_code = "2"`), the method returns early after the change SC execution, performing no subsequent confirmations. If it is a **full change** (`func_code` other than `"2"`), it optionally executes the price plan change confirmation (`EKK0081C120`) when the application date is not the system maximum (`"20991231"`) and no work charge is pending (`koji_um` check). It also handles **STB (Set-Top Box) removal** special logic, adjusting the reservation application date and setting the `STB_TEKKYO_YMD` field appropriately. Finally, if a station application reservation exists (`cdbs_stch_set_mskm_um = "1"`), it delegates to `addMkjAddfKeiRvStarCh` and `addMkjAddfKeiRvStarCh2` for additional reservation start processing.

This is a **shared utility component** called by multiple screen operation classes (KKSV0311, KKSV0312, KKSV0674, KKSV1059), making it a critical entry point for all TV service line source change operations across the system.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["courceChange starts"])

    START --> INIT["Initialize: get ccMsg, workMap, tmpWorkMap, scCall, opeDate"]
    INIT --> GET_PCRS["Get pcrsCode from ccMsg"]

    GET_PCRS --> PCRS_CHECK{pcrsCode equals A23?}

    PCRS_CHECK -- "Yes: Radio trouble case" --> PCRS_A23["EKK0581A010: Radio trouble case consent consultation"]
    PCRS_A23 --> GET_PP_A23["Set pplan_cd from EKK0581A010OUT"]

    PCRS_CHECK -- "No: General plan inquiry" --> PCRS_OTHER["EKK0591B003: Price plan list inquiry"]
    PCRS_OTHER --> GET_PP_OTHER["Set pplan_cd from EKK0591B003OUT"]

    GET_PP_A23 --> SVC_QUERY["EKK0081A010: Service contract inquiry"]
    GET_PP_OTHER --> SVC_QUERY

    SVC_QUERY --> GET_CUR["Get curSvcKeiInfo"]

    GET_CUR --> COURCE_IN["Build EKK0101C060IN: Service contract eoTV price plan change"]
    COURCE_IN --> STB_CHECK{stbTekkyoFlg equals 1?}

    STB_CHECK -- "Yes: STB removal" --> STB_YES["Get chrgEndYmd, calculate rsvAplyYmd, set STB_TEKKYO_YMD"]
    STB_CHECK -- "No: Normal change" --> STB_NO["Use rsv_aply_ymd from ccMsg directly"]

    STB_YES --> COURCE_OUT["EKK0101C060: Execute price plan change"]
    STB_NO --> COURCE_OUT

    COURCE_OUT --> SAVE_DTM["Save work_upd_dtm to workMap and tmpWorkMap"]

    SAVE_DTM --> FUNC_CHECK{func_code equals 2?}

    FUNC_CHECK -- "Yes" --> EARLY_RETURN["Return param early - no further processing"]
    FUNC_CHECK -- "No" --> STB_REM_CHECK{stbTekkyoFlg is true?}

    STB_REM_CHECK -- "No: Normal" --> KOJI_CHECK{koji_um null or empty or 0?}
    STB_REM_CHECK -- "Yes: STB removal" --> SKIP_PLAN_CHANGE["Skip price plan change confirmation"]

    KOJI_CHECK -- "Yes: No work" --> APLY_CHECK{rsv_aply_ymd not 20991231?}
    KOJI_CHECK -- "No: Work needed" --> APLY_CHECK

    APLY_CHECK -- "Yes: Immediate application" --> PLAN_CHANGE["EKK0081C120: Price plan change confirmation"]
    APLY_CHECK -- "No: Max date" --> STCH_SET_CHECK{cdbs_stch_set_mskm_um equals 1?}

    PLAN_CHANGE --> SAVE_PLAN_DTM["Save work_upd_dtm from plan change result"]

    SAVE_PLAN_DTM --> STCH_SET_CHECK
    SKIP_PLAN_CHANGE --> STCH_SET_CHECK

    STCH_SET_CHECK -- "Yes: Station" --> STCH_PROC["addMkjAddfKeiRvStarCh + addMkjAddfKeiRvStarCh2"]
    STCH_SET_CHECK -- "No" --> FINAL_RETURN

    STCH_PROC --> FINAL_RETURN["Return param"]
    EARLY_RETURN --> FINAL_RETURN

    FINAL_RETURN --> END(["courceChange ends"])
```

### Processing Flow Summary

1. **Initialization** -- Extract the `ccMsg` HashMap from the parameter using the `fixedText` key, obtain the mapping work area and temporary work map (`"WORK"`), create a `ServiceComponentRequestInvoker` for SC invocations, and retrieve the operational date.

2. **PCRS Code Routing** -- Check if `pcrs_cd` equals `"A23"` (radio trouble case). If yes, call `EKK0581A010` (Radio Trouble Case Consent Consultation) to resolve the desired plan code. Otherwise, call `EKK0591B003` (Price Plan List Inquiry) to get the plan code. The result is stored in `ccMsg["pplan_cd"]`.

3. **Service Contract Inquiry** -- Call `EKK0081A010` (Service Contract Inquiry) with func_code `"2"` to retrieve current service detail information into `curSvcKeiInfo`.

4. **Source Change Execution** -- Build the input for `EKK0101C060` (Service Contract -- eo light TV > Price Plan Change). For **STB removal** (`stbTekkyo_flg = "1"` / STB撤去): calculate the reservation application date by adding one month to the charge end date's first day (with fallback to `"20991231"` if the charge end date is null/empty). Otherwise, use `rsv_aply_ymd` from `ccMsg` directly. Execute the SC and save the returned `upd_dtm` to both `workMap` and `tmpWorkMap`.

5. **Check-Only Guard** -- If `func_code` equals `"2"` (チェックのみ / check only), return the param immediately, skipping all subsequent processing.

6. **Non-STB-Removal Processing** -- When `stbTekkyoFlg` is false and the reservation application date is not the system maximum (`"20991231"`), execute `EKK0081C120` (Service Contract Price Plan Change Confirmation) with appropriate flags (`koji_um`, `kkshka_um`, `sokuji_aply_um`). Save the returned `upd_dtm`.

7. **Station Application Processing** -- If `cdbs_stch_set_mskm_um` equals `"1"` (スタッチャ申込あり / station application exists), call `addMkjAddfKeiRvStarCh` and `addMkjAddfKeiRvStarCh2` to register contract reservation start content for non-registration-possible contracts at application time.

8. **Return** -- Return the modified `param` object.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle for SC invocations; carries the database connection context, transaction boundary, and operator identity for all service component calls. |
| 2 | `param` | `IRequestParameterReadWrite` | Request/response parameter object that carries business data (via `getData()` / `setData()`), mapping work area (via `getMappingWorkArea()`), control map data (operator, operation date, host info), and error information. Contains the `ccMsg` HashMap keyed by `fixedText`, `workMap`, and `tmpWorkMap` (key `"WORK"`). |
| 3 | `fixedText` | `String` | The data map key used to identify this operation's message bundle within `param`. It is used to retrieve and store the `ccMsg` HashMap which carries all input business data fields (e.g., `pcrs_cd`, `svc_kei_no`, `func_code`, `rsv_aply_ymd`). |

**Instance fields / external state read:**

| Field/State | Source | Business Description |
|------------|--------|---------------------|
| `TEMPLATE_ID_EKK0101C060` | Constant in this class | Template ID `"EKK0101C060"` for the service change SC message |
| `TEMPLATE_ID_EKK0081A010` | Constant in this class | Template ID `"EKK0081A010"` for the service contract inquiry SC message |
| `TEMPLATE_ID_EKK0081C120` | Constant in this class | Template ID `"EKK0081C120"` for the price plan change confirmation SC message |
| `TEMPLATE_ID_EKK0581A010` | Constant in this class | Template ID `"EKK0581A010"` for the radio trouble case consultation SC message |
| `TEMPLATE_ID_EKK0591B003` | Constant in this class | Template ID `"EKK0591B003"` for the price plan list inquiry SC message |
| `STB_TEKKYO` | Constant in this class | Value `"1"` -- flag indicating STB removal (STB撤去) |
| `JPCBPCommon.getOpeDate()` | Called method | Returns the operational date (運用日) from the control map |
| `JKKBpCommon.getChrgEndYmd()` | Called method | Returns the charge end date (請求終了年月日) for date calculations |
| `JPCDateUtil.addMonth()` | Called method | Adds a specified number of months to a date string |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `EKK0581A010CBS` | EKK0581A010SC | KK_T_DMPS_ANKEN (trouble case / 災害案件) | Radio trouble case consent consultation -- inquires trouble case details and retrieves the desired plan code (DMPS_ANKEN_AITAI_PPLAN_CD) |
| R | `EKK0591B003CBS` | EKK0591B003SC | KK_T_PRCRS_CD_PRCP (price course / 料金コース) | Price plan list inquiry -- retrieves pricing plan code (PPLAN_CD) for the given PCRS code (PCRS_CD) |
| R | `EKK0081A010CBS` | EKK0081A010SC | KK_T_SVC_KEI (service detail / サービス契約) | Service contract inquiry -- retrieves current service detail information (service number, state, service code, price group code, etc.) |
| C/U | `EKK0101C060CBS` | EKK0101C060SC | KK_T_SVC_KEI (service detail / サービス契約) | Service contract -- eo light TV price plan change -- modifies the service contract's pricing plan, service code, reservation application date, penalty status, etc. |
| C/U | `EKK0081C120CBS` | EKK0081C120SC | KK_T_SVC_KEI (service detail / サービス契約) | Service contract price plan change confirmation -- finalizes the price plan change with auto-application rules |
| C | `addMkjAddfKeiRvStarCh` | (internal) | KK_T_MKJ_ADDF_KEI_RV_STAR (reservation start / 予約開始) | Registers contract reservation start content for non-registration-possible contracts at application time (station application flow) |
| C | `addMkjAddfKeiRvStarCh2` | (internal) | KK_T_MKJ_ADDF_KEI_RV_STAR2 (reservation start detail / 予約開始詳細) | Additional registration for reservation start (IT1-2014-0000259 countermeasure -- TV new source /スカパー導入対応) |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0311 | `KKSV0311OPOperation` (CCRequestBroker target13) -> `JKKTvSvcKeiCourceChgCC.courceChange` | EKK0101C060SC [C/U] KK_T_SVC_KEI, EKK0081A010SC [R] KK_T_SVC_KEI, EKK0591B003SC [R] KK_T_PRCRS_CD_PRCP, EKK0581A010SC [R] KK_T_DMPS_ANKEN, EKK0081C120SC [C/U] KK_T_SVC_KEI |
| 2 | Screen:KKSV0312 | `KKSV0312OPOperation` (CCRequestBroker target11) -> `JKKTvSvcKeiCourceChgCC.courceChange` | EKK0101C060SC [C/U] KK_T_SVC_KEI, EKK0081A010SC [R] KK_T_SVC_KEI, EKK0591B003SC [R] KK_T_PRCRS_CD_PRCP, EKK0581A010SC [R] KK_T_DMPS_ANKEN, EKK0081C120SC [C/U] KK_T_SVC_KEI |
| 3 | Screen:KKSV0674 | `KKSV0674OPOperation` (CCRequestBroker target31) -> `JKKTvSvcKeiCourceChgCC.courceChange` | EKK0101C060SC [C/U] KK_T_SVC_KEI, EKK0081A010SC [R] KK_T_SVC_KEI, EKK0591B003SC [R] KK_T_PRCRS_CD_PRCP, EKK0581A010SC [R] KK_T_DMPS_ANKEN, EKK0081C120SC [C/U] KK_T_SVC_KEI |
| 4 | Screen:KKSV1059 | `KKSV1059OPOperation` (CCRequestBroker target5) -> `JKKTvSvcKeiCourceChgCC.courceChange` | EKK0101C060SC [C/U] KK_T_SVC_KEI, EKK0081A010SC [R] KK_T_SVC_KEI, EKK0591B003SC [R] KK_T_PRCRS_CD_PRCP, EKK0581A010SC [R] KK_T_DMPS_ANKEN, EKK0081C120SC [C/U] KK_T_SVC_KEI |

## 6. Per-Branch Detail Blocks

**Block 1** — SET (initialization) (L100)

> Initialize all working data structures and obtain the operational date.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMapKey = fixedText` |
| 2 | EXEC | `ccMsg = (HashMap) param.getData(dataMapKey)` -- Extract ccMsg HashMap from param [-> dataMapKey = fixedText] |
| 3 | SET | `workMap = (Map) param.getMappingWorkArea()` |
| 4 | SET | `tmpWorkMap = (HashMap) param.getData("WORK")` |
| 5 | SET | `scCall = new ServiceComponentRequestInvoker()` -- Instantiate SC call invoker (SC呼び出し部品 -- pass class name to constructor; log outputs empty string) (インスタンス生成：引数にはログに出力するクラスタイプを渡す) |
| 6 | SET | `opeDate = JPCBPCommon.getOpeDate(null)` -- Get operational date (運用日) |

**Block 2** — IF-ELSE-IF (PCRS code routing) (L106)

> Route to the appropriate SC for retrieving the pricing plan code based on the PCRS code. If `pcrs_cd` equals `"A23"`, it's a radio trouble case; otherwise, do a general price plan inquiry.

| # | Type | Code |
|---|------|------|
| 1 | SET | `pcrsCode = (String) ccMsg.get("pcrs_cd")` |
| 2 | IF | `STB_TEKKYO` check is not done here; this is the PCRS check |

**Block 2.1** — IF branch: `pcrsCode` equals `"A23"` (radio trouble case) (L108) [PCRS_CD_A23 = "A23"]

> Radio trouble case consent consultation. Call EKK0581A010 and extract the desired plan code from the output.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0581a010IN = new CAANMsg(EKK0581A010CBSMsg.class.getName())` |
| 2 | EXEC | `ekk0581a010IN.set(EKK0581A010CBSMsg.TEMPLATEID, TEMPLATE_ID_EKK0581A010)` |
| 3 | EXEC | `ekk0581a010IN.set(EKK0581A010CBSMsg.FUNC_CODE, "1")` |
| 4 | EXEC | `ekk0581a010IN.set(EKK0581A010CBSMsg.KEY_DMPS_ANKEN_NO, ccMsg.get("dmps_anken_no"))` |
| 5 | CALL | `ekk0581a010OUTLIST = callSC(handle, scCall, param, dataMapKey, ekk0581a010IN)` -- EKK0581A010: Radio trouble case consent consultation |
| 6 | IF | Check `ekk0581a010OUTLIST != null && ekk0581a010OUTLIST.length > 0` |
| 7 | SET | `ekk0581a010OUT = ekk0581a010OUTLIST[0]` |
| 8 | EXEC | `ccMsg.put("pplan_cd", ekk0581a010OUT.getString(EKK0581A010CBSMsg1List.DMPS_ANKEN_AITAI_PPLAN_CD))` |

**Block 2.2** — ELSE branch: general price plan inquiry (L122) [PCRS_CD != "A23"]

> General price plan list inquiry. Call EKK0591B003 and extract the plan code.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0591b003IN = new CAANMsg(EKK0591B003CBSMsg.class.getName())` |
| 2 | EXEC | `ekk0591b003IN.set(EKK0591B003CBSMsg.TEMPLATEID, TEMPLATE_ID_EKK0591B003)` |
| 3 | EXEC | `ekk0591b003IN.set(EKK0591B003CBSMsg.FUNC_CODE, "1")` |
| 4 | EXEC | `ekk0591b003IN.set(EKK0591B003CBSMsg.KEY_PCRS_CD, pcrsCode)` |
| 5 | CALL | `ekk0591b003OUT = callSC(handle, scCall, param, dataMapKey, ekk0591b003IN)` -- EKK0591B003: Price plan list inquiry |
| 6 | EXEC | `ccMsg.put("pplan_cd", ekk0591b003OUT.getString(EKK0591B003CBSMsg1List.PPLAN_CD))` |

**Block 3** — SET (Service contract inquiry -- unconditional) (L135)

> Query the current service contract details using EKK0081A010 with func_code `"2"`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0081a010IN = new CAANMsg(EKK0081A010CBSMsg.class.getName())` |
| 2 | EXEC | `ekk0081a010IN.set(EKK0081A010CBSMsg.TEMPLATEID, TEMPLATE_ID_EKK0081A010)` |
| 3 | EXEC | `ekk0081a010IN.set(EKK0081A010CBSMsg.FUNC_CODE, "2")` |
| 4 | EXEC | `ekk0081a010IN.set(EKK0081A010CBSMsg.KEY_SVC_KEI_NO, ccMsg.get("svc_kei_no"))` |
| 5 | EXEC | `ekk0081a010IN.set(EKK0081A010CBSMsg.KEY_GENE_ADD_DTM, "")` |
| 6 | EXEC | `ekk0081a010IN.set(EKK0081A010CBSMsg.KEY_RSV_APLY_YMD, opeDate)` |
| 7 | CALL | `curSvcKeiInfo = callSC(handle, scCall, param, dataMapKey, ekk0081a010IN)` -- EKK0081A010: Service contract inquiry |

**Block 4** — SET (Build EKK0101C060 input) (L143)

> Build input for the service detail source change SC.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0101c060IN = new CAANMsg(EKK0101C060CBSMsg.class.getName())` |
| 2 | EXEC | `ekk0101c060IN.set(EKK0101C060CBSMsg.TEMPLATEID, TEMPLATE_ID_EKK0101C060)` |
| 3 | EXEC | `ekk0101c060IN.set(EKK0101C060CBSMsg.FUNC_CODE, ccMsg.get("func_code"))` |
| 4 | EXEC | `ekk0101c060IN.set(EKK0101C060CBSMsg.SVC_KEI_NO, ccMsg.get("svc_kei_no"))` |
| 5 | EXEC | `ekk0101c060IN.set(EKK0101C060CBSMsg.MSKM_DTL_NO, workMap.get("mskm_dtl_no"))` |
| 6 | EXEC | `ekk0101c060IN.set(EKK0101C060CBSMsg.PRC_GRP_CD, ccMsg.get("prc_grp_cd"))` |
| 7 | EXEC | `ekk0101c060IN.set(EKK0101C060CBSMsg.PCRS_CD, ccMsg.get("pcrs_cd"))` |
| 8 | EXEC | `ekk0101c060IN.set(EKK0101C060CBSMsg.PPLAN_CD, ccMsg.get("pplan_cd"))` |
| 9 | EXEC | `ekk0101c060IN.set(EKK0101C060CBSMsg.TK_HOSHIKI_KEI_NO, ccMsg.get("tk_hoshiki_kei_no"))` |
| 10 | EXEC | `ekk0101c060IN.set(EKK0101C060CBSMsg.PNLTY_HASSEI_CD, ccMsg.get("pnlty_hassei_cd"))` |
| 11 | EXEC | `ekk0101c060IN.set(EKK0101C060CBSMsg.IDO_DIV, ccMsg.get("ido_div"))` |
| 12 | EXEC | `ekk0101c060IN.set(EKK0101C060CBSMsg.DMPS_ANKEN_NO, ccMsg.get("dmps_anken_no"))` |
| 13 | EXEC | `ekk0101c060IN.set(EKK0101C060CBSMsg.UPD_DTM_BF, ccMsg.get("upd_dtm_bf"))` |

**Block 5** — IF-ELSE (STB removal date logic) (L159) [OM-2016-0001853 version change]

> For STB removal (STB撤去), calculate the reservation application date from the charge end date. For normal changes, use `rsv_aply_ymd` from ccMsg directly.

| # | Type | Code |
|---|------|------|
| 1 | IF | `STB_TEKKYO.equals(ccMsg.get("stb_tekkyo_flg"))` [STB_TEKKYO = "1"] |
| 2 | SET | `chrgEndYmd = JKKBpCommon.getChrgEndYmd((String)ccMsg.get("stb_tekkyo_ymd"))` |
| 3 | IF | ANK-4673-00-02 fix: `chrgEndYmd == null || "".equals(chrgEndYmd)` |
| 4 | SET | `rsvAplyYmd = "20991231"` -- Fallback to max date [ANK-4673-00-02] |
| 5 | ELSE | `rsvAplyYmd = JPCDateUtil.addMonth(chrgEndYmd.substring(0, 6) + "01", 1)` -- Add 1 month to charge end date's first day |
| 6 | EXEC | `ekk0101c060IN.set(EKK0101C060CBSMsg.RSV_APLY_YMD, rsvAplyYmd)` |
| 7 | ELSE (stbTekkyo) | `ekk0101c060IN.set(EKK0101C060CBSMsg.RSV_APLY_YMD, ccMsg.get("rsv_aply_ymd"))` |

**Block 6** — IF (STB removal flag -- v7.00.00 addition) (L173)

> Separate STB removal flag check for setting the STB removal date field. This is a v7.00.00 addition for STB removal source change.

| # | Type | Code |
|---|------|------|
| 1 | SET | `stbTekkyoFlg = false` |
| 2 | IF | `ccMsg.get("stb_tekkyo_flg") != null` |
| 3 | IF | `STB_TEKKYO.equals((String)ccMsg.get("stb_tekkyo_flg"))` [STB_TEKKYO = "1"] |
| 4 | SET | `stbTekkyoFlg = true` |
| 5 | IF | `stbTekkyoFlg` is true |
| 6 | IF | ANK-4673-00-02: `ccMsg.get("stb_tekkyo_ymd") != null && !"".equals(...)` |
| 7 | EXEC | `ekk0101c060IN.set(EKK0101C060CBSMsg.STB_TEKKYO_YMD, ccMsg.get("rsv_aply_ymd"))` -- Set STB removal date (v7.00.01 correction) |

**Block 7** — CALL (Execute EKK0101C060) (L196)

> Execute the service detail source change SC.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `ekk0101c060OUT = callSC(handle, scCall, param, dataMapKey, ekk0101c060IN)` -- EKK0101C060: Service contract eo light TV price plan change |

**Block 8** — SET (Save update timestamp) (L198)

> Save the returned update timestamp to both work maps.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `workMap.put("work_upd_dtm", ekk0101c060OUT.getString(EKK0101C060CBSMsg.UPD_DTM))` |
| 2 | EXEC | `tmpWorkMap.put("work_upd_dtm", ekk0101c060OUT.getString(EKK0101C060CBSMsg.UPD_DTM))` |

**Block 9** — IF (Check-only mode early return) (L202)

> If `func_code` equals `"2"` (チェックのみ / check only), return immediately without further processing.

| # | Type | Code |
|---|------|------|
| 1 | IF | `STB_TEKKYO != "2"`: ` "2".equals(ccMsg.get("func_code"))` [func_code = "2" (チェックのみ)] |
| 2 | RETURN | `return param` -- Early return for check-only mode |

**Block 10** — IF (Non-STB-removal processing) (L208) [v7.00.00 change block]

> When NOT STB removal, optionally execute the price plan change confirmation.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!stbTekkyoFlg` -- Not STB removal (STB撤去以外の場合) |
| 2 | SET | `kojiChk = false` |
| 3 | IF | `ccMsg.get("koji_um") == null || "".equals(...) || "0".equals(...)` |
| 4 | SET | `kojiChk = true` [v6.00.00 fix] |
| 5 | IF | `rsv_aply_ymd != "20991231" &&ojiChk` -- Not max date and no work needed |
| 6 | SET | `ekk0081c120IN = new CAANMsg(EKK0081C120CBSMsg.class.getName())` |
| 7 | EXEC | Set TEMPLATEID, FUNC_CODE, SVC_KEI_NO, RSV_APLY_YMD, UPD_DTM_BF, RULE0059_AUTO_APLY="0", RULE0079_AUTO_APLY="0" |
| 8 | IF | `koji_um == null || "".equals(koji_um)` -- v6.00.00 fix |
| 9 | EXEC | `ekk0081c120IN.set(EKK0081C120CBSMsg.KOJI_UM, "0")` |
| 10 | ELSE | `ekk0101c060IN.set(EKK0081C120CBSMsg.KOJI_UM, ccMsg.get("koji_um"))` |
| 11 | EXEC | `ekk0081c120IN.set(EKK0081C120CBSMsg.KKSHKA_UM, "0")` |
| 12 | IF | ANK-4592-00-00: `!JKKStringUtil.isNullBlank((String)ccMsg.get("sokuji_aply_um"))` |
| 13 | EXEC | `ekk0081c120IN.set(EKK0081C120CBSMsg.RULE0065_SOKUJI_APLY_UM, ccMsg.get("sokuji_aply_um"))` |
| 14 | CALL | `ekk0081c120OUT = callSC(...)` -- EKK0081C120: Service contract price plan change confirmation |
| 15 | EXEC | `workMap.put("work_upd_dtm", ekk0081c120OUT.getString(EKK0081C120CBSMsg.UPD_DTM))` |
| 16 | EXEC | `tmpWorkMap.put("work_upd_dtm", ekk0081c120OUT.getString(EKK0081C120CBSMsg.UPD_DTM))` |

**Block 11** — IF (Station application processing) (L236) [ANK-2135-00-00 v10.00.00]

> When a station application reservation exists (`cdbs_stch_set_mskm_um = "1"`), delegate to helper methods.

| # | Type | Code |
|---|------|------|
| 1 | IF | `ccMsg.get("cdbs_stch_set_mskm_um") != null && "1".equals(...)` [スタッチャ申込あり -- station application exists] |
| 2 | CALL | `addMkjAddfKeiRvStarCh(param, fixedText, handle, workMap, curSvcKeiInfo)` -- Register contract reservation start for non-registration-possible contracts |
| 3 | CALL | `addMkjAddfKeiRvStarCh2(param, fixedText, handle, workMap, curSvcKeiInfo)` -- Additional registration (IT1-2014-0000259 / TV new source Scapar introduction) |

**Block 12** — SET (Get mskm_no, comment about discount auto-application) (L242)

> Retrieve the application number and note that the discount CC is intentionally not called (reservation data creation time).

| # | Type | Code |
|---|------|------|
| 1 | SET | `mskmNo = (String) workMap.get("mskm_no")` |
| 2 | COMMENT | `execWrisvcAutoAply` is commented out -- Discount CC is not executed at reservation data creation time (予約データ作成時は割引CCを実行しない) |

**Block 13** — RETURN (L247)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return param` -- Return modified parameter object |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `pcrs_cd` | Field | Price course code (料金コースコード) -- Classifies the type of pricing plan (e.g., FTTH, Mail, ENUM). Used to route to the correct price plan inquiry SC. |
| `pplan_cd` | Field | Pricing plan code (料金プランコード) -- The specific pricing plan identifier resolved from the SC inquiry. |
| `svc_kei_no` | Field | Service detail number (サービス契約番号) -- Unique identifier for a service contract line item. |
| `svc_kei_ucwk_no` | Field | Service detail work number (サービス契約作業番号) -- Internal tracking ID for service contract line item operations. |
| `func_code` | Field | Function code (機能コード) -- `"1"` = full change processing (変更処理), `"2"` = check-only mode (チェックのみ). Controls whether the method returns early after the SC execution. |
| `rsv_aply_ymd` | Field | Reservation application date (予約適用年月日) -- The date when the change takes effect. `"20991231"` is the system maximum date indicating no immediate application needed. |
| `stb_tekkyo_flg` | Field | STB delivery flag (STB配送フラグ) -- `"1"` indicates STB removal processing (STB撤去). Controls date calculation logic for the reservation application date. |
| `stb_tekkyo_ymd` | Field | STB removal date (STB撤去年月日) -- The date the STB removal was performed, used as the basis for calculating the next month's application date. |
| `koji_um` | Field | Work charge user modification flag (工事費用戶側変更フラグ) -- Non-empty/non-zero value indicates work charges need user-side modification processing. |
| `cdbs_stch_set_mskm_um` | Field | CDBS station application application number user modification (CDBS設置申込申請番号用戶側変更フラグ) -- `"1"` indicates a station application reservation exists, triggering additional reservation start processing. |
| `sokuji_aply_um` | Field | Emergency application user modification flag (即済申請用戶側変更フラグ) -- Flag for immediate application processing in the new TV source (スカパー) introduction. |
| `dmps_anken_no` | Field | Disaster case number (災害案件番号) -- Identifier for radio trouble/disaster cases. Used in EKK0581A010 consultation. |
| `ido_div` | Field | Change type division (異動区分) -- Indicates the type of change (e.g., new, transfer, cancellation). |
| `upd_dtm_bf` | Field | Update date/time before (更新日時前) -- The previous update timestamp, used for optimistic concurrency control. |
| `mskm_no` | Field | Application number (申請番号) -- Unique identifier for the application/order. |
| `mskm_dtl_no` | Field | Application detail number (申請詳細番号) -- Detail line item identifier within an application. |
| `prc_grp_cd` | Field | Price group code (料金グループコード) -- Groups pricing plans into logical families. |
| `tk_hoshiki_kei_no` | Field | Transmission arrangement service detail number (伝送方式サービス番号) -- Identifies the transmission arrangement service type. |
| `pnlty_hassei_cd` | Field | Penalty occurrence code (ペナルティ発生コード) -- Indicates whether penalties apply to the change. |
| STB_TEKKYO | Constant | STB removal (STB撤去) -- Value `"1"` indicates the subscriber is returning/removing the Set-Top Box. |
| STB | Acronym | Set-Top Box -- Cable box device for receiving digital TV signals. |
| FTTH | Business term | Fiber To The Home -- Fiber-optic broadband internet service offered by K-Opticom. |
| PCRS | Acronym | Price Course (料金コース) -- Pricing plan classification category. |
| PPLAN | Acronym | Pricing Plan (料金プラン) -- Specific pricing plan identifier. |
| SOD | Acronym | Service Order Data (サービスオーダーデータ) -- Telecom order fulfillment entity. |
| EKK0101C060 | SC Code | Service Contract - eo light TV > Price Plan Change (サービス契約 > eo光TV > 料金プラン変更) -- Core SC for modifying TV service detail source. |
| EKK0081A010 | SC Code | Service Contract Inquiry (サービス契約照会) -- Inquires current service contract details. |
| EKK0081C120 | SC Code | Service Contract Price Plan Change Confirmation (サービス契約料金プラン変更確定) -- Finalizes the price plan change confirmation. |
| EKK0581A010 | SC Code | Radio Trouble Case Consent Consultation (電話障害案件一任照会) -- Consults disaster/radio trouble case for plan resolution. |
| EKK0591B003 | SC Code | Price Plan List Inquiry (料金プラン一覧照会) -- General price plan list inquiry SC. |
| EKK0591 | SC Prefix | Price Course/Plan (料金コース) |
| KK_T_SVC_KEI | Table | Service Detail Table (サービス契約マスタ) -- Core table storing service contract line item records. |
| KK_T_PRCRS_CD_PRCP | Table | Price Course Code Pricing Table (料金コースコード料金マスタ) -- Maps price course codes to pricing plans. |
| KK_T_DMPS_ANKEN | Table | Disaster Case Table (災害案件マスタ) -- Stores radio trouble/disaster case records. |
| KK_T_MKJ_ADDF_KEI_RV_STAR | Table | Marketing Additional Service Reservation Start Table (マーケティング追加サービス予約開始マスタ) -- Reservation start records for station application. |
| CC | Acronym | Common Component (共通コンポーネント) -- Shared business logic component in the Fujurity framework. |
| SC | Acronym | Service Component (サービスコンポーネント) -- Service layer component that handles data access and business logic. |
| CBS | Acronym | Component Business Service (コンポーネントビジネスサービス) -- The message-based interface to an SC. |
| CAANMsg | Class | Canonical message object -- The framework's message container for SC input/output data. |
| カスタマー | Term | Customer (顧客) -- The subscriber/end-user of K-Opticom services. |
| 運用日 | Term | Operational Date (Operational date) -- The system date used for transaction processing, obtained from JPCBPCommon. |
| 料金プラン変更 | Term | Price Plan Change -- The business operation of modifying a subscriber's pricing plan for their TV service. |
| STB撤去 | Term | STB Removal -- Process where a subscriber returns/removes the Set-Top Box, requiring special date calculation logic. |
| チェックのみ | Term | Check Only -- Mode where the method executes the SC for validation but does not commit any downstream changes. |
| 予約適用年月日 | Term | Reservation Application Date -- The date when a service change takes effect. |
| 災害案件 | Term | Disaster Case -- A case related to radio trouble or natural disaster affecting service delivery. |
| 工事費 | Term | Construction Cost (工事費用) -- Installation/construction charges for equipment setup. |
| スカパー | Term | SKY PerfecTV! -- Satellite broadcasting service. The "スカパー導入" refers to introducing this service. |
| スタッチャ申込 | Term | Station Application (設置申込) -- Application for installing equipment at a subscriber's location. |
| 割引サービス自動適用 | Term | Discount Service Auto-Application -- Process of automatically applying discounts to service contracts (commented out in current code). |
