# Business Logic — JKKPauseReceptCC.pauseReceptuCtrlTran() [168 LOC]

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

## 1. Role

### JKKPauseReceptCC.pauseReceptuCtrlTran()

This method is the central orchestration hub for **service suspension reception processing** (休止受付制御処理 — Pause Reception Control Processing) in the K-Opticom customer backbone system. It serves as the primary business component that receives service suspension requests from screen KKSV0203 (a service suspension operation screen) and coordinates all downstream actions to bring a live service into a paused state.

The method first retrieves the current service contract status (via `svkeiInfoStkuTran`) and branches its logic based on the service's status code. When the service is **in progress** (status "100" / SVC_KEI_STAT_TKC), it delegates to `pauseReceptTran` to perform the core pause acceptance logic, then determines whether a Service Order Data (SOD) must be issued based on whether the operation date matches the service suspension date. When the service is already **stopped** (status "220"), **contract terminated** (status "910"), or **cancelled** (status "920"), it returns a success code without further processing.

The method implements the **dispatch/delegation design pattern**: it reads the service state, dispatches to specialized child methods (`pauseReceptTran`, `executeHakkoSodCC`, `executeFmtcelIdoInf`, `executeAddSmtvlIdoInf`, `executeNetflixTajgsKeiIdInf`), and then returns the enriched parameter object. It plays the role of a **shared business gateway** — called by exactly one screen operation (KKSV0203OP), but internally routing to multiple service components and creating a complex web of reads, creates, and cross-entity updates.

When the operation date equals the service suspension date (meaning the pause is taking effect today), the method triggers SOD creation, fault difference registration, smart barrier difference registration, and — for Netflix service (svc_cd "01") — Netflix additional business difference registration. A check mode (`isCheckMode`) guard ensures that data-modifying operations (re-fetch, CBS calls, SOD creation) are skipped during dry-run validation.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["pauseReceptuCtrlTran called"])

    START --> INIT["init param, fixedText"]

    INIT --> EXTRACT["Extract target and inMap from param"]

    EXTRACT --> GET_OPE_DATE["Get OPE_DATE via JCCBPCommon.getOpeDate"]

    GET_OPE_DATE --> INIT_SOD["Set sod_hakko_flg = 0 (SOD_HAKKO_FLG_FUYO)"]

    INIT_SOD --> SVKEI_INFO["svkeiInfoStkuTran"]

    SVKEI_INFO --> EXTRACT_MSG["Extract msgEKK0081A010 from resultHash"]

    EXTRACT_MSG --> EXTRACT_FIELDS["Extract svc_kei_stat, svc_pause_ymd, pcrs_cd, svc_cd"]

    EXTRACT_FIELDS --> CHECK_STAT{svc_kei_stat == 220 or 910 or 920?}

    CHECK_STAT -->|220, 910, 920| SET_OK_1["Set RETURN_CODE = 0000"]

    SET_OK_1 --> FINAL_CHECK{isCheckMode == false?}

    CHECK_STAT -->|100| PAUSE_TR["pauseReceptTran"]

    PAUSE_TR --> CHECK_DATE_EQ{tmpOpeDate == svc_pause_ymd?}

    CHECK_DATE_EQ -->|Yes| SET_SOD_YO["Set sod_hakko_flg = 1 (SOD_HAKKO_FLG_YO)"]

    SET_SOD_YO --> CHECK_DATE_LE{tmpOpeDate < svc_pause_ymd?}

    CHECK_DATE_EQ -->|No| CHECK_DATE_LE

    CHECK_DATE_LE -->|Yes| NO_OP_1["No processing"]

    NO_OP_1 --> CHECK_DATE_GT{tmpOpeDate > svc_pause_ymd?}

    CHECK_DATE_LE -->|No| CHECK_DATE_GT

    CHECK_DATE_GT -->|Yes| THROW_ERR["Set RETURN_CODE = -1, throw SCCallException"]

    CHECK_DATE_GT -->|No| SET_OK_TKC["Set RETURN_CODE = 0000"]

    SET_OK_TKC --> FINAL_CHECK

    THROW_ERR --> FINAL_CHECK

    FINAL_CHECK -->|Yes| RE_SVKEI["svkeiInfoStkuTran - re-retrieve"]

    FINAL_CHECK -->|No| CHECK_SOD

    RE_SVKEI --> CALL_014["callEKK0081C014"]

    CALL_014 --> CHECK_SOD{!sod_hakko_flg == 0 AND isCheckMode == false?}

    CHECK_SOD -->|True| CALL_004["callEKK0161B004"]

    CALL_004 --> EXEC_SOD["executeHakkoSodCC"]

    EXEC_SOD --> EXEC_FMT["executeFmtcelIdoInf"]

    EXEC_FMT --> EXEC_SMART["executeAddSmtvlIdoInf"]

    EXEC_SMART --> CHECK_NET{tmpOpeDate == svc_pause_ymd?}

    CHECK_SOD -->|False| SET_OK_2["Set RETURN_CODE = 0000"]

    CHECK_NET -->|Yes| CHECK_SVC_CD{svc_cd == 01?}

    CHECK_NET -->|No| SET_OK_2

    CHECK_SVC_CD -->|Yes| EXEC_NET["executeNetflixTajgsKeiIdInf"]

    CHECK_SVC_CD -->|No| SET_OK_2

    EXEC_NET --> SET_OK_2

    SET_OK_2 --> RETURN["Return param"]

    RETURN --> END(["End"])
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle containing connection context (DB instance, credentials). Carries the database connection used for all service component calls, ensuring transactions are routed to the correct data source. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object containing the business data map and control map. The data map (keyed by `fixedText`) holds the pause reception input data (`pause_recept_map`) extracted from the screen. The control map is used to set the return code (`RETURN_CODE`) for the calling screen. Contains maps for service contract status, pause date, and result maps. |
| 3 | `fixedText` | `String` | User-defined arbitrary string used as a key to look up the target data map within `param.getData(fixedText)`. Acts as a logical namespace for the pause reception data within the parameter object. |

### Instance fields / external state

| Field | Description |
|-------|-------------|
| `isCheckMode` | Inherited from `AbstractCommonComponent` — when `true`, the method skips all data-modifying operations (re-fetch, CBS calls, SOD creation, difference registration). Set at the operation layer (KKSV0203OPOperation) based on function code `JPCModelConstant.FUNC_CD_2`. |
| `mapper` | `JKKPauseReceptMapperCC` — mapper object used for transforming data between screen and internal representations. |
| `scCall` | `ServiceComponentRequestInvoker` — the service component call infrastructure for invoking CBS/SC methods. |
| `prgDtm` | `String` — progress date-time stamp field (set via `init`). |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JCCBPCommon.getOpeDate` | JCCBPCommon | - | Retrieves the current operation date (OPE_DATE) used for date comparisons throughout the method. |
| R | `JKKPauseReceptCC.svkeiInfoStkuTran` | - | EKK0081A010CBSMsg | Calls service contract status acquisition. Invoked twice: once at the start to determine the branching path, and again in non-check mode to re-fetch after pause processing. Uses SC `EKK0081A010`. |
| - | `JKKPauseReceptCC.callEKK0081C014` | EKK0081C014 | EKK0081C014CBSMsg | Service contract business liaison update. Executed after re-retrieval in non-check mode. Updates service contract liaison information. |
| - | `JKKPauseReceptCC.callEKK0161B004` | EKK0161B004 | EKK0161B004CBSMsg | Service contract details acquisition. Called when `sod_hakko_flg == 1` (SOD issuance required). Retrieves full service contract detail list for SOD creation. |
| - | `JKKPauseReceptCC.pauseReceptTran` | - | pause_recept_map | Core pause receipt processing. Delegates to the main pause logic when service status is "in progress" (100). |
| C | `JKKPauseReceptCC.executeHakkoSodCC` | - | - | Creates the Service Order Data (SOD). Invoked when SOD is required (`sod_hakko_flg != "0"`). Orchestrates the SOD creation flow including `executeOdrHakkoJokenAdd` for order conditions. |
| C | `JKKPauseReceptCC.executeFmtcelIdoInf` | - | - | Registers fault difference information (フォルトセドル異動情報登録). ANK-0035-00-00 addition. Creates records in the fault difference info table. |
| C | `JKKPauseReceptCC.executeAddSmtvlIdoInf` | - | - | Registers smart barrier difference information (スマートバリヤ異動情報登録). ANK-0406-00-00 addition for consumer law compliance. Creates records in the smart barrier difference info table. |
| C | `JKKPauseReceptCC.executeNetflixTajgsKeiIdInf` | - | - | Registers Netflix additional business difference information (ネットフックス他事業者契約異動情報登録). ANK-3987-00-00 addition for Netflix service integration. |
| R | `JKKPauseReceptCC.getWorkCAANMsg` | - | - | Extracts a CAANMsg from the SC response map. Used to unwrap the service contract detail response from callEKK0161B004. |
| - | `JKKPauseReceptCC.init` | - | - | Initializes the parameter object with `fixedText`. Sets up the mapper, progress date-time, and other internal state. |

### Classification by operation type:

| CRUD | Service / Method | Business Description |
|------|-----------------|---------------------|
| R | `svkeiInfoStkuTran` (called twice) | Service contract status retrieval — reads current service state (TKC/STP/DSL/CANCEL) and pause date from the system. |
| U | `callEKK0081C014` | Service contract business liaison update — updates liaison records after pause processing in non-check mode. |
| R | `callEKK0161B004` | Service contract details fetch — retrieves the full list of service contract detail records for SOD creation. |
| C | `pauseReceptTran` | Core pause receipt processing — executes the main business logic for registering a service pause. |
| C | `executeHakkoSodCC` | SOD creation — generates the Service Order Data record that triggers downstream service state transitions. |
| C | `executeFmtcelIdoInf` | Fault difference info creation — records fault-related differences triggered by the pause. |
| C | `executeAddSmtvlIdoInf` | Smart barrier difference info creation — records consumer protection-related barrier changes (per 2012/07/17 ANK-0406). |
| C | `executeNetflixTajgsKeiIdInf` | Netflix additional business difference info creation — records Netflix-related contractual differences when the service is Netflix and today matches the suspension date. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0203 | `KKSV0203Flow` -> `KKSV0203OPOperation.run` -> `CCRequestBroker (KKSV020301CC)` -> `JKKPauseReceptCC.pauseReceptuCtrlTran` | `svkeiInfoStkuTran [R] EKK0081A010`, `pauseReceptTran [C] pause_recept_map`, `callEKK0161B004 [R] EKK0161B004CBSMsg`, `executeHakkoSodCC [C] SOD`, `executeFmtcelIdoInf [C] fault_diff`, `executeAddSmtvlIdoInf [C] smart_barrier`, `executeNetflixTajgsKeiIdInf [C] netflix_diff` |

### Call chain detail:
1. **KKSV0203** (Service suspension screen) -> **KKSV0203Flow** (BPM flow) -> **KKSV0203OPOperation.run** (operation processor) -> **CCRequestBroker** (target9: `com.fujitsu.futurity.bp.custom.common.JKKPauseReceptCC` / method `pauseReceptuCtrlTran`) -> **JKKPauseReceptCC.pauseReceptuCtrlTran**.

The KKSV0203OPOperation sets `isCheckMode` by checking if the function code equals `JPCModelConstant.FUNC_CD_2`. If check mode is active, it returns early before calling `pauseReceptuCtrlTran`. The data is remapped from `KKSV020301CC` before the call, with `PAUSE_RECEPT_MAP` and `PAUSE_RECEPT_RSLT_MAP` extracted from the source map.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] (L196)

> Initialize local result map and call init.

| # | Type | Code |
|---|------|------|
| 1 | SET | `resultHash = new HashMap<>()` |
| 2 | EXEC | `init(param, fixedText)` // Initialization: init(param, fixedText) — initializes the parameter with fixedText |

**Block 2** — [SET] (L199-202)

> Extract the target map from param and get the pause reception map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `trgtMap = (HashMap) param.getData(fixedText)` // Request parameter retrieval: リクエストパラメータの取得処理 |
| 2 | SET | `inMap = (HashMap) trgtMap.get(JKKPauseReceptConstCC.PAUSE_RECEPT_MAP)` // Pause reception map retrieval: 休止受付マップ取得 |

**Block 3** — [CALL, SET] (L205)

> Get the current operation date from the common service.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `tmpOpeDate = JCCBPCommon.getOpeDate(null)` // Operation date retrieval: 運用日取得 |

**Block 4** — [SET] (L208)

> Initialize SOD issuance flag to "not required".

| # | Type | Code |
|---|------|------|
| 1 | SET | `sod_hakko_flg = SOD_HAKKO_FLG_FUYO` // SOD flag init: SOD発行フラグ初期化: 0 = SOD発行不要 [-> SOD_HAKKO_FLG_FUYO="0"] |

**Block 5** — [CALL] (L211)

> Retrieve service contract status.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `svkeiInfoStkuTran(handle, param, fixedText, resultHash)` // Service contract info retrieval: サービス契約情報取得処理 |

**Block 6** — [SET, SET] (L213-218)

> Extract service contract message and its fields.

| # | Type | Code |
|---|------|------|
| 1 | SET | `msgEKK0081A010 = (CAANMsg) resultHash.get(RESULT_KEY_EKK0081A010)` [-> RESULT_KEY_EKK0081A010="EKK0081A010"] |
| 2 | SET | `svc_kei_stat = msgEKK0081A010.getString(EKK0081A010CBSMsg1List.SVC_KEI_STAT)` // Service contract status: サービス契約ステータス |
| 3 | SET | `svc_pause_ymd = (String) inMap.get(JKKPauseReceptConstCC.SVC_PAUSE_YMD)` // Service suspension date: サービス休止年月日 |
| 4 | SET | `pcrs_cd = msgEKK0081A010.getString(EKK0081A010CBSMsg1List.PCRS_CD)` // Price code (ANK-3987): 料金コースコード |
| 5 | SET | `svc_cd = msgEKK0081A010.getString(EKK0081A010CBSMsg1List.SVC_CD)` // Service code: サービスコード |

**Block 7** — [IF] `(svc_kei_stat == "220" OR "910" OR "920")` (L222)

> If service status is stopped, terminated, or cancelled: set return code and do nothing further.

| # | Type | Code |
|---|------|------|
| 1 | SET | `param.setControlMapData(SCControlMapKeys.RETURN_CODE, "0000")` // Set return code: リターンコードの設定 |

**Block 8** — [IF] `(svc_kei_stat == "100")` (L242)

> If service is in progress (TKC = 提供中): execute pause receipt processing and determine order data.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `pauseReceptTran(handle, param, fixedText, resultHash)` // Pause receipt processing: 休止受付処理 |

**Block 8.1** — [IF] `(tmpOpeDate.equals(svc_pause_ymd))` (L248)

> Operation date equals service suspension date: SOD issuance is required.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sod_hakko_flg = SOD_HAKKO_FLG_YO` // SOD flag: SOD発行設定（SOD発行要）[-> SOD_HAKKO_FLG_YO="1"] |

**Block 8.2** — [ELSE-IF] `(tmpOpeDate.compareTo(svc_pause_ymd) < 0)` (L258)

> Operation date is before suspension date: do nothing.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | (no processing: 処理なし) |

**Block 8.3** — [ELSE] (L265)

> Operation date is after suspension date: error — throw exception.

| # | Type | Code |
|---|------|------|
| 1 | SET | `param.setControlMapData(SCControlMapKeys.RETURN_CODE, "-1")` |
| 2 | SET | `errMsg = "INVALID_RETURN_MESSAGE"` |
| 3 | EXEC | `throw new SCCallException(errMsg, "0", -1)` |

**Block 9** — [IF] `(!isCheckMode)` (L275)

> Non-check mode: re-fetch service info and update liaison. The block from L275-276 re-retrieves service contract info because pauseReceptTran may have changed the service state.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `svkeiInfoStkuTran(handle, param, fixedText, resultHash)` // Re-retrieve service contract info |
| 2 | SET | `msgEKK0081A010 = (CAANMsg) resultHash.get(RESULT_KEY_EKK0081A010)` |
| 3 | CALL | `callEKK0081C014(handle, param, fixedText, msgEKK0081A010)` // Service contract business liaison update: サービス契約業務連絡備考変更 |

**Block 10** — [IF] `(!sod_hakko_flg.equals(SOD_HAKKO_FLG_FUYO) && !isCheckMode)` (L282)

> SOD issuance required AND not in check mode: create SOD and register difference info.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `rsltEKK0161B004 = callEKK0161B004(handle, param, fixedText)` // Get service contract details: サービス契約内訳照会 |
| 2 | CALL | `workEKK0161B004 = getWorkCAANMsg(rsltEKK0161B004)` // Extract work CAANMsg: 業務データの取得処理 |
| 3 | SET | `msgEKK0161B004List = workEKK0161B004.getCAANMsgList(EKK0161B004CBSMsg.EKK0161B004CBSMSG1LIST)` |
| 4 | CALL | `executeHakkoSodCC(handle, param, msgEKK0081A010, msgEKK0161B004List)` // SOD CC execution: SOD CC実行 |
| 5 | CALL | `executeFmtcelIdoInf(handle, param, inMap, fixedText)` // Fault difference registration (ANK-0035): フォルトセドル異動情報登録 |
| 6 | CALL | `executeAddSmtvlIdoInf(handle, param, inMap, fixedText)` // Smart barrier difference registration (ANK-0406): スマートバリヤ異動情報登録 |

**Block 11** — [IF] `(tmpOpeDate.equals(svc_pause_ymd))` (L297)

> Operation date equals suspension date: check for Netflix service. ANK-3987 addition.

| # | Type | Code |
|---|------|------|
| 1 | IF | `(svc_cd == "01" && !isCheckMode)` // Netflix service check: 光ネットの場合 |
| 2 | CALL | `executeNetflixTajgsKeiIdInf(handle, param, inMap, pcrs_cd)` // Netflix additional business difference registration: Netflix他事業者契約異動情報登録 |

**Block 12** — [SET, RETURN] (L306-L308)

> Set final return code and return the param object.

| # | Type | Code |
|---|------|------|
| 1 | SET | `param.setControlMapData(SCControlMapKeys.RETURN_CODE, "0000")` // Final return code: リターンコードの設定 |
| 2 | RETURN | `return param` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_stat` | Field | Service contract status — indicates the lifecycle state of a service. Values: "100" (in progress/提供中), "210" (suspended/interrupted), "220" (stopped/停止中), "910" (terminated/解約済), "920" (cancelled/キャンセル済). |
| `svc_pause_ymd` | Field | Service suspension date — the date when the service pause takes effect, in YYYYMMDD format. |
| `svc_cd` | Field | Service code — identifies the type of service. "01" = Netflix (光ネット). |
| `pcrs_cd` | Field | Price course code — identifies the pricing plan/course for the service. |
| `sod_hakko_flg` | Field | SOD issuance flag — when "1", indicates a Service Order Data record must be created to trigger downstream state transitions. When "0", SOD creation is skipped. |
| `tmpOpeDate` | Field | Current operation date — the business date used for comparing against pause and suspension dates. |
| `inMap` | Field | Pause reception input map — the data structure carrying pause request parameters from the screen. |
| `resultHash` | Field | Result hash map — carries return data from called service components (e.g., EKK0081A010 message). |
| `SVC_KEI_STAT_TKC` | Constant | Service status: in progress (提供中) = "100" |
| `SVC_KEI_STAT_PAUSE` | Constant | Service status: suspended/interrupted (休止・中断中) = "210" |
| `SVC_KEI_STAT_STP` | Constant | Service status: stopped (停止中) = "220" |
| `SVC_KEI_STAT_DSL` | Constant | Service status: terminated (解約済) = "910" |
| `SVC_KEI_STAT_CANCEL` | Constant | Service status: cancelled (キャンセル済) = "920" |
| `SOD_HAKKO_FLG_FUYO` | Constant | SOD flag: not required (不要) = "0" |
| `SOD_HAKKO_FLG_YO` | Constant | SOD flag: required (要) = "1" |
| `isCheckMode` | Field | Check/dry-run mode — when true, data-modifying operations are skipped (re-fetch, CBS calls, SOD creation, difference registration). |
| PAUSE_RECEPT_MAP | Constant | Map key for pause reception data within the target map |
| SVC_PAUSE_YMD | Constant | Map key for service suspension date within the pause reception map |
| RETURN_CODE | Field | Control map key for the return code sent back to the calling screen. "0000" = success, "-1" = error. |
| SOD | Acronym | Service Order Data — an internal order record that triggers downstream business state transitions in the telecom service provisioning system. |
| `executeHakkoSodCC` | Method | SOD creation handler — orchestrates creation of the Service Order Data record. Internally calls `executeOdrHakkoJokenAdd` for order condition registration. |
| `executeFmtcelIdoInf` | Method | Fault difference info registration — records fault-related contract differences triggered by the service pause (ANK-0035 addition). |
| `executeAddSmtvlIdoInf` | Method | Smart barrier difference info registration — records consumer protection-related service barrier changes required by 2012 consumer law amendments (ANK-0406 addition). |
| `executeNetflixTajgsKeiIdInf` | Method | Netflix additional business difference info registration — records Netflix-specific contractual differences when a Netflix service is being paused (ANK-3987 addition). |
| `svkeiInfoStkuTran` | Method | Service contract status acquisition — retrieves current service state, pause date, and service code from the system using SC `EKK0081A010`. |
| `callEKK0081C014` | Method | Service contract business liaison update — updates service contract liaison information in the system. |
| `callEKK0161B004` | Method | Service contract detail inquiry — retrieves the full list of service contract detail records (for SOD creation). |
| `pauseReceptTran` | Method | Core pause receipt processing — the main business logic for registering a service pause request. |
| `getWorkCAANMsg` | Method | Work CAAN message extractor — unwraps a CAANMsg from a service component response map. |
| KKSV0203 | Screen | Service suspension operation screen — the primary screen from which operators request service suspension. |
| KKSV0203OPOperation | Operation | Business process operation class — orchestrates the KKSV0203 workflow, including calling `pauseReceptuCtrlTran`. |
| FUNC_CD_2 | Constant | Function code "2" — indicates check mode when detected in the request parameter. |
| EKK0081A010 | SC Code | Service contract status acquisition service component. |
| EKK0081C014 | SC Code | Service contract business liaison update service component. |
| EKK0161B004 | SC Code | Service contract detail inquiry service component. |
| EKK0541C010 | Template ID | Request suspension change template (請求抑制変更). |
| EKK0541D010 | Template ID | Request suspension registration template (請求抑制登録). |
| SEIKYYOKSIHRIWAKECC | Constant | Request suspension dispatch map ID (請求抑制振分マップID). |
| CAANMsg | Type | Fujitsu's canonical message wrapper — a strongly-typed message object used across SC/CBS interfaces for structured data exchange. |
| SCCallException | Type | Service component call exception — thrown when an SC call fails, carrying an error message, error code, and return code. |
