# Eo / Web / Webview / Fuw00927sf

## Overview

The `FUW00927SF` module implements the **input content confirmation screen** (入力内容確認画面) for the eo customer base system. It is a web-view logic module within the K-Opticom (Fujitsu) web framework that displays a summary of subscription details to the user for review before registration. The user can verify personal information, contract services (network, phone, TV, mobile), usage location details, and pricing breakdowns — and then either navigate back to edit individual sections, proceed to additional service selection, or submit the registration.

This module is the penultimate screen in the new subscription flow: the user has already filled in all data on prior screens, and FUW00927SF serves as the final checkpoint where everything is displayed read-only before the `add()` registration call.

## Key Classes and Interfaces

### [FUW00927SFLogic](source/koptWebR/src/eo/web/webview/FUW00927SF/FUW00927SFLogic.java)

**Role:** The central view logic class. It orchestrates the confirmation screen lifecycle — initial display, user navigation to edit screens, service registration via EJB calls, and post-registration transitions.

It extends `JCCWebBusinessLogic` and inherits common web-business logic utilities. The class contains three distinct categories of behavior:

#### 1. `init()` — Screen Load / Initialization

The entry point when the confirmation page first loads. The method performs the following steps in sequence:

1. **Retrieves shared beans** — fetches the `CommonInfoBean` and `ServiceFormBean` which contain all data accumulated from previous input screens.
2. **Sets front-newly-set flag** — marks `FU_KBN_05` as `"R"` to indicate a front-end new registration context.
3. **Fetches dependent information** — retrieves mansion info, contract service info, and other contextual data via helper methods (`getMansioninfo`, `getKeiyakusvcinfo`, `getElseInfo`).
4. **Controls conditional display flags** based on business rules:
   - **Same-location warning flag** (`DSP_SAME_USE_PLACE_KKOKU_FLG`): For individual-contract customers who already have concurrent subscription with the same installation location, the system calls the `FUSV0198` mapper to check for existing contractor records. If zero matching records exist, the warning is hidden. If records exist, the warning is shown and the close button is enabled.
   - **Next button flag** (`DSP_NEXT_BTN_FLG`): For "all-unified submission" (全戸一括) cases where `KNYKEI_MSKM_JOKEN_CD_13` is set, the Next button is shown so the user can continue to the service selection flow.
   - **Contract service area display** (`KEI_SVC_AREA_DSP_FLG`): For add-submission scenarios where the user is adding to an existing line or adding a new line at a different location with an existing eo electricity contract, the contract service area is displayed.
   - **Campaign flag** (`CX_START_FLG`): Loaded from the display property file to control whether campaign information is shown.
5. **Calls pricing simulation** (`JFUWebCommon.ryokin(this)`) to populate cost estimates on the screen.
6. **Transfers data** from `CommonInfoBean` to the data bean (`FUW00927SFBean`) via `setFromComToDatBean()`.

#### 2. `shusei_*()` — Edit Navigation Methods

These methods handle the "correct content" (内容修正) button presses, allowing the user to navigate back to specific input screens:

| Method | Navigates to | Purpose |
|--------|-------------|---------|
| `shusei_kei_info()` | FUW00921 | Edit contractor information (individual/legal entity) |
| `shusei_shinkensha()` | FUW00921 | Edit guarantor information |
| `shusei_use_place()` | FUW00922 | Edit usage location |
| `shusei_use_setplace()` | FUW00922 | Edit usage location installation position |
| `shusei_ad()` | FUW00922 | Edit contractor residence address |
| `shusei_rrk()` | FUW00922 | Edit contact information |

Each method simply sets the next screen ID/name in the shared form bean and returns `true`.

#### 3. `add()` — Registration

The core submission method. When the user presses the "Register" button:

1. Prepares the bean hierarchy (WEB new info, contract info, mansion info).
2. Reconfigures the contractor residence selection (`setKshAddCfm`).
3. Prepares mansion data for fiber-optic scenarios (`setHikarikaMansInfo`).
4. Uses the **`FUSV0152_FUSV0152OPDBMapper`** to populate a comprehensive data map for the EJB call. The mapper call chain registers:
   - Customer registration (individual `ECK0021` or corporate `ECK0031`)
   - Contact person registration (`ECK0201`)
   - Subscription number assignment (`EKK0021C013`)
   - Auto-number assignment (`JFUMskmshoDtlSibnCC`)
   - Subscription registration (`EKK0011D010`)
   - Request contract registration (`EKK0491D010`)
   - Service-specific contract registrations (conditional):
     - Network (`EKK0091D010`, `EKK0171D010`, `EKK0361D010` for ISP, `EKK0341D01001` for equipment)
     - Phone (`EKK0111D010`, `EKK0191D010`, `EKK0371D010`, `EKK0341D01003`)
     - TV (`EKK0101D010`, `EKK0181D010`, `EKK0341D01002`)
     - Mobile (`EKK0121D010`, `EKK0201D010`, `EKK0361D010` for mobile ISP, `EKK0341D01004`)
   - Usage location info registration (`EKK0251D010`)
   - Line-target service contract registration (`EKK0241D010`)
   - Progress registration (`EKK1091D010`)
   - Location/residence split processing (`FUSV015211CC`, `FUSV015212CC`)
   - Discount service code registration (`FUSV015222CC`, `FUSV015221CC`, `FUSV015223CC`)
   - Starter channel set registration/execution (`FUSV015229CC`, `FUSV015229ReqChk`)
   - Pre-registration prohibited contract reservation (`FUSV015230CC`, `FUSV015230ReqChk`)
   - Work fee installment contract registration (`FUSV015233SC`, `FUSV015233ReqChk`)
   - And many more (agent registration, data extraction item settings, etc.)
5. Invokes the EJB service via `callService()`.
6. After registration, if business regulation flag is not set, calls `callGetdatamap()` to refresh bean data.
7. Transitions to the registration completion screen (`FUW00931`).

#### 4. `next()` — Forward to Service Selection

Used when the user has "next" button available (typically for all-unified submission). This method:

1. Retrieves selected services (network, phone, TV) from the contract service info bean.
2. Retrieves bonus point usage flags from the eo light-phone beans.
3. Clears discount service info from the shared form bean (`callClearData`).
4. Routes to the appropriate next screen based on selected service:
   - Network selected -> `FUW00916` (eo light network option selection)
   - Phone selected + bonus point used -> `FUW00918` (eo number portability info)
   - Phone selected + no bonus point -> `FUW00917` (eo light phone option selection)
   - TV selected -> `FUW00919` (eo light TV option selection)

#### 5. `back()` — Return to Previous Screen

Simply navigates back to the usage location input screen (`FUW00922`).

#### 6. `setFromComToDatBean()` — Data Transfer

Transfers display values from `CommonInfoBean` to `FUW00927SFBean`. This method converts internal code values (e.g., sex codes, contract type codes, contact choice codes) into human-readable display text using `JFUWebCommon.getDispText()`. Key fields transferred include:

- Contract type (individual/corporate)
- Sex
- Identity verification document type
- Usage location installation position (form, floor, address)
- Contact choice (same as user / same as contractor / other)
- Indoor survey appliance installation preference
- FAX contact preference
- Current network line type and installation position change flag
- Indoor survey and construction same-day implementation flag

#### 7. `callFUSV0330()` — Campaign Selection List Retrieval

Called during `init()` to fetch available campaign options. Skips the call if redirect info already contains data extraction item codes (indicating the user is coming from a campaign screen) or if the application is for an all-unified/multi-unit building.

#### 8. `getSrviceNm()` — Service Name Assembly

Constructs a display-friendly service name string by querying the property-based display text map (`DISPSETTING/SETTING[@screenId='FUW00927']`). It assembles the name from:

- Network service name (type + course, e.g., "eo光ホーム 100Mコース")
- Phone/TV/Mobile service names
- Handles single-service and multi-service scenarios

### [FUW00927SFBean](source/koptWebR/src/eo/web/webview/FUW00927SF/FUW00927SFBean.java)

**Role:** The data model / view bean for the confirmation screen. It extends `X33VViewBaseBean` and implements `X33VListedBeanInterface` and `X31CBaseBean`.

The bean holds over 150 fields, organized into these groups:

#### Pricing Display Fields

Each pricing line item follows a three-field pattern: `_update`, `_value`, and `_state` for screen control:

- **Monthly fee items**: `getsu_ryokin_kmk_list`, `getsu_ryokin_list` (with `X33VDataTypeList` for dynamic lists)
- **Initial fee items**: `shoki_hiyo_kmk_list`, `shoki_hiyo_list`
- **Monthly fee totals**: `getsu_ryokin_kei_list`, `getsu_ryokin_kei_zei_list` (with/without tax)
- **Initial fee totals**: `shoki_hiyo_kei_update/value/state`, `shoki_hiyo_kei_zei_*`
- **Mobile pricing**: `mobile_month_*`, `mobile_init_*`
- **Fee statements**: `getsu_ryokin_mongon_*`, `shoki_hiyo_mongon_*`
- **Grand totals**: `gtgk_prc_gokei_*`, `gtgk_prc_gokei_zei_*`, `shkh_gokei_*`, `shkh_gokei_zei_*`
- **Smartlist variants**: All of the above also have `_sml_` suffixed counterparts for smart device layout
- **Group/home variants**: All of the above also have `_gh_` suffixed counterparts for group/home variants

#### Screen Control Fields

Each field also has `_update` (bound to input), `_value` (display value), and `_state` (read-only/visibility state) variants for over 30 display fields, including:

- `fnc_mode_*` / `screen_mode_*` — function and screen mode control
- `dsp_next_btn_flg_*`, `dsp_close_btn_flg_*`, `dsp_add_btn_flg_*` — button visibility flags
- `dsp_same_use_place_kkoku_flg_*` — same-location warning flag
- `dsp_pcd_flg_*` — postal code display flag
- `kei_svc_area_dsp_flg_*` — contract service area display flag
- `cx_start_flg_*` — campaign start flag

#### User Information Fields

- `sex_*` — sex (individual only)
- `hnin_cfm_aticle_*` — identity verification document type
- `setplace_form_*`, `setplace_flr_*`, `setplace_bnchi_*` — usage location installation details
- `use_net_ksn_*` — current network line type
- `kiki_place_chg_*` — equipment installation position change flag
- `rrks_choice_*` — contact choice
- `fax_kibo_*` — FAX contact preference
- `tkc_koji_same_*` — indoor survey and construction same-day flag

#### List Fields

Several `X33VDataTypeList` fields hold dynamic pricing data:

- `koumoku_code_list`, `koumoku_value_list` — item codes and values
- `getsu_ryokin_kmk_list`, `getsu_ryokin_list`, `shoki_hiyo_kmk_list`, `shoki_hiyo_list` — pricing line items
- `getsu_ryokin_kei_zei_list`, `getsu_ryokin_kei_list` — total amounts
- `gtgk_wrib_mngn_tk_kikan_list`, `gtgk_wrib_mngn_wrib_nm_list`, `gtgk_wrib_mngn_wrib_amnt_list`, `gtgk_wrib_mngn_biko_list` — discount text period, name, amount, remarks

Each list has a corresponding `getJsflist_*()` method that converts the `X33VDataTypeList` into an `ArrayList<SelectItem>` for JSF dropdown rendering.

#### Constructor

The constructor initializes all `X33VDataTypeList` fields to empty lists to prevent `NullPointerException` during rendering.

### [FUW00927SFChecker](source/koptWebR/src/eo/web/webview/FUW00927SF/FUW00927SFChecker.java)

**Role:** A validation class that implements `X31SGuiCheckBase`. It receives a reference to the `X31BBusinessLogic` (which is `FUW00927SFLogic`) in its constructor.

Currently, the `checkMethod()` implementation always returns `true` and performs no validation logic. This is a framework placeholder — the pattern exists to support future GUI-level field validations (required fields, format checks, cross-field consistency) if the need arises. The `patternID` parameter would distinguish between different validation scenarios (e.g., save vs. submit), but no branching occurs in the current implementation.

### [FUW00927SFConst](source/koptWebFrontCommon/src/eo/web/webview/FUW00927SF/FUW00927SFConst.java)

**Role:** A utility class holding string constant definitions used across the module. The constructor is private to prevent instantiation.

Constants are organized into these categories:

| Category | Example Constants |
|----------|-------------------|
| Mode codes | `FNC_MODE`, `SCREEN_MODE` |
| Screen flags | `DSP_SAME_USE_PLACE_KKOKU_FLG`, `DSP_PCD_FLG`, `DSP_CLOSE_BTN_FLG`, `DSP_NEXT_BTN_FLG`, `DSP_ADD_BTN_FLG` |
| Pricing keys | `GETSU_RYOKIN_KMK`, `SHOKI_HIYO`, `GETSU_RYOKIN_KEI`, `SHOKI_HIYO_KEI_ZEI` |
| User fields | `SEX`, `HNIN_CFM_ATICLE`, `RRKS_CHOICE`, `SETPLACE_FORM`, `FAX_KIBO` |
| Display flags | `KEI_SVC_AREA_DSP_FLG`, `CX_START_FLG`, `TAKCHO_APO_KADEN_KIBO_UM_DISP_FLG` |
| Smartlist fields | `GETSU_RYOKIN_KMK_SML`, `SHOKI_HIYO_SML`, etc. (with `_SML` suffix) |
| Group/home fields | `GETSU_RYOKIN_KMK_GH`, `SHOKI_HIYO_GH`, etc. (with `_GH` suffix) |
| Discount fields | `GTGK_WRIB_MNGN_TK_KIKAN`, `GTGK_WRIB_MNGN_WRIB_NM`, `GTGK_WRIB_MNGN_WRIB_AMNT`, `GTGK_WRIB_MNGN_BIKO` |

## How It Works

### Typical Request Flow

```mermaid
flowchart TD
    subgraph A["Initialization Phase"]
        Start(["User navigates<br>to confirmation screen"]) --> Init["FUW00927SFLogic.init()"]
        Init --> GetBeans["Get CommonInfoBean +<br>ServiceFormBean"]
        GetBeans --> FetchSvc["Fetch mansion info,<br>contract services, etc."]
        FetchSvc --> CheckFlags["Evaluate display flags:<br>- Same-location warning<br>- Next button visibility<br>- Service area display<br>- Campaign flag"]
        CheckFlags --> CallService["Call FUSV0198 mapper for<br>same-contractor check"]
        CallService --> CallCampaign["Call FUSV0330 for<br>campaign list"]
        CallCampaign --> Ryokin["Call JFUWebCommon.ryokin()<br>for pricing simulation"]
        Ryokin --> TransferData["setFromComToDatBean()<br>convert codes to display text"]
        TransferData --> Render["Render JSP page<br>FUW009270PJP.jsp"]
    end

    subgraph B["User Actions"]
        Render --> UserChoice{"User selects action"}
        UserChoice -->|"Correct content<br>button"| Shusei["shusei_*() methods<br>Navigate to input screens"]
        UserChoice -->|"Register button"| Add["add()<br>EJB registration"]
        UserChoice -->|"Next button"| Next["next()<br>Service selection flow"]
        UserChoice -->|"Back button"| Back["back()<br>Return to previous screen"]
    end

    subgraph C["Registration Phase"]
        Add --> PrepareBeans["Prepare bean hierarchy"]
        PrepareBeans --> BuildDataMap["FUSV0152 mapper:<br>Customer, service,<br>contract registrations"]
        BuildDataMap --> EJBCall["invokeService()<br>Call EJB registration"]
        EJBCall --> PostReg["Post-registration:<br>refresh beans, redirect"]
        PostReg --> Complete(["Registration<br>complete screen FUW00931"])
    end

    Shusei --> End(["Continue edit flow"])
    Back --> End
```

### Same-Location Warning Logic

When an individual customer has `KNYKEI_MSKM_JOKEN_CD_12` (concurrent subscription-ready) as their contract application condition code, the system checks whether there are existing contractor records at the same location by calling the `FUSV0198` mapper:

1. If **zero** existing records are found -> hide warning, show postal code, hide close button
2. If **one or more** records found -> show warning, show postal code, show close button

This prevents duplicate subscriptions at the same address for individual contracts.

### Screen Transition Routing

The module supports a rich set of navigation paths. The `_mode_*` fields in the bean control screen state:

- `fnc_mode_update/value/state` — function mode (edit, view, etc.)
- `screen_mode_update/value/state` — screen mode (kakunin = confirmation, def = default)

Each `shusei_*()` method sets the next screen via `setNextScreen()` which writes `SCREEN_MODE_06`, `NEXT_SCREEN_ID`, and `NEXT_SCREEN_NAME` into the `CommonInfoBean`.

### Pricing Calculation Integration

The `ryokin()` method delegates to `JFUWebCommon.ryokin(this)`, which is a shared utility for pricing simulation. This external method queries the pricing engine to populate all the fee fields (`getsu_ryokin_*`, `shoki_hiyo_*`, `gtgk_prc_gokei_*`, `shkh_gokei_*`) on the confirmation screen. Errors during this call result in `JCCBusinessException` with error code `ERROR_CODE_0002`.

## Data Model

### Data Flow Architecture

The module operates on a **three-bean hierarchy** pattern common in the X33/X31 web framework:

```
CommonInfoBean (shared across all screens)
  |-- WEB_NEW_INFO (WEB new subscription info)
  |     |-- KEIYAKUSHA_INFO (contractor info)
  |     |     |-- personal/corporate fields
  |     |-- KEIYAKU_SVC_INFO (contract services)
  |     |     |-- SELECT_SVC_NET/TEL/TV/MOB
  |     |-- MANSION_INFO
  |     |-- ELSE_INFO (miscellaneous)
  |     |-- USE_KAISEN_KIKI_INFO (current line/equipment)
  |     |-- EOTEL (eo light phone, 2 records)
  |     |-- EONET (eo light network)
  |     |-- EOTV (eo light TV)
  |     |-- EOMOBILE (eo mobile)
  |     |-- REDIRECT_INFO (discount service codes)
  |     |-- PAYWAY_INFO (payment method)
  |     |-- PASCO_INFO (PASCO)
  |
  +-- ServiceFormBean (screen-specific form data)
        +-- FUW00927SFBean (this module's data bean)
              |-- All pricing, display, and control fields
```

### Field Naming Convention

The bean fields follow a strict naming convention established by the code generation tool:

- **`*_update`**: Bound to the form input (POST back value)
- **`*_value`**: Display value (read from bean)
- **`*_state`**: Field state (enabled/disabled, visible/hidden)

For list fields (pricing line items), the convention uses:
- **`*_list`**: `X33VDataTypeList` container
- **`getJsflist_*()`**: Converts the list to `ArrayList<SelectItem>` for JSF rendering

### Pricing Field Groups

The module has a massive number of pricing fields due to the complexity of Japanese telecom billing. Each pricing concept appears in up to 5 variants:

1. **Standard** — base field
2. **Smartlist (`_sml_`)** — compact variant for smart devices
3. **Group/Home (`_gh_`)** — variant for group/home contracts
4. **Tax-included** — with `_zei` suffix
5. **Statement text** — with `_mongon` suffix for formatted display

For example, the monthly fee total appears as:
- `getsu_ryokin_kei_value` / `getsu_ryokin_kei_state`
- `getsu_ryokin_kei_sml_value` / `getsu_ryokin_kei_sml_state`
- `getsu_ryokin_kei_gh_value` / `getsu_ryokin_kei_gh_state`
- `getsu_ryokin_kei_zei_value` / `getsu_ryokin_kei_zei_state`

## Dependencies and Integration

### Inbound Dependencies (What Uses This Module)

| Consumer | What It Uses |
|----------|-------------|
| `WEBGAMEN_FUW009270PJP.xml` | `FUW00927SFBean`, `FUW00927SFLogic` |
| `FUW009270PJP.jsp` | `FUW00927SFBean` (JSP view) |
| `x31business_logic_FUW00927SF.xml` | `FUW00927SFLogic` (EJB business logic config) |

### Outbound Dependencies (What This Module Calls)

| Dependency | Purpose |
|-----------|---------|
| `JCCWebBusinessLogic` | Base class for web business logic |
| `CommonInfoCF.CommonInfoCFConst` | Shared common info field constants |
| `JFUScreenConst` | Screen ID/name constants for navigation |
| `JFUWebCommon` | Shared web utilities (pricing, data access) |
| `JFUStrConst` | Japanese string constants |
| `JPCModelConstant` | Model code constants |
| `FUSV0152_FUSV0152OPDBMapper` | Registration service mapper (add) |
| `FUSV0198_FUSV0198OPDBMapper` | Same-contractor check mapper (init) |
| `FUSV0330_FUSV0330OPDBMapper` | Campaign selection mapper (init) |
| `X33VViewBaseBean` | Base bean class |
| `X31SGuiCheckBase` | Interface for checker |
| `X31BBusinessLogic` | Business logic interface |

### Related Modules

The module connects to numerous other webview modules for navigation:

- `FUW00921` — Contractor information input (edit target)
- `FUW00922` — Residence/location information input (edit target)
- `FUW00916` — eo light network option selection
- `FUW00917` — eo light phone option selection
- `FUW00918` — eo number portability info
- `FUW00919` — eo light TV option selection
- `FUW00931` — Registration completion screen
- `FUW07401SF`, `FUW07501SF`, `FUW09905SF`, `FUW12001SF`, `KKA17101SF`, `KKA17401SF`, `KKA17601SF`, `SCW00101SF` — Various related screens in the broader subscription flow

## Notes for Developers

### Code Generation

Three of the four source files (`FUW00927SFBean`, `FUW00927SFChecker`, `FUW00927SFConst`) were generated by the "Web Client Definition Tool" (Webクライアント定義ツール) v2.0.39. Only `FUW00927SFLogic` was hand-written. If you need to regenerate the bean:

1. Modify the X33 model definition files
2. Re-run the code generation tool
3. The new `FUW00927SFBean` will contain all new field getters/setters but the constructor must be reviewed to ensure all new `X33VDataTypeList` fields are initialized

### Screen Flag Pattern

Display flags in `FUW00927SFConst` control JSP rendering. The pattern `setNextScreen()` writes to the shared bean:
```java
serviceFormBean.sendMessageString(FUW00927SFConst.DSP_NEXT_BTN_FLG,
    X31CWebConst.DATABEAN_SET_VALUE, DISP_FLG_1);
```
The JSP reads this flag to conditionally render buttons. New flags should be added to `FUW00927SFConst` following the naming pattern `DSP_*_FLG`.

### Business Rule Flags

The `kariFlg` instance variable tracks whether the application was originally a provisional submission (仮申請) and needs to be converted to a real submission (本申請) after registration. This is used for the application number interface screen data preservation feature.

### Mapper Call Ordering

The `callSetdatamap()` method calls mapper methods in a very specific order. Changing the order or removing a call can break the registration flow because the EJB backend expects a particular sequence of data population. The mapper methods are not idempotent — calling `setEKK0011D010` before `setECK0021D010` would fail because the customer record must exist before the subscription record can reference it.

### Price Simulation Dependency

The pricing simulation call `JFUWebCommon.ryokin(this)` must succeed for the screen to display correctly. If the pricing service is unavailable, the user will see a generic error (`ERROR_CODE_0002`). Consider adding a fallback or graceful degradation if pricing data is non-critical for a specific use case.

### Checkbox Pattern

Fields with `_update`/`_value`/`_state` three-field pattern are typically rendered as checkboxes or radio buttons in JSF. The `_state` controls the `disabled` attribute, `_value` is the displayed label, and `_update` receives the submitted value. This pattern is used for all boolean toggle fields on the confirmation screen (button visibility, warning flags, etc.).

### Japanese Module Name Reference

The file header documents the module purpose as: "入力内容確認画面ビューロジックです。" (Input content confirmation screen view logic).

### Version History

The `FUW00927SFLogic` file has been iteratively updated since 2012 (v1.00) through v75.00 (2025), with changes spanning:

- ANK ticket items: concurrent submission, call charge limit notification, optical hybrid, FTTH volume-based billing, price simulation, all-unified submission, Web agent entry, auto-number, WiFi instant activation, identity verification, price simulation sync, standalone module application, multi-router, CRM integration, BS optimization, minor-age mineo, standard work fee installment, retail/visit Web services, selective CP system, contractor/usage location mismatch flag, competitive rule verification, simultaneous home survey/construction, home investigation labor saving, CP countermeasures, NTT countermeasures, new coarse code introduction, and retail/visit Web home survey/improvement of survey method hearing.
- IT/TAI ticket items: various system improvements and integration tasks.

This indicates the module is a **core, long-lived component** of the eo customer system that has absorbed significant business evolution.

### Checkbox Implementation Note

The `takcho_apo_kaden_kibo_um_enabled` field in the bean is a `Boolean` (not `String`), making it distinct from the standard three-field pattern. This field controls whether the indoor survey appliance installation preference checkbox is enabled.
