# Business Logic — FUW00943SFLogic.selectHfMzKjMngn() [109 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00943SF.FUW00943SFLogic` |
| Layer | Controller / Web Logic (presentation layer within the web module) |
| Module | `FUW00943SF` (Package: `eo.web.webview.FUW00943SF`) |

## 1. Role

### FUW00943SFLogic.selectHfMzKjMngn()

This method assembles construction-related display text (工事系文言) for email output in the home/Mezon (eo building) subscription flow (スクラム型有料オプション — clump-type paid option). It acts as a **text-builder** and **conditional router**: given the current subscription context (service type, order classification, installation environment), it appends the appropriate Japanese-language instructions, notes, and warnings into a `StringBuilder` message that will be rendered to the customer via email.

The method handles **four distinct business service contexts**: (1) **eo Home** services (`MSKM_KSN_SVC_HOME = "1"`), where different eo mypage guidance messages are shown based on whether the order is new (`MSKM_KBN_NEW = "1"`) or add/extension (`MSKM_KBN_ADD = "2"`); (2) **non-home services**, where a default eo mypage message is shown; (3) **eo light multi-function router return scenarios** (`CD00002_1 = "1"`), where a router return notice is appended; and (4) **Mansion Mezon** construction contexts, where general construction notes and, optionally, indoor excavation work notices are appended when TV or net services are selected.

The design follows a **builder pattern** (incrementally appending to a `StringBuilder`) combined with a **conditional dispatch pattern** (routing based on service type, order classification, and environment). It delegates to several display-text resolution utilities (`JFUWebCommon.getDispText`) to retrieve localized, screen-specific message strings from the message resource bundle. Its role in the larger system is as a **text composition utility** called by the finalization logic (`finMskm`) to prepare the construction-related email body before presentation to the customer.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["selectHfMzKjMngn"])
    START --> INIT["Initialize StringBuilder message"]
    INIT --> GET_SRV["getKeiyakusvcinfo -> bnKykSrv"]
    GET_SRV --> EXTRACT_MSKM_KBN["Extract mskmKbn from bean"]
    EXTRACT_MSKM_KBN --> EXTRACT_MSKM_KSN_SVC["Extract mskmKsnSvc from bean"]
    EXTRACT_MSKM_KSN_SVC --> EXTRACT_MSKM_MNS_TYPE["Extract mskmMnsType from bean"]
    EXTRACT_MSKM_MNS_TYPE --> EXTRACT_SVC_NET["Extract svcNet from bean"]
    EXTRACT_SVC_NET --> EXTRACT_SVC_TV["Extract svcTv from bean"]
    EXTRACT_SVC_TV --> GET_EONET["getEonet -> bnNet"]
    GET_EONET --> GET_KUGIRI["getDispText ML_DSP_KUGIRI2"]
    GET_KUGIRI --> APPEND_KUGIRI["message append kugiri divider"]
    APPEND_KUGIRI --> CHECK_HOME{mskmKsnSvc == MSKM_KSN_SVC_HOME}
    CHECK_HOME -->|Home| HOME_BRANCH["eo Mypage info Home"]
    CHECK_HOME -->|Else| OTHER_BRANCH["eo Mypage info Non-Home"]
    HOME_BRANCH --> CHECK_HOME_NEW{mskmKbn == MSKM_KBN_NEW}
    CHECK_HOME_NEW -->|New| HOME_NEW_MSG["Append eo Mypage msg home/new"]
    HOME_NEW_MSG --> CHECK_HOME_ADD{mskmKbn == MSKM_KBN_ADD}
    CHECK_HOME_ADD -->|Add| HOME_ADD_MSG["Append eo Mypage msg home/add"]
    CHECK_HOME_ADD -->|Else| CHECK_ROUTER
    CHECK_HOME_NEW -->|Else| HOME_DEFAULT_MSG["Append eo Mypage msg home/default"]
    HOME_DEFAULT_MSG --> CHECK_ROUTER
    OTHER_BRANCH --> CHECK_OTHER_NEW{mskmKbn == MSKM_KBN_NEW}
    CHECK_OTHER_NEW -->|New| OTHER_NEW_MSG["Append eo Mypage msg non-home/new"]
    CHECK_OTHER_NEW -->|Else| CHECK_ROUTER
    OTHER_NEW_MSG --> CHECK_ROUTER
    CHECK_ROUTER{returnFlg == CD00002_1}
    CHECK_ROUTER -->|Yes| APPEND_ROUTER["Append router return message"]
    CHECK_ROUTER -->|No| CHECK_MEZON
    APPEND_ROUTER --> CHECK_MEZON{mskmKsnSvc == MSKM_KSN_SVC_MANSION}
    CHECK_MEZON -->|Mansion| MEZON_BRANCH
    CHECK_MEZON -->|Else| END_RETURN
    MEZON_BRANCH --> CHECK_MEZON_TYPE{mskmMnsType == MSKM_MNS_TYPE_MEZON}
    CHECK_MEZON_TYPE -->|Mezon| APPEND_MEZON_MSG["Append general notes Mezon"]
    APPEND_MEZON_MSG --> CHECK_NET_TV{svcTv == TV_CHOICE OR svcNet == NET_CHOICE}
    CHECK_NET_TV -->|True| APPEND_MEZON_NET_TV["Append indoor work msg Mezon"]
    APPEND_MEZON_NET_TV --> END_RETURN
    CHECK_NET_TV -->|False| END_RETURN
    END_RETURN["Return message"]
```

**CRITICAL — Constant Resolution:**

| Constant | Actual Value | Business Meaning |
|----------|-------------|------------------|
| `MSKM_KSN_SVC_HOME` | `"1"` | Subscription return line service — Home (eo building residential) |
| `MSKM_KSN_SVC_MANSION` | `"2"` | Subscription return line service — Mansion |
| `MSKM_KBN_NEW` | `"1"` | Order classification — New order |
| `MSKM_KBN_ADD` | `"2"` | Order classification — Add order (new line addition / addition to existing line) |
| `MSKM_MNS_TYPE_MEZON` | `"2"` | Management type — Mezon (eo brand building) |
| `CD00002_1` | `"1"` | Flag value indicating "required" state (router return required) |
| `SELECT_SVC_TV_CHOICE` | `"1"` | Selected service TV — Choice plan selected |
| `SELECT_SVC_NET_CHOICE` | `"1"` | Selected service Net — Choice plan selected |
| `RETURN_CODE` | `"\r
"` | Carriage return / line feed |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `webNewInfoBean` | `X31SDataBeanAccess` | The web form data bean carrying the customer's current subscription and order context. It holds the order classification code (new vs. add), the subscription return line service type (home vs. mansion vs. mobile vs. electric), the management type (mansion vs. Mezon), and the selected net/TV service codes. This bean is the primary input that determines which message branches are activated. |

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

| No | Field / Source | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `getKeiyakusvcinfo(webNewInfoBean)` | `X31SDataBeanAccess` | Contract service info bean — retrieves the customer's contract service information (including selected TV and net services) via a delegated call to the instance method `getKeiyakusvcinfo`. |
| 2 | `getEonet(webNewInfoBean)` | `X31SDataBeanAccess` | eo Net bean — retrieves the eo light multi-function router-related information (including the router return flag) via a delegated call to the instance method `getEonet`. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `X31SDataBeanAccess.sendMessageString` | - | - | Reads string values from the web form data bean by key (e.g., MSKM_KBN_06, MSKM_KSN_SVC_06). No database operation; acts as an in-memory data accessor. |
| R | `JFUWebCommon.getDispText` | JFUWebCommon | - | Retrieves localized display text from the message resource bundle for screen `FUW00943` (e.g., divider text, eo mypage messages, router return message, Mezon construction notes). |
| R | `JFUGetTabletTanmtCmpKbn.getDispText` | JFUGetTabletTanmtCmpKbn | - | (Pre-computed from code analysis graph — display text resolution utility) |
| R | `JFUMskmDmenMappingUtil.getDispText` | JFUMskmDmenMapping | - | (Pre-computed from code analysis graph — display text resolution utility) |
| R | `FUW07401SFLogic.getDispText` | FUW07401SFLogic | - | (Pre-computed from code analysis graph — display text resolution utility) |
| R | `FUW07501SFLogic.getDispText` | FUW07501SFLogic | - | (Pre-computed from code analysis graph — display text resolution utility) |
| R | `FUW12001SFLogic.getDispText` | FUW12001SFLogic | - | (Pre-computed from code analysis graph — display text resolution utility) |
| R | `FUW00943SFLogic.getEonet` | FUW00943SFLogic | - | Instance method that extracts and returns the eo Net information bean from the webNewInfoBean. Read-only data extraction. |
| R | `FUW00943SFLogic.getKeiyakusvcinfo` | FUW00943SFLogic | - | Instance method that extracts and returns the contract service info bean from the webNewInfoBean. Read-only data extraction. |

**How to classify:**
- All operations in this method are **Read (R)** or **non-CRUD** (-). The method is purely a text composition utility — it reads data from beans, resolves display messages, and appends text. It does **not** create, update, or delete any database records.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `FUW00943SFLogic.finMskm` | `finMskm` -> `selectHfMzKjMngn(webNewInfoBean)` | `getDispText [R] -`, `sendMessageString [-]`, `getKeiyakusvcinfo [R] -`, `getEonet [R] -` |

**Terminal operations from this method (end of chain):**
- `sendMessageString` (×18 calls — read from X31SDataBeanAccess, non-CRUD)
- `getDispText` (×5 calls via `JFUWebCommon.getDispText` — reads from message resource bundle)

No screen/batch entry points found within 8 hops. This method is a **leaf-level text builder** with no downstream service component (SC) or database operations — it only delegates to display-text resolution utilities and in-memory bean accessors.

## 6. Per-Branch Detail Blocks

### Block 1 — Initialization (L2971)

> Initialize the message StringBuilder and extract all relevant subscription/service context data from the input bean and delegated instance methods.

| # | Type | Code |
|---|------|------|
| 1 | SET | `message = new StringBuilder()` |
| 2 | CALL | `bnKykSrv = getKeiyakusvcinfo(webNewInfoBean)` — Contract service info bean |
| 3 | SET | `mskmKbn = webNewInfoBean.sendMessageString(MSKM_KBN_06, DATABEAN_GET_VALUE)` — Extract order classification (申受区割: order classification code) |
| 4 | SET | `mskmKsnSvc = webNewInfoBean.sendMessageString(MSKM_KSN_SVC_06, DATABEAN_GET_VALUE)` — Extract subscription return line service type (申受回線サービス: subscription return line service) |
| 5 | SET | `mskmMnsType = webNewInfoBean.sendMessageString(MSKM_MNS_TYPE_06, DATABEAN_GET_VALUE)` — Extract management type (申受マンションタイプ: subscription management type) |
| 6 | SET | `svcNet = bnKykSrv.sendMessageString(SELECT_SVC_NET_10, DATABEAN_GET_VALUE)` — Extract selected net service (選択サービス(ネット): selected service (net)) |
| 7 | SET | `svcTv = bnKykSrv.sendMessageString(SELECT_SVC_TV_10, DATABEAN_GET_VALUE)` — Extract selected TV service (選択サービス(テレビ): selected service (TV)) |
| 8 | CALL | `bnNet = getEonet(webNewInfoBean)` — eo Net information bean |
| 9 | SET | `kugiri = JFUWebCommon.getDispText(FUW00943, ML_DSP_KUGIRI2)` — Divider text (区切り線表示フラグ: divider display flag) |
| 10 | EXEC | `message.append(kugiri)` — Append divider (申受サービスの箇所: subscription service section) |

### Block 2 — eo Mypage Info: Home vs. Non-Home Branch (L3000)

> Conditional branch on whether the subscription return line service is "Home" (eo building residential). This determines which eo mypage guidance messages to show.

#### Block 2.1 — IF: mskmKsnSvc == MSKM_KSN_SVC_HOME ("1") — Home (L3000)

> The customer's subscription is for eo Home (home/eo building) services. Branch further on order classification (new vs. add).

##### Block 2.1.1 — IF: mskmKbn == MSKM_KBN_NEW ("1") — New Order (L3001)

> The customer is placing a new order. Append the eo mypage guidance message specific to home new orders.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mlEoMypage = JFUWebCommon.getDispText(FUW00943, ML_DSP_MSG_EOMYPAGE_HOME_NEW)` |
| 2 | EXEC | `message.append(RETURN_CODE)` — Line break (改行) |
| 3 | EXEC | `message.append(RETURN_CODE)` — Line break (改行) |
| 4 | EXEC | `message.append(mlEoMypage)` |

##### Block 2.1.2 — ELSE-IF: mskmKbn == MSKM_KBN_ADD ("2") — Add Order (L3008)

> The customer is placing an add order (new line addition / addition to existing line). Append the eo mypage guidance message specific to home add orders.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mlEoMypage = JFUWebCommon.getDispText(FUW00943, ML_DSP_MSG_EOMYPAGE_HOME_ADD)` |
| 2 | EXEC | `message.append(RETURN_CODE)` — Line break (改行) |
| 3 | EXEC | `message.append(RETURN_CODE)` — Line break (改行) |
| 4 | EXEC | `message.append(mlEoMypage)` |

##### Block 2.1.3 — ELSE: Default Home (implicit, L3015)

> The order classification is neither new nor add for a home subscription. Fall through to router check without appending a specific home mypage message.

#### Block 2.2 — ELSE: Non-Home Services (L3017)

> The subscription return line service is NOT "Home" (could be mansion, mobile, electric, etc.). Only check for new orders to append the default eo mypage message.

##### Block 2.2.1 — IF: mskmKbn == MSKM_KBN_NEW ("1") — New Order (L3018)

> The customer is placing a new order for a non-home service. Append the default eo mypage guidance message (non-home variant).

| # | Type | Code |
|---|------|------|
| 1 | SET | `mlEoMypage = JFUWebCommon.getDispText(FUW00943, ML_DSP_MSG_EOMYPAGE)` — Default eo mypage message (non-home) |
| 2 | EXEC | `message.append(RETURN_CODE)` — Line break (改行) |
| 3 | EXEC | `message.append(RETURN_CODE)` — Line break (改行) |
| 4 | EXEC | `message.append(mlEoMypage)` |

##### Block 2.2.2 — ELSE: Default Non-Home (implicit, L3025)

> The order classification is not new for a non-home service. No eo mypage message is appended. Fall through to router check.

### Block 3 — eo Light Multi-Function Router Return Notice (L3030)

> Check whether the eo light multi-function router requires return. If so, append the router return detail message.

#### Block 3.1 — SET: Extract Router Return Flag (L3030)

| # | Type | Code |
|---|------|------|
| 1 | SET | `returnFlg = bnNet.sendMessageString(ROUTER_RETURN_FLG_11, DATABEAN_GET_VALUE)` — Router return flag (eo光ルーター返却フラグ) |

#### Block 3.2 — IF: returnFlg == CD00002_1 ("1") — Router Return Required (L3031)

> The router return flag is set to "required". Append the eo light multi-function router return notice message.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mlRouterReturn = JFUWebCommon.getDispText(FUW00943, ML_DSP_ROUTER_RETURN_DTL)` — Router return detail message (eo光多機能ルーターについて: regarding eo light multi-function router) |
| 2 | EXEC | `message.append(RETURN_CODE)` — Line break (改行) |
| 3 | EXEC | `message.append(RETURN_CODE)` — Line break (改行) |
| 4 | EXEC | `message.append(mlRouterReturn)` — Append router return detail |

#### Block 3.3 — ELSE: No Router Return Needed (implicit)

> The router return flag is not set. Skip router return message. Fall through to Mezon construction check.

### Block 4 — Mansion Mezon Construction Notes (L3038)

> Check if the subscription is for a Mansion and the management type is Mezon. If so, append general construction notes. If TV or net service is selected, also append indoor excavation work notices.

#### Block 4.1 — IF: mskmKsnSvc == MSKM_KSN_SVC_MANSION ("2") AND mskmMnsType == MSKM_MNS_TYPE_MEZON ("2") — Mansion Mezon (L3038)

> The customer's subscription is for a Mansion (mansion-type residential building) with Mezon management type (eo brand building). This is a specialized construction context.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mlMezonKjMsg = JFUWebCommon.getDispText(FUW00943, ML_DSP_MSG_KJ_MEZON)` — General construction notes Mezon (全般的な注意事項_メzon 工事: general construction notes) |
| 2 | EXEC | `message.append(RETURN_CODE)` — Line break (改行) |
| 3 | EXEC | `message.append(RETURN_CODE)` — Line break (改行) |
| 4 | EXEC | `message.append(mlMezonKjMsg)` |

##### Block 4.1.1 — IF: svcTv == SELECT_SVC_TV_CHOICE ("1") OR svcNet == SELECT_SVC_NET_CHOICE ("1") — TV or Net Service Selected (L3047)

> TV choice plan or net choice plan is selected alongside the Mezon mansion construction. Append the indoor work (excavation work) notice.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mlMzKjNetTvMsg = JFUWebCommon.getDispText(FUW00943, ML_DSP_MSG_KJ_MEZON_NET_TV)` — Indoor work (excavation work) notice Mezon (室内工事（開通工事）について_メzon: regarding indoor work (passage work)) |
| 2 | EXEC | `message.append(RETURN_CODE)` — Line break (改行) |
| 3 | EXEC | `message.append(RETURN_CODE)` — Line break (改行) |
| 4 | EXEC | `message.append(mlMzKjNetTvMsg)` |

##### Block 4.1.2 — ELSE: No TV/Net Selection (implicit)

> Neither TV nor net choice plan is selected. No indoor work message appended for Mezon.

#### Block 4.2 — ELSE: Not Mansion or Not Mezon (implicit)

> The subscription is not for a Mansion, or the management type is not Mezon. Skip all Mezon-specific construction messages.

### Block 5 — Return (L3061)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return message` — Return the fully assembled message StringBuilder |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mskmKbn` | Field | Order classification code (申受区割) — distinguishes new orders ("1") from add/extension orders ("2") |
| `mskmKsnSvc` | Field | Subscription return line service type (申受回線サービス) — "1" = Home (eo building residential), "2" = Mansion, "3" = Mobile, "4" = Electric |
| `mskmMnsType` | Field | Management type (申受マンションタイプ) — "1" = standard Mansion, "2" = Mezon (eo brand building) |
| `svcNet` | Field | Selected net service code (選択サービス(ネット)) — "1" indicates Choice plan selected |
| `svcTv` | Field | Selected TV service code (選択サービス(テレビ)) — "1" indicates Choice plan selected |
| `returnFlg` | Field | Router return flag (eo光ルーター返却フラグ) — "1" indicates the eo light multi-function router must be returned |
| `kugiri` | Field | Divider text (区切り線) — section separator in the email message |
| `JFUStrConst.MSKM_KSN_SVC_HOME` | Constant | Subscription return line service = Home ("1") — eo building residential service |
| `JFUStrConst.MSKM_KSN_SVC_MANSION` | Constant | Subscription return line service = Mansion ("2") |
| `JFUStrConst.MSKM_KBN_NEW` | Constant | Order classification = New order ("1") |
| `JFUStrConst.MSKM_KBN_ADD` | Constant | Order classification = Add order ("2") — new line addition or addition to existing line |
| `JFUStrConst.MSKM_MNS_TYPE_MEZON` | Constant | Management type = Mezon ("2") — eo brand building management |
| `JFUStrConst.CD00002_1` | Constant | Flag value "1" indicating "required" state |
| `JFUStrConst.SELECT_SVC_TV_CHOICE` | Constant | Selected TV service = Choice plan ("1") |
| `JFUStrConst.SELECT_SVC_NET_CHOICE` | Constant | Selected Net service = Choice plan ("1") |
| `JFUStrConst.RETURN_CODE` | Constant | Carriage return + line feed (`\r
`) used as line breaks in email output |
| eo | Business term | Japan Telecom's broadband/communication brand (NTT East region) |
| eo光 (eo Hikari) | Business term | eo Fiber — fiber-optic internet service |
| eo多機能ルーター | Business term | eo Multi-function Router — combined router/gateway device for eo services |
| Mezon | Business term | Mezon — eo brand's premium building/residential product line |
| 工事系文言 | Business term | Construction-related display text — installation/construction notices shown to customers |
| スクラム型有料オプション | Business term | Clump-type paid option — bundled paid service packages |
| ML_DSP_* | Constant prefix | Message List Display — message resource keys for localized display text |
| X31SDataBeanAccess | Type | Web form data bean — holds customer subscription/order data for the web screen |
| `getKeiyakusvcinfo` | Method | Instance method — extracts contract service info bean from the web form data |
| `getEonet` | Method | Instance method — extracts eo Net (router) info bean from the web form data |
| `getDispText` | Method | Utility method — resolves a message key from the screen-specific message resource bundle |
| `finMskm` | Method | Caller — finalization logic for the subscription confirmation screen, calls this method to build the construction message text |
