# Business Logic - KKW00147SFLogic.editServiceFormBean() [909 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | eo.web.webview.KKW00147SF.KKW00147SFLogic |
| Layer | Controller / Web Logic (SF = Screen Flow, webview package) |
| Module | KKW00147SF (Package: eo.web.webview.KKW00147SF) |

## 1. Role

### KKW00147SFLogic.editServiceFormBean()

This method populates and edits the service form bean for the Telephone Number Registration screen (KKW00147) after the KKSV0051 service call returns. It is the central data-mapping and display-preparation routine that transforms raw service-contract data, customer information, and line-configuration results into a flat form suitable for rendering the user interface. It handles all operation division (ido_div) branches: phone number addition (BANGO_TSUIKA), phone number change (BANGO_HENKO), phone change (DENWA_HENKO), number cancellation (BANGO_KAIYAKU), number porting-out (DENWA_BMPP_MMODOSHU), and call forwarding cancellation (DENWA_TDIS). For each branch it performs: (1) commission/pulldown configuration based on the operation type; (2) extraction of address, name, phone number, and port-related fields from the service-contract bean, agreement bean, and customer bean; (3) computation of derived display values such as call-forwarding status, billing-period breakdowns, and penalty occurrence flags; (4) population of the telephone number history table with formatted dates and display labels. The method implements a routing/dispatch pattern (branching on ido_div) and a builder/delegation pattern (delegating address formatting to editAddress, date formatting to JPCFomatString.formatDate, and authority checks to getDispAuthority). It plays a shared display-preparation role - not an entry point itself, but an internal method called by actionInitKKW00147(), ensuring the form is fully initialized before screen rendering.

## 2. Processing Pattern (Detailed Business Logic)

The method flow is structured as a multi-stage pipeline:

1. **Stage 1 - Operation Date & ID Acquisition** (L456-L470): Retrieve operating date via JCCWebCommon.getOpeDate(). Echo back uketsukeNo and mskmNo from svcFormBean.

2. **Stage 2 - Commission Branching** (L470-L543): Route by ido_div:
   - If BANGO_TSUIKA: Read parentMap from outputMap(KKSV006401CC), find matching EKK1021B001CBSMsg1List record, extract icjkn_sette_cd and icjkn_shitei_amnt. Configure pulldown. If JIMUTE_SHITEIGAKU, set jimuCommisionAmnt.
   - If BANGO_HENKO or BANGO_KAIYAKU: Configure pulldown with JIMU_TESURYO_NASI.
   - Else (DENWA_HENKO, DENWA_TDIS, etc.): Clear pulldown.

3. **Stage 3 - Bean Acquisition** (L545-L571): Read 5 DataBean arrays: EKK0081A010DATA (service contract), EKK0161A010DATA (contract agreement), EKK0191A010DATA (eo phone agreement), ECK0011A010DATA (customer agreement), EKK0251ZXXXDATA (service line).

4. **Stage 4 - Valid/Invalid List Build** (L573-L581): Loop through CD00002DATA, build umuMap from CD_DIV_14 to CD_DIV_NM_14.

5. **Stage 5 - BMP_UM (Phone Directory) Setup** (L583-L589): If svcKeiUcwkTelBean has BMP_UM_06 set it, else default CD00002_NASI. Configure pulldown.

6. **Stage 6 - BMP Commission Handling** (L591-L641): If CD00002_ARI (directory present) and (DENWA_HENKO or empty id): Extract from KKSV006431SC -> EKK1021A010CBSMsg1List. Configure BMP_MSKM_COMMISION pulldown. If JIMUTE_SHITEIGAKU, set amount.

7. **Stage 7 - Update Timestamps** (L643-L674): Set SVCKEI_UPD_DTM, SVC_UCWK_UPD_DTM, SVC_UCWK_TEL_UPD_DTM, SVCKEIUCWKTEL_GENE_ADD_DTM from source beans.

8. **Stage 8 - Issuer Number Notification** (L676-L702): Call getTelNoTchUm(). Configure HASINSHA_NO_TCH pulldown. Set HNO_TCHI_INI.

9. **Stage 9 - New vs Existing Number Branch** (L710-L716): If svcFormBean SVC_KEI_UCWK_NO is null (new number):
   - Clear phone fields, NRN
   - Copy user name (kana + kanji) from okyakusamaBean
   - Copy address from svcKeiKaisenBean via editAddress()
   - Copy banchiGo, adTtmm, adRoom (concatenated)
   - Copy adCd, postCd, svc_kei_kaisen_ucwk_no
   - Set no_guide, book_um, TOKI_JOKYO, PRD_FROM, PRD_TO, KEIUW_STAT, SVC_STAYMD, SVC_CHRG_STAYMD, SVC_END_YMD, SVC_CHRG_END_YMD
   - Clear PNLTY_HASSEI_DIV_L
   - Set SVC_STP_YMD, SVC_STP__RLS_YMD, TELNO_PRE_TCHI
   - Set TK_HOSHIKI_KEI_NO from svcKeiBean

10. **Stage 10 - Existing Number Processing** (L718-L1067): Else (existing number):
    - Copy svc_kei_kaisen_ucwk_no
    - Copy TEL_NO and TEL_NO_BEFORE from svcKeiUcwkTelBean
    - Call editNrn()
    - Copy user names, address, banchiGo, adTtmm, adRoom
    - Copy no_guide, book_um with getDisplayNameFromPulldown
    - **Call forwarding status computation** (L837-L922): Calculate TALKY_RESERVED or TALKY_ACTIVATED based on itenTalkyStaYmd and itenTalkyEndYmd vs unyoYmd. Handle MAX_DATE (20991231) as empty.
    - Set TOKI_JOKYO, ITNTOKI_END_YMD, PRD_FROM, PRD_TO
    - Set KEIUW_STAT, SVC_STAYMD, SVC_CHRG_STAYMD
    - **If BANGO_KAIYAKU** (L977-L1016): Set SVC_END_YEAR/MON/DAY/YMD and SVC_CHRG_END_YEAR/MON/DAY/YMD to current unyoYmd
    - **Else** (L1018-L1104): Extract svcEndYmd and svcDslKisanYmd, split into year/month/day fields
    - Set PNLTY_HASSEI_DIV pulldown
    - Set SVC_STP_YMD, SVC_STP__RLS_YMD (handle MAX_DATE as clear)
    - Set TELNO_PRE_TCHI from denbanNm[0-2] array lookup
    - Set MSKM_DTL_NO, TK_HOSHIKI_KEI_NO

11. **Stage 11 - VA & Port Configuration** (L1069-L1075): Call configureVAChoicePulldown(svcFormBean, outputMap). Call configureVAPortPulldown(svcFormBean, svcKeiUcwkTelBean).

12. **Stage 12 - Phone Number History Population** (L1077-L1150): Loop telLstArr (EKK0191BXXXDATA), copy each record to rrkArr (TELNO_RRK) with fields: RIREKI_TELNO_02, RIREKI_BMP_02 (from umuMap), RIREKI_KEI_UCWK_STAT_NM_02, RIREKI_SVC_STAYMD_02 (formatted), RIREKI_SVC_ENDYMD_02 (formatted). Copy RIREKI_NO_GUIDE_02 and RIREKI_DNWACHO_KEISAI_02. Build CSV hidden values.

13. **Stage 13 - Misc Initialization** (L1152-L1278): If DENWA_TDIS or empty, set TELNO_RRK_CHOICE to 0. Get PRC_GRP_CD from eKK0081A010DATA. Initialize kkw00201Bean (HATUBAN_INPUT). If BANGO_HENKO, clear and re-add BMP_INPUT and DOBANITEN_INPUT beans. Call actionKikiChange().

14. **Stage 14 - Display Contract Status** (L1278-L1300): Loop EKK0191B001DATA, find matching svc_kei_ucwk_no, copy dsp_svc_kei_ucwk_stat. Copy svc_kei_ucwk_stat.

15. **Stage 15 - ONU Exchange Check** (L1300-L1308): If BANGO_TSUIKA and onuKokanKojiFlg equals 1, set message EKBF810--I.

16. **Stage 16 - ENUM KRKE Authority** (L1310-L1362): If BANGO_KAIYAKU or DENWA_BMPP_MMODOSHU:
    - Call getDispAuthority(), set ENUM_KRKE_AUTHORITY_FLG
    - Get eTU0151A011DATA (Port Auto Agreement). If telno empty, set ENUM_KRKE_DOUJI=false, HIDE_ENUM_KRKE_DOUJI=false. Else set both to enumKrkeAuthority.

### Sequence Diagram

sequenceDiagram
    participant A as actionInitKKW00147
    participant B as editServiceFormBean
    participant C as JCCWebCommon
    participant D as editAddress
    participant E as editNrn
    participant F as configureVAChoicePulldown
    participant G as configureVAPortPulldown
    participant H as getTelNoTchUm
    participant I as actionKikiChange
    participant J as getDispAuthority

    A->>B: editServiceFormBean(svcFormBean, outputMap)
    B->>C: getOpeDate()
    B->>D: editAddress(bean, ...)
    B->>E: editNrn(svcFormBean, bmp_um)
    B->>F: configureVAChoicePulldown(...)
    B->>G: configureVAPortPulldown(...)
    B->>H: getTelNoTchUm()
    B->>I: actionKikiChange()
    B->>J: getDispAuthority()

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | svcFormBean | X31SDataBeanAccess | The service form bean that holds all display fields for the Telephone Number Registration screen. It contains fields for phone number, address, user names, service dates, commission codes, history records, port-related data, and various pulldown code lists. All field values are set here for UI rendering. |
| 2 | outputMap | HashMap<String, Object> | Holds inter-screen data passed from the caller actionInitKKW00147(). Contains parentMap (KKSV006401CC) with EKK1021B001CBSMsg1List for commission results, and KKSV006431SC for phone directory commission data. Used to retrieve temporarily-set agreement one-time payment settings. |

**Instance Fields Read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| ido_div | String | Operation division code that determines which branch is executed. Values include: BANGO_TSUIKA (phone number addition), BANGO_HENKO (phone number change), BANGO_KAIYAKU (number cancellation), DENWA_HENKO (phone change), DENWA_TDIS (call forwarding cancellation), DENWA_BMPP_MMODOSHU (number porting-out) |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JCCWebCommon.getOpeDate` | JCCWebCommon | - | Calls getOpeDate to retrieve the current operating date |
| - | `editAddress` | KKW00147SFLogic | - | Internal method that concatenates address components (state, city, oaza, aza, banchigo) |
| - | `editNrn` | KKW00147SFLogic | - | Internal method that processes NRN (Number Routing Number) display fields |
| - | `configureVAChoicePulldown` | KKW00147SFLogic | - | Internal method configuring VA (Terminal) choice pulldown with outputMap |
| - | `configureVAPortPulldown` | KKW00147SFLogic | - | Internal method configuring VA port pulldown from svcKeiUcwkTelBean |
| - | `getTelNoTchUm` | KKW00147SFLogic | - | Internal method determining issuer number notification presence |
| - | `actionKikiChange` | KKW00147SFLogic | - | Internal method handling equipment change for ANK-1578-00-00 |
| - | `getDispAuthority` | KKW00147SFLogic | - | Internal method determining ENUM/krke display authority (ANK-4494-00-00) |
| - | `getDisplayNameFromPulldown` | KKW00147SFLogic | - | Internal method resolving pulldown code to display name |
| - | `OneStopDataBeanAccessArray.addDataBean` | OneStopDataBeanAccessArray | - | Adds a data bean to TELNO_RRK (phone number history) array |
| - | `OneStopDataBeanAccessArray.clearArray` | OneStopDataBeanAccessArray | - | Clears the TELNO_RRK (phone number history) array before population |
| - | `OneStopDataBeanAccessArray.getDataBean` | OneStopDataBeanAccessArray | - | Retrieves a data bean at index i from telLstArr for history loop |
| - | `OneStopDataBeanAccess.getDataBean` | OneStopDataBeanAccess | - | Retrieves individual data bean (index 0) from various bean arrays |
| - | `OneStopDataBeanAccess.getDataBeanArray` | OneStopDataBeanAccess | - | Retrieves typed DataBeanArray for service contract, agreement, customer, etc. |
| - | `OneStopDataBeanAccess.sendMessageString` | OneStopDataBeanAccess | - | GET/SET operations on all form bean fields (DATABEAN_GET_VALUE / DATABEAN_SET_VALUE) |
| - | `OneStopDataBeanAccess.sendMessage` | OneStopDataBeanAccess | - | CLEAR operations on form bean fields (DATABEAN_CLEAR) |
| - | `OneStopDataBeanAccess.sendMessageBoolean` | OneStopDataBeanAccess | - | Sets boolean fields (ENUM_KRKE_AUTHORITY_FLG, ENUM_KRKE_DOUJI, HIDE_ENUM_KRKE_DOUJI) |
| - | `OneStopDataBeanAccessArray.getCount` | OneStopDataBeanAccessArray | - | Gets row count for history loop iterations |
| - | `JPCFomatString.formatDate` | JPCFomatString | - | Formats date strings from YYYYMMDD to display format (YYYY/MM/DD) |
| - | `JCCWebCommon.setMessageInfo` | JCCWebCommon | - | Sets message EKBF810--I for ONU exchange work notification |

## 5. Dependency Trace

### Callers

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | KKW00147SFLogic.actionInitKKW00147() | actionInitKKW00147() -> editServiceFormBean(svcFormBean, outputMap) | formatDate [R], sendMessageString [R/U], getDataBean [R], getDataBeanArray [R], getOpeDate [R], setMessageInfo [-], addDataBean [C], clearArray [U] |

### Terminal Operations Reached

| # | Terminal Operation | Type |
|---|-------------------|------|
| 1 | JCCWebCommon.getOpeDate | R |
| 2 | OneStopDataBeanAccess.getDataBeanArray | R |
| 3 | OneStopDataBeanAccess.getDataBean | R |
| 4 | OneStopDataBeanAccess.sendMessageString (GET_VALUE) | R |
| 5 | OneStopDataBeanAccess.sendMessageString (SET_VALUE) | U |
| 6 | OneStopDataBeanAccess.sendMessage (CLEAR) | U |
| 7 | OneStopDataBeanAccess.sendMessageBoolean (SET_VALUE) | U |
| 8 | OneStopDataBeanAccessArray.addDataBean | C |
| 9 | OneStopDataBeanAccessArray.clearArray | U |
| 10 | OneStopDataBeanAccessArray.getCount | R |
| 11 | OneStopDataBeanAccessArray.getDataBean | R |
| 12 | JPCFomatString.formatDate | R |
| 13 | JCCWebCommon.setMessageInfo | - |

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `unyoYmd = JCCWebCommon.getOpeDate(this, null)` (L456)

| # | Type | Code |
|---|------|------|
| 1 | SET | unyoYmd = JCCWebCommon.getOpeDate(this, null) // Operating date |
| 2 | SET | uketsukeNo = svcFormBean.sendMessageString(MSKMSHO_NO, GET_VALUE) // Receipt number |
| 3 | SET | svcFormBean.sendMessageString(MSKMSHO_NO, SET_VALUE, uketsukeNo) // Echo back receipt number |
| 4 | SET | mskmNo = svcFormBean.sendMessageString(MSKMSHO_DTL_NO, GET_VALUE) // Submission number |
| 5 | SET | svcFormBean.sendMessageString(MSKMSHO_DTL_NO, SET_VALUE, mskmNo) // Echo back submission number |

**Block 2** — [IF] `ido_div.equals(IDO_DIV_BANGO_TSUIKA)` [phone number addition] (L477)

> Handles commission setup for phone number addition operations. Reads parentMap to find EKK1021B001CBSMsg1List (temporary payment settings agreement result).

| # | Type | Code |
|---|------|------|
| 1 | SET | jimuCommision = JIMU_TESURYO_NASI // Default: no commission |
| 2 | SET | jimuCommisionAmnt = "" // No commission amount |
| 3 | SET | parentMap = outputMap.get("KKSV006401CC") // Get parent temporary payment settings data |
| 4 | IF | parentMap != null && EKK1021B001CBSMsg1List has entries |
| 5 | SET | tmpSvcKeiUcwkNo = svcFormBean.getServiceContractNumber |
| 6 | FOR | i=0 to ekk1021B001CBSMsg1List.size(), find matching svc_kei_ucwk_no |
| 7 | SET | jimuCommision = record.icjkn_sette_cd // Commission type code |
| 8 | SET | jimuCommisionAmnt = record.icjkn_shitei_amnt // Specified amount |
| 9 | CALL | configPulldown(svcFormBean, CD00346DATA, JIMU_COMMISION, jimuCommision) |
| 10 | IF | JIMUTE_SHITEIGAKU.equals(jimuCommision) [specified amount] |
| 11 | SET | svcFormBean.set JIMU_COMMISION_AMNT = jimuCommisionAmnt |

**Block 3** — [ELSE IF] `ido_div.equals(IDO_DIV_BANGO_HENKO) || id o_div.equals(IDO_DIV_BANGO_KAIYAKU)` [phone number change OR number cancellation] (L527)

| # | Type | Code |
|---|------|------|
| 1 | CALL | configPulldown(svcFormBean, CD00346DATA, JIMU_COMMISION, JIMU_TESURYO_NASI) |

**Block 4** — [ELSE] [phone change / call forwarding cancellation / number porting-out] (L540)

| # | Type | Code |
|---|------|------|
| 1 | CALL | configClearPulldown(svcFormBean, JIMU_COMMISION) |

**Block 5** — [SET] Bean Acquisition Stage (L545-L571)

| # | Type | Code |
|---|------|------|
| 1 | SET | svcKeiBean = svcFormBean.getDataBeanArray(EKK0081A010DATA).getDataBean(0) // Service contract |
| 2 | SET | svcKeiUcwkBean = svcFormBean.getDataBeanArray(EKK0161A010DATA).getDataBean(0) // Contract agreement |
| 3 | SET | svcKeiUcwkTelBean = svcFormBean.getDataBeanArray(EKK0191A010DATA).getDataBean(0) // eo phone agreement |
| 4 | SET | okyakusamaBean = svcFormBean.getDataBeanArray(ECK0011A010DATA).getDataBean(0) // Customer agreement |
| 5 | SET | svcKeiKaisenBean = svcFormBean.getDataBeanArray(EKK0251ZXXXDATA).getDataBean(0) // Service line |

**Block 6** — [FOR] Valid/Invalid List Build (L573-L581)

| # | Type | Code |
|---|------|------|
| 1 | SET | cd00002Arr = svcFormBean.getDataBeanArray(CD00002DATA) // Valid/invalid code list |
| 2 | SET | umuMap = new HashMap<String, String>() // cdDiv -> cdNm mapping |
| 3 | FOR | i=0 to cd00002Arr.getCount(): cdDiv = bean.getCdDiv_14, cdNm = bean.getCdDivNm_14, umuMap.put(cdDiv, cdNm) |

**Block 7** — [IF] `bmp_um` setup (L585-L589)

| # | Type | Code |
|---|------|------|
| 1 | SET | bmp_um = CD00002_NASI // Default: not present |
| 2 | IF | svcKeiUcwkTelBean.getBmpUm_06 != null |
| 3 | SET | bmp_um = svcKeiUcwkTelBean.getBmpUm_06 |
| 4 | CALL | configPulldown(svcFormBean, CD00002DATA, BMP_UM, bmp_um) |
| 5 | SET | svcFormBean.setBmpUm_L = bmp_um |

**Block 8** — [IF/ELSE] BMP Commission Handling (ANK-3190-00-00) (L593-L641)

> Phone directory commission setup when directory is present (ARI) and operation is DENWA_HENKO or empty.

| # | Type | Code |
|---|------|------|
| 1 | IF | CD00002_ARI.equals(bmp_um) AND (IDO_DIV_DENWA_HENKO.equals(ido_div) OR ido_div is empty) |
| 2 | SET | kksv006431sc = (Map)outputMap.get("KKSV006431SC") // Phone directory commission data |
| 3 | IF | kksv006431sc != null && EKK1021A010CBSMsg1List has entries |
| 4 | SET | bmpMskmCommision = list[0].icjkn_sette_cd |
| 5 | SET | bmpMskmCommisionAmnt = list[0].icjkn_shitei_amnt |
| 6 | CALL | configPulldown(svcFormBean, CD00346DATA, BMP_MSKM_COMMISION, bmpMskmCommision) |
| 7 | IF | JIMUTE_SHITEIGAKU.equals(bmpMskmCommision) |
| 8 | SET | svcFormBean.set BMP_MSKM_COMMISION_AMNT = bmpMskmCommisionAmnt |
| 9 | ELSE | configClearPulldown(svcFormBean, BMP_MSKM_COMMISION) |

**Block 9** — [SET] Update Timestamps (L643-L674)

| # | Type | Code |
|---|------|------|
| 1 | SET | svcFormBean.setSVCKEI_UPD_DTM = svcKeiBean.getUPD_DTM_21 |
| 2 | SET | svcFormBean.setSVC_UCWK_UPD_DTM = svcKeiUcwkBean.getUPD_DTM_05 |
| 3 | SET | svcFormBean.setSVC_UCWK_TEL_UPD_DTM = svcKeiUcwkTelBean.getUPD_DTM_06 |
| 4 | SET | svcFormBean.setSVCKEIUCWKTEL_GENE_ADD_DTM = svcKeiUcwkTelBean.getGENE_ADD_DTM_06 |

**Block 10** — [SET] Issuer Number Notification (L676-L702)

| # | Type | Code |
|---|------|------|
| 1 | SET | no_tch = getTelNoTchUm() // Determine issuer notification presence |
| 2 | CALL | configPulldown(svcFormBean, CD00002DATA, HASINSHA_NO_TCH, no_tch) |
| 3 | SET | svcFormBean.setHASINSHA_NO_TCH_L = no_tch |
| 4 | SET | svcFormBean.setHNO_TCHI_INI = no_tch // For porting-out initial registration |

**Block 11** — [IF/ELSE] New Number vs Existing Number Branch (L710-L1067)

> **IF**: svcFormBean SVC_KEI_UCWK_NO is null (new phone number registration)

| # | Type | Code |
|---|------|------|
| 1 | SET | TEL_NO = "" // Clear phone number |
| 2 | SET | NRN = "" // Clear NRN |
| 3 | SET | userNmKana = okyakusamaBean.getCustKana_12 |
| 4 | SET | svcFormBean.setUSER_KANA = userNmKana |
| 5 | SET | userNmKj = okyakusamaBean.getCustNm_12 |
| 6 | SET | svcFormBean.setUSER_NM = userNmKj |
| 7 | IF | svcKeiKaisenBean != null |
| 8 | SET | svcFormBean.setAD = editAddress(svcKeiKaisenBean, STATE_NM_13, CITY_NM_13, OAZTSU_NM_13, AZCHO_NM_13, svcFormBean) |
| 9 | SET | banchiGo = svcKeiKaisenBean.getKaisenPlaceBnchigo_13 |
| 10 | SET | adTtmm = svcKeiKaisenBean.getKaisenPlaceAdrttm_13 |
| 11 | SET | adRoom = svcKeiKaisenBean.getKaisenPlaceAdrrm_13 |
| 12 | SET | svcFormBean.setADRTTM = adTtmm + adRoom // Concatenated building name + room number |
| 13 | SET | adCd = svcKeiKaisenBean.getKaisenPlaceAdCd_13 |
| 14 | SET | postCd = svcKeiKaisenBean.getKaisenPlacePcd_13 |
| 15 | SET | svc_kei_kaisen_ucwk_no = svcKeiKaisenBean.getSvcKeiKaisenUcwkNo_13 |
| 16 | ELSE (existing number path - L718) |

> **ELSE**: Existing number branch - populates all fields from existing data

| # | Type | Code |
|---|------|------|
| 1 | SET | svcFormBean.setSVC_KEI_KAISEN_UCWK_NO = svc_kei_kaisen_ucwk_no |
| 2 | SET | svcFormBean.setTEL_NO = svcKeiUcwkTelBean.getTelno_06 |
| 3 | SET | svcFormBean.setTEL_NO_BEFORE = svcKeiUcwkTelBean.getTelno_06 // ANK-1855-00-00 |
| 4 | CALL | editNrn(svcFormBean, bmp_um) |
| 5 | SET | tsjgs_cd = svcFormBean.getTsjgsCd() // Fallback from svcKeiUcwkTelBean |
| 6 | SET | userNmKana = svcKeiUcwkTelBean.getEmgKshKana_06 |
| 7 | SET | userNmKj = svcKeiUcwkTelBean.getEmgKshNm_06 |
| 8 | SET | svcFormBean.setUSER_KANA_BEFORE = userNmKana |
| 9 | SET | svcFormBean.setUSER_NM_BEFORE = userNmKj |
| 10 | SET | bean = svcFormBean.getDataBeanArray(EZM0081A010DATA).getDataBean(0) // Address data bean |
| 11 | SET | svcFormBean.setAD = editAddress(bean, STATE_NM_11, CITY_NM_11, OAZTSU_NM_11, AZCHO_NM_11, svcFormBean) |
| 12 | SET | banchiGo = svcKeiUcwkTelBean.getEmgBnchigo_06 |
| 13 | SET | adTtmm = svcKeiUcwkTelBean.getEmgAdrttm_06, adRoom = svcKeiUcwkTelBean.getEmgAdrrm_06 |
| 14 | SET | svcFormBean.setADRTTM = adTtmm + adRoom |
| 15 | SET | adCd = svcKeiUcwkTelBean.getEmgAdCd_06, postCd = svcKeiUcwkTelBean.getEmgHoseiPcd_06 |
| 16 | SET | no_guide = svcKeiUcwkTelBean.getNttNoGuideUm_06 |
| 17 | CALL | configPulldown + getDisplayNameFromPulldown for NO_GUIDE |
| 18 | SET | book_um = svcKeiUcwkTelBean.getHellopageKeisaiUm_06 |
| 19 | CALL | configPulldown + getDisplayNameFromPulldown for DNWACHO_KEISAI |
| 20 | SET | itenTalkyStaYmd = svcKeiUcwkTelBean.getItnTokiStaYmd_06 |
| 21 | SET | itenTalkyEndYmd = svcKeiUcwkTelBean.getItnTokiEndYmd_06 |
| 22 | IF | itenTalkyEndYmd == MAX_DATE (20991231), set itenTalkyEndYmd = "" |
| 23 | IF | itenTalkyEndYmd is blank AND itenTalkyEndRsvYmd from bean |
| 24 | IF | itenTalkyStaYmd is NOT blank: compute talky status |
| 25 | IF | kyo < itenTalkyStaYmd: talky = TALKY_RESERVED |
| 26 | ELSE IF | itenTalkyEndYmd is blank: talky = TALKY_ACTIVATED |
| 27 | ELSE IF | kyo < itenTalkyEndYmd: talky = TALKY_ACTIVATED |
| 28 | SET | svcFormBean.setTOKI_JOKYO = talky |
| 29 | SET | svcFormBean.setITNTOKI_END_YMD = svcKeiUcwkTelBean.getItnTokiEndRsvYmd_06 |
| 30 | IF | talky is null or empty: clear PRD_FROM and PRD_TO |
| 31 | ELSE: set PRD_FROM = itenTalkyStaYmd, PRD_TO = itenTalkyEndYmd |
| 32 | SET | svcFormBean.setKEIUW_STAT = svcKeiUcwkBean.getSvcKeiUcwkStatNm_05 |
| 33 | SET | svcFormBean.setSVC_STAYMD = svcKeiUcwkBean.getSvcStayMd_05 |
| 34 | SET | svcFormBean.setSVC_CHRG_STAYMD = svcKeiUcwkBean.getSvcChrgStayMd_05 |

**Block 11.1** — [IF] `IDO_DIV_BANGO_KAIYAKU.equals(ido_div)` [number cancellation] (L977)

> Sets service end date and charge end date to the current operating date (unyoYmd).

| # | Type | Code |
|---|------|------|
| 1 | SET | wkYear = unyoYmd.substring(0, 4) |
| 2 | SET | wkMonth = unyoYmd.substring(4, 6) |
| 3 | SET | wkDay = unyoYmd.substring(6) |
| 4 | SET | svcFormBean.setSVC_END_YEAR = wkYear, SVC_END_MON = wkMonth, SVC_END_DAY = wkDay, SVC_END_YMD = unyoYmd |
| 5 | SET | svcFormBean.setSVC_CHRG_END_YEAR = wkYear, SVC_CHRG_END_MON = wkMonth, SVC_CHRG_END_DAY = wkDay, SVC_CHRG_END_YMD = unyoYmd |

**Block 11.2** — [ELSE] [not number cancellation - extract end dates from bean] (L1018)

| # | Type | Code |
|---|------|------|
| 1 | SET | svcEndYmd = svcKeiUcwkBean.getSvcEndYmd_05 |
| 2 | IF | svcEndYmd not null and length >= 8 and not empty/MAX |
| 3 | SET | svcFormBean.setSVC_END_YEAR = svcEndYmd.substring(0,4), SVC_END_MON = substring(4,6), SVC_END_DAY = substring(6), SVC_END_YMD = svcEndYmd |
| 4 | ELSE: svcFormBean.clear SVC_END_YEAR/MON/DAY/YMD |
| 5 | SET | svcDslKisanYmd = svcKeiUcwkBean.getSvcDslKisanYmd_05 // ANK-4315-00-00: Use deregistration calculation date instead of charge end date |
| 6 | IF | svcDslKisanYmd not null and length >= 8 and not empty/MAX |
| 7 | SET | svcFormBean.setSVC_CHRG_END_YEAR = substring(0,4), SVC_CHRG_END_MON = substring(4,6), SVC_CHRG_END_DAY = substring(6), SVC_CHRG_END_YMD = svcDslKisanYmd |
| 8 | ELSE: svcFormBean.clear SVC_CHRG_END_* fields |

**Block 11.3** — [SET] Penalty and Stop Date Fields (L1106-L1150)

| # | Type | Code |
|---|------|------|
| 1 | SET | iyakuKinDiv = svcKeiUcwkBean.getPnltyHasseiCd_05 |
| 2 | CALL | configPulldown(svcFormBean, CD00002DATA, PNLTY_HASSEI_DIV, iyakuKinDiv) |
| 3 | IF | !BANGO_KAIYAKU: iyaString = getDisplayNameFromPulldown(...) |
| 4 | SET | svcFormBean.setPNLTY_HASSEI_DIV_L = iyaString |
| 5 | SET | svcStopDtm = svcKeiUcwkBean.getSvcStopYmd_05 |
| 6 | IF | svcStopDtm.length >= 8: svcFormBean.setSVC_STP_YMD = svcStopDtm.substring(0,8) |
| 7 | SET | svcStopRelDtm = svcKeiUcwkBean.getSvcStopRlsYmd_05 |
| 8 | IF | svcStopRelDtm == MAX_YMD: svcFormBean.clear SVC_STP__RLS_YMD |
| 9 | ELSE IF | svcStopRelDtm.length >= 8: svcFormBean.setSVC_STP__RLS_YMD = substring(0,8) |
| 10 | SET | denbanCd = svcKeiUcwkTelBean.getTelNoPreTchCd_06 |
| 11 | IF | denbanCd matches [0-2]: svcFormBean.setTELNO_PRE_TCHI = denbanNm[Integer.parseInt(denbanCd)] // [0="なし", 1="あり", 2="出力済"] |
| 12 | SET | svcFormBean.setMSKM_DTL_NO = svcKeiUcwkBean.getMskmDtlNo_05 |
| 13 | SET | svcFormBean.setTK_HOSHIKI_KEI_NO = svcKeiUcwkBean.getTkHosikiKeiNo_05 |

**Block 12** — [SET] VA & Port Configuration (L1069-L1075)

| # | Type | Code |
|---|------|------|
| 1 | CALL | configureVAChoicePulldown(svcFormBean, outputMap) // IK1-2013-0000147 |
| 2 | CALL | configureVAPortPulldown(svcFormBean, svcKeiUcwkTelBean) |

**Block 13** — [FOR] Phone Number History Population (L1077-L1150)

> Iterates over EKK0191BXXXDATA (phone number list) and copies each record to TELNO_RRK (history) array.

| # | Type | Code |
|---|------|------|
| 1 | SET | telLstArr = svcFormBean.getDataBeanArray(EKK0191BXXXDATA) |
| 2 | SET | rrkArr = svcFormBean.getDataBeanArray(TELNO_RRK) |
| 3 | CALL | rrkArr.clearArray() |
| 4 | SET | rireki_no_guideList = new ArrayList(), rireki_dnwachoKeisaiList = new ArrayList() |
| 5 | FOR | i=0 to telLstArr.getCount(): |
| 6 | SET | srcBean = telLstArr.getDataBean(i) |
| 7 | SET | bmp = srcBean.getBmpUm_08; bmp = empty ? CD00002_NASI : bmp |
| 8 | SET | tgtBean = rrkArr.addDataBean() |
| 9 | SET | tgtBean.setRirekiTelno_02 = srcBean.getRrkTelno_08 |
| 10 | SET | tgtBean.setRirekiBmp_02 = umuMap.get(bmp) |
| 11 | SET | tgtBean.setRirekiKeiUcwkStatNm_02 = srcBean.getRrkSvcKeiUcwkStatNm_08 |
| 12 | SET | staYmd = srcBean.getRrkSvcStayMd_08; staYmd = formatted by JPCFomatString.formatDate |
| 13 | SET | tgtBean.setRirekiSvcStayMd_02 = staYmd |
| 14 | SET | endYmd = srcBean.getRrkSvcEndYmd_08; format or empty |
| 15 | SET | tgtBean.setRirekiSvcEndYmd_02 = endYmd |
| 16 | SET | tgtBean.setRirekiNoGuide_02 = srcBean.getRrkNoGuideNm_08 |
| 17 | SET | tgtBean.setRirekiDnwachoKeisai_02 = srcBean.getRrkDnwachoKeisaiNm_08 |
| 18 | SET | rireki_no_guideList.add(i, srcBean.getRrkNoGuide_08) |
| 19 | SET | rireki_dnwachoKeisaiList.add(i, srcBean.getRrkDnwachoKeisai_08) |
| 20 | SET | csvVal = comma-separated rireki_no_guideList |
| 21 | SET | svcFormBean.setRirekiNoGuide_CSV = csvVal.toString() |
| 22 | SET | csvVal2 = comma-separated rireki_dnwachoKeisaiList |
| 23 | SET | svcFormBean.setRirekiDnwachoKeisai_CSV = csvVal2.toString() |
| 24 | IF | IDO_DIV_DENWA_TDIS.equals(ido_div) or ido_div empty: svcFormBean.setTELNO_RRK_CHOICE = "0" |

**Block 14** — [SET] Misc Initialization (L1152-L1278)

| # | Type | Code |
|---|------|------|
| 1 | SET | eKK0081A010DATA = svcFormBean.getDataBeanArray(EKK0081A010DATA).getDataBean(0) |
| 2 | SET | svcFormBean.setPRC_GRP_CD = eKK0081A010DATA.getPrCGrpCd_21 |
| 3 | SET | kkw00201Bean = svcFormBean.getDataBeanArray(HATUBAN_INPUT).getDataBean(0) |
| 4 | CALL | kkw00201Bean.clear AREACD_INF_CHOICE_03, HRADSI_TEL_NO_03, RSY_TELNO_INF_CHOICE_03, AD_CD_03 |
| 5 | IF | IDO_DIV_BANGO_HENKO.equals(ido_div): |
| 6 | CALL | bmpInputList.clearArray(), bmpInputList.addDataBean() |
| 7 | CALL | dobanitenInputList.clearArray(), dobanitenInputList.addDataBean() |
| 8 | SET | svcFormBean.setADD_JOKYO = "", DOBANITEN_KH = "", CHOSA_REQ_YMD = "" |
| 9 | CALL | actionKikiChange() // ANK-1578-00-00: Equipment change processing |

**Block 15** — [FOR] Display Contract Status Lookup (ANK-1855-00-00) (L1278-L1300)

| # | Type | Code |
|---|------|------|
| 1 | SET | ucwkIchrnList = svcFormBean.getDataBeanArray(EKK0191B001DATA) |
| 2 | FOR | i=0 to ucwkIchrnList.getCount(): srcBean = ucwkIchrnList.getDataBean(i) |
| 3 | SET | tmpSvcKeiUcwkNo = svcFormBean.getServiceContractNumber() |
| 4 | SET | svc_kei_ucwk_no = srcBean.getServiceContractNumber_30 |
| 5 | IF | tmpSvcKeiUcwkNo.equals(svc_kei_ucwk_no): |
| 6 | SET | svcFormBean.setDSP_SVC_KEI_UCWK_STAT = srcBean.getDspSvcKeiUcwkStat_30 |
| 7 | BREAK |
| 8 | SET | svc_kei_ucwk_stat = svcKeiUcwkBean.getServiceContractStatus_05 |
| 9 | SET | svcFormBean.setSVC_KEI_UCWK_STAT = svc_kei_ucwk_stat |

**Block 16** — [IF] ONU Exchange Work Check (ANK-4315-00-00) (L1300-L1308)

| # | Type | Code |
|---|------|------|
| 1 | IF | IDO_DIV_BANGO_TSUIKA.equals(ido_div) |
| 2 | SET | onuKokanKojiFlg = svcFormBean.getOnuKokanKojiFlg() |
| 3 | IF | "1".equals(onuKokanKojiFlg): JCCWebCommon.setMessageInfo(this, "EKBF810--I") |

**Block 17** — [IF] ENUM KRKE Authority (ANK-4494-00-00) (L1310-L1362)

> Number cancellation and number porting-out operations require ENUM/krke authority check.

| # | Type | Code |
|---|------|------|
| 1 | IF | IDO_DIV_BANGO_KAIYAKU.equals(ido_div) OR IDO_DIV_DENWA_BMPP_MMODOSHU.equals(ido_div) |
| 2 | SET | enumKrkeAuthority = getDispAuthority() // ANK-4494-00-00 Step2 disability management account |
| 3 | SET | svcFormBean.setENUM_KRKE_AUTHORITY_FLG = enumKrkeAuthority |
| 4 | SET | eTU0151A011DATA = svcFormBean.getDataBeanArray(ETU0151A011DATA).getDataBean(0) // Port auto agreement |
| 5 | SET | telno = eTU0151A011DATA.getEnumKrkeTelNo_32 |
| 6 | IF | telno is null or empty: |
| 7 | SET | svcFormBean.setENUM_KRKE_DOUJI = false, HIDE_ENUM_KRKE_DOUJI = false |
| 8 | ELSE: |
| 9 | SET | svcFormBean.setENUM_KRKE_DOUJI = enumKrkeAuthority, HIDE_ENUM_KRKE_DOUJI = enumKrkeAuthority |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| ido_div | Field | Operation division - determines the type of phone number operation being performed |
| BANGO_TSUIKA | Constant | Phone number addition - registering a new phone number |
| BANGO_HENKO | Constant | Phone number change - modifying an existing phone number |
| BANGO_KAIYAKU | Constant | Number cancellation - cancelling a phone number (results in service end date set to current date) |
| DENWA_HENKO | Constant | Phone change - changing the telephone line type while keeping the number |
| DENWA_TDIS | Constant | Call forwarding cancellation - cancelling call forwarding service (TDIS = Teleservice Disable) |
| DENWA_BMPP_MMODOSHU | Constant | Number porting-out - porting out to a different carrier (BMPP = Basic Mobile Portability) |
| KKSV0051 | Screen/Service | Service call screen - the screen that invokes the KKSV0051 service before calling this method |
| KKW00147 | Screen | Telephone Number Registration screen - the primary screen for telephone number operations |
| svcFormBean | Parameter | Service form bean - holds all display fields for the KKW00147 screen |
| outputMap | Parameter | Output map from caller - carries intermediate results (KKSV006401CC parentMap, KKSV006431SC) |
| JIMU_TESURYO_NASI | Constant | No service commission - the default/empty commission value |
| JIMUTE_SHITEIGAKU | Constant | Specified commission amount - when commission type is a fixed amount |
| CD00002_ARI / CD00002_NASI | Constants | Yes/No for phone directory presence (1=Yes/ARI, 0=No/NASI) |
| BMP_UM | Field | Phone directory (Meibo) presence flag - whether the number is listed in the phone directory |
| EKK0081A010DATA | Constant | Service contract bean - core service contract data entity |
| EKK0161A010DATA | Constant | Service contract agreement bean - agreement/consent data for service contracts |
| EKK0191A010DATA | Constant | eo Phone agreement bean - specifically for eo Hikari Denwa service agreements |
| ECK0011A010DATA | Constant | Customer agreement bean - customer (okyakusama) consent/agreement data |
| EKK0251ZXXXDATA | Constant | Service line configuration bean - line location and configuration data |
| EKK0191BXXXDATA | Constant | Phone number list bean - contains historical phone number entries |
| TELNO_RRK | Constant | Telephone number history bean array - populated with phone number history records |
| EKK0191B001DATA | Constant | Service contract agreement eo phone list - for matching display contract status |
| EKK0251ZXXXDATA | Constant | Service line bean - contains line location address components |
| EZM0081A010DATA | Constant | Address data bean - used for address formatting in existing number branch |
| EKK0081A010DATA | Constant | Service contract bean - core service contract data |
| ETU0151A011DATA | Constant | Port auto agreement data bean - ENUM/krke port authorization data |
| HATUBAN_INPUT | Constant | Banban (phone number issuance) screen input bean - initialized for phone number issuance operations |
| BMP_INPUT | Constant | Meibo (phone directory) input bean - cleared and re-added during BANGO_HENKO |
| DOBANITEN_INPUT | Constant | Tobaniten (same number forwarding) input bean |
| icjkn_sette_cd | Field | Temporary payment settings agreement code - commission/payment type code from EKK1021B001CBSMsg1List |
| icjkn_shitei_amnt | Field | Temporary payment settings specified amount - commission amount |
| svc_kei_ucwk_no | Field | Service detail work number - unique internal tracking ID for service contract line items |
| svc_kei_kaisen_ucwk_no | Field | Service line detail work number - tracking ID for specific service line configuration |
| upd_dtm | Field | Update date/time - timestamp of the last modification |
| gen_add_dtm | Field | Generation addition date/time - when the service line was originally created |
| prc_grp_cd | Field | Price group code - pricing tier for the service contract |
| no_guide | Field | Phone number guide - NTT phone directory guidance flag |
| book_um | Field | Phone book publication - Hello Page directory publication flag |
| tokijokyo | Field | Call forwarding status - displays RESERVED, ACTIVATED, or blank |
| prd_from / prd_to | Fields | Service period from/to - call forwarding service period range |
| keiuw_stat | Field | Contract status name - human-readable display of service contract state |
| svc_staymd / svc_chrg_staymd | Fields | Service start date / charge start date |
| svc_end_ymd / svc_chrg_end_ymd | Fields | Service end date / charge end date (deregistration calculation date after OT-2013-0000579) |
| svc_end_year/mon/day | Fields | Service end date components (year, month, day) |
| svc_chrg_end_year/mon/day | Fields | Charge end date components (year, month, day) |
| pnlty_hassei_div | Field | Penalty occurrence division - whether termination penalty applies |
| svc_stop_ymd / svc_stp__rls_ymd | Fields | Service stop date / Service stop release date |
| telno_pre_tchi | Field | Phone number prior notification - pre-notification status (0=none, 1=present, 2=output complete) |
| tk_hosiki_kei_no | Field | Provision method contract number - service provision method contract ID |
| kikai_kokan_koji_flg | Field | ONU exchange work flag - 1 indicates ONU exchange work is required (ANK-4315-00-00) |
| enum_krke_authority_flg | Field | ENUM/krke display authority flag - disability management account No.100 control (ANK-4494-00-00) |
| enum_krke_douji | Field | ENUM/krke simultaneous authorization flag |
| hide_enum_krke_douji | Field | Hide ENUM/krke simultaneous authorization flag |
| unyoYmd | Variable | Operating date in YYYYMMDD format |
| MAX_DATE | Constant | "20991231" - maximum date used to indicate "not set" or "ongoing" |
| JKKCommonConst.MAX_YMD | Constant | Maximum date constant (20991231) |
| TALKY_RESERVED | Constant | "Transfer reserved" (Tokiiyaku-chu) - call forwarding is scheduled but not yet active |
| TALKY_ACTIVATED | Constant | "Transfer in progress" (Tokijikkochu) - call forwarding is currently active |
| umuMap | Variable | Map of valid/invalid code division to code division name, used for phone directory display |
| rireki_no_guideList / rireki_dnwacho_keisaiList | Variables | Lists for CSV hidden values of phone number guide and phone book publication history |
| jimuCommision | Variable | Service commission code for commission/pulldown display |
| jimuCommisionAmnt | Variable | Service commission specified amount |
| bmpMskmCommision / bmpMskmCommisionAmnt | Variables | Phone directory application commission code and amount |
| itenTalkyStaYmd / itenTalkyEndYmd | Variables | Call forwarding start/end date (from svcKeiUcwkTelBean) |
| itenTalkyEndRsvYmd | Variable | Call forwarding end reservation date (fallback when endYmd is blank) |
| denbanNm | Array | Display name array for phone number prior notification: ["none", "present", "output complete"] |
| adTtmm / adRoom | Variables | Address component: building name / room number - concatenated for ADRTTM display |
| userNmKana / userNmKj | Variables | User name in Kana (hiragana/katakana) and Kanji respectively |
| kyo | Variable | Current operating date parsed as long for numeric comparison |
| no_tch | Variable | Issuer number notification presence flag |
| tsjgs_cd | Variable | Telecom service code |
| bmp_um | Variable | Phone directory presence (after resolving from bean) |
| svcStopDtm / svcStopRelDtm | Variables | Service stop date and stop release date |
| iyakuKinDiv | Variable | Penalty occurrence division code |
| denbanCd | Variable | Phone number prior notification code (0-2) |
| svcEndYmd / svcDslKisanYmd | Variables | Service end date / service deregistration calculation date |
| dsp_svc_kei_ucwk_stat | Variable | Display service contract status (from matched record) |
| svc_kei_ucwk_stat | Variable | Service contract status code |
| onuKokanKojiFlg | Variable | ONU exchange work flag |
| enumKrkeAuthority | Variable | ENUM/krke authority boolean |
| telno | Variable | Phone number from port auto agreement bean |
| csvVal / csvVal2 | Variables | CSV builder strings for hidden form values |
