
# Business Logic — JKKKikiIchiranIkkatsuCC.execTvCourseChangeYouhiUpdate() [403 LOC]

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

## 1. Role

### JKKKikiIchiranIkkatsuCC.execTvCourseChangeYouhiUpdate()

This method performs the **update execution phase** of an e-Hikari TV (eo TV) service contract course change confirmation screen. After all validation checks (executed by the caller `execTvCourseChangeYouhi`) have passed, this method commits the course change by routing business logic across multiple service component calls based on the work status (`kojiHandan`) and the target course change content (`pcrsCdAf`). It handles four distinct work scenario branches: (1) when there are ongoing construction works (`KOJI_ARI` with `kojiakSbtCd` subtypes "001" for new installation, "011" for service addition, "003" for address change, "013" for eo TV change); (2) when there are no ongoing works but there is a pending anomaly reservation (`ekk1681b001cbsMsg1list` present) with specific movement division codes; and (3) when there are no ongoing works and no anomaly reservations, a default course change update is executed. For premium digital/BS courses (A37, A75, A23), it additionally calculates the earliest contract termination date from the course change cancellation list and derives the billing end date and installment start date. The method implements a **routing/dispatch pattern**, delegating to specialized service components: `execEKK0101C050` for procedural fee plan changes, `execEKK0101C060` for price plan changes, `execEKK0081C130` for course change cancellation, `execEKK0081C120` for price plan confirmation, and `execEKK1091D010Tv` for progress registration. Finally, it calls `setSvcUpDtmSvcKei` to update the service contract data modification timestamp.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["execTvCourseChangeYouhiUpdate params"])

    START --> GET["Get ccMsg from temporaryData"]
    GET --> PARSE["Parse pcrsArray and pcrsAfArray"]
    PARSE --> GET_EKK0081["Get EKK0081A010 CBS message from temporaryData"]
    GET_EKK0081 --> GET_EKK0101["Get EKK0101A010 CBS message from temporaryData"]
    GET_EKK0101 --> GET_DMPS["Get dmpsAnkenNo from EKK0101A010"]
    GET_DMPS --> SET_VARS["Set local vars to empty strings"]
    SET_VARS --> GET_TEMP["Get EKK1681B001_TV and EKU0011B030 from temporaryData"]
    GET_TEMP --> SVC_UPDTM["Call setSvcUpDtmSvcKei"]

    SVC_UPDTM --> CHK_PCRS{pcrsCdAf is A37 or A75 or A23?}

    CHK_PCRS -->|True: TV course| LOOP_CANDEL["Loop courseChangeCanDelList for latest kiki_tk_end_ymd"]
    CHK_PCRS -->|False| ELSE_FALSE["Set rsvAplyYmd=20991231 and tukihajimeDay empty"]

    LOOP_CANDEL --> CHK_PAST{isPastDate newkiki_tk_end_ymd vs unyo_ymd?}

    CHK_PAST -->|True| CALC_DATE["Get svcStaYmd from EKK0081A010"]
    CALC_DATE --> CHRG_END["Calculate staChrgEndYmd via getChrgEndYmd"]
    CHRG_END --> RSV_APLY["Calculate rsvAplyYmd via addMonth"]
    RSV_APLY --> TUKI_HAJIME["Set tukihajimeDay=rsvAplyYmd, pastDateFlg=true"]

    CHK_PAST -->|False| SET_FUTURE["Set rsvAplyYmd=20991231 and tukihajimeDay empty"]

    ELSE_FALSE --> CHK_KOJI{kojiHandan equals KOJI_ARI?}

    TUKI_HAJIME --> CHK_KOJI
    SET_FUTURE --> CHK_KOJI

    CHK_KOJI -->|True: KOJI_ARI| GET_KOJI_INFO["Get kojiakSbtCd, kojiUkOptntyIdoDiv, kojiakNo, rnkiSvcKeiNo from EKU0011B030"]
    CHK_KOJI -->|False: KOJI_NASHI| CHK_NON_KOJI

    GET_KOJI_INFO --> CALL_EKU0091B020["Call execEKU0091B020 for kojiakNo"]
    CALL_EKU0091B020 --> GET_MSKM["Set mskmDtlNo from EKU0091B020 result"]

    GET_MSKM --> CHK_KOJIAK_SBT{kojiakSbtCd is 001 or 011?}

    CHK_KOJIAK_SBT -->|True| CALL_C050_NEW["Call execEKK0101C050"]
    CHK_KOJIAK_SBT -->|False| CHK_JUUSYO{kojiakSbtCd is 003?}

    CALL_C050_NEW --> CHK_EO_TV{kojiakSbtCd is 013?}

    CHK_JUUSYO -->|True| CHK_EKK1681{ekk1681b001cbsMsg1list != null?}
    CHK_JUUSYO -->|False| CHK_EO_TV2{kojiakSbtCd is 013?}

    CHK_EKK1681 -->|True| CALL_C050_JUUSHO["Call execEKK0101C050"]
    CHK_EKK1681 -->|False| CALL_C060_JUUSHO["Call execEKK0101C060 with IDO_DIV 00019"]

    CALL_C050_JUUSHO --> CALL_JUUSHO_UPD["Create JKKJuushoUpdateDtlUpCC; set data; call updjuushoUpdateDtl; removeData"]

    CALL_C060_JUUSHO --> CHK_EO_TV2

    CALL_JUUSHO_UPD --> CHK_EO_TV2

    CHK_EO_TV2 -->|True| CHK_EO_NULL{ekk1681b001cbsMsg1list != null?}
    CHK_EO_TV2 -->|False| EXEC_1091

    CHK_NON_KOJI -->|True| GET_NON_KOJI_INFO["Get idoDiv and mskmDtlNo from ekk1681b001cbsMsg1list"]

    GET_NON_KOJI_INFO --> CHK_IDO_DIV2{idoDiv is 00019 or 00009 or 00081?}

    CHK_IDO_DIV2 -->|True| CALL_EKU0091B010["Call execEKU0091B010 for mskmDtlNo"]

    CALL_EKU0091B010 --> CHK_EKU_RESULT{result null or empty?}

    CHK_EKU_RESULT -->|True| CALL_C130_CHUSHI{isCourseChangChushi?}

    CALL_C130_CHUSHI -->|Chushi| CALL_C130["Call execEKK0081C130"]
    CALL_C130_CHUSHI -->|Course Change| CALL_C050_CC["Call execEKK0101C050"]

    CHK_EKU_RESULT -->|Not empty| CALL_C050_ALL["Call execEKK0101C050"]

    CALL_C130 --> CHK_EKO_EO{ekk1681b001cbsMsg1list != null?}
    CALL_C050_CC --> CHK_EKO_EO
    CALL_C050_ALL --> CHK_EKO_EO

    CHK_EKO_EO -->|True| CHK_IDO_EO{idoDiv != 00009?}
    CHK_EKO_EO -->|False| CALL_C060_EO["Call execEKK0101C060 with IDO_DIV 00081"]

    CHK_IDO_EO -->|True| CALL_C130_EO{isCourseChangChushi?}

    CALL_C130_EO -->|Chushi| CALL_C130_EO_ACT["Call execEKK0081C130"]
    CALL_C130_EO -->|Course Change| CALL_C050_EO["Call execEKK0101C050"]

    CHK_IDO_EO -->|False: Course 00009| CALL_C050_EO2["Call execEKK0101C050"]

    CALL_C130_EO_ACT --> CALL_C060_EO
    CALL_C050_EO --> CALL_C060_EO
    CALL_C050_EO2 --> CALL_C060_EO

    CALL_C060_EO --> CHK_IDO_DIV3

    CHK_IDO_DIV3 -->|False| CALL_C060_DEFAULT["Call execEKK0101C060 with IDO_DIV 00009"]

    CALL_C060_DEFAULT --> CHK_FUNC{func_code equals 1?}

    CHK_FUNC -->|True| GET_ADD_LIST["Get courseChangeAddList"]

    GET_ADD_LIST --> CHK_ADD_LIST{courseChangeAddList size is 0?}

    CHK_ADD_LIST -->|True| CHK_PAST_FLG{pastDateFlg is false?}

    CHK_PAST_FLG -->|True| CALL_C120["Call execEKK0081C120"]
    CHK_PAST_FLG -->|False| EXEC_1091

    CHK_ADD_LIST -->|False: STB add| EXEC_1091

    CHK_FUNC -->|False| EXEC_1091

    EXEC_1091["Call execEKK1091D010Tv with pcrsCdNmBf and pcrsCdNmAf"]

    EXEC_1091 --> END_NODE(["Return Next"])
```

**CRITICAL - Constant Resolution:**

| Constant | Value | Business Meaning |
|----------|-------|-----------------|
| `COURSE_CHANGE_KOJI_ARI` | `"KOJI_ARI"` | Work in progress flag — indicates ongoing construction/installation work |
| `KOJIAK_SBT_CD_NEW` | `"001"` | Work case subtype: New installation |
| `KOJIAK_SBT_CD_SVCTSUIKA` | `"011"` | Work case subtype: Service addition |
| `KOJIAK_SBT_CD_JUUSHOHENKOU` | `"003"` | Work case subtype: Address change (new) |
| `KOJIAK_SBT_CD_EO_TV_CHANGE` | `"013"` | Work case subtype: eo TV change |
| `IDO_DIV_VALUE_00009` | `"00009"` | Movement division: Course change |
| `IDO_DIV_VALUE_00019` | `"00019"` | Movement division: Address change / registration |
| `IDO_DIV_VALUE_00081` | `"00081"` | Movement division: Course change (eo TV change in progress) |
| `FUNC_CODE_1` | `"1"` | Function code: Check and register (vs. `"2"` for check only) |
| `ADCHG_DTL_SBT_CD_SVC` | `"01"` | Address change detail subtype: Service |
| `SVC_KEI_IDO_SBT_CHG` | `"1"` | Service contract movement subtype: Change |
| `CD00134_A37` | `"A37"` | PCRS code: Digital / BS course (premium) |
| `CD00134_TV_RESEND_MULTI_CH_BS` | `"A75"` | PCRS code: TV resending multi-channel BS course |
| `CD00134_A23` | `"A23"` | PCRS code: A23 course (digital/BS variant) |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle for CBS (CBS/Business Service) calls; provides transaction and connection context |
| 2 | `scCall` | `ServiceComponentRequestInvoker` | Service component invocation proxy used to dispatch to CBS/SC operations across the application server |
| 3 | `param` | `IRequestParameterReadWrite` | Request parameter map — carries inter-component data through the call chain; used to set temporary data (e.g., JuushoUpdateDtlUpCC) and retrieve the main message map via `dataMapKey` |
| 4 | `dataMapKey` | `String` | Key within `param` used to access the business data map (`ccMsg`) containing screen-level context such as `func_code` and `unyo_ymd` |
| 5 | `temporaryData` | `HashMap<String, Object>` | Shared temporary data store carrying pre-fetched CBS results (EKK0081A010 service contract, EKK0101A010 eo TV consent, EKK1681B001_TV anomaly reservations, EKU0011B030 work case data) and derived lists (`courseChangeCanDelList`, `courseChangeAddList`) between the check and update phases |
| 6 | `pcrsArray` | `String[]` | Pre-course-change (before) PCRS data: index 0 is `pcrsCd` (service course code), index 1 is `pcrsCdNm` (course name) |
| 7 | `pcrsAfArray` | `String[]` | Post-course-change (after) PCRS data: index 0 is `pcrsCdAf` (new service course code), index 1 is `pplanCdAf` (new plan code), index 2 is `pcrsCdNmAf` (new course name) |
| 8 | `kojiHandan` | `String` | Work judgment flag — `"KOJI_ARI"` means there are ongoing construction/installation works; `"KOJI_NASHI"` (or anything else) means no ongoing works. Controls which routing branch executes |

**Instance fields / external state read by this method:**

| Field | Description |
|-------|-------------|
| `ccMsg.get("func_code")` | Screen function code obtained from `ccMsg` map via `dataMapKey` |
| `ccMsg.get("unyo_ymd")` | Operations date (application date) used for date comparison |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `execEKK0101C050` | EKK0101C050 | E-Observation procedural fee plan update | Updates the procedural fee plan for eo TV course change (hand-tsuki ryokin puran henkou). Called when work case subtype is "001" (New), "011" (Service addition), "003" with anomaly reservation, or "013" (eo TV change) |
| U | `execEKK0101C060` | EKK0101C060 | Price plan update | Updates the price plan for eo TV course change (ryokin puran henkou). Called when work case subtype is "003" without anomaly reservation, "013" without anomaly reservation, or default (no work case) scenario |
| U | `execEKK0081C130` | EKK0081C130 | Service contract price plan cancellation | Cancels the service contract price plan change (ryokin puran henkou chushi). Called when `isCourseChangChushi` returns true (all data same — actual course change cancellation) |
| U | `execEKK0081C120` | EKK0081C120 | Service contract price plan confirmation | Confirms the service contract price plan change (ryokin puran henkou kakutei). Called during check-and-register mode when `func_code="1"` and no STB addition list exists and termination date is not past |
| U | `execEKK1091D010Tv` | EKK1091D010 | Progress registration (TV) | Registers the progress of the course change (shinmachi touroku). Called unconditionally at the end of the method with before/after course names |
| U | `updjuushoUpdateDtl` | JKKJuushoUpdateDtlUpCC | Address change detail update | Updates address change details (juusho henkou shoukai koushin) when work case subtype is "003" (address change) without anomaly reservation |
| U | `setSvcUpDtmSvcKei` | JKKKikiIchiranIkkatsuCC | Service contract data modification timestamp | Updates the service contract data update timestamp (svc up dtm svc kei). Called at the beginning after fetching CBS messages |
| R | `getChrgEndYmd` | JKKKikiIchiranIkkatsuCC | Billing end date calculation | Calculates the billing end date from the contract termination date |
| R | `getMskmDtlNo` | JKKKikiIchiranIkkatsuCC | Application detail number retrieval | Retrieves the application detail number from param data |
| R | `getNullToStr` | JKKKikiIchiranIkkatsuCC | Null-safe string conversion | Converts null values to empty strings |
| R | `isCourseChangChushi` | JKKKikiIchiranIkkatsuCC | Course change cancellation judgment | Determines if the course change should be cancelled (all data identical between before/after) |
| R | `execEKU0091B010` | EKU0091B010 | Work case list inquiry (application detail number) | Retrieves the work case list for a given application detail number |
| R | `execEKU0091B020` | EKU0091B020 | Work case list inquiry (application detail number - 1st record) | Retrieves application detail number from work case list (1st record) for a given work case number |
| R | `getString` | Various CBS messages | Data extraction | Extracts individual fields from CAANMsg CBS message lists |
| R | `getData` | param | Parameter data retrieval | Retrieves business data map from request parameter |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JKKKikiIchiranIkkatsuCC.execTvCourseChangeYouhi` | `execTvCourseChangeYouhi` -> `execTvCourseChangeYouhiUpdate` | `execEKK0101C050 [U]`, `execEKK0101C060 [U]`, `execEKK0081C130 [U]`, `execEKK0081C120 [U]`, `execEKK1091D010Tv [U]`, `updjuushoUpdateDtl [U]`, `setSvcUpDtmSvcKei [U]` |

**Terminal operations from this method:** `execEKK1091D010Tv` [-], `execEKK0081C120` [-], `execEKK0101C060` [-], `getMskmDtlNo` [R], `execEKK0101C050` [-], `execEKK0081C130` [-], `isCourseChangChushi` [-], `execEKU0091B010` [-], `getNullToStr` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getNullToStr` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R]

## 6. Per-Branch Detail Blocks

### Block 1 — Initialization (L20691)

> Retrieves pre-fetched CBS messages and parses before/after PCRS arrays. Sets up service timestamp update.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `ccMsg = (HashMap)param.getData(dataMapKey)` |
| 2 | SET | `pcrsCdBf = pcrsArray[0]` — before course change code |
| 3 | SET | `pcrsCdNmBf = pcrsArray[1]` — before course change name |
| 4 | SET | `pcrsCdAf = pcrsAfArray[0]` — after course change code |
| 5 | SET | `pplanCdAf = pcrsAfArray[1]` — after plan code |
| 6 | SET | `pcrsCdNmAf = pcrsAfArray[2]` — after course change name |
| 7 | EXEC | `ekk0081a010cbsMsgList = (CAANMsg)temporaryData.get(TEMPLATE_ID_EKK0081A010)` — get service contract consent data [-> TEMPLATE_ID_EKK0081A010="EKK0081A010"] |
| 8 | EXEC | `ekk0101a010cbsMsg1list = (CAANMsg)temporaryData.get(TEMPLATE_ID_EKK0101A010)` — get eo TV consent data [-> TEMPLATE_ID_EKK0101A010] |
| 9 | EXEC | `setSvcUpDtmSvcKei(handle, param, dataMapKey, scCall)` — update service contract data modification timestamp |
| 10 | EXEC | `dmpsAnkenNo = ekk0101a010cbsMsg1list.getString(EKK0101A010CBSMsg1List.DMPS_ANKEN_NO)` — get disaster damage case number |
| 11 | SET | Initialize local vars to empty: `kojiakSbtCd`, `kojiUkOptntyIdoDiv`, `kojiakNo`, `rnkiSvcKeiNo`, `mskmDtlNo`, `idoDiv` |
| 12 | EXEC | Get `ekk1681b001cbsMsg1list` from temporaryData [-> TEMPLATE_ID_EKK1681B001_TV] — anomaly reservation list |
| 13 | EXEC | Get `eku0011b030cbsMsg1list` from temporaryData [-> TEMPLATE_ID_EKU0011B030] — work case data |

### Block 2 — Premium Course Termination Date Calculation (L20762)

> For Digital/BS premium courses (A37, A75, A23), find the earliest contract termination date from the course change cancellation list, compute billing end date and installment start date.

| # | Type | Code |
|---|------|------|
| 1 | SET | `stbTekkyoYmd = ""` — STB delivery date |
| 2 | EXEC | `courseChangeCanDelList = (ArrayList)temporaryData.get("courseChangeCanDelList")` — get course change cancellation list |
| 3 | SET | `kiki_tk_end_ymd = ""`, `newkiki_tk_end_ymd = "19000101"` — initialize |
| 4 | SET | `tukihajimeDay = ""`, `rsvAplyYmd = ""`, `pastDateFlg = false` |

#### Block 2.1 — Loop: Find Latest Termination Date (L20776)

> Iterates through course change cancellation list items to find the latest kiki_tk_end_ymd where the date is future relative to current newkiki_tk_end_ymd.

| # | Type | Code |
|---|------|------|
| 1 | FOR | Iterate `courseChangeCanDelList` (each item is `HashMap<String, String>`) |
| 2 | SET | `kiki_tk_end_ymd = getNullToStr(msg.get("kiki_tk_end_ymd"))` |
| 3 | IF | `JPCUtilCommon.isFutureDate(kiki_tk_end_ymd, newkiki_tk_end_ymd, "0")` — true if kiki_tk_end_ymd is after newkiki_tk_end_ymd |
| 3.1 | SET | `newkiki_tk_end_ymd = kiki_tk_end_ymd` |

#### Block 2.2 — Check Past Termination Date (L20792)

> If the latest termination date is past the operations date, compute billing end date and installment start date.

| # | Type | Code |
|---|------|------|
| 1 | IF | `JPCUtilCommon.isPastDate(newkiki_tk_end_ymd, ccMsg.get("unyo_ymd"), "0")` |
| 1.1 | EXEC | Re-get `ekk0081a010cbsMsg` from temporaryData |
| 1.2 | SET | `svcStaYmd = getNullToStr(ekk0081a010cbsMsg.getString(EKK0081A010CBSMsg1List.SVC_STA_YMD))` — service start year-month-day |
| 1.3 | IF | `svcStaYmd > newkiki_tk_end_ymd` |
| 1.3.1 | SET | `newkiki_tk_end_ymd = svcStaYmd` |
| 1.4 | SET | `staChrgEndYmd = getChrgEndYmd(newkiki_tk_end_ymd)` — calculate billing end date |
| 1.5 | SET | `rsvAplyYmd = JPCDateUtil.addMonth(staChrgEndYmd.substring(0,6)+"01", 1)` — add 1 month to the 1st of billing end month |
| 1.6 | SET | `tukihajimeDay = rsvAplyYmd` — installment start day |
| 1.7 | SET | `pastDateFlg = true` |
| 2 | ELSE | |
| 2.1 | SET | `rsvAplyYmd = "20991231"` — far future default |
| 2.2 | SET | `tukihajimeDay = ""` |

#### Block 2.3 — False Branch: Non-Premium Course (L20807)

> For non-Digital/BS courses, set defaults.

| # | Type | Code |
|---|------|------|
| 1 | SET | `rsvAplyYmd = "20991231"` |
| 2 | SET | `tukihajimeDay = ""` |

### Block 3 — Work-in-Progress Branch (kojiHandan == KOJI_ARI) (L20814)

> When there are ongoing works (`COURSE_CHANGE_KOJI_ARI`), retrieve work case information and dispatch to specific handlers based on work case subtype.

| # | Type | Code |
|---|------|------|
| 1 | IF | `COURSE_CHANGE_KOJI_ARI.equals(kojiHandan)` [-> COURSE_CHANGE_KOJI_ARI="KOJI_ARI"] |

#### Block 3.1 — Get Work Case Information (L20821)

| # | Type | Code |
|---|------|------|
| 1 | SET | `kojiakSbtCd = getNullToStr(eku0011b030cbsMsg1list.getString(EKU0011B030CBSMsg1List.KOJIAK_SBT_CD))` — work case subtype code |
| 2 | SET | `kojiUkOptntyIdoDiv = getNullToStr(eku0011b030cbsMsg1list.getString(EKU0011B030CBSMsg1List.KOJI_UK_OPTNTY_IDO_DIV))` — work acceptance machine divergence division |
| 3 | SET | `kojiakNo = getNullToStr(eku0011b030cbsMsg1list.getString(EKU0011B030CBSMsg1List.KOJIAK_NO))` — work case number |
| 4 | SET | `rnkiSvcKeiNo = getNullToStr(eku0011b030cbsMsg1list.getString(EKU0011B030CBSMsg1List.RNKI_SVC_KEI_NO))` — linked service contract number |

#### Block 3.2 — Get Application Detail Number (L20831)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `eku0091b020CbsMsg1List = execEKU0091B020(handle, scCall, param, dataMapKey, kojiakNo)[0]` |
| 2 | SET | `mskmDtlNo = getNullToStr(eku0091b020CbsMsg1List.getString(EKU0091B020CBSMsg1List.MSKM_DTL_NO))` |

#### Block 3.3 — Work Case Subtype == "001" (NEW) or "011" (SVCTSUIKA) (L20838)

> For new installation or service addition work cases, update the procedural fee plan.

| # | Type | Code |
|---|------|------|
| 1 | IF | `KOJIAK_SBT_CD_NEW.equals(kojiakSbtCd) || KOJIAK_SBT_CD_SVCTSUIKA.equals(kojiakSbtCd)` [-> KOJIAK_SBT_CD_NEW="001", KOJIAK_SBT_CD_SVCTSUIKA="011"] |
| 2 | CALL | `execEKK0101C050(handle, scCall, param, dataMapKey, pcrsCdAf, pplanCdAf, temporaryData, dmpsAnkenNo, mskmDtlNo)` |

#### Block 3.4 — Work Case Subtype == "003" (JUUSHOHENKOU) (L20847)

> For address change work cases.

| # | Type | Code |
|---|------|------|
| 1 | ELSE IF | `KOJIAK_SBT_CD_JUUSHOHENKOU.equals(kojiakSbtCd)` [-> KOJIAK_SBT_CD_JUUSHOHENKOU="003"] |

##### Block 3.4.1 — With Anomaly Reservation (L20851)

| # | Type | Code |
|---|------|------|
| 1 | IF | `ekk1681b001cbsMsg1list != null` |
| 2 | CALL | `execEKK0101C050(handle, scCall, param, dataMapKey, pcrsCdAf, pplanCdAf, temporaryData, dmpsAnkenNo, mskmDtlNo)` |

##### Block 3.4.2 — Without Anomaly Reservation (L20858)

| # | Type | Code |
|---|------|------|
| 1 | ELSE | |
| 2 | CALL | `execEKK0101C060(handle, scCall, param, dataMapKey, pcrsCdAf, pplanCdAf, temporaryData, mskmDtlNo, IDO_DIV_VALUE_00019, dmpsAnkenNo, rsvAplyYmd, tukihajimeDay)` [-> IDO_DIV_VALUE_00019="00019"] |
| 3 | EXEC | `juushoUpdateDtlUpCC = new JKKJuushoUpdateDtlUpCC()` |
| 4 | EXEC | `param.setData("JuushoUpdateDtlUpCC", new HashMap<String, Object>())` |
| 5 | EXEC | `outMap = (HashMap)param.getData("JuushoUpdateDtlUpCC")` |
| 6 | SET | `outMap.put("func_code", ccMsg.get("func_code"))` |
| 7 | SET | `outMap.put("update_flg", "1")` |
| 8 | SET | `outMap.put("chg_tg_kei_no", rnkiSvcKeiNo)` |
| 9 | SET | `outMap.put("kiki_chg_no", "")` |
| 10 | SET | `outMap.put("kojiak_no", kojiakNo)` |
| 11 | SET | `outMap.put("adchg_dtl_sbt_cd_kiki", ADCHG_DTL_SBT_CD_SVC)` [-> ADCHG_DTL_SBT_CD_SVC="01"] |
| 12 | SET | `outMap.put("svc_kei_ido_sbt_cd", SVC_KEI_IDO_SBT_CHG)` [-> SVC_KEI_IDO_SBT_CHG="1"] |
| 13 | CALL | `juushoUpdateDtlUpCC.updjuushoUpdateDtl(handle, param, "JuushoUpdateDtlUpCC")` |
| 14 | EXEC | `param.removeData("JuushoUpdateDtlUpCC")` |

### Block 4 — Work Case Subtype == "013" (EO_TV_CHANGE) (L20896)

> For eo TV change work cases. Complex branching based on anomaly reservation presence and movement division.

| # | Type | Code |
|---|------|------|
| 1 | ELSE IF | `KOJIAK_SBT_CD_EO_TV_CHANGE.equals(kojiakSbtCd)` [-> KOJIAK_SBT_CD_EO_TV_CHANGE="013"] |

#### Block 4.1 — With Anomaly Reservation (L20900)

| # | Type | Code |
|---|------|------|
| 1 | IF | `ekk1681b001cbsMsg1list != null` |
| 2 | SET | `idoDiv = getNullToStr(ekk1681b001cbsMsg1list.getString(EKK1681B001CBSMsg1List.IDO_DIV))` |

##### Block 4.1.1 — Movement Division != "00009" (L20908)

> Not a pure course change — perform course change cancellation judgment.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!IDO_DIV_VALUE_00009.equals(idoDiv)` [-> IDO_DIV_VALUE_00009="00009"] |
| 2 | IF | `isCourseChangChushi(pcrsCdAf, pplanCdAf, ekk1681b001cbsMsg1list)` — all same = cancellation |
| 2.1 | CALL | `execEKK0081C130(handle, scCall, param, dataMapKey, temporaryData, ekk1681b001cbsMsg1list)` |
| 3 | ELSE | |
| 3.1 | CALL | `execEKK0101C050(handle, scCall, param, dataMapKey, pcrsCdAf, pplanCdAf, temporaryData, dmpsAnkenNo, mskmDtlNo)` |

##### Block 4.1.2 — Movement Division == "00009" (L20925)

> Pure course change.

| # | Type | Code |
|---|------|------|
| 1 | ELSE | |
| 2 | CALL | `execEKK0101C050(handle, scCall, param, dataMapKey, pcrsCdAf, pplanCdAf, temporaryData, dmpsAnkenNo, mskmDtlNo)` |

#### Block 4.2 — Without Anomaly Reservation (L20933)

| # | Type | Code |
|---|------|------|
| 1 | ELSE | |
| 2 | CALL | `execEKK0101C060(handle, scCall, param, dataMapKey, pcrsCdAf, pplanCdAf, temporaryData, mskmDtlNo, IDO_DIV_VALUE_00081, dmpsAnkenNo, rsvAplyYmd, tukihajimeDay)` [-> IDO_DIV_VALUE_00081="00081"] |

### Block 5 — No Work Case Branch (kojiHandan != KOJI_ARI) (L20942)

> When there are no ongoing works (`KOJI_NASHI`), check for anomaly reservations and route accordingly.

| # | Type | Code |
|---|------|------|
| 1 | ELSE | (kojiHandan != KOJI_ARI) |

#### Block 5.1 — With Anomaly Reservation (L20946)

| # | Type | Code |
|---|------|------|
| 1 | IF | `ekk1681b001cbsMsg1list != null` |
| 2 | SET | `idoDiv = getNullToStr(ekk1681b001cbsMsg1list.getString(EKK1681B001CBSMsg1List.IDO_DIV))` |
| 3 | SET | `mskmDtlNo = getNullToStr(ekk1681b001cbsMsg1list.getString(EKK1681B001CBSMsg1List.MSKM_DTL_NO))` |

##### Block 5.1.1 — Movement Division in {00019, 00009, 00081} (L20957)

| # | Type | Code |
|---|------|------|
| 1 | IF | `IDO_DIV_VALUE_00019.equals(idoDiv) || IDO_DIV_VALUE_00009.equals(idoDiv) || IDO_DIV_VALUE_00081.equals(idoDiv)` |
| 2 | EXEC | `eku0091b010cbsMsg1list = execEKU0091B010(handle, scCall, param, dataMapKey, mskmDtlNo)` |

###### Block 5.1.1.1 — Work Case Not Linked (L20961)

| # | Type | Code |
|---|------|------|
| 1 | IF | `eku0091b010cbsMsg1list == null || eku0091b010cbsMsg1list.length == 0` |
| 2 | IF | `isCourseChangChushi(pcrsCdAf, pplanCdAf, ekk1681b001cbsMsg1list)` |
| 2.1 | CALL | `execEKK0081C130(handle, scCall, param, dataMapKey, temporaryData, ekk1681b001cbsMsg1list)` |
| 3 | ELSE | |
| 3.1 | CALL | `execEKK0101C050(handle, scCall, param, dataMapKey, pcrsCdAf, pplanCdAf, temporaryData, dmpsAnkenNo, mskmDtlNo)` |

###### Block 5.1.1.2 — Work Case Linked (L20973)

| # | Type | Code |
|---|------|------|
| 1 | ELSE | |
| 2 | CALL | `execEKK0101C050(handle, scCall, param, dataMapKey, pcrsCdAf, pplanCdAf, temporaryData, dmpsAnkenNo, mskmDtlNo)` |

### Block 6 — No Anomaly Reservation (L20979)

> Default course change update path. Executes price plan change and optionally confirms price plan.

| # | Type | Code |
|---|------|------|
| 1 | ELSE | (ekk1681b001cbsMsg1list == null) |
| 2 | CALL | `execEKK0101C060(handle, scCall, param, dataMapKey, pcrsCdAf, pplanCdAf, temporaryData, getMskmDtlNo(param, ekk0081a010cbsMsgList), IDO_DIV_VALUE_00009, dmpsAnkenNo, rsvAplyYmd, tukihajimeDay)` [-> IDO_DIV_VALUE_00009="00009"] |
| 3 | IF | `FUNC_CODE_1.equals(ccMsg.get("func_code"))` [-> FUNC_CODE_1="1"] — Check and register mode |
| 3.1 | EXEC | `courseChangeAddList = (ArrayList)temporaryData.get("courseChangeAddList")` — get course change addition list |
| 3.2 | IF | `courseChangeAddList.size() == 0` — no STB addition |
| 3.2.1 | IF | `!pastDateFlg` — termination date not past |
| 3.2.2 | CALL | `execEKK0081C120(handle, scCall, param, temporaryData, dataMapKey, newkiki_tk_end_ymd)` |

### Block 7 — Progress Registration (L21017)

> Always executed at the end. Registers the course change progress with before/after course names.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `execEKK1091D010Tv(handle, scCall, param, dataMapKey, temporaryData, pcrsCdNmBf, pcrsCdNmAf)` — shinchaku touroku (progress registration) with course change names |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `kojiHandan` | Field | Work judgment flag — "KOJI_ARI" means construction is ongoing, "KOJI_NASHI" means no ongoing work |
| `kojiakSbtCd` | Field | Work case subtype code — classifies the type of work case (001=new, 011=service addition, 003=address change, 013=eo TV change) |
| `kojiUkOptntyIdoDiv` | Field | Work acceptance machine divergence division — identifies the type of divergence when accepting work |
| `kojiakNo` | Field | Work case number — unique identifier for a work case record |
| `rnkiSvcKeiNo` | Field | Linked service contract number — the service contract number associated with a linked/parallel service |
| `mskmDtlNo` | Field | Application detail number — unique identifier for an application detail record |
| `idoDiv` | Field | Movement division code — classifies the type of service movement (00009=course change, 00019=address change/registration, 00081=course change eo TV change in progress) |
| `pcrsCd` | Field | PCRS (Product/Rate/Plan/Service/Rate) code — service course classification code |
| `pcrsCdAf` | Field | After course change PCRS code — the new service course code after the change |
| `pplanCdAf` | Field | After plan code — the new plan code after the course change |
| `pcrsCdNm` | Field | PCRS course name — human-readable name of the service course |
| `dmpsAnkenNo` | Field | Disaster damage case number — reference number for disaster-related service changes |
| `newkiki_tk_end_ymd` | Field | New device termination date — the computed contract termination date for equipment |
| `kiki_tk_end_ymd` | Field | Device termination date— the termination date from a course change cancellation record |
| `rsvAplyYmd` | Field | Reservation application date — the effective date for the reservation |
| `tukihajimeDay` | Field | Installment start day — the date from which installment billing begins |
| `svcStaYmd` | Field | Service start year-month-day — when the service contract started |
| `pastDateFlg` | Field | Past date flag — true if the termination date is past the operations date |
| `courseChangeCanDelList` | Field | Course change cancellation list — list of contracts being cancelled with their termination dates |
| `courseChangeAddList` | Field | Course change addition list — list of courses being added (e.g., STB additions) |
| `func_code` | Field | Function code — "1" for check and register, "2" for check only |
| `unyo_ymd` | Field | Operations date — the current application/operations date used as reference for date comparisons |
| `KOJI_ARI` | Constant | Work in progress — there are ongoing construction/installation works |
| `KOJI_NASHI` | Constant | No work — there are no ongoing construction/installation works |
| NEW (001) | Code | Work case subtype: New installation |
| SVCTSUIKA (011) | Code | Work case subtype: Service addition |
| JUUSHOHENKOU (003) | Code | Work case subtype: Address change (new) |
| EO_TV_CHANGE (013) | Code | Work case subtype: eo TV change |
| EKK0101C050 | SC Code | EO TV procedural fee plan change — updates the handling fee plan |
| EKK0101C060 | SC Code | EO TV price plan change — updates the pricing plan |
| EKK0081C120 | SC Code | Service contract price plan confirmation — confirms/commits the price plan change |
| EKK0081C130 | SC Code | Service contract price plan cancellation — cancels/reverses a price plan change |
| EKK1091D010 | SC Code | Progress registration (TV) — registers the progress of the course change operation |
| EKK0081A010 | SC Code | Service contract consent — retrieves service contract details |
| EKK0101A010 | SC Code | EO TV consent — retrieves eo TV service consent details |
| EKK1681B001_TV | SC Code | Anomaly reservation list (TV) — retrieves pending anomaly reservations for TV services |
| EKU0011B030 | SC Code | Work case list inquiry (complex search) — retrieves work case details |
| EKU0091B020 | SC Code | Work case list inquiry (application detail number, 1st record) |
| EKU0091B010 | SC Code | Work case list inquiry (application detail number) |
| A37 | Code | PCRS code: Digital/BS course (premium) |
| A75 | Code | PCRS code: TV resending multi-channel BS course |
| A23 | Code | PCRS code: A23 course (digital/BS variant) |
| `ADCHG_DTL_SBT_CD_SVC` | Constant | Address change detail subtype: Service (value "01") |
| `SVC_KEI_IDO_SBT_CHG` | Constant | Service contract movement subtype: Change (value "1") |
| setSvcUpDtmSvcKei | Method | Updates the service contract data modification timestamp |
| getChrgEndYmd | Method | Calculates the billing end date from the contract termination date |
| getNullToStr | Method | Null-safe string conversion — returns empty string for null inputs |
| isCourseChangChushi | Method | Course change cancellation judgment — true if before/after data are all identical |
| execEKK1091D010Tv | Method | Progress registration for TV course changes (shinchaku touroku) |
| JKKJuushoUpdateDtlUpCC | Class | Address change detail update component — handles address modification records |
| CAANMsg | Type | CBS message wrapper — container for CBS response data with typed getters |
| FTTH | Business term | Fiber To The Home — fiber-optic internet service (domain context) |
| STB | Acronym | Set-Top Box — device for receiving digital television signals |
| CBS | Acronym | Central Business System — Fujitsu enterprise backend system for telecom operations |
| SC | Acronym | Service Component — a modular service layer component in the application architecture |
